perf.data-directory-format.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. perf.data directory format
  2. DISCLAIMER This is not ABI yet and is subject to possible change
  3. in following versions of perf. We will remove this
  4. disclaimer once the directory format soaks in.
  5. This document describes the on-disk perf.data directory format.
  6. The layout is described by HEADER_DIR_FORMAT feature.
  7. Currently it holds only version number (0):
  8. HEADER_DIR_FORMAT = 24
  9. struct {
  10. uint64_t version;
  11. }
  12. The current only version value 0 means that:
  13. - there is a single perf.data file named 'data' within the directory.
  14. e.g.
  15. $ tree -ps perf.data
  16. perf.data
  17. └── [-rw------- 25912] data
  18. Future versions are expected to describe different data files
  19. layout according to special needs.
  20. Currently the only 'perf record' option to output to a directory is
  21. the --kcore option which puts a copy of /proc/kcore into the directory.
  22. e.g.
  23. $ sudo perf record --kcore uname
  24. Linux
  25. [ perf record: Woken up 1 times to write data ]
  26. [ perf record: Captured and wrote 0.015 MB perf.data (9 samples) ]
  27. $ sudo tree -ps perf.data
  28. perf.data
  29. ├── [-rw------- 23744] data
  30. └── [drwx------ 4096] kcore_dir
  31. ├── [-r-------- 6731125] kallsyms
  32. ├── [-r-------- 40230912] kcore
  33. └── [-r-------- 5419] modules
  34. 1 directory, 4 files
  35. $ sudo perf script -v
  36. build id event received for vmlinux: 1eaa285996affce2d74d8e66dcea09a80c9941de
  37. build id event received for [vdso]: 8bbaf5dc62a9b644b4d4e4539737e104e4a84541
  38. build id event received for /lib/x86_64-linux-gnu/libc-2.28.so: 5b157f49586a3ca84d55837f97ff466767dd3445
  39. Samples for 'cycles' event do not have CPU attribute set. Skipping 'cpu' field.
  40. Using CPUID GenuineIntel-6-8E-A
  41. Using perf.data/kcore_dir/kcore for kernel data
  42. Using perf.data/kcore_dir/kallsyms for symbols
  43. perf 15316 2060795.480902: 1 cycles: ffffffffa2caa548 native_write_msr+0x8 (vmlinux)
  44. perf 15316 2060795.480906: 1 cycles: ffffffffa2caa548 native_write_msr+0x8 (vmlinux)
  45. perf 15316 2060795.480908: 7 cycles: ffffffffa2caa548 native_write_msr+0x8 (vmlinux)
  46. perf 15316 2060795.480910: 119 cycles: ffffffffa2caa54a native_write_msr+0xa (vmlinux)
  47. perf 15316 2060795.480912: 2109 cycles: ffffffffa2c9b7b0 native_apic_msr_write+0x0 (vmlinux)
  48. perf 15316 2060795.480914: 37606 cycles: ffffffffa2f121fe perf_event_addr_filters_exec+0x2e (vmlinux)
  49. uname 15316 2060795.480924: 588287 cycles: ffffffffa303a56d page_counter_try_charge+0x6d (vmlinux)
  50. uname 15316 2060795.481067: 2261945 cycles: ffffffffa301438f kmem_cache_free+0x4f (vmlinux)
  51. uname 15316 2060795.481643: 2172167 cycles: 7f1a48c393c0 _IO_un_link+0x0 (/lib/x86_64-linux-gnu/libc-2.28.so)