diff options
| author | Reinette Chatre <reinette.chatre@intel.com> | 2026-04-03 18:56:08 -0700 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2026-05-04 18:40:02 -0600 |
| commit | da707d9fedabf71d1973543f0cf244d2ef597c0d (patch) | |
| tree | 0fe1117d7093800d2fdbfc447cea20f4add1851e /tools/testing/selftests/resctrl/resctrl.h | |
| parent | ca2e4f4ba15a00218bff3b89ff57b20d0164de0a (diff) | |
| download | linux-da707d9fedabf71d1973543f0cf244d2ef597c0d.tar.gz linux-da707d9fedabf71d1973543f0cf244d2ef597c0d.zip | |
selftests/resctrl: Simplify perf usage in CAT test
The CAT test relies on the PERF_COUNT_HW_CACHE_MISSES event to determine if
modifying a cache portion size is successful. This event is configured to
report the data as part of an event group, but no other events are added to
the group.
Remove the unnecessary PERF_FORMAT_GROUP format setting. This eliminates
the need for struct perf_event_read and results in read() of the associated
file descriptor to return just one value associated with the
PERF_COUNT_HW_CACHE_MISSES event of interest.
Link: https://lore.kernel.org/r/fb69325eba5031b735fa79effaaacd797c9c6040.1775266384.git.reinette.chatre@intel.com
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/resctrl/resctrl.h')
| -rw-r--r-- | tools/testing/selftests/resctrl/resctrl.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 3bad2d80c09b..175101022bf3 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -148,13 +148,6 @@ struct resctrl_val_param { struct fill_buf_param *fill_buf; }; -struct perf_event_read { - __u64 nr; /* The number of events */ - struct { - __u64 value; /* The value of the event */ - } values[2]; -}; - /* * Memory location that consumes values compiler must not optimize away. * Volatile ensures writes to this location cannot be optimized away by @@ -210,11 +203,9 @@ unsigned int count_bits(unsigned long n); int snc_kernel_support(void); void perf_event_attr_initialize(struct perf_event_attr *pea, __u64 config); -void perf_event_initialize_read_format(struct perf_event_read *pe_read); int perf_open(struct perf_event_attr *pea, pid_t pid, int cpu_no); int perf_event_reset_enable(int pe_fd); -int perf_event_measure(int pe_fd, struct perf_event_read *pe_read, - const char *filename, pid_t bm_pid); +int perf_event_measure(int pe_fd, const char *filename, pid_t bm_pid); int measure_llc_resctrl(const char *filename, pid_t bm_pid); int minimize_l2_occupancy(const struct resctrl_test *test, const struct user_params *uparams, |
