Re: [PATCH V6 05/13] perf: Generic intel uncore support

From: Stephane Eranian
Date: Tue Jul 24 2012 - 02:21:27 EST


On Tue, Jul 24, 2012 at 8:00 AM, Yan, Zheng <zheng.z.yan@xxxxxxxxx> wrote:
> [...snip...]
>>> +
>>> +static int __init intel_uncore_init(void)
>>> +{
>>> + int ret;
>>> +
>>> + if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
>>> + return -ENODEV;
>>> +
>>> + ret = uncore_cpu_init();
>>> + if (ret)
>>> + goto fail;
>>> +
>>> + uncore_pmus_register();
>>> + return 0;
>>> +fail:
>>> + return ret;
>>> +}
>>> +device_initcall(intel_uncore_init);
>>
>>
>> You cannot use device_initcall() here. Otherwise you're subject
>> to linker ordering issues between intel_uncore_init() and the
>> perf_event_sysfs_init() initcall. You need the perf_event sysfs
>> support to be enabled BEFORE you init the uncore otherwise you
>> won't see the uncore sysfs entries. Given how perf now relies on
>> sysfs to parse the event, this is a showstopper.
>
> I think the ordering makes no matter. perf_event_sysfs_init() checks
> PMUs that were registered previously and allocates sysfs entries for
> them.
>
You're right, seems like I had a bad kernel that caused the problem
to happen.
Thanks for checking.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/