diff -Naur kernprof/kernprof.c kernprof.new/kernprof.c --- kernprof/kernprof.c Wed Mar 8 00:57:11 2006 +++ kernprof.new/kernprof.c Tue Aug 15 11:32:47 2006 @@ -39,8 +39,8 @@ #include #include #include -#include #include +#include #include #include "gmon_out.h" @@ -306,6 +306,7 @@ PC_sample_count_t *samples; size_t PC_sample_len; int n_buckets; + PC_sample_count_t *percpu_samples; samples = (PC_sample_count_t *)read_file("/proc/profile/PC_samples", &PC_sample_len); @@ -326,7 +327,7 @@ fprintf(stderr, "gentable_pc: wrong PC_sample size\n"); exit(1); } - PC_sample_count_t *percpu_samples = samples + n_buckets; + percpu_samples = samples + n_buckets; for (c = 1; c < memory_map.nr_cpus; c++) { for (i = 0; i < n_buckets; i++) { if (percpu_samples[i]) @@ -414,6 +415,7 @@ int end = start_index + hist_size; int need_free = 0; int n_buckets; + PC_sample_count_t *percpu_samples; if (buf == NULL) { buf = (PC_sample_count_t *) read_file("/proc/profile/PC_samples", &len); @@ -428,7 +430,7 @@ fprintf(stderr, "write_gprof_pc_hist: wrong PC_sample size\n"); exit(1); } - PC_sample_count_t *percpu_samples = buf + n_buckets; + percpu_samples = buf + n_buckets; for (c = 1; c < memory_map.nr_cpus; c++) { for (i = 0; i < n_buckets; i++) { if (percpu_samples[i]) diff -Naur kernprof/kplib.c kernprof.new/kplib.c --- kernprof/kplib.c Wed Jul 6 21:37:57 2005 +++ kernprof.new/kplib.c Tue Aug 15 11:35:31 2006 @@ -45,8 +45,8 @@ #include #include #include -#include #include +#include #include #include "kplib.h" @@ -172,6 +172,7 @@ static int tab_size = 1024; int count = 0; int n_buckets; + PC_sample_count_t *percpu_samples; if (table) { prof_t **entry; @@ -201,7 +202,7 @@ fprintf(stderr, "gentable_pc: wrong PC_sample size\n"); kp_err(1); } - PC_sample_count_t *percpu_samples = samples + n_buckets; + percpu_samples = samples + n_buckets; for (c = 1; c < memory_map.nr_cpus; c++) { for (i = 0; i < n_buckets; i++) { if (percpu_samples[i])