]> Pileus Git - ~andy/linux/blobdiff - kernel/trace/trace.c
tracing: Use current_uid() for critical time tracing
[~andy/linux] / kernel / trace / trace.c
index 4d79485b3237597a3657b3f2b98b4fca1f40d3a6..1a41023a1f88e03cb6ee79e0b7c46991857e90ab 100644 (file)
@@ -843,7 +843,15 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
 
        memcpy(max_data->comm, tsk->comm, TASK_COMM_LEN);
        max_data->pid = tsk->pid;
-       max_data->uid = task_uid(tsk);
+       /*
+        * If tsk == current, then use current_uid(), as that does not use
+        * RCU. The irq tracer can be called out of RCU scope.
+        */
+       if (tsk == current)
+               max_data->uid = current_uid();
+       else
+               max_data->uid = task_uid(tsk);
+
        max_data->nice = tsk->static_prio - 20 - MAX_RT_PRIO;
        max_data->policy = tsk->policy;
        max_data->rt_priority = tsk->rt_priority;