lkml.org 
[lkml]   [2001]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectDynamically altering code segments
Date
Hi...

This is my first post, so if this is off topic for this list, please direct
me
to another one that is more appropriate. Thanks

That said, I am wanting to dynamically modify the kernel in specific places
to
implement a custom kernel trace mechanism. The general idea is that, when
the
"trace" is off, there are NOP instruction sequences at various places in the
kernel. When the "trace" is turned on, those same NOPs are replaced by JMPs
to code that implements the trace (such as logging events, using the MSR and
PMC's etc..).

This was a trick that was done in my old days of OS/2 performance tools
developement to get trace information from the running kernel. In that
case,
we simply remapped the appropriate code segments to data segments (I think
back then it was called 'aliasing code segments') and used that segment to
make changes to the kernel code on the fly.

Is it possible to do the same thing in Linux?

Thanks

Tom


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

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.040 / U:2.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site