• Ian Rogers's avatar
    perf kmem: Pass additional arguments to 'perf record' · be8299e4
    Ian Rogers authored
    'perf kmem' has an input file option but current an output file option
    fails:
    
      $ sudo perf kmem record -o /tmp/p.data sleep 1  
       Error: unknown switch `o'
    
      Usage: perf kmem [<options>] {record|stat}
    
         -f, --force           don't complain, do it
         -i, --input <file>    input file name
         -l, --line <num>      show n lines
         -s, --sort <key[,key2...]>
                               sort by keys: ptr, callsite, bytes, hit, pingpong, frag, page, order, mig>
         -v, --verbose         be more verbose (show symbol address, etc)
             --alloc           show per-allocation statistics
             --caller          show per-callsite statistics
             --live            Show live page stat
             --page            Analyze page allocator
             --raw-ip          show raw ip instead of symbol
             --slab            Analyze slab allocator
             --time <str>      Time span of interest (start,stop)
    
    'perf sched' is similar in implementation and avoids the problem by
    passing additional arguments to 'perf record'.
    
    This change makes 'perf kmem' parse command line options consistently
    with 'perf sched', although neither actually list that -o is a supported
    option.
    Signed-off-by: default avatarIan Rogers <irogers@google.com>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.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>
    Cc: Stephane Eranian <eranian@google.com>
    Link: http://lore.kernel.org/lkml/20200708183919.4141023-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    be8299e4
builtin-kmem.c 45.6 KB