All of lore.kernel.org
 help / color / mirror / Atom feed
* Replacing kernel functions - kernel symtab
@ 2010-03-03 17:11 Leonidas .
  0 siblings, 0 replies; only message in thread
From: Leonidas . @ 2010-03-03 17:11 UTC (permalink / raw)
  To: linux-kernel

Hi

I am working on a module which provides dynamic instrumentation for
some of the kernel
functions. My module is not ready yet from dynamic instrumentation perspective.

In order to test basic functionality, I am planning to hijack calls
like kmalloc in order to provide
some profiling information. I was thinking of replacing the symbols in
the kernel symbol table
just for testing purposes. I know this is not a clean approach.

Would it possible to replace kmalloc with my_kmalloc in my modules
init function? This way, after
my module is loaded all mallocs are routed to my module. What could go
wrong here? Logically,
this is just point replacement in symtab which should be atomic, right?

Is there any other way to trap calls like kmalloc without making
changes in mm subsystem or compiling
kernel/rebooting? In user space we have multiple options like usage of
LD_PRELOAD etc, are there
any loading time tricks which we can use in kernel space?



-Leo.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-03 17:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-03 17:11 Replacing kernel functions - kernel symtab Leonidas .

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.