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:	Thu, 24 May 2012 11:57:20 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	acme@...hat.com, mingo@...e.hu, paulus@...ba.org,
	cjashfor@...ux.vnet.ibm.com, fweisbec@...il.com,
	eranian@...gle.com, gorcunov@...nvz.org, tzanussi@...il.com,
	mhiramat@...hat.com, robert.richter@....com, fche@...hat.com,
	linux-kernel@...r.kernel.org, masami.hiramatsu.pt@...achi.com,
	drepper@...il.com, asharma@...com, benjamin.redelings@...cent.org
Subject: Re: [PATCH 02/16] perf: Add ability to attach registers dump to
 sample

On Wed, 2012-05-23 at 21:32 +0200, Jiri Olsa wrote:

> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -130,8 +130,9 @@ enum perf_event_sample_format {
>  	PERF_SAMPLE_STREAM_ID			= 1U << 9,
>  	PERF_SAMPLE_RAW				= 1U << 10,
>  	PERF_SAMPLE_BRANCH_STACK		= 1U << 11,
> +	PERF_SAMPLE_REGS			= 1U << 12,
>  
> -	PERF_SAMPLE_MAX = 1U << 12,		/* non-ABI */
> +	PERF_SAMPLE_MAX = 1U << 13,		/* non-ABI */
>  };

There's a comment update missing for PERF_RECORD_SAMPLE that describes
the output this bit generates.

> @@ -4011,6 +4042,30 @@ void perf_output_sample(struct perf_output_handle *handle,
>  			perf_output_put(handle, nr);
>  		}
>  	}
> +
> +	if (sample_type & PERF_SAMPLE_REGS) {
> +		u64 mode = event->attr.sample_regs;
> +
> +		if (mode & PERF_SAMPLE_REGS_USER) {
> +			u64 id = PERF_REGS_ABI_NONE;
> +
> +			/*
> +			 * If there are no regs to dump, notice it through
> +			 * PERF_REGS_ABI_NONE id.
> +			 */
> +			if (data->regs_user)
> +				id = perf_reg_version();

OK, so I don't like this.. why does this exists at all? Why not use a
length field instead?

> +			perf_output_put(handle, id);
> +
> +			if (id) {
> +				u64 mask = event->attr.sample_regs_user;
> +				perf_output_sample_regs(handle,
> +							data->regs_user,
> +							mask);
> +			}
> +		}
> +	}
>  }




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