perf stat: Add --sync/-S option
authorIngo Molnar <mingo@elte.hu>
Thu, 28 Apr 2011 16:17:11 +0000 (18:17 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 28 Apr 2011 06:39:39 +0000 (08:39 +0200)
commitf9cef0a90c4e7637f1ec98474a1a099aec45eb65
tree6a7b6bd456a274070f83d75fa1e7f97d90f32e8e
parent8a850cadca0e387c87a0911a61e99fd66aeb57ec
perf stat: Add --sync/-S option

--sync will tell perf stat to run sync() before starting a command.

This allows IO-heavy tests to be used with --repeat, without one
iteration impacting the other.

Elapsed time will stabilize for example:

  before:        3.971525714  seconds time elapsed  ( +-  8.56% )
  after:         3.211098537  seconds time elapsed  ( +-  1.52% )

So measurements will be more accurate.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/n/tip-7y40wib8n1eqio7hjpn1dsrm@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/builtin-stat.c