[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4990ef71-734a-10cf-e7dc-51b33b26fd18@amd.com>
Date: Wed, 14 Dec 2022 09:22:29 +0530
From: Ravi Bangoria <ravi.bangoria@....com>
To: Like Xu <like.xu.linux@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Marc Zyngier <maz@...nel.org>,
Fenghua Yu <fenghua.yu@...el.com>, kvmarm@...ts.linux.dev,
linux-perf-users@...r.kernel.org,
Ravi Bangoria <ravi.bangoria@....com>
Subject: Re: [PATCH RFC 1/8] perf/core: Add *group_leader to
perf_event_create_kernel_counter()
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 7f04f995c975..f671b1a9a691 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -12674,12 +12674,14 @@ SYSCALL_DEFINE5(perf_event_open,
> * @attr: attributes of the counter to create
> * @cpu: cpu in which the counter is bound
> * @task: task to profile (NULL for percpu)
> + * @group_leader: event group leader
> * @overflow_handler: callback to trigger when we hit the event
> * @context: context data could be used in overflow_handler callback
> */
> struct perf_event *
> perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu,
> struct task_struct *task,
> + struct perf_event *group_leader,
> perf_overflow_handler_t overflow_handler,
> void *context)
> {
> @@ -12694,7 +12696,7 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu,
> if (attr->aux_output)
> return ERR_PTR(-EINVAL);
>
> - event = perf_event_alloc(attr, cpu, task, NULL, NULL,
> + event = perf_event_alloc(attr, cpu, task, group_leader, NULL,
> overflow_handler, context, -1);
Grouping involves lot of complexities. Setting group_leader won't be sufficient.
Please see perf_event_open() syscall code for more detail.
Thanks,
Ravi
Powered by blists - more mailing lists