From: Steven Rostedt <rostedt@goodmis.org>
To: changbin.du@intel.com
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] tracing/power: Polish the tracepoints cpu_idle and cpu_frequency
Date: Wed, 14 Feb 2018 10:19:30 -0500 [thread overview]
Message-ID: <20180214101930.7599c67b@gandalf.local.home> (raw)
In-Reply-To: <1518576038-16198-1-git-send-email-changbin.du@intel.com>
[ Resending due to typo in LKML address ]
On Wed, 14 Feb 2018 10:40:38 +0800
changbin.du@intel.com wrote:
> From: Changbin Du <changbin.du@intel.com>
>
> 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.
>
> Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
>From the tracing perspective:
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-- Steve
> Signed-off-by: Changbin Du <changbin.du@intel.com>
>
> ---
> v2:
> o rename title.
> o define tracepoint with DEFINE_EVENT_PRINT().
> ---
> Documentation/trace/events-power.txt | 4 ++--
> include/trace/events/power.h | 17 ++++++++++-------
> 2 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt
> index 21d514c..9485039 100644
> --- a/Documentation/trace/events-power.txt
> +++ b/Documentation/trace/events-power.txt
> @@ -23,8 +23,8 @@ Cf. include/trace/events/power.h for the events definitions.
> A 'cpu' event class gathers the CPU-related events: cpuidle and
> cpufreq.
>
> -cpu_idle "state=%lu cpu_id=%lu"
> -cpu_frequency "state=%lu cpu_id=%lu"
> +cpu_idle "state=%ld cpu_id=%lu"
> +cpu_frequency "frequency=%lu cpu_id=%lu"
>
> A suspend event is used to indicate the system going in and out of the
> suspend mode:
> diff --git a/include/trace/events/power.h b/include/trace/events/power.h
> index 908977d..f1b82de 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,13 @@ DECLARE_EVENT_CLASS(cpu,
> __entry->cpu_id = cpu_id;
> ),
>
> - TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
> + TP_printk("state=%ld cpu_id=%lu", (long)__entry->state,
> (unsigned long)__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 +141,14 @@ 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=%lu cpu_id=%lu", (unsigned long)__entry->state,
> + (unsigned long)__entry->cpu_id)
> );
>
> TRACE_EVENT(device_pm_callback_start,
next parent reply other threads:[~2018-02-14 15:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1518576038-16198-1-git-send-email-changbin.du@intel.com>
2018-02-14 15:19 ` Steven Rostedt [this message]
[not found] ` <20180214095440.2debdbba@gandalf.local.home>
[not found] ` <20180227093526.z7gxg2nk7xmfk2oi@intel.com>
[not found] ` <20180227173938.0826ed9b@vmware.local.home>
2018-02-28 2:45 ` Du, Changbin
2018-02-28 9:14 ` Rafael J. Wysocki
2018-02-28 9:07 ` Du, Changbin
[not found] <1519809638-24248-1-git-send-email-changbin.du@intel.com>
[not found] ` <CAJZ5v0jqG0pcqOuvAVoP7sNKoOe+3ByMk4X5AZASp84OPcrgPg@mail.gmail.com>
[not found] ` <20180301022719.xyfcu5tpmadjxbut@intel.com>
2018-03-02 9:24 ` Rafael J. Wysocki
2018-03-02 9:41 ` Du, Changbin
2018-03-02 10:18 ` Rafael J. Wysocki
2018-03-02 10:15 ` Du, Changbin
2018-03-02 10:39 ` Rafael J. Wysocki
2018-03-02 10:50 ` Du, Changbin
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=20180214101930.7599c67b@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=changbin.du@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
/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
all inboxes | Powered by JetHome®