Re: [RFC PATCH v6 1/5] perf sched: sync state char array with the kernel

From: Ze Gao
Date: Thu Aug 03 2023 - 08:26:12 EST



perf sched: sync state char array with the kernel

Since commit e936e8e459e14 ("perf tools: Adapt the
TASK_STATE_TO_CHAR_STR to new value in kernel space."),
the state char array that is used to interpret the
states of tasks being switched out have not synced
once with kernel definitions. Whereas the task report
logic is evolving over this time and the definition
of this state char array has been changed multiple
times. And this leads to inconsistency.

As of this writing, perf timehist --state still reports
the wrong states because TASK_STATE_TO_CHAR_STR is too
outdated to use.

So sync TASK_STATE_TO_CHAR_STR to match the latest kernel
definitions to fix it.

Signed-off-by: Ze Gao <zegao@xxxxxxxxxxx>


On Thu, Aug 3, 2023 at 6:29 PM Ze Gao <zegao2021@xxxxxxxxx> wrote:
> On Thu, Aug 3, 2023 at 5:09 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> >
> > On Thu, 3 Aug 2023 04:33:48 -0400
> > Ze Gao <zegao2021@xxxxxxxxx> wrote:
> >
> > Hi Ze,
> >
> > > Update state char array and then remove unused and stale
> > > macros, which are kernel internal representations and not
> > > encouraged to use anymore.
> > >
> >
> > A couple of things.
> >
> > First, the change logs of every commit need to specify the "why". The
> > subject can say "what", but the change log really needs to explain why this
> > patch is important. For example, this patch is really two changes (and thus
> > should actually be two patches). (I'll also comment on the other patches)
> Thanks for the feedback! Will elaborate the changes in each changelog.
> > 1. The update of the state char array. You should explain why it's being
> > updated. If it was wrong, it needs to state the commit that changed to make
> > that happen.
> >
> > 2. For the removing the stale macros, the change log can simply state that
> > the macros are unused in the code and are being removed.
> >
> > Finally, I know you're eager to get this patch set in, but please hold off
> > sending a new version immediately after a comment or two. Some maintainers
> > prefer submitters to wait a week or so, otherwise you will tend to "spam"
> > their inboxes. There's more than one maintainer Cc'd on this series, and you
> > need to be courteous not to send too many emails in a short period of time.
> Noted! Actually I'm in no rush and just to make sure people see the
> latest patches so they do not have to waste time on the old series.
> Will hold off to resolve all the comments in this thread.
> And thanks for pointing this out.
> Regards,
> Ze