Re: [util-linux] readprofile ignores the last element in /proc/profile

mita akinobu
2004-08-31T17:24:16Z

Perhaps the prof_buffer[] should have prepared another entry for
exceeded PC samplings.

--- 2.6-mm/kernel/profile.c.orig 2004-09-01 01:46:16.000000000 +0900
+++ 2.6-mm/kernel/profile.c 2004-09-01 01:58:02.549930824 +0900
@@ -44,7 +44,7 @@ void __init profile_init(void)
return;

/* only text is profiled */
- prof_len = (_etext - _stext) >> prof_shift;
+ prof_len = ((_etext - _stext) >> prof_shift) + 1;
prof_buffer = alloc_bootmem(prof_len*sizeof(atomic_t));
}