All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Yao Jin <yao.jin@linux.intel.com>,
	Kan Liang <kan.liang@linux.intel.com>
Subject: Re: [PATCH] perf record: Add a dummy event for a hybrid system
Date: Thu, 8 Jul 2021 22:32:13 -0700	[thread overview]
Message-ID: <CAM9d7cgGmAsa1wCQJM_FfhiG9+ULqAdCTyqw4wSqbnNSzvrdWQ@mail.gmail.com> (raw)
In-Reply-To: <1625760212-18441-1-git-send-email-kan.liang@intel.com>

On Thu, Jul 8, 2021 at 9:05 AM <kan.liang@intel.com> wrote:
>
> From: Kan Liang <kan.liang@linux.intel.com>
>
> Some symbols may not be resolved if a user only monitor one type of PMU.
>
>  $ sudo perf record -e cpu_atom/branch-instructions/ ./big_small_workload
>  $ sudo perf report –stdio
>  # Overhead  Command    Shared Object      Symbol
>  # ........  .........  .................
>  # ......................................
>  #
>     28.02%  perf-exec  [unknown]          [.] 0x0000000000401cf6
>     11.32%  perf-exec  [unknown]          [.] 0x0000000000401d04
>     10.90%  perf-exec  [unknown]          [.] 0x0000000000401d11
>     10.61%  perf-exec  [unknown]          [.] 0x0000000000401cfc
>
> To parse symbols, the side-band events, e.g., COMM, which are generated
> by the kernel are required. To decide whether to generate the side-band
> event, the kernel relies on the event_filter_match() to filter the
> unrelated events. On a hybrid system, the event_filter_match() further
> checks the CPU mask of the current enabled PMU. If an event is collected
> on the CPU which doesn't have an enabled PMU, it's treated as an
> unrelated event.
>
> The "big_small_workload" is created in a big core, but runs on a small
> core. The side-band events are filtered, because the user only monitors
> the PMU of the small core. The big core PMU is not enabled.
>
> For a hybrid system, a dummy event is required to generate the complete
> side-band events.
>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/builtin-record.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 3337b5f..99607b9 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -891,11 +891,12 @@ static int record__open(struct record *rec)
>         int rc = 0;
>
>         /*
> -        * For initial_delay or system wide, we need to add a dummy event so
> -        * that we can track PERF_RECORD_MMAP to cover the delay of waiting or
> -        * event synthesis.
> +        * For initial_delay or system wide or a hybrid system, we need to
> +        * add a dummy event so that we can track PERF_RECORD_MMAP to cover
> +        * the delay of waiting or event synthesis.
>          */
> -       if (opts->initial_delay || target__has_cpu(&opts->target)) {
> +       if (opts->initial_delay || target__has_cpu(&opts->target) ||
> +           perf_pmu__has_hybrid()) {
>                 pos = evlist__get_tracking_event(evlist);
>                 if (!evsel__is_dummy_event(pos)) {
>                         /* Set up dummy event. */
> --
> 2.7.4
>

  reply	other threads:[~2021-07-09  5:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 16:03 [PATCH] perf record: Add a dummy event for a hybrid system kan.liang
2021-07-09  5:32 ` Namhyung Kim [this message]
2021-07-09 12:51   ` Arnaldo Carvalho de Melo

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=CAM9d7cgGmAsa1wCQJM_FfhiG9+ULqAdCTyqw4wSqbnNSzvrdWQ@mail.gmail.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=yao.jin@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.