Re: [patch] profile enhancements, please read!

From: Andi Kleen (
Date: Thu May 25 2000 - 19:05:24 EST

John Baboval <> writes:

> The attached patch makes the following enhancements to the kernel profiler:
> - Dynamic allocation of the profile buffer.
> This allows for profiling on a production system without the continuous
> performance hit that the profiler causes. You can turn it on, get you
> data, and then turn it off again....
> I submitted this as a patch to 2.3.99pre8, but nobody commented, and it
> didn't get applied. I'm resubmitting because the further enhancements

I actually commented, but it bounced because your mail seemed to have
an invalid From/Reply address.

> Please review and test/apply this patch.

+ size = prof_len * sizeof(unsigned int) + PAGE_SIZE-1;
+ /* Use kmalloc if size < 512 * PAGE_SIZE, if it's bigger use vmalloc */
+ if(size < 512 * PAGE_SIZE)
+ {
+ if(!(prof_buffer = kmalloc(size, GFP_KERNEL)))

kmalloc cannot allocate >128K, and that is very unreliable; better use vmalloc
for >2*PAGE_SIZE

I also think the cleanup function does not check if all resources were
really allocated (which can be triggered with sysctl)

I also have my doubts that the per process name is that useful, because
the linux kernel does a lot of things asynchronously outside process context.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:15 EST