Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e11a5795 authored by Mathieu Poirier's avatar Mathieu Poirier Committed by Greg Kroah-Hartman
Browse files

perf/aux: Make perf_event accessible to setup_aux()



When pmu::setup_aux() is called the coresight PMU needs to know which
sink to use for the session by looking up the information in the
event's attr::config2 field.

As such simply replace the cpu information by the complete perf_event
structure and change all affected customers.

Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c2bc02f8
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -1600,7 +1600,7 @@ static void aux_sdb_init(unsigned long sdb)


/*
/*
 * aux_buffer_setup() - Setup AUX buffer for diagnostic mode sampling
 * aux_buffer_setup() - Setup AUX buffer for diagnostic mode sampling
 * @cpu:	On which to allocate, -1 means current
 * @event:	Event the buffer is setup for, event->cpu == -1 means current
 * @pages:	Array of pointers to buffer pages passed from perf core
 * @pages:	Array of pointers to buffer pages passed from perf core
 * @nr_pages:	Total pages
 * @nr_pages:	Total pages
 * @snapshot:	Flag for snapshot mode
 * @snapshot:	Flag for snapshot mode
@@ -1612,8 +1612,8 @@ static void aux_sdb_init(unsigned long sdb)
 *
 *
 * Return the private AUX buffer structure if success or NULL if fails.
 * Return the private AUX buffer structure if success or NULL if fails.
 */
 */
static void *aux_buffer_setup(int cpu, void **pages, int nr_pages,
static void *aux_buffer_setup(struct perf_event *event, void **pages,
			      bool snapshot)
			      int nr_pages, bool snapshot)
{
{
	struct sf_buffer *sfb;
	struct sf_buffer *sfb;
	struct aux_buffer *aux;
	struct aux_buffer *aux;
+3 −1
Original line number Original line Diff line number Diff line
@@ -77,10 +77,12 @@ static size_t buf_size(struct page *page)
}
}


static void *
static void *
bts_buffer_setup_aux(int cpu, void **pages, int nr_pages, bool overwrite)
bts_buffer_setup_aux(struct perf_event *event, void **pages,
		     int nr_pages, bool overwrite)
{
{
	struct bts_buffer *buf;
	struct bts_buffer *buf;
	struct page *page;
	struct page *page;
	int cpu = event->cpu;
	int node = (cpu == -1) ? cpu : cpu_to_node(cpu);
	int node = (cpu == -1) ? cpu : cpu_to_node(cpu);
	unsigned long offset;
	unsigned long offset;
	size_t size = nr_pages << PAGE_SHIFT;
	size_t size = nr_pages << PAGE_SHIFT;
+3 −2
Original line number Original line Diff line number Diff line
@@ -1114,10 +1114,11 @@ static int pt_buffer_init_topa(struct pt_buffer *buf, unsigned long nr_pages,
 * Return:	Our private PT buffer structure.
 * Return:	Our private PT buffer structure.
 */
 */
static void *
static void *
pt_buffer_setup_aux(int cpu, void **pages, int nr_pages, bool snapshot)
pt_buffer_setup_aux(struct perf_event *event, void **pages,
		    int nr_pages, bool snapshot)
{
{
	struct pt_buffer *buf;
	struct pt_buffer *buf;
	int node, ret;
	int node, ret, cpu = event->cpu;


	if (!nr_pages)
	if (!nr_pages)
		return NULL;
		return NULL;
+3 −3
Original line number Original line Diff line number Diff line
@@ -177,15 +177,15 @@ static void etm_free_aux(void *data)
	schedule_work(&event_data->work);
	schedule_work(&event_data->work);
}
}


static void *etm_setup_aux(int event_cpu, void **pages,
static void *etm_setup_aux(struct perf_event *event, void **pages,
			   int nr_pages, bool overwrite)
			   int nr_pages, bool overwrite)
{
{
	int cpu;
	int cpu = event->cpu;
	cpumask_t *mask;
	cpumask_t *mask;
	struct coresight_device *sink;
	struct coresight_device *sink;
	struct etm_event_data *event_data = NULL;
	struct etm_event_data *event_data = NULL;


	event_data = alloc_event_data(event_cpu);
	event_data = alloc_event_data(cpu);
	if (!event_data)
	if (!event_data)
		return NULL;
		return NULL;
	INIT_WORK(&event_data->work, free_event_data);
	INIT_WORK(&event_data->work, free_event_data);
+3 −3
Original line number Original line Diff line number Diff line
@@ -824,10 +824,10 @@ static void arm_spe_pmu_read(struct perf_event *event)
{
{
}
}


static void *arm_spe_pmu_setup_aux(int cpu, void **pages, int nr_pages,
static void *arm_spe_pmu_setup_aux(struct perf_event *event, void **pages,
				   bool snapshot)
				   int nr_pages, bool snapshot)
{
{
	int i;
	int i, cpu = event->cpu;
	struct page **pglist;
	struct page **pglist;
	struct arm_spe_pmu_buf *buf;
	struct arm_spe_pmu_buf *buf;


Loading