]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
readprofile: don't stop parsing at __init_end
authorPo-Yu Chuang <ratbert@faraday-tech.com>
Fri, 8 Apr 2011 09:35:53 +0000 (17:35 +0800)
committerKarel Zak <kzak@redhat.com>
Tue, 12 Apr 2011 10:10:54 +0000 (12:10 +0200)
Some architectures like ARM place __init_end before .text section.
If any function in .init section is hit while profiling, readprofile
stops at __init_end.  That means if we enable profiling at boot time,
the profiler probably hits init functions and readprofile does not
work well unless we reset profiling buffer with -r option.

Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com>
sys-utils/readprofile.c

index 91ff32951bf32c2ccc86987648aa74c8cffd56a4..174f9aa0d03ce26cd1b768b5fedbf5e837097683 100644 (file)
@@ -323,8 +323,10 @@ main(int argc, char **argv) {
                        done = 1;
                else {
                        /* ignore any LEADING (before a '[tT]' symbol is found)
-                          Absolute symbols */
-                       if ((*mode == 'A' || *mode == '?') && total == 0)
+                          Absolute symbols and __init_end because some
+                          architectures place it before .text section */
+                       if ((*mode == 'A' || *mode == '?')
+                           && (total == 0 || !strcmp(next_name, "__init_end")))
                                continue;
                        if (*mode != 'T' && *mode != 't' &&
                            *mode != 'W' && *mode != 'w')