Re: [PATCH v2 0/3] perf: introduce perf based task analyzer

From: Petar Gligoric
Date: Thu Dec 08 2022 - 07:15:59 EST


> > Thanks for the input! For this patchset we explicitly decided against
> > extending "perf sched timehist" - after some pros and cons. Mainly we
> > didn't want to break existing programs (which might parse the output of
> > perf sched) and also the goal of the task-analyzer is a bit different.
> > E.g what will follow as a follow-up patch, is to show IRQs visually
> > pleasing intermixed with tasks to show potential sources of task
> > latency. This will be offered as an option for the task-analyzer, but
> > would be too much functionality for "perf sched timehist". This was the
> > main reason why we decided against the extension.
>
> Then you might want to add a new sub-command under perf sched.
> But I guess we can just add a new option for the different output
> format in the perf sched timehist.
>
> Anyway, "perf script" is a generic tool not targeting specific events.
> This functionality requires sched_switch (and more?) then we need
> the record part to make sure the data has the events. That's why
> it's natural to have it in perf sched IMHO.
>
> Thanks,
> Namhyung

We assumed that python scripts should not only be used as a "generic tool".
There are a number of tools like flamegraph, netdev-times, dropmonitor and
other scripts that analyze and look at *very specific* events. The question is
rather, why should this be implemented in C? When using Python - with batteries
included - less code has to be written for the identical result, and it is less
error-prone than C (less technical debt). We have measured the performance,
even for very large perf.data files, and again we see no problems.

But maybe this should be clarified in principle! What do you say Arnaldo, Ian,
...?

Petar