linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] perf stat: Disable NMI watchdog message on hybrid
@ 2021-06-10  3:45 Jin Yao
  2021-07-06  2:19 ` Jin, Yao
  0 siblings, 1 reply; 4+ messages in thread
From: Jin Yao @ 2021-06-10  3:45 UTC (permalink / raw)
  To: acme, jolsa, peterz, mingo, alexander.shishkin
  Cc: Linux-kernel, ak, kan.liang, yao.jin, Jin Yao

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>
---
v3:
 - Use evlist__has_hybrid() to check there is at least one hybrid
   event in evlist.

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.

 tools/perf/util/stat-display.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index b759dfd633b4..55ae0d1705a9 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -19,6 +19,7 @@
 #include "util.h"
 #include "iostat.h"
 #include "pmu-hybrid.h"
+#include "evlist-hybrid.h"
 
 #define CNTR_NOT_SUPPORTED	"<not supported>"
 #define CNTR_NOT_COUNTED	"<not counted>"
@@ -465,9 +466,11 @@ 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 (!evlist__has_hybrid(counter->evlist)) {
+				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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] perf stat: Disable NMI watchdog message on hybrid
  2021-06-10  3:45 [PATCH v3] perf stat: Disable NMI watchdog message on hybrid Jin Yao
@ 2021-07-06  2:19 ` Jin, Yao
  2021-07-06 19:54   ` Jiri Olsa
  0 siblings, 1 reply; 4+ messages in thread
From: Jin, Yao @ 2021-07-06  2:19 UTC (permalink / raw)
  To: acme, jolsa, peterz, mingo, alexander.shishkin
  Cc: Linux-kernel, ak, kan.liang, yao.jin

Hi Jiri,

On 6/10/2021 11:45 AM, 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>
> ---
> v3:
>   - Use evlist__has_hybrid() to check there is at least one hybrid
>     event in evlist.
> 
> 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.
> 
>   tools/perf/util/stat-display.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index b759dfd633b4..55ae0d1705a9 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -19,6 +19,7 @@
>   #include "util.h"
>   #include "iostat.h"
>   #include "pmu-hybrid.h"
> +#include "evlist-hybrid.h"
>   
>   #define CNTR_NOT_SUPPORTED	"<not supported>"
>   #define CNTR_NOT_COUNTED	"<not counted>"
> @@ -465,9 +466,11 @@ 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 (!evlist__has_hybrid(counter->evlist)) {
> +				config->print_free_counters_hint = 1;
> +				if (is_mixed_hw_group(counter))
> +					config->print_mixed_hw_group_error = 1;
> +			}
>   		}
>   
>   		fprintf(config->output, "%-*s%s",
> 

Any comments for v3?

Thanks
Jin Yao



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] perf stat: Disable NMI watchdog message on hybrid
  2021-07-06  2:19 ` Jin, Yao
@ 2021-07-06 19:54   ` Jiri Olsa
  2021-07-07 14:38     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Olsa @ 2021-07-06 19:54 UTC (permalink / raw)
  To: Jin, Yao
  Cc: acme, jolsa, peterz, mingo, alexander.shishkin, Linux-kernel, ak,
	kan.liang, yao.jin

On Tue, Jul 06, 2021 at 10:19:47AM +0800, Jin, Yao wrote:
> Hi Jiri,
> 
> On 6/10/2021 11:45 AM, 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>
> > ---
> > v3:
> >   - Use evlist__has_hybrid() to check there is at least one hybrid
> >     event in evlist.
> > 
> > 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.

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> > 
> >   tools/perf/util/stat-display.c | 9 ++++++---
> >   1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> > index b759dfd633b4..55ae0d1705a9 100644
> > --- a/tools/perf/util/stat-display.c
> > +++ b/tools/perf/util/stat-display.c
> > @@ -19,6 +19,7 @@
> >   #include "util.h"
> >   #include "iostat.h"
> >   #include "pmu-hybrid.h"
> > +#include "evlist-hybrid.h"
> >   #define CNTR_NOT_SUPPORTED	"<not supported>"
> >   #define CNTR_NOT_COUNTED	"<not counted>"
> > @@ -465,9 +466,11 @@ 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 (!evlist__has_hybrid(counter->evlist)) {
> > +				config->print_free_counters_hint = 1;
> > +				if (is_mixed_hw_group(counter))
> > +					config->print_mixed_hw_group_error = 1;
> > +			}
> >   		}
> >   		fprintf(config->output, "%-*s%s",
> > 
> 
> Any comments for v3?
> 
> Thanks
> Jin Yao
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] perf stat: Disable NMI watchdog message on hybrid
  2021-07-06 19:54   ` Jiri Olsa
@ 2021-07-07 14:38     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-07-07 14:38 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Jin, Yao, jolsa, peterz, mingo, alexander.shishkin, Linux-kernel,
	ak, kan.liang, yao.jin

Em Tue, Jul 06, 2021 at 09:54:15PM +0200, Jiri Olsa escreveu:
> On Tue, Jul 06, 2021 at 10:19:47AM +0800, Jin, Yao wrote:
> > > v3:
> > >   - Use evlist__has_hybrid() to check there is at least one hybrid
> > >     event in evlist.

> > > 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.

> Acked-by: Jiri Olsa <jolsa@redhat.com>

Thanks, applied.

- Arnaldo


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-07 14:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10  3:45 [PATCH v3] perf stat: Disable NMI watchdog message on hybrid Jin Yao
2021-07-06  2:19 ` Jin, Yao
2021-07-06 19:54   ` Jiri Olsa
2021-07-07 14:38     ` Arnaldo Carvalho de Melo

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).