diff options
author | Chunyan Zhang <zhang.chunyan@linaro.org> | 2015-07-31 18:37:26 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-05 23:30:15 +0300 |
commit | 722102274ab1206634d31abe4f438a911a0945d2 (patch) | |
tree | d01e62de326f74e7167ae98ffad435e36c634c72 /include/linux/coresight.h | |
parent | cd196ac3fa5a574f3ddf37b66fbe8c58225c3355 (diff) |
Coresight: Add an interface for supporting ETM3/4 Context ID tracing
If PID namespace is enabled, everytime users configure the Context ID
register to trace the specific process, there needs to be a translation
between the real PID seen from the kernel and VPID seen from the
namespace in which the user's process resides .
This patch just adds the translation interface for ETMs.
Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/coresight.h')
-rw-r--r-- | include/linux/coresight.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 3486b9082adb..626da6948ca2 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -248,4 +248,24 @@ static inline struct coresight_platform_data *of_get_coresight_platform_data( struct device *dev, struct device_node *node) { return NULL; } #endif +#ifdef CONFIG_PID_NS +static inline unsigned long +coresight_vpid_to_pid(unsigned long vpid) +{ + struct task_struct *task = NULL; + unsigned long pid = 0; + + rcu_read_lock(); + task = find_task_by_vpid(vpid); + if (task) + pid = task_pid_nr(task); + rcu_read_unlock(); + + return pid; +} +#else +static inline unsigned long +coresight_vpid_to_pid(unsigned long vpid) { return vpid; } +#endif + #endif |