File: sysc_compat_truncate64.stp

package info (click to toggle)
systemtap 4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,436 kB
  • sloc: cpp: 72,388; ansic: 58,430; xml: 47,797; exp: 40,417; sh: 10,793; python: 2,759; perl: 2,252; tcl: 1,305; makefile: 1,119; lisp: 105; java: 102; awk: 101; asm: 91; sed: 16
file content (59 lines) | stat: -rw-r--r-- 1,879 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
# truncate64 __________________________________________________
#
# COMPAT_SYSCALL_DEFINE3(s390_truncate64, const char __user *, path,
#			 u32, high, u32, low)
#

@define _SYSCALL_COMPAT_TRUNCATE64_NAME
%(
	name = "truncate"
%)

@define _SYSCALL_COMPAT_TRUNCATE64_ARGSTR
%(
	argstr = sprintf("%s, %d", path, length)
%)

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

# dw_compat_truncate64 _____________________________________________________

probe dw_syscall.compat_truncate64 = kernel.function("sys32_truncate64").call ?,
	kernel.function("compat_sys_s390_truncate64").call ?
{
        @_SYSCALL_COMPAT_TRUNCATE64_NAME
	path_uaddr = @__pointer($path)
	path = user_string_quoted(path_uaddr)
        length = (($high << 32) | __uint32($low))
	@_SYSCALL_COMPAT_TRUNCATE64_ARGSTR
}
probe dw_syscall.compat_truncate64.return =
	kernel.function("sys32_truncate64").return ?,
	kernel.function("compat_sys_s390_truncate64").return ?
{
	@_SYSCALL_COMPAT_TRUNCATE64_NAME
	@SYSC_RETVALSTR($return)
}

# nd_compat_truncate64 _____________________________________________________

probe nd_syscall.compat_truncate64 = kprobe.function("sys32_truncate64") ?,
	kprobe.function("compat_sys_s390_truncate64") ?
{
	asmlinkage()
        @_SYSCALL_COMPAT_TRUNCATE64_NAME
	path_uaddr = pointer_arg(1)
	path = user_string_quoted(path_uaddr)
        length = ((uint_arg(2) << 32) | uint_arg(3))
	@_SYSCALL_COMPAT_TRUNCATE64_ARGSTR
}
probe nd_syscall.compat_truncate64.return =
	kprobe.function("sys32_truncate64").return ?,
	kprobe.function("compat_sys_s390_truncate64").return ?
{
	@_SYSCALL_COMPAT_TRUNCATE64_NAME
	@SYSC_RETVALSTR(returnval())
}