Merge pull request #37 from Tencent/zgpeng

proc: fix the display error of the processes field in /proc/stat
This commit is contained in:
heddchen 2020-11-12 15:49:13 +08:00 committed by GitHub
commit 9c2652e3d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -118,7 +118,7 @@ static int show_bt_stat(struct seq_file *p, void *v)
seq_printf(p,
"\nctxt %llu\n"
"btime %lu\n"
"processes %d\n"
"processes %lu\n"
"procs_running %lu\n"
"procs_blocked %lu\n",
nr_context_switches(),

View File

@ -169,7 +169,7 @@ static int show_stat(struct seq_file *p, void *v)
seq_printf(p,
"\nctxt %llu\n"
"btime %llu\n"
"processes %d\n"
"processes %lu\n"
"procs_running %lu\n"
"procs_blocked %lu\n",
nr_context_switches(),

View File

@ -15,7 +15,7 @@
DECLARE_PER_CPU(unsigned long, total_forks);
extern int nr_threads;
DECLARE_PER_CPU(unsigned long, process_counts);
extern int nr_forks(void);
extern unsigned long nr_forks(void);
extern int nr_processes(void);
extern unsigned long nr_running(void);
extern unsigned long nr_running_cpu(int cpu);

View File

@ -133,10 +133,10 @@ int lockdep_tasklist_lock_is_held(void)
EXPORT_SYMBOL_GPL(lockdep_tasklist_lock_is_held);
#endif /* #ifdef CONFIG_PROVE_RCU */
int nr_forks(void)
unsigned long nr_forks(void)
{
int cpu;
int total = 0;
unsigned long total = 0;
for_each_possible_cpu(cpu)
total += per_cpu(total_forks, cpu);