lkml.org 
[lkml]   [2006]   [Sep]   [20]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
DateWed, 20 Sep 2006 11:39:55 +0200
FromHelge Hafting <>
SubjectRe: [PATCH] Linux Kernel Markers
S. P. Prasanna wrote:
>>
>> Yes, that's simple. but slower, as you have a double jump. Probably
>> a damned sight faster than int3 though.
>>
>> M.
>> 
>
> The advantage of using int3 over jmp to launch the instrumented
> module is that int3 (or breakpoint in most architectures) is an
> atomic operation to insert.
> 
Yes, 5 bytes is not an atomic write except on 64-bit. So a race is possible.

How about this workaround:
1. Overwrite the start of the function with a hlt, which is atomic.
2. Write that 5-byte jump after the hlt.
3. Overwrite the hlt with nop so things will work
4. interrupt any cpus that got stuck on the hlt - or just wait for the 
timer.

Helge Hafting

-
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: 2006-09-20 07:45    [W:1.216 / U:0.430 seconds]
©2003-2008 Jasper Spaans