File: sysc_sysctl32.stp

package info (click to toggle)
systemtap 5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,556 kB
  • sloc: cpp: 81,117; ansic: 54,933; xml: 49,795; exp: 43,595; sh: 11,526; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (82 lines) | stat: -rw-r--r-- 2,359 bytes parent folder | download | duplicates (5)
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
# compat_sys_sysctl ________________________________________
#
# long compat_sys_sysctl(struct __sysctl_args32 __user *args)
#
# To match the ia64/s390/x86_64 versions (and to match the syscall variant of
# this probe), the 'syscall.compat_sysctl' probe name is deprecated and
# 'syscall.sysctl32' should be used instead.  To use the old name without
# changing your script, use the '--compatible 2.8' stap option.
#

@define _SYSCALL_SYSCTL32_NAME
%(
	name = "sysctl"
%)

@define _SYSCALL_SYSCTL32_ARGSTR
%(
	argstr = sprintf("%p", args)
%)

probe
%( systemtap_v <= "2.8"
		%? syscall.compat_sysctl %: syscall.sysctl32
		%) = dw_syscall.sysctl32 !, nd_syscall.sysctl32 ? {}
probe
%( systemtap_v <= "2.8"
		%? syscall.compat_sysctl.return %: syscall.sysctl32.return
		%) = dw_syscall.sysctl32.return !, nd_syscall.sysctl32.return ? {}

# Note that these probes used to hook up to the ppc64 specific
# compat_sys_sysctl() kernel function. However, that was just a
# wrapper around sys_sysctl(). To avoid syscall nesting, we'll just
# ignore compat_sys_sysctl().

# dw_compat_sys_sysctl ________________________________________

probe
%( systemtap_v <= "2.8"
		%? dw_syscall.compat_sysctl %: dw_syscall.sysctl32
		%)
	= %( systemtap_v <= "3.1"
	    %? kernel.function("compat_sys_sysctl").call ? %: never %)
{
	@_SYSCALL_SYSCTL32_NAME
	args = %( systemtap_v <= "3.1" %? $args %: 0 %)
	@_SYSCALL_SYSCTL32_ARGSTR
}
probe
%( systemtap_v <= "2.8"
		%? dw_syscall.compat_sysctl.return %: dw_syscall.sysctl32.return
		%)
	= %( systemtap_v <= "3.1"
	    %? kernel.function("compat_sys_sysctl").return ? %: never %)
{
	@_SYSCALL_SYSCTL32_NAME
	retstr =  %( systemtap_v <= "3.1" %? return_str(1, $return) %: "0" %)
}

# nd_compat_sys_sysctl ________________________________________

probe
%( systemtap_v <= "2.8"
		%? nd_syscall.compat_sysctl %: nd_syscall.sysctl32
		%)
	= %( systemtap_v <= "3.1" %? kprobe.function("compat_sys_sysctl") ?
	    %: never %)
{
	@_SYSCALL_SYSCTL32_NAME
	asmlinkage()
	args = %( systemtap_v <= "3.1" %? pointer_arg(1) %: 0 %)
	@_SYSCALL_SYSCTL32_ARGSTR
}
probe
%( systemtap_v <= "2.8"
		%? nd_syscall.compat_sysctl.return %: nd_syscall.sysctl32.return
		%)
	= %( systemtap_v <= "3.1"
	    %? kprobe.function("compat_sys_sysctl").return ? %: never %)
{
	@_SYSCALL_SYSCTL32_NAME
	retstr =  %( systemtap_v <= "3.1" %? returnstr(1) %: "0" %)
}