From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: acme@infradead.org, mingo@kernel.org,
linux-kernel@vger.kernel.org, peterz@infradead.org,
eranian@google.com, namhyung@kernel.org,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 2/2] perf, tools: Support spark lines in perf stat
Date: Mon, 14 Apr 2014 10:50:28 +0200 [thread overview]
Message-ID: <20140414085028.GA1433@krava.brq.redhat.com> (raw)
In-Reply-To: <1395768699-16060-2-git-send-email-andi@firstfloor.org>
On Tue, Mar 25, 2014 at 10:31:39AM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
SNIP
> @@ -1176,6 +1176,9 @@ static void print_aggr(char *prefix)
> if (run != ena)
> fprintf(output, " (%.2f%%)",
> 100.0 * run / ena);
> +
> + fputc(' ', output);
> + print_stat_spark(output, counter->priv);
> }
> fputc('\n', output);
> }
> @@ -1224,6 +1227,9 @@ static void print_counter_aggr(struct perf_evsel *counter, char *prefix)
>
> print_noise(counter, avg);
>
> + fputc(' ', output);
> + print_stat_spark(output, counter->priv);
> +
> if (csv_output) {
> fputc('\n', output);
> return;
> @@ -1295,6 +1301,9 @@ static void print_counter(struct perf_evsel *counter, char *prefix)
> if (run != ena)
> fprintf(output, " (%.2f%%)",
> 100.0 * run / ena);
> +
> + fputc(' ', output);
> + print_stat_spark(output, counter->priv);
> }
> fputc('\n', output);
> }
> @@ -1355,6 +1364,9 @@ static void print_stat(int argc, const char **argv)
> fprintf(output, " ");
> print_noise_pct(stddev_stats(&walltime_nsecs_stats),
> avg_stats(&walltime_nsecs_stats));
> +
> + fputc(' ', output);
> + print_stat_spark(output, &walltime_nsecs_stats);
Do we want to be that explicit about printing ' ' here?
I dont see it elsewhere..
fput could go into print_stat_spark
SNIP
> +void print_stat_spark(FILE *f, struct stats *stat)
> +{
> + int n = stat->n, len;
> +
> + if (n <= 1)
> + return;
> + len = n;
> + if (len > NUM_SPARK_VALS)
> + len = NUM_SPARK_VALS;
> + if (all_the_same(stat->svals, len))
> + return;
> + print_spark(f, stat->svals, len);
> + if (stat->n > NUM_SPARK_VALS)
> + fputs("..", f);
> +}
whats the reason for 'n' in here? looks like you could do only with 'len'
thanks,
jirka
next prev parent reply other threads:[~2014-04-14 9:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 17:31 [PATCH 1/2] perf, tools, stat: Initialize statistics correctly Andi Kleen
2014-03-25 17:31 ` [PATCH 2/2] perf, tools: Support spark lines in perf stat Andi Kleen
2014-04-13 18:08 ` Jiri Olsa
2014-04-14 8:50 ` Jiri Olsa [this message]
2014-04-14 17:09 ` Andi Kleen
2014-04-09 1:49 ` [PATCH 1/2] perf, tools, stat: Initialize statistics correctly Namhyung Kim
2014-04-09 13:42 ` Jiri Olsa
2014-04-14 14:54 ` [tip:perf/urgent] perf " tip-bot for Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140414085028.GA1433@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=acme@infradead.org \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome