Re: [PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-08 Thread David Carrillo-Cisneros
Hi Nilay, Sounds good, I will post an updated version. Thanks, David On Mon, Aug 8, 2016 at 9:12 AM, Nilay Vaish wrote: > On 7 August 2016 at 15:10, David Carrillo-Cisneros wrote: >> Hi Nilay, >> static int perf_event_read(struct perf_event

Re: [PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-08 Thread David Carrillo-Cisneros
Hi Nilay, Sounds good, I will post an updated version. Thanks, David On Mon, Aug 8, 2016 at 9:12 AM, Nilay Vaish wrote: > On 7 August 2016 at 15:10, David Carrillo-Cisneros wrote: >> Hi Nilay, >> static int perf_event_read(struct perf_event *event, bool group) { - int

Re: [PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-08 Thread Nilay Vaish
On 7 August 2016 at 15:10, David Carrillo-Cisneros wrote: > Hi Nilay, > >>> static int perf_event_read(struct perf_event *event, bool group) >>> { >>> - int ret = 0; >>> + int ret = 0, cpu_to_read; >>> >>> - /* >>> -* If event is enabled and

Re: [PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-08 Thread Nilay Vaish
On 7 August 2016 at 15:10, David Carrillo-Cisneros wrote: > Hi Nilay, > >>> static int perf_event_read(struct perf_event *event, bool group) >>> { >>> - int ret = 0; >>> + int ret = 0, cpu_to_read; >>> >>> - /* >>> -* If event is enabled and currently active on a CPU,

Re: [PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-07 Thread David Carrillo-Cisneros
Hi Nilay, >> static int perf_event_read(struct perf_event *event, bool group) >> { >> - int ret = 0; >> + int ret = 0, cpu_to_read; >> >> - /* >> -* If event is enabled and currently active on a CPU, update the >> -* value in the event structure: >> -*/

Re: [PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-07 Thread David Carrillo-Cisneros
Hi Nilay, >> static int perf_event_read(struct perf_event *event, bool group) >> { >> - int ret = 0; >> + int ret = 0, cpu_to_read; >> >> - /* >> -* If event is enabled and currently active on a CPU, update the >> -* value in the event structure: >> -*/

Re: [PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-07 Thread Nilay Vaish
On 08/06/16 22:12, David Carrillo-Cisneros wrote: diff --git a/kernel/events/core.c b/kernel/events/core.c index 34049cc..77f1bd3 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -,6 +,26 @@ struct perf_read_data { int ret; }; +static int find_cpu_to_read(struct

Re: [PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-07 Thread Nilay Vaish
On 08/06/16 22:12, David Carrillo-Cisneros wrote: diff --git a/kernel/events/core.c b/kernel/events/core.c index 34049cc..77f1bd3 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -,6 +,26 @@ struct perf_read_data { int ret; }; +static int find_cpu_to_read(struct

[PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-06 Thread David Carrillo-Cisneros
Introduce the flag PMU_EV_CAP_READ_ACTIVE_PKG, useful for uncore events, that allows a PMU to signal the generic perf code that an event is readable in the current CPU if the event is active in a CPU in the same package as the current CPU. This is an optimization that avoids a unnecessary IPI for

[PATCH v2 3/4] perf/core: introduce PMU_EV_CAP_READ_ACTIVE_PKG

2016-08-06 Thread David Carrillo-Cisneros
Introduce the flag PMU_EV_CAP_READ_ACTIVE_PKG, useful for uncore events, that allows a PMU to signal the generic perf code that an event is readable in the current CPU if the event is active in a CPU in the same package as the current CPU. This is an optimization that avoids a unnecessary IPI for