[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOh2x==TDQrs3iNX6ZkSBWv+HRS3BoJqoZuyWpwsXGT6pCrK-w@mail.gmail.com>
Date: Wed, 15 Mar 2017 09:56:39 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Javi Merino <javi.merino@....com>
Cc: Eduardo Valentin <edubezval@...il.com>,
Zhang Rui <rui.zhang@...el.com>,
Linux PM list <linux-pm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Punit Agrawal <punit.agrawal@....com>,
Lina Iyer <lina.iyer@...aro.org>,
Mark Brown <broonie@...nel.org>,
Jon Medhurst <tixy@...aro.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v3 2/5] thermal: add trace events to the power allocator governor
Hi Javi,
Sorry for picking up an old thread, but i had a question for you.
On Mon, Mar 2, 2015 at 10:47 PM, Javi Merino <javi.merino@....com> wrote:
> diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
> @@ -588,12 +590,20 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev,
> u32 *power)
> {
> unsigned long freq;
> - int cpu, ret;
> + int i = 0, cpu, ret;
> u32 static_power, dynamic_power, total_load = 0;
> struct cpufreq_cooling_device *cpufreq_device = cdev->devdata;
> + u32 *load_cpu = NULL;
>
> freq = cpufreq_quick_get(cpumask_any(&cpufreq_device->allowed_cpus));
>
> + if (trace_thermal_power_cpu_get_power_enabled()) {
You allocated load_cpu if cpu_get_power trace is enabled.
> + u32 ncpus = cpumask_weight(&cpufreq_device->allowed_cpus);
> +
> + load_cpu = devm_kcalloc(&cdev->device, ncpus, sizeof(*load_cpu),
> + GFP_KERNEL);
> + }
> +
> for_each_cpu(cpu, &cpufreq_device->allowed_cpus) {
> u32 load;
>
> @@ -603,14 +613,29 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev,
> load = 0;
>
> total_load += load;
> + if (trace_thermal_power_cpu_limit_enabled() && load_cpu)
But you store values to it only if cpu_limit trace is also enabled,
otherwise it is all zeros.
Why?
Powered by blists - more mailing lists