Commit aaf680ea authored by Linus Torvalds's avatar Linus Torvalds

Fix more places where we exported our internal time

to user space. Convert to standard clock_t.
parent abd988c4
......@@ -368,8 +368,8 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
priority,
nice,
0UL /* removed */,
task->it_real_value,
task->start_time,
jiffies_to_clock_t(task->it_real_value),
jiffies_to_clock_t(task->start_time),
vsize,
mm ? mm->rss : 0, /* you might want to shift this left 3 */
task->rlim[RLIMIT_RSS].rlim_cur,
......@@ -693,15 +693,15 @@ int proc_pid_cpu(struct task_struct *task, char * buffer)
len = sprintf(buffer,
"cpu %lu %lu\n",
task->utime,
task->stime);
jiffies_to_clock_t(task->utime),
jiffies_to_clock_t(task->stime));
for (i = 0 ; i < NR_CPUS; i++) {
if (cpu_online(i))
len += sprintf(buffer + len, "cpu%d %lu %lu\n",
i,
task->per_cpu_utime[i],
task->per_cpu_stime[i]);
jiffies_to_clock_t(task->per_cpu_utime[i]),
jiffies_to_clock_t(task->per_cpu_stime[i]));
}
return len;
......
......@@ -36,6 +36,7 @@
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/seq_file.h>
#include <linux/times.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
......@@ -294,18 +295,21 @@ static int kstat_read_proc(char *page, char **start, off_t off,
#endif
}
len = sprintf(page, "cpu %u %u %u %lu\n", user, nice, system,
jif * num_online_cpus() - (user + nice + system));
len = sprintf(page, "cpu %u %u %u %lu\n",
jiffies_to_clock_t(user),
jiffies_to_clock_t(nice),
jiffies_to_clock_t(system),
jiffies_to_clock_t(jif * num_online_cpus() - (user + nice + system)));
for (i = 0 ; i < NR_CPUS; i++){
if (!cpu_online(i)) continue;
len += sprintf(page + len, "cpu%d %u %u %u %lu\n",
i,
kstat.per_cpu_user[i],
kstat.per_cpu_nice[i],
kstat.per_cpu_system[i],
jif - ( kstat.per_cpu_user[i] \
jiffies_to_clock_t(kstat.per_cpu_user[i]),
jiffies_to_clock_t(kstat.per_cpu_nice[i]),
jiffies_to_clock_t(kstat.per_cpu_system[i]),
jiffies_to_clock_t(jif - ( kstat.per_cpu_user[i] \
+ kstat.per_cpu_nice[i] \
+ kstat.per_cpu_system[i]));
+ kstat.per_cpu_system[i])));
}
len += sprintf(page + len,
"page %u %u\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment