Adds a new PERF_RECORD_MMAP2 record type which is essence an expanded version of PERF_RECORD_MMAP. Used to request mmap records with more information about the mapping, including device major, minor and the inode number and generation for mappings associated with files or shared memory segments. Works for code and data (with attr->mmap_data set). Existing PERF_RECORD_MMAP record is unmodified by this patch.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -276,8 +276,9 @@ struct perf_event_attr { · 275 unmodified lines | |||
| 276 | 276 | ||
| 277 | exclude_callchain_kernel : 1, /* exclude kernel callchains */ | 277 | exclude_callchain_kernel : 1, /* exclude kernel callchains */ |
| 278 | exclude_callchain_user : 1, /* exclude user callchains */ | 278 | exclude_callchain_user : 1, /* exclude user callchains */ |
| 279 | mmap2 : 1, /* include mmap with inode data */ | ||
| 279 | 280 | ||
| 280 | __reserved_1 : 41; | 281 | __reserved_1 : 40; |
| 281 | 282 | ||
| 282 | union { | 283 | union { |
| 283 | __u32 wakeup_events; /* wakeup every n events */ | 284 | __u32 wakeup_events; /* wakeup every n events */ |
| @@ -651,6 +652,27 @@ enum perf_event_type { · 367 unmodified lines | |||
| 651 | */ | 652 | */ |
| 652 | PERF_RECORD_SAMPLE = 9, | 653 | PERF_RECORD_SAMPLE = 9, |
| 653 | 654 | ||
| 655 | /* | ||
| 656 | * The MMAP2 records are an augmented version of MMAP, they add | ||
| 657 | * maj, min, ino numbers to be used to uniquely identify each mapping | ||
| 658 | * | ||
| 659 | * struct { | ||
| 660 | * struct perf_event_header header; | ||
| 661 | * | ||
| 662 | * u32 pid, tid; | ||
| 663 | * u64 addr; | ||
| 664 | * u64 len; | ||
| 665 | * u64 pgoff; | ||
| 666 | * u32 maj; | ||
| 667 | * u32 min; | ||
| 668 | * u64 ino; | ||
| 669 | * u64 ino_generation; | ||
| 670 | * char filename[]; | ||
| 671 | * struct sample_id sample_id; | ||
| 672 | * }; | ||
| 673 | */ | ||
| 674 | PERF_RECORD_MMAP2 = 10, | ||
| 675 | |||
| 654 | PERF_RECORD_MAX, /* non-ABI */ | 676 | PERF_RECORD_MAX, /* non-ABI */ |
| 655 | }; | 677 | }; |
| 656 | 678 | ||