Re: [PATCH v2] trace: Add migrate-disabled counter to tracing output.

From: Sebastian Andrzej Siewior
Date: Mon Sep 06 2021 - 04:13:49 EST


On 2021-09-03 19:42:16 [-0400], Steven Rostedt wrote:
Hi Steven,

> BTW,
>
> When doing a v2, always create a new thread. Never send it as a reply to
> the previous patch. The reason I missed this is because replies to previous
> patches do not end up in my internal patchwork. And I only look at that for
> patches. Not my INBOX.

oki.

>
> > --- a/kernel/trace/trace_events.c
> > +++ b/kernel/trace/trace_events.c
> > @@ -181,7 +181,8 @@ static int trace_define_common_fields(void)
> >
> > __common_field(unsigned short, type);
> > __common_field(unsigned char, flags);
> > - __common_field(unsigned char, preempt_count);
> > + /* XXX */
> > + __common_field(unsigned char, preempt_mg_count);
> > __common_field(int, pid);
> >
> > return ret;
>
> I'm going to have to nuke this hunk of the patch, and update all the other
> locations that have preempt_mg_count in it. Because I just tested it, and
> this breaks user space.

I left that with that XXX on purpose so you can look and comment and say
how to fix it. The problem I had with preempt_count was that only the
lower nibble contains the preemption counter. So I thought you could
easily came up with something how this can be split or taught to only
expose the lower nibble. I didn't after a few attempts.
My understanding is that this `preempt_count' is also used in the filter
tracefs file so something like "preempt_count > 1" > filter would also
match for migrate_count = 2, preempt_count = 1. You seem to be happy to
filter in user space.

Sebastian