This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

first set of missing system calls


Here's a patch to add a few of the missing system calls.  Unless
somebody beats me to it I'll try to add the other missing *at functions
when I have a bit more time.

-- 
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
--- ./tapset/syscalls2.stp-save	2007-09-22 15:01:04.000000000 -0700
+++ ./tapset/syscalls2.stp	2007-09-22 16:33:29.000000000 -0700
@@ -121,6 +121,42 @@
 	retstr = returnstr(1)
 }
 
+
+# openat _______________________________________________________
+# long sys_openat(int dfd, const char __user * filename, int flags, int mode)
+probe syscall.openat = 
+		kernel.function("sys_openat") ?,
+		kernel.function("compat_sys_openat") ?
+{
+	name = "openat"
+	dfd = $dfd
+	filename = user_string($filename)
+	flags = $flags
+	mode = $mode
+	if (flags & 64) {
+		if (dfd == -100)
+			argstr = sprintf("AT_FDCWD, %s, %s, %#o", user_string_quoted($filename), 
+					_sys_open_flag_str(flags), $mode)
+		else
+			argstr = sprintf("%d, %s, %s, %#o", dfd, user_string_quoted($filename), 
+					_sys_open_flag_str(flags), $mode)
+	} else {
+		if (dfd == -100)
+			argstr = sprintf("AT_FDCWD, %s, %s", user_string_quoted($filename), 
+				_sys_open_flag_str(flags))
+		else
+			argstr = sprintf("%d, %s, %s", dfd, user_string_quoted($filename), 
+				_sys_open_flag_str(flags))
+	}
+}
+probe syscall.openat.return = 
+		kernel.function("sys_openat").return ?, 
+		kernel.function("compat_sys_openat").return ?
+{
+	name = "openat"
+	retstr = returnstr(1)
+}
+
 # pause ______________________________________________________
 #
 # sys_pause(void)
@@ -409,6 +445,7 @@
 	name = "readahead"
 	retstr = returnstr(1)
 }
+
 # readlink ___________________________________________________
 #
 # long sys_readlink(const char __user * path,
@@ -428,6 +465,30 @@
 	retstr = returnstr(1)
 }
 
+# readlinkat ___________________________________________________
+#
+# long sys_readlinkat(int dfd, const char __user * path,
+#		  char __user * buf,
+#		  int bufsiz)
+#
+probe syscall.readlinkat = kernel.function("sys_readlinkat") {
+	name = "readlinkat"
+	dfd = $dfd
+	path = user_string($path)
+	buf_uaddr = $buf
+	bufsiz = $bufsiz
+	if (dfd == -100)
+		argstr = sprintf("AT_FDCWD, %s, %p, %d", user_string_quoted($path), 
+				buf_uaddr, bufsiz)
+	else
+		argstr = sprintf("%d, %s, %p, %d", dfd, user_string_quoted($path), 
+				buf_uaddr, bufsiz)
+}
+probe syscall.readlinkat.return = kernel.function("sys_readlinkat").return {
+	name = "readlinkat"
+	retstr = returnstr(1)
+}
+
 # readv ______________________________________________________
 #
 # ssize_t sys_readv(unsigned long fd,

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]