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:	Thu, 11 Jul 2013 09:43:38 -0600
From:	David Ahern <dsahern@...il.com>
To:	Adrian Hunter <adrian.hunter@...el.com>,
	Stephane Eranian <eranian@...gle.com>
CC:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	linux-kernel@...r.kernel.org,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jiri Olsa <jolsa@...hat.com>, Mike Galbraith <efault@....de>,
	Namhyung Kim <namhyung@...il.com>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH V5 09/12] perf: make events stream always parsable

On 7/11/13 7:12 AM, Adrian Hunter wrote:
> The event stream is not always parsable because the format of a sample
> is dependent on the sample_type of the selected event.  When there
> is more than one selected event and the sample_types are not the
> same then parsing becomes problematic.  A sample can be matched to its
> selected event using the ID that is allocated when the event is opened.
> Unfortunately, to get the ID from the sample means first parsing it.

Here's an alternative suggestion -- one that does not involve changing 
the kernel API or requiring a common denominator in sample_type options.

perf handles event streams through an mmap which can be directly tied to 
an evsel (a single event) when the mmap is created. ie., when events are 
read we know exactly which evsel they correspond to. (See 
perf_evlist__mmap_per_cpu and perf_evlist__mmap_per_thread and add 
struct perf_evsel *evsel entry to struct perf_mmap).

Commands like perf-record can inject a user event into the stream and 
hence the data file every time the evsel changes while walking all of 
the mmap's reading events -- very  similar to the way finished round is 
done. The event would only contain a perf_event_header which is 8 bytes 
so this does not add a lot to a data file. As an optimization the evsel 
event could only be injected if the sample_types differ.

Live commands would just use the evsel connected to the mmap -- no 
lookups needed which would simplify things a bit processing the events.

In short, the information to associate event streams to an event (evsel) 
is currently available -- it's just being discarded in the many layers.

I'll try to whip up some code that implements this in the next few days.

David

--
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