]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blobdiff - drivers/misc/tegra-profiler/hrt.c
misc: tegra-profiler: unwinding: use RCU locking
[sojka/nv-tegra/linux-3.10.git] / drivers / misc / tegra-profiler / hrt.c
index c03d53832c6bcbc646170e6198d3dd3d94eb170b..c25384429cfdbff54d52851709d8c654b92a9112 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/ptrace.h>
 #include <linux/interrupt.h>
 #include <linux/err.h>
+#include <linux/nsproxy.h>
 
 #include <asm/cputype.h>
 #include <asm/irq_regs.h>
@@ -253,22 +254,15 @@ read_all_sources(struct pt_regs *regs, struct task_struct *task)
        if (atomic_read(&cpu_ctx->nr_active) == 0)
                return;
 
-       if (!task) {
-               pid_t pid;
-               struct pid *pid_s;
-               struct quadd_thread_data *t_data;
-
-               t_data = &cpu_ctx->active_thread;
-               pid = t_data->pid;
+       if (!task)
+               task = current;
 
-               rcu_read_lock();
-               pid_s = find_vpid(pid);
-               if (pid_s)
-                       task = pid_task(pid_s, PIDTYPE_PID);
+       rcu_read_lock();
+       if (!task_nsproxy(task)) {
                rcu_read_unlock();
-               if (!task)
-                       return;
+               return;
        }
+       rcu_read_unlock();
 
        if (ctx->pmu && ctx->pmu_info.active)
                nr_events += read_source(ctx->pmu, regs,