perf: change count variable type to ihk_atomic64_t
Change-Id: I2bb6fab2c040683830b44fa6b963a86a233b883a
This commit is contained in:
@ -1139,7 +1139,9 @@ void sync_child_event(struct mc_perf_event *event)
|
|||||||
ihk_mc_perfctr_read(leader->counter_id);
|
ihk_mc_perfctr_read(leader->counter_id);
|
||||||
}
|
}
|
||||||
else if (leader->pid > 0) {
|
else if (leader->pid > 0) {
|
||||||
leader->count = ihk_mc_perfctr_read(leader->counter_id);
|
uint64_t count = ihk_mc_perfctr_read(leader->counter_id);
|
||||||
|
|
||||||
|
ihk_atomic64_set(&leader->count, count);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return; // Error
|
return; // Error
|
||||||
@ -1150,7 +1152,9 @@ void sync_child_event(struct mc_perf_event *event)
|
|||||||
ihk_mc_perfctr_read(sub->counter_id);
|
ihk_mc_perfctr_read(sub->counter_id);
|
||||||
}
|
}
|
||||||
else if (event->pid > 0) {
|
else if (event->pid > 0) {
|
||||||
sub->count = ihk_mc_perfctr_read(sub->counter_id);
|
uint64_t count = ihk_mc_perfctr_read(sub->counter_id);
|
||||||
|
|
||||||
|
ihk_atomic64_set(&sub->count, count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3955,7 +3959,7 @@ unsigned long perf_event_read_value(struct mc_perf_event *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rtn_count += event->count + pmc_count;
|
rtn_count += ihk_atomic64_read(&event->count) + pmc_count;
|
||||||
|
|
||||||
if(event->attr.inherit)
|
if(event->attr.inherit)
|
||||||
rtn_count += event->child_count_total;
|
rtn_count += event->child_count_total;
|
||||||
@ -4534,7 +4538,7 @@ static int mc_perf_event_alloc(struct mc_perf_event **out,
|
|||||||
|
|
||||||
event->sample_freq = attr->sample_freq;
|
event->sample_freq = attr->sample_freq;
|
||||||
event->nr_siblings = 0;
|
event->nr_siblings = 0;
|
||||||
event->count = 0L;
|
ihk_atomic64_set(&event->count, 0);
|
||||||
event->child_count_total = 0;
|
event->child_count_total = 0;
|
||||||
event->parent = NULL;
|
event->parent = NULL;
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include <list.h>
|
#include <list.h>
|
||||||
#include <march.h>
|
#include <march.h>
|
||||||
|
#include <ihk/atomic.h>
|
||||||
|
|
||||||
struct perf_event_attr;
|
struct perf_event_attr;
|
||||||
|
|
||||||
@ -272,7 +273,7 @@ struct mc_perf_event {
|
|||||||
enum perf_event_state state;
|
enum perf_event_state state;
|
||||||
int cpu_id;
|
int cpu_id;
|
||||||
int counter_id; // counter_id
|
int counter_id; // counter_id
|
||||||
unsigned long count; // counter_value
|
ihk_atomic64_t count; // counter_value
|
||||||
unsigned long child_count_total; // child_counter_value
|
unsigned long child_count_total; // child_counter_value
|
||||||
unsigned long pmc_status;
|
unsigned long pmc_status;
|
||||||
unsigned long sample_freq;
|
unsigned long sample_freq;
|
||||||
|
|||||||
Reference in New Issue
Block a user