lkml.org 
[lkml]   [2013]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 3/4] perf,x86: add Intel RAPL PMU support
On Wed, Oct 23, 2013 at 02:58:04PM +0200, Stephane Eranian wrote:

SNIP

> + pmu = per_cpu(rapl_pmu, i);
> + if (pmu) {
> + per_cpu(rapl_pmu, cpu) = pmu;
> + atomic_inc(&pmu->refcnt);
> + }
> + continue;
> + }
> + rapl_cpu_prepare(cpu);
> + cpumask_set_cpu(cpu, &rapl_cpu_mask);
> + }
> +
> + perf_cpu_notifier(rapl_cpu_notifier);

hum, this should be rather called below only if we succeed
with the perf_pmu_register

> +
> + ret = perf_pmu_register(&rapl_pmu_class, "power", -1);
> + WARN_ON(ret);
> + if (!ret) {
> + pr_info("RAPL PMU detected, registration failed, RAPL PMU disabled\n");
> + put_online_cpus();
> + return -1;
> + }
> +
> + pmu = __get_cpu_var(rapl_pmu);
> +
> + pr_info("RAPL PMU detected, hw unit 2^-%d Joules,"
> + " API unit is 2^-32 Joules,"
> + " %d fixed counters\n",
> + pmu->hw_unit,
> + hweight32(rapl_cntr_mask));
> +
> + put_online_cpus();
> +
> + return 0;
> +}
> +device_initcall(rapl_pmu_init);
> --
> 1.7.9.5
>


\
 
 \ /
  Last update: 2013-10-25 14:41    [W:0.090 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site