• Adrian Hunter's avatar
    perf record: Add finished init event · 3812d298
    Adrian Hunter authored
    In preparation for recording sideband events in a virtual machine guest so
    that they can be injected into a host perf.data file.
    
    This is needed to enable injecting events after the initial synthesized
    user events (that have an all zero id sample) but before regular events.
    
    Committer notes:
    
    Add entry about PERF_RECORD_FINISHED_INIT to
    tools/perf/Documentation/perf.data-file-format.txt.
    
    Committer testing:
    
    Before:
    
      # perf report -D | grep FINISHED
      0 0x5910 [0x8]: PERF_RECORD_FINISHED_ROUND
        FINISHED_ROUND events:          1  ( 0.5%)
      #
    
    After:
    
      # perf record -- sleep 1
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.020 MB perf.data (7 samples) ]
      # perf report -D | grep FINISHED
      0 0x5068 [0x8]: PERF_RECORD_FINISHED_INIT: unhandled!
      0 0x5390 [0x8]: PERF_RECORD_FINISHED_ROUND
        FINISHED_ROUND events:          1  ( 0.5%)
         FINISHED_INIT events:          1  ( 0.5%)
      #
    Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
    Acked-by: default avatarIan Rogers <irogers@google.com>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: https://lore.kernel.org/r/20220610113316.6682-5-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    3812d298
builtin-inject.c 32.8 KB