Received: by 10.223.176.5 with SMTP id f5csp1379054wra; Fri, 9 Feb 2018 18:46:38 -0800 (PST) X-Google-Smtp-Source: AH8x225urYUR4mgKC8PfqF1rxOvBIUXSP49k3WrZp7OGULpcKUex+JuIfdQ8MszQg+rLyGlLOSJk X-Received: by 2002:a17:902:102:: with SMTP id 2-v6mr4419224plb.178.1518230798114; Fri, 09 Feb 2018 18:46:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518230798; cv=none; d=google.com; s=arc-20160816; b=yOl+grWGe90OGbC0I9RG+d8C3abpU17jww38RR3bRoicoz6GTkunhzimG70ZLLpaRe 6pgw3A6IdH1HJWxe41+BsccFfdrIG1ROqo3pd0i3MHdvzcROIc09CNQlSkzbNGyeHU2M JEMpz/p/207sSvtZ2qp2QZ63cZiNcLIuwWC9h6iYiHuVnw09dVwaUVGBFELIg2kP1MY5 kceg3YAGeCzuWoq5pLTAdUzOf/H6+DDF6w/miOiT1kDZwwfojxjJDnvwN3iLQxfxY2zE TgPfmphgaSYOLi8HhP1Uh8VsHZBLBIUbmu9zluSvD/liUp5ISMSnina9YDWJB1YXidsI 6haA== 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 :dmarc-filter:arc-authentication-results; bh=Obtlr4edg3mDvU0FaDf4dCVo9Fhx+J+FzQrengkq1No=; b=yvbxEIeVy4z901xCihb46mAl+RvgYU1pc+n/UrMLk5gmfaPxSnmN5z1g2fYsXxijmp XIc2Hs63uwRYW32FA8785wMQZENzN9nXCAcEeZJjZcFdRRVSQpDpPqrxEs1oeEsiidYb pfCqZJ+0OnrrTi+tcrgA0zMGib2XsmZBrjoV71liGh2Q4Q/63T/6WkScplbPejfoXyG+ GHFPEWzi1F2JPHMlC808I/LCEVkTw2IUHNJwbGvYyla/9gNAlZohGItxi7ihyo+8jSPM J7gXmh2F69MaOnmyFM92LEB2NK8XBVDYabEAMqA/jZOEE2Fi9VRlgqeOuyih1RbD7rQg Qzeg== 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 f9-v6si2376726plo.697.2018.02.09.18.46.24; Fri, 09 Feb 2018 18:46:38 -0800 (PST) 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 S1752560AbeBJCpC (ORCPT + 99 others); Fri, 9 Feb 2018 21:45:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:41794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751019AbeBJCpB (ORCPT ); Fri, 9 Feb 2018 21:45:01 -0500 Received: from vmware.local.home (cpe-172-100-180-131.stny.res.rr.com [172.100.180.131]) (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 4D70121789; Sat, 10 Feb 2018 02:45:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D70121789 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Fri, 9 Feb 2018 21:44:58 -0500 From: Steven Rostedt To: changbin.du@intel.com Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tracing/power: Don't share template for cpu_idle and cpu_frequency Message-ID: <20180209214458.1ed36c3c@vmware.local.home> In-Reply-To: <1518226624-8931-1-git-send-email-changbin.du@intel.com> References: <1518226624-8931-1-git-send-email-changbin.du@intel.com> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.31; 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 Sat, 10 Feb 2018 09:37:04 +0800 changbin.du@intel.com wrote: > From: Changbin Du > > The type of state is signed int, convert it to unsigned int looks weird. > (-1 become 4294967295) > 932.123 power:cpu_idle:state=1 cpu_id=0) > 932.125 power:cpu_idle:state=4294967295 cpu_id=0) > 932.132 power:cpu_idle:state=1 cpu_id=0) > 932.133 power:cpu_idle:state=4294967295 cpu_id=0) > > Similarly for cpu_frequency as "state=%lu cpu_id=%lu". User need to read > the code to understand what 'state' means. > > No functional change in this patch. That's not true. You split a class into two TRACE_EVENTS. Each TRACE_EVENT adds approximately 5k of code and data. A DEFINE_EVENT() adds around 300 bytes. There's better ways to do this, Please don't add this patch. -- Steve > > Signed-off-by: Changbin Du > --- > include/trace/events/power.h | 32 +++++++++++++++++++------------- > 1 file changed, 19 insertions(+), 13 deletions(-) > > diff --git a/include/trace/events/power.h b/include/trace/events/power.h > index 908977d..39bd6de 100644 > --- a/include/trace/events/power.h > +++ b/include/trace/events/power.h > @@ -12,14 +12,14 @@ > > #define TPS(x) tracepoint_string(x) > > -DECLARE_EVENT_CLASS(cpu, > +TRACE_EVENT(cpu_idle, > > - TP_PROTO(unsigned int state, unsigned int cpu_id), > + TP_PROTO(int state, unsigned int cpu_id), > > TP_ARGS(state, cpu_id), > > TP_STRUCT__entry( > - __field( u32, state ) > + __field( int, state ) > __field( u32, cpu_id ) > ), > > @@ -28,17 +28,10 @@ DECLARE_EVENT_CLASS(cpu, > __entry->cpu_id = cpu_id; > ), > > - TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state, > + TP_printk("state=%d cpu_id=%lu", __entry->state, > (unsigned long)__entry->cpu_id) > ); > > -DEFINE_EVENT(cpu, cpu_idle, > - > - TP_PROTO(unsigned int state, unsigned int cpu_id), > - > - TP_ARGS(state, cpu_id) > -); > - > TRACE_EVENT(powernv_throttle, > > TP_PROTO(int chip_id, const char *reason, int pmax), > @@ -141,11 +134,24 @@ TRACE_EVENT(pstate_sample, > { PM_EVENT_RESTORE, "restore" }, \ > { PM_EVENT_RECOVER, "recover" }) > > -DEFINE_EVENT(cpu, cpu_frequency, > +TRACE_EVENT(cpu_frequency, > > TP_PROTO(unsigned int frequency, unsigned int cpu_id), > > - TP_ARGS(frequency, cpu_id) > + TP_ARGS(frequency, cpu_id), > + > + TP_STRUCT__entry( > + __field( u32, frequency ) > + __field( u32, cpu_id ) > + ), > + > + TP_fast_assign( > + __entry->frequency = frequency; > + __entry->cpu_id = cpu_id; > + ), > + > + TP_printk("frequency=%lu cpu_id=%lu", __entry->frequency, > + (unsigned long)__entry->cpu_id) > ); > > TRACE_EVENT(device_pm_callback_start,