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] [day] [month] [year] [list]
Date:	Mon, 14 Apr 2014 19:09:32 +0200
From:	Andi Kleen <andi@...stfloor.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Andi Kleen <andi@...stfloor.org>, acme@...radead.org,
	mingo@...nel.org, linux-kernel@...r.kernel.org,
	peterz@...radead.org, eranian@...gle.com, namhyung@...nel.org,
	Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 2/2] perf, tools: Support spark lines in perf stat

> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ