This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Duplicate events for 32-bit compatible syscall probes
- From: David Smith <dsmith at redhat dot com>
- To: Aryeh Weinreb <weinrea at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 25 Apr 2013 09:39:54 -0500
- Subject: Re: Duplicate events for 32-bit compatible syscall probes
- References: <CAE5ibEkN66WM4a1YD8r3xAqBb519iJNOThL3ek5otXcBJSaJwA at mail dot gmail dot com> <51792BCC dot 5090406 at redhat dot com> <51792D24 dot 5060002 at redhat dot com>
On 04/25/2013 08:18 AM, David Smith wrote:
> On 04/25/2013 08:12 AM, David Smith wrote:
>> On 04/24/2013 04:47 AM, Aryeh Weinreb wrote:
>>> Hi,
>>>
>>> While using some syscall.mq_* probes on 32bit on x86_64 I am getting
>>> duplicate events.
>>>
>>> Looking into ipc/compat_mq.c it seems that the compat_sys_mq calls are
>>> just wrappers for the sys_mq ones.
>>> Although, sometimes the compat calls can return EFAULT without calling
>>> the non-compat versions.
>>>
>>> It would be nice to only get one event for each system call without
>>> missing any calls.
>>>
>>> I am using an RHEL 6 build of systemtap version 1.8.
>>
>> If you just want to trace the "real" 64-bit syscalls, I'd do something
>> like the following to reject the 32-bit-on-64-bit syscalls. Note that
>> this is untested, but should work.
>>
>> =====
>> function is_compat_task:long () %{
>> STAP_RETVALUE = _stp_is_compat_task();
>> %}
>>
>> probe syscall.mq_getsetattr
>> {
>> if { is_compat_task() } next;
>> # ... your real code here
>> }
>> =====
>>
>
> And of course as soon as I send this I realize it won't work. That will
> most likely reject all 32-on-64 processes.
>
> I'll keep thinking here.
>
OK, here's a solution that I actually tested with syscall.open.
Basically if the function name we're probing has 'compat_' in it, skip it.
====
probe syscall.open
{
if (isinstr(ppfunc(), "compat_")) {
next
}
# ... your real code here
}
====
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)