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]
Date:	Tue, 25 Jun 2013 16:45:29 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Adrian Hunter <adrian.hunter@...el.com>
Cc:	Stephane Eranian <eranian@...gle.com>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	LKML <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Namhyung Kim <namhyung@...il.com>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 12/15] perf tools: allow non-matching sample types

On Tue, Jun 25, 2013 at 03:13:29PM +0300, Adrian Hunter wrote:
> On 25/06/13 14:23, Stephane Eranian wrote:
> > On Mon, Jun 24, 2013 at 3:16 PM, Adrian Hunter <adrian.hunter@...el.com> wrote:
> >> Sample types need not be identical to determine
> >> the sample id from the event.  Only the position
> >> of the sample id needs to be the same.
> >>
> >> Compatible sample types are ones in which the bits
> >> defined by PERF_COMPAT_MASK are the same.
> >> 'perf_evlist__config()' forces sample types to be
> >> compatible on that basis.
> >>

nice idea

> > This is indeed a major flaw of the current sampling buffer format.
> > I have a patch coming to address this from the kernel side.
> > 
> > I am trying to understand this patch and I am confused by the
> > description and especially the structure of COMPAT_MASK.
> > 
> > I agree that if the SAMPLE_ID position remains constant then
> > it can be extracted from the body of the sample uniformly.
> > The only way to guarantee a fixed position is by ensuring that
> > all the sample_types before SAMPLE_ID and either set or
> > unset. By before I don't mean in the enum order but in the
> > order in which the kernel lays them various sample_types
> > in the buffer. And that's determined by perf_output_sample().
> > So I don't understand why PERF_SAMPLE_CPU and
> > PERF_SAMPLE_STREAM_ID  are here.
> > 
> > Any explanation?

+1 for more comments in changelog and code ;-)

> 
> There are 2 sample formats: one for sample events and one for other events
> (the id sample).  In perf tools refer __perf_evsel__parse_sample() vs
> perf_evsel__parse_id_sample().

For non sample events the ID info is stored backwards via:
__perf_event__output_id_sample kernel func.

Why do you use PERF_SAMPLE_STREAM_ID in this case instead
of the PERF_SAMPLE_ID as for sample events.. ? apart from
one more condition in __perf_evsel__calc_is_pos function.

AFAICS PERF_SAMPLE_STREAM_ID holds same id value as PERF_SAMPLE_ID,
but I guess it has some other meaning.. if not for now, maybe meant
something else for the future ;-) not sure

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