Re: [PATCH] perf: Add support for creating offline events

2018-02-14 Thread Peter Zijlstra
On Tue, Feb 13, 2018 at 02:17:07PM -0800, Sodagudi Prasad wrote: > > This is horrible.. and you seem to have forgotten to explain why you > > care about offline CPUs. > > Up to 4.9 kernel, drivers can register cpu hotplug notfiters and drivers are > able to create perf events dynamically based

Re: [PATCH] perf: Add support for creating offline events

2018-02-14 Thread Peter Zijlstra
On Tue, Feb 13, 2018 at 02:17:07PM -0800, Sodagudi Prasad wrote: > > This is horrible.. and you seem to have forgotten to explain why you > > care about offline CPUs. > > Up to 4.9 kernel, drivers can register cpu hotplug notfiters and drivers are > able to create perf events dynamically based

Re: [PATCH] perf: Add support for creating offline events

2018-02-13 Thread Sodagudi Prasad
On 2018-02-13 10:23, Peter Zijlstra wrote: On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: Perf framework doesn't allow creation of hardware events if the requested CPU is offline. However, creation of an event is achievable if the event is attached to the PMU as soon as

Re: [PATCH] perf: Add support for creating offline events

2018-02-13 Thread Sodagudi Prasad
On 2018-02-13 10:23, Peter Zijlstra wrote: On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: Perf framework doesn't allow creation of hardware events if the requested CPU is offline. However, creation of an event is achievable if the event is attached to the PMU as soon as

Re: [PATCH] perf: Add support for creating offline events

2018-02-13 Thread Peter Zijlstra
On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: > Perf framework doesn't allow creation of hardware events if > the requested CPU is offline. However, creation of an event > is achievable if the event is attached to the PMU as soon > as the CPU is online again. > > So,

Re: [PATCH] perf: Add support for creating offline events

2018-02-13 Thread Peter Zijlstra
On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: > Perf framework doesn't allow creation of hardware events if > the requested CPU is offline. However, creation of an event > is achievable if the event is attached to the PMU as soon > as the CPU is online again. > > So,

Re: [PATCH] perf: Add support for creating offline events

2018-02-13 Thread Raghavendra Rao Ananta
On 02/13/2018 08:08 AM, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 02:22:30PM -0800, Raghavendra Rao Ananta wrote: On 02/12/2018 01:21 PM, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 10:04:42PM +0100, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: Hi

Re: [PATCH] perf: Add support for creating offline events

2018-02-13 Thread Raghavendra Rao Ananta
On 02/13/2018 08:08 AM, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 02:22:30PM -0800, Raghavendra Rao Ananta wrote: On 02/12/2018 01:21 PM, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 10:04:42PM +0100, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: Hi

Re: [PATCH] perf: Add support for creating offline events

2018-02-13 Thread Jiri Olsa
On Mon, Feb 12, 2018 at 02:22:30PM -0800, Raghavendra Rao Ananta wrote: > > > On 02/12/2018 01:21 PM, Jiri Olsa wrote: > > On Mon, Feb 12, 2018 at 10:04:42PM +0100, Jiri Olsa wrote: > > > On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: > > > > Hi Jiri, > > > > > > > >

Re: [PATCH] perf: Add support for creating offline events

2018-02-13 Thread Jiri Olsa
On Mon, Feb 12, 2018 at 02:22:30PM -0800, Raghavendra Rao Ananta wrote: > > > On 02/12/2018 01:21 PM, Jiri Olsa wrote: > > On Mon, Feb 12, 2018 at 10:04:42PM +0100, Jiri Olsa wrote: > > > On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: > > > > Hi Jiri, > > > > > > > >

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Raghavendra Rao Ananta
On 02/12/2018 01:21 PM, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 10:04:42PM +0100, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: Hi Jiri, Thank you for the response. Does perf tool has its own check to see if the CPU was offline during the

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Raghavendra Rao Ananta
On 02/12/2018 01:21 PM, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 10:04:42PM +0100, Jiri Olsa wrote: On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: Hi Jiri, Thank you for the response. Does perf tool has its own check to see if the CPU was offline during the

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Jiri Olsa
On Mon, Feb 12, 2018 at 10:04:42PM +0100, Jiri Olsa wrote: > On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: > > Hi Jiri, > > > > Thank you for the response. > > > > Does perf tool has its own check to see if the CPU was offline during the > > lifetime of an event? If so,

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Jiri Olsa
On Mon, Feb 12, 2018 at 10:04:42PM +0100, Jiri Olsa wrote: > On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: > > Hi Jiri, > > > > Thank you for the response. > > > > Does perf tool has its own check to see if the CPU was offline during the > > lifetime of an event? If so,

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Jiri Olsa
On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: > Hi Jiri, > > Thank you for the response. > > Does perf tool has its own check to see if the CPU was offline during the > lifetime of an event? If so, it might ignore these type of events. nope, we don't check on that >

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Jiri Olsa
On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: > Hi Jiri, > > Thank you for the response. > > Does perf tool has its own check to see if the CPU was offline during the > lifetime of an event? If so, it might ignore these type of events. nope, we don't check on that >

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread kbuild test robot
Hi Raghavendra, Thank you for the patch! Yet something to improve: [auto build test ERROR on v4.15] [also build test ERROR on next-20180212] [cannot apply to tip/perf/core] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread kbuild test robot
Hi Raghavendra, Thank you for the patch! Yet something to improve: [auto build test ERROR on v4.15] [also build test ERROR on next-20180212] [cannot apply to tip/perf/core] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Raghavendra Rao Ananta
Hi Jiri, Thank you for the response. Does perf tool has its own check to see if the CPU was offline during the lifetime of an event? If so, it might ignore these type of events. Initially, I tested the same using perf tool and found similar results. Then I debugged further and found that the

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Raghavendra Rao Ananta
Hi Jiri, Thank you for the response. Does perf tool has its own check to see if the CPU was offline during the lifetime of an event? If so, it might ignore these type of events. Initially, I tested the same using perf tool and found similar results. Then I debugged further and found that the

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Jiri Olsa
On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: > Perf framework doesn't allow creation of hardware events if > the requested CPU is offline. However, creation of an event > is achievable if the event is attached to the PMU as soon > as the CPU is online again. > > So,

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Jiri Olsa
On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: SNIP > > if (!task) { > +#if defined CONFIG_HOTPLUG_CPU || defined CONFIG_KEXEC_CORE > + struct perf_cpu_context *cpuctx = > + container_of(ctx, struct perf_cpu_context, ctx); > + > +

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Jiri Olsa
On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: > Perf framework doesn't allow creation of hardware events if > the requested CPU is offline. However, creation of an event > is achievable if the event is attached to the PMU as soon > as the CPU is online again. > > So,

Re: [PATCH] perf: Add support for creating offline events

2018-02-12 Thread Jiri Olsa
On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: SNIP > > if (!task) { > +#if defined CONFIG_HOTPLUG_CPU || defined CONFIG_KEXEC_CORE > + struct perf_cpu_context *cpuctx = > + container_of(ctx, struct perf_cpu_context, ctx); > + > +

[PATCH] perf: Add support for creating offline events

2018-02-09 Thread Raghavendra Rao Ananta
Perf framework doesn't allow creation of hardware events if the requested CPU is offline. However, creation of an event is achievable if the event is attached to the PMU as soon as the CPU is online again. So, introducing a feature that could allow to create events even when the CPU is offline

[PATCH] perf: Add support for creating offline events

2018-02-09 Thread Raghavendra Rao Ananta
Perf framework doesn't allow creation of hardware events if the requested CPU is offline. However, creation of an event is achievable if the event is attached to the PMU as soon as the CPU is online again. So, introducing a feature that could allow to create events even when the CPU is offline