]> granicus.if.org Git - strace/commitdiff
Make sysent_shorthand_defs.h suitable for tests
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 7 Aug 2017 12:49:44 +0000 (12:49 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 7 Aug 2017 12:49:44 +0000 (12:49 +0000)
* sysent_shorthand_defs.h [STRACE_TESTS_H]: Add shorthand notations from
tests/ksysent.c and tests/nsyscalls.c.
* tests/ksysent.c: Remove shorthand notations.
* tests/nsyscalls.c: Likewise.

sysent_shorthand_defs.h
sysent_shorthand_undefs.h
tests/ksysent.c
tests/nsyscalls.c

index 52b591c3fa01824a3f66faf09b4bcfe47d027907..911fc33d609cdbda062076fbcd5fd9e80d46a479 100644 (file)
@@ -1,19 +1,47 @@
-#define TD TRACE_DESC
-#define TF TRACE_FILE
-#define TI TRACE_IPC
-#define TN TRACE_NETWORK
-#define TP TRACE_PROCESS
-#define TS TRACE_SIGNAL
-#define TM TRACE_MEMORY
-#define TST TRACE_STAT
-#define TLST TRACE_LSTAT
-#define TFST TRACE_FSTAT
-#define TSTA TRACE_STAT_LIKE
-#define TSF TRACE_STATFS
-#define TFSF TRACE_FSTATFS
-#define TSFA TRACE_STATFS_LIKE
-#define NF SYSCALL_NEVER_FAILS
-#define MA MAX_ARGS
-#define SI STACKTRACE_INVALIDATE_CACHE
-#define SE STACKTRACE_CAPTURE_ON_ENTER
-#define CST COMPAT_SYSCALL_TYPES
+#ifdef STRACE_TESTS_H
+
+# define TD    0
+# define TF    0
+# define TI    0
+# define TN    0
+# define TP    0
+# define TS    0
+# define TM    0
+# define TST   0
+# define TLST  0
+# define TFST  0
+# define TSTA  0
+# define TSF   0
+# define TFSF  0
+# define TSFA  0
+# define NF    0
+# define MA    0
+# define SI    0
+# define SE    0
+# define CST   0
+# define SEN(a)        0, 0
+
+#else  /*      !STRACE_TESTS_H */
+
+# define TD    TRACE_DESC
+# define TF    TRACE_FILE
+# define TI    TRACE_IPC
+# define TN    TRACE_NETWORK
+# define TP    TRACE_PROCESS
+# define TS    TRACE_SIGNAL
+# define TM    TRACE_MEMORY
+# define TST   TRACE_STAT
+# define TLST  TRACE_LSTAT
+# define TFST  TRACE_FSTAT
+# define TSTA  TRACE_STAT_LIKE
+# define TSF   TRACE_STATFS
+# define TFSF  TRACE_FSTATFS
+# define TSFA  TRACE_STATFS_LIKE
+# define NF    SYSCALL_NEVER_FAILS
+# define MA    MAX_ARGS
+# define SI    STACKTRACE_INVALIDATE_CACHE
+# define SE    STACKTRACE_CAPTURE_ON_ENTER
+# define CST   COMPAT_SYSCALL_TYPES
+/* SEN(a) is defined elsewhere */
+
+#endif
index d44dc88c4760d2e0dd7dda6f5357d25b6bddd413..5232b64863c5ffd7c33c83380f8e1c34ee48cf54 100644 (file)
@@ -1,4 +1,3 @@
-#undef SEN
 #undef TD
 #undef TF
 #undef TI
@@ -18,3 +17,4 @@
 #undef SI
 #undef SE
 #undef CST
+#undef SEN
index 860e21e41e194943d26466c356f4d9f5a3d0f6c9..7e25def45f83419516dac11bafa6b0f7a37ec5f1 100644 (file)
 #include <string.h>
 #include <asm/unistd.h>
 
-#define TD 0
-#define TF 0
-#define TI 0
-#define TN 0
-#define TP 0
-#define TS 0
-#define TM 0
-#define TST 0
-#define TLST 0
-#define TFST 0
-#define TSTA 0
-#define TSF 0
-#define TFSF 0
-#define TSFA 0
-#define NF 0
-#define MA 0
-#define SI 0
-#define SE 0
-#define CST 0
-#define SEN(arg) 0, 0
+#include "sysent_shorthand_defs.h"
 
 static const struct_sysent syscallent[] = {
 #include "syscallent.h"
 };
 
+#include "sysent_shorthand_undefs.h"
+
 typedef const char *pstr_t;
 static const pstr_t ksyslist[] = {
 #include "ksysent.h"
index d6b989c48b846411d8d04099fa4ff17037834de4..29f444a20e235b40f46c33b6989a69caea97303b 100644 (file)
 #include <unistd.h>
 #include <asm/unistd.h>
 
-#define TD 0
-#define TF 0
-#define TI 0
-#define TN 0
-#define TP 0
-#define TS 0
-#define TM 0
-#define TST 0
-#define TLST 0
-#define TFST 0
-#define TSTA 0
-#define TSF 0
-#define TFSF 0
-#define TSFA 0
-#define NF 0
-#define MA 0
-#define SI 0
-#define SE 0
-#define CST 0
-#define SEN(arg) 0, 0
+#include "sysent_shorthand_defs.h"
 
 static const struct_sysent syscallent[] = {
 #include "syscallent.h"
 };
 
+#include "sysent_shorthand_undefs.h"
+
 #if defined __X32_SYSCALL_BIT && defined __NR_read \
  && (__X32_SYSCALL_BIT & __NR_read) != 0
 # define SYSCALL_BIT __X32_SYSCALL_BIT