On Wed, Sep 25, 2013 at 03:36:29PM -0700, Sukadev Bhattiprolu wrote:
> Jiri Olsa [jo...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to