All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Du, Changbin" <changbin.du@intel.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Rafael Wysocki <rafael.j.wysocki@intel.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] tracing/power: Polish the tracepoints cpu_idle and cpu_frequency
Date: Fri, 2 Mar 2018 10:24:45 +0100	[thread overview]
Message-ID: <CAJZ5v0j8GsaK7kJ4hyvyQYOpa6QmoP2Pc69egg0hb=tb2EwpuA@mail.gmail.com> (raw)
In-Reply-To: <20180301022719.xyfcu5tpmadjxbut@intel.com>

[Fix up LKML address.]

On Thu, Mar 1, 2018 at 3:27 AM, Du, Changbin <changbin.du@intel.com> wrote:
> Hi,
> On Wed, Feb 28, 2018 at 11:27:09AM +0100, Rafael J. Wysocki wrote:
>> On Wed, Feb 28, 2018 at 10:20 AM,  <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.
>>
>> That rather isn't the case if negative values are ever passed to the
>> tracepoint, right?
>>
> yes.
>> Which seems to be the reason why you want to make this change, isn't it?
>>
> yes, to improve readability.
>
>> So maybe fix the code using the tracepoint(s) to avoid passing
>> negative values to it(them)?
> For cpu_idle event, [0, CPUIDLE_STATE_MAX) are used to index the idle state arrary,
> so I think a appropriate value for PWR_EVENT_EXIT is -1 (defined in include/trace/events/power.h).
> Or do you have a better idea? Thanks!

Sorry, I'm not sure what you mean.

I'm saying that the code using the CPU PM tracepoints is not expected
to pass -1 as the CPU number to them.  IOW, neither -1 nor its UL
representation should ever appear in the output of these tracepoints.
If that happens, it is a problem with the code using the tracepoints
which needs to be fixed.  Users should not see any of these values.

       reply	other threads:[~2018-03-02  9:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2018-03-02  9:41       ` [PATCH v2] tracing/power: Polish the tracepoints cpu_idle and cpu_frequency 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
     [not found] <1518576038-16198-1-git-send-email-changbin.du@intel.com>
2018-02-14 15:19 ` Steven Rostedt
     [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

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='CAJZ5v0j8GsaK7kJ4hyvyQYOpa6QmoP2Pc69egg0hb=tb2EwpuA@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=changbin.du@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rafael.j.wysocki@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.