[profile]: [20/23] clean up profile_init() not to oversize buffer

From: William Lee Irwin III
Date: Tue Jun 22 2004 - 11:53:09 EST


Don't overestimate the length of prof_buffer in profile_init().

Index: prof-2.6.7/kernel/profile.c
===================================================================
--- prof-2.6.7.orig/kernel/profile.c 2004-06-22 07:25:59.267153192 -0700
+++ prof-2.6.7/kernel/profile.c 2004-06-22 07:26:00.201011224 -0700
@@ -28,17 +28,12 @@

void __init profile_init(void)
{
- unsigned int size;
-
if (!prof_on)
return;

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

int profiling_on(void)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/