Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7224792imm; Tue, 24 Jul 2018 10:25:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdr0X5y78z7b6/cYwY61xlMFeINqQlPcHHHeGEidUSbOJoe6C+eFHdRSWYZYc1/d83pjTRc X-Received: by 2002:a62:9f16:: with SMTP id g22-v6mr18290725pfe.207.1532453150870; Tue, 24 Jul 2018 10:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532453150; cv=none; d=google.com; s=arc-20160816; b=ce1XlNj4w2towxmG3TLTwrgl121vxhlSin7AoArOq9yUOfi6vEpVBhZKFvfBkJM7nt SFQuujljZJ7hVmKAmFbgcq8tpgBWp8WLA+xFOvA0IYFMnQ05OMukt+PEicc8K8n6JOzK X+/iH/9KQ7W4mrSu5PjP6CfcL9ZkpEZn6A3KLL7ztndWNhmgPKx3kGNblvu5sxAr1s1D vREJ6xqHG6nZKqZ6UsEAbN8ZQMSMq2K2ECyqz6cRsKFoHb4t1v2CrSMveo1o0A8TS6UO 2DM5eoqEs8ipYWc2HZAj+il8029YRRcNLeJvjLANv15IOd9qpyBxdMmHjuOX7GmAKSUZ sFyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=toxk+IXZeNr5JmdgFIwY4a/V6xKEg9X97pyxPK/3kCo=; b=zWClfXXS5C+9HGG2N0nY00kag6sanPndt6c5NaZiTkw/iHfsjP/JDbvDsZgf2S4uYa SWi355WZpBYzDTYsxnkgTh8AhZoHDF0FuCvOZPt/x1WQ1AsZq18ctNkCUMpxoeEIdK49 U2o9hEE575zIFqzOv8DZLeblsFCGsMneCLNYxgvsFpSGPTP/OGJPU57vQycXPqyfuqyb RmEKsxZCpHKZ/IFqutU/haNUYYg4gHZSsyLAdERygfSuqdIzTFRaVRbcOAamx1dj0cKu +bpnWK6S5Ao4FJ68YXU+dMHmKAjZhL0+OJlVmFAqBx8MKQaget6DSMxG9QFCTobImXIr Fc0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=G9Feiah7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n21-v6si10403199plp.31.2018.07.24.10.25.36; Tue, 24 Jul 2018 10:25:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=G9Feiah7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388501AbeGXSbg (ORCPT + 99 others); Tue, 24 Jul 2018 14:31:36 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:41385 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388393AbeGXSbg (ORCPT ); Tue, 24 Jul 2018 14:31:36 -0400 Received: by mail-pl0-f67.google.com with SMTP id w8-v6so2055305ply.8 for ; Tue, 24 Jul 2018 10:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=toxk+IXZeNr5JmdgFIwY4a/V6xKEg9X97pyxPK/3kCo=; b=G9Feiah7WFmqxB/rnB5qOGhj4xArhsT0Yd7mQZJroSNWqoXogYDddp4Frmoezy0js8 pXjdkkddxrqDp6/E5g0NeqxpBFkKDdzr3giKQlsWcOgXniDp6I9g9O8b+3DjHi75xRWN 6t7sSD79gu1I/tuICvW9T8LMqWEVQuMHZzbpI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=toxk+IXZeNr5JmdgFIwY4a/V6xKEg9X97pyxPK/3kCo=; b=Tw+507umCD/qaqGDx+QDf4go1n61MGtZG0Zr1Le+9P0AO5N2NgTtiST8vnerGtcs9A mDciyad1+L5dMLpIDitPNIZJw+VJokh3ExcsBcEMVcZjhpV8QD0NqrIGADID3OIE2MC6 Td/m9Xd7xti64VPooWbyB4gCdJKdcI7uK18raBoY9sQP9FW23XFg4uZFKDrZaC9bpYu3 80VZ5ix+9wJjZV6vJ+du9ZYUR6Q/UFgbxmJknqwbBtuXjegPWDh3uuvoCSLhtFPcosq8 38Q3HzPxQBTavprVP2AbM7IhL4MAGGa9CyhBy3I3Zyzqco0WicpYjp3nG+HJwSbkw6sG lKmA== X-Gm-Message-State: AOUpUlGZXRIn5hq0cQizDgZVNtrElYrCckKntNao2c/x/tzQNx9whlHg Uymt32W9HU9l/0Np+gpBlHEWlw== X-Received: by 2002:a17:902:a40b:: with SMTP id p11-v6mr17950827plq.228.1532453046184; Tue, 24 Jul 2018 10:24:06 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id p64-v6sm19522303pfa.47.2018.07.24.10.24.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Jul 2018 10:24:05 -0700 (PDT) Date: Tue, 24 Jul 2018 10:24:05 -0700 From: Joel Fernandes To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Ruchi Kandoi , Ingo Molnar , Jonathan Corbet , linux-doc@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Viresh Kumar Subject: Re: [PATCH v2] cpufreq: trace frequency limits change Message-ID: <20180724172405.GA257870@joelaf.mtv.corp.google.com> References: <20180720222114.200311-1-joel@joelfernandes.org> <20180724094932.11e10452@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180724094932.11e10452@gandalf.local.home> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 24, 2018 at 09:49:32AM -0400, Steven Rostedt wrote: > On Fri, 20 Jul 2018 15:21:14 -0700 > Joel Fernandes wrote: > > > From: Ruchi Kandoi > > > > systrace used for tracing for Android systems has carried a patch for > > many years in the Android tree that traces when the cpufreq limits > > change. With the help of this information, systrace can know when the > > policy limits change and can visually display the data. Lets add > > upstream support for the same. > > > > Signed-off-by: Ruchi Kandoi > > Signed-off-by: Joel Fernandes (Google) > > --- > > v1->v2: Minor changes suggested by Viresh > > > > Documentation/trace/events-power.rst | 1 + > > drivers/cpufreq/cpufreq.c | 1 + > > include/trace/events/power.h | 25 +++++++++++++++++++++++++ > > 3 files changed, 27 insertions(+) > > > > diff --git a/Documentation/trace/events-power.rst b/Documentation/trace/events-power.rst > > index a77daca75e30..2ef318962e29 100644 > > --- a/Documentation/trace/events-power.rst > > +++ b/Documentation/trace/events-power.rst > > @@ -27,6 +27,7 @@ cpufreq. > > > > cpu_idle "state=%lu cpu_id=%lu" > > cpu_frequency "state=%lu cpu_id=%lu" > > + cpu_frequency_limits "min=%lu max=%lu cpu_id=%lu" > > > > A suspend event is used to indicate the system going in and out of the > > suspend mode: > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > > index b0dfd3222013..4fd935df101e 100644 > > --- a/drivers/cpufreq/cpufreq.c > > +++ b/drivers/cpufreq/cpufreq.c > > @@ -2236,6 +2236,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, > > > > policy->min = new_policy->min; > > policy->max = new_policy->max; > > + trace_cpu_frequency_limits(policy->min, policy->max, policy->cpu); > > Wouldn't it make more sense just to pass in "policy"? Yes I agree, good idea. > > > > policy->cached_target_freq = UINT_MAX; > > > > diff --git a/include/trace/events/power.h b/include/trace/events/power.h > > index 908977d69783..f5bec45108b6 100644 > > --- a/include/trace/events/power.h > > +++ b/include/trace/events/power.h > > @@ -148,6 +148,31 @@ DEFINE_EVENT(cpu, cpu_frequency, > > TP_ARGS(frequency, cpu_id) > > ); > > > > +TRACE_EVENT(cpu_frequency_limits, > > + > > + TP_PROTO(unsigned int min_freq, unsigned int max_freq, > > + unsigned int cpu_id), > > + > > + TP_ARGS(min_freq, max_freq, cpu_id), > > + > > + TP_STRUCT__entry( > > + __field(u32, min_freq) > > + __field(u32, max_freq) > > + __field(u32, cpu_id) > > + ), > > + > > + TP_fast_assign( > > + __entry->min_freq = min_freq; > > + __entry->max_freq = max_freq; > > + __entry->cpu_id = cpu_id; > > Then have here: > > __entry->min_freq = policy->min; > __entry->max_freq = policy->max; > __entry->puc_id = policy->cpu; > > It would also make the footprint of the tracepoint in the code smaller > as it would pass fewer parameters to the trace event. Yes, that's a great idea. I'll make the change and post v3. -Joel