Received: by 10.223.185.116 with SMTP id b49csp2411346wrg; Mon, 12 Feb 2018 09:07:21 -0800 (PST) X-Google-Smtp-Source: AH8x224uvGyL69GA4zFkINSV0J8/Cdn1P81G6T+/T+PSdQwLhUBS+JTx3iuvfISg/X4VvN9lc3DQ X-Received: by 10.99.180.79 with SMTP id n15mr10029080pgu.314.1518455241848; Mon, 12 Feb 2018 09:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518455241; cv=none; d=google.com; s=arc-20160816; b=DDa2J6v7On7c4w5Gn2kVrRm+e3IJ/CuoHmjdHKVZS1+DpLOOAx64KRZ9fKaQJvGYCX mqAM0aiSUsJ5TPJ7w+/58cnIdrZIa6JQJ4TIvuy39tXkxIwtppS5vwPBKvCA+iAHbU8J CyEsrvXs9w4R9hHQi1eYkn9gayMeUwNNuO2RAE6Ofuv5q3WnAsIIF4hexsFh6w/buZDu 7JAFvTVofRAJRAv77Bv3ssAqr4JdJUBxTyCj0mb5gOXXw86L8WyeDL1w8J71DkxMqsnc 4LRaebCtdZz8ykAA36LUW+nfdw7/qc6+hCe2aE6O8VQm/D4QKXC/Q02VAw5/5qtoME6M nWxA== 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=GYgiRed2G0pUgKic0C4zqLUfXteeMdRtA9R0TAFF7Pg=; b=GSALXcR2bXCLKsiAiYsQx2GgXOr+h4q7o+TAk45+eO2KOYCwz+9qF9CoVIhcYjorjB WNEE1SO1yRn6AmYWhiqXpIrr/j0CbwNpmGtP15gJYnrVX7RPjtffCBpSK0ULBMXdtLL1 Uv8LOE13t+5DG0Q4HXftantAcWKjzfXkYJXLXPkz8N7baNTZimAbIHGvIQoTNDDlEoFr yhCM4eygjlYPnw9ZdQCwxtExMweAjvL8KhtWpp6D9z0wNuoZfBcTexWhBM6qSjhK6hFN fasQZZsg4odrAJbE47UV/9qrPomBAFSNoZJo9Nkr1IRYG6LHTTIpe9BOn/hlauBzd1gb JyJw== 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 e9-v6si4395731pli.474.2018.02.12.09.07.06; Mon, 12 Feb 2018 09:07:21 -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 S1751455AbeBLRE5 (ORCPT + 99 others); Mon, 12 Feb 2018 12:04:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:57588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbeBLRE4 (ORCPT ); Mon, 12 Feb 2018 12:04:56 -0500 Received: from gandalf.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 4236921104; Mon, 12 Feb 2018 17:04:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4236921104 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: Mon, 12 Feb 2018 12:04:52 -0500 From: Steven Rostedt To: "Du, Changbin" 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: <20180212120452.50abd9bf@gandalf.local.home> In-Reply-To: <20180211105004.p55ajlt5kw36qwxi@intel.com> References: <1518226624-8931-1-git-send-email-changbin.du@intel.com> <20180209214458.1ed36c3c@vmware.local.home> <20180211105004.p55ajlt5kw36qwxi@intel.com> X-Mailer: Claws Mail 3.16.0 (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 Sun, 11 Feb 2018 18:50:04 +0800 "Du, Changbin" wrote: > Steve, How abount DEFINE_EVENT_PRINT as below? Yes, DEFINE_EVENT_PRINT is better. > > diff --git a/include/trace/events/power.h b/include/trace/events/power.h > index 908977d..e71ce98 100644 > --- a/include/trace/events/power.h > +++ b/include/trace/events/power.h > @@ -14,12 +14,12 @@ > > DECLARE_EVENT_CLASS(cpu, > > - 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( s32, state ) > __field( u32, cpu_id ) > ), > > @@ -28,13 +28,12 @@ DECLARE_EVENT_CLASS(cpu, > __entry->cpu_id = cpu_id; > ), > > - TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state, > - (unsigned long)__entry->cpu_id) Yous still need the type casting, because s32/u32 on 32 bit machines can be defined as "long". -- Steve > + TP_printk("state=%d cpu_id=%u", __entry->state, __entry->cpu_id) > ); > > DEFINE_EVENT(cpu, cpu_idle, > > - TP_PROTO(unsigned int state, unsigned int cpu_id), > + TP_PROTO(int state, unsigned int cpu_id), > > TP_ARGS(state, cpu_id) > ); > @@ -141,11 +140,13 @@ TRACE_EVENT(pstate_sample, > { PM_EVENT_RESTORE, "restore" }, \ > { PM_EVENT_RECOVER, "recover" }) > > -DEFINE_EVENT(cpu, cpu_frequency, > +DEFINE_EVENT_PRINT(cpu, cpu_frequency, > > - TP_PROTO(unsigned int frequency, unsigned int cpu_id), > + TP_PROTO(int state, unsigned int cpu_id), > > - TP_ARGS(frequency, cpu_id) > + TP_ARGS(state, cpu_id), > + > + TP_printk("frequency=%u cpu_id=%lu", __entry->state, __entry->cpu_id) > );