I've been having a back and forth going for a while with my TA and OSYou stipulated 8MB text, but this calculates in unsigned ints, so prof_len = 2M.
professor on the meaning of profile=3 and have been unable to convince
either of them. The basic question is if profile=3 is passed to kernel
with an 8MB text section, how big is the allocated profile buffer. His
answer is 1MB....
if (prof_shift) {
unsigned int size;
/* only text is profiled */
prof_len = (unsigned *) &_etext - (unsigned *) &_stext;
prof_len >>= prof_shift;
size = prof_len * sizeof(unsigned int) + PAGE_SIZE-1;
prof_buffer = (unsigned int *) alloc_bootmem(size);
}