From: "Du, Changbin" <changbin.du@intel.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Du, Changbin" <changbin.du@intel.com>,
mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing/power: Don't share template for cpu_idle and cpu_frequency
Date: Tue, 13 Feb 2018 08:20:24 +0800 [thread overview]
Message-ID: <20180213002024.vweatugblamznigc@intel.com> (raw)
In-Reply-To: <20180212120452.50abd9bf@gandalf.local.home>
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" <changbin.du@intel.com> 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
next prev parent reply other threads:[~2018-02-13 0:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-10 1:37 changbin.du
2018-02-10 2:44 ` Steven Rostedt
2018-02-11 10:50 ` Du, Changbin
2018-02-12 17:04 ` Steven Rostedt
2018-02-13 0:20 ` Du, Changbin [this message]
2018-02-12 16:16 ` kbuild test robot
2018-02-12 16:25 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180213002024.vweatugblamznigc@intel.com \
--to=changbin.du@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome