From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754020AbbIRN4I (ORCPT ); Fri, 18 Sep 2015 09:56:08 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:57931 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752745AbbIRN4G (ORCPT ); Fri, 18 Sep 2015 09:56:06 -0400 Date: Fri, 18 Sep 2015 14:55:51 +0100 From: Javi Merino To: Steven Rostedt Cc: "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "cw00.choi@samsung.com" , "edubezval@gmail.com" , Zhang Rui , Ingo Molnar Subject: Re: [PATCH v6 4/5] devfreq_cooling: add trace information Message-ID: <20150918135550.GA5283@e104805> References: <1441904972-5809-1-git-send-email-javi.merino@arm.com> <1441904972-5809-5-git-send-email-javi.merino@arm.com> <20150910131928.3c88fe28@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150910131928.3c88fe28@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve, On Thu, Sep 10, 2015 at 06:19:28PM +0100, Steven Rostedt wrote: > On Thu, 10 Sep 2015 18:09:31 +0100 > Javi Merino wrote: > > > Tracing is useful for debugging and performance tuning. Add similar > > traces to what's present in the cpu cooling device. > > > > Cc: Zhang Rui > > Cc: Eduardo Valentin > > Cc: Steven Rostedt > > Cc: Ingo Molnar > > Signed-off-by: Javi Merino > > --- > > drivers/thermal/devfreq_cooling.c | 6 +++++ > > include/trace/events/thermal.h | 53 +++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 59 insertions(+) > > > > diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c > > index a032c5d5c374..a27206815066 100644 > > --- a/drivers/thermal/devfreq_cooling.c > > +++ b/drivers/thermal/devfreq_cooling.c > > @@ -25,6 +25,8 @@ > > #include > > #include > > > > +#include > > + > > static DEFINE_MUTEX(devfreq_lock); > > static DEFINE_IDR(devfreq_idr); > > > > @@ -293,6 +295,9 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd > > /* Get static power */ > > static_power = get_static_power(dfc, freq); > > > > + trace_thermal_power_devfreq_get_power(cdev, status, freq, dyn_power, > > + static_power); > > + > > *power = dyn_power + static_power; > > > > return 0; > > @@ -348,6 +353,7 @@ static int devfreq_cooling_power2state(struct thermal_cooling_device *cdev, > > break; > > > > *state = i; > > + trace_thermal_power_devfreq_limit(cdev, freq, *state, power); > > I'm curious, does changing the above to: > > trace_thermal_power_devfreq_limit(cdev, freq, i, power); > > make the compiled code better? > > A tracepoint does some whacky things, and gcc may not optimize this. I've compared the generated assembly on arm, arm64 and x86_64 and both options generate exactly the same code. Cheers, Javi