Re: [tip:perfcounters/urgent] perf stat: Add -n/--null option to run without counters

Ingo Molnar
2009-06-27T16:53:33Z

* Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:

> On Sat, 2009-06-27 at 04:31 +0000, tip-bot for Ingo Molnar wrote:
> > Commit-ID: 0cfb7a13b8e4e0afd4b856156ab16a182de7505b
> > Gitweb: http://git.kernel.org/tip/0cfb7a13b8e4e0afd4b856156ab16a182de7505b
> > Author: Ingo Molnar <mingo@elte.hu>
> > AuthorDate: Sat, 27 Jun 2009 06:10:30 +0200
> > Committer: Ingo Molnar <mingo@elte.hu>
> > CommitDate: Sat, 27 Jun 2009 06:11:24 +0200
> >
> > perf stat: Add -n/--null option to run without counters
> >
> > Allow a no-counters run. This can be useful to measure just
> > elapsed wall-clock time - or to assess the raw overhead of perf
> > stat itself, without running any counters.
> >
>
> Why it better then $ time <command>

For example can 'time' do average and standard deviation
measurements, like:

perf stat --repeat 10 --null /bin/true

?

Also, --null can be used to validate 'perf stat'.

> Any way this patch is broken.
>
> Why you are allocating :
> memcpy(attrs, default_attrs, sizeof(attrs)); when null_run is set.

a memcpy is not 'allocating' anything. What do you mean?

The memcpy itself could be unnecessary. Is it a big problem?

What exactly is 'broken' about it? It's a straightforward feature.

> To get better picture and solution, Please check [PATCH] perf
> stat: fix default attrs and nr_counters
>
> which I send in "Re: [PATCH -tip] perf_counter tools: add support
> to set of multiple events in one short" send on Fri, 26 Jun 2009
> 18:08:40 +0530

When you send new patches you should change the subject line.

Also, that patch mixes in some other changes that look wrong.
Anyway, please resubmit as standalone patch if you think that
something is broken.

Ingo