From: Ze Gao <zegao2021@gmail.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>, Ingo Molnar <mingo@redhat.com>,
Jiri Olsa <jolsa@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Ze Gao <zegao@tencent.com>
Subject: [PATCH v2 0/4] perf sched: Fix task state report
Date: Mon, 22 Jan 2024 02:08:55 -0500 [thread overview]
Message-ID: <20240122070859.1394479-2-zegao@tencent.com> (raw)
No functional changes introduced in v2, just got v1 rebased onto
the tip of perf-tools-next for a clean apply.
---
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
next reply other threads:[~2024-01-22 7:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 7:08 Ze Gao [this message]
2024-01-22 7:08 ` [PATCH v2 1/4] perf sched: Sync state char array with the kernel Ze Gao
2024-01-22 7:08 ` [PATCH v2 2/4] perf util: Add helpers to parse task state string from libtraceevent Ze Gao
2024-01-22 7:08 ` [PATCH v2 3/4] perf util: Add evsel__taskstate() to parse the task state info instead Ze Gao
2024-01-22 7:08 ` [PATCH v2 4/4] perf sched: Commit to evsel__taskstate() to parse task state info Ze Gao
2024-01-23 0:38 ` Namhyung Kim
2024-01-23 2:09 ` Ze Gao
2024-01-23 2:24 ` Ze Gao
2024-01-24 0:17 ` Namhyung Kim
2024-01-23 7:02 ` [PATCH] perf evsel: Rename get_states() to parse_task_states() and make it public Ze Gao
2024-02-02 20:57 ` Namhyung Kim
2024-02-04 2:03 ` Ze Gao
2024-01-24 0:38 ` [PATCH v2 0/4] perf sched: Fix task state report Namhyung Kim
2024-01-24 2:08 ` Ze Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240122070859.1394479-2-zegao@tencent.com \
--to=zegao2021@gmail.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=zegao@tencent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).