• Namhyung Kim's avatar
    perf bench: Add build-id injection benchmark · 0bf02a0d
    Namhyung Kim authored
    Sometimes I can see that 'perf record' piped with 'perf inject' take a
    long time processing build-ids.
    
    So introduce a inject-build-id benchmark to the internals benchmark
    suite to measure its overhead regularly.
    
    It runs the 'perf inject' command internally and feeds the given number
    of synthesized events (MMAP2 + SAMPLE basically).
    
      Usage: perf bench internals inject-build-id <options>
    
        -i, --iterations <n>  Number of iterations used to compute average (default: 100)
        -m, --nr-mmaps <n>    Number of mmap events for each iteration (default: 100)
        -n, --nr-samples <n>  Number of sample events per mmap event (default: 100)
        -v, --verbose         be more verbose (show iteration count, DSO name, etc)
    
    By default, it measures average processing time of 100 MMAP2 events
    and 10000 SAMPLE events.  Below is a result on my laptop.
    
      $ perf bench internals inject-build-id
      # Running 'internals/inject-build-id' benchmark:
        Average build-id injection to...
    0bf02a0d
builtin-bench.c 8.13 KB