]> Git Repo - linux.git/commitdiff
perf/x86/p4: Add format attributes
authorPeter Zijlstra <[email protected]>
Tue, 27 Mar 2012 14:50:42 +0000 (16:50 +0200)
committerIngo Molnar <[email protected]>
Tue, 3 Apr 2012 06:33:38 +0000 (08:33 +0200)
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]>
arch/x86/kernel/cpu/perf_event_p4.c

index ef484d9d0a251b0128a164486096ce43c4ea8f4c..a2dfacfd7103b4b951452d5c42a3d613223f5ad5 100644 (file)
@@ -1271,6 +1271,17 @@ done:
        return num ? -EINVAL : 0;
 }
 
+PMU_FORMAT_ATTR(cccr, "config:0-31" );
+PMU_FORMAT_ATTR(escr, "config:32-62");
+PMU_FORMAT_ATTR(ht,   "config:63"   );
+
+static struct attribute *intel_p4_formats_attr[] = {
+       &format_attr_cccr.attr,
+       &format_attr_escr.attr,
+       &format_attr_ht.attr,
+       NULL,
+};
+
 static __initconst const struct x86_pmu p4_pmu = {
        .name                   = "Netburst P4/Xeon",
        .handle_irq             = p4_pmu_handle_irq,
@@ -1305,6 +1316,8 @@ static __initconst const struct x86_pmu p4_pmu = {
         * the former idea is taken from OProfile code
         */
        .perfctr_second_write   = 1,
+
+       .format_attrs           = intel_p4_formats_attr,
 };
 
 __init int p4_pmu_init(void)
This page took 0.05736 seconds and 4 git commands to generate.