3
0
forked from pool/util-linux
util-linux/util-linux-2.12r-sys_utils_readprofile_mapfile.patch

46 lines
1.5 KiB
Diff
Raw Normal View History

diff -ruNp util-linux-2.12r/sys-utils/readprofile.c util-linux-2.12r.fix/sys-utils/readprofile.c
--- util-linux-2.12r/sys-utils/readprofile.c 2004-12-11 11:11:09.000000000 +1100
+++ util-linux-2.12r.fix/sys-utils/readprofile.c 2006-05-19 17:45:56.000000000 +1000
@@ -324,6 +324,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"),
@@ -332,12 +333,17 @@ 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"))
+ 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. "
@@ -387,6 +393,8 @@ main(int argc, char **argv) {
strcpy(fn_name,next_name);
maplineno++;
+ if (done)
+ break;
}
/* clock ticks, out of kernel text - probably modules */