Extend the capability of the IOCTL mechanism to filter allocations based on tag's module name, function name, file name and line number.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -45,8 +45,32 @@ struct allocinfo_tag_data { · 44 unmodified lines | |||
| 45 | struct allocinfo_counter counter; | 45 | struct allocinfo_counter counter; |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | enum { | ||
| 49 | ALLOCINFO_FILTER_MODNAME, | ||
| 50 | ALLOCINFO_FILTER_FUNCTION, | ||
| 51 | ALLOCINFO_FILTER_FILENAME, | ||
| 52 | ALLOCINFO_FILTER_LINENO, | ||
| 53 | __ALLOCINFO_FILTER_LAST = ALLOCINFO_FILTER_LINENO | ||
| 54 | }; | ||
| 55 | |||
| 56 | #define ALLOCINFO_FILTER_MASK_MODNAME (1 << ALLOCINFO_FILTER_MODNAME) | ||
| 57 | #define ALLOCINFO_FILTER_MASK_FUNCTION (1 << ALLOCINFO_FILTER_FUNCTION) | ||
| 58 | #define ALLOCINFO_FILTER_MASK_FILENAME (1 << ALLOCINFO_FILTER_FILENAME) | ||
| 59 | #define ALLOCINFO_FILTER_MASK_LINENO (1 << ALLOCINFO_FILTER_LINENO) | ||
| 60 | |||
| 61 | #define ALLOCINFO_FILTER_MASKS \ | ||
| 62 | ((1 << (__ALLOCINFO_FILTER_LAST + 1)) - 1) | ||
| 63 | |||
| 64 | struct allocinfo_filter { | ||
| 65 | __u64 mask; /* bitmask of the filter fields used */ | ||
| 66 | struct allocinfo_tag fields; | ||
| 67 | }; | ||
| 68 | |||
| 48 | struct allocinfo_get_at { | 69 | struct allocinfo_get_at { |
| 49 | __u64 pos; /* input */ | 70 | /* inputs */ |
| 71 | __u64 pos; | ||
| 72 | struct allocinfo_filter filter; | ||
| 73 | /* output */ | ||
| 50 | struct allocinfo_tag_data data; | 74 | struct allocinfo_tag_data data; |
| 51 | }; | 75 | }; |
| 52 | 76 | ||