Adjust event counters to report only new events

Previously, RSMI assumed that the event counter values returned
from perf were only new events. But in fact, when we read the
counter values, they are running totals. To account for this, we
now record the value we read and take the difference between the
current value and the previously recorded value.

Change-Id: I1e04b514e89c7c4d4719889f2dae3a1283864e7f
This commit is contained in:
Chris Freehill
2021-02-24 11:02:17 -06:00
parent 11440536cf
commit ce475b009c
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ class Event {
uint32_t dev_ind_;
int32_t fd_;
perf_event_attr attr_;
uint64_t prev_cntr_val_;
int32_t get_event_file_info(void);
int32_t get_event_type(uint32_t *ev_type);
};