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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 14 Jul 2015 08:54:38 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	kan.liang@...el.com
Cc:	acme@...nel.org, jolsa@...nel.org, namhyung@...nel.org,
	ak@...ux.intel.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC V3 3/5] perf,tool: partial time support

On Wed, Jul 08, 2015 at 04:44:55AM -0400, kan.liang@...el.com wrote:
> From: Kan Liang <kan.liang@...el.com>
> 
> When multiple events are sampled it may not be needed to collect fine
> grained time stamps on all events. The sample sites are usually nearby.
> It's enough to have time stamps on the regular reference events.
> This patchkit adds the ability to turn off time stamps per event. This
> in term can reduce sampling overhead and the size of the perf.data.

[PATCH RFC V3 3/5] perf,tool: partial time support

for a minute I was wondering why's the patch not full and just partial ;-)

'per event' might sound better

SNIP

> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index 83c0803..1d58330 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -619,10 +619,37 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
>  	struct perf_event_attr *attr = &evsel->attr;
>  	int track = evsel->tracking;
>  	bool per_cpu = opts->target.default_per_cpu && !opts->target.per_thread;
> +	bool sample_time = opts->sample_time;
>  
>  	attr->sample_id_all = perf_missing_features.sample_id_all ? 0 : 1;
>  	attr->inherit	    = !opts->no_inherit;
>  
> +	/*
> +	 * If user doesn't explicitly set time option,
> +	 * let event attribute decide.
> +	 */
> +
> +	if (!opts->sample_time_set) {
> +		if (attr->sample_type & PERF_SAMPLE_TIME)
> +			sample_time = true;
> +		else
> +			sample_time = false;
> +	}
> +
> +	/*
> +	 * Event parsing doesn't check the availability
> +	 * Clear the bit which event parsing may be set.
> +	 * Let following code check and reset if available
> +	 *
> +	 * Also, the sample size may be caculated mistakenly,
> +	 * because event parsing may set the PERF_SAMPLE_TIME.
> +	 * Remove the size which add in perf_evsel__init
> +	 */
> +	if (attr->sample_type & PERF_SAMPLE_TIME) {
> +		attr->sample_type &= ~PERF_SAMPLE_TIME;
> +		evsel->sample_size -= sizeof(u64);
> +	}

so we have TIME enabled by default, like:

[jolsa@...va perf]$ ./perf record ls
...
[jolsa@...va perf]$ ./perf evlist -v
cycles: size: 112, { sample_period, sample_freq }: 4000, sample_type:
IP|TID|TIME|PERIOD, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1,
enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2:
1, comm_exec: 1

this patch disables it by default and there might be people out there
who actualy care.

I wonder you should instead disable it completely via --no-timestamp
option and enable it via 'time' term for specific events, like:

   $ perf record --no-timestamp -e 'cpu/...time/,cpu/.../'ls

or disable timestamps globaly if 'time' term is detected in any
event definition..?

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