I am trying to read RDT counters, which are llc_occupancy,llc_local_bytes,total_bytes.
These counters are available via perf list, as intel_cqm/llc_occupancy , intel_cqm/llc_local_bytes/,intel_cqm_total_bytes/
I was able to read data via these counters using perf stat.
How can I read these counter values for a specific process "P", using perf_event_open.
I did the following, and it didn't help much
perf stat -e intel_cqm/llc_occupancy/ -a -p 5816 -vv
and used the same perf_event_attr parameters in the perf_event_open, and the api didn't get the counters.
Also, I noticed that, when I execute the above command, it returns with
sys_perf_event_open: pid 5816 cpu -1 group_fd -1 flags 0x8
sys_perf_event_open failed, error -22
which is an invalid argument, however at the end of the command, it displays the llc occupancy.
Is it possible to read the RDT counters for a specific process id?