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:	Mon, 29 Oct 2012 16:38:32 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, ak@...ux.intel.com,
	acme@...hat.com, jolsa@...hat.com, ming.m.lin@...el.com
Subject: Re: [Patch v1 04/10] perf/x86: add memory profiling via PEBS Load
 Latency

On Mon, 2012-10-29 at 16:15 +0100, Stephane Eranian wrote:
> +       fll = event->hw.flags & PERF_X86_EVENT_PEBS_LDLAT;
> +
>         perf_sample_data_init(&data, 0, event->hw.last_period);
>  
> +       data.period = event->hw.last_period;
> +       sample_type = event->attr.sample_type;
> +
> +       /*
> +        * if PEBS-LL or PreciseStore
> +        */
> +       if (fll) {
> +               if (sample_type & PERF_SAMPLE_ADDR)
> +                       data.addr = pebs->dla;
> +
> +               /*
> +                * Use latency for cost (only avail with PEBS-LL)
> +                */
> +               if (fll && (sample_type & PERF_SAMPLE_COST))
> +                       data.cost = pebs->lat;
> +
> +               /*
> +                * data.dsrc encodes the data source
> +                */
> +               if (sample_type & PERF_SAMPLE_DSRC) {
> +                       if (fll)
> +                               data.dsrc.val = load_latency_data(pebs->dse);
> +               }
> +       } 


Why does fl1 exist? the above looks really convoluted, all fl1 checks
inside are pointless. Also 'fl1' is a bizarre name, 'pebs_ll' would be a
better name I guess.

What's wrong with:

	if (event->hw.flags & PERF_X86_EVENT_PEBS_LDLAT) {
		if (sample_type & PERF_SAMPLE_ADDR)
			data.addr = pebs->dla;

		if (sample_type & PERF_SAMPLE_COST)
			data.cost = perf->lat;

		if (sample_type & PERF_SAMPLE_DSRC)
			data.dsrc.val = load_latency_data(pebs->dse);
	}


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