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: <20140908100018.GC1172@krava.brq.redhat.com>
Date:	Mon, 8 Sep 2014 12:00:19 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Jiri Olsa <jolsa@...nel.org>, linux-kernel@...r.kernel.org,
	Andi Kleen <andi@...stfloor.org>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	"Jen-Cheng(Tommy) Huang" <tommy24@...ech.edu>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 2/9] perf: Deny optimized switch for events read by
 PERF_SAMPLE_READ

On Tue, Sep 02, 2014 at 12:52:44PM +0200, Peter Zijlstra wrote:
> On Mon, Aug 25, 2014 at 04:45:36PM +0200, Jiri Olsa wrote:
> > The optimized task context switch for cloned perf events just
> > swaps whole perf event contexts (of current and next process)
> > if it finds them suitable. Events from the 'current' context
> > will now measure data of the 'next' context and vice versa.
> > 
> > This is ok for cases where we are not directly interested in
> > the event->count value of separate child events, like:
> >   - standard sampling, where we take 'period' value for the
> >     event count
> >   - counting, where we accumulate all events (children)
> >     into a single count value
> > 
> > But in case we read event by using the PERF_SAMPLE_READ sample
> > type, we are interested in direct event->count value measured
> > in specific task. Switching events within tasks for this kind
> > of measurements corrupts data.
> > 
> > Fixing this by setting/unsetting pin_count for perf event context
> > once cloned event with PERF_SAMPLE_READ read is added/removed.
> > The pin_count value != 0 makes the context not suitable for
> > optimized switch.
> 
> no.. so the value of the counter is the sum of all the inherited events.
> It doesn't matter if you flip it or not the sum is not affected.
> 
> PERF_SAMPLE_READ should return the value.

so I want to be able to do the leader sampling over child processes

that means:
  - have event group with sampling leader, and the rest
    of the group events' periods being read on leader's sample
    via PERF_SAMPLE_READ sample_type
  - for each child process created I want it to do the
    same thing as the parent - sample on leader, read
    values of other events in group via PERF_SAMPLE_READ

Now, If I let the optimized switch enabled for above config,
I'll get wrong data, because the period counts of group events
are local to the child process. Optimized switch will move
it to another child.

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