It's all very well providing an events directory to userspace that
details our events in terms of "event=0xNN", but if we don't define how
to encode the "event" field in the perf attr.config, then it's a waste
of time.
This patch adds a single format entry to describe that the event field
occupies the bottom 8 bits of our config field on ARMv7.
Signed-off-by: Will Deacon <will.deacon@arm.com>
[C(BPU)][C(OP_WRITE)][C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
};
[C(BPU)][C(OP_WRITE)][C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
};
+PMU_FORMAT_ATTR(event, "config:0-7");
+
+static struct attribute *armv7_pmu_format_attrs[] = {
+ &format_attr_event.attr,
+ NULL,
+};
+
+static struct attribute_group armv7_pmu_format_attr_group = {
+ .name = "format",
+ .attrs = armv7_pmu_format_attrs,
+};
+
#define ARMV7_EVENT_ATTR_RESOLVE(m) #m
#define ARMV7_EVENT_ATTR(name, config) \
PMU_EVENT_ATTR_STRING(name, armv7_event_attr_##name, \
#define ARMV7_EVENT_ATTR_RESOLVE(m) #m
#define ARMV7_EVENT_ATTR(name, config) \
PMU_EVENT_ATTR_STRING(name, armv7_event_attr_##name, \
&armv7_event_attr_br_mis_pred.attr.attr,
&armv7_event_attr_cpu_cycles.attr.attr,
&armv7_event_attr_br_pred.attr.attr,
&armv7_event_attr_br_mis_pred.attr.attr,
&armv7_event_attr_cpu_cycles.attr.attr,
&armv7_event_attr_br_pred.attr.attr,
};
static struct attribute_group armv7_pmuv1_events_attr_group = {
};
static struct attribute_group armv7_pmuv1_events_attr_group = {
static const struct attribute_group *armv7_pmuv1_attr_groups[] = {
&armv7_pmuv1_events_attr_group,
static const struct attribute_group *armv7_pmuv1_attr_groups[] = {
&armv7_pmuv1_events_attr_group,
+ &armv7_pmu_format_attr_group,
+ NULL,
};
ARMV7_EVENT_ATTR(mem_access, ARMV7_PERFCTR_MEM_ACCESS);
};
ARMV7_EVENT_ATTR(mem_access, ARMV7_PERFCTR_MEM_ACCESS);
&armv7_event_attr_inst_spec.attr.attr,
&armv7_event_attr_ttbr_write_retired.attr.attr,
&armv7_event_attr_bus_cycles.attr.attr,
&armv7_event_attr_inst_spec.attr.attr,
&armv7_event_attr_ttbr_write_retired.attr.attr,
&armv7_event_attr_bus_cycles.attr.attr,
};
static struct attribute_group armv7_pmuv2_events_attr_group = {
};
static struct attribute_group armv7_pmuv2_events_attr_group = {
static const struct attribute_group *armv7_pmuv2_attr_groups[] = {
&armv7_pmuv2_events_attr_group,
static const struct attribute_group *armv7_pmuv2_attr_groups[] = {
&armv7_pmuv2_events_attr_group,
+ &armv7_pmu_format_attr_group,
+ NULL,