Re: [PATCH] perf sched: Fix sched latency analysis incorrect

From: Namhyung Kim
Date: Mon Mar 06 2023 - 17:31:35 EST


On Mon, Mar 6, 2023 at 2:05 AM Chunxin Zang <zangchunxin@xxxxxxxxxxx> wrote:
>
> > On Mar 4, 2023, at 10:14, Namhyung Kim wrote:
> >
> > Hello,
> >
> > On Fri, Mar 3, 2023 at 3:53 AM Chunxin Zang wrote:
> >>
> >> 'perf sched latency' is incorrect to get process schedule latency
> >> when it used 'sched:sched_wakeup' to analysis perf.data.
> >>
> >> Because 'perf record' prefer use 'sched:sched_waking' to
> >> 'sched:sched_wakeup' since commit d566a9c2d482 ("perf sched: Prefer
> >> sched_waking event when it exists"). It's very reasonable to
> >> evaluate process schedule latency.
> >>
> >> Similarly, update sched latency/map/replay to use sched_waking events.
> >
> > Have you checked if it works ok when data has both wakeup and
> > waking events?
>
>
> Yes, I used 'perf record -e “sched:* "' to record both wakeup and waking events,
> and use fixed perf version to analysis them, the result is correct.
> Because the function "latency_wakeup_event” will change atom->state to THREAD_WAIT_CPU
> at waking event, and judge the 'atom->state != THREAD_SLEEPING’ is false then returned at wakeup event.

Ok, good.

>
> >
> >>
> >> Signed-off-by: Chunxin Zang
> >> Signed-off-by: Jerry Zhou
> >
> > Missing email addresses.
> >
> > Otherwise looks good.
> >
> > Thanks,
> > Namhyung
>
> Maybe the company smtp email server reason, the email address is erased.
> Shall I send v2 patch version to fix it?

Yeah, that'd be nice.

Thanks,
Namhyung