[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <D2E25104-C81C-4DF5-B781-E3F839AD3836@fb.com>
Date: Mon, 10 Feb 2020 18:53:20 +0000
From: Song Liu <songliubraving@...com>
To: Kim Phillips <kim.phillips@....com>
CC: Arnaldo Carvalho de Melo <acme@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
"Namhyung Kim" <namhyung@...nel.org>,
Cong Wang <xiyou.wangcong@...il.com>,
Jin Yao <yao.jin@...ux.intel.com>,
Kan Liang <kan.liang@...ux.intel.com>,
"Davidlohr Bueso" <dave@...olabs.net>,
"linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jiri Olsa <jolsa@...hat.com>, Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 1/3 v2] perf stat: don't report a null stalled cycles per
insn metric
> On Feb 7, 2020, at 3:06 PM, Kim Phillips <kim.phillips@....com> wrote:
>
> For data collected on machines with front end stalled cycles supported,
> such as found on modern AMD CPU families, commit 146540fb545b ("perf
> stat: Always separate stalled cycles per insn") introduces a new line
> in CSV output with a leading comma that upsets some automated scripts.
> Scripts have to use "-e ex_ret_instr" to work around this issue, after
> upgrading to a version of perf with that commit.
>
> We could add "if (have_frontend_stalled && !config->csv_sep)"
> to the not (total && avg) else clause, to emphasize that CSV users
> are usually scripts, and are written to do only what is needed, i.e.,
> they wouldn't typically invoke "perf stat" without specifying an
> explicit event list.
>
> But - let alone CSV output - why should users now tolerate a constant
> 0-reporting extra line in regular terminal output?:
>
> BEFORE:
>
> $ sudo perf stat --all-cpus -einstructions,cycles -- sleep 1
>
> Performance counter stats for 'system wide':
>
> 181,110,981 instructions # 0.58 insn per cycle
> # 0.00 stalled cycles per insn
> 309,876,469 cycles
>
> 1.002202582 seconds time elapsed
>
> The user would not like to see the now permanent
> "0.00 stalled cycles per insn" line fixture, as it gives
> no useful information.
>
> So this patch removes the printing of the zeroed stalled cycles
> line altogether, almost reverting the very original commit fb4605ba47e7
> ("perf stat: Check for frontend stalled for metrics"), which seems
> like it was written to normalize --metric-only column output
> of common Intel machines at the time: modern Intel machines
> have ceased to support the genericised frontend stalled metrics AFAICT.
>
> AFTER:
>
> $ sudo perf stat --all-cpus -einstructions,cycles -- sleep 1
>
> Performance counter stats for 'system wide':
>
> 244,071,432 instructions # 0.69 insn per cycle
> 355,353,490 cycles
>
> 1.001862516 seconds time elapsed
>
> Output behaviour when stalled cycles is indeed measured is not affected
> (BEFORE == AFTER):
>
> $ sudo perf stat --all-cpus -einstructions,cycles,stalled-cycles-frontend -- sleep 1
>
> Performance counter stats for 'system wide':
>
> 247,227,799 instructions # 0.63 insn per cycle
> # 0.26 stalled cycles per insn
> 394,745,636 cycles
> 63,194,485 stalled-cycles-frontend # 16.01% frontend cycles idle
>
> 1.002079770 seconds time elapsed
>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
> Cc: Jiri Olsa <jolsa@...nel.org>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Cong Wang <xiyou.wangcong@...il.com>
> Cc: Jin Yao <yao.jin@...ux.intel.com>
> Cc: Kan Liang <kan.liang@...ux.intel.com>
> Cc: Kim Phillips <kim.phillips@....com>
> Cc: Song Liu <songliubraving@...com>
> Cc: Davidlohr Bueso <dave@...olabs.net>
> Cc: linux-perf-users@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
> Acked-by: Jiri Olsa <jolsa@...hat.com>
> Acked-by: Andi Kleen <ak@...ux.intel.com>
> Fixes: 146540fb545b ("perf stat: Always separate stalled cycles per insn")
> Signed-off-by: Kim Phillips <kim.phillips@....com>
Acked-by: Song Liu <songliubraving@...com>
Thanks for improving perf on AMD systems!
Powered by blists - more mailing lists