aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 98e78e2f18d6..9cbab7e93557 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -289,6 +289,15 @@ static inline char *task_cap(struct task_struct *p, char *buffer)
289 cap_t(p->cap_effective)); 289 cap_t(p->cap_effective));
290} 290}
291 291
292static inline char *task_context_switch_counts(struct task_struct *p,
293 char *buffer)
294{
295 return buffer + sprintf(buffer, "voluntary_ctxt_switches:\t%lu\n"
296 "nonvoluntary_ctxt_switches:\t%lu\n",
297 p->nvcsw,
298 p->nivcsw);
299}
300
292int proc_pid_status(struct task_struct *task, char * buffer) 301int proc_pid_status(struct task_struct *task, char * buffer)
293{ 302{
294 char * orig = buffer; 303 char * orig = buffer;
@@ -307,6 +316,7 @@ int proc_pid_status(struct task_struct *task, char * buffer)
307#if defined(CONFIG_S390) 316#if defined(CONFIG_S390)
308 buffer = task_show_regs(task, buffer); 317 buffer = task_show_regs(task, buffer);
309#endif 318#endif
319 buffer = task_context_switch_counts(task, buffer);
310 return buffer - orig; 320 return buffer - orig;
311} 321}
312 322
@@ -440,8 +450,9 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
440 450
441 /* Temporary variable needed for gcc-2.96 */ 451 /* Temporary variable needed for gcc-2.96 */
442 /* convert timespec -> nsec*/ 452 /* convert timespec -> nsec*/
443 start_time = (unsigned long long)task->start_time.tv_sec * NSEC_PER_SEC 453 start_time =
444 + task->start_time.tv_nsec; 454 (unsigned long long)task->real_start_time.tv_sec * NSEC_PER_SEC
455 + task->real_start_time.tv_nsec;
445 /* convert nsec -> ticks */ 456 /* convert nsec -> ticks */
446 start_time = nsec_to_clock_t(start_time); 457 start_time = nsec_to_clock_t(start_time);
447 458