On Tue, Aug 08, 2023 at 12:21:27PM +0200, Peter Zijlstra wrote: > Date: Tue, 8 Aug 2023 12:21:27 +0200 > From: Peter Zijlstra <peterz@xxxxxxxxxxxxx> > Subject: Re: [PATCH RFV v2 05/13] perf/core: Add function > perf_event_create_group_kernel_counters() > > On Tue, Aug 08, 2023 at 02:31:03PM +0800, Dapeng Mi wrote: > > diff --git a/kernel/events/core.c b/kernel/events/core.c > > index 15eb82d1a010..1877171e9590 100644 > > --- a/kernel/events/core.c > > +++ b/kernel/events/core.c > > @@ -12762,11 +12762,34 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, > > struct task_struct *task, > > perf_overflow_handler_t overflow_handler, > > void *context) > > +{ > > + return perf_event_create_group_kernel_counters(attr, cpu, task, > > + NULL, overflow_handler, context); > > +} > > +EXPORT_SYMBOL_GPL(perf_event_create_kernel_counter); > > + > > +/** > > + * perf_event_create_group_kernel_counters > > + * > > + * @attr: attributes of the counter to create > > + * @cpu: cpu in which the counter is bound > > + * @task: task to profile (NULL for percpu) > > + * @group_leader: the group leader event of the created event > > + * @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_group_kernel_counters(struct perf_event_attr *attr, > > + int cpu, struct task_struct *task, > > + struct perf_event *group_leader, > > + perf_overflow_handler_t overflow_handler, > > + void *context) > > I would much prefer if you just add the argument to > perf_event_create_kernel_counter(), there aren't *that* many users. Sure. Thanks. -- Thanks, Dapeng Mi