Skip to content

Commit e5fd3d6

Browse files
perf: passing struct perf_event to function setup_aux()
Some information, like driver specific configuration, is found in the perf event structure. As such pass a 'struct perf_event' to function setup_aux() rather than just the CPU number so that individual drivers can make the right configuration when setting up a session. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent 1efb790 commit e5fd3d6

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/hwtracing/coresight/coresight-etm-perf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ static void etm_free_aux(void *data)
155155
schedule_work(&event_data->work);
156156
}
157157

158-
static void *etm_setup_aux(int event_cpu, void **pages,
158+
static void *etm_setup_aux(struct perf_event *event, void **pages,
159159
int nr_pages, bool overwrite)
160160
{
161161
int cpu;
162162
cpumask_t *mask;
163163
struct coresight_device *sink;
164164
struct etm_event_data *event_data = NULL;
165165

166-
event_data = alloc_event_data(event_cpu);
166+
event_data = alloc_event_data(event->cpu);
167167
if (!event_data)
168168
return NULL;
169169

include/linux/perf_event.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ struct pmu {
378378
/*
379379
* Set up pmu-private data structures for an AUX area
380380
*/
381-
void *(*setup_aux) (int cpu, void **pages,
381+
void *(*setup_aux) (struct perf_event *event, void **pages,
382382
int nr_pages, bool overwrite);
383383
/* optional */
384384

kernel/events/ring_buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ int rb_alloc_aux(struct ring_buffer *rb, struct perf_event *event,
562562
goto out;
563563
}
564564

565-
rb->aux_priv = event->pmu->setup_aux(event->cpu, rb->aux_pages, nr_pages,
565+
rb->aux_priv = event->pmu->setup_aux(event, rb->aux_pages, nr_pages,
566566
overwrite);
567567
if (!rb->aux_priv)
568568
goto out;

0 commit comments

Comments
 (0)