Received: by 10.223.185.116 with SMTP id b49csp2832787wrg; Mon, 12 Feb 2018 16:30:29 -0800 (PST) X-Google-Smtp-Source: AH8x227+wtuWILle7CKRAqtQydLjgS70kZkr+wj0jsOUd68AlsZDbby2F5o0VXsj7EKWYXIyJ0XC X-Received: by 2002:a17:902:8a8a:: with SMTP id p10-v6mr11921841plo.261.1518481829163; Mon, 12 Feb 2018 16:30:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518481829; cv=none; d=google.com; s=arc-20160816; b=Mri1pZF2tkkFq9x5KqD/2wg+2HQNQPlVdgu+9NDh8ZUyZTCBZ53q+4zExFVq7tBwM6 sixednt8WSqqjX4ycm9i7pT0pHKrPd1BKnQIJW+BA0p0eWWPM6fBzgnFihSh0vL/p9oN J4R+89iTiwx1nIUQy7LuIM90BZFN/FfNJ5bUyIvz+kn0eJ7JKwYL0yABwJme9KKlbR9p SL+oBL1iF9OSdFCpnOm/9unQOiLhqAQzGxF52Qy6PyedJxCHbtyROJN+mYmAwFJH23/N ozq0vm82iy9OKmDH7MZDksftlDavaSrnANiWCsBq46GGhfMhgNd8QzMNX7JOleIj9jWi jzvQ== 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:arc-authentication-results; bh=UPiEyq/yRZQcTk9s658C3j54X6slMNlwy+iBnDzDumQ=; b=Oyx1NhKrQsUdCA9QngrWiW71cV6C6C6f2CzNgHJZ3uWeG8MbG9SbPoRQXRTFU4u0Xd Vf11n71BCxZugiNBUxvPO3U0MfdW2C5h0G33jBRg2JhxISlZmLX9nyKXMBFQiSpvX/r3 +4hvNRX5xkKnGV2AgGnweqvgo4JRt+5kXnNL9xoBOOoLVbNhxYxrPYSSmSADVs9Y6bCS f4XUTeQv6epoU7oQWWo1U66Z+5uUd3VX84jNXDRqY3fsrqyshZPyAKW/JVoOPB/PSwQB gti8deduu/+LwOUAg3BlUOeUMQXtN7LaEQjkLSxG6tbtRAf3k3xlKrXMMzi4vYwj4jMY CuJQ== 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 e82si3252087pfh.159.2018.02.12.16.30.14; Mon, 12 Feb 2018 16:30:29 -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 S933012AbeBMA3H (ORCPT + 99 others); Mon, 12 Feb 2018 19:29:07 -0500 Received: from mga18.intel.com ([134.134.136.126]:12065 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932769AbeBMA3G (ORCPT ); Mon, 12 Feb 2018 19:29:06 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2018 16:29:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,504,1511856000"; d="scan'208";a="30256618" Received: from gvt-dell.bj.intel.com (HELO intel.com) ([10.238.154.59]) by fmsmga001.fm.intel.com with SMTP; 12 Feb 2018 16:29:04 -0800 Date: Tue, 13 Feb 2018 08:20:24 +0800 From: "Du, Changbin" To: Steven Rostedt Cc: "Du, Changbin" , 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: <20180213002024.vweatugblamznigc@intel.com> References: <1518226624-8931-1-git-send-email-changbin.du@intel.com> <20180209214458.1ed36c3c@vmware.local.home> <20180211105004.p55ajlt5kw36qwxi@intel.com> <20180212120452.50abd9bf@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180212120452.50abd9bf@gandalf.local.home> User-Agent: NeoMutt/20171027-42-ad8712 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks, I will improve this change in v2. And also update related docs. On Mon, Feb 12, 2018 at 12:04:52PM -0500, Steven Rostedt wrote: > 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) > > ); > -- Thanks, Changbin Du