lkml.org 
[lkml]   [2014]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tracing: Use task_nice() in function __update_max_tr() to get the nice value of task.
Date
There is already a function named task_nice in sched.h to get the nice value
of task_struct. We can use it in __update_max_tr() rather than calculate it
manually.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
kernel/trace/trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 9d20cd9..ec149b4 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -970,7 +970,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
else
max_data->uid = task_uid(tsk);

- max_data->nice = tsk->static_prio - 20 - MAX_RT_PRIO;
+ max_data->nice = task_nice(tsk);
max_data->policy = tsk->policy;
max_data->rt_priority = tsk->rt_priority;

--
1.8.2.1


\
 
 \ /
  Last update: 2014-01-22 11:22    [W:0.069 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site