linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Chunxin Zang <zangchunxin@lixiang.com>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, irogers@google.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jerry Zhou <zhouchunhua@lixiang.com>
Subject: Re: [PATCH v3] perf sched: Fix sched latency analysis incorrect
Date: Mon, 27 Mar 2023 12:00:52 -0700	[thread overview]
Message-ID: <CAM9d7chc+eJvPMm3ZhcxcbYUjNzVvBG7N0DvVwMzmOOb+-xiMQ@mail.gmail.com> (raw)
In-Reply-To: <20230317063246.1128219-1-zangchunxin@lixiang.com>

On Thu, Mar 16, 2023 at 11:33 PM Chunxin Zang <zangchunxin@lixiang.com> 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 perf sched replay (add_sched_event_wakeup)?  I think
it'd make unnecessary sched atoms for sched_wakeup.

Can we check the wakeup and waking events and disable the wakeup
if the waking is found like in perf_sched__timehist?

Thanks,
Namhyung


>
> 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.
>
> Signed-off-by: Chunxin Zang <zangchunxin@lixiang.com>
> Signed-off-by: Jerry Zhou <zhouchunhua@lixiang.com>
> ---
>
>         changelogs in v3:
>         1) fix non-ASCII characters in commit log.
>
>         changelogs in v2:
>         1) fix email address disappearing in 'signed off by'
>
>  tools/perf/builtin-sched.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 86e18575c9be..1af4ec1ac824 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -1819,6 +1819,7 @@ static int perf_sched__read_events(struct perf_sched *sched)
>         const struct evsel_str_handler handlers[] = {
>                 { "sched:sched_switch",       process_sched_switch_event, },
>                 { "sched:sched_stat_runtime", process_sched_runtime_event, },
> +               { "sched:sched_waking",       process_sched_wakeup_event, },
>                 { "sched:sched_wakeup",       process_sched_wakeup_event, },
>                 { "sched:sched_wakeup_new",   process_sched_wakeup_event, },
>                 { "sched:sched_migrate_task", process_sched_migrate_task_event, },
> --
> 2.25.1
>
> 声明:这封邮件只允许文件接收者阅读,有很高的机密性要求。禁止其他人使用、打开、复制或转发里面的任何内容。如果本邮件错误地发给了你,请联系邮件发出者并删除这个文件。机密及法律的特权并不因为误发邮件而放弃或丧失。任何提出的观点或意见只属于作者的个人见解,并不一定代表本公司。

  parent reply	other threads:[~2023-03-27 19:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17  6:32 [PATCH v3] perf sched: Fix sched latency analysis incorrect Chunxin Zang
2023-03-21  7:32 ` Mike Galbraith
2023-03-21 11:05   ` Chunxin Zang
2023-03-27 19:00 ` Namhyung Kim [this message]
2023-03-28  3:24   ` Chunxin Zang

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=CAM9d7chc+eJvPMm3ZhcxcbYUjNzVvBG7N0DvVwMzmOOb+-xiMQ@mail.gmail.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --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=peterz@infradead.org \
    --cc=zangchunxin@lixiang.com \
    --cc=zhouchunhua@lixiang.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).