File: sysc_ipc.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 (65 lines) | stat: -rw-r--r-- 1,507 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
%( systemtap_v <= "2.7" %?
# sys32_ipc() is just a syscall multiplexer (similar to
# sys_socketcall()). So, we don't really need to probe it, since we'll
# be probing what sys32_ipc() will call (semget, msgsnd, msgrcv,
# shmat, etc.).

# ipc ________________________________________
#
# long sys32_ipc(u32 call, u32 first, u32 second, u32 third,
#			compat_uptr_t ptr, u32 fifth)
#

@define _SYSCALL_IPC_NAME
%(
	name = "ipc"
%)

@define _SYSCALL_IPC_ARGSTR
%(
	argstr = sprintf("%d, %d, %d, %d, %p, %d", call, first, second,
	                 third, ptr, fifth)
%)

probe syscall.ipc = dw_syscall.ipc !, nd_syscall.ipc ? {}
probe syscall.ipc.return = dw_syscall.ipc.return !, nd_syscall.ipc.return ? {}

# dw_ipc _____________________________________________________

probe dw_syscall.ipc = kernel.function("sys32_ipc") ?
{
	@_SYSCALL_IPC_NAME
	call = $call
	first = $first
	second = $second
	third = $third
	ptr = $ptr
	fifth = $fifth
	@_SYSCALL_IPC_ARGSTR
}
probe dw_syscall.ipc.return = kernel.function("sys32_ipc").return ?
{
	@_SYSCALL_IPC_NAME
	@SYSC_RETVALSTR($return)
}

# nd_ipc _____________________________________________________

probe nd_syscall.ipc = kprobe.function("sys32_ipc") ?
{
	@_SYSCALL_IPC_NAME
	asmlinkage()
	call = uint_arg(1)
	first = uint_arg(2)
	second = uint_arg(3)
	third = uint_arg(4)
	ptr = uint_arg(5)
	fifth = uint_arg(6)
	@_SYSCALL_IPC_ARGSTR
}
probe nd_syscall.ipc.return = kprobe.function("sys32_ipc").return ?
{
	@_SYSCALL_IPC_NAME
	@SYSC_RETVALSTR(returnval())
}
%)