Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1341950 > unrolled thread

Re: [PATCH 16/48] perf core: Add backward attribute to perf event

Started byJiri Olsa <jolsa@redhat.com>
First post2016-02-24 14:10 +0100
Last post2016-02-24 14:30 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 16/48] perf core: Add backward attribute to perf event Jiri Olsa <jolsa@redhat.com> - 2016-02-24 14:10 +0100
    Re: [PATCH 16/48] perf core: Add backward attribute to perf event Jiri Olsa <jolsa@redhat.com> - 2016-02-24 14:30 +0100

#1341950 — Re: [PATCH 16/48] perf core: Add backward attribute to perf event

FromJiri Olsa <jolsa@redhat.com>
Date2016-02-24 14:10 +0100
SubjectRe: [PATCH 16/48] perf core: Add backward attribute to perf event
Message-ID<r5Hmy-4ZE-15@gated-at.bofh.it>
On Mon, Feb 22, 2016 at 09:10:43AM +0000, Wang Nan wrote:

SNIP

> +	if (is_write_backward(output_event) != is_write_backward(event))
> +		goto out;
> +
> +	/*
>  	 * If both events generate aux data, they must be on the same PMU
>  	 */
>  	if (has_aux(event) && has_aux(output_event) &&
> diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
> index 37c11c6..80b1fa7 100644
> --- a/kernel/events/ring_buffer.c
> +++ b/kernel/events/ring_buffer.c
> @@ -233,6 +233,8 @@ out:
>  int perf_output_begin(struct perf_output_handle *handle,
>  		      struct perf_event *event, unsigned int size)
>  {
> +	if (unlikely(is_write_backward(event)))
> +		return __perf_output_begin(handle, event, size, true);
>  	return __perf_output_begin(handle, event, size, false);

could this be just:
	return __perf_output_begin(handle, event, size,
				   is_write_backward(event))

also not sure if it's worth to have __perf_output_begin
if the only difference to perf_output_begin is 'backward'
argument that could be figured out from the event argument
anyway

jirka

[toc] | [next] | [standalone]


#1341966

FromJiri Olsa <jolsa@redhat.com>
Date2016-02-24 14:30 +0100
Message-ID<r5HFU-59T-17@gated-at.bofh.it>
In reply to#1341950
On Wed, Feb 24, 2016 at 02:08:50PM +0100, Jiri Olsa wrote:
> On Mon, Feb 22, 2016 at 09:10:43AM +0000, Wang Nan wrote:
> 
> SNIP
> 
> > +	if (is_write_backward(output_event) != is_write_backward(event))
> > +		goto out;
> > +
> > +	/*
> >  	 * If both events generate aux data, they must be on the same PMU
> >  	 */
> >  	if (has_aux(event) && has_aux(output_event) &&
> > diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
> > index 37c11c6..80b1fa7 100644
> > --- a/kernel/events/ring_buffer.c
> > +++ b/kernel/events/ring_buffer.c
> > @@ -233,6 +233,8 @@ out:
> >  int perf_output_begin(struct perf_output_handle *handle,
> >  		      struct perf_event *event, unsigned int size)
> >  {
> > +	if (unlikely(is_write_backward(event)))
> > +		return __perf_output_begin(handle, event, size, true);
> >  	return __perf_output_begin(handle, event, size, false);
> 
> could this be just:
> 	return __perf_output_begin(handle, event, size,
> 				   is_write_backward(event))
> 
> also not sure if it's worth to have __perf_output_begin
> if the only difference to perf_output_begin is 'backward'
> argument that could be figured out from the event argument
> anyway

nevermind my second comment, just saw it being used also in next patches ;-)

jirka

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web