From: Jiri Olsa <jolsa@redhat.com>
To: Jin Yao <yao.jin@linux.intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
mingo@redhat.com, alexander.shishkin@linux.intel.com,
Linux-kernel@vger.kernel.org, ak@linux.intel.com,
kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH v2] perf stat: Disable NMI watchdog message on hybrid
Date: Wed, 9 Jun 2021 22:26:18 +0200 [thread overview]
Message-ID: <YMEj6vuPcEnCz6tr@krava> (raw)
In-Reply-To: <20210609050600.7308-1-yao.jin@linux.intel.com>
On Wed, Jun 09, 2021 at 01:06:00PM +0800, Jin Yao wrote:
> If we run a single workload that only runs on big core, there is always a
> ugly message about disabling the NMI watchdog because the atom is not
> counted.
>
> Before:
>
> # ./perf stat true
>
> Performance counter stats for 'true':
>
> 0.43 msec task-clock # 0.396 CPUs utilized
> 0 context-switches # 0.000 /sec
> 0 cpu-migrations # 0.000 /sec
> 45 page-faults # 103.918 K/sec
> 639,634 cpu_core/cycles/ # 1.477 G/sec
> <not counted> cpu_atom/cycles/ (0.00%)
> 643,498 cpu_core/instructions/ # 1.486 G/sec
> <not counted> cpu_atom/instructions/ (0.00%)
> 123,715 cpu_core/branches/ # 285.694 M/sec
> <not counted> cpu_atom/branches/ (0.00%)
> 4,094 cpu_core/branch-misses/ # 9.454 M/sec
> <not counted> cpu_atom/branch-misses/ (0.00%)
>
> 0.001092407 seconds time elapsed
>
> 0.001144000 seconds user
> 0.000000000 seconds sys
>
> Some events weren't counted. Try disabling the NMI watchdog:
> echo 0 > /proc/sys/kernel/nmi_watchdog
> perf stat ...
> echo 1 > /proc/sys/kernel/nmi_watchdog
>
> # ./perf stat -e '{cpu_atom/cycles/,msr/tsc/}' true
>
> Performance counter stats for 'true':
>
> <not counted> cpu_atom/cycles/ (0.00%)
> <not counted> msr/tsc/ (0.00%)
>
> 0.001904106 seconds time elapsed
>
> 0.001947000 seconds user
> 0.000000000 seconds sys
>
> Some events weren't counted. Try disabling the NMI watchdog:
> echo 0 > /proc/sys/kernel/nmi_watchdog
> perf stat ...
> echo 1 > /proc/sys/kernel/nmi_watchdog
> The events in group usually have to be from the same PMU. Try reorganizing the group.
>
> Now we disable the NMI watchdog message on hybrid, otherwise there
> are too many false positives.
>
> After:
>
> # ./perf stat true
>
> Performance counter stats for 'true':
>
> 0.79 msec task-clock # 0.419 CPUs utilized
> 0 context-switches # 0.000 /sec
> 0 cpu-migrations # 0.000 /sec
> 48 page-faults # 60.889 K/sec
> 777,692 cpu_core/cycles/ # 986.519 M/sec
> <not counted> cpu_atom/cycles/ (0.00%)
> 669,147 cpu_core/instructions/ # 848.828 M/sec
> <not counted> cpu_atom/instructions/ (0.00%)
> 128,635 cpu_core/branches/ # 163.176 M/sec
> <not counted> cpu_atom/branches/ (0.00%)
> 4,089 cpu_core/branch-misses/ # 5.187 M/sec
> <not counted> cpu_atom/branch-misses/ (0.00%)
>
> 0.001880649 seconds time elapsed
>
> 0.001935000 seconds user
> 0.000000000 seconds sys
>
> # ./perf stat -e '{cpu_atom/cycles/,msr/tsc/}' true
>
> Performance counter stats for 'true':
>
> <not counted> cpu_atom/cycles/ (0.00%)
> <not counted> msr/tsc/ (0.00%)
>
> 0.000963319 seconds time elapsed
>
> 0.000999000 seconds user
> 0.000000000 seconds sys
>
> Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
> ---
> v2:
> - If the group was mixed with hybrid event and non-hybrid event,
> the NMI watchdog message was still reported. V2 adds checking
> for hybrid event mixed group.
>
> v1:
> - Get ACK from Jiri.
>
> tools/perf/util/stat-display.c | 22 +++++++++++++++++++---
> 1 file changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index b759dfd633b4..c1314f13bc9a 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -404,6 +404,19 @@ static bool is_mixed_hw_group(struct evsel *counter)
> return false;
> }
>
> +static bool is_mixed_hybrid_group(struct evsel *counter)
> +{
> + struct evlist *evlist = counter->evlist;
> + struct evsel *pos;
> +
> + evlist__for_each_entry(evlist, pos) {
> + if (perf_pmu__is_hybrid(pos->pmu_name))
> + return true;
> + }
so we care if there's at least one hybrid event in the list right?
it can be all full with just hybrid events, but the function name
suggests it's mixed with normal events
jirka
> +
> + return false;
> +}
> +
> static void printout(struct perf_stat_config *config, struct aggr_cpu_id id, int nr,
> struct evsel *counter, double uval,
> char *prefix, u64 run, u64 ena, double noise,
> @@ -465,9 +478,12 @@ static void printout(struct perf_stat_config *config, struct aggr_cpu_id id, int
> config->csv_sep);
>
> if (counter->supported) {
> - config->print_free_counters_hint = 1;
> - if (is_mixed_hw_group(counter))
> - config->print_mixed_hw_group_error = 1;
> + if (!is_mixed_hybrid_group(counter)) {
> + if (!perf_pmu__is_hybrid(counter->pmu_name))
> + config->print_free_counters_hint = 1;
> + if (is_mixed_hw_group(counter))
> + config->print_mixed_hw_group_error = 1;
> + }
> }
>
> fprintf(config->output, "%-*s%s",
> --
> 2.17.1
>
next prev parent reply other threads:[~2021-06-09 20:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 5:06 [PATCH v2] perf stat: Disable NMI watchdog message on hybrid Jin Yao
2021-06-09 20:26 ` Jiri Olsa [this message]
2021-06-10 1:04 ` Jin, Yao
2021-06-10 9:51 ` Jiri Olsa
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=YMEj6vuPcEnCz6tr@krava \
--to=jolsa@redhat.com \
--cc=Linux-kernel@vger.kernel.org \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=yao.jin@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox