[PATCH] implementations of the 13 openat syscalls + inotify (fwd)

Bernhard Kaindl bk at suse.de
Tue Mar 28 11:57:03 UTC 2006


(resend with one attachment removed, the moderator should reject
my previous mail, it hit the 40 message size limit)

Hi,

I fixed two bugs and added support for i386. I tested i386 using
32-bit compatabilty syscalls on x86_64, and the strace output
of the glibc *at testcases match also. That looks correct.

I generated the syscallent.sh which is included in straces
and hacked it quickly to allow me to retrieve the number of
args check the system call takes from a kernel system call
implementation.

If you have the input file which it expects ($1 needs to be
e.g.  kernel's include/asm-i386/unistd.h) in the same format,
you can use it directly to update your arch's syscallent file
with the missig entries or you can see if you can generate
such file quickly from the whay which your archtecture uses
to wire up system calls.

The attached patch also contains an implementation for
two inotify calls because I merged the syscallentf files
with the changes it does to one patch. These should be
added to the strace CVS as well, I assume.

I added TD and TF flags for all 13 at syscall now as
the manual page says that -e file should show all
calls which take a file argument and for -e desc
it says it should show all calls which take file
descriptors, and all *at calls take both, file
descriptors and file name args, to they have to
be shown with -e file as will as with -e desc.

As the output for i386 and x86_64 matched the
*at implementation looks finished to me and
ready for inclusion in the CVS.

Bernhard
-------------- next part --------------
diff -rup strace.current/file.c strace.+inotify/file.c
--- strace.current/file.c	2005-06-08 22:45:28.000000000 +0200
+++ strace.+inotify/file.c	2006-03-28 21:15:15.000000000 +0200
@@ -324,6 +324,76 @@ struct tcb *tcp;
 	return 0;
 }
 
+static const struct xlat inotify_modes[] = {
+	{ 0x00000001, "IN_ACCESS" },
+	{ 0x00000002, "IN_MODIFY" },
+	{ 0x00000004, "IN_ATTRIB" },
+	{ 0x00000008, "IN_CLOSE_WRITE" },
+	{ 0x00000010, "IN_CLOSE_NOWRITE" },
+	{ 0x00000020, "IN_OPEN" },
+	{ 0x00000040, "IN_MOVED_FROM" },
+	{ 0x00000080, "IN_MOVED_TO" },
+	{ 0x00000100, "IN_CREATE" },
+	{ 0x00000200, "IN_DELETE" },
+	{ 0x00000400, "IN_DELETE_SELF" },
+	{ 0x00000800, "IN_MOVE_SELF" },
+	{ 0x00002000, "IN_UNMOUNT" },
+	{ 0x00004000, "IN_Q_OVERFLOW" },
+	{ 0x00008000, "IN_IGNORED" },
+	{ 0x40000000, "IN_ISDIR" },
+	{ 0x80000000, "IN_ONESHOT" }
+};
+
+int
+sys_inotify_add_watch(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		tprintf("%ld, ", tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", ");
+		printflags(inotify_modes, tcp->u_arg[2], "IN_???");
+	}
+	return 0;
+}
+
+int
+sys_inotify_rm_watch(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		tprintf("%ld, %ld", tcp->u_arg[0], tcp->u_arg[1]);
+	}
+	return 0;
+}
+
+static inline void printdfd(dfd)
+int dfd;
+{
+	if (dfd == AT_FDCWD)
+		tprintf("AT_FDCWD, ");
+	else
+		tprintf("%d, ", dfd);
+}
+
+int
+sys_openat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", ");
+		/* flags */
+		printflags(openmodes, tcp->u_arg[2] + 1, "O_???");
+		if (tcp->u_arg[2] & O_CREAT) {
+			/* mode */
+			tprintf(", %#lo", tcp->u_arg[3]);
+		}
+	}
+	return 0;
+}
+
 #ifdef LINUXSPARC
 static const struct xlat openmodessol[] = {
 	{ 0,		"O_RDWR"	},
@@ -400,6 +470,19 @@ struct tcb *tcp;
 }
 
 int
+sys_faccessat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", ");
+		printflags(access_flags, tcp->u_arg[2], "?_OK");
+	}
+	return 0;
+}
+
+int
 sys_umask(tcp)
 struct tcb *tcp;
 {
@@ -1128,6 +1211,31 @@ struct tcb *tcp;
 }
 #endif
 
+static const struct xlat fstatatflags[] = {
+	{ AT_SYMLINK_NOFOLLOW,	"AT_SYMLINK_NOFOLLOW"	},
+	{ 0,			NULL			},
+};
+
+int
+sys_fstatat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", ");
+	} else {
+#ifdef HAVE_STAT64
+		printstat64(tcp, tcp->u_arg[2]);
+#else
+		printstat(tcp, tcp->u_arg[2]);
+#endif
+		tprintf(", ");
+		printflags(fstatatflags, tcp->u_arg[3], "AT_???");
+	}
+	return 0;
+}
+
 int
 sys_fstat64(tcp)
 struct tcb *tcp;
@@ -1696,6 +1804,18 @@ struct tcb *tcp;
 }
 
 int
+sys_mkdirat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", %#lo", tcp->u_arg[2]);
+	}
+	return 0;
+}
+
+int
 sys_rmdir(tcp)
 struct tcb *tcp;
 {
@@ -1757,6 +1877,70 @@ struct tcb *tcp;
 	return 0;
 }
 
+static const struct xlat unlinkatflags[] = {
+	{ AT_REMOVEDIR,	"AT_REMOVEDIR"	},
+	{ 0,		NULL		},
+};
+
+int
+sys_linkat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", ");
+		printdfd(tcp->u_arg[2]);
+		printpath(tcp, tcp->u_arg[3]);
+		tprintf(", %ld", tcp->u_arg[4]);
+	}
+	return 0;
+}
+
+int
+sys_unlinkat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", ");
+		printflags(unlinkatflags, tcp->u_arg[2], "AT_???");
+	}
+	return 0;
+}
+
+int
+sys_symlinkat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printpath(tcp, tcp->u_arg[0]);
+		tprintf(", ");
+		printdfd(tcp->u_arg[1]);
+		printpath(tcp, tcp->u_arg[2]);
+	}
+	return 0;
+}
+
+int
+sys_readlinkat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", ");
+	} else {
+		if (syserror(tcp))
+			tprintf("%#lx", tcp->u_arg[2]);
+		else
+			printpathn(tcp, tcp->u_arg[2], tcp->u_rval);
+		tprintf(", %lu", tcp->u_arg[3]);
+	}
+	return 0;
+}
+
 int
 sys_symlink(tcp)
 struct tcb *tcp;
@@ -1799,6 +1983,20 @@ struct tcb *tcp;
 }
 
 int
+sys_renameat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", ");
+		printdfd(tcp->u_arg[2]);
+		printpath(tcp, tcp->u_arg[3]);
+	}
+	return 0;
+}
+
+int
 sys_chown(tcp)
 struct tcb *tcp;
 {
@@ -1823,6 +2021,31 @@ struct tcb *tcp;
 }
 
 int
+sys_fchownat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		printuid(", ", tcp->u_arg[2]);
+		printuid(", ", tcp->u_arg[3]);
+	}
+	return 0;
+}
+
+int
+sys_fchmodat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", %#lo", tcp->u_arg[2]);
+	}
+	return 0;
+}
+
+int
 sys_chmod(tcp)
 struct tcb *tcp;
 {
@@ -1870,6 +2093,19 @@ struct tcb *tcp;
 }
 
 int
+sys_futimesat(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", ");
+		printtv(tcp, tcp->u_arg[2]);
+	}
+	return 0;
+}
+
+int
 sys_utime(tcp)
 struct tcb *tcp;
 {
@@ -1923,6 +2159,36 @@ struct tcb *tcp;
 }
 
 int
+sys_mknodat(tcp)
+struct tcb *tcp;
+{
+	int mode = tcp->u_arg[2];
+
+	if (entering(tcp)) {
+		printdfd(tcp->u_arg[0]);
+		printpath(tcp, tcp->u_arg[1]);
+		tprintf(", %s", sprintmode(mode));
+		switch (mode & S_IFMT) {
+		case S_IFCHR: case S_IFBLK:
+#ifdef LINUXSPARC
+			if (current_personality == 1)
+			tprintf(", makedev(%lu, %lu)",
+				(unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
+				(unsigned long) (tcp->u_arg[3] & 0x3ffff));
+			else
+#endif
+			tprintf(", makedev(%lu, %lu)",
+				(unsigned long) major(tcp->u_arg[3]),
+				(unsigned long) minor(tcp->u_arg[3]));
+			break;
+		default:
+			break;
+		}
+	}
+	return 0;
+}
+
+int
 sys_mkfifo(tcp)
 struct tcb *tcp;
 {
Only in strace.+inotify: file.c.orig
diff -rup strace.current/linux/alpha/syscallent.h strace.+inotify/linux/alpha/syscallent.h
--- strace.current/linux/alpha/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace.+inotify/linux/alpha/syscallent.h	2006-03-28 21:14:58.000000000 +0200
@@ -467,3 +467,11 @@
 	{ 2,	0,	sys_mq_notify,		"mq_notify"		}, /* 436 */
 	{ 3,	0,	sys_mq_getsetattr,	"mq_getsetattr"		}, /* 437 */
 	{ 4,	0,	printargs,		"waitid"		}, /* 438 */
+	{ 5,	0,	printargs,		"add_key"		}, /* 439 */
+	{ 4,	0,	printargs,		"request_key"		}, /* 440 */
+	{ 5,	0,	printargs,		"keyctl"		}, /* 441 */
+	{ 3,	0,	printargs,		"ioprio_set"		}, /* 442 */
+	{ 2,	0,	printargs,		"ioprio_get"		}, /* 443 */
+	{ 0,	0,	printargs,		"inotify_init"		}, /* 444 */
+	{ 3,	0,	sys_inotify_add_watch,	"inotify_add_watch"	}, /* 445 */
+	{ 2,	0,	sys_inotify_rm_watch,	"inotify_rm_watch"	}, /* 446 */
diff -rup strace.current/linux/ia64/syscallent.h strace.+inotify/linux/ia64/syscallent.h
--- strace.current/linux/ia64/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace.+inotify/linux/ia64/syscallent.h	2006-03-28 21:14:58.000000000 +0200
@@ -1174,15 +1174,15 @@
 	{ 5,	0,	printargs,		"sys_kexec_load" }, /* 1268 */
 	{ 5,	0,	printargs,		"vserver"	}, /* 1269 */
 	{ 5,	TP,	sys_waitid,		"waitid"	}, /* 1270 */
-	{ 8,	0,	printargs,		"SYS_1271"	}, /* 1271 */
-	{ 8,	0,	printargs,		"SYS_1272"	}, /* 1272 */
-	{ 8,	0,	printargs,		"SYS_1273"	}, /* 1273 */
-	{ 8,	0,	printargs,		"SYS_1274"	}, /* 1274 */
-	{ 8,	0,	printargs,		"SYS_1275"	}, /* 1275 */
-	{ 8,	0,	printargs,		"SYS_1276"	}, /* 1276 */
-	{ 8,	0,	printargs,		"SYS_1277"	}, /* 1277 */
-	{ 8,	0,	printargs,		"SYS_1278"	}, /* 1278 */
-	{ 8,	0,	printargs,		"SYS_1279"	}, /* 1279 */
+	{ 5,	0,	printargs,		"add_key"	}, /* 1271 */
+	{ 4,	0,	printargs,		"request_key"	}, /* 1272 */
+	{ 5,	0,	printargs,		"keyctl"	}, /* 1273 */
+	{ 3,	0,	printargs,		"ioprio_set"	}, /* 1274 */
+	{ 2,	0,	printargs,		"ioprio_get"	}, /* 1275 */
+	{ 3,	0,	printargs,		"set_zone_reclaim" }, /* 1276 */
+	{ 0,	0,	printargs,		"inotify_init"	}, /* 1277 */
+	{ 3,	0,	sys_inotify_add_watch,	"inotify_add_watch" }, /* 1278 */
+	{ 2,	0,	sys_inotify_rm_watch, 	"inotify_rm_watch" }, /* 1279 */
 	{ 8,	0,	printargs,		"SYS_1280"	}, /* 1280 */
 	{ 8,	0,	printargs,		"SYS_1281"	}, /* 1281 */
 	{ 8,	0,	printargs,		"SYS_1282"	}, /* 1282 */
diff -rup strace.current/linux/powerpc/syscallent.h strace.+inotify/linux/powerpc/syscallent.h
--- strace.current/linux/powerpc/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace.+inotify/linux/powerpc/syscallent.h	2006-03-28 21:14:58.000000000 +0200
@@ -299,14 +299,14 @@
 	{ 3,	0,	sys_mq_getsetattr,	"mq_getsetattr"		}, /* 267 */
 	{ 5,	0,	printargs,		"sys_kexec_load"	}, /* 268 */
 	{ 5,	0,	printargs,		"add_key"		}, /* 269 */
-	{ 5,	0,	printargs,		"request_key"		}, /* 270 */
+	{ 4,	0,	printargs,		"request_key"		}, /* 270 */
 	{ 5,	0,	printargs,		"keyctl"		}, /* 271 */
 	{ 5,	TP,	sys_waitid,		"waitid"		}, /* 272 */
-	{ 5,	0,	printargs,		"SYS_273"		}, /* 273 */
-	{ 5,	0,	printargs,		"SYS_274"		}, /* 274 */
-	{ 5,	0,	printargs,		"SYS_275"		}, /* 275 */
-	{ 5,	0,	printargs,		"SYS_276"		}, /* 276 */
-	{ 5,	0,	printargs,		"SYS_277"		}, /* 277 */
+	{ 3,	0,	printargs,		"ioprio_set"		}, /* 273 */
+	{ 2,	0,	printargs,		"ioprio_get"		}, /* 274 */
+	{ 0,	0,	printargs,		"inotify_init"		}, /* 275 */
+	{ 3,	0,	sys_inotify_add_watch,	"inotify_add_watch"	}, /* 276 */
+	{ 2,	0,	sys_inotify_rm_watch,		"inotify_rm_watch"	}, /* 277 */
 	{ 5,	0,	printargs,		"SYS_278"		}, /* 278 */
 	{ 5,	0,	printargs,		"SYS_279"		}, /* 279 */
 	{ 5,	0,	printargs,		"SYS_280"		}, /* 280 */
diff -rup strace.current/linux/s390/syscallent.h strace.+inotify/linux/s390/syscallent.h
--- strace.current/linux/s390/syscallent.h	2005-12-02 05:19:13.000000000 +0100
+++ strace.+inotify/linux/s390/syscallent.h	2006-03-28 21:14:58.000000000 +0200
@@ -313,8 +313,8 @@
 	{ 3,	0,	printargs,		"ioprio_set"	}, /* 282 */
 	{ 2,	0,	printargs,		"ioprio_get"	}, /* 283 */
 	{ 0,	0,	printargs,		"inotify_init"	}, /* 284 */
-	{ 3,	0,	printargs,		"inotify_add_watch" }, /* 285 */
-	{ 2,	0,	printargs,		"inotify_rm_watch" }, /* 286 */
+	{ 3,	0,	sys_inotify_add_watch,	"inotify_add_watch" }, /* 285 */
+	{ 2,	0,	sys_inotify_rm_watch,	"inotify_rm_watch" }, /* 286 */
 
 	{ 5,	0,	printargs,		"SYS_287"	}, /* 287 */
 	{ 5,	0,	printargs,		"SYS_288"	}, /* 288 */
diff -rup strace.current/linux/s390x/syscallent.h strace.+inotify/linux/s390x/syscallent.h
--- strace.current/linux/s390x/syscallent.h	2005-12-02 05:19:13.000000000 +0100
+++ strace.+inotify/linux/s390x/syscallent.h	2006-03-28 21:14:58.000000000 +0200
@@ -312,8 +312,8 @@
 	{ 3,	0,	printargs,		"ioprio_set"	}, /* 282 */
 	{ 2,	0,	printargs,		"ioprio_get"	}, /* 283 */
 	{ 0,	0,	printargs,		"inotify_init"	}, /* 284 */
-	{ 3,	0,	printargs,		"inotify_add_watch" }, /* 285 */
-	{ 2,	0,	printargs,		"inotify_rm_watch" }, /* 286 */
+	{ 3,	0,	sys_inotify_add_watch,	"inotify_add_watch" }, /* 285 */
+	{ 2,	0,	sys_inotify_rm_watch,	"inotify_rm_watch" }, /* 286 */
 
 	{ 5,	0,	printargs,		"SYS_287"	}, /* 287 */
 	{ 5,	0,	printargs,		"SYS_288"	}, /* 288 */
diff -rup strace.current/linux/syscall.h strace.+inotify/linux/syscall.h
--- strace.current/linux/syscall.h	2006-03-27 18:57:22.000000000 +0200
+++ strace.+inotify/linux/syscall.h	2006-03-28 21:15:15.000000000 +0200
@@ -102,6 +102,7 @@ int sys_waitid(), sys_fadvise64(), sys_f
 int sys_mbind(), sys_get_mempolicy(), sys_set_mempolicy();
 int sys_arch_prctl();
 int sys_io_setup(), sys_io_submit(), sys_io_cancel(), sys_io_getevents(), sys_io_destroy();
+int sys_inotify_init(), sys_inotify_add_watch(), sys_inotify_rm_watch();
 
 /* sys_socketcall subcalls */
 
@@ -115,6 +116,12 @@ int sys_query_module();
 int sys_poll();
 int sys_mincore();
 
+/* the 13 openat syscalls */
+int sys_openat(), sys_mkdirat(), sys_mknodat(), sys_fchownat();
+int sys_futimesat(), sys_fstatat(), sys_unlinkat(), sys_renameat();
+int sys_linkat(), sys_symlinkat(), sys_readlinkat();
+int sys_fchmodat(), sys_faccessat();
+
 /* architecture-specific calls */
 #ifdef ALPHA
 int sys_osf_select();
@@ -183,7 +190,7 @@ int sys_osf_utimes();
 #  undef SYS_sendmsg
 #  undef SYS_recvmsg
 # endif /* IA64 */
-#  define SYS_socket_subcall	300
+#  define SYS_socket_subcall	320
 #define SYS_sub_socket		(SYS_socket_subcall + 1)
 #define SYS_sub_bind		(SYS_socket_subcall + 2)
 #define SYS_sub_connect		(SYS_socket_subcall + 3)
--- strace.current/linux/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace.+inotify/linux/syscallent.h	2006-03-28 21:14:48.000000000 +0200
@@ -316,22 +316,42 @@
 	{ 5,	0,	printargs,		"sys_kexec_load" }, /* 283 */
 	{ 5,	TP,	sys_waitid,		"waitid", SYS_waitid }, /* 284 */
 	{ 5,	0,	printargs,		"SYS_285"	}, /* 285 */
-	{ 5,	0,	printargs,		"SYS_286"	}, /* 286 */
-	{ 5,	0,	printargs,		"SYS_287"	}, /* 287 */
-	{ 5,	0,	printargs,		"SYS_288"	}, /* 288 */
-	{ 5,	0,	printargs,		"SYS_289"	}, /* 289 */
-	{ 5,	0,	printargs,		"SYS_290"	}, /* 290 */
-	{ 5,	0,	printargs,		"SYS_291"	}, /* 291 */
-	{ 5,	0,	printargs,		"SYS_292"	}, /* 292 */
-	{ 5,	0,	printargs,		"SYS_293"	}, /* 293 */
-	{ 5,	0,	printargs,		"SYS_294"	}, /* 294 */
-	{ 5,	0,	printargs,		"SYS_295"	}, /* 295 */
-	{ 5,	0,	printargs,		"SYS_296"	}, /* 296 */
-	{ 5,	0,	printargs,		"SYS_297"	}, /* 297 */
-	{ 5,	0,	printargs,		"SYS_298"	}, /* 298 */
-	{ 5,	0,	printargs,		"SYS_299"	}, /* 299 */
+	{ 5,	0,	printargs,		"add_key"	}, /* 286 */
+	{ 4,	0,	printargs,		"request_key"	}, /* 287 */
+	{ 5,	0,	printargs,		"keyctl"	}, /* 288 */
+	{ 3,	0,	printargs,		"ioprio_set"	}, /* 289 */
+	{ 2,	0,	printargs,		"ioprio_get"	}, /* 290 */
+	{ 0,	0,	printargs,		"inotify_init"	}, /* 291 */
+	{ 3,	0,	sys_inotify_add_watch,	"inotify_add_watch" }, /* 292 */
+	{ 2,	0,	sys_inotify_rm_watch,	"inotify_rm_watch" }, /* 293 */
+	{ 4,	0,	printargs,		"migrate_pages"	}, /* 294 */
+	{ 4,	TD|TF,	sys_openat,		"openat"	}, /* 295 */
+	{ 3,	TD|TF,	sys_mkdirat,		"mkdirat"	}, /* 296 */
+	{ 4,	TD|TF,	sys_mknodat,		"mknodat"	}, /* 297 */
+	{ 5,	TD|TF,	sys_fchownat,		"fchownat"	}, /* 298 */
+	{ 3,	TD|TF,	sys_futimesat,		"futimesat"	}, /* 299 */
+	{ 4,	TD|TF,	sys_fstatat,		"fstatat64"	}, /* 300 */
+	{ 3,	TD|TF,	sys_unlinkat,		"unlinkat"	}, /* 301 */
+	{ 4,	TD|TF,	sys_renameat,		"renameat"	}, /* 302 */
+	{ 5,	TD|TF,	sys_linkat,		"linkat"	}, /* 303 */
+	{ 3,	TD|TF,	sys_symlinkat,		"symlinkat"	}, /* 304 */
+	{ 4,	TD|TF,	sys_readlinkat,		"readlinkat"	}, /* 305 */
+	{ 3,	TD|TF,	sys_fchmodat,		"fchmodat"	}, /* 306 */
+	{ 3,	TD|TF,	sys_faccessat,		"faccessat"	}, /* 307 */
+	{ 6,	0,	printargs,		"pselect6"	}, /* 308 */
+	{ 5,	0,	printargs,		"ppoll"		}, /* 309 */
+	{ 1,	0,	printargs,		"unshare"	}, /* 310 */
+	{ 5,	0,	printargs,		"SYS_311"	}, /* 311 */
+	{ 5,	0,	printargs,		"SYS_312"	}, /* 312 */
+	{ 5,	0,	printargs,		"SYS_313"	}, /* 313 */
+	{ 5,	0,	printargs,		"SYS_314"	}, /* 314 */
+	{ 5,	0,	printargs,		"SYS_315"	}, /* 315 */
+	{ 5,	0,	printargs,		"SYS_316"	}, /* 316 */
+	{ 5,	0,	printargs,		"SYS_317"	}, /* 317 */
+	{ 5,	0,	printargs,		"SYS_318"	}, /* 318 */
+	{ 5,	0,	printargs,		"SYS_319"	}, /* 319 */
 
-#if SYS_socket_subcall != 300
+#if SYS_socket_subcall != 320
  #error fix me
 #endif
 	{ 8,	0,	printargs,		"socket_subcall"}, /* 300 */
@@ -353,7 +373,7 @@
 	{ 5,	TN,	sys_sendmsg,		"sendmsg"	}, /* 316 */
 	{ 5,	TN,	sys_recvmsg,		"recvmsg"	}, /* 317 */
 
-#if SYS_ipc_subcall != 318
+#if SYS_ipc_subcall != 338
  #error fix me
 #endif
 	{ 4,	0,	printargs,		"ipc_subcall"	}, /* 318 */
diff -rup strace.current/linux/x86_64/syscallent.h strace.+inotify/linux/x86_64/syscallent.h
--- strace.current/linux/x86_64/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace.+inotify/linux/x86_64/syscallent.h	2006-03-28 21:14:48.000000000 +0200
@@ -246,9 +246,25 @@
 	{ 3,	0,	sys_mq_getsetattr,	"mq_getsetattr"	}, /* 245 */
 	{ 5,	0,	printargs,		"kexec_load"	}, /* 246 */
 	{ 5,	TP,	sys_waitid,		"waitid"	}, /* 247 */
-	{ 5,	0,	printargs,		"SYS_248"	}, /* 248 */
-	{ 5,	0,	printargs,		"SYS_249"	}, /* 249 */
-	{ 5,	0,	printargs,		"SYS_250"	}, /* 250 */
-	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
-	{ 5,	0,	printargs,		"SYS_252"	}, /* 252 */
-	{ 5,	0,	printargs,		"SYS_253"	}, /* 253 */
+	{ 5,	0,	printargs,		"add_key"	}, /* 248 */
+	{ 4,	0,	printargs,		"request_key"	}, /* 249 */
+	{ 5,	0,	printargs,		"keyctl"	}, /* 250 */
+	{ 3,	0,	printargs,		"ioprio_set"	}, /* 251 */
+	{ 2,	0,	printargs,		"ioprio_get"	}, /* 252 */
+	{ 0,	0,	printargs,		"inotify_init"	}, /* 253 */
+	{ 3,	0,	sys_inotify_add_watch,	"inotify_add_watch" }, /* 254 */
+	{ 2,	0,	sys_inotify_rm_watch,	"inotify_rm_watch" }, /* 255 */
+	{ 4,	0,	printargs,		"migrate_pages"	}, /* 256 */
+	{ 4,	TD|TF,	sys_openat,		"openat"	}, /* 257 */
+	{ 3,	TD|TF,	sys_mkdirat,		"mkdirat"	}, /* 258 */
+	{ 4,	TD|TF,	sys_mknodat,		"mknodat"	}, /* 259 */
+	{ 5,	TD|TF,	sys_fchownat,		"fchownat"	}, /* 260 */
+	{ 3,	TD|TF,	sys_futimesat,		"futimesat"	}, /* 261 */
+	{ 4,	TD|TF,	sys_fstatat,		"fstatat"	}, /* 262 */
+	{ 3,	TD|TF,	sys_unlinkat,		"unlinkat"	}, /* 263 */
+	{ 4,	TD|TF,	sys_renameat,		"renameat"	}, /* 264 */
+	{ 5,	TD|TF,	sys_linkat,		"linkat"	}, /* 265 */
+	{ 3,	TD|TF,	sys_symlinkat,		"symlinkat"	}, /* 266 */
+	{ 4,	TD|TF,	sys_readlinkat,		"readlinkat"	}, /* 267 */
+	{ 3,	TD|TF,	sys_fchmodat,		"fchmodat"	}, /* 268 */
+	{ 3,	TD|TF,	sys_faccessat,		"faccessat"	}, /* 269 */
-------------- next part --------------
--- strace-4.5.14/syscallent.sh	2003-03-31 03:03:34.000000000 +0200
+++ strace-4.5.14-i386/syscallent.sh	2006-03-28 16:51:09.000000000 +0200
@@ -48,22 +48,31 @@ s/^#[ ]*define[ ][ ]*__NR_\([^ ]*\)[ ]*[
 			s = s "}, /* " call " */"
 			print s
 		}
+		if (call >= 294) {
 		f = "sys_" $1
 		n = $1
-		s = "\t{ -1,\t0,\t"
+			filter = "|sed \"s/\t\t/\t/g\"|cut -f4";
+			grep = "grep " f " /usr/src/linux-2.6.16-rc5/arch/mips/kernel/scall32-o32.S" filter;
+			grep | getline numargs_grepped;
+			numargs="A";
+			if (numargs_grepped > 0 && numargs_grepped < 7)
+				numargs=numargs_grepped;
+		s = "\t{ " numargs ",\t0,\t"
 		s = s f ","
 		s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
 		s = s "\"" n "\""
 		s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
 		s = s "}, /* " call " */"
 		print s
+		}
 	}
 	END {
-		limit = call + 100
+		limit = call + 10
 		while (++call < limit) {
 			f = "printargs"
 			n = "SYS_" call
-			s = "\t{ -1,\t0,\t"
+			numargs=5;
+			s = "\t{ " numargs ",\t0,\t"
 			s = s f ","
 			s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
 			s = s "\"" n "\""


More information about the Strace-devel mailing list