• Namhyung Kim's avatar
    perf tools: Add mode argument to sort_help() · 871893d7
    Namhyung Kim authored
    Some sort keys are meaningful only in a specific mode - like branch
    stack and memory (data-src).  Add the mode to skip unnecessary ones.
    This will be used for 'perf mem report' later.
    
    While at it, change the prefix for the -F/--fields option to remove
    the duplicate part.
    
    Before:
    
      $ perf report -F
       Error: switch `F' requires a value
       Usage: perf report [<options>]
    
          -F, --fields <key[,keys...]>
      			  output field(s): overhead period sample  overhead overhead_sys
      			  overhead_us overhead_guest_sys overhead_guest_us overhead_children
      			  sample period weight1 weight2 weight3 ins_lat retire_lat
      			  ...
    After:
    
      $ perf report -F
       Error: switch `F' requires a value
       Usage: perf report [<options>]
    
          -F, --fields <key[,keys...]>
      			  output field(s): overhead overhead_sys overhead_us
      			  overhead_guest_sys overhead_guest_us overhead_children
      			  sample period weight1 weight2 weight3 ins_lat retire_lat
      			  ...
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Link: https://lore.kernel.org/r/20240731235505.710436-5-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    871893d7
sort.h 3.75 KB