Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-rm
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-rm
  • Repository
Switch branch/tag
  • linux-rm
  • tools
  • lib
  • perf
  • cpumap.c
Find file BlameHistoryPermalink
  • Riccardo Mancini's avatar
    libperf cpumap: Take into advantage it is sorted to optimize perf_cpu_map__max() · 6e93bc53
    Riccardo Mancini authored Aug 21, 2021
    From commit 7074674e
    
     ("perf cpumap: Maintain cpumaps ordered and
    without dups"), perf_cpu_map elements are sorted in ascending order.
    
    This patch improves the perf_cpu_map__max function by returning the last
    element.
    
    Committer notes:
    
    Do it as a ternary to keep it in just one return line, add a comment
    explaining it is sorted and what functions does it.
    
    Signed-off-by: default avatarRiccardo Mancini <rickyman7@gmail.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lore.kernel.org/lkml/fb79f02e7b86ea8044d563adb1e9890c906f982f.1629490974.git.rickyman7@gmail.com
    
    
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    6e93bc53