From: Peter Zijlstra <peterz@infradead.org>
To: Ajay Kaher <ajay.kaher@broadcom.com>
Cc: mingo@redhat.com, acme@kernel.org, namhyung@kernel.org,
mark.rutland@arm.com, rostedt@goodmis.org,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
kan.liang@linux.intel.com, yangjihong1@huawei.com,
zegao2021@gmail.com, leo.yan@linux.dev, asmadeus@codewreck.org,
siyanteng@loongson.cn, sunhaiyong@loongson.cn,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
alexey.makhalov@broadcom.com, vasavi.sirnapalli@broadcom.com,
Vamsi Krishna Brahmajosyula
<vamsi-krishna.brahmajosyula@broadcom.com>,
nadav.amit@gmail.com
Subject: Re: [PATCH RFC 1/3] perf/core: add logic to collect off-cpu sample
Date: Mon, 15 Jul 2024 13:48:05 +0200 [thread overview]
Message-ID: <20240715114805.GF14400@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CAD2QZ9YQ6n_6J+bq+wNxS5bGuAOsLkSiicigan84qaD+xrjS3Q@mail.gmail.com>
On Sun, Jul 14, 2024 at 09:53:10PM +0530, Ajay Kaher wrote:
> On Fri, Jul 12, 2024 at 3:19 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Thu, Jul 11, 2024 at 05:46:17PM +0530, Ajay Kaher wrote:
> > > following logics has been added to collect the off-cpu sample:
> > >
> > > - 'task_pt_regs(current)' has been used to capture registers
> > > status off-cpu sample.
> > >
> > > - off-cpu time represent the time period for which the target
> > > process not occupying the cpu cycles. And calculate as:
> > >
> > > off-cpu time = swap-in time - swap-out time
> > >
> >
> > I have absolutely no idea what you're trying to do :/ The above does not
> > constitute a comprehensible Changelog.
>
> Sorry Peter, it’s sched-in/out (not swap-in/out).
>
> 'Perf record' captures on-cpu samples at frequency which is specified by
> the user ( i.e. time period to collect sample is NSEC_PER_SEC / freq).
>
> This patch is to collect the off_cpu sample and time period of off_cpu
> sample is calculated based upon the time when target task was sched_out
> to sched_in, as:
>
> off-cpu time period = sched_in time - sched-out time
But but but... you don't need anything new for that. The sched_wakeup
tracepoint should generate an event in both the task/cpu that does the
wakeup *AND* the task being woken.
So sched_switch + sched_wakeup should get you all this already. What am
I missing?
https://lore.kernel.org/all/1342016098-213063-1-git-send-email-avagin@openvz.org/T/#u
next prev parent reply other threads:[~2024-07-15 11:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-11 12:16 [PATCH RFC 0/3] perf: add logic to collect off-cpu samples Ajay Kaher
2024-07-11 12:16 ` [PATCH RFC 1/3] perf/core: add logic to collect off-cpu sample Ajay Kaher
2024-07-11 21:49 ` Peter Zijlstra
2024-07-14 16:23 ` Ajay Kaher
2024-07-15 11:48 ` Peter Zijlstra [this message]
2024-07-11 12:16 ` [PATCH RFC 2/3] perf/record: add options --off-cpu-kernel Ajay Kaher
2024-07-11 12:16 ` [PATCH RFC 3/3] perf/report: add off-cpu samples Ajay Kaher
2024-07-11 21:58 ` [PATCH RFC 0/3] perf: add logic to collect " Ian Rogers
2024-07-13 7:42 ` Ajay Kaher
2024-07-14 18:32 ` Ian Rogers
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=20240715114805.GF14400@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ajay.kaher@broadcom.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexey.makhalov@broadcom.com \
--cc=asmadeus@codewreck.org \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=namhyung@kernel.org \
--cc=rostedt@goodmis.org \
--cc=siyanteng@loongson.cn \
--cc=sunhaiyong@loongson.cn \
--cc=vamsi-krishna.brahmajosyula@broadcom.com \
--cc=vasavi.sirnapalli@broadcom.com \
--cc=yangjihong1@huawei.com \
--cc=zegao2021@gmail.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