]> granicus.if.org Git - strace/blobdiff - defs.h
tests: check decoding of vcpu auxstr
[strace] / defs.h
diff --git a/defs.h b/defs.h
index 1fb8b17b1eba3b8c8e519382c60b36ed53dae232..0d4bf82b3c525514d1dcc25f6b77e16faa6fcdd0 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -182,12 +182,22 @@ typedef struct ioctlent {
 #define INJECT_F_RETVAL                0x04
 #define INJECT_F_DELAY_ENTER   0x08
 #define INJECT_F_DELAY_EXIT    0x10
+#define INJECT_F_SYSCALL       0x20
+
+#define INJECT_ACTION_FLAGS    \
+       (INJECT_F_SIGNAL        \
+       |INJECT_F_ERROR         \
+       |INJECT_F_RETVAL        \
+       |INJECT_F_DELAY_ENTER   \
+       |INJECT_F_DELAY_EXIT    \
+       )
 
 struct inject_data {
-       uint8_t flags;          /* 5 of 8 flags are used so far */
+       uint8_t flags;          /* 6 of 8 flags are used so far */
        uint8_t signo;          /* NSIG <= 128 */
        uint16_t rval_idx;      /* index in retval_vec */
        uint16_t delay_idx;     /* index in delay_data_vec */
+       uint16_t scno;          /* syscall to be injected instead of -1 */
 };
 
 struct inject_opts {
@@ -226,6 +236,10 @@ struct tcb {
 
        struct mmap_cache_t *mmap_cache;
 
+#ifdef HAVE_LINUX_KVM_H
+       struct vcpu_info *vcpu_info_list;
+#endif
+
 #ifdef ENABLE_STACKTRACE
        void *unwind_ctx;
        struct unwind_queue_t *unwind_queue;
@@ -261,6 +275,8 @@ struct tcb {
 #define TCB_INJECT_DELAY_EXIT  0x800   /* Current syscall needs to be delayed
                                           on exit */
 #define TCB_DELAYED    0x1000  /* Current syscall has been delayed */
+#define TCB_TAMPERED_NO_FAIL 0x2000    /* We tamper tcb with syscall
+                                          that should not fail. */
 
 /* qualifier flags */
 #define QUAL_TRACE     0x001   /* this system call should be traced */
@@ -285,11 +301,17 @@ struct tcb {
 #define recovering(tcp)        ((tcp)->flags & TCB_RECOVERING)
 #define inject_delay_exit(tcp) ((tcp)->flags & TCB_INJECT_DELAY_EXIT)
 #define syscall_delayed(tcp)   ((tcp)->flags & TCB_DELAYED)
+#define syscall_tampered_nofail(tcp) ((tcp)->flags & TCB_TAMPERED_NO_FAIL)
 
 #include "xlat.h"
 
 extern const struct xlat addrfams[];
+
+/** Protocol hardware identifiers array, sorted, defined in sockaddr.c. */
 extern const struct xlat arp_hardware_types[];
+/** Protocol hardware identifiers array size without terminating record. */
+extern const size_t arp_hardware_types_size;
+
 extern const struct xlat at_flags[];
 extern const struct xlat clocknames[];
 extern const struct xlat dirent_types[];
@@ -299,12 +321,16 @@ extern const struct xlat ethernet_protocols[];
 /** Ethernet protocols array size without terminating record. */
 extern const size_t ethernet_protocols_size;
 
+/** IP protocols list, sorted, defined in net.c. */
+extern const struct xlat inet_protocols[];
+/** IP protocols array size without terminating record. */
+extern const size_t inet_protocols_size;
+
 extern const struct xlat evdev_abs[];
 /** Number of elements in evdev_abs array without the terminating record. */
 extern const size_t evdev_abs_size;
 
 extern const struct xlat iffflags[];
-extern const struct xlat inet_protocols[];
 extern const struct xlat ip_type_of_services[];
 extern const struct xlat ipc_private[];
 extern const struct xlat msg_flags[];
@@ -636,46 +662,9 @@ printaddr(const kernel_ulong_t addr)
        printaddr64(addr);
 }
 
-#define XLAT_STYLE_VERBOSITY_MASK (XLAT_STYLE_RAW | XLAT_STYLE_ABBREV)
-#define XLAT_STYLE_FORMAT_SHIFT   2
-#define XLAT_STYLE_FORMAT_MASK    (3 << XLAT_STYLE_FORMAT_SHIFT)
-
-#define XLAT_STYLE_SPEC_BITS (XLAT_STYLE_FORMAT_SHIFT + 2)
-#define XLAT_STYLE_MASK ((1 << XLAT_STYLE_SPEC_BITS) - 1)
-
 #define xlat_verbose(style_) ((style_) & XLAT_STYLE_VERBOSITY_MASK)
 #define xlat_format(style_)  ((style_) & XLAT_STYLE_FORMAT_MASK)
 
-enum xlat_type {
-       XT_NORMAL,
-       XT_SORTED,
-       XT_INDEXED,
-};
-
-enum xlat_style {
-       /**
-        * Special value that is used for passing to *print{xval,flags}*_ex
-        * routines that indicates that no overriding of user-supplied xlat
-        * verbosity/formatting configuration is intended.
-        */
-       XLAT_STYLE_DEFAULT = 0,
-
-       /** Print xlat value as is without xlat processing */
-       XLAT_STYLE_RAW     = 1 << 0,
-       /**
-        * Historic strace style, process xlat and print the result (xlat
-        * constant name/combination of flags), raw number only if nothing is
-        * found.
-        */
-       XLAT_STYLE_ABBREV  = 1 << 1,
-       /** Always print both raw number and xlat processing result. */
-       XLAT_STYLE_VERBOSE = XLAT_STYLE_RAW | XLAT_STYLE_ABBREV,
-
-       XLAT_STYLE_FMT_X   = 0 << XLAT_STYLE_FORMAT_SHIFT,
-       XLAT_STYLE_FMT_U   = 1 << XLAT_STYLE_FORMAT_SHIFT,
-       XLAT_STYLE_FMT_D   = 2 << XLAT_STYLE_FORMAT_SHIFT,
-};
-
 extern enum xlat_style xlat_verbosity;
 
 extern int printxvals_ex(uint64_t val, const char *dflt,
@@ -1003,6 +992,11 @@ extern void unwind_tcb_print(struct tcb *);
 extern void unwind_tcb_capture(struct tcb *);
 #endif
 
+#ifdef HAVE_LINUX_KVM_H
+extern void kvm_run_structure_decoder_init(void);
+extern void kvm_vcpu_info_free(struct tcb *);
+#endif
+
 static inline int
 printstrn(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len)
 {
@@ -1385,6 +1379,8 @@ extern const struct_sysent sysent0[];
 extern const struct_ioctlent ioctlent0[];
 
 extern const char *const personality_names[];
+/* Personality designators to be used for specifying personality */
+extern const char *const personality_designators[];
 
 #if SUPPORTED_PERSONALITIES > 1
 extern const struct_sysent *sysent;