[11/11] perf stat: Add missing separator in the CSV header

Message ID 20221112032244.1077370-12-namhyung@kernel.org
State New
Headers
Series perf stat: Cleanup perf stat output display (v2) |

Commit Message

Namhyung Kim Nov. 12, 2022, 3:22 a.m. UTC
  It should have a comma after 'cpus' for socket and die aggregation mode.
The output of the following command shows the issue.

  $ sudo perf stat -a --per-socket -x, --metric-only -I1 true

Before:
                  +--- here
                  V
   time,socket,cpusGhz,insn per cycle,branch-misses of all branches,
       0.000908461,S0,8,0.950,1.65,1.21,

After:
   time,socket,cpus,GHz,insn per cycle,branch-misses of all branches,
       0.000683094,S0,8,0.593,2.00,0.60,

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/stat-display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ian Rogers Nov. 14, 2022, 6:21 p.m. UTC | #1
On Fri, Nov 11, 2022 at 7:23 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> It should have a comma after 'cpus' for socket and die aggregation mode.
> The output of the following command shows the issue.
>
>   $ sudo perf stat -a --per-socket -x, --metric-only -I1 true
>
> Before:
>                   +--- here
>                   V
>    time,socket,cpusGhz,insn per cycle,branch-misses of all branches,
>        0.000908461,S0,8,0.950,1.65,1.21,
>
> After:
>    time,socket,cpus,GHz,insn per cycle,branch-misses of all branches,
>        0.000683094,S0,8,0.593,2.00,0.60,
>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/util/stat-display.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index 96bb7a42fd41..a316807255cd 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -828,8 +828,8 @@ static int aggr_header_lens[] = {
>
>  static const char *aggr_header_csv[] = {
>         [AGGR_CORE]     =       "core,cpus,",
> -       [AGGR_DIE]      =       "die,cpus",
> -       [AGGR_SOCKET]   =       "socket,cpus",
> +       [AGGR_DIE]      =       "die,cpus,",
> +       [AGGR_SOCKET]   =       "socket,cpus,",
>         [AGGR_NONE]     =       "cpu,",
>         [AGGR_THREAD]   =       "comm-pid,",
>         [AGGR_NODE]     =       "node,",
> --
> 2.38.1.493.g58b659f92b-goog
>
  

Patch

diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index 96bb7a42fd41..a316807255cd 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -828,8 +828,8 @@  static int aggr_header_lens[] = {
 
 static const char *aggr_header_csv[] = {
 	[AGGR_CORE] 	= 	"core,cpus,",
-	[AGGR_DIE] 	= 	"die,cpus",
-	[AGGR_SOCKET] 	= 	"socket,cpus",
+	[AGGR_DIE] 	= 	"die,cpus,",
+	[AGGR_SOCKET] 	= 	"socket,cpus,",
 	[AGGR_NONE] 	= 	"cpu,",
 	[AGGR_THREAD] 	= 	"comm-pid,",
 	[AGGR_NODE] 	= 	"node,",