aboutsummaryrefslogtreecommitdiff
path: root/drivers/gator/gator_events_perf_pmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gator/gator_events_perf_pmu.c')
-rw-r--r--drivers/gator/gator_events_perf_pmu.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/gator/gator_events_perf_pmu.c b/drivers/gator/gator_events_perf_pmu.c
index f6b4f18ad11a..e62492bbd536 100644
--- a/drivers/gator/gator_events_perf_pmu.c
+++ b/drivers/gator/gator_events_perf_pmu.c
@@ -136,6 +136,7 @@ static int gator_events_perf_pmu_online(int **buffer, bool migrate)
static void __online_dispatch(int cpu, bool migrate, struct gator_attr *const attr, struct gator_event *const event)
{
perf_overflow_handler_t handler;
+ struct perf_event *pevent;
event->zero = true;
@@ -148,22 +149,22 @@ static void __online_dispatch(int cpu, bool migrate, struct gator_attr *const at
handler = dummy_handler;
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
- event->pevent = perf_event_create_kernel_counter(event->pevent_attr, cpu, 0, handler);
+ pevent = perf_event_create_kernel_counter(event->pevent_attr, cpu, 0, handler);
#else
- event->pevent = perf_event_create_kernel_counter(event->pevent_attr, cpu, 0, handler, 0);
+ pevent = perf_event_create_kernel_counter(event->pevent_attr, cpu, 0, handler, 0);
#endif
- if (IS_ERR(event->pevent)) {
- pr_debug("gator: unable to online a counter on cpu %d\n", cpu);
- event->pevent = NULL;
+ if (IS_ERR(pevent)) {
+ pr_err("gator: unable to online a counter on cpu %d\n", cpu);
return;
}
- if (event->pevent->state != PERF_EVENT_STATE_ACTIVE) {
- pr_debug("gator: inactive counter on cpu %d\n", cpu);
- perf_event_release_kernel(event->pevent);
- event->pevent = NULL;
+ if (pevent->state != PERF_EVENT_STATE_ACTIVE) {
+ pr_err("gator: inactive counter on cpu %d\n", cpu);
+ perf_event_release_kernel(pevent);
return;
}
+
+ event->pevent = pevent;
}
static void gator_events_perf_pmu_online_dispatch(int cpu, bool migrate)
@@ -369,6 +370,7 @@ static int gator_events_perf_pmu_read(int **buffer, bool sched_switch)
}
static struct gator_interface gator_events_perf_pmu_interface = {
+ .name = "perf_pmu",
.create_files = gator_events_perf_pmu_create_files,
.start = gator_events_perf_pmu_start,
.stop = gator_events_perf_pmu_stop,
@@ -463,10 +465,10 @@ static void gator_events_perf_pmu_cci_400_init(const int type)
cci_name = "CCI_400";
break;
case 1:
- cci_name = "CCI_400-r1";
+ cci_name = "CCI_400_r1";
break;
default:
- pr_debug("gator: unrecognized cci-400 revision\n");
+ pr_err("gator: unrecognized cci-400 revision\n");
return;
}
@@ -536,14 +538,19 @@ int gator_events_perf_pmu_init(void)
}
if (pe->pmu != NULL && type == pe->pmu->type) {
- if (strcmp("CCI", pe->pmu->name) == 0 || strcmp("CCI_400", pe->pmu->name) == 0 || strcmp("CCI_400-r1", pe->pmu->name) == 0) {
+ pr_notice("gator: perf pmu: %s\n", pe->pmu->name);
+ if (strcmp("CCI", pe->pmu->name) == 0 || strcmp("CCI_400", pe->pmu->name) == 0 || strcmp("CCI_400_r1", pe->pmu->name) == 0) {
+ pr_notice("gator: Adding CCI-400 counters with type %i\n", type);
gator_events_perf_pmu_cci_400_init(type);
} else if (strcmp("CCI_500", pe->pmu->name) == 0) {
+ pr_notice("gator: Adding CCI-500 counters with type %i\n", type);
gator_events_perf_pmu_uncore_init("CCI_500", type, CCI_500, false);
} else if (strcmp("ccn", pe->pmu->name) == 0) {
+ pr_notice("gator: Adding CCN counters with type %i\n", type);
gator_events_perf_pmu_uncore_init("ARM_CCN_5XX", type, CCN_5XX, true);
} else if ((gator_cpu = gator_find_cpu_by_pmu_name(pe->pmu->name)) != NULL) {
found_cpu = true;
+ pr_notice("gator: Adding cpu counters for %s with type %i\n", gator_cpu->pmnc_name, type);
gator_events_perf_pmu_cpu_init(gator_cpu, type);
}
/* Initialize gator_attrs for dynamic PMUs here */
@@ -562,6 +569,7 @@ int gator_events_perf_pmu_init(void)
return -1;
}
}
+ pr_notice("gator: Adding cpu counters (based on cpuid) for %s\n", gator_cpu->pmnc_name);
gator_events_perf_pmu_cpu_init(gator_cpu, PERF_TYPE_RAW);
}