All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH 05/21] perf: Add event toggle sys_perf_event_open interface
Date: Thu, 26 Sep 2013 14:27:02 +0200	[thread overview]
Message-ID: <20130926122702.GD1067@krava.brq.redhat.com> (raw)
In-Reply-To: <20130925223629.GA13425@us.ibm.com>

On Wed, Sep 25, 2013 at 03:36:29PM -0700, Sukadev Bhattiprolu wrote:
> Jiri Olsa [jolsa@redhat.com] wrote:

SNIP

> | diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> | index 866e85c..6ede25c 100644
> | --- a/include/linux/perf_event.h
> | +++ b/include/linux/perf_event.h
> | @@ -289,6 +289,12 @@ struct swevent_hlist {
> |  struct perf_cgroup;
> |  struct ring_buffer;
> | 
> | +enum perf_event_toggle_flag {
> | +	PERF_TOGGLE_NONE	= 0,
> | +	PERF_TOGGLE_ON		= 1,
> | +	PERF_TOGGLE_OFF		= 2,
> | +};
> 
> Can we call this 'perf_event_toggle_state' ? it can be confusing with
> PERF_FLAG_TOGGLE* macros below which apply to a different field.

right, 'state' is probably better

> 
> | +
> |  /**
> |   * struct perf_event - performance event kernel representation:
> |   */
> | @@ -414,6 +420,9 @@ struct perf_event {
> |  	int				cgrp_defer_enabled;
> |  #endif
> | 
> | +	struct perf_event		*toggled_event;
> | +	enum perf_event_toggle_flag	toggle_flag;
> 
> s/toggle_flag/toggle_state/ ?
> 
> | +	int				paused;
> 
> There is an 'event->state' field with OFF, INACTIVE, ACTIVE states.
> Can we add a 'PAUSED' state to that instead ?

good idea, I think that's possible

> 
> 
> |  #endif /* CONFIG_PERF_EVENTS */
> |  };
> | 
> | diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> | index ca1d90b..ecb0474 100644
> | --- a/include/uapi/linux/perf_event.h
> | +++ b/include/uapi/linux/perf_event.h
> | @@ -694,6 +694,9 @@ enum perf_callchain_context {
> |  #define PERF_FLAG_FD_NO_GROUP		(1U << 0)
> |  #define PERF_FLAG_FD_OUTPUT		(1U << 1)
> |  #define PERF_FLAG_PID_CGROUP		(1U << 2) /* pid=cgroup id, per-cpu mode only */
> | +#define PERF_FLAG_TOGGLE_ON		(1U << 3)
> | +#define PERF_FLAG_TOGGLE_OFF		(1U << 4)
> | +
> | 

SNIP

> | +	/* It's either ON or OFF. */
> | +	if ((flags & PERF_FLAG_TOGGLE) == PERF_FLAG_TOGGLE)
> | +		return -EINVAL;
> | +
> | +	/* Allow only same cpu, */
> | +	if (toggled_event->cpu != event->cpu)
> | +		return -EINVAL;
> | +
> | +	/* or same task. */
> 
> nit: s/or/and/
> 

ok

thanks,
jirka

  reply	other threads:[~2013-09-26 12:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-25 12:50 [RFC 00/21] perf tools: Add toggling events support Jiri Olsa
2013-09-25 12:50 ` [PATCH 01/21] perf tools: Introduce perf_evlist__wait_workload function Jiri Olsa
2013-09-25 12:50 ` [PATCH 02/21] perf tools: Separate sys_perf_event_open call into evsel_open Jiri Olsa
2013-09-25 12:50 ` [PATCH 03/21] perf x86: Update event count properly for read syscall Jiri Olsa
2013-09-25 12:50 ` [PATCH 04/21] perf: Move event state initialization before/behind the pmu add/del calls Jiri Olsa
2013-09-25 12:50 ` [PATCH 05/21] perf: Add event toggle sys_perf_event_open interface Jiri Olsa
2013-09-25 22:36   ` Sukadev Bhattiprolu
2013-09-26 12:27     ` Jiri Olsa [this message]
2013-09-25 12:50 ` [PATCH 06/21] perf: Add event toggle ioctl interface Jiri Olsa
2013-09-25 19:46   ` Vince Weaver
2013-09-26 12:30     ` Jiri Olsa
2013-09-26 13:03       ` Vince Weaver
2013-09-25 12:50 ` [PATCH 07/21] perf: Toggle whole group in toggle event overflow Jiri Olsa
2013-09-25 12:50 ` [PATCH 08/21] perf: Add new 'paused' attribute Jiri Olsa
2013-09-25 22:41   ` Sukadev Bhattiprolu
2013-09-26 12:24     ` Jiri Olsa
2013-09-25 12:50 ` [PATCH 09/21] perf: Account toggle masters for toggled event Jiri Olsa
2013-09-25 12:50 ` [PATCH 10/21] perf: Be more specific on pmu related event init naming Jiri Olsa
2013-09-25 12:50 ` [PATCH 11/21] perf: Split allocation and initialization code Jiri Olsa
2013-09-25 12:50 ` [PATCH 12/21] perf: Support event inheritance for toggle feature Jiri Olsa
2013-09-25 12:50 ` [PATCH 13/21] perf tests: Adding event simple toggling test Jiri Olsa
2013-09-25 12:50 ` [PATCH 14/21] perf tests: Adding event group " Jiri Olsa
2013-09-25 12:50 ` [PATCH 15/21] perf tests: Adding event inherit " Jiri Olsa
2013-09-25 12:50 ` [PATCH 16/21] perf tools: Allow numeric event to change name via name term Jiri Olsa
2013-09-25 12:50 ` [PATCH 17/21] perf tools: Add event_config_optional parsing rule Jiri Olsa
2013-09-25 12:50 ` [PATCH 18/21] perf tools: Rename term related parsing function/variable properly Jiri Olsa
2013-09-25 12:50 ` [PATCH 19/21] perf tools: Carry term string value for symbols events Jiri Olsa
2013-09-25 12:50 ` [PATCH 20/21] perf tools: Add support to parse event on/off toggle terms Jiri Olsa
2013-09-25 12:50 ` [PATCH 21/21] perf tools: Add record/stat support for toggling events Jiri Olsa
2013-09-25 19:12 ` [RFC 00/21] perf tools: Add toggling events support Andi Kleen
2013-09-26  7:03   ` Ingo Molnar
2013-09-26 15:45     ` Andi Kleen
2013-09-26 12:11   ` Jiri Olsa
2013-09-26 11:31 ` Stephane Eranian
2013-09-26 12:20   ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130926122702.GD1067@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=sukadev@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.