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, 14 Jul 2015 08:54:58 +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>
> 

SNIP

> +
> +	/*
> +	 * 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);
> +	}

why not use perf_evsel__reset_sample_bit?

> +
>  	perf_evsel__set_sample_bit(evsel, IP);
>  	perf_evsel__set_sample_bit(evsel, TID);
>  
> @@ -705,14 +732,15 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
>  	/*
>  	 * When the user explicitely disabled time don't force it here.
>  	 */

SNIP

> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index a71eeb2..9510047 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -598,6 +598,13 @@ do {									   \
>  		 * attr->branch_sample_type = term->val.num;
>  		 */
>  		break;
> +	case PARSE_EVENTS__TERM_TYPE_TIME:
> +		CHECK_TYPE_VAL(NUM);
> +		if (term->val.num > 1)
> +			return -EINVAL;
> +		if (term->val.num == 1)
> +			attr->sample_type |= PERF_SAMPLE_TIME;

why not use perf_evsel__set_sample_bit?

> +		 break;
>  	case PARSE_EVENTS__TERM_TYPE_NAME:
>  		CHECK_TYPE_VAL(STR);
>  		break;

SNIP

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