linux/tools
Jiri Olsa 88371c5898 perf data: Add support to store time of day in CTF data conversion
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 262150 2020-07-13 18:38:50.097682941 153633.958250577:          1 cycles: ...
            perf 262150 2020-07-13 18:38:50.097684997 153633.958252633:          7 cycles: ...
  ...

Display data in babeltrace:

  # babeltrace --clock-date  ./ctf
  [2020-07-13 18:38:50.097678523] (+?.?????????) cycles: { cpu_id = 0 }, { perf_ip = 0xFFF ...
  [2020-07-13 18:38:50.097682941] (+0.000004418) cycles: { cpu_id = 0 }, { perf_ip = 0xFFF ...
  [2020-07-13 18:38:50.097684997] (+0.000002056) cycles: { cpu_id = 0 }, { perf_ip = 0xFFF ...
  ...

It's available only for recording with clockid specified, because it's
the only case where we can get reference time to wallclock time. It's
can't do that with perf clock yet.

Error is display if you want to use --tod on data without clockid
specified:

  # perf data convert --tod --to-ctf ./ctf
  Can't provide --tod time, missing clock data. Please record with -k/--clockid option.
  Failed to setup CTF writer.
  Error during conversion setup.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Geneviève Bastien <gbastien@versatic.net>
Cc: Ian Rogers <irogers@google.com>
Cc: Jeremie Galarneau <jgalar@efficios.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lore.kernel.org/lkml/20200805093444.314999-6-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-08-06 09:43:37 -03:00
..
accounting SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
arch tools arch kvm: Sync kvm headers with the kernel sources 2020-07-17 09:39:16 -03:00
bootconfig tools/bootconfig: Add testcase for show-command and quotes test 2020-06-16 21:21:03 -04:00
bpf Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-08-05 20:13:21 -07:00
build Mgerge remote-tracking branch 'torvalds/master' into perf/core 2020-08-06 08:15:47 -03:00
cgroup iocost_monitor: start from the oldest usage index 2020-07-30 11:45:29 -06:00
debugging
edid
firewire
firmware
gpio tools: gpio: fix spurious close warning in gpio-event-mon 2020-07-12 10:22:01 +02:00
hv
iio .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
include Mgerge remote-tracking branch 'torvalds/master' into perf/core 2020-08-06 08:15:47 -03:00
io_uring io_uring: change the poll type to be 32-bits 2020-06-21 20:44:00 -06:00
kvm/kvm_stat tools/kvm_stat: add sample systemd unit file 2020-04-21 09:13:12 -04:00
laptop change email address for Pali Rohár 2020-04-10 15:36:22 -07:00
leds .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
lib tools lib traceevent: Handle possible strdup() error in tep_add_plugin_path() API 2020-08-06 09:27:50 -03:00
memory-model These were the main changes in this cycle: 2020-08-03 14:39:35 -07:00
nfsd
objtool Misc updates: 2020-08-03 14:45:33 -07:00
pci tools: PCI: Add 'e' to clear IRQ 2020-04-02 17:57:10 +01:00
pcmcia .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
perf perf data: Add support to store time of day in CTF data conversion 2020-08-06 09:43:37 -03:00
power ACPI updates for 5.9-rc1 2020-08-03 20:37:22 -07:00
scripts Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-25 18:58:11 -07:00
spi spi: tools: Make default_tx/rx and input_tx static 2020-06-11 16:27:24 +01:00
testing Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-08-05 20:13:21 -07:00
thermal/tmon - Convert tsens configuration DT binding to yaml (Rajeshwari) 2020-04-07 20:00:16 -07:00
time
usb tools: usb: usbip: Replace HTTP links with HTTPS ones 2020-07-15 16:33:51 +02:00
virtio compiler: Remove uninitialized_var() macro 2020-07-16 12:35:31 -07:00
vm tools/vm/page_owner_sort.c: filter out unneeded line 2020-06-03 20:09:49 -07:00
wmi
Makefile bpf: Compile resolve_btfids tool at kernel compilation start 2020-07-13 10:42:02 -07:00