From: <za...@us...> - 2004-11-30 22:26:49
|
Will Cohen writes: > In the case where a dprobes probe is placed in a function with > PROBEPOINT_LOCATION, it aways places the probe at an offset of 3 from > start of function. This is wrong. GCC generates schedulable instructions > and may intermix instructions from the body of the function with the > prologue. > > The case were I saw this break was with the tut14.dpc example. In the > Fedora Core 3 smp kernel I built do_fork+3 is the second byte of an > instruction. This is definitely not the correctly place to put a probe. > The result is the kernel crashes with a double. fault. > > disassembled code from the smp kernel: > > c01222e0 <do_fork>: > c01222e0: 55 push %ebp > c01222e1: 57 push %edi > c01222e2: 31 ff xor %edi,%edi > c01222e4: 56 push %esi > > disassembled code from the up kernel > > c01230bd <do_fork>: > c01230bd: 55 push %ebp > c01230be: 89 c5 mov %eax,%ebp > c01230c0: 57 push %edi > c01230c1: 56 push %esi > c01230c2: 89 d6 mov %edx,%esi > c01230c4: 53 push %ebx > > In general this approach in dpcc with a fixed offset is going to be very > fragile because of the assumptions it makes about the code the compiler > generates. > Yes, I'm aware of it - my current code uses skip_prologue_offset() to calculate the offset, but that also doesn't seem to work reliably in all cases. Unfortunately, I don't have the bandwidth to look into it at the moment, but I can send you the code if you want... Tom > -Will > > _______________________________________________ > Dprobes mailing list > Dp...@ww... > http://www-124.ibm.com/developerworks/oss/mailman/listinfo/dprobes -- Regards, Tom Zanussi <za...@us...> IBM Linux Technology Center/RAS |