linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] perf sched: Fix task state report
@ 2024-01-15  7:23 Ze Gao
  2024-01-15  7:23 ` [PATCH 1/4] perf sched: Sync state char array with the kernel Ze Gao
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Ze Gao @ 2024-01-15  7:23 UTC (permalink / raw)
  To: Adrian Hunter, Alexander Shishkin, Arnaldo Carvalho de Melo,
	Ian Rogers, Ingo Molnar, Jiri Olsa, Mark Rutland, Namhyung Kim,
	Peter Zijlstra, Steven Rostedt
  Cc: linux-kernel, linux-perf-users, Ze Gao

Hi,

The problems of task state report in both libtraceevent
and perf sched has been reported in [1]. In short, they
parsed the wrong state due to relying on the outdated
hardcoded state string to interpret the raw bitmask
from the record, which left the messes to maintain the
backward compatibilities for both tools.

[1] has not managed to make itself into the kernel, the
problems and the solutions are well studied though.

Luckily, as suggested by Steven, perf/libtraceevent
records the print format, especially the __print_flags()
part of the in-kernel tracepoint sched_switch in its
metadata, and we have a chance to build the state str
on the fly by parsing it.

Now that libtraceevent has landed this solution in [2],
we now apply the same idea to perf as well.

Regards,

        -- Ze

[1]: https://lore.kernel.org/lkml/20230803083352.1585-1-zegao@tencent.com/
[2]: https://lore.kernel.org/linux-trace-devel/20231224140732.7d41698d@rorschach.local.home/

Ze Gao (4):
  perf sched: Sync state char array with the kernel
  perf util: Add helpers to parse task state string from libtraceevent
  perf util: Add evsel__taskstate() to parse the task state info instead
  perf sched: Commit to evsel__taskstate() to parse task state info

 tools/perf/builtin-sched.c |  57 +++------------
 tools/perf/util/evsel.c    | 146 +++++++++++++++++++++++++++++++++++++
 tools/perf/util/evsel.h    |   1 +
 3 files changed, 157 insertions(+), 47 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-01-22  7:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-15  7:23 [PATCH 0/4] perf sched: Fix task state report Ze Gao
2024-01-15  7:23 ` [PATCH 1/4] perf sched: Sync state char array with the kernel Ze Gao
2024-01-15  7:23 ` [PATCH 2/4] perf util: Add helpers to parse task state string from libtraceevent Ze Gao
2024-01-15  7:23 ` [PATCH 3/4] perf util: Add evsel__taskstate() to parse the task state info instead Ze Gao
2024-01-15  7:23 ` [PATCH 4/4] perf sched: Commit to evsel__taskstate() to parse task state info Ze Gao
2024-01-17  1:35 ` [PATCH 0/4] perf sched: Fix task state report Namhyung Kim
2024-01-18  3:00   ` Ze Gao
2024-01-18  3:15     ` Ze Gao
2024-01-18 23:53       ` Namhyung Kim
2024-01-19  1:54         ` Ze Gao
2024-01-19 22:44           ` Namhyung Kim
2024-01-22  3:08             ` Ze Gao
2024-01-22  3:15               ` Ze Gao
2024-01-22  7:19               ` Ze Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).