mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Yang Jihong <yangjihong1@huawei.com>,
	peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, namhyung@kernel.org, irogers@google.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] perf/core: deliver PERF_RECORD_COMM and PERF_RECORD_MMAP side-band events to all online cpus
Date: Tue, 20 Jun 2023 21:49:14 +0300	[thread overview]
Message-ID: <f5b4e1e4-9966-c22a-1628-b3df37523841@intel.com> (raw)
In-Reply-To: <20230620155515.101222-1-yangjihong1@huawei.com>

On 20/06/23 18:55, Yang Jihong wrote:
> Tasks are migrated between cores due to scheduling.
> If perf samples specified CPUs, PERF_RECORD_COMM and PERF_RECORD_MMAP
> events need be deliver to all cores to avoids the problem that the comm
> and symbols cannot be parsed due to task migration to the target core.
> 
> The specific scenarios are as follows:
> 
>          CPU0                                 CPU1
>   perf record -C 0 start
>                               taskA starts to be created and executed
>                                 -> PERF_RECORD_COMM and PERF_RECORD_MMAP
>                                    events only deliver to CPU1
>                               ......
>                                 |
>                           migrate to CPU0
>                                 |
>   Running on CPU0    <----------/
>   ...
> 
>   perf record -C 0 stop
> 
> Now perf samples the PC of taskA. However, perf does not record the
> PERF_RECORD_COMM and PERF_RECORD_COMM events of taskA.
> Therefore, the comm and symbols of taskA cannot be parsed.

perf record deals with this for PERF_RECORD_TEXT_POKE, by opening
the corresponding "dummy" event on each CPU irrespective of whether
the main events are on selected CPUs.  Refer
evlist__add_dummy_on_all_cpus().

So this could be handled by perf record.

> 
> Yang Jihong (2):
>   perf/core: perf_iterate_sb_cpu() supports to receive side-band events
>     for all oneline cpus
>   perf/core: deliver PERF_RECORD_COMM and PERF_RECORD_MMAP side-band
>     events to all online cpus
> 
>  kernel/events/core.c | 58 +++++++++++++++++++++++++++++++-------------
>  1 file changed, 41 insertions(+), 17 deletions(-)
> 


  parent reply	other threads:[~2023-06-20 18:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 15:55 Yang Jihong
2023-06-20 15:55 ` [PATCH 1/2] perf/core: perf_iterate_sb_cpu() supports to receive side-band events for all oneline cpus Yang Jihong
2023-06-20 15:55 ` [PATCH 2/2] perf/core: deliver PERF_RECORD_COMM and PERF_RECORD_MMAP side-band events to all online cpus Yang Jihong
2023-06-20 18:49 ` Adrian Hunter [this message]
2023-06-23  5:48   ` [PATCH 0/2] " Yang Jihong

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=f5b4e1e4-9966-c22a-1628-b3df37523841@intel.com \
    --to=adrian.hunter@intel.com \
    --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=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yangjihong1@huawei.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

all inboxes | Powered by JetHome®