This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/2438] Can't resolve $fd argument for sys_readv and sys_writev on ppc64


------- Additional Comments From guij at cn dot ibm dot com  2006-04-26 06:19 -------
It seems such case cannot be avoided completely. In powerpc, first
arguments are always passed in registers, and there's no reason
for the compiler to refuse to put a modification instruction at the 
probe address.

How about fixing it like:

In ppc64, use
  dwarf_getlocation_addr(attr, pc - module_bias - 4, &expr,&len,1)
instead of
  dwarf_getlocation_addr(attr, pc - module_bias, &expr,&len,1))

Here, 4 is sizeof(kprobe_opcode_t).

The reason is: 

the instruction at the "pc" address will modify the incoming argument 
register therfore make related location list entry invalid, while it 
was still valid at the preceding address "pc-4".

Since our pre-handler will be executed before this instruction
at "pc", the location list entry should also be valid at that time.

But elfutils has no idea about the difference of the inserted handler
and the original instruction, we have use this trick to tell elfutils:
"give me the location-list entry, as long as it is valid before me".

I've tried it on my ppc64 box and it works. 

Any comments?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2438

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]