PATCH: strace-4.5.17 (madvise typo correction and printing)

Rajeev V. Pillai rajeevvp at gmail.com
Tue Aug 12 04:29:43 UTC 2008


Hi,

	Attach is a small fix for strace-4.5.17 to print the `advise' 
value to the madvise system call correctly. Two problems are fixed
by the patch.

1. Typos to MADV_RANDOM and MADV_DONTNEED are corrected.

2. Use printxval() instead of printflags() because according to both
   the Linux and the FreeBSD man pages the `advise' parameter is not
   a bit flag--it's a distinct advise. The same is true of the POSIX
   posix_madvise() function call.

Rajeev
-------------- next part --------------
diff -urN strace-4.5.17.orig/mem.c strace-4.5.17/mem.c
--- strace-4.5.17.orig/mem.c	2008-05-20 06:41:56.000000000 +0530
+++ strace-4.5.17/mem.c	2008-07-30 23:06:51.325115690 +0530
@@ -388,7 +388,7 @@
 #ifdef MADV_NORMAL
 	{ MADV_NORMAL,		"MADV_NORMAL" },
 #endif
-#ifdef MADZV_RANDOM
+#ifdef MADV_RANDOM
 	{ MADV_RANDOM,		"MADV_RANDOM" },
 #endif
 #ifdef MADV_SEQUENTIAL
@@ -397,7 +397,7 @@
 #ifdef MADV_WILLNEED
 	{ MADV_WILLNEED,	"MADV_WILLNEED" },
 #endif
-#ifdef MADV_DONTNED
+#ifdef MADV_DONTNEED
 	{ MADV_DONTNEED,	"MADV_DONTNEED" },
 #endif
 	{ 0,			NULL },
@@ -410,7 +410,7 @@
 {
 	if (entering(tcp)) {
 		tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
-		printflags(madvise_flags, tcp->u_arg[2], "MADV_???");
+		printxval(madvise_flags, tcp->u_arg[2], "MADV_???");
 	}
 	return 0;
 }


More information about the Strace-devel mailing list