• Jiri Olsa's avatar
    perf data: Add support to store time of day in CTF data conversion · 88371c58
    Jiri Olsa authored
    Adad support to convert and store time of day in CTF data conversion for
    'perf data convert' subcommand.
    
    The perf.data used for conversion needs to have clock data information -
    must be recorded with -k/--clockid option).
    
    New --tod option is added to 'perf data convert' subcommand to convert
    data with timestamps converted to wall clock time.
    
    Record data with clockid set:
    
      # perf record -k CLOCK_MONOTONIC kill
      kill: not enough arguments
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.033 MB perf.data (8 samples) ]
    
    Convert data with TOD timestamps:
    
      # perf data convert --tod --to-ctf ./ctf
      [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
      [ perf data convert: Converted and wrote 0.000 MB (8 samples) ]
    
    Display data in perf script:
    
      # perf script -F+tod --ns
                perf 262150 2020-07-13 18:38:50.097678523 153633.958246159:          1 cycles: ...
                perf 26...
    88371c58
builtin-data.c 2.89 KB