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: <20140715142524.GI9918@twins.programming.kicks-ass.net>
Date:	Tue, 15 Jul 2014 16:25:24 +0200
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,
	jolsa@...hat.com, acme@...hat.com, namhyung@...nel.org
Subject: Re: [PATCH v2 1/5] perf: add ability to sample machine state on
 interrupt

On Tue, Jul 15, 2014 at 02:31:40AM +0200, Stephane Eranian wrote:
> @@ -618,6 +619,8 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,
>  	data->weight = 0;
>  	data->data_src.val = 0;
>  	data->txn = 0;
> +	data->regs_intr.abi = PERF_SAMPLE_REGS_ABI_NONE;
> +	data->regs_intr.regs = NULL;
>  }

> +static void perf_sample_regs_intr(struct perf_regs *regs_intr,
> +				  struct pt_regs *regs)
> +{
> +	regs_intr->regs = regs;
> +	regs_intr->abi  = perf_reg_abi(current);
> +}

> @@ -4800,6 +4824,20 @@ void perf_prepare_sample(struct perf_event_header *header,
>  		data->stack_user_size = stack_size;
>  		header->size += size;
>  	}
> +
> +	if (sample_type & PERF_SAMPLE_REGS_INTR) {
> +		/* regs dump ABI info */
> +		int size = sizeof(u64);
> +
> +		perf_sample_regs_intr(&data->regs_intr, regs);
> +
> +		if (data->regs_intr.regs) {
> +			u64 mask = event->attr.sample_regs_intr;
> +			size += hweight64(mask) * sizeof(u64);
> +		}
> +
> +		header->size += size;
> +	}

Given that the prepare_sample hunk sets both regs_intr fields, the
addition to perf_sample_data_init() is entirely superfluous, no?

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ