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=fXWdaGr3cNsUMWqrb_be38z01Eq5UhyPU6eUSLJNQHyQg@mail.gmail.com>
Date:   Tue, 8 Nov 2022 15:23:07 -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 8/9] perf stat: Fix condition in print_interval()

On Mon, Nov 7, 2022 at 1:33 PM Namhyung Kim <namhyung@...nel.org> wrote:
>
> The num_print_interval and config->interval_clear should be checked
> together like other places like later in the function.  Otherwise,
> the --interval-clear option could print the headers for the CSV or
> JSON output unnecessarily.
>
> 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, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index aab2576bd40f..a10af26c26ab 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -902,8 +902,8 @@ static void print_interval(struct perf_stat_config *config,
>                 sprintf(prefix, "{\"interval\" : %lu.%09lu}", (unsigned long)
>                                  ts->tv_sec, ts->tv_nsec);
>
> -       if ((num_print_interval == 0 && !config->csv_output && !config->json_output)
> -                        || config->interval_clear) {
> +       if ((num_print_interval == 0 || config->interval_clear) &&
> +                       !config->csv_output && !config->json_output) {
>                 switch (config->aggr_mode) {
>                 case AGGR_NODE:
>                         fprintf(output, "#           time node   cpus");
> --
> 2.38.1.431.g37b22c650d-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ