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: <alpine.LFD.2.00.1012061014180.2653@localhost6.localdomain6>
Date:	Mon, 6 Dec 2010 10:20:06 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Ian Munsie <imunsie@....ibm.com>
cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 3/3] perf record/report: Process events in order

On Mon, 6 Dec 2010, Ian Munsie wrote:

> From: Ian Munsie <imunsie@....ibm.com>
> 
> This patch changes perf report to ask for the ID info on all events be
> default if recording from multiple CPUs.
>
> Perf report will now process the events in order if the kernel is able
> to provide timestamps on all events. This ensures that events such as
> COMM and MMAP which are necessary to correctly interpret samples are
> processed prior to those samples so that they are attributed correctly.

See https://lkml.org/lkml/2010/12/5/45

Slightly different, but the same idea :)
 
>  
> +static int perf_session__dispatch_event(event_t *event,
> +					struct sample_data *sample,
> +					struct perf_session *s,
> +					struct perf_event_ops *ops)
> +{
> +	switch (event->header.type) {
> +	case PERF_RECORD_SAMPLE:
> +		return ops->sample(event, sample, s);
> +	case PERF_RECORD_MMAP:
> +		return ops->mmap(event, sample, s);
> +	case PERF_RECORD_COMM:
> +		return ops->comm(event, sample, s);
> +	case PERF_RECORD_FORK:
> +		return ops->fork(event, sample, s);
> +	case PERF_RECORD_EXIT:
> +		return ops->exit(event, sample, s);
> +	case PERF_RECORD_LOST:
> +		return ops->lost(event, sample, s);
> +	case PERF_RECORD_READ:
> +		return ops->read(event, sample, s);
> +	case PERF_RECORD_THROTTLE:
> +		return ops->throttle(event, sample, s);
> +	case PERF_RECORD_UNTHROTTLE:
> +		return ops->unthrottle(event, sample, s);


> +	case PERF_RECORD_HEADER_ATTR:
> +		return ops->attr(event, s);
> +	case PERF_RECORD_HEADER_EVENT_TYPE:
> +		return ops->event_type(event, s);
> +	case PERF_RECORD_HEADER_TRACING_DATA:
> +		return ops->tracing_data(event, s);
> +	case PERF_RECORD_HEADER_BUILD_ID:
> +		return ops->build_id(event, s);

These can be processed unordered.

> +	case PERF_RECORD_FINISHED_ROUND:
> +		return ops->finished_round(event, s, ops);

You don't want to delay this unless you have unlimited memory. See my
patch.

>  {
> +	if (ops->ordered_samples && sample->time == -1ULL) {
> +		dump_printf("Event missing timestamp, switching to unordered processing\n");
> +		flush_sample_queue(s, ops);
> +		ops->ordered_samples = false;

Why ? The events injected by perf record itself have no timestamps and
do not need them. So why disabling ordered_samples ?

Thanks,

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