[PATCH] fix Linux delete_module output

Johannes Stezenbach js at linuxtv.org
Wed Jan 24 17:53:30 UTC 2007


Hi,

Linux delete_module() has two arguments: the module name and open(2)
style flags to implement rmmod --wait (O_NONBLOCK) and
--force (O_TRUNC). The patch below makes strace print
those flags. Tested on x86.


Johannes


diff -rNup strace-4.5.14.orig/linux/alpha/syscallent.h strace-4.5.14/linux/alpha/syscallent.h
--- strace-4.5.14.orig/linux/alpha/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace-4.5.14/linux/alpha/syscallent.h	2007-01-24 18:16:36.000000000 +0100
@@ -336,7 +336,7 @@
 	{ 3,	TD,	sys_getdents,		"getdents"		}, /* 305 */
 	{ 2,	0,	sys_create_module,	"create_module"		}, /* 306 */
 	{ 4,	0,	sys_init_module,	"init_module"		}, /* 307 */
-	{ 1,	0,	sys_delete_module,	"delete_module"		}, /* 308 */
+	{ 2,	0,	sys_delete_module,	"delete_module"		}, /* 308 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"	}, /* 309 */
 	{ 3,	0,	sys_syslog,		"syslog"		}, /* 310 */
 	{ 3,	0,	sys_reboot,		"reboot"		}, /* 311 */
diff -rNup strace-4.5.14.orig/linux/arm/syscallent.h strace-4.5.14/linux/arm/syscallent.h
--- strace-4.5.14.orig/linux/arm/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace-4.5.14/linux/arm/syscallent.h	2007-01-24 18:16:07.000000000 +0100
@@ -165,7 +165,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"	}, /* 126 */
 	{ 2,	0,	sys_create_module,	"create_module"	}, /* 127 */
 	{ 3,	0,	sys_init_module,	"init_module"	}, /* 128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"}, /* 130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	}, /* 131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"	}, /* 132 */
diff -rNup strace-4.5.14.orig/linux/dummy.h strace-4.5.14/linux/dummy.h
--- strace-4.5.14.orig/linux/dummy.h	2004-04-16 23:48:44.000000000 +0200
+++ strace-4.5.14/linux/dummy.h	2007-01-24 18:17:06.000000000 +0100
@@ -54,7 +54,7 @@
 #define	sys_umount		sys_chdir
 #define	sys_swapon		sys_chdir
 #define	sys_swapoff		sys_chdir
-#define	sys_delete_module	sys_chdir
+#define	sys_delete_module	sys_open
 #define	sys_fchdir		sys_close
 #define	sys_setfsuid		sys_setuid
 #define	sys_setfsgid		sys_setgid
diff -rNup strace-4.5.14.orig/linux/hppa/syscallent.h strace-4.5.14/linux/hppa/syscallent.h
--- strace-4.5.14.orig/linux/hppa/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace-4.5.14/linux/hppa/syscallent.h	2007-01-24 18:17:13.000000000 +0100
@@ -134,7 +134,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"		}, /* 126 */
 	{ 2,	0,	sys_create_module,	"create_module"		}, /* 127 */
 	{ 4,	0,	sys_init_module,	"init_module"		}, /* 128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"		}, /* 129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"		}, /* 129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"	}, /* 130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"		}, /* 131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"		}, /* 132 */
diff -rNup strace-4.5.14.orig/linux/ia64/syscallent.h strace-4.5.14/linux/ia64/syscallent.h
--- strace-4.5.14.orig/linux/ia64/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace-4.5.14/linux/ia64/syscallent.h	2007-01-24 18:18:22.000000000 +0100
@@ -1037,7 +1037,7 @@
 	{ 1,	0,	sys_adjtimex,		"adjtimex"	}, /* 1131 */
 	{ 2,	0,	sys_create_module,	"create_module"	}, /* 1132 */
 	{ 4,	0,	sys_init_module,	"init_module"	}, /* 1133 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	}, /* 1134 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	}, /* 1134 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"}, /* 1135 */
 	{ 5,	0,	sys_query_module,	"query_module"	}, /* 1136 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	}, /* 1137 */
diff -rNup strace-4.5.14.orig/linux/m68k/syscallent.h strace-4.5.14/linux/m68k/syscallent.h
--- strace-4.5.14.orig/linux/m68k/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace-4.5.14/linux/m68k/syscallent.h	2007-01-24 18:16:22.000000000 +0100
@@ -157,7 +157,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"	}, /* 126 */
 	{ 2,	0,	sys_create_module,	"create_module"	}, /* 127 */
 	{ 3,	0,	sys_init_module,	"init_module"	}, /* 128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"}, /* 130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	}, /* 131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"	}, /* 132 */
diff -rNup strace-4.5.14.orig/linux/mips/syscallent.h strace-4.5.14/linux/mips/syscallent.h
--- strace-4.5.14.orig/linux/mips/syscallent.h	2006-01-12 23:19:22.000000000 +0100
+++ strace-4.5.14/linux/mips/syscallent.h	2007-01-24 18:18:12.000000000 +0100
@@ -4127,7 +4127,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"	}, /* 4126 */
 	{ 2,	0,	sys_create_module,	"create_module"	}, /* 4127 */
 	{ 3,	0,	sys_init_module,	"init_module"	}, /* 4128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	}, /* 4129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	}, /* 4129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"}, /* 4130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	}, /* 4131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"	}, /* 4132 */
diff -rNup strace-4.5.14.orig/linux/powerpc/syscallent.h strace-4.5.14/linux/powerpc/syscallent.h
--- strace-4.5.14.orig/linux/powerpc/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace-4.5.14/linux/powerpc/syscallent.h	2007-01-24 18:17:20.000000000 +0100
@@ -157,7 +157,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"		}, /* 126 */
 	{ 2,	0,	sys_create_module,	"create_module"		}, /* 127 */
 	{ 3,	0,	sys_init_module,	"init_module"		}, /* 128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"		}, /* 129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"		}, /* 129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"	}, /* 130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"		}, /* 131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"		}, /* 132 */
diff -rNup strace-4.5.14.orig/linux/s390/syscallent.h strace-4.5.14/linux/s390/syscallent.h
--- strace-4.5.14.orig/linux/s390/syscallent.h	2005-12-02 05:18:16.000000000 +0100
+++ strace-4.5.14/linux/s390/syscallent.h	2007-01-24 18:16:29.000000000 +0100
@@ -157,7 +157,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"	}, /* 126 */
 	{ 2,	0,	sys_create_module,	"create_module"	}, /* 127 */
 	{ 3,	0,	sys_init_module,	"init_module"	}, /* 128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"}, /* 130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	}, /* 131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"	}, /* 132 */
diff -rNup strace-4.5.14.orig/linux/s390x/syscallent.h strace-4.5.14/linux/s390x/syscallent.h
--- strace-4.5.14.orig/linux/s390x/syscallent.h	2005-12-02 05:18:16.000000000 +0100
+++ strace-4.5.14/linux/s390x/syscallent.h	2007-01-24 18:17:56.000000000 +0100
@@ -156,7 +156,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"	}, /* 126 */
 	{ 2,	0,	sys_create_module,	"create_module"	}, /* 127 */
 	{ 3,	0,	sys_init_module,	"init_module"	}, /* 128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"}, /* 130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	}, /* 131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"	}, /* 132 */
diff -rNup strace-4.5.14.orig/linux/sh/syscallent.h strace-4.5.14/linux/sh/syscallent.h
--- strace-4.5.14.orig/linux/sh/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace-4.5.14/linux/sh/syscallent.h	2007-01-24 18:16:57.000000000 +0100
@@ -159,7 +159,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"	}, /* 126 */
 	{ 2,	0,	sys_create_module,	"create_module"	}, /* 127 */
 	{ 3,	0,	sys_init_module,	"init_module"	}, /* 128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"}, /* 130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	}, /* 131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"	}, /* 132 */
diff -rNup strace-4.5.14.orig/linux/sh64/syscallent.h strace-4.5.14/linux/sh64/syscallent.h
--- strace-4.5.14.orig/linux/sh64/syscallent.h	2005-08-03 13:27:34.000000000 +0200
+++ strace-4.5.14/linux/sh64/syscallent.h	2007-01-24 18:18:04.000000000 +0100
@@ -157,7 +157,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"	}, /* 126 */
 	{ 2,	0,	sys_create_module,	"create_module"	}, /* 127 */
 	{ 3,	0,	sys_init_module,	"init_module"	}, /* 128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"}, /* 130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	}, /* 131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"	}, /* 132 */
diff -rNup strace-4.5.14.orig/linux/sparc/syscallent.h strace-4.5.14/linux/sparc/syscallent.h
--- strace-4.5.14.orig/linux/sparc/syscallent.h	2006-01-12 23:19:49.000000000 +0100
+++ strace-4.5.14/linux/sparc/syscallent.h	2007-01-24 18:17:27.000000000 +0100
@@ -220,7 +220,7 @@
 	{ 1,	0,	sys_adjtimex,	"adjtimex" },		/* 219 */
 	{ 3,	TS,	sys_sigprocmask,"sigprocmask" },	/* 220 */
 	{ 2,	0,	sys_create_module,"create_module" },	/* 221 */
-	{ 1,	0,	sys_delete_module,"delete_module" },
+	{ 2,	0,	sys_delete_module,"delete_module" },
 	{ 1,	0,	sys_get_kernel_syms,"get_kernel_syms"},	/* 223 */
 	{ 1,	0,	sys_getpgid,	"getpgid" },		/* 224 */
 	{ 0,	0,	sys_bdflush,	"bdflush" },		/* 225 */
diff -rNup strace-4.5.14.orig/linux/sparc64/syscallent.h strace-4.5.14/linux/sparc64/syscallent.h
--- strace-4.5.14.orig/linux/sparc64/syscallent.h	2006-01-12 23:17:04.000000000 +0100
+++ strace-4.5.14/linux/sparc64/syscallent.h	2007-01-24 18:16:43.000000000 +0100
@@ -220,7 +220,7 @@
 	{ 1,	0,	sys_adjtimex,	"adjtimex" },		/* 219 */
 	{ 3,	TS,	sys_sigprocmask,"sigprocmask" },	/* 220 */
 	{ 2,	0,	sys_create_module,"create_module" },	/* 221 */
-	{ 1,	0,	sys_delete_module,"delete_module" },
+	{ 2,	0,	sys_delete_module,"delete_module" },
 	{ 1,	0,	sys_get_kernel_syms,"get_kernel_syms"},	/* 223 */
 	{ 1,	0,	sys_getpgid,	"getpgid" },		/* 224 */
 	{ 0,	0,	sys_bdflush,	"bdflush" },		/* 225 */
diff -rNup strace-4.5.14.orig/linux/sparc64/syscallent2.h strace-4.5.14/linux/sparc64/syscallent2.h
--- strace-4.5.14.orig/linux/sparc64/syscallent2.h	2005-08-03 13:26:08.000000000 +0200
+++ strace-4.5.14/linux/sparc64/syscallent2.h	2007-01-24 18:16:51.000000000 +0100
@@ -220,7 +220,7 @@
 	{ 1,	0,	sys_adjtimex,	"adjtimex" },		/* 219 */
 	{ 3,	TS,	sys_sigprocmask,"sigprocmask" },	/* 220 */
 	{ 2,	0,	sys_create_module,"create_module" },	/* 221 */
-	{ 1,	0,	sys_delete_module,"delete_module" },
+	{ 2,	0,	sys_delete_module,"delete_module" },
 	{ 1,	0,	sys_get_kernel_syms,"get_kernel_syms"},	/* 223 */
 	{ 1,	0,	sys_getpgid,	"getpgid" },		/* 224 */
 	{ 0,	0,	sys_bdflush,	"bdflush" },		/* 225 */
diff -rNup strace-4.5.14.orig/linux/syscallent.h strace-4.5.14/linux/syscallent.h
--- strace-4.5.14.orig/linux/syscallent.h	2006-01-12 23:34:50.000000000 +0100
+++ strace-4.5.14/linux/syscallent.h	2007-01-24 18:16:15.000000000 +0100
@@ -157,7 +157,7 @@
 	{ 3,	TS,	sys_sigprocmask,	"sigprocmask"	}, /* 126 */
 	{ 2,	0,	sys_create_module,	"create_module"	}, /* 127 */
 	{ 3,	0,	sys_init_module,	"init_module"	}, /* 128 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	}, /* 129 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"}, /* 130 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	}, /* 131 */
 	{ 1,	0,	sys_getpgid,		"getpgid"	}, /* 132 */
diff -rNup strace-4.5.14.orig/linux/x86_64/syscallent.h strace-4.5.14/linux/x86_64/syscallent.h
--- strace-4.5.14.orig/linux/x86_64/syscallent.h	2006-01-12 23:19:55.000000000 +0100
+++ strace-4.5.14/linux/x86_64/syscallent.h	2007-01-24 18:17:49.000000000 +0100
@@ -174,7 +174,7 @@
 	{ 3,	0,	sys_ioperm,		"ioperm"	},  /* 173 */
 	{ 2,	0,	sys_create_module,	"create_module"	},  /* 174 */
 	{ 3,	0,	sys_init_module,	"init_module"	},  /* 175 */
-	{ 1,	0,	sys_delete_module,	"delete_module"	},  /* 176 */
+	{ 2,	0,	sys_delete_module,	"delete_module"	},  /* 176 */
 	{ 1,	0,	sys_get_kernel_syms,	"get_kernel_syms"},  /* 177 */
 	{ 5,	0,	sys_query_module,	"query_module"	},  /* 178 */
 	{ 4,	0,	sys_quotactl,		"quotactl"	},  /* 179 */




More information about the Strace-devel mailing list