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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130118140557.GC1579@krava>
Date:	Fri, 18 Jan 2013 15:05:57 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	"mingo@...e.hu" <mingo@...e.hu>,
	"ak@...ux.intel.com" <ak@...ux.intel.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Namhyung Kim <namhyung.kim@....com>
Subject: Re: [PATCH v2 2/2] perf stat: add interval printing

On Fri, Jan 18, 2013 at 02:59:58PM +0100, Stephane Eranian wrote:
> On Fri, Jan 18, 2013 at 2:50 PM, Jiri Olsa <jolsa@...hat.com> wrote:
> > On Fri, Jan 18, 2013 at 02:06:28PM +0100, Stephane Eranian wrote:
> >> This patch adds a new printing mode for perf stat.
> >> It allows internval printing. That means perf stat
> >
> > SNIP
> >
> >>       const char * const stat_usage[] = {
> >> @@ -1245,12 +1356,23 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
> >>               usage_with_options(stat_usage, options);
> >>               return -1;
> >>       }
> >> +     if (interval < 0 || (interval > 0 && interval < 100)) {
> >> +             pr_err("print interval must be >= 100ms\n");
> >> +             usage_with_options(stat_usage, options);
> >> +             return -1;
> >> +     }
> >>
> >>       list_for_each_entry(pos, &evsel_list->entries, node) {
> >>               if (perf_evsel__alloc_stat_priv(pos) < 0 ||
> >>                   perf_evsel__alloc_counts(pos, perf_evsel__nr_cpus(pos)) < 0)
> >>                       goto out_free_fd;
> >>       }
> >> +     if (interval) {
> >> +             list_for_each_entry(pos, &evsel_list->entries, node) {
> >> +                     if (perf_evsel__alloc_prev_raw_counts(pos) < 0)
> >> +                             goto out_free_fd;
> >> +             }
> >> +     }
> >
> > this could be squeezed up into the previous loop,
> >
> The raw_counts are lazily allocated. So you'd have to have
> 
> if (interval)
>      perf_evsel__alloc_prev_raw_counts(pos);
> 
> in the body of the loop.

right,
jirka
--
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