Skip to contentSkip to conversation

util-linux: readprofile: don't stop parsing at __init_end

RFC PATCH New Po-Yu Chuang 2 participants 2 messages Apr 8, 2011 – Apr 12, 2011

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 util-linux: readprofile: don't stop parsing at __init_end

From: Po-Yu Chuang <[email protected]>

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.

---
 sys-utils/readprofile.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
sys-utils/readprofile.c +4 -2
index 91ff329..174f9aa 100644
@@ -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')
Signature · 1 line
1.6.3.3
Applied
#1 lore raw

RFC PATCH 1/1 util-linux: readprofile: don't stop parsing at __init_end

Quoted 8 lines · Po-Yu Chuang

From: Po-Yu Chuang <[email protected]>

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.

Quoted 4 lines
---
 sys-utils/readprofile.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Applied, thanks.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com