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, 11 Mar 2014 15:26:30 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	acme@...radead.org, mingo@...nel.org, linux-kernel@...r.kernel.org,
	peterz@...radead.org, eranian@...gle.com, namhyung@...nel.org,
	Andi Kleen <ak@...ux.intel.com>, fweisbec@...il.com
Subject: Re: [PATCH 7/8] perf, tools, record: Always allow to overide default
 period

On Wed, Mar 05, 2014 at 11:49:37AM -0800, Andi Kleen wrote:
> From: Andi Kleen <ak@...ux.intel.com>
> 
> Fix the logic to allow overriding event default periods with -c or -F
> on the command line. I'm not sure what the previous if was supposed
> to do, it didn't work and seemed bogus. I just remove the extra
> check and unconditionally allow overiding when the user set
> an option.
> 
> This fixed specifying -c / -F with json event list events,
> which have a default period. It should do the same
> for trace point events.
> 
> Cc: fweisbec@...il.com
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
> ---
>  tools/perf/util/evsel.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index adc94dd..ca4b976 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -561,19 +561,15 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
>  	}
>  
>  	/*
> -	 * We default some events to a 1 default interval. But keep
> -	 * it a weak assumption overridable by the user.
> +	 * Let the user override any default periods.
>  	 */
> -	if (!attr->sample_period || (opts->user_freq != UINT_MAX &&
> -				     opts->user_interval != ULLONG_MAX)) {
> -		if (opts->freq) {
> -			perf_evsel__set_sample_bit(evsel, PERIOD);
> -			attr->freq		= 1;
> -			attr->sample_freq	= opts->freq;
> -		} else {
> -			attr->sample_period = opts->default_interval;
> -		}
> +	if (opts->user_freq != UINT_MAX) {
> +		perf_evsel__set_sample_bit(evsel, PERIOD);
> +		attr->freq		= 1;
> +		attr->sample_freq	= opts->freq;
>  	}
> +	if (opts->user_interval != ULLONG_MAX)
> +		attr->sample_period = opts->default_interval;

and this also makes the default frequency not be set ;-)

  $ ./perf record ls
  ...
  $ ./perf report -D | grep SAMPLE
  $

and 'perf test attr' fails for this reason:
  $ ./perf test attr
  13: struct perf_event_attr setup                           :FAILED './tests/attr/test-record-branch-filter-k' - match failure
 FAILED!


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