Skip to content

Commit 7b8e6da

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
perf/x86/p4: Add format attributes
Steven reported his P4 not booting properly, the missing format attributes cause a NULL ptr deref. Cure this by adding the missing format specification. I took the format description out of the comment near p4_config_pack*() and hope that comment is still relatively accurate. Reported-by: Steven Rostedt <[email protected]> Reported-by: Bruno Prémont <[email protected]> Tested-by: Steven Rostedt <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Cyrill Gorcunov <[email protected]> Cc: Lin Ming <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/1332859842.16159.227.camel@twins Signed-off-by: Ingo Molnar <[email protected]>
1 parent 6308191 commit 7b8e6da

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arch/x86/kernel/cpu/perf_event_p4.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,17 @@ static int p4_pmu_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign
12711271
return num ? -EINVAL : 0;
12721272
}
12731273

1274+
PMU_FORMAT_ATTR(cccr, "config:0-31" );
1275+
PMU_FORMAT_ATTR(escr, "config:32-62");
1276+
PMU_FORMAT_ATTR(ht, "config:63" );
1277+
1278+
static struct attribute *intel_p4_formats_attr[] = {
1279+
&format_attr_cccr.attr,
1280+
&format_attr_escr.attr,
1281+
&format_attr_ht.attr,
1282+
NULL,
1283+
};
1284+
12741285
static __initconst const struct x86_pmu p4_pmu = {
12751286
.name = "Netburst P4/Xeon",
12761287
.handle_irq = p4_pmu_handle_irq,
@@ -1305,6 +1316,8 @@ static __initconst const struct x86_pmu p4_pmu = {
13051316
* the former idea is taken from OProfile code
13061317
*/
13071318
.perfctr_second_write = 1,
1319+
1320+
.format_attrs = intel_p4_formats_attr,
13081321
};
13091322

13101323
__init int p4_pmu_init(void)

0 commit comments

Comments
 (0)