coresight: perf: Add helper to retrieve sink configuration
We can always find the sink configuration for a given perf_output_handle. Add a helper to retrieve the sink configuration for a given perf_output_handle. This will be used to get rid of the set_buffer() call back. Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7ec786ad19
commit
d25054ee8d
drivers/hwtracing/coresight
|
@ -23,20 +23,6 @@
|
||||||
static struct pmu etm_pmu;
|
static struct pmu etm_pmu;
|
||||||
static bool etm_perf_up;
|
static bool etm_perf_up;
|
||||||
|
|
||||||
/**
|
|
||||||
* struct etm_event_data - Coresight specifics associated to an event
|
|
||||||
* @work: Handle to free allocated memory outside IRQ context.
|
|
||||||
* @mask: Hold the CPU(s) this event was set for.
|
|
||||||
* @snk_config: The sink configuration.
|
|
||||||
* @path: An array of path, each slot for one CPU.
|
|
||||||
*/
|
|
||||||
struct etm_event_data {
|
|
||||||
struct work_struct work;
|
|
||||||
cpumask_t mask;
|
|
||||||
void *snk_config;
|
|
||||||
struct list_head * __percpu *path;
|
|
||||||
};
|
|
||||||
|
|
||||||
static DEFINE_PER_CPU(struct perf_output_handle, ctx_handle);
|
static DEFINE_PER_CPU(struct perf_output_handle, ctx_handle);
|
||||||
static DEFINE_PER_CPU(struct coresight_device *, csdev_src);
|
static DEFINE_PER_CPU(struct coresight_device *, csdev_src);
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#ifndef _CORESIGHT_ETM_PERF_H
|
#ifndef _CORESIGHT_ETM_PERF_H
|
||||||
#define _CORESIGHT_ETM_PERF_H
|
#define _CORESIGHT_ETM_PERF_H
|
||||||
|
|
||||||
|
#include <linux/percpu-defs.h>
|
||||||
#include "coresight-priv.h"
|
#include "coresight-priv.h"
|
||||||
|
|
||||||
struct coresight_device;
|
struct coresight_device;
|
||||||
|
@ -42,14 +43,39 @@ struct etm_filters {
|
||||||
bool ssstatus;
|
bool ssstatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct etm_event_data - Coresight specifics associated to an event
|
||||||
|
* @work: Handle to free allocated memory outside IRQ context.
|
||||||
|
* @mask: Hold the CPU(s) this event was set for.
|
||||||
|
* @snk_config: The sink configuration.
|
||||||
|
* @path: An array of path, each slot for one CPU.
|
||||||
|
*/
|
||||||
|
struct etm_event_data {
|
||||||
|
struct work_struct work;
|
||||||
|
cpumask_t mask;
|
||||||
|
void *snk_config;
|
||||||
|
struct list_head * __percpu *path;
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_CORESIGHT
|
#ifdef CONFIG_CORESIGHT
|
||||||
int etm_perf_symlink(struct coresight_device *csdev, bool link);
|
int etm_perf_symlink(struct coresight_device *csdev, bool link);
|
||||||
|
static inline void *etm_perf_sink_config(struct perf_output_handle *handle)
|
||||||
|
{
|
||||||
|
struct etm_event_data *data = perf_get_aux(handle);
|
||||||
|
|
||||||
|
if (data)
|
||||||
|
return data->snk_config;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static inline int etm_perf_symlink(struct coresight_device *csdev, bool link)
|
static inline int etm_perf_symlink(struct coresight_device *csdev, bool link)
|
||||||
{ return -EINVAL; }
|
{ return -EINVAL; }
|
||||||
|
|
||||||
|
static inline void *etm_perf_sink_config(struct perf_output_handle *handle)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_CORESIGHT */
|
#endif /* CONFIG_CORESIGHT */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue