Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp790031imm; Wed, 25 Jul 2018 06:19:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfdPlfQ12neegvJBpmjPYDT6ovy9Tm8amhy2xm4yCnbUF27geNTFcIfhDwViSpobQjofIla X-Received: by 2002:a17:902:b609:: with SMTP id b9-v6mr10275476pls.321.1532524796962; Wed, 25 Jul 2018 06:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532524796; cv=none; d=google.com; s=arc-20160816; b=1AYYCBBczUE/NhvKTTHidf0ESGPpFlrDM3CO0FFO+ZjlgR8WoQuBq2u4JSnuorWNEM zIQ6Rvl36z70FgCyyToWTuCGYnGiU8cLzSsE0wDqf1xf09dLnttu0aS4a3tbgKxpNI+V wtfF54/RqOBAHXf00AHzOHCa6twS3u4yoxRrIG9TnK0VFiNSarDBKuYiXHesyYEu06IA bJ9dKQOOYltCoWt1xnG3qj38F/VD1Gc2xvQz0kfuXCalDKfwyYq4+vejMxX3fq1BvVKc e4BvW0TiC61PfOJ3yw1O/0xkeiCa/2x7OgyAAxL1fob1Jbh8qoX/BMKrLV4nX+kamhTM jVow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=DdnM/6ljbZlUPwpnP3Prlu78kK8YiOlNpp/bAbI6MVM=; b=t0pBARPKcL1y3S6OY7Y9YkGbRwP1GKfQMIWX9JFJqKK1auqdd1hnZC2hRs0Tgd16wD aKhT3tCSQIHFiRGU2k2uDB8A14okjnrCnfHWcwMj4GNvbeiYG/Yeb2Drel3JhKTvLo+x o+lauoJVJSOwEo4ChJr3Cq5q+my2VjGyVgETf1WhSyp72hK7y15PQbGQX+UuayE0iMqk M31RtWiLwfHrKvKsalPpqGQedjFUvZXPaWTyUmsn09KfLNH0NBeqn5eHv8yNktdOgLtP XnDKf3PYnZuYsmrucp9Ck3tDMzaIJkXw6kRibLPixiNA9UB9qdKsHtgIRr7gGqR03WT+ SfSQ== ARC-Authentication-Results: i=1; mx.google.com; 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 75-v6si14072410pgh.110.2018.07.25.06.19.41; Wed, 25 Jul 2018 06:19:56 -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; 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 S1729067AbeGYO3o (ORCPT + 99 others); Wed, 25 Jul 2018 10:29:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:35694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728824AbeGYO3o (ORCPT ); Wed, 25 Jul 2018 10:29:44 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC41B20843; Wed, 25 Jul 2018 13:18:03 +0000 (UTC) Date: Wed, 25 Jul 2018 09:18:02 -0400 From: Steven Rostedt To: Joel Fernandes 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 v3] cpufreq: trace frequency limits change Message-ID: <20180725091802.74400a81@gandalf.local.home> In-Reply-To: <20180724173544.18876-1-joel@joelfernandes.org> References: <20180724173544.18876-1-joel@joelfernandes.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Jul 2018 10:35:44 -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) Better ;-) Acked-by: Steven Rostedt (VMware) -- Steve > --- > Viresh since I changed the patch, could you Ack it again? > > v2->v3: reduce parameters to tracepoint call (Steve) > v1->v2: correct ordering of min/max (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..52566f1f1050 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); > > policy->cached_target_freq = UINT_MAX; > > diff --git a/include/trace/events/power.h b/include/trace/events/power.h > index 908977d69783..f7aece721aed 100644 > --- a/include/trace/events/power.h > +++ b/include/trace/events/power.h > @@ -5,6 +5,7 @@ > #if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ) > #define _TRACE_POWER_H > > +#include > #include > #include > #include > @@ -148,6 +149,30 @@ DEFINE_EVENT(cpu, cpu_frequency, > TP_ARGS(frequency, cpu_id) > ); > > +TRACE_EVENT(cpu_frequency_limits, > + > + TP_PROTO(struct cpufreq_policy *policy), > + > + TP_ARGS(policy), > + > + TP_STRUCT__entry( > + __field(u32, min_freq) > + __field(u32, max_freq) > + __field(u32, cpu_id) > + ), > + > + TP_fast_assign( > + __entry->min_freq = policy->min; > + __entry->max_freq = policy->max; > + __entry->cpu_id = policy->cpu; > + ), > + > + TP_printk("min=%lu max=%lu cpu_id=%lu", > + (unsigned long)__entry->min_freq, > + (unsigned long)__entry->max_freq, > + (unsigned long)__entry->cpu_id) > +); > + > TRACE_EVENT(device_pm_callback_start, > > TP_PROTO(struct device *dev, const char *pm_ops, int event),