Commit 5168ce2c647f02756803bef7b74906f485491a1c
Committed by
Martin Schwidefsky
1 parent
cbdc229245
Exists in
master
and in
7 other branches
[S390] cputime: initialize per thread timer values on fork
Initialize per thread timer values instead of just copying them from the parent. That way it is easily possible to tell how much time a thread spent in user/system context. Doesn't fix a bug, this is just for debugging purposes. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff
arch/s390/kernel/process.c
... | ... | @@ -163,6 +163,7 @@ |
163 | 163 | unsigned long unused, |
164 | 164 | struct task_struct *p, struct pt_regs *regs) |
165 | 165 | { |
166 | + struct thread_info *ti; | |
166 | 167 | struct fake_frame |
167 | 168 | { |
168 | 169 | struct stack_frame sf; |
... | ... | @@ -214,6 +215,10 @@ |
214 | 215 | p->thread.mm_segment = get_fs(); |
215 | 216 | /* Don't copy debug registers */ |
216 | 217 | memset(&p->thread.per_info, 0, sizeof(p->thread.per_info)); |
218 | + /* Initialize per thread user and system timer values */ | |
219 | + ti = task_thread_info(p); | |
220 | + ti->user_timer = 0; | |
221 | + ti->system_timer = 0; | |
217 | 222 | return 0; |
218 | 223 | } |
219 | 224 |