/usr/share/systemtap/tapset/linux/syscalls.stpm is in systemtap-common 2.6-0.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | // syscalls tapset macros
// Copyright (C) 2013-2014 Red Hat Inc.
//
// This file is part of systemtap, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
@define __syscall_gate(syscall_nr)
%(
%( CONFIG_COMPAT == "y" %?
# On some platforms (like s390x and ppc64), the 32-bit
# syscalls use the same syscall number as the 64-bit
# syscall. So, we have to check to see if this is a
# 32-on-64-bit user task.
if (%{ _stp_is_compat_task() %}) next
%)
# If _stp_syscall_nr() fails, that means we aren't in user
# context. So, skip this call.
try { if (_stp_syscall_nr() != @syscall_nr) next } catch { next }
%)
@define __syscall_gate2(syscall_nr1, syscall_nr2)
%(
%( CONFIG_COMPAT == "y" %?
# On some platforms (like s390x and ppc64), the 32-bit
# syscalls use the same syscall number as the 64-bit
# syscall. So, we have to check to see if this is a
# 32-on-64-bit user task.
if (%{ _stp_is_compat_task() %}) next
%)
try { __nr = _stp_syscall_nr() } catch { next }
if ((__nr != @syscall_nr1) && (__nr != @syscall_nr2)) next
%)
@define __syscall_compat_gate(syscall_nr, compat_syscall_nr)
%(
%( CONFIG_COMPAT == "y" %?
try { __nr = _stp_syscall_nr() } catch { next }
if (%{ _stp_is_compat_task() %}) {
if (__nr != @compat_syscall_nr)
next
}
else if (__nr != @syscall_nr)
next
%:
try { if (_stp_syscall_nr() != @syscall_nr) next } catch { next }
%)
%)
@define __compat_syscall_gate(compat_syscall_nr)
%(
%( CONFIG_COMPAT == "y" %?
try { __nr = _stp_syscall_nr() } catch { next }
if (%{ _stp_is_compat_task() %}) {
if (__nr != @compat_syscall_nr) next
}
%)
%)
@define __pointer(val)
%(
%( CONFIG_COMPAT == "y" %?
# If this is a compat task, the high bits of a pointer may be
# garbage.
(%{ _stp_is_compat_task() %} ? (@val & 0xffffffff) : @val)
%:
@val
%)
%)
@define _af_inet_info_u(my_addr_uaddr, addrlen)
%(
%( systemtap_v >= "2.5" %?
uaddr_af = _struct_sockaddr_u_sa_family(@my_addr_uaddr, @addrlen)
if (_struct_sockaddr_u_sa_family(@my_addr_uaddr, @addrlen) =~ "AF_INET.*") {
uaddr_ip = _struct_sockaddr_u_ip_addr(@my_addr_uaddr, @addrlen)
uaddr_ip_port = _struct_sockaddr_u_tcp_port(@my_addr_uaddr, @addrlen)
if (_struct_sockaddr_u_sa_family(@my_addr_uaddr, @addrlen) == "AF_INET6") {
uaddr_ipv6_flowinfo = _struct_sockaddr_u_ipv6_flowinfo(@my_addr_uaddr, @addrlen)
uaddr_ipv6_scope_id = _struct_sockaddr_u_ipv6_scope_id(@my_addr_uaddr, @addrlen)
}
}
%)
%)
|