lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fU+Xeqt6sn5ESkNnCHQNTYjbrv-qiZBpbtMRu3ayGL7pA@mail.gmail.com>
Date:   Tue, 8 Nov 2022 15:23:34 -0800
From:   Ian Rogers <irogers@...gle.com>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        linux-perf-users@...r.kernel.org,
        Kan Liang <kan.liang@...ux.intel.com>,
        Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
        James Clark <james.clark@....com>
Subject: Re: [PATCH 9/9] perf stat: Consolidate condition to print metrics

On Mon, Nov 7, 2022 at 1:33 PM Namhyung Kim <namhyung@...nel.org> wrote:
>
> The pm variable holds an appropriate function to print metrics for CSV
> anf JSON already.  So we can combine the if statement to simplify the
> code a little bit.  This also matches to the above condition for non-CSV
> and non-JSON case.
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>

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

Thanks,
Ian

> ---
>  tools/perf/util/stat-display.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index a10af26c26ab..4d3999673dde 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -600,9 +600,7 @@ static void printout(struct perf_stat_config *config, struct aggr_cpu_id id, int
>                         pm(config, &os, NULL, NULL, "", 0);
>                 print_noise(config, counter, noise);
>                 print_running(config, run, ena);
> -               if (config->csv_output)
> -                       pm(config, &os, NULL, NULL, "", 0);
> -               else if (config->json_output)
> +               if (config->csv_output || config->json_output)
>                         pm(config, &os, NULL, NULL, "", 0);
>                 return;
>         }
> --
> 2.38.1.431.g37b22c650d-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ