Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144019
b: refs/heads/master
c: e1c8053
h: refs/heads/master
i:
  144017: 195c7b3
  144015: b0d2c61
v: v3
  • Loading branch information
Martin Schwidefsky committed Apr 23, 2009
1 parent d7eb656 commit 8cd7d51
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1ad171efa089ae26aba750d747d8149a4f860d5
refs/heads/master: e1c805309d19c69d4ebeac38724076fa86feacdf
4 changes: 4 additions & 0 deletions trunk/arch/s390/include/asm/cputime.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,8 @@ cputime64_to_clock_t(cputime64_t cputime)
return __div(cputime, 4096000000ULL / USER_HZ);
}

cputime64_t s390_get_idle_time(int cpu);

#define arch_idle_time(cpu) s390_get_idle_time(cpu)

#endif /* _S390_CPUTIME_H */
16 changes: 16 additions & 0 deletions trunk/arch/s390/kernel/vtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,22 @@ void vtime_stop_cpu(void)
}
}

cputime64_t s390_get_idle_time(int cpu)
{
struct s390_idle_data *idle;
unsigned long long now, idle_time, idle_enter;

idle = &per_cpu(s390_idle, cpu);
spin_lock(&idle->lock);
now = get_clock();
idle_time = 0;
idle_enter = idle->idle_enter;
if (idle_enter != 0ULL && idle_enter < now)
idle_time = now - idle_enter;
spin_unlock(&idle->lock);
return idle_time;
}

/*
* Sorted add to a list. List is linear searched until first bigger
* element is found.
Expand Down
5 changes: 5 additions & 0 deletions trunk/fs/proc/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#ifndef arch_irq_stat
#define arch_irq_stat() 0
#endif
#ifndef arch_idle_time
#define arch_idle_time(cpu) 0
#endif

static int show_stat(struct seq_file *p, void *v)
{
Expand All @@ -40,6 +43,7 @@ static int show_stat(struct seq_file *p, void *v)
nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice);
system = cputime64_add(system, kstat_cpu(i).cpustat.system);
idle = cputime64_add(idle, kstat_cpu(i).cpustat.idle);
idle = cputime64_add(idle, arch_idle_time(i));
iowait = cputime64_add(iowait, kstat_cpu(i).cpustat.iowait);
irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq);
softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
Expand Down Expand Up @@ -69,6 +73,7 @@ static int show_stat(struct seq_file *p, void *v)
nice = kstat_cpu(i).cpustat.nice;
system = kstat_cpu(i).cpustat.system;
idle = kstat_cpu(i).cpustat.idle;
idle = cputime64_add(idle, arch_idle_time(i));
iowait = kstat_cpu(i).cpustat.iowait;
irq = kstat_cpu(i).cpustat.irq;
softirq = kstat_cpu(i).cpustat.softirq;
Expand Down

0 comments on commit 8cd7d51

Please sign in to comment.