Duplicate events for 32-bit compatible syscall probes

David Smith dsmith@redhat.com
Thu Apr 25 13:12:00 GMT 2013


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
}
=====

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)



More information about the Systemtap mailing list