diff options
author | Matthias Koenig | 2007-07-18 16:15:44 +0200 |
---|---|---|
committer | Karel Zak | 2007-07-24 14:28:40 +0200 |
commit | 5a3009cad69b3eacc46f8bd729fd473500c98c85 (patch) | |
tree | 7659eb83d02a6677771bffb7ab8e8d927063f936 /sys-utils/readprofile.c | |
parent | manpage typos (diff) | |
download | kernel-qcow2-util-linux-5a3009cad69b3eacc46f8bd729fd473500c98c85.tar.gz kernel-qcow2-util-linux-5a3009cad69b3eacc46f8bd729fd473500c98c85.tar.xz kernel-qcow2-util-linux-5a3009cad69b3eacc46f8bd729fd473500c98c85.zip |
readprofile: fix on ppc64
Fix inconsistency between kernel profiling and readprofile.
The range of kernel profiling is between _stext and _etext,
and readprofile tries to extract profiling for all the symbols in
/boot/System.map-2.6.16.11-7-ppc64 from /proc/profile, but there
are more symbols in /boot/System.map-2.6.16.11-7-ppc64 than those
between _stext and _etext.
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/readprofile.c')
-rw-r--r-- | sys-utils/readprofile.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sys-utils/readprofile.c b/sys-utils/readprofile.c index 978e6c1d3..950e90510 100644 --- a/sys-utils/readprofile.c +++ b/sys-utils/readprofile.c @@ -325,6 +325,7 @@ main(int argc, char **argv) { */ while (fgets(mapline,S_LEN,map)) { unsigned int this=0; + int done = 0; if (sscanf(mapline,"%llx %s %s",&next_add,mode,next_name)!=3) { fprintf(stderr,_("%s: %s(%i): wrong map line\n"), @@ -333,12 +334,19 @@ main(int argc, char **argv) { } header_printed = 0; - /* ignore any LEADING (before a '[tT]' symbol is found) - Absolute symbols */ - if ((*mode == 'A' || *mode == '?') && total == 0) continue; - if (*mode != 'T' && *mode != 't' && - *mode != 'W' && *mode != 'w') - break; /* only text is profiled */ + /* the kernel only profiles up to _etext */ + if (!strcmp(next_name, "_etext") || + !strcmp(next_name, "__etext")) + done = 1; + else { + /* ignore any LEADING (before a '[tT]' symbol is found) + Absolute symbols */ + if ((*mode == 'A' || *mode == '?') && total == 0) + continue; + if (*mode != 'T' && *mode != 't' && + *mode != 'W' && *mode != 'w') + break; /* only text is profiled */ + } if (indx >= len / sizeof(*buf)) { fprintf(stderr, _("%s: profile address out of range. " @@ -388,6 +396,8 @@ main(int argc, char **argv) { strcpy(fn_name,next_name); maplineno++; + if (done) + break; } /* clock ticks, out of kernel text - probably modules */ |