Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753054AbeAEVGt (ORCPT + 1 other); Fri, 5 Jan 2018 16:06:49 -0500 Received: from mga05.intel.com ([192.55.52.43]:20687 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752802AbeAEVGs (ORCPT ); Fri, 5 Jan 2018 16:06:48 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,320,1511856000"; d="scan'208";a="190271252" Message-ID: <1515186406.26317.38.camel@linux.intel.com> Subject: Re: [Resend][PATCH V2] cpufreq: intel_pstate: allow trace in passive mode From: Srinivas Pandruvada To: Doug Smythies , "'Rafael J. Wysocki'" Cc: "'Rafael J. Wysocki'" , 'Linux Kernel Mailing List' , 'Linux PM' Date: Fri, 05 Jan 2018 13:06:46 -0800 In-Reply-To: <001501d38661$f82af1b0$e880d510$@net> References: <1513384980-3428-1-git-send-email-dsmythies@telus.net> <1513639857.31113.12.camel@linux.intel.com> R5i6epWR47WleR5i7eE79h <001501d38661$f82af1b0$e880d510$@net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, 2018-01-05 at 12:15 -0800, Doug Smythies wrote: > >  [...] > On 2017.12.18 16:25 Rafael J. Wysocki wrote: > > > > +     from = cpu->pstate.current_pstate; > > > > +     time = ktime_get(); > > > > +     sample_taken = intel_pstate_sample(cpu, time); > > > > + > > > This is quite a bit of overhead for tracing. > Yes, it is a bit of added code, but without tracing abilities I > do not know how to investigate passive operation. > > > > > > > > > Why not fold the above two > > > statements in the next if () with conditional tracing? > No, I specifically want to do a trace sample, even if the target > is the same as last time. Why? Because we want to know the time > between calls to the driver, i.e. the duration. That information > is incredibly useful. I am not saying you don't need trace. But you can do all processing when just trace is enabled. Which can be done by if (trace_pstate_sample_enabled()) The above function should return true when trace is enabled. So in your v3, in intel_cpufreq_trace() you can simply return if trace_pstate_sample_enabled() is false, without calling intel_pstate_sample(). Thanks, Srinivas