* numa.c (print_status): Add xlat_style support for status argument.
* tests/move_pages-Xabbrev.c: New file.
* tests/move_pages-Xraw.c: Likewise.
* tests/move_pages-Xverbose.c: Likewise.
* tests/move_pages.c: Handle XLAT_RAW, XLAT_ABBREV, and XLAT_VERBOSE
macros.
* tests/gen_tests.in (move_pages-Xabbrev, move_pages-Xraw,
move_pages-Xverbose): New tests.
* tests/pure_executables.list: Add move_pages-Xabbrev, move_pages-Xraw,
and move_pages-Xverbose.
* tests/.gitignore: Likewise.
print_status(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
{
const int status = *(int *) elem_buf;
+ bool is_errno = (status < 0) && ((unsigned) -status < nerrnos);
- if (status < 0 && (unsigned) -status < nerrnos)
- tprintf("-%s", errnoent[-status]);
- else
+ if (!is_errno || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
tprintf("%d", status);
+ if (!is_errno || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return true;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ tprintf("-%s", errnoent[-status]);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+
return true;
}
mount-Xraw
mount-Xverbose
move_pages
+move_pages-Xabbrev
+move_pages-Xraw
+move_pages-Xverbose
mq
mq_sendrecv
mq_sendrecv-read
mount-Xraw -a33 -e trace=mount -Xraw
mount-Xverbose -a33 -e trace=mount -Xverbose
move_pages -s3
+move_pages-Xabbrev -s3 -e trace=move_pages -Xabbrev
+move_pages-Xraw -s3 -a36 -e trace=move_pages -Xraw
+move_pages-Xverbose -s3 -e trace=move_pages -Xverbose
mq -a32 -e trace=mq_getsetattr,mq_open,mq_unlink
mq_sendrecv -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink
mq_sendrecv-read -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink
--- /dev/null
+#include "move_pages.c"
--- /dev/null
+#define XLAT_RAW 1
+#include "move_pages.c"
--- /dev/null
+#define XLAT_VERBOSE 1
+#include "move_pages.c"
if (status[i] >= 0) {
printf("%d", status[i]);
} else {
+#if !XLAT_RAW
errno = -status[i];
+#endif
+#if XLAT_RAW
+ printf("%d", status[i]);
+#elif XLAT_VERBOSE
+ printf("%d /* -%s */", status[i], errno2name());
+#else
printf("-%s", errno2name());
+#endif
}
}
printf("]");
} else {
print_status_array(status, count);
}
+#if XLAT_RAW
+ printf(", 0x2) = %s\n", errstr);
+#elif XLAT_VERBOSE
+ printf(", 0x2 /* MPOL_MF_MOVE */) = %s\n", errstr);
+#else /* XLAT_ABBREV */
printf(", MPOL_MF_MOVE) = %s\n", errstr);
+#endif
}
static void
printf("%p", status);
else
printf("[]");
+#if XLAT_RAW
+ printf(", 0x4) = %s\n", errstr);
+#elif XLAT_VERBOSE
+ printf(", 0x4 /* MPOL_MF_MOVE_ALL */) = %s\n", errstr);
+#else /* XLAT_ABBREV */
printf(", MPOL_MF_MOVE_ALL) = %s\n", errstr);
+#endif
}
int
mount-Xraw
mount-Xverbose
move_pages
+move_pages-Xabbrev
+move_pages-Xraw
+move_pages-Xverbose
mq
mq_sendrecv
mq_sendrecv-read