From: Andi Kleen <andi@firstfloor.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>,
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 19:09:32 +0200 [thread overview]
Message-ID: <20140414170931.GF22728@two.firstfloor.org> (raw)
In-Reply-To: <20140414085028.GA1433@krava.brq.redhat.com>
> fput could go into print_stat_spark
I wanted to keep the function generic, so that it can be easily
used in other places. Adding the space is somewhat specific
to stat.
Also the rest of the stat code has the white space printing
centralized in the caller too. I suppose makes it easier to change.
> > + 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'
len is capped to NUM_SPARK_VALS, but the test needs to be on the
uncapped value. Otherwise exactly NUM_SPARK_VALS entries would
get a .. incorrectly.
-Andi
next prev parent reply other threads:[~2014-04-14 17:09 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
2014-04-14 17:09 ` Andi Kleen [this message]
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=20140414170931.GF22728@two.firstfloor.org \
--to=andi@firstfloor.org \
--cc=acme@infradead.org \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.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