/* Architecture-specific definitions. */
#ifndef STRACE_ARCH_DEFS_H
-#define STRACE_ARCH_DEFS_H
+# define STRACE_ARCH_DEFS_H
-#include "arch_defs_.h"
-#include "linux/arch_defs_.h"
+# include "arch_defs_.h"
+# include "linux/arch_defs_.h"
#endif /* !STRACE_ARCH_DEFS_H */
/* Provide fall-back definitions for BLK* ioctls */
#define XLAT_MACROS_ONLY
-# include "xlat/block_ioctl_cmds.h"
+#include "xlat/block_ioctl_cmds.h"
#undef XLAT_MACROS_ONLY
#include MPERS_DEFS
*/
#ifndef STRACE_BPF_ATTR_H
-#define STRACE_BPF_ATTR_H
+# define STRACE_BPF_ATTR_H
/*
* The policy is that all fields of type uint64_t in this header file
* v4.16-rc1~123^2~109^2~5^2~4.
*/
-#ifndef BPF_OBJ_NAME_LEN
-# define BPF_OBJ_NAME_LEN 16U
-#else
-# if BPF_OBJ_NAME_LEN != 16U
-# error "Unexpected value of BPF_OBJ_NAME_LEN"
+# ifndef BPF_OBJ_NAME_LEN
+# define BPF_OBJ_NAME_LEN 16U
+# else
+# if BPF_OBJ_NAME_LEN != 16U
+# error "Unexpected value of BPF_OBJ_NAME_LEN"
+# endif
# endif
-#endif
-#ifndef BPF_TAG_SIZE
-# define BPF_TAG_SIZE 8
-#else
-# if BPF_TAG_SIZE != 8
-# error "Unexpected value of BPF_TAG_SIZE"
+# ifndef BPF_TAG_SIZE
+# define BPF_TAG_SIZE 8
+# else
+# if BPF_TAG_SIZE != 8
+# error "Unexpected value of BPF_TAG_SIZE"
+# endif
# endif
-#endif
struct BPF_MAP_CREATE_struct {
uint32_t map_type;
uint32_t map_ifindex;
};
-#define BPF_MAP_CREATE_struct_size \
+# define BPF_MAP_CREATE_struct_size \
sizeof(struct BPF_MAP_CREATE_struct)
-#define expected_BPF_MAP_CREATE_struct_size 48
+# define expected_BPF_MAP_CREATE_struct_size 48
struct BPF_MAP_LOOKUP_ELEM_struct {
uint32_t map_fd;
uint64_t ATTRIBUTE_ALIGNED(8) value;
};
-#define BPF_MAP_LOOKUP_ELEM_struct_size \
+# define BPF_MAP_LOOKUP_ELEM_struct_size \
sizeof(struct BPF_MAP_LOOKUP_ELEM_struct)
-#define expected_BPF_MAP_LOOKUP_ELEM_struct_size 24
+# define expected_BPF_MAP_LOOKUP_ELEM_struct_size 24
struct BPF_MAP_UPDATE_ELEM_struct {
uint32_t map_fd;
uint64_t ATTRIBUTE_ALIGNED(8) flags;
};
-#define BPF_MAP_UPDATE_ELEM_struct_size \
+# define BPF_MAP_UPDATE_ELEM_struct_size \
sizeof(struct BPF_MAP_UPDATE_ELEM_struct)
-#define expected_BPF_MAP_UPDATE_ELEM_struct_size 32
+# define expected_BPF_MAP_UPDATE_ELEM_struct_size 32
struct BPF_MAP_DELETE_ELEM_struct {
uint32_t map_fd;
uint64_t ATTRIBUTE_ALIGNED(8) key;
};
-#define BPF_MAP_DELETE_ELEM_struct_size \
+# define BPF_MAP_DELETE_ELEM_struct_size \
sizeof(struct BPF_MAP_DELETE_ELEM_struct)
-#define expected_BPF_MAP_DELETE_ELEM_struct_size 16
+# define expected_BPF_MAP_DELETE_ELEM_struct_size 16
struct BPF_MAP_GET_NEXT_KEY_struct {
uint32_t map_fd;
uint64_t ATTRIBUTE_ALIGNED(8) next_key;
};
-#define BPF_MAP_GET_NEXT_KEY_struct_size \
+# define BPF_MAP_GET_NEXT_KEY_struct_size \
sizeof(struct BPF_MAP_GET_NEXT_KEY_struct)
-#define expected_BPF_MAP_GET_NEXT_KEY_struct_size 24
+# define expected_BPF_MAP_GET_NEXT_KEY_struct_size 24
struct BPF_PROG_LOAD_struct {
uint32_t prog_type;
uint32_t expected_attach_type;
};
-#define BPF_PROG_LOAD_struct_size \
+# define BPF_PROG_LOAD_struct_size \
offsetofend(struct BPF_PROG_LOAD_struct, expected_attach_type)
-#define expected_BPF_PROG_LOAD_struct_size 72
+# define expected_BPF_PROG_LOAD_struct_size 72
struct BPF_OBJ_PIN_struct {
uint64_t ATTRIBUTE_ALIGNED(8) pathname;
uint32_t file_flags;
};
-#define BPF_OBJ_PIN_struct_size \
+# define BPF_OBJ_PIN_struct_size \
sizeof(struct BPF_OBJ_PIN_struct)
-#define expected_BPF_OBJ_PIN_struct_size 16
+# define expected_BPF_OBJ_PIN_struct_size 16
-#define BPF_OBJ_GET_struct BPF_OBJ_PIN_struct
-#define BPF_OBJ_GET_struct_size BPF_OBJ_PIN_struct_size
+# define BPF_OBJ_GET_struct BPF_OBJ_PIN_struct
+# define BPF_OBJ_GET_struct_size BPF_OBJ_PIN_struct_size
struct BPF_PROG_ATTACH_struct {
uint32_t target_fd;
uint32_t attach_flags;
};
-#define BPF_PROG_ATTACH_struct_size \
+# define BPF_PROG_ATTACH_struct_size \
sizeof(struct BPF_PROG_ATTACH_struct)
-#define expected_BPF_PROG_ATTACH_struct_size 16
+# define expected_BPF_PROG_ATTACH_struct_size 16
struct BPF_PROG_DETACH_struct {
uint32_t target_fd;
uint32_t attach_type;
};
-#define BPF_PROG_DETACH_struct_size \
+# define BPF_PROG_DETACH_struct_size \
sizeof(struct BPF_PROG_DETACH_struct)
-#define expected_BPF_PROG_DETACH_struct_size 12
+# define expected_BPF_PROG_DETACH_struct_size 12
struct BPF_PROG_TEST_RUN_struct /* test */ {
uint32_t prog_fd;
uint32_t duration;
};
-#define BPF_PROG_TEST_RUN_struct_size \
+# define BPF_PROG_TEST_RUN_struct_size \
sizeof(struct BPF_PROG_TEST_RUN_struct)
-#define expected_BPF_PROG_TEST_RUN_struct_size 40
+# define expected_BPF_PROG_TEST_RUN_struct_size 40
struct BPF_PROG_GET_NEXT_ID_struct {
uint32_t start_id;
uint32_t open_flags;
};
-#define BPF_PROG_GET_NEXT_ID_struct_size \
+# define BPF_PROG_GET_NEXT_ID_struct_size \
sizeof(struct BPF_PROG_GET_NEXT_ID_struct)
-#define expected_BPF_PROG_GET_NEXT_ID_struct_size 12
+# define expected_BPF_PROG_GET_NEXT_ID_struct_size 12
-#define BPF_MAP_GET_NEXT_ID_struct BPF_PROG_GET_NEXT_ID_struct
-#define BPF_MAP_GET_NEXT_ID_struct_size BPF_PROG_GET_NEXT_ID_struct_size
+# define BPF_MAP_GET_NEXT_ID_struct BPF_PROG_GET_NEXT_ID_struct
+# define BPF_MAP_GET_NEXT_ID_struct_size BPF_PROG_GET_NEXT_ID_struct_size
struct BPF_PROG_GET_FD_BY_ID_struct {
uint32_t prog_id;
uint32_t open_flags;
};
-#define BPF_PROG_GET_FD_BY_ID_struct_size \
+# define BPF_PROG_GET_FD_BY_ID_struct_size \
sizeof(struct BPF_PROG_GET_FD_BY_ID_struct)
-#define expected_BPF_PROG_GET_FD_BY_ID_struct_size 12
+# define expected_BPF_PROG_GET_FD_BY_ID_struct_size 12
struct BPF_MAP_GET_FD_BY_ID_struct {
uint32_t map_id;
uint32_t open_flags;
};
-#define BPF_MAP_GET_FD_BY_ID_struct_size \
+# define BPF_MAP_GET_FD_BY_ID_struct_size \
sizeof(struct BPF_MAP_GET_FD_BY_ID_struct)
-#define expected_BPF_MAP_GET_FD_BY_ID_struct_size 12
+# define expected_BPF_MAP_GET_FD_BY_ID_struct_size 12
struct BPF_OBJ_GET_INFO_BY_FD_struct /* info */ {
uint32_t bpf_fd;
uint64_t ATTRIBUTE_ALIGNED(8) info;
};
-#define BPF_OBJ_GET_INFO_BY_FD_struct_size \
+# define BPF_OBJ_GET_INFO_BY_FD_struct_size \
sizeof(struct BPF_OBJ_GET_INFO_BY_FD_struct)
-#define expected_BPF_OBJ_GET_INFO_BY_FD_struct_size 16
+# define expected_BPF_OBJ_GET_INFO_BY_FD_struct_size 16
struct BPF_PROG_QUERY_struct /* query */ {
uint32_t target_fd;
uint32_t prog_cnt;
};
-#define BPF_PROG_QUERY_struct_size \
+# define BPF_PROG_QUERY_struct_size \
offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt)
-#define expected_BPF_PROG_QUERY_struct_size 28
+# define expected_BPF_PROG_QUERY_struct_size 28
struct BPF_RAW_TRACEPOINT_OPEN_struct /* raw_tracepoint */ {
uint64_t ATTRIBUTE_ALIGNED(8) name;
uint32_t prog_fd;
};
-#define BPF_RAW_TRACEPOINT_OPEN_struct_size \
+# define BPF_RAW_TRACEPOINT_OPEN_struct_size \
offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd)
-#define expected_BPF_RAW_TRACEPOINT_OPEN_struct_size 12
+# define expected_BPF_RAW_TRACEPOINT_OPEN_struct_size 12
struct bpf_map_info_struct {
uint32_t type;
uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
};
-#define bpf_map_info_struct_size \
+# define bpf_map_info_struct_size \
sizeof(struct bpf_map_info_struct)
-#define expected_bpf_map_info_struct_size 64
+# define expected_bpf_map_info_struct_size 64
struct bpf_prog_info_struct {
uint32_t type;
uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
};
-#define bpf_prog_info_struct_size \
+# define bpf_prog_info_struct_size \
sizeof(struct bpf_prog_info_struct)
-#define expected_bpf_prog_info_struct_size 104
+# define expected_bpf_prog_info_struct_size 104
#endif /* !STRACE_BPF_ATTR_H */
*/
#ifndef STRACE_BPF_FILTER_H
-#define STRACE_BPF_FILTER_H
+# define STRACE_BPF_FILTER_H
struct bpf_filter_block {
uint16_t code;
*/
#ifndef STRACE_BPF_FPROG_H
-#define STRACE_BPF_FPROG_H
+# define STRACE_BPF_FPROG_H
struct bpf_fprog {
unsigned short len;
#ifdef HAVE_LINUX_BTRFS_H
-#include DEF_MPERS_TYPE(struct_btrfs_ioctl_dev_replace_args)
-#include DEF_MPERS_TYPE(struct_btrfs_ioctl_send_args)
-#include DEF_MPERS_TYPE(struct_btrfs_ioctl_received_subvol_args)
-#include DEF_MPERS_TYPE(struct_btrfs_ioctl_vol_args_v2)
+# include DEF_MPERS_TYPE(struct_btrfs_ioctl_dev_replace_args)
+# include DEF_MPERS_TYPE(struct_btrfs_ioctl_send_args)
+# include DEF_MPERS_TYPE(struct_btrfs_ioctl_received_subvol_args)
+# include DEF_MPERS_TYPE(struct_btrfs_ioctl_vol_args_v2)
# include <linux/btrfs.h>
#ifdef HAVE_LINUX_BTRFS_H
-#include "print_fields.h"
-#include <linux/fs.h>
+# include "print_fields.h"
+# include <linux/fs.h>
/*
* Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in
*/
typedef __u64 u64;
-#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS
+# ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS
struct btrfs_ioctl_feature_flags {
uint64_t compat_flags;
uint64_t compat_ro_flags;
uint64_t incompat_flags;
};
-#endif
+# endif
-#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START
+# ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START
struct btrfs_ioctl_defrag_range_args {
uint64_t start;
uint64_t len;
uint32_t compress_type;
uint32_t unused[4];
};
-#endif
+# endif
-#ifndef BTRFS_LABEL_SIZE
-# define BTRFS_LABEL_SIZE 256
-#endif
+# ifndef BTRFS_LABEL_SIZE
+# define BTRFS_LABEL_SIZE 256
+# endif
-#ifndef BTRFS_IOC_QUOTA_RESCAN
+# ifndef BTRFS_IOC_QUOTA_RESCAN
struct btrfs_ioctl_quota_rescan_args {
uint64_t flags, progress, reserved[6];
};
-# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \
+# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \
struct btrfs_ioctl_quota_rescan_args)
-# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
+# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
struct btrfs_ioctl_quota_rescan_args)
-#endif
+# endif
-#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT
-# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
-#endif
+# ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT
+# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
+# endif
-#ifndef BTRFS_IOC_GET_FEATURES
-# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
+# ifndef BTRFS_IOC_GET_FEATURES
+# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
struct btrfs_ioctl_feature_flags)
-# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
+# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
struct btrfs_ioctl_feature_flags[2])
-# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
+# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
struct btrfs_ioctl_feature_flags[3])
-#endif
+# endif
-#ifndef BTRFS_IOC_TREE_SEARCH_V2
-# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
+# ifndef BTRFS_IOC_TREE_SEARCH_V2
+# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
struct btrfs_ioctl_search_args_v2)
struct btrfs_ioctl_search_args_v2 {
struct btrfs_ioctl_search_key key; /* in/out - search parameters */
* to store item */
uint64_t buf[0]; /* out - found items */
};
-#endif
-
-#include "xlat/btrfs_balance_args.h"
-#include "xlat/btrfs_balance_ctl_cmds.h"
-#include "xlat/btrfs_balance_flags.h"
-#include "xlat/btrfs_balance_state.h"
-#include "xlat/btrfs_compress_types.h"
-#include "xlat/btrfs_cont_reading_from_srcdev_mode.h"
-#include "xlat/btrfs_defrag_flags.h"
-#include "xlat/btrfs_dev_replace_cmds.h"
-#include "xlat/btrfs_dev_replace_results.h"
-#include "xlat/btrfs_dev_replace_state.h"
-#include "xlat/btrfs_dev_stats_flags.h"
-#include "xlat/btrfs_dev_stats_values.h"
-#include "xlat/btrfs_features_compat.h"
-#include "xlat/btrfs_features_compat_ro.h"
-#include "xlat/btrfs_features_incompat.h"
-#include "xlat/btrfs_key_types.h"
-#include "xlat/btrfs_logical_ino_args_flags.h"
-#include "xlat/btrfs_qgroup_ctl_cmds.h"
-#include "xlat/btrfs_qgroup_inherit_flags.h"
-#include "xlat/btrfs_qgroup_limit_flags.h"
-#include "xlat/btrfs_qgroup_status_flags.h"
-#include "xlat/btrfs_scrub_flags.h"
-#include "xlat/btrfs_send_flags.h"
-#include "xlat/btrfs_snap_flags_v2.h"
-#include "xlat/btrfs_space_info_flags.h"
-#include "xlat/btrfs_tree_objectids.h"
+# endif
+
+# include "xlat/btrfs_balance_args.h"
+# include "xlat/btrfs_balance_ctl_cmds.h"
+# include "xlat/btrfs_balance_flags.h"
+# include "xlat/btrfs_balance_state.h"
+# include "xlat/btrfs_compress_types.h"
+# include "xlat/btrfs_cont_reading_from_srcdev_mode.h"
+# include "xlat/btrfs_defrag_flags.h"
+# include "xlat/btrfs_dev_replace_cmds.h"
+# include "xlat/btrfs_dev_replace_results.h"
+# include "xlat/btrfs_dev_replace_state.h"
+# include "xlat/btrfs_dev_stats_flags.h"
+# include "xlat/btrfs_dev_stats_values.h"
+# include "xlat/btrfs_features_compat.h"
+# include "xlat/btrfs_features_compat_ro.h"
+# include "xlat/btrfs_features_incompat.h"
+# include "xlat/btrfs_key_types.h"
+# include "xlat/btrfs_logical_ino_args_flags.h"
+# include "xlat/btrfs_qgroup_ctl_cmds.h"
+# include "xlat/btrfs_qgroup_inherit_flags.h"
+# include "xlat/btrfs_qgroup_limit_flags.h"
+# include "xlat/btrfs_qgroup_status_flags.h"
+# include "xlat/btrfs_scrub_flags.h"
+# include "xlat/btrfs_send_flags.h"
+# include "xlat/btrfs_snap_flags_v2.h"
+# include "xlat/btrfs_space_info_flags.h"
+# include "xlat/btrfs_tree_objectids.h"
static inline char
prnibble(char v)
}
/* 8-4-4-4-12 = 36 characters */
-#define UUID_STRING_SIZE 36
+# define UUID_STRING_SIZE 36
/* Formats uuid, returns 0 if it's all zeroes */
static int
tprints("}");
}
-#define btrfs_print_key_type(prefix_, where_, field_) \
+# define btrfs_print_key_type(prefix_, where_, field_) \
PRINT_FIELD_XVAL_U((prefix_), (where_), field_, btrfs_key_types, NULL)
-#define btrfs_print_objectid(prefix_, where_, field_) \
+# define btrfs_print_objectid(prefix_, where_, field_) \
PRINT_FIELD_XVAL_U((prefix_), (where_), field_, btrfs_tree_objectids, \
NULL)
struct btrfs_ioctl_fs_info_args args;
char uuid[UUID_STRING_SIZE+1];
uint32_t nodesize, sectorsize, clone_alignment;
-#ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
+# ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
uint32_t *reserved32;
-#endif
+# endif
if (entering(tcp))
return 0;
if (umove_or_printaddr(tcp, arg, &args))
break;
-#ifdef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
+# ifdef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
nodesize = args.nodesize,
sectorsize = args.sectorsize,
clone_alignment = args.clone_alignment;
-#else
+# else
reserved32 = (void *) args.reserved;
nodesize = reserved32[0];
sectorsize = reserved32[1];
clone_alignment = reserved32[2];
-#endif
+# endif
btrfs_unparse_uuid(args.fsid, uuid);
PRINT_FIELD_U("{", args, max_id);
tprintf(", flags=");
printflags64(btrfs_logical_ino_args_flags,
-#ifdef HAVE_STRUCT_BTRFS_IOCTL_LOGICAL_INO_ARGS_FLAGS
+# ifdef HAVE_STRUCT_BTRFS_IOCTL_LOGICAL_INO_ARGS_FLAGS
args.flags
-#else
+# else
args.reserved[3]
-#endif
+# endif
, "BTRFS_LOGICAL_INO_ARGS_???");
PRINT_FIELD_ADDR64(", ", args, inodes);
tprints("}");
case BTRFS_IOC_CLONE: /* FICLONE */
case BTRFS_IOC_CLONE_RANGE: /* FICLONERANGE */
-#ifdef BTRFS_IOC_FILE_EXTENT_SAME
+# ifdef BTRFS_IOC_FILE_EXTENT_SAME
case BTRFS_IOC_FILE_EXTENT_SAME: /* FIDEDUPERANGE */
-#endif
+# endif
/*
* FICLONE, FICLONERANGE, and FIDEDUPERANGE started out as
* btrfs ioctls and the code was kept for the generic
# include "xlat/cacheflush_scope.h"
static const struct xlat cacheflush_flags[] = {
-#ifdef FLUSH_CACHE_BOTH
+# ifdef FLUSH_CACHE_BOTH
XLAT(FLUSH_CACHE_BOTH),
-#endif
-#ifdef FLUSH_CACHE_DATA
+# endif
+# ifdef FLUSH_CACHE_DATA
XLAT(FLUSH_CACHE_DATA),
-#endif
-#ifdef FLUSH_CACHE_INSN
+# endif
+# ifdef FLUSH_CACHE_INSN
XLAT(FLUSH_CACHE_INSN),
-#endif
+# endif
XLAT_END
};
#ifdef SH
static const struct xlat cacheflush_flags[] = {
-#ifdef CACHEFLUSH_D_INVAL
+# ifdef CACHEFLUSH_D_INVAL
XLAT(CACHEFLUSH_D_INVAL),
-#endif
-#ifdef CACHEFLUSH_D_WB
+# endif
+# ifdef CACHEFLUSH_D_WB
XLAT(CACHEFLUSH_D_WB),
-#endif
-#ifdef CACHEFLUSH_D_PURGE
+# endif
+# ifdef CACHEFLUSH_D_PURGE
XLAT(CACHEFLUSH_D_PURGE),
-#endif
-#ifdef CACHEFLUSH_I
+# endif
+# ifdef CACHEFLUSH_I
XLAT(CACHEFLUSH_I),
-#endif
+# endif
XLAT_END
};
*/
#ifndef STRACE_DEFS_H
-#define STRACE_DEFS_H
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <features.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
+# define STRACE_DEFS_H
+
+# ifdef HAVE_CONFIG_H
+# include "config.h"
+# endif
+
+# include <features.h>
+# include <stdbool.h>
+# include <stdint.h>
+# include <inttypes.h>
+# include <sys/types.h>
+# include <stddef.h>
+# include <unistd.h>
+# include <stdlib.h>
+# include <stdio.h>
/* Open-coding isprint(ch) et al proved more efficient than calling
* generalized libc interface. We don't *want* to do non-ASCII anyway.
*/
/* #include <ctype.h> */
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-#include <sys/time.h>
-
-#include "arch_defs.h"
-#include "error_prints.h"
-#include "gcc_compat.h"
-#include "kernel_types.h"
-#include "macros.h"
-#include "mpers_type.h"
-#include "string_to_uint.h"
-#include "sysent.h"
-#include "xmalloc.h"
-
-#ifndef HAVE_STRERROR
+# include <string.h>
+# include <errno.h>
+# include <time.h>
+# include <sys/time.h>
+
+# include "arch_defs.h"
+# include "error_prints.h"
+# include "gcc_compat.h"
+# include "kernel_types.h"
+# include "macros.h"
+# include "mpers_type.h"
+# include "string_to_uint.h"
+# include "sysent.h"
+# include "xmalloc.h"
+
+# ifndef HAVE_STRERROR
const char *strerror(int);
-#endif
-#ifndef HAVE_STPCPY
+# endif
+# ifndef HAVE_STPCPY
/* Some libc have stpcpy, some don't. Sigh...
* Roll our private implementation...
*/
-#undef stpcpy
-#define stpcpy strace_stpcpy
+# undef stpcpy
+# define stpcpy strace_stpcpy
extern char *stpcpy(char *dst, const char *src);
-#endif
+# endif
/* Glibc has an efficient macro for sigemptyset
* (it just does one or two assignments of 0 to internal vector of longs).
*/
-#if defined(__GLIBC__) && defined(__sigemptyset) && !defined(sigemptyset)
-# define sigemptyset __sigemptyset
-#endif
+# if defined(__GLIBC__) && defined(__sigemptyset) && !defined(sigemptyset)
+# define sigemptyset __sigemptyset
+# endif
/* Configuration section */
-#ifndef DEFAULT_STRLEN
+# ifndef DEFAULT_STRLEN
/* default maximum # of bytes printed in `printstr', change with -s switch */
-# define DEFAULT_STRLEN 32
-#endif
-#ifndef DEFAULT_ACOLUMN
-# define DEFAULT_ACOLUMN 40 /* default alignment column for results */
-#endif
+# define DEFAULT_STRLEN 32
+# endif
+# ifndef DEFAULT_ACOLUMN
+# define DEFAULT_ACOLUMN 40 /* default alignment column for results */
+# endif
/*
* Maximum number of args to a syscall.
*
* linux/<ARCH>/syscallent*.h:
* all have nargs <= 6 except mips o32 which has nargs <= 7.
*/
-#ifndef MAX_ARGS
-# ifdef LINUX_MIPSO32
-# define MAX_ARGS 7
-# else
-# define MAX_ARGS 6
+# ifndef MAX_ARGS
+# ifdef LINUX_MIPSO32
+# define MAX_ARGS 7
+# else
+# define MAX_ARGS 6
+# endif
# endif
-#endif
/* default sorting method for call profiling */
-#ifndef DEFAULT_SORTBY
-# define DEFAULT_SORTBY "time"
-#endif
+# ifndef DEFAULT_SORTBY
+# define DEFAULT_SORTBY "time"
+# endif
/* To force NOMMU build, set to 1 */
-#define NOMMU_SYSTEM 0
-
-#ifndef ERESTARTSYS
-# define ERESTARTSYS 512
-#endif
-#ifndef ERESTARTNOINTR
-# define ERESTARTNOINTR 513
-#endif
-#ifndef ERESTARTNOHAND
-# define ERESTARTNOHAND 514
-#endif
-#ifndef ERESTART_RESTARTBLOCK
-# define ERESTART_RESTARTBLOCK 516
-#endif
-
-#define PERSONALITY0_WORDSIZE SIZEOF_LONG
-#define PERSONALITY0_KLONGSIZE SIZEOF_KERNEL_LONG_T
-#define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
-#define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
-
-#if SUPPORTED_PERSONALITIES > 1
-# define PERSONALITY1_WORDSIZE 4
-# define PERSONALITY1_KLONGSIZE PERSONALITY1_WORDSIZE
-#endif
-
-#if SUPPORTED_PERSONALITIES > 2
-# define PERSONALITY2_WORDSIZE 4
-# define PERSONALITY2_KLONGSIZE PERSONALITY0_KLONGSIZE
-#endif
-
-#if SUPPORTED_PERSONALITIES > 1 && defined HAVE_M32_MPERS
-# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
-# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
-# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
-# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
-# define HAVE_PERSONALITY_1_MPERS 1
-#else
-# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
-# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
-# define PERSONALITY1_INCLUDE_FUNCS "empty.h"
-# define HAVE_PERSONALITY_1_MPERS 0
-#endif
-
-#if SUPPORTED_PERSONALITIES > 2 && defined HAVE_MX32_MPERS
-# define PERSONALITY2_INCLUDE_FUNCS "mx32_funcs.h"
-# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h"
-# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h"
-# define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h"
-# define HAVE_PERSONALITY_2_MPERS 1
-#else
-# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
-# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
-# define PERSONALITY2_INCLUDE_FUNCS "empty.h"
-# define HAVE_PERSONALITY_2_MPERS 0
-#endif
-
-#ifdef WORDS_BIGENDIAN
-# define is_bigendian true
-#else
-# define is_bigendian false
-#endif
+# define NOMMU_SYSTEM 0
+
+# ifndef ERESTARTSYS
+# define ERESTARTSYS 512
+# endif
+# ifndef ERESTARTNOINTR
+# define ERESTARTNOINTR 513
+# endif
+# ifndef ERESTARTNOHAND
+# define ERESTARTNOHAND 514
+# endif
+# ifndef ERESTART_RESTARTBLOCK
+# define ERESTART_RESTARTBLOCK 516
+# endif
+
+# define PERSONALITY0_WORDSIZE SIZEOF_LONG
+# define PERSONALITY0_KLONGSIZE SIZEOF_KERNEL_LONG_T
+# define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
+# define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
+
+# if SUPPORTED_PERSONALITIES > 1
+# define PERSONALITY1_WORDSIZE 4
+# define PERSONALITY1_KLONGSIZE PERSONALITY1_WORDSIZE
+# endif
+
+# if SUPPORTED_PERSONALITIES > 2
+# define PERSONALITY2_WORDSIZE 4
+# define PERSONALITY2_KLONGSIZE PERSONALITY0_KLONGSIZE
+# endif
+
+# if SUPPORTED_PERSONALITIES > 1 && defined HAVE_M32_MPERS
+# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
+# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
+# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
+# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
+# define HAVE_PERSONALITY_1_MPERS 1
+# else
+# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
+# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
+# define PERSONALITY1_INCLUDE_FUNCS "empty.h"
+# define HAVE_PERSONALITY_1_MPERS 0
+# endif
+
+# if SUPPORTED_PERSONALITIES > 2 && defined HAVE_MX32_MPERS
+# define PERSONALITY2_INCLUDE_FUNCS "mx32_funcs.h"
+# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h"
+# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h"
+# define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h"
+# define HAVE_PERSONALITY_2_MPERS 1
+# else
+# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
+# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
+# define PERSONALITY2_INCLUDE_FUNCS "empty.h"
+# define HAVE_PERSONALITY_2_MPERS 0
+# endif
+
+# ifdef WORDS_BIGENDIAN
+# define is_bigendian true
+# else
+# define is_bigendian false
+# endif
typedef struct ioctlent {
const char *symbol;
unsigned int code;
} struct_ioctlent;
-#define INJECT_F_SIGNAL 0x01
-#define INJECT_F_ERROR 0x02
-#define INJECT_F_RETVAL 0x04
-#define INJECT_F_DELAY_ENTER 0x08
-#define INJECT_F_DELAY_EXIT 0x10
-#define INJECT_F_SYSCALL 0x20
+# define INJECT_F_SIGNAL 0x01
+# define INJECT_F_ERROR 0x02
+# 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 \
+# define INJECT_ACTION_FLAGS \
(INJECT_F_SIGNAL \
|INJECT_F_ERROR \
|INJECT_F_RETVAL \
struct inject_data data;
};
-#define MAX_ERRNO_VALUE 4095
+# define MAX_ERRNO_VALUE 4095
/* Trace Control Block */
struct tcb {
kernel_ulong_t scno; /* System call number */
kernel_ulong_t u_arg[MAX_ARGS]; /* System call arguments */
kernel_long_t u_rval; /* Return value */
-#if SUPPORTED_PERSONALITIES > 1
+# if SUPPORTED_PERSONALITIES > 1
unsigned int currpers; /* Personality at the time of scno update */
-#endif
+# endif
int sys_func_rval; /* Syscall entry parser's return value */
int curcol; /* Output column for this process */
FILE *outf; /* Output file for this process */
struct mmap_cache_t *mmap_cache;
-#ifdef HAVE_LINUX_KVM_H
+# ifdef HAVE_LINUX_KVM_H
struct vcpu_info *vcpu_info_list;
-#endif
+# endif
-#ifdef ENABLE_STACKTRACE
+# ifdef ENABLE_STACKTRACE
void *unwind_ctx;
struct unwind_queue_t *unwind_queue;
-#endif
+# endif
};
/* TCB flags */
/* We have attached to this process, but did not see it stopping yet */
-#define TCB_STARTUP 0x01
-#define TCB_IGNORE_ONE_SIGSTOP 0x02 /* Next SIGSTOP is to be ignored */
+# define TCB_STARTUP 0x01
+# define TCB_IGNORE_ONE_SIGSTOP 0x02 /* Next SIGSTOP is to be ignored */
/*
* Are we in system call entry or in syscall exit?
*
* Use entering(tcp) / exiting(tcp) to check this bit to make code more
* readable.
*/
-#define TCB_INSYSCALL 0x04
-#define TCB_ATTACHED 0x08 /* We attached to it already */
-#define TCB_REPRINT 0x10 /* We should reprint this syscall on exit */
-#define TCB_FILTERED 0x20 /* This system call has been filtered out */
-#define TCB_TAMPERED 0x40 /* A syscall has been tampered with */
-#define TCB_HIDE_LOG 0x80 /* We should hide everything (until execve) */
-#define TCB_CHECK_EXEC_SYSCALL 0x100 /* Check whether this execve syscall succeeded */
-#define TCB_SKIP_DETACH_ON_FIRST_EXEC 0x200 /* -b execve should skip detach on first execve */
-#define TCB_GRABBED 0x400 /* We grab the process and can catch it
+# define TCB_INSYSCALL 0x04
+# define TCB_ATTACHED 0x08 /* We attached to it already */
+# define TCB_REPRINT 0x10 /* We should reprint this syscall on exit */
+# define TCB_FILTERED 0x20 /* This system call has been filtered out */
+# define TCB_TAMPERED 0x40 /* A syscall has been tampered with */
+# define TCB_HIDE_LOG 0x80 /* We should hide everything (until execve) */
+# define TCB_CHECK_EXEC_SYSCALL 0x100 /* Check whether this execve syscall succeeded */
+# define TCB_SKIP_DETACH_ON_FIRST_EXEC 0x200 /* -b execve should skip detach on first execve */
+# define TCB_GRABBED 0x400 /* We grab the process and can catch it
* in the middle of a syscall */
-#define TCB_RECOVERING 0x800 /* We try to recover after detecting incorrect
+# define TCB_RECOVERING 0x800 /* We try to recover after detecting incorrect
* syscall entering/exiting state */
-#define TCB_INJECT_DELAY_EXIT 0x1000 /* Current syscall needs to be delayed
+# define TCB_INJECT_DELAY_EXIT 0x1000 /* Current syscall needs to be delayed
on exit */
-#define TCB_DELAYED 0x2000 /* Current syscall has been delayed */
-#define TCB_TAMPERED_NO_FAIL 0x4000 /* We tamper tcb with syscall
+# define TCB_DELAYED 0x2000 /* Current syscall has been delayed */
+# define TCB_TAMPERED_NO_FAIL 0x4000 /* We tamper tcb with syscall
that should not fail. */
/* qualifier flags */
-#define QUAL_TRACE 0x001 /* this system call should be traced */
-#define QUAL_ABBREV 0x002 /* abbreviate the structures of this syscall */
-#define QUAL_VERBOSE 0x004 /* decode the structures of this syscall */
-#define QUAL_RAW 0x008 /* print all args in hex for this syscall */
-#define QUAL_INJECT 0x010 /* tamper with this system call on purpose */
-
-#define DEFAULT_QUAL_FLAGS (QUAL_TRACE | QUAL_ABBREV | QUAL_VERBOSE)
-
-#define entering(tcp) (!((tcp)->flags & TCB_INSYSCALL))
-#define exiting(tcp) ((tcp)->flags & TCB_INSYSCALL)
-#define syserror(tcp) ((tcp)->u_error != 0)
-#define traced(tcp) ((tcp)->qual_flg & QUAL_TRACE)
-#define verbose(tcp) ((tcp)->qual_flg & QUAL_VERBOSE)
-#define abbrev(tcp) ((tcp)->qual_flg & QUAL_ABBREV)
-#define raw(tcp) ((tcp)->qual_flg & QUAL_RAW)
-#define inject(tcp) ((tcp)->qual_flg & QUAL_INJECT)
-#define filtered(tcp) ((tcp)->flags & TCB_FILTERED)
-#define hide_log(tcp) ((tcp)->flags & TCB_HIDE_LOG)
-#define check_exec_syscall(tcp) ((tcp)->flags & TCB_CHECK_EXEC_SYSCALL)
-#define syscall_tampered(tcp) ((tcp)->flags & TCB_TAMPERED)
-#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"
+# define QUAL_TRACE 0x001 /* this system call should be traced */
+# define QUAL_ABBREV 0x002 /* abbreviate the structures of this syscall */
+# define QUAL_VERBOSE 0x004 /* decode the structures of this syscall */
+# define QUAL_RAW 0x008 /* print all args in hex for this syscall */
+# define QUAL_INJECT 0x010 /* tamper with this system call on purpose */
+
+# define DEFAULT_QUAL_FLAGS (QUAL_TRACE | QUAL_ABBREV | QUAL_VERBOSE)
+
+# define entering(tcp) (!((tcp)->flags & TCB_INSYSCALL))
+# define exiting(tcp) ((tcp)->flags & TCB_INSYSCALL)
+# define syserror(tcp) ((tcp)->u_error != 0)
+# define traced(tcp) ((tcp)->qual_flg & QUAL_TRACE)
+# define verbose(tcp) ((tcp)->qual_flg & QUAL_VERBOSE)
+# define abbrev(tcp) ((tcp)->qual_flg & QUAL_ABBREV)
+# define raw(tcp) ((tcp)->qual_flg & QUAL_RAW)
+# define inject(tcp) ((tcp)->qual_flg & QUAL_INJECT)
+# define filtered(tcp) ((tcp)->flags & TCB_FILTERED)
+# define hide_log(tcp) ((tcp)->flags & TCB_HIDE_LOG)
+# define check_exec_syscall(tcp) ((tcp)->flags & TCB_CHECK_EXEC_SYSCALL)
+# define syscall_tampered(tcp) ((tcp)->flags & TCB_TAMPERED)
+# 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[];
extern const struct xlat whence_codes[];
/* Format of syscall return values */
-#define RVAL_UDECIMAL 000 /* unsigned decimal format */
-#define RVAL_HEX 001 /* hex format */
-#define RVAL_OCTAL 002 /* octal format */
-#define RVAL_FD 010 /* file descriptor */
-#define RVAL_MASK 013 /* mask for these values */
+# define RVAL_UDECIMAL 000 /* unsigned decimal format */
+# define RVAL_HEX 001 /* hex format */
+# define RVAL_OCTAL 002 /* octal format */
+# define RVAL_FD 010 /* file descriptor */
+# define RVAL_MASK 013 /* mask for these values */
-#define RVAL_STR 020 /* Print `auxstr' field after return val */
-#define RVAL_NONE 040 /* Print nothing */
+# define RVAL_STR 020 /* Print `auxstr' field after return val */
+# define RVAL_NONE 040 /* Print nothing */
-#define RVAL_DECODED 0100 /* syscall decoding finished */
-#define RVAL_IOCTL_DECODED 0200 /* ioctl sub-parser successfully decoded
+# define RVAL_DECODED 0100 /* syscall decoding finished */
+# define RVAL_IOCTL_DECODED 0200 /* ioctl sub-parser successfully decoded
the argument */
-#define IOCTL_NUMBER_UNKNOWN 0
-#define IOCTL_NUMBER_HANDLED 1
-#define IOCTL_NUMBER_STOP_LOOKUP 010
+# define IOCTL_NUMBER_UNKNOWN 0
+# define IOCTL_NUMBER_HANDLED 1
+# define IOCTL_NUMBER_STOP_LOOKUP 010
-#define indirect_ipccall(tcp) (tcp->s_ent->sys_flags & TRACE_INDIRECT_SUBCALL)
+# define indirect_ipccall(tcp) (tcp->s_ent->sys_flags & TRACE_INDIRECT_SUBCALL)
enum sock_proto {
SOCK_PROTO_UNKNOWN,
size_t num_selected;
size_t size;
} global_path_set;
-#define tracing_paths (global_path_set.num_selected != 0)
+# define tracing_paths (global_path_set.num_selected != 0)
extern unsigned xflag;
extern unsigned followfork;
-#ifdef ENABLE_STACKTRACE
+# ifdef ENABLE_STACKTRACE
/* if this is true do the stack trace for every system call */
extern bool stack_trace_enabled;
-#endif
+# endif
extern unsigned ptrace_setoptions;
extern unsigned max_strlen;
extern unsigned os_release;
-#undef KERNEL_VERSION
-#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
+# undef KERNEL_VERSION
+# define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
extern int read_int_from_file(struct tcb *, const char *, int *);
*/
extern int
umoven(struct tcb *, kernel_ulong_t addr, unsigned int len, void *laddr);
-#define umove(pid, addr, objp) \
+# define umove(pid, addr, objp) \
umoven((pid), (addr), sizeof(*(objp)), (void *) (objp))
/**
{
return tfetch_mem64(tcp, addr, len, laddr);
}
-#define tfetch_obj(pid, addr, objp) \
+# define tfetch_obj(pid, addr, objp) \
tfetch_mem((pid), (addr), sizeof(*(objp)), (void *) (objp))
/**
extern int
umoven_or_printaddr64(struct tcb *, uint64_t addr,
unsigned int len, void *laddr);
-#define umove_or_printaddr64(pid, addr, objp) \
+# define umove_or_printaddr64(pid, addr, objp) \
umoven_or_printaddr64((pid), (addr), sizeof(*(objp)), (void *) (objp))
static inline int
{
return umoven_or_printaddr64(tcp, addr, len, laddr);
}
-#define umove_or_printaddr(pid, addr, objp) \
+# define umove_or_printaddr(pid, addr, objp) \
umoven_or_printaddr((pid), (addr), sizeof(*(objp)), (void *) (objp))
/**
extern int
umoven_or_printaddr64_ignore_syserror(struct tcb *, uint64_t addr,
unsigned int len, void *laddr);
-#define umove_or_printaddr64_ignore_syserror(pid, addr, objp) \
+# define umove_or_printaddr64_ignore_syserror(pid, addr, objp) \
umoven_or_printaddr64_ignore_syserror((pid), (addr), sizeof(*(objp)), \
(void *) (objp))
{
return umoven_or_printaddr64_ignore_syserror(tcp, addr, len, laddr);
}
-#define umove_or_printaddr_ignore_syserror(pid, addr, objp) \
+# define umove_or_printaddr_ignore_syserror(pid, addr, objp) \
umoven_or_printaddr_ignore_syserror((pid), (addr), sizeof(*(objp)), \
(void *) (objp))
extern int upeek(struct tcb *tcp, unsigned long, kernel_ulong_t *);
extern int upoke(struct tcb *tcp, unsigned long, kernel_ulong_t);
-#if HAVE_ARCH_GETRVAL2
+# if HAVE_ARCH_GETRVAL2
extern long getrval2(struct tcb *);
-#endif
+# endif
extern const char *signame(const int);
extern const char *sprintsigname(const int);
return strncmp(str, prefix, prefix_len) ? str : str + prefix_len;
}
-#define STR_STRIP_PREFIX(str, prefix) \
+# define STR_STRIP_PREFIX(str, prefix) \
str_strip_prefix_len((str), (prefix), sizeof(prefix) - 1)
-#define QUOTE_0_TERMINATED 0x01
-#define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02
-#define QUOTE_OMIT_TRAILING_0 0x08
-#define QUOTE_FORCE_HEX 0x10
-#define QUOTE_EMIT_COMMENT 0x20
+# define QUOTE_0_TERMINATED 0x01
+# define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02
+# define QUOTE_OMIT_TRAILING_0 0x08
+# define QUOTE_FORCE_HEX 0x10
+# define QUOTE_EMIT_COMMENT 0x20
extern int string_quote(const char *, char *, unsigned int, unsigned int,
const char *escape_chars);
/* a refers to the lower numbered u_arg,
* b refers to the higher numbered u_arg
*/
-#ifdef WORDS_BIGENDIAN
-# define ULONG_LONG(a, b) \
+# ifdef WORDS_BIGENDIAN
+# define ULONG_LONG(a, b) \
((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))
-#else
-# define ULONG_LONG(a, b) \
+# else
+# define ULONG_LONG(a, b) \
((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32))
-#endif
+# endif
extern int getllval(struct tcb *, unsigned long long *, int);
extern int printllval(struct tcb *, const char *, int)
ATTRIBUTE_FORMAT((printf, 2, 0));
printaddr64(addr);
}
-#define xlat_verbose(style_) ((style_) & XLAT_STYLE_VERBOSITY_MASK)
-#define xlat_format(style_) ((style_) & XLAT_STYLE_FORMAT_MASK)
+# define xlat_verbose(style_) ((style_) & XLAT_STYLE_VERBOSITY_MASK)
+# define xlat_format(style_) ((style_) & XLAT_STYLE_FORMAT_MASK)
extern enum xlat_style xlat_verbosity;
extern int printxvals_ex(uint64_t val, const char *dflt,
enum xlat_style, const struct xlat *, ...)
ATTRIBUTE_SENTINEL;
-#define printxvals(val_, dflt_, ...) \
+# define printxvals(val_, dflt_, ...) \
printxvals_ex((val_), (dflt_), XLAT_STYLE_DEFAULT, __VA_ARGS__)
extern int printxval_searchn_ex(const struct xlat *, size_t xlat_size,
* as the array size, as all arrays are XLAT_END-terminated and
* printxval_searchn expects a size without the terminating record.
*/
-#define printxval_search(xlat__, val__, dflt__) \
+# define printxval_search(xlat__, val__, dflt__) \
printxval_searchn(xlat__, ARRAY_SIZE(xlat__) - 1, val__, dflt__)
-#define printxval_search_ex(xlat__, val__, dflt__, style__) \
+# define printxval_search_ex(xlat__, val__, dflt__, style__) \
printxval_searchn_ex((xlat__), ARRAY_SIZE(xlat__) - 1, (val__), \
(dflt__), (style__))
XLAT_STYLE_DEFAULT);
}
-#define printxval_index(xlat__, val__, dflt__) \
+# define printxval_index(xlat__, val__, dflt__) \
printxval_indexn(xlat__, ARRAY_SIZE(xlat__) - 1, val__, dflt__)
-#define printxval_index_ex(xlat__, val__, dflt__) \
+# define printxval_index_ex(xlat__, val__, dflt__) \
printxval_indexn_ex((xlat__), ARRAY_SIZE(xlat__) - 1, (val__), \
(dflt__), XLAT_STYLE_DEFAULT)
PXF_DEFAULT_STR_BIT,
};
-#define FLAG_(name_) name_ = 1 << name_##_BIT
+# define FLAG_(name_) name_ = 1 << name_##_BIT
enum xlat_style_private_flags {
/* print_array */
FLAG_(PXF_DEFAULT_STR),
};
-#undef FLAG_
+# undef FLAG_
/** Print a value in accordance with xlat formatting settings. */
extern void print_xlat_ex(uint64_t val, const char *str, enum xlat_style style);
-#define print_xlat(val_) \
+# define print_xlat(val_) \
print_xlat_ex((val_), #val_, XLAT_STYLE_DEFAULT)
-#define print_xlat32(val_) \
+# define print_xlat32(val_) \
print_xlat_ex((uint32_t) (val_), #val_, XLAT_STYLE_DEFAULT)
-#define print_xlat_u(val_) \
+# define print_xlat_u(val_) \
print_xlat_ex((val_), #val_, XLAT_STYLE_FMT_U)
-#define print_xlat_d(val_) \
+# define print_xlat_d(val_) \
print_xlat_ex((val_), #val_, XLAT_STYLE_FMT_D)
extern int printargs(struct tcb *);
extern int
printpath(struct tcb *, kernel_ulong_t addr);
-#define TIMESPEC_TEXT_BUFSIZE \
+# define TIMESPEC_TEXT_BUFSIZE \
(sizeof(long long) * 3 * 2 + sizeof("{tv_sec=-, tv_nsec=}"))
extern void printfd(struct tcb *, int);
extern void print_sockaddr(const void *sa, int len);
print_sigset_addr(struct tcb *, kernel_ulong_t addr);
extern const char *sprintsigmask_n(const char *, const void *, unsigned int);
-#define tprintsigmask_addr(prefix, mask) \
+# define tprintsigmask_addr(prefix, mask) \
tprints(sprintsigmask_n((prefix), (mask), sizeof(mask)))
extern void printsignal(int);
extern void qualify(const char *);
extern unsigned int qual_flags(const unsigned int);
-#define DECL_IOCTL(name) \
+# define DECL_IOCTL(name) \
extern int \
name ## _ioctl(struct tcb *, unsigned int request, kernel_ulong_t arg) \
/* End of DECL_IOCTL definition. */
DECL_IOCTL(term);
DECL_IOCTL(ubi);
DECL_IOCTL(uffdio);
-#undef DECL_IOCTL
+# undef DECL_IOCTL
extern int decode_sg_io_v4(struct tcb *, const kernel_ulong_t arg);
extern void print_evdev_ff_type(const kernel_ulong_t val);
typedef bool (*netlink_decoder_t)(struct tcb *, const struct nlmsghdr *,
kernel_ulong_t addr, unsigned int len);
-#define DECL_NETLINK(name) \
+# define DECL_NETLINK(name) \
extern bool \
decode_netlink_ ## name(struct tcb *, const struct nlmsghdr *, \
kernel_ulong_t addr, unsigned int len) \
extern void ts_mul(struct timespec *, const struct timespec *, int);
extern void ts_div(struct timespec *, const struct timespec *, int);
-#ifdef ENABLE_STACKTRACE
+# ifdef ENABLE_STACKTRACE
extern void unwind_init(void);
extern void unwind_tcb_init(struct tcb *);
extern void unwind_tcb_fin(struct tcb *);
extern void unwind_tcb_print(struct tcb *);
extern void unwind_tcb_capture(struct tcb *);
-#endif
+# endif
-#ifdef HAVE_LINUX_KVM_H
+# ifdef HAVE_LINUX_KVM_H
extern void kvm_run_structure_decoder_init(void);
extern void kvm_vcpu_info_free(struct tcb *);
-#endif
+# endif
static inline int
printstrn(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len)
tprint_iov_upto(tcp, len, addr, decode_iov, -1);
}
-#ifdef ALPHA
+# ifdef ALPHA
typedef struct {
int tv_sec, tv_usec;
} timeval32_t;
extern void print_timeval32(struct tcb *, kernel_ulong_t addr);
extern void print_timeval32_utimes(struct tcb *, kernel_ulong_t addr);
extern void print_itimerval32(struct tcb *, kernel_ulong_t addr);
-#endif
+# endif
-#ifdef HAVE_STRUCT_USER_DESC
+# ifdef HAVE_STRUCT_USER_DESC
/**
* Filter what to print from the point of view of the get_thread_area syscall.
* Kernel copies only entry_number field at first and then tries to write the
extern void print_user_desc(struct tcb *, kernel_ulong_t addr,
enum user_desc_print_filter filter);
-#endif
+# endif
/* Strace log generation machinery.
*
tprints(sprint_mac_addr(addr, size));
}
-#if SUPPORTED_PERSONALITIES > 1
+# if SUPPORTED_PERSONALITIES > 1
extern void set_personality(unsigned int personality);
extern unsigned current_personality;
-#else
-# define set_personality(personality) ((void)0)
-# define current_personality 0
-#endif
-
-#if SUPPORTED_PERSONALITIES == 1
-# define current_wordsize PERSONALITY0_WORDSIZE
-# define current_klongsize PERSONALITY0_KLONGSIZE
-#else
-# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_WORDSIZE == PERSONALITY1_WORDSIZE
-# define current_wordsize PERSONALITY0_WORDSIZE
# else
-extern unsigned current_wordsize;
+# define set_personality(personality) ((void)0)
+# define current_personality 0
# endif
-# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE == PERSONALITY1_KLONGSIZE
+
+# if SUPPORTED_PERSONALITIES == 1
+# define current_wordsize PERSONALITY0_WORDSIZE
# define current_klongsize PERSONALITY0_KLONGSIZE
# else
+# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_WORDSIZE == PERSONALITY1_WORDSIZE
+# define current_wordsize PERSONALITY0_WORDSIZE
+# else
+extern unsigned current_wordsize;
+# endif
+# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE == PERSONALITY1_KLONGSIZE
+# define current_klongsize PERSONALITY0_KLONGSIZE
+# else
extern unsigned current_klongsize;
+# endif
# endif
-#endif
-#define max_addr() (~0ULL >> ((8 - current_wordsize) * 8))
-#define max_kaddr() (~0ULL >> ((8 - current_klongsize) * 8))
+# define max_addr() (~0ULL >> ((8 - current_wordsize) * 8))
+# define max_kaddr() (~0ULL >> ((8 - current_klongsize) * 8))
/*
* When u64 is interpreted by the kernel as an address, there is a difference
* to a valid address). Since 32-bit strace cannot figure out what kind of
* kernel the tracee is running on, it has to account for both possibilities.
*/
-#if CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL
+# if CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL
/**
* Print raw 64-bit value as an address if it's too big to fit in strace's
tprints(" or ");
}
}
-#else /* !CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL */
-# define print_big_u64_addr(addr_) ((void) 0)
-#endif /* CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL */
+# else /* !CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL */
+# define print_big_u64_addr(addr_) ((void) 0)
+# endif /* CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL */
-#if SIZEOF_KERNEL_LONG_T > 4 \
+# if SIZEOF_KERNEL_LONG_T > 4 \
&& (SIZEOF_LONG < SIZEOF_KERNEL_LONG_T || !defined(current_wordsize))
-# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG 1
-#else
-# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG 0
-#endif
+# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG 1
+# else
+# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG 0
+# endif
-#define DECL_PRINTNUM(name) \
+# define DECL_PRINTNUM(name) \
extern bool \
printnum_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
ATTRIBUTE_FORMAT((printf, 3, 0)) \
DECL_PRINTNUM(short);
DECL_PRINTNUM(int);
DECL_PRINTNUM(int64);
-#undef DECL_PRINTNUM
+# undef DECL_PRINTNUM
-#define DECL_PRINTNUM_ADDR(name) \
+# define DECL_PRINTNUM_ADDR(name) \
extern bool \
printnum_addr_ ## name(struct tcb *, kernel_ulong_t addr) \
/* End of DECL_PRINTNUM_ADDR definition. */
DECL_PRINTNUM_ADDR(int);
DECL_PRINTNUM_ADDR(int64);
-#undef DECL_PRINTNUM_ADDR
+# undef DECL_PRINTNUM_ADDR
-#ifndef current_wordsize
+# ifndef current_wordsize
extern bool
printnum_long_int(struct tcb *, kernel_ulong_t addr,
const char *fmt_long, const char *fmt_int)
return printnum_addr_long_int(tcp, addr);
}
-#elif current_wordsize > 4
+# elif current_wordsize > 4
static inline bool
printnum_slong(struct tcb *tcp, kernel_ulong_t addr)
return printnum_addr_int64(tcp, addr);
}
-#else /* current_wordsize == 4 */
+# else /* current_wordsize == 4 */
static inline bool
printnum_slong(struct tcb *tcp, kernel_ulong_t addr)
return printnum_addr_int(tcp, addr);
}
-#endif
+# endif
-#ifndef current_klongsize
+# ifndef current_klongsize
extern bool printnum_addr_klong_int(struct tcb *, kernel_ulong_t addr);
static inline bool
return printnum_addr_klong_int(tcp, addr);
}
-#elif current_klongsize > 4
+# elif current_klongsize > 4
static inline bool
printnum_kptr(struct tcb *tcp, kernel_ulong_t addr)
return printnum_addr_int64(tcp, addr);
}
-#else /* current_klongsize == 4 */
+# else /* current_klongsize == 4 */
static inline bool
printnum_kptr(struct tcb *tcp, kernel_ulong_t addr)
return printnum_addr_int(tcp, addr);
}
-#endif
+# endif
-#define DECL_PRINTPAIR(name) \
+# define DECL_PRINTPAIR(name) \
extern bool \
printpair_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
ATTRIBUTE_FORMAT((printf, 3, 0)) \
DECL_PRINTPAIR(int);
DECL_PRINTPAIR(int64);
-#undef DECL_PRINTPAIR
+# undef DECL_PRINTPAIR
static inline kernel_long_t
truncate_klong_to_current_wordsize(const kernel_long_t v)
{
-#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
if (current_wordsize < sizeof(v)) {
return (int) v;
} else
-#endif
+# endif
{
return v;
}
static inline kernel_ulong_t
truncate_kulong_to_current_wordsize(const kernel_ulong_t v)
{
-#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
if (current_wordsize < sizeof(v)) {
return (unsigned int) v;
} else
-#endif
+# endif
{
return v;
}
/*
* Cast a pointer or a pointer-sized integer to kernel_ulong_t.
*/
-#define ptr_to_kulong(v) ((kernel_ulong_t) (unsigned long) (v))
+# define ptr_to_kulong(v) ((kernel_ulong_t) (unsigned long) (v))
/*
* Zero-extend a signed integer type to unsigned long long.
*/
-#define zero_extend_signed_to_ull(v) \
+# define zero_extend_signed_to_ull(v) \
(sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \
sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \
sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \
/*
* Sign-extend an unsigned integer type to long long.
*/
-#define sign_extend_unsigned_to_ll(v) \
+# define sign_extend_unsigned_to_ll(v) \
(sizeof(v) == sizeof(char) ? (long long) (char) (v) : \
sizeof(v) == sizeof(short) ? (long long) (short) (v) : \
sizeof(v) == sizeof(int) ? (long long) (int) (v) : \
/* Personality designators to be used for specifying personality */
extern const char *const personality_designators[];
-#if SUPPORTED_PERSONALITIES > 1
+# if SUPPORTED_PERSONALITIES > 1
extern const struct_sysent *sysent;
extern const struct_ioctlent *ioctlent;
-#else
-# define sysent sysent0
-# define ioctlent ioctlent0
-#endif
+# else
+# define sysent sysent0
+# define ioctlent ioctlent0
+# endif
extern unsigned nsyscalls;
extern unsigned nioctlents;
extern const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES];
extern struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES];
-#ifdef IN_MPERS_BOOTSTRAP
+# ifdef IN_MPERS_BOOTSTRAP
/* Transform multi-line MPERS_PRINTER_DECL statements to one-liners. */
-# define MPERS_PRINTER_DECL(type, name, ...) MPERS_PRINTER_DECL(type, name, __VA_ARGS__)
-#else /* !IN_MPERS_BOOTSTRAP */
-# if SUPPORTED_PERSONALITIES > 1
-# include "printers.h"
-# else
-# include "native_printer_decls.h"
-# endif
-# define MPERS_PRINTER_DECL(type, name, ...) type MPERS_FUNC_NAME(name)(__VA_ARGS__)
-#endif /* !IN_MPERS_BOOTSTRAP */
+# define MPERS_PRINTER_DECL(type, name, ...) MPERS_PRINTER_DECL(type, name, __VA_ARGS__)
+# else /* !IN_MPERS_BOOTSTRAP */
+# if SUPPORTED_PERSONALITIES > 1
+# include "printers.h"
+# else
+# include "native_printer_decls.h"
+# endif
+# define MPERS_PRINTER_DECL(type, name, ...) type MPERS_FUNC_NAME(name)(__VA_ARGS__)
+# endif /* !IN_MPERS_BOOTSTRAP */
/* Checks that sysent[scno] is not out of range. */
static inline bool
&& !(sysent[scno].sys_flags & TRACE_INDIRECT_SUBCALL);
}
-#define MPERS_FUNC_NAME__(prefix, name) prefix ## name
-#define MPERS_FUNC_NAME_(prefix, name) MPERS_FUNC_NAME__(prefix, name)
-#define MPERS_FUNC_NAME(name) MPERS_FUNC_NAME_(MPERS_PREFIX, name)
+# define MPERS_FUNC_NAME__(prefix, name) prefix ## name
+# define MPERS_FUNC_NAME_(prefix, name) MPERS_FUNC_NAME__(prefix, name)
+# define MPERS_FUNC_NAME(name) MPERS_FUNC_NAME_(MPERS_PREFIX, name)
-#define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(syscall_name)
+# define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(syscall_name)
-#define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(sys_ ## syscall_name)(struct tcb *tcp)
+# define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(sys_ ## syscall_name)(struct tcb *tcp)
#endif /* !STRACE_DEFS_H */
*/
#ifndef STRACE_DELAY_H
-#define STRACE_DELAY_H
+# define STRACE_DELAY_H
uint16_t alloc_delay_data(void);
void fill_delay_data(uint16_t delay_idx, int intval, bool isenter);
}
}
-#include "xlat/dm_flags.h"
+# include "xlat/dm_flags.h"
static void
dm_decode_flags(const struct dm_ioctl *ioc)
*/
#ifndef STRACE_ERROR_PRINTS_H
-#define STRACE_ERROR_PRINTS_H
+# define STRACE_ERROR_PRINTS_H
-#include <stdbool.h>
+# include <stdbool.h>
-#include "gcc_compat.h"
+# include "gcc_compat.h"
extern bool debug_flag;
ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
/* Wrappers for if (debug_flag) error_msg(...) */
-#define debug_msg(...) \
+# define debug_msg(...) \
do { \
if (debug_flag) \
error_msg(__VA_ARGS__); \
} while (0)
-#define debug_perror_msg(...) \
+# define debug_perror_msg(...) \
do { \
if (debug_flag) \
perror_msg(__VA_ARGS__); \
} while (0)
/* Simple wrappers for providing function name in error messages */
-#define error_func_msg(fmt_, ...) \
+# define error_func_msg(fmt_, ...) \
error_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
-#define perror_func_msg(fmt_, ...) \
+# define perror_func_msg(fmt_, ...) \
perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
-#define debug_func_msg(fmt_, ...) \
+# define debug_func_msg(fmt_, ...) \
debug_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
-#define debug_func_perror_msg(fmt_, ...) \
+# define debug_func_perror_msg(fmt_, ...) \
debug_perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
-#define error_func_msg_and_die(fmt_, ...) \
+# define error_func_msg_and_die(fmt_, ...) \
error_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
-#define perror_func_msg_and_die(fmt_, ...) \
+# define perror_func_msg_and_die(fmt_, ...) \
perror_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
#endif /* !STRACE_ERROR_PRINTS_H */
return RVAL_IOCTL_DECODED;
}
-#define decode_bitset(tcp_, arg_, decode_nr_, max_nr_, dflt_, xt_) \
+# define decode_bitset(tcp_, arg_, decode_nr_, max_nr_, dflt_, xt_) \
decode_bitset_((tcp_), (arg_), (decode_nr_), (max_nr_), \
(dflt_), ARRAY_SIZE(decode_nr_) - 1, (xt_))
#ifdef HAVE_LINUX_INPUT_H
-#include DEF_MPERS_TYPE(struct_ff_effect)
+# include DEF_MPERS_TYPE(struct_ff_effect)
# include <linux/ioctl.h>
# include <linux/input.h>
*/
#ifndef STRACE_F_OWNER_EX_H
-#define STRACE_F_OWNER_EX_H
+# define STRACE_F_OWNER_EX_H
-#include <linux/fcntl.h>
+# include <linux/fcntl.h>
-#if defined HAVE_STRUCT_F_OWNER_EX
+# if defined HAVE_STRUCT_F_OWNER_EX
typedef struct f_owner_ex struct_kernel_f_owner_ex;
-#elif defined HAVE_STRUCT___KERNEL_F_OWNER_EX
+# elif defined HAVE_STRUCT___KERNEL_F_OWNER_EX
typedef struct __kernel_f_owner_ex struct_kernel_f_owner_ex;
-#else
-# error struct f_owner_ex definition not found in <linux/fcntl.h>
-#endif
+# else
+# error struct f_owner_ex definition not found in <linux/fcntl.h>
+# endif
#endif /* !STRACE_F_OWNER_EX_H */
*/
#ifndef STRACE_FILTER_H
-#define STRACE_FILTER_H
+# define STRACE_FILTER_H
struct number_set;
typedef int (*string_to_uint_func)(const char *);
*/
#ifndef STRACE_FLOCK_H
-#define STRACE_FLOCK_H
+# define STRACE_FLOCK_H
-#include <linux/fcntl.h>
+# include <linux/fcntl.h>
-#if defined HAVE_STRUCT_FLOCK
+# if defined HAVE_STRUCT_FLOCK
typedef struct flock struct_kernel_flock;
-#elif defined HAVE_STRUCT___KERNEL_FLOCK
+# elif defined HAVE_STRUCT___KERNEL_FLOCK
typedef struct __kernel_flock struct_kernel_flock;
-#else
-# error struct flock definition not found in <linux/fcntl.h>
-#endif
+# else
+# error struct flock definition not found in <linux/fcntl.h>
+# endif
-#if defined HAVE_STRUCT_FLOCK64
+# if defined HAVE_STRUCT_FLOCK64
typedef struct flock64 struct_kernel_flock64;
-#elif defined HAVE_STRUCT___KERNEL_FLOCK64
+# elif defined HAVE_STRUCT___KERNEL_FLOCK64
typedef struct __kernel_flock64 struct_kernel_flock64;
-#else
-# error struct flock64 definition not found in <linux/fcntl.h>
-#endif
+# else
+# error struct flock64 definition not found in <linux/fcntl.h>
+# endif
#endif /* !STRACE_FLOCK_H */
*/
#ifndef STRACE_GCC_COMPAT_H
-#define STRACE_GCC_COMPAT_H
+# define STRACE_GCC_COMPAT_H
-#if defined __GNUC__ && defined __GNUC_MINOR__
-# define GNUC_PREREQ(maj, min) \
+# if defined __GNUC__ && defined __GNUC_MINOR__
+# define GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-#else
-# define GNUC_PREREQ(maj, min) 0
-#endif
+# else
+# define GNUC_PREREQ(maj, min) 0
+# endif
-#if defined __clang__ && defined __clang_major__ && defined __clang_minor__
-# define CLANG_PREREQ(maj, min) \
+# if defined __clang__ && defined __clang_major__ && defined __clang_minor__
+# define CLANG_PREREQ(maj, min) \
((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
-#else
-# define CLANG_PREREQ(maj, min) 0
-#endif
-
-#if !(GNUC_PREREQ(2, 0) || CLANG_PREREQ(1, 0))
-# define __attribute__(x) /* empty */
-#endif
-
-#if GNUC_PREREQ(2, 5)
-# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
-#else
-# define ATTRIBUTE_NORETURN /* empty */
-#endif
-
-#if GNUC_PREREQ(2, 7)
-# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
-# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
-# define ATTRIBUTE_PACKED __attribute__((__packed__))
-#else
-# define ATTRIBUTE_FORMAT(args) /* empty */
-# define ATTRIBUTE_ALIGNED(arg) /* empty */
-# define ATTRIBUTE_PACKED /* empty */
-#endif
-
-#if GNUC_PREREQ(3, 0)
-# define SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y))
-# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0)
+# else
+# define CLANG_PREREQ(maj, min) 0
+# endif
+
+# if !(GNUC_PREREQ(2, 0) || CLANG_PREREQ(1, 0))
+# define __attribute__(x) /* empty */
+# endif
+
+# if GNUC_PREREQ(2, 5)
+# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
+# else
+# define ATTRIBUTE_NORETURN /* empty */
+# endif
+
+# if GNUC_PREREQ(2, 7)
+# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
+# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
+# define ATTRIBUTE_PACKED __attribute__((__packed__))
+# else
+# define ATTRIBUTE_FORMAT(args) /* empty */
+# define ATTRIBUTE_ALIGNED(arg) /* empty */
+# define ATTRIBUTE_PACKED /* empty */
+# endif
+
+# if GNUC_PREREQ(3, 0)
+# define SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y))
+# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0)
/* &(a)[0] is a pointer and not an array, shouldn't be treated as the same */
-# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0]))
-#else
-# define SAME_TYPE(x, y) 0
-# define MUST_BE_ARRAY(a) 0
-#endif
-
-#if GNUC_PREREQ(3, 0)
-# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
-#else
-# define ATTRIBUTE_MALLOC /* empty */
-#endif
-
-#if GNUC_PREREQ(3, 1)
-# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
-#else
-# define ATTRIBUTE_NOINLINE /* empty */
-#endif
-
-#if GNUC_PREREQ(4, 0)
-# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
-#else
-# define ATTRIBUTE_SENTINEL /* empty */
-#endif
-
-#if GNUC_PREREQ(4, 1)
-# define ALIGNOF(t_) __alignof__(t_)
-#else
-# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
-#endif
-
-#if GNUC_PREREQ(4, 3)
-# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
-#else
-# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
-#endif
-
-#if GNUC_PREREQ(7, 0)
-# define ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__))
-#else
-# define ATTRIBUTE_FALLTHROUGH ((void) 0)
-#endif
-
-#if CLANG_PREREQ(2, 8)
-# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
+# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0]))
+# else
+# define SAME_TYPE(x, y) 0
+# define MUST_BE_ARRAY(a) 0
+# endif
+
+# if GNUC_PREREQ(3, 0)
+# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
+# else
+# define ATTRIBUTE_MALLOC /* empty */
+# endif
+
+# if GNUC_PREREQ(3, 1)
+# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
+# else
+# define ATTRIBUTE_NOINLINE /* empty */
+# endif
+
+# if GNUC_PREREQ(4, 0)
+# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
+# else
+# define ATTRIBUTE_SENTINEL /* empty */
+# endif
+
+# if GNUC_PREREQ(4, 1)
+# define ALIGNOF(t_) __alignof__(t_)
+# else
+# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
+# endif
+
+# if GNUC_PREREQ(4, 3)
+# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
+# else
+# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
+# endif
+
+# if GNUC_PREREQ(7, 0)
+# define ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__))
+# else
+# define ATTRIBUTE_FALLTHROUGH ((void) 0)
+# endif
+
+# if CLANG_PREREQ(2, 8)
+# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
_Pragma("clang diagnostic push"); \
_Pragma("clang diagnostic ignored \"-Winitializer-overrides\"");
-# define DIAG_POP_IGNORE_OVERRIDE_INIT \
+# define DIAG_POP_IGNORE_OVERRIDE_INIT \
_Pragma("clang diagnostic pop");
-#elif GNUC_PREREQ(4, 2)
-# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
+# elif GNUC_PREREQ(4, 2)
+# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
_Pragma("GCC diagnostic push"); \
_Pragma("GCC diagnostic ignored \"-Woverride-init\"");
-# define DIAG_POP_IGNORE_OVERRIDE_INIT \
+# define DIAG_POP_IGNORE_OVERRIDE_INIT \
_Pragma("GCC diagnostic pop");
-#else
-# define DIAG_PUSH_IGNORE_OVERRIDE_INIT /* empty */
-# define DIAG_POP_IGNORE_OVERRIDE_INIT /* empty */
-#endif
+# else
+# define DIAG_PUSH_IGNORE_OVERRIDE_INIT /* empty */
+# define DIAG_POP_IGNORE_OVERRIDE_INIT /* empty */
+# endif
-#if GNUC_PREREQ(6, 0)
-# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE \
+# if GNUC_PREREQ(6, 0)
+# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE \
_Pragma("GCC diagnostic push"); \
_Pragma("GCC diagnostic ignored \"-Wtautological-compare\"");
-# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE \
+# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE \
_Pragma("GCC diagnostic pop");
-#else
-# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
-# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
-#endif
+# else
+# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
+# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
+# endif
#endif /* !STRACE_GCC_COMPAT_H */
*/
#ifndef STRACE_GET_PERSONALITY_H
-#define STRACE_GET_PERSONALITY_H
+# define STRACE_GET_PERSONALITY_H
-#include "ptrace.h"
+# include "ptrace.h"
extern int
get_personality_from_syscall_info(const struct ptrace_syscall_info *);
*/
#ifndef STRACE_IPC_DEFS_H
-#define STRACE_IPC_DEFS_H
+# define STRACE_IPC_DEFS_H
-#ifdef HAVE_SYS_IPC_H
-# include <sys/ipc.h>
-#elif defined HAVE_LINUX_IPC_H
-# include <linux/ipc.h>
+# ifdef HAVE_SYS_IPC_H
+# include <sys/ipc.h>
+# elif defined HAVE_LINUX_IPC_H
+# include <linux/ipc.h>
/* While glibc uses __key, the kernel uses key. */
-# define __key key
-#endif
+# define __key key
+# endif
-#if !defined IPC_64
-# define IPC_64 0x100
-#endif
+# if !defined IPC_64
+# define IPC_64 0x100
+# endif
-#define PRINTCTL(flagset, arg, dflt) \
+# define PRINTCTL(flagset, arg, dflt) \
do { \
if ((arg) & IPC_64) { \
print_xlat(IPC_64); \
*/
#ifndef STRACE_KERNEL_TYPES_H
-#define STRACE_KERNEL_TYPES_H
+# define STRACE_KERNEL_TYPES_H
# if defined HAVE___KERNEL_LONG_T && defined HAVE___KERNEL_ULONG_T
-# include <asm/posix_types.h>
+# include <asm/posix_types.h>
typedef __kernel_long_t kernel_long_t;
typedef __kernel_ulong_t kernel_ulong_t;
char d_name[1];
} kernel_dirent;
-#if SIZEOF_KERNEL_LONG_T > SIZEOF_LONG
-# define PRI_kl "ll"
-#else
-# define PRI_kl "l"
-#endif
+# if SIZEOF_KERNEL_LONG_T > SIZEOF_LONG
+# define PRI_kl "ll"
+# else
+# define PRI_kl "l"
+# endif
-#define PRI_kld PRI_kl"d"
-#define PRI_klu PRI_kl"u"
-#define PRI_klx PRI_kl"x"
+# define PRI_kld PRI_kl"d"
+# define PRI_klu PRI_kl"u"
+# define PRI_klx PRI_kl"x"
/*
* The kernel used to define 64-bit types on 64-bit systems on a per-arch
* every printing of __u64 or __s64 to stdint types.
* The exception is Android, where for MIPS64 unsigned long long is used.
*/
-#if SIZEOF_LONG == 4
-# define PRI__64 "ll"
-#elif defined ALPHA || defined IA64 || defined __powerpc64__ \
+# if SIZEOF_LONG == 4
+# define PRI__64 "ll"
+# elif defined ALPHA || defined IA64 || defined __powerpc64__ \
|| (defined MIPS && !defined __ANDROID__)
-# define PRI__64 "l"
-#else
-# define PRI__64 "ll"
-#endif
+# define PRI__64 "l"
+# else
+# define PRI__64 "ll"
+# endif
-#define PRI__d64 PRI__64"d"
-#define PRI__u64 PRI__64"u"
-#define PRI__x64 PRI__64"x"
+# define PRI__d64 PRI__64"d"
+# define PRI__u64 PRI__64"u"
+# define PRI__x64 PRI__64"x"
#endif /* !STRACE_KERNEL_TYPES_H */
*/
#ifndef STRACE_KEYCTL_KDF_PARAMS_H
-#define STRACE_KEYCTL_KDF_PARAMS_H
+# define STRACE_KEYCTL_KDF_PARAMS_H
-#include <stdint.h>
-#include "kernel_types.h"
+# include <stdint.h>
+# include "kernel_types.h"
/* from include/linux/crypto.h */
-#define CRYPTO_MAX_ALG_NAME 128
+# define CRYPTO_MAX_ALG_NAME 128
/* from security/keys/internal.h */
-#define KEYCTL_KDF_MAX_OI_LEN 64 /* max length of otherinfo */
+# define KEYCTL_KDF_MAX_OI_LEN 64 /* max length of otherinfo */
struct keyctl_kdf_params {
char *hashname;
*/
#ifndef STRACE_KILL_SAVE_ERRNO_H
-#define STRACE_KILL_SAVE_ERRNO_H
+# define STRACE_KILL_SAVE_ERRNO_H
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
+# include <sys/types.h>
+# include <signal.h>
+# include <errno.h>
static inline int
kill_save_errno(pid_t pid, int sig)
: 0;
}
-#define VCPU_DENTRY_PREFIX "anon_inode:kvm-vcpu:"
+# define VCPU_DENTRY_PREFIX "anon_inode:kvm-vcpu:"
static struct vcpu_info*
vcpu_get_info(struct tcb *const tcp, int fd)
*/
#ifndef STRACE_LARGEFILE_WRAPPERS_H
-#define STRACE_LARGEFILE_WRAPPERS_H
+# define STRACE_LARGEFILE_WRAPPERS_H
-#include "defs.h"
+# include "defs.h"
-#ifdef _LARGEFILE64_SOURCE
-# ifdef HAVE_FOPEN64
-# define fopen_stream fopen64
+# ifdef _LARGEFILE64_SOURCE
+# ifdef HAVE_FOPEN64
+# define fopen_stream fopen64
+# else
+# define fopen_stream fopen
+# endif
+# define struct_stat struct stat64
+# define stat_file stat64
+# define struct_dirent struct dirent64
+# define read_dir readdir64
+# define struct_rlimit struct rlimit64
+# define set_rlimit setrlimit64
# else
# define fopen_stream fopen
+# define struct_stat struct stat
+# define stat_file stat
+# define struct_dirent struct dirent
+# define read_dir readdir
+# define struct_rlimit struct rlimit
+# define set_rlimit setrlimit
# endif
-# define struct_stat struct stat64
-# define stat_file stat64
-# define struct_dirent struct dirent64
-# define read_dir readdir64
-# define struct_rlimit struct rlimit64
-# define set_rlimit setrlimit64
-#else
-# define fopen_stream fopen
-# define struct_stat struct stat
-# define stat_file stat
-# define struct_dirent struct dirent
-# define read_dir readdir
-# define struct_rlimit struct rlimit
-# define set_rlimit setrlimit
-#endif
#endif /* STRACE_LARGEFILE_WRAPPERS_H */
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
{
*err = 0;
-#ifdef __thumb__ /* && FRAME_POINTERS_ENABLED */
+# ifdef __thumb__ /* && FRAME_POINTERS_ENABLED */
register kernel_ulong_t rt;
register kernel_ulong_t r0 __asm__("r0");
: "r"(nr)
: "memory");
-#else
+# else
register kernel_ulong_t r7 __asm__("r7") = nr;
register kernel_ulong_t r0 __asm__("r0");
: "r"(r7)
: "memory");
-#endif
+# endif
return r0;
}
*/
#ifndef STRACE_ASM_STAT_H
-#define STRACE_ASM_STAT_H
+# define STRACE_ASM_STAT_H
# undef dev_t
# undef gid_t
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
typedef struct {
int sig;
*/
#ifndef STRACE_LINUX_DUMMY_H
-#define STRACE_LINUX_DUMMY_H
+# define STRACE_LINUX_DUMMY_H
-#ifndef HAVE_STRUCT___OLD_KERNEL_STAT
-#define sys_oldfstat printargs
-#define sys_oldstat printargs
-#endif
+# ifndef HAVE_STRUCT___OLD_KERNEL_STAT
+# define sys_oldfstat printargs
+# define sys_oldstat printargs
+# endif
/* still unfinished */
-#define sys_rseq printargs
-#define sys_vm86 printargs
-#define sys_vm86old printargs
+# define sys_rseq printargs
+# define sys_vm86 printargs
+# define sys_vm86old printargs
/* machine-specific */
-#ifndef HAVE_STRUCT_USER_DESC
-# define sys_modify_ldt printargs
-#endif
+# ifndef HAVE_STRUCT_USER_DESC
+# define sys_modify_ldt printargs
+# endif
-#if !(defined HAVE_STRUCT_USER_DESC || defined M68K || defined MIPS)
-# define sys_set_thread_area printargs
-#endif
+# if !(defined HAVE_STRUCT_USER_DESC || defined M68K || defined MIPS)
+# define sys_set_thread_area printargs
+# endif
-#if !(defined HAVE_STRUCT_USER_DESC || defined M68K)
-# define sys_get_thread_area printargs
-#endif
+# if !(defined HAVE_STRUCT_USER_DESC || defined M68K)
+# define sys_get_thread_area printargs
+# endif
-#ifdef ALPHA
-# define sys_getdtablesize printargs
-#endif
+# ifdef ALPHA
+# define sys_getdtablesize printargs
+# endif
/* like another call */
-#define sys_acct sys_chdir
-#define sys_chroot sys_chdir
-#define sys_clock_getres sys_clock_gettime
-#define sys_connect sys_bind
-#define sys_fchdir sys_close
-#define sys_fdatasync sys_close
-#define sys_fsync sys_close
-#define sys_getegid sys_getuid
-#define sys_getegid16 sys_geteuid16
-#define sys_geteuid sys_getuid
-#define sys_geteuid16 sys_getuid16
-#define sys_getgid sys_getuid
-#define sys_getgid16 sys_getuid16
-#define sys_getpeername sys_getsockname
-#define sys_getresgid sys_getresuid
-#define sys_getresgid16 sys_getresuid16
-#define sys_lstat sys_stat
-#define sys_lstat64 sys_stat64
-#define sys_mkdir sys_chmod
-#define sys_mkdirat sys_fchmodat
-#define sys_mlock sys_munmap
-#define sys_mq_unlink sys_chdir
-#define sys_munlock sys_munmap
-#define sys_oldlstat sys_oldstat
-#define sys_pivotroot sys_link
-#define sys_rename sys_link
-#define sys_rmdir sys_chdir
-#define sys_sched_get_priority_max sys_sched_get_priority_min
-#define sys_set_robust_list sys_munmap
-#define sys_setdomainname sys_sethostname
-#define sys_setfsgid sys_setfsuid
-#define sys_setfsgid16 sys_setfsuid16
-#define sys_setgid sys_setuid
-#define sys_setgid16 sys_setuid16
-#define sys_setregid sys_setreuid
-#define sys_setregid16 sys_setreuid16
-#define sys_setresgid sys_setresuid
-#define sys_setresgid16 sys_setresuid16
-#define sys_stime sys_time
-#define sys_swapoff sys_chdir
-#define sys_symlink sys_link
-#define sys_syncfs sys_close
-#define sys_umount sys_chdir
-#define sys_unlink sys_chdir
-#define sys_uselib sys_chdir
-#define sys_vfork sys_fork
+# define sys_acct sys_chdir
+# define sys_chroot sys_chdir
+# define sys_clock_getres sys_clock_gettime
+# define sys_connect sys_bind
+# define sys_fchdir sys_close
+# define sys_fdatasync sys_close
+# define sys_fsync sys_close
+# define sys_getegid sys_getuid
+# define sys_getegid16 sys_geteuid16
+# define sys_geteuid sys_getuid
+# define sys_geteuid16 sys_getuid16
+# define sys_getgid sys_getuid
+# define sys_getgid16 sys_getuid16
+# define sys_getpeername sys_getsockname
+# define sys_getresgid sys_getresuid
+# define sys_getresgid16 sys_getresuid16
+# define sys_lstat sys_stat
+# define sys_lstat64 sys_stat64
+# define sys_mkdir sys_chmod
+# define sys_mkdirat sys_fchmodat
+# define sys_mlock sys_munmap
+# define sys_mq_unlink sys_chdir
+# define sys_munlock sys_munmap
+# define sys_oldlstat sys_oldstat
+# define sys_pivotroot sys_link
+# define sys_rename sys_link
+# define sys_rmdir sys_chdir
+# define sys_sched_get_priority_max sys_sched_get_priority_min
+# define sys_set_robust_list sys_munmap
+# define sys_setdomainname sys_sethostname
+# define sys_setfsgid sys_setfsuid
+# define sys_setfsgid16 sys_setfsuid16
+# define sys_setgid sys_setuid
+# define sys_setgid16 sys_setuid16
+# define sys_setregid sys_setreuid
+# define sys_setregid16 sys_setreuid16
+# define sys_setresgid sys_setresuid
+# define sys_setresgid16 sys_setresuid16
+# define sys_stime sys_time
+# define sys_swapoff sys_chdir
+# define sys_symlink sys_link
+# define sys_syncfs sys_close
+# define sys_umount sys_chdir
+# define sys_unlink sys_chdir
+# define sys_uselib sys_chdir
+# define sys_vfork sys_fork
/* printargs does the right thing */
-#define sys_getpgrp printargs
-#define sys_getpid printargs
-#define sys_getppid printargs
-#define sys_gettid printargs
-#define sys_idle printargs
-#define sys_inotify_init printargs
-#define sys_munlockall printargs
-#define sys_pause printargs
-#define sys_printargs printargs
-#define sys_sched_yield printargs
-#define sys_setsid printargs
-#define sys_set_tid_address printargs
-#define sys_setup printargs
-#define sys_sync printargs
-#define sys_syscall printargs
-#define sys_vhangup printargs
+# define sys_getpgrp printargs
+# define sys_getpid printargs
+# define sys_getppid printargs
+# define sys_gettid printargs
+# define sys_idle printargs
+# define sys_inotify_init printargs
+# define sys_munlockall printargs
+# define sys_pause printargs
+# define sys_printargs printargs
+# define sys_sched_yield printargs
+# define sys_setsid printargs
+# define sys_set_tid_address printargs
+# define sys_setup printargs
+# define sys_sync printargs
+# define sys_syscall printargs
+# define sys_vhangup printargs
/* printargs_u does the right thing */
-#define sys_alarm printargs_u
+# define sys_alarm printargs_u
/* printargs_d does the right thing */
-#define sys_exit printargs_d
-#define sys_getpgid printargs_d
-#define sys_getsid printargs_d
-#define sys_nice printargs_d
-#define sys_setpgid printargs_d
-#define sys_setpgrp printargs_d
-#define sys_timer_delete printargs_d
-#define sys_timer_getoverrun printargs_d
+# define sys_exit printargs_d
+# define sys_getpgid printargs_d
+# define sys_getsid printargs_d
+# define sys_nice printargs_d
+# define sys_setpgid printargs_d
+# define sys_setpgrp printargs_d
+# define sys_timer_delete printargs_d
+# define sys_timer_getoverrun printargs_d
/* unimplemented */
-#define sys_afs_syscall printargs
-#define sys_break printargs
-#define sys_create_module printargs
-#define sys_ftime printargs
-#define sys_get_kernel_syms printargs
-#define sys_getpmsg printargs
-#define sys_gtty printargs
-#define sys_lock printargs
-#define sys_mpx printargs
-#define sys_nfsservctl printargs
-#define sys_prof printargs
-#define sys_profil printargs
-#define sys_putpmsg printargs
-#define sys_query_module printargs
-#define sys_security printargs
-#define sys_stty printargs
-#define sys_timerfd printargs
-#define sys_tuxcall printargs
-#define sys_ulimit printargs
-#define sys_vserver printargs
+# define sys_afs_syscall printargs
+# define sys_break printargs
+# define sys_create_module printargs
+# define sys_ftime printargs
+# define sys_get_kernel_syms printargs
+# define sys_getpmsg printargs
+# define sys_gtty printargs
+# define sys_lock printargs
+# define sys_mpx printargs
+# define sys_nfsservctl printargs
+# define sys_prof printargs
+# define sys_profil printargs
+# define sys_putpmsg printargs
+# define sys_query_module printargs
+# define sys_security printargs
+# define sys_stty printargs
+# define sys_timerfd printargs
+# define sys_tuxcall printargs
+# define sys_ulimit printargs
+# define sys_vserver printargs
/* deprecated */
-#define sys_bdflush printargs
-#define sys_oldolduname printargs
-#define sys_olduname printargs
-#define sys_sysfs printargs
+# define sys_bdflush printargs
+# define sys_oldolduname printargs
+# define sys_olduname printargs
+# define sys_sysfs printargs
#endif /* !STRACE_LINUX_DUMMY_H */
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
typedef struct {
unsigned int tramp[9];
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
typedef struct {
uint32_t pretcode;
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
typedef struct {
unsigned long arg0;
struct sigcontext sc;
} struct_rt_sigframe;
-#define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \
+# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \
offsetof(struct_rt_sigframe, sc.sc_mask)
#endif /* !STRACE_RT_SIGFRAME_H */
*/
#ifndef STRACE_LINUX_INET_DIAG_H
-#define STRACE_LINUX_INET_DIAG_H
+# define STRACE_LINUX_INET_DIAG_H
-#define TCPDIAG_GETSOCK 18
-#define DCCPDIAG_GETSOCK 19
+# define TCPDIAG_GETSOCK 18
+# define DCCPDIAG_GETSOCK 19
/* Socket identity */
struct inet_diag_sockid {
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
typedef struct {
char *pretcode;
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
typedef struct {
uint32_t pad[6];
*/
#ifndef STRACE_LINUX_NETLINK_DIAG_H
-#define STRACE_LINUX_NETLINK_DIAG_H
+# define STRACE_LINUX_NETLINK_DIAG_H
struct netlink_diag_req {
uint8_t sdiag_family;
NETLINK_DIAG_FLAGS,
};
-#define NDIAG_SHOW_MEMINFO 0x00000001
-#define NDIAG_SHOW_GROUPS 0x00000002
-#define NDIAG_SHOW_RING_CFG 0x00000004 /* deprecated since 4.6 */
-#define NDIAG_SHOW_FLAGS 0x00000008
-#define NDIAG_PROTO_ALL ((uint8_t) ~0)
+# define NDIAG_SHOW_MEMINFO 0x00000001
+# define NDIAG_SHOW_GROUPS 0x00000002
+# define NDIAG_SHOW_RING_CFG 0x00000004 /* deprecated since 4.6 */
+# define NDIAG_SHOW_FLAGS 0x00000008
+# define NDIAG_PROTO_ALL ((uint8_t) ~0)
/* flags */
-#define NDIAG_FLAG_CB_RUNNING 0x00000001
-#define NDIAG_FLAG_PKTINFO 0x00000002
-#define NDIAG_FLAG_BROADCAST_ERROR 0x00000004
-#define NDIAG_FLAG_NO_ENOBUFS 0x00000008
-#define NDIAG_FLAG_LISTEN_ALL_NSID 0x00000010
-#define NDIAG_FLAG_CAP_ACK 0x00000020
+# define NDIAG_FLAG_CB_RUNNING 0x00000001
+# define NDIAG_FLAG_PKTINFO 0x00000002
+# define NDIAG_FLAG_BROADCAST_ERROR 0x00000004
+# define NDIAG_FLAG_NO_ENOBUFS 0x00000008
+# define NDIAG_FLAG_LISTEN_ALL_NSID 0x00000010
+# define NDIAG_FLAG_CAP_ACK 0x00000020
#endif /* !STRACE_LINUX_NETLINK_DIAG_H */
*/
static struct user_pt_regs nios2_regs;
-# define ARCH_REGS_FOR_GETREGSET nios2_regs
+#define ARCH_REGS_FOR_GETREGSET nios2_regs
#define ARCH_PC_REG nios2_regs.regs[PTR_EA]
#define ARCH_SP_REG nios2_regs.regs[PTR_SP]
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_LINUX_PACKET_DIAG_H
-#define STRACE_LINUX_PACKET_DIAG_H
+# define STRACE_LINUX_PACKET_DIAG_H
struct packet_diag_req {
uint8_t sdiag_family;
uint32_t pdiag_cookie[2];
};
-#define PACKET_SHOW_INFO 0x00000001
-#define PACKET_SHOW_MCLIST 0x00000002
-#define PACKET_SHOW_RING_CFG 0x00000004
-#define PACKET_SHOW_FANOUT 0x00000008
-#define PACKET_SHOW_MEMINFO 0x00000010
-#define PACKET_SHOW_FILTER 0x00000020
+# define PACKET_SHOW_INFO 0x00000001
+# define PACKET_SHOW_MCLIST 0x00000002
+# define PACKET_SHOW_RING_CFG 0x00000004
+# define PACKET_SHOW_FANOUT 0x00000008
+# define PACKET_SHOW_MEMINFO 0x00000010
+# define PACKET_SHOW_FILTER 0x00000020
struct packet_diag_msg {
uint8_t pdiag_family;
uint32_t pdi_tstamp;
uint32_t pdi_flags;
-#define PDI_RUNNING 0x1
-#define PDI_AUXDATA 0x2
-#define PDI_ORIGDEV 0x4
-#define PDI_VNETHDR 0x8
-#define PDI_LOSS 0x10
+# define PDI_RUNNING 0x1
+# define PDI_AUXDATA 0x2
+# define PDI_ORIGDEV 0x4
+# define PDI_VNETHDR 0x8
+# define PDI_LOSS 0x10
};
struct packet_diag_mclist {
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
-#define SIGNAL_FRAMESIZE32 64
+#define SIGNAL_FRAMESIZE32 64
FUNC_GET_RT_SIGFRAME_ADDR
{
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#undef FUNC_GET_RT_SIGFRAME_ADDR
-#define FUNC_GET_RT_SIGFRAME_ADDR \
+#define FUNC_GET_RT_SIGFRAME_ADDR \
static kernel_ulong_t ppc_get_rt_sigframe_addr(struct tcb *tcp)
#include "powerpc/arch_rt_sigframe.c"
#undef FUNC_GET_RT_SIGFRAME_ADDR
-#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
+#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
FUNC_GET_RT_SIGFRAME_ADDR
{
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
/* This is a generic definition for compatible architectures. */
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
typedef struct {
uint8_t callee_used_stack[__SIGNAL_FRAMESIZE];
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
typedef struct {
siginfo_t *pinfo;
*/
#ifndef STRACE_LINUX_SMC_DIAG_H
-#define STRACE_LINUX_SMC_DIAG_H
+# define STRACE_LINUX_SMC_DIAG_H
-#include <linux/inet_diag.h>
+# include <linux/inet_diag.h>
-#include "gcc_compat.h"
+# include "gcc_compat.h"
/* Request structure */
struct smc_diag_req {
*/
#ifndef STRACE_LINUX_SOCK_DIAG_H
-#define STRACE_LINUX_SOCK_DIAG_H
+# define STRACE_LINUX_SOCK_DIAG_H
-#define SOCK_DIAG_BY_FAMILY 20
-#define SOCK_DESTROY 21
+# define SOCK_DIAG_BY_FAMILY 20
+# define SOCK_DESTROY 21
-#define SK_MEMINFO_VARS 9
+# define SK_MEMINFO_VARS 9
struct sock_diag_req {
uint8_t sdiag_family;
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include "ptrace.h"
-#include <signal.h>
+# include "ptrace.h"
+# include <signal.h>
typedef struct {
struct sparc_stackf ss;
/* more data follows */
} struct_rt_sigframe;
-#define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \
+# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \
offsetof(struct_rt_sigframe, mask)
#endif /* !STRACE_RT_SIGFRAME_H */
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
-#define STACK_BIAS 2047
+#define STACK_BIAS 2047
FUNC_GET_RT_SIGFRAME_ADDR
{
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_LINUX_SYSCALL_H
-#define STRACE_LINUX_SYSCALL_H
+# define STRACE_LINUX_SYSCALL_H
-#include "dummy.h"
-#include "sys_func.h"
-#include "sen.h"
+# include "dummy.h"
+# include "sys_func.h"
+# include "sen.h"
-#if HAVE_ARCH_UID16_SYSCALLS
+# if HAVE_ARCH_UID16_SYSCALLS
extern SYS_FUNC(chown16);
extern SYS_FUNC(fchown16);
extern SYS_FUNC(getgroups16);
extern SYS_FUNC(setresuid16);
extern SYS_FUNC(setreuid16);
extern SYS_FUNC(setuid16);
-#endif /* HAVE_ARCH_UID16_SYSCALLS */
+# endif /* HAVE_ARCH_UID16_SYSCALLS */
#endif /* !STRACE_LINUX_SYSCALL_H */
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
-#include <signal.h>
+# include <signal.h>
typedef struct {
unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
*/
#ifndef STRACE_LINUX_UNIX_DIAG_H
-#define STRACE_LINUX_UNIX_DIAG_H
+# define STRACE_LINUX_UNIX_DIAG_H
struct unix_diag_req {
uint8_t sdiag_family;
uint32_t udiag_cookie[2];
};
-#define UDIAG_SHOW_NAME 0x01
-#define UDIAG_SHOW_VFS 0x02
-#define UDIAG_SHOW_PEER 0x04
-#define UDIAG_SHOW_ICONS 0x08
-#define UDIAG_SHOW_RQLEN 0x10
-#define UDIAG_SHOW_MEMINFO 0x20
+# define UDIAG_SHOW_NAME 0x01
+# define UDIAG_SHOW_VFS 0x02
+# define UDIAG_SHOW_PEER 0x04
+# define UDIAG_SHOW_ICONS 0x08
+# define UDIAG_SHOW_RQLEN 0x10
+# define UDIAG_SHOW_MEMINFO 0x20
struct unix_diag_msg {
uint8_t udiag_family;
kernel_ulong_t scno = sci->entry.nr;
-#ifndef __X32_SYSCALL_BIT
-# define __X32_SYSCALL_BIT 0x40000000
-#endif
+# ifndef __X32_SYSCALL_BIT
+# define __X32_SYSCALL_BIT 0x40000000
+# endif
if (pers == 0 && (scno & __X32_SYSCALL_BIT)) {
/*
*/
#ifndef STRACE_X86_64_ASM_STAT_H
-#define STRACE_X86_64_ASM_STAT_H
+# define STRACE_X86_64_ASM_STAT_H
# if defined __x86_64__ && defined __ILP32__
# define stat redirect_kernel_stat
if ((long long) x86_64_regs.orig_rax != -1) {
currpers = 2;
} else {
-# ifdef X32
+#ifdef X32
currpers = 2;
-# endif
+#endif
}
}
}
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
*/
#ifndef STRACE_RAW_SYSCALL_H
-#define STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
# include "kernel_types.h"
#include "print_fields.h"
#define XLAT_MACROS_ONLY
-# include "xlat/loop_cmds.h"
+#include "xlat/loop_cmds.h"
#undef XLAT_MACROS_ONLY
#include "xlat/loop_flags_options.h"
kernel_long_t offset;
-# ifndef current_klongsize
+#ifndef current_klongsize
if (current_klongsize < sizeof(kernel_long_t)) {
offset = (int) tcp->u_arg[1];
} else
-# endif /* !current_klongsize */
+#endif /* !current_klongsize */
{
offset = tcp->u_arg[1];
}
*/
#ifndef STRACE_MACROS_H
-#define STRACE_MACROS_H
+# define STRACE_MACROS_H
-#include <stdbool.h>
-#include <sys/types.h>
+# include <stdbool.h>
+# include <sys/types.h>
-#include "gcc_compat.h"
+# include "gcc_compat.h"
-#define ARRAY_SIZE(a_) (sizeof(a_) / sizeof((a_)[0]) + MUST_BE_ARRAY(a_))
+# define ARRAY_SIZE(a_) (sizeof(a_) / sizeof((a_)[0]) + MUST_BE_ARRAY(a_))
-#define ARRSZ_PAIR(a_) a_, ARRAY_SIZE(a_)
+# define ARRSZ_PAIR(a_) a_, ARRAY_SIZE(a_)
-#define STRINGIFY(...) #__VA_ARGS__
-#define STRINGIFY_VAL(...) STRINGIFY(__VA_ARGS__)
+# define STRINGIFY(...) #__VA_ARGS__
+# define STRINGIFY_VAL(...) STRINGIFY(__VA_ARGS__)
-#ifndef MAX
-# define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-#ifndef MIN
-# define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-#define CLAMP(val, min, max) MIN(MAX(min, val), max)
+# ifndef MAX
+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
+# endif
+# ifndef MIN
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
+# endif
+# define CLAMP(val, min, max) MIN(MAX(min, val), max)
-#ifndef ROUNDUP
-# define ROUNDUP(val_, div_) ((((val_) + (div_) - 1) / (div_)) * (div_))
-#endif
+# ifndef ROUNDUP
+# define ROUNDUP(val_, div_) ((((val_) + (div_) - 1) / (div_)) * (div_))
+# endif
-#ifndef offsetofend
-# define offsetofend(type_, member_) \
+# ifndef offsetofend
+# define offsetofend(type_, member_) \
(offsetof(type_, member_) + sizeof(((type_ *)0)->member_))
-#endif
+# endif
static inline bool
is_filled(const char *ptr, char fill, size_t size)
return true;
}
-#define IS_ARRAY_ZERO(arr_) \
+# define IS_ARRAY_ZERO(arr_) \
is_filled((const char *) (arr_), 0, sizeof(arr_) + MUST_BE_ARRAY(arr_))
#endif /* !STRACE_MACROS_H */
*/
#ifndef STRACE_MMAP_CACHE_H
-#define STRACE_MMAP_CACHE_H
+# define STRACE_MMAP_CACHE_H
/*
* Keep a sorted array of cache entries,
*/
#ifndef STRACE_MMAP_NOTIFY_H
-#define STRACE_MMAP_NOTIFY_H
+# define STRACE_MMAP_NOTIFY_H
-#include "defs.h"
+# include "defs.h"
typedef void (*mmap_notify_fn)(struct tcb *, void *);
*/
#ifndef STRACE_MPERS_TYPE_H
-#define STRACE_MPERS_TYPE_H
+# define STRACE_MPERS_TYPE_H
-#include "macros.h"
+# include "macros.h"
-#ifdef IN_MPERS
-# define DEF_MPERS_TYPE(args) STRINGIFY(args.h)
-# ifdef MPERS_IS_m32
-# define MPERS_PREFIX m32_
-# define MPERS_DEFS "m32_type_defs.h"
-# elif defined MPERS_IS_mx32
-# define MPERS_PREFIX mx32_
-# define MPERS_DEFS "mx32_type_defs.h"
-# endif
-#else
-# define MPERS_PREFIX
-# define DEF_MPERS_TYPE(args) "empty.h"
-# if IN_MPERS_BOOTSTRAP
-# define MPERS_DEFS "empty.h"
+# ifdef IN_MPERS
+# define DEF_MPERS_TYPE(args) STRINGIFY(args.h)
+# ifdef MPERS_IS_m32
+# define MPERS_PREFIX m32_
+# define MPERS_DEFS "m32_type_defs.h"
+# elif defined MPERS_IS_mx32
+# define MPERS_PREFIX mx32_
+# define MPERS_DEFS "mx32_type_defs.h"
+# endif
# else
-# define MPERS_DEFS "native_defs.h"
-# endif
+# define MPERS_PREFIX
+# define DEF_MPERS_TYPE(args) "empty.h"
+# if IN_MPERS_BOOTSTRAP
+# define MPERS_DEFS "empty.h"
+# else
+# define MPERS_DEFS "native_defs.h"
+# endif
typedef unsigned long mpers_ptr_t;
-#endif
+# endif
#endif /* !STRACE_MPERS_TYPE_H */
*/
#ifndef STRACE_MSGHDR_H
-#define STRACE_MSGHDR_H
+# define STRACE_MSGHDR_H
/* For definitions of struct msghdr and struct mmsghdr. */
# include <sys/socket.h>
#include <linux/nbd.h>
#define XLAT_MACROS_ONLY
-# include "xlat/nbd_ioctl_cmds.h"
+#include "xlat/nbd_ioctl_cmds.h"
#undef XLAT_MACROS_ONLY
#include "xlat/nbd_ioctl_flags.h"
*/
#ifndef STRACE_NEGATED_ERRNO_H
-#define STRACE_NEGATED_ERRNO_H
+# define STRACE_NEGATED_ERRNO_H
/*
* Check the syscall return value register value for whether it is
{
kernel_ulong_t max = -(kernel_long_t) MAX_ERRNO_VALUE;
-#ifndef current_klongsize
+# ifndef current_klongsize
if (current_klongsize < sizeof(val)) {
val = (uint32_t) val;
max = (uint32_t) max;
}
-#endif /* !current_klongsize */
+# endif /* !current_klongsize */
return val >= max;
}
#include "xlat/inet_protocols.h"
#define XLAT_MACROS_ONLY
-# include "xlat/addrfams.h"
-# include "xlat/ethernet_protocols.h"
+#include "xlat/addrfams.h"
+#include "xlat/ethernet_protocols.h"
#undef XLAT_MACROS_ONLY
#include "xlat/ax25_protocols.h"
#include "xlat/irda_protocols.h"
*/
#ifndef STRACE_NETLINK_H
-#define STRACE_NETLINK_H
-
-#include <stdbool.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-
-#ifndef NETLINK_SOCK_DIAG
-# define NETLINK_SOCK_DIAG 4
-#endif
-
-#ifndef NLM_F_NONREC
-# define NLM_F_NONREC 0x100
-#endif
-#ifndef NLM_F_CAPPED
-# define NLM_F_CAPPED 0x100
-#endif
-
-#undef NLMSG_HDRLEN
-#define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
-
-#ifndef NLMSG_MIN_TYPE
-# define NLMSG_MIN_TYPE 0x10
-#endif
-
-#ifndef NLA_ALIGN
-# define NLA_ALIGN(len) (((len) + 3) & ~3)
-#endif
-
-#undef NLA_HDRLEN
-#define NLA_HDRLEN ((unsigned int) NLA_ALIGN(sizeof(struct nlattr)))
-
-#ifndef NLA_TYPE_MASK
-# define NLA_F_NESTED (1 << 15)
-# define NLA_F_NET_BYTEORDER (1 << 14)
-# define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
-#endif
+# define STRACE_NETLINK_H
+
+# include <stdbool.h>
+# include <sys/socket.h>
+# include <linux/netlink.h>
+
+# ifndef NETLINK_SOCK_DIAG
+# define NETLINK_SOCK_DIAG 4
+# endif
+
+# ifndef NLM_F_NONREC
+# define NLM_F_NONREC 0x100
+# endif
+# ifndef NLM_F_CAPPED
+# define NLM_F_CAPPED 0x100
+# endif
+
+# undef NLMSG_HDRLEN
+# define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
+
+# ifndef NLMSG_MIN_TYPE
+# define NLMSG_MIN_TYPE 0x10
+# endif
+
+# ifndef NLA_ALIGN
+# define NLA_ALIGN(len) (((len) + 3) & ~3)
+# endif
+
+# undef NLA_HDRLEN
+# define NLA_HDRLEN ((unsigned int) NLA_ALIGN(sizeof(struct nlattr)))
+
+# ifndef NLA_TYPE_MASK
+# define NLA_F_NESTED (1 << 15)
+# define NLA_F_NET_BYTEORDER (1 << 14)
+# define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
+# endif
static inline bool
is_nlmsg_ok(const struct nlmsghdr *const nlh, const ssize_t len)
*/
#ifndef STRACE_NETLINK_KOBJECT_UEVENT_H
-#define STRACE_NETLINK_KOBJECT_UEVENT_H
+# define STRACE_NETLINK_KOBJECT_UEVENT_H
struct udev_monitor_netlink_header {
/* "libudev" prefix to distinguish libudev and kernel messages */
*/
#ifndef STRACE_NETLINK_ROUTE_H
-#define STRACE_NETLINK_ROUTE_H
+# define STRACE_NETLINK_ROUTE_H
-#define DECL_NETLINK_ROUTE_DECODER(route_decode_name) \
+# define DECL_NETLINK_ROUTE_DECODER(route_decode_name) \
void \
route_decode_name(struct tcb *tcp, \
const struct nlmsghdr *nlmsghdr, \
tprints("}");
}
-# define PRINT_FIELD_SMC_DIAG_CURSOR(prefix_, where_, field_) \
+#define PRINT_FIELD_SMC_DIAG_CURSOR(prefix_, where_, field_) \
do { \
tprintf("%s%s=", (prefix_), #field_); \
print_smc_diag_cursor(&(where_).field_); \
*/
#ifndef STRACE_NETLINK_SOCK_DIAG_H
-#define STRACE_NETLINK_SOCK_DIAG_H
+# define STRACE_NETLINK_SOCK_DIAG_H
-#define DECL_NETLINK_DIAG_DECODER(diag_decode_name) \
+# define DECL_NETLINK_DIAG_DECODER(diag_decode_name) \
void \
diag_decode_name(struct tcb *tcp, \
const struct nlmsghdr *nlmsghdr, \
extern void
print_inet_diag_sockid(const struct inet_diag_sockid *, const uint8_t family);
-#define PRINT_FIELD_INET_DIAG_SOCKID(prefix_, where_, field_, af_) \
+# define PRINT_FIELD_INET_DIAG_SOCKID(prefix_, where_, field_, af_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_inet_diag_sockid(&(where_).field_, (af_)); \
*/
#ifndef STRACE_NLATTR_H
-#define STRACE_NLATTR_H
+# define STRACE_NLATTR_H
-#include "xlat.h"
+# include "xlat.h"
struct decode_nla_xlat_opts {
const struct xlat *xlat;
unsigned int size,
const void *opaque_data);
-#define DECL_NLA(name) \
+# define DECL_NLA(name) \
extern bool \
decode_nla_ ## name(struct tcb *, kernel_ulong_t addr, \
unsigned int len, const void *) \
*/
#ifndef STRACE_NSFS_H
-#define STRACE_NSFS_H
+# define STRACE_NSFS_H
-#include <linux/ioctl.h>
+# include <linux/ioctl.h>
-#ifdef HAVE_LINUX_NSFS_H
-# include <linux/nsfs.h>
-#else
-# define NSIO 0xb7
-# define NS_GET_USERNS _IO(NSIO, 0x1)
-# define NS_GET_PARENT _IO(NSIO, 0x2)
-#endif
+# ifdef HAVE_LINUX_NSFS_H
+# include <linux/nsfs.h>
+# else
+# define NSIO 0xb7
+# define NS_GET_USERNS _IO(NSIO, 0x1)
+# define NS_GET_PARENT _IO(NSIO, 0x2)
+# endif
-#ifndef NS_GET_NSTYPE
-# define NS_GET_NSTYPE _IO(NSIO, 0x3)
-#endif
-#ifndef NS_GET_OWNER_UID
-# define NS_GET_OWNER_UID _IO(NSIO, 0x4)
-#endif
+# ifndef NS_GET_NSTYPE
+# define NS_GET_NSTYPE _IO(NSIO, 0x3)
+# endif
+# ifndef NS_GET_OWNER_UID
+# define NS_GET_OWNER_UID _IO(NSIO, 0x4)
+# endif
#endif /* !STRACE_NSFS_H */
*/
#ifndef STRACE_NSIG_H
-#define STRACE_NSIG_H
+# define STRACE_NSIG_H
-#include <signal.h>
+# include <signal.h>
-#ifndef NSIG
-# warning NSIG is not defined, using 32
-# define NSIG 32
-#elif NSIG < 32
-# error NSIG < 32
-#endif
+# ifndef NSIG
+# warning NSIG is not defined, using 32
+# define NSIG 32
+# elif NSIG < 32
+# error NSIG < 32
+# endif
-#define NSIG_BYTES (NSIG / 8)
+# define NSIG_BYTES (NSIG / 8)
#endif /* !STRACE_NSIG_H */
*/
#ifndef STRACE_NUMBER_SET_H
-#define STRACE_NUMBER_SET_H
+# define STRACE_NUMBER_SET_H
-#include "gcc_compat.h"
+# include "gcc_compat.h"
struct number_set;
#ifdef OR1K
-#define OR1K_ATOMIC_SWAP 1
-#define OR1K_ATOMIC_CMPXCHG 2
-#define OR1K_ATOMIC_XCHG 3
-#define OR1K_ATOMIC_ADD 4
-#define OR1K_ATOMIC_DECPOS 5
-#define OR1K_ATOMIC_AND 6
-#define OR1K_ATOMIC_OR 7
-#define OR1K_ATOMIC_UMAX 8
-#define OR1K_ATOMIC_UMIN 9
-
-#include "xlat/atomic_ops.h"
+# define OR1K_ATOMIC_SWAP 1
+# define OR1K_ATOMIC_CMPXCHG 2
+# define OR1K_ATOMIC_XCHG 3
+# define OR1K_ATOMIC_ADD 4
+# define OR1K_ATOMIC_DECPOS 5
+# define OR1K_ATOMIC_AND 6
+# define OR1K_ATOMIC_OR 7
+# define OR1K_ATOMIC_UMAX 8
+# define OR1K_ATOMIC_UMIN 9
+
+# include "xlat/atomic_ops.h"
SYS_FUNC(or1k_atomic)
{
* offsetofend against size) in order to print fields as kernel sees
* them. This also should work great on big endian architectures.
*/
- #define _PERF_CHECK_FIELD(_field) \
+#define _PERF_CHECK_FIELD(_field) \
do { \
if (offsetof(struct perf_event_attr, _field) >= size) \
goto print_perf_event_attr_out; \
*/
#ifndef STRACE_LINUX_PERF_EVENT_STRUCT_H
-#define STRACE_LINUX_PERF_EVENT_STRUCT_H
+# define STRACE_LINUX_PERF_EVENT_STRUCT_H
-#include <stdint.h>
+# include <stdint.h>
struct perf_event_attr {
uint32_t type;
#include "perf_event_struct.h"
#define XLAT_MACROS_ONLY
-# include "xlat/perf_ioctl_cmds.h"
+#include "xlat/perf_ioctl_cmds.h"
#undef XLAT_MACROS_ONLY
#include "xlat/perf_ioctl_flags.h"
*/
#ifndef STRACE_PRINT_FIELDS_H
-#define STRACE_PRINT_FIELDS_H
+# define STRACE_PRINT_FIELDS_H
/*
* The printf-like function to use in header files
* shared between strace and its tests.
*/
-#ifndef STRACE_PRINTF
-# define STRACE_PRINTF tprintf
-#endif
+# ifndef STRACE_PRINTF
+# define STRACE_PRINTF tprintf
+# endif
-#define PRINT_FIELD_D(prefix_, where_, field_) \
+# define PRINT_FIELD_D(prefix_, where_, field_) \
STRACE_PRINTF("%s%s=%lld", (prefix_), #field_, \
sign_extend_unsigned_to_ll((where_).field_))
-#define PRINT_FIELD_U(prefix_, where_, field_) \
+# define PRINT_FIELD_U(prefix_, where_, field_) \
STRACE_PRINTF("%s%s=%llu", (prefix_), #field_, \
zero_extend_signed_to_ull((where_).field_))
-#define PRINT_FIELD_U_CAST(prefix_, where_, field_, type_) \
+# define PRINT_FIELD_U_CAST(prefix_, where_, field_, type_) \
STRACE_PRINTF("%s%s=%llu", (prefix_), #field_, \
zero_extend_signed_to_ull((type_) (where_).field_))
-#define PRINT_FIELD_X(prefix_, where_, field_) \
+# define PRINT_FIELD_X(prefix_, where_, field_) \
STRACE_PRINTF("%s%s=%#llx", (prefix_), #field_, \
zero_extend_signed_to_ull((where_).field_))
-#define PRINT_FIELD_ADDR(prefix_, where_, field_) \
+# define PRINT_FIELD_ADDR(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printaddr((where_).field_); \
} while (0)
-#define PRINT_FIELD_ADDR64(prefix_, where_, field_) \
+# define PRINT_FIELD_ADDR64(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printaddr64((where_).field_); \
} while (0)
-#define PRINT_FIELD_0X(prefix_, where_, field_) \
+# define PRINT_FIELD_0X(prefix_, where_, field_) \
STRACE_PRINTF("%s%s=%#0*llx", (prefix_), #field_, \
(int) sizeof((where_).field_) * 2, \
zero_extend_signed_to_ull((where_).field_))
-#define PRINT_FIELD_COOKIE(prefix_, where_, field_) \
+# define PRINT_FIELD_COOKIE(prefix_, where_, field_) \
STRACE_PRINTF("%s%s=[%llu, %llu]", (prefix_), #field_, \
zero_extend_signed_to_ull((where_).field_[0]), \
zero_extend_signed_to_ull((where_).field_[1]))
-#define PRINT_FIELD_FLAGS(prefix_, where_, field_, xlat_, dflt_) \
+# define PRINT_FIELD_FLAGS(prefix_, where_, field_, xlat_, dflt_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printflags64((xlat_), \
(dflt_)); \
} while (0)
-#define PRINT_FIELD_XVAL(prefix_, where_, field_, xlat_, dflt_) \
+# define PRINT_FIELD_XVAL(prefix_, where_, field_, xlat_, dflt_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printxval64((xlat_), \
(dflt_)); \
} while (0)
-#define PRINT_FIELD_XVAL_U(prefix_, where_, field_, xlat_, dflt_) \
+# define PRINT_FIELD_XVAL_U(prefix_, where_, field_, xlat_, dflt_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printxvals_ex(zero_extend_signed_to_ull((where_).field_), \
(xlat_), NULL); \
} while (0)
-#define PRINT_FIELD_XVAL_SORTED_SIZED(prefix_, where_, field_, xlat_, \
+# define PRINT_FIELD_XVAL_SORTED_SIZED(prefix_, where_, field_, xlat_, \
xlat_size_, dflt_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
(dflt_)); \
} while (0)
-#define PRINT_FIELD_XVAL_INDEX(prefix_, where_, field_, xlat_, dflt_) \
+# define PRINT_FIELD_XVAL_INDEX(prefix_, where_, field_, xlat_, dflt_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printxval_index((xlat_), \
* Generic "ID" printing. ID is considered unsigned except for the special value
* of -1.
*/
-#define PRINT_FIELD_ID(prefix_, where_, field_) \
+# define PRINT_FIELD_ID(prefix_, where_, field_) \
do { \
if (sign_extend_unsigned_to_ll((where_).field_) == -1LL) \
STRACE_PRINTF("%s%s=-1", (prefix_), #field_); \
zero_extend_signed_to_ull((where_).field_)); \
} while (0)
-#define PRINT_FIELD_UID PRINT_FIELD_ID
+# define PRINT_FIELD_UID PRINT_FIELD_ID
-#define PRINT_FIELD_U64(prefix_, where_, field_) \
+# define PRINT_FIELD_U64(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
if (zero_extend_signed_to_ull((where_).field_) == UINT64_MAX) \
zero_extend_signed_to_ull((where_).field_)); \
} while (0)
-#define PRINT_FIELD_STRING(prefix_, where_, field_, len_, style_) \
+# define PRINT_FIELD_STRING(prefix_, where_, field_, len_, style_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_quoted_string((const char *)(where_).field_, \
(len_), (style_)); \
} while (0)
-#define PRINT_FIELD_CSTRING(prefix_, where_, field_) \
+# define PRINT_FIELD_CSTRING(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_quoted_cstring((const char *) (where_).field_, \
MUST_BE_ARRAY((where_).field_)); \
} while (0)
-#define PRINT_FIELD_CSTRING_SZ(prefix_, where_, field_, size_) \
+# define PRINT_FIELD_CSTRING_SZ(prefix_, where_, field_, size_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_quoted_cstring((const char *) (where_).field_, \
(size_)); \
} while (0)
-#define PRINT_FIELD_HEX_ARRAY(prefix_, where_, field_) \
+# define PRINT_FIELD_HEX_ARRAY(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_quoted_string((const char *)(where_).field_, \
QUOTE_FORCE_HEX); \
} while (0)
-#define PRINT_FIELD_INET_ADDR(prefix_, where_, field_, af_) \
+# define PRINT_FIELD_INET_ADDR(prefix_, where_, field_, af_) \
do { \
STRACE_PRINTF(prefix_); \
print_inet_addr((af_), &(where_).field_, \
sizeof((where_).field_), #field_); \
} while (0)
-#define PRINT_FIELD_INET4_ADDR(prefix_, where_, field_) \
+# define PRINT_FIELD_INET4_ADDR(prefix_, where_, field_) \
STRACE_PRINTF("%s%s=inet_addr(\"%s\")", (prefix_), #field_, \
inet_ntoa((where_).field_))
-#define PRINT_FIELD_AX25_ADDR(prefix_, where_, field_) \
+# define PRINT_FIELD_AX25_ADDR(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_ax25_addr(&(where_).field_); \
} while (0)
-#define PRINT_FIELD_X25_ADDR(prefix_, where_, field_) \
+# define PRINT_FIELD_X25_ADDR(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_x25_addr(&(where_).field_); \
} while (0)
-#define PRINT_FIELD_NET_PORT(prefix_, where_, field_) \
+# define PRINT_FIELD_NET_PORT(prefix_, where_, field_) \
STRACE_PRINTF("%s%s=htons(%u)", (prefix_), #field_, \
ntohs((where_).field_))
-#define PRINT_FIELD_IFINDEX(prefix_, where_, field_) \
+# define PRINT_FIELD_IFINDEX(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_ifindex((where_).field_); \
} while (0)
-#define PRINT_FIELD_SOCKADDR(prefix_, where_, field_) \
+# define PRINT_FIELD_SOCKADDR(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_sockaddr(&(where_).field_, \
sizeof((where_).field_)); \
} while (0)
-#define PRINT_FIELD_DEV(prefix_, where_, field_) \
+# define PRINT_FIELD_DEV(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_dev_t((where_).field_); \
} while (0)
-#define PRINT_FIELD_PTR(prefix_, where_, field_) \
+# define PRINT_FIELD_PTR(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printaddr((mpers_ptr_t) (where_).field_); \
} while (0)
-#define PRINT_FIELD_FD(prefix_, where_, field_, tcp_) \
+# define PRINT_FIELD_FD(prefix_, where_, field_, tcp_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printfd((tcp_), (where_).field_); \
} while (0)
-#define PRINT_FIELD_STRN(prefix_, where_, field_, len_, tcp_) \
+# define PRINT_FIELD_STRN(prefix_, where_, field_, len_, tcp_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printstrn((tcp_), (where_).field_, (len_)); \
} while (0)
-#define PRINT_FIELD_STR(prefix_, where_, field_, tcp_) \
+# define PRINT_FIELD_STR(prefix_, where_, field_, tcp_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printstr((tcp_), (where_).field_); \
} while (0)
-#define PRINT_FIELD_PATH(prefix_, where_, field_, tcp_) \
+# define PRINT_FIELD_PATH(prefix_, where_, field_, tcp_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
printpath((tcp_), (where_).field_); \
} while (0)
-#define PRINT_FIELD_MAC(prefix_, where_, field_) \
+# define PRINT_FIELD_MAC(prefix_, where_, field_) \
PRINT_FIELD_MAC_SZ((prefix_), (where_), field_, \
ARRAY_SIZE((where_).field_))
-#define PRINT_FIELD_MAC_SZ(prefix_, where_, field_, size_) \
+# define PRINT_FIELD_MAC_SZ(prefix_, where_, field_, size_) \
do { \
static_assert(sizeof(((where_).field_)[0]) == 1, \
"MAC address is not a byte array"); \
#ifdef HAVE_SCSI_SG_H
-#include DEF_MPERS_TYPE(struct_sg_req_info)
+# include DEF_MPERS_TYPE(struct_sg_req_info)
# include <scsi/sg.h>
#include "nr_prefix.c"
#ifndef IN_MPERS
-#include "printsiginfo.h"
+# include "printsiginfo.h"
#endif
#include "xlat/audit_arch.h"
*/
#ifndef STRACE_PRINTSIGINFO_H
-#define STRACE_PRINTSIGINFO_H
+# define STRACE_PRINTSIGINFO_H
extern void printsiginfo(const siginfo_t *);
printaddr(addr);
}
-# if defined IA64 || defined SPARC || defined SPARC64
+#if defined IA64 || defined SPARC || defined SPARC64
switch (request) {
-# ifdef IA64
+# ifdef IA64
case PTRACE_PEEKDATA:
case PTRACE_PEEKTEXT:
case PTRACE_PEEKUSER:
/* data is ignored */
return RVAL_DECODED | RVAL_HEX;
-# endif /* IA64 */
-# if defined SPARC || defined SPARC64
+# endif /* IA64 */
+# if defined SPARC || defined SPARC64
case PTRACE_GETREGS:
case PTRACE_SETREGS:
case PTRACE_GETFPREGS:
case PTRACE_SETFPREGS:
/* data is ignored */
return RVAL_DECODED;
-# endif /* SPARC || SPARC64 */
+# endif /* SPARC || SPARC64 */
}
-# endif /* IA64 || SPARC || SPARC64 */
+#endif /* IA64 || SPARC || SPARC64 */
tprints(", ");
*/
#ifndef STRACE_PTRACE_H
-#define STRACE_PTRACE_H
+# define STRACE_PTRACE_H
-#include <stdint.h>
-#include <sys/ptrace.h>
+# include <stdint.h>
+# include <sys/ptrace.h>
-#ifdef HAVE_STRUCT_IA64_FPREG
-# define ia64_fpreg XXX_ia64_fpreg
-#endif
-#ifdef HAVE_STRUCT_PT_ALL_USER_REGS
-# define pt_all_user_regs XXX_pt_all_user_regs
-#endif
-#ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
-# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
-#endif
+# ifdef HAVE_STRUCT_IA64_FPREG
+# define ia64_fpreg XXX_ia64_fpreg
+# endif
+# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
+# define pt_all_user_regs XXX_pt_all_user_regs
+# endif
+# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
+# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
+# endif
-#include <linux/ptrace.h>
+# include <linux/ptrace.h>
-#ifdef HAVE_STRUCT_IA64_FPREG
-# undef ia64_fpreg
-#endif
-#ifdef HAVE_STRUCT_PT_ALL_USER_REGS
-# undef pt_all_user_regs
-#endif
-#ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
-# undef ptrace_peeksiginfo_args
-#endif
+# ifdef HAVE_STRUCT_IA64_FPREG
+# undef ia64_fpreg
+# endif
+# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
+# undef pt_all_user_regs
+# endif
+# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
+# undef ptrace_peeksiginfo_args
+# endif
-#if defined(SPARC) || defined(SPARC64)
+# if defined(SPARC) || defined(SPARC64)
/*
* SPARC has a different PTRACE_DETACH value correctly defined in sys/ptrace.h,
* but linux/ptrace.h clobbers it with the standard one. PTRACE_SUNDETACH is
* also defined to the correct value by sys/ptrace.h, so use that instead.
*/
-# undef PTRACE_DETACH
-# define PTRACE_DETACH PTRACE_SUNDETACH
-#endif
+# undef PTRACE_DETACH
+# define PTRACE_DETACH PTRACE_SUNDETACH
+# endif
-#ifndef PTRACE_EVENT_FORK
-# define PTRACE_EVENT_FORK 1
-#endif
-#ifndef PTRACE_EVENT_VFORK
-# define PTRACE_EVENT_VFORK 2
-#endif
-#ifndef PTRACE_EVENT_CLONE
-# define PTRACE_EVENT_CLONE 3
-#endif
-#ifndef PTRACE_EVENT_EXEC
-# define PTRACE_EVENT_EXEC 4
-#endif
-#ifndef PTRACE_EVENT_VFORK_DONE
-# define PTRACE_EVENT_VFORK_DONE 5
-#endif
-#ifndef PTRACE_EVENT_EXIT
-# define PTRACE_EVENT_EXIT 6
-#endif
-#ifndef PTRACE_EVENT_SECCOMP
-# define PTRACE_EVENT_SECCOMP 7
-#endif
-#ifdef PTRACE_EVENT_STOP
+# ifndef PTRACE_EVENT_FORK
+# define PTRACE_EVENT_FORK 1
+# endif
+# ifndef PTRACE_EVENT_VFORK
+# define PTRACE_EVENT_VFORK 2
+# endif
+# ifndef PTRACE_EVENT_CLONE
+# define PTRACE_EVENT_CLONE 3
+# endif
+# ifndef PTRACE_EVENT_EXEC
+# define PTRACE_EVENT_EXEC 4
+# endif
+# ifndef PTRACE_EVENT_VFORK_DONE
+# define PTRACE_EVENT_VFORK_DONE 5
+# endif
+# ifndef PTRACE_EVENT_EXIT
+# define PTRACE_EVENT_EXIT 6
+# endif
+# ifndef PTRACE_EVENT_SECCOMP
+# define PTRACE_EVENT_SECCOMP 7
+# endif
+# ifdef PTRACE_EVENT_STOP
/* Linux 3.1 - 3.3 releases had a broken value. It was fixed in 3.4. */
-# if PTRACE_EVENT_STOP == 7
-# undef PTRACE_EVENT_STOP
+# if PTRACE_EVENT_STOP == 7
+# undef PTRACE_EVENT_STOP
+# endif
+# endif
+# ifndef PTRACE_EVENT_STOP
+# define PTRACE_EVENT_STOP 128
# endif
-#endif
-#ifndef PTRACE_EVENT_STOP
-# define PTRACE_EVENT_STOP 128
-#endif
-#ifndef PTRACE_O_TRACESYSGOOD
-# define PTRACE_O_TRACESYSGOOD 1
-#endif
-#ifndef PTRACE_O_TRACEFORK
-# define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
-#endif
-#ifndef PTRACE_O_TRACEVFORK
-# define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
-#endif
-#ifndef PTRACE_O_TRACECLONE
-# define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
-#endif
-#ifndef PTRACE_O_TRACEEXEC
-# define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
-#endif
-#ifndef PTRACE_O_TRACEVFORKDONE
-# define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
-#endif
-#ifndef PTRACE_O_TRACEEXIT
-# define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
-#endif
-#ifndef PTRACE_O_TRACESECCOMP
-# define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
-#endif
-#ifndef PTRACE_O_EXITKILL
-# define PTRACE_O_EXITKILL (1 << 20)
-#endif
-#ifndef PTRACE_O_SUSPEND_SECCOMP
-# define PTRACE_O_SUSPEND_SECCOMP (1 << 21)
-#endif
+# ifndef PTRACE_O_TRACESYSGOOD
+# define PTRACE_O_TRACESYSGOOD 1
+# endif
+# ifndef PTRACE_O_TRACEFORK
+# define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
+# endif
+# ifndef PTRACE_O_TRACEVFORK
+# define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
+# endif
+# ifndef PTRACE_O_TRACECLONE
+# define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
+# endif
+# ifndef PTRACE_O_TRACEEXEC
+# define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
+# endif
+# ifndef PTRACE_O_TRACEVFORKDONE
+# define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
+# endif
+# ifndef PTRACE_O_TRACEEXIT
+# define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
+# endif
+# ifndef PTRACE_O_TRACESECCOMP
+# define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
+# endif
+# ifndef PTRACE_O_EXITKILL
+# define PTRACE_O_EXITKILL (1 << 20)
+# endif
+# ifndef PTRACE_O_SUSPEND_SECCOMP
+# define PTRACE_O_SUSPEND_SECCOMP (1 << 21)
+# endif
-#ifndef PTRACE_SETOPTIONS
-# define PTRACE_SETOPTIONS 0x4200
-#endif
-#ifndef PTRACE_GETEVENTMSG
-# define PTRACE_GETEVENTMSG 0x4201
-#endif
-#ifndef PTRACE_GETSIGINFO
-# define PTRACE_GETSIGINFO 0x4202
-#endif
-#ifndef PTRACE_SETSIGINFO
-# define PTRACE_SETSIGINFO 0x4203
-#endif
-#ifndef PTRACE_GETREGSET
-# define PTRACE_GETREGSET 0x4204
-#endif
-#ifndef PTRACE_SETREGSET
-# define PTRACE_SETREGSET 0x4205
-#endif
-#ifndef PTRACE_SEIZE
-# define PTRACE_SEIZE 0x4206
-#endif
-#ifndef PTRACE_INTERRUPT
-# define PTRACE_INTERRUPT 0x4207
-#endif
-#ifndef PTRACE_LISTEN
-# define PTRACE_LISTEN 0x4208
-#endif
-#ifndef PTRACE_PEEKSIGINFO
-# define PTRACE_PEEKSIGINFO 0x4209
-#endif
-#ifndef PTRACE_GETSIGMASK
-# define PTRACE_GETSIGMASK 0x420a
-#endif
-#ifndef PTRACE_SETSIGMASK
-# define PTRACE_SETSIGMASK 0x420b
-#endif
-#ifndef PTRACE_SECCOMP_GET_FILTER
-# define PTRACE_SECCOMP_GET_FILTER 0x420c
-#endif
-#ifndef PTRACE_SECCOMP_GET_METADATA
-# define PTRACE_SECCOMP_GET_METADATA 0x420d
-#endif
-#ifndef PTRACE_GET_SYSCALL_INFO
-# define PTRACE_GET_SYSCALL_INFO 0x420e
-# define PTRACE_SYSCALL_INFO_NONE 0
-# define PTRACE_SYSCALL_INFO_ENTRY 1
-# define PTRACE_SYSCALL_INFO_EXIT 2
-# define PTRACE_SYSCALL_INFO_SECCOMP 3
+# ifndef PTRACE_SETOPTIONS
+# define PTRACE_SETOPTIONS 0x4200
+# endif
+# ifndef PTRACE_GETEVENTMSG
+# define PTRACE_GETEVENTMSG 0x4201
+# endif
+# ifndef PTRACE_GETSIGINFO
+# define PTRACE_GETSIGINFO 0x4202
+# endif
+# ifndef PTRACE_SETSIGINFO
+# define PTRACE_SETSIGINFO 0x4203
+# endif
+# ifndef PTRACE_GETREGSET
+# define PTRACE_GETREGSET 0x4204
+# endif
+# ifndef PTRACE_SETREGSET
+# define PTRACE_SETREGSET 0x4205
+# endif
+# ifndef PTRACE_SEIZE
+# define PTRACE_SEIZE 0x4206
+# endif
+# ifndef PTRACE_INTERRUPT
+# define PTRACE_INTERRUPT 0x4207
+# endif
+# ifndef PTRACE_LISTEN
+# define PTRACE_LISTEN 0x4208
+# endif
+# ifndef PTRACE_PEEKSIGINFO
+# define PTRACE_PEEKSIGINFO 0x4209
+# endif
+# ifndef PTRACE_GETSIGMASK
+# define PTRACE_GETSIGMASK 0x420a
+# endif
+# ifndef PTRACE_SETSIGMASK
+# define PTRACE_SETSIGMASK 0x420b
+# endif
+# ifndef PTRACE_SECCOMP_GET_FILTER
+# define PTRACE_SECCOMP_GET_FILTER 0x420c
+# endif
+# ifndef PTRACE_SECCOMP_GET_METADATA
+# define PTRACE_SECCOMP_GET_METADATA 0x420d
+# endif
+# ifndef PTRACE_GET_SYSCALL_INFO
+# define PTRACE_GET_SYSCALL_INFO 0x420e
+# define PTRACE_SYSCALL_INFO_NONE 0
+# define PTRACE_SYSCALL_INFO_ENTRY 1
+# define PTRACE_SYSCALL_INFO_EXIT 2
+# define PTRACE_SYSCALL_INFO_SECCOMP 3
struct ptrace_syscall_info {
uint8_t op;
uint8_t pad[3];
} seccomp;
};
};
-#endif
+# endif
-#if !HAVE_DECL_PTRACE_PEEKUSER
-# define PTRACE_PEEKUSER PTRACE_PEEKUSR
-#endif
-#if !HAVE_DECL_PTRACE_POKEUSER
-# define PTRACE_POKEUSER PTRACE_POKEUSR
-#endif
+# if !HAVE_DECL_PTRACE_PEEKUSER
+# define PTRACE_PEEKUSER PTRACE_PEEKUSR
+# endif
+# if !HAVE_DECL_PTRACE_POKEUSER
+# define PTRACE_POKEUSER PTRACE_POKEUSR
+# endif
#endif /* !STRACE_PTRACE_H */
*/
#ifndef STRACE_PTRACE_SYSCALL_INFO_H
-#define STRACE_PTRACE_SYSCALL_INFO_H
+# define STRACE_PTRACE_SYSCALL_INFO_H
extern bool ptrace_get_syscall_info_supported;
extern bool test_ptrace_get_syscall_info(void);
#include <linux/random.h>
#define XLAT_MACROS_ONLY
-# include "xlat/random_ioctl_cmds.h"
+#include "xlat/random_ioctl_cmds.h"
#undef XLAT_MACROS_ONLY
/*
*/
#ifndef STRACE_REGS_H
-#define STRACE_REGS_H
+# define STRACE_REGS_H
-#include <sys/user.h>
-#include "arch_regs.h"
+# include <sys/user.h>
+# include "arch_regs.h"
#endif /* !STRACE_REGS_H */
/* retval to index and visa versa. */
#ifndef STRACE_RETVAL_H
-#define STRACE_RETVAL_H
+# define STRACE_RETVAL_H
uint16_t retval_new(kernel_long_t rval);
kernel_long_t retval_get(uint16_t rval_idx);
#include "ptrace.h"
#include "regs.h"
-#define DEF_FUNC_GET_RT_SIGFRAME_ADDR \
+#define DEF_FUNC_GET_RT_SIGFRAME_ADDR \
kernel_ulong_t get_rt_sigframe_addr(struct tcb *tcp)
-#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
+#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
#include "arch_rt_sigframe.c"
PRINT_FIELD_U(", ", st, rx_compressed);
PRINT_FIELD_U(", ", st, tx_compressed);
-#ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER
+# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER
if (len >= def_size)
PRINT_FIELD_U(", ", st, rx_nohandler);
-#endif
+# endif
tprints("}");
}
PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_ucast);
PRINT_FIELD_U(", ", ndtst, ndts_periodic_gc_runs);
PRINT_FIELD_U(", ", ndtst, ndts_forced_gc_runs);
-#ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS
+# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS
if (len >= def_size)
PRINT_FIELD_U(", ", ndtst, ndts_table_fulls);
-#endif
+# endif
tprints("}");
}
#if defined S390 || defined S390X
-#include <sys/user.h>
+# include <sys/user.h>
-#include "print_fields.h"
+# include "print_fields.h"
-#include "xlat/s390_guarded_storage_commands.h"
-#include "xlat/s390_runtime_instr_commands.h"
-#include "xlat/s390_sthyi_function_codes.h"
+# include "xlat/s390_guarded_storage_commands.h"
+# include "xlat/s390_runtime_instr_commands.h"
+# include "xlat/s390_sthyi_function_codes.h"
/*
* Since, for some reason, kernel doesn't expose all these nice constants and
*ascii++ = conv_table[(unsigned char) *ebcdic++];
}
-#define DECODE_EBCDIC(ebcdic_, ascii_) \
+# define DECODE_EBCDIC(ebcdic_, ascii_) \
decode_ebcdic((ebcdic_), (ascii_), \
sizeof(ebcdic_) + MUST_BE_ARRAY(ebcdic_))
-#define PRINT_EBCDIC(ebcdic_) \
+# define PRINT_EBCDIC(ebcdic_) \
do { \
char ascii_str[sizeof(ebcdic_) + MUST_BE_ARRAY(ebcdic_)]; \
\
QUOTE_EMIT_COMMENT); \
} while (0)
-#define PRINT_FIELD_EBCDIC(prefix_, where_, field_) \
+# define PRINT_FIELD_EBCDIC(prefix_, where_, field_) \
do { \
PRINT_FIELD_HEX_ARRAY(prefix_, where_, field_); \
PRINT_EBCDIC((where_).field_); \
} while (0)
-#define PRINT_FIELD_WEIGHT(prefix_, where_, field_) \
+# define PRINT_FIELD_WEIGHT(prefix_, where_, field_) \
do { \
PRINT_FIELD_X(prefix_, where_, field_); \
if ((where_).field_) \
} while (0)
-#define IS_BLANK(arr_) /* 0x40 is space in EBCDIC */ \
+# define IS_BLANK(arr_) /* 0x40 is space in EBCDIC */ \
is_filled(arr_, '\x40', sizeof(arr_) + MUST_BE_ARRAY(arr_))
-#define CHECK_SIZE(hdr_, size_, name_, ...) \
+# define CHECK_SIZE(hdr_, size_, name_, ...) \
do { \
if ((size_) < sizeof(*(hdr_))) { \
tprintf_comment("Invalid " name_ " with size " \
} \
} while (0)
-#define PRINT_UNKNOWN_TAIL(hdr_, size_) \
+# define PRINT_UNKNOWN_TAIL(hdr_, size_) \
do { \
if ((size_) > sizeof(*(hdr_)) && \
!is_filled((char *) ((hdr_) + 1), '\0', \
tprints("}");
}
-#define STHYI_PRINT_STRUCT(l_, name_) \
+# define STHYI_PRINT_STRUCT(l_, name_) \
do { \
if (hdr->inf ##l_## off && hdr->inf ##l_## off + \
hdr->inf ##l_## len <= sizeof(data)) { \
} \
} while (0)
-#define STHYI_PRINT_HV_STRUCT(l_, n_, name_) \
+# define STHYI_PRINT_HV_STRUCT(l_, n_, name_) \
do { \
if (hdr->inf ##l_## off ##n_ && hdr->inf ##l_## off ##n_ + \
hdr->inf ##l_## len ##n_ <= sizeof(data)) { \
*/
#ifndef STRACE_SCHED_ATTR_H
-#define STRACE_SCHED_ATTR_H
+# define STRACE_SCHED_ATTR_H
# include <stdint.h>
#ifdef HAVE_SCSI_SG_H
-#include DEF_MPERS_TYPE(struct_sg_io_hdr)
+# include DEF_MPERS_TYPE(struct_sg_io_hdr)
# include <scsi/sg.h>
}
}
-#define PRINT_FIELD_SG_IO_BUFFER(prefix_, where_, field_, size_, count_, tcp_) \
+# define PRINT_FIELD_SG_IO_BUFFER(prefix_, where_, field_, size_, count_, tcp_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_sg_io_buffer((tcp_), (mpers_ptr_t)((where_).field_), \
}
}
-#define PRINT_FIELD_SG_IO_BUFFER(prefix_, where_, field_, size_, count_, tcp_) \
+# define PRINT_FIELD_SG_IO_BUFFER(prefix_, where_, field_, size_, count_, tcp_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
print_sg_io_buffer((tcp_), (where_).field_, (size_), (count_)); \
*/
#ifndef STRACE_SIGEVENT_H
-#define STRACE_SIGEVENT_H
+# define STRACE_SIGEVENT_H
typedef struct {
union {
memset(&sa, 0, sizeof(sa));
sa.sa_handler__ = sa32.sa_handler__;
sa.sa_flags = sa32.sa_flags;
-#if HAVE_SA_RESTORER && defined SA_RESTORER
+# if HAVE_SA_RESTORER && defined SA_RESTORER
sa.sa_restorer = sa32.sa_restorer;
-#endif
+# endif
/* Kernel treats sa_mask as an array of longs.
* For 32-bit process, "long" is uint32_t, thus, for example,
* 32th bit in sa_mask will end up as bit 0 in sa_mask[1].
#include "xlat/iffflags.h"
#define XLAT_MACROS_ONLY
-# include "xlat/arp_hardware_types.h"
+#include "xlat/arp_hardware_types.h"
#undef XLAT_MACROS_ONLY
static void
#include "xstring.h"
#define XLAT_MACROS_ONLY
-# include "xlat/inet_protocols.h"
+#include "xlat/inet_protocols.h"
#undef XLAT_MACROS_ONLY
typedef struct {
#ifdef BFIN
-#include <bfin_sram.h>
+# include <bfin_sram.h>
-#include "xlat/sram_alloc_flags.h"
+# include "xlat/sram_alloc_flags.h"
SYS_FUNC(sram_alloc)
{
*/
#ifndef STRACE_STAT_H
-#define STRACE_STAT_H
+# define STRACE_STAT_H
struct strace_stat {
unsigned long long dev;
*/
#ifndef STRACE_STATFS_H
-#define STRACE_STATFS_H
+# define STRACE_STATFS_H
struct strace_statfs {
unsigned long long f_type;
*/
#ifndef STRACE_STATIC_ASSERT_H
-#define STRACE_STATIC_ASSERT_H
+# define STRACE_STATIC_ASSERT_H
-#include "assert.h"
+# include "assert.h"
-#if defined HAVE_STATIC_ASSERT
+# if defined HAVE_STATIC_ASSERT
/* static_assert is already available */
-#elif defined HAVE__STATIC_ASSERT
+# elif defined HAVE__STATIC_ASSERT
-# undef static_assert
-# define static_assert _Static_assert
+# undef static_assert
+# define static_assert _Static_assert
-#else /* !HAVE_STATIC_ASSERT && !HAVE__STATIC_ASSERT */
+# else /* !HAVE_STATIC_ASSERT && !HAVE__STATIC_ASSERT */
-# define static_assert(expr, message) \
+# define static_assert(expr, message) \
extern int (*strace_static_assert(int))[sizeof(int[2 * !!(expr) - 1])]
-#endif
+# endif
#endif /* !STRACE_STATIC_ASSERT_H */
*/
#ifndef STRACE_STATX_H
-#define STRACE_STATX_H
+# define STRACE_STATX_H
-#include <stdint.h>
+# include <stdint.h>
typedef struct {
int64_t sec;
#ifndef HAVE_STRERROR
-#if !HAVE_DECL_SYS_ERRLIST
+# if !HAVE_DECL_SYS_ERRLIST
extern int sys_nerr;
extern char *sys_errlist[];
-#endif
+# endif
const char *
strerror(int err_no)
*/
#ifndef STRACE_STRING_TO_UINT_H
-#define STRACE_STRING_TO_UINT_H
+# define STRACE_STRING_TO_UINT_H
-#include <limits.h>
+# include <limits.h>
-#include "kernel_types.h"
+# include "kernel_types.h"
extern long long
string_to_uint_ex(const char *str, char **endptr,
};
const char *const personality_names[] =
-# if defined X86_64
+#if defined X86_64
{"64 bit", "32 bit", "x32"}
-# elif defined X32
+#elif defined X32
{"x32", "32 bit"}
-# elif SUPPORTED_PERSONALITIES == 2
+#elif SUPPORTED_PERSONALITIES == 2
{"64 bit", "32 bit"}
-# else
+#else
{STRINGIFY_VAL(__WORDSIZE) " bit"}
-# endif
+#endif
;
const char *const personality_designators[] =
-# if defined X86_64
+#if defined X86_64
{ "64", "32", "x32" }
-# elif defined X32
+#elif defined X32
{ "x32", "32" }
-# elif SUPPORTED_PERSONALITIES == 2
+#elif SUPPORTED_PERSONALITIES == 2
{ "64", "32" }
-# else
+#else
{ STRINGIFY_VAL(__WORDSIZE) }
-# endif
+#endif
;
#if SUPPORTED_PERSONALITIES > 1
static const int personality_wordsize[SUPPORTED_PERSONALITIES] = {
PERSONALITY0_WORDSIZE,
PERSONALITY1_WORDSIZE,
-# if SUPPORTED_PERSONALITIES > 2
+# if SUPPORTED_PERSONALITIES > 2
PERSONALITY2_WORDSIZE,
-# endif
+# endif
};
# endif
}
#define XLAT_MACROS_ONLY
-# include "xlat/nt_descriptor_types.h"
+#include "xlat/nt_descriptor_types.h"
#undef XLAT_MACROS_ONLY
#define ARCH_MIGHT_USE_SET_REGS 1
*/
#ifndef STRACE_SYSENT_H
-#define STRACE_SYSENT_H
+# define STRACE_SYSENT_H
typedef struct sysent {
unsigned nargs;
const char *sys_name;
} struct_sysent;
-#define TRACE_FILE 00000001 /* Trace file-related syscalls. */
-#define TRACE_IPC 00000002 /* Trace IPC-related syscalls. */
-#define TRACE_NETWORK 00000004 /* Trace network-related syscalls. */
-#define TRACE_PROCESS 00000010 /* Trace process-related syscalls. */
-#define TRACE_SIGNAL 00000020 /* Trace signal-related syscalls. */
-#define TRACE_DESC 00000040 /* Trace file descriptor-related syscalls. */
-#define TRACE_MEMORY 00000100 /* Trace memory mapping-related syscalls. */
-#define SYSCALL_NEVER_FAILS 00000200 /* Syscall is always successful. */
-#define MEMORY_MAPPING_CHANGE 00000400 /* Trigger proc/maps cache updating */
-#define STACKTRACE_CAPTURE_ON_ENTER 00001000 /* Capture stacktrace on "entering" stage */
-#define TRACE_INDIRECT_SUBCALL 00002000 /* Syscall is an indirect socket/ipc subcall. */
-#define COMPAT_SYSCALL_TYPES 00004000 /* A compat syscall that uses compat types. */
-#define TRACE_STAT 00010000 /* Trace {,*_}{,old}{,x}stat{,64} syscalls. */
-#define TRACE_LSTAT 00020000 /* Trace *lstat* syscalls. */
-#define TRACE_STATFS 00040000 /* Trace statfs, statfs64, and statvfs syscalls. */
-#define TRACE_FSTATFS 00100000 /* Trace fstatfs, fstatfs64 and fstatvfs syscalls. */
-#define TRACE_STATFS_LIKE 00200000 /* Trace statfs-like, fstatfs-like and ustat syscalls. */
-#define TRACE_FSTAT 00400000 /* Trace *fstat{,at}{,64} syscalls. */
-#define TRACE_STAT_LIKE 01000000 /* Trace *{,l,f}stat{,x,at}{,64} syscalls. */
-#define TRACE_PURE 02000000 /* Trace getter syscalls with no arguments. */
+# define TRACE_FILE 00000001 /* Trace file-related syscalls. */
+# define TRACE_IPC 00000002 /* Trace IPC-related syscalls. */
+# define TRACE_NETWORK 00000004 /* Trace network-related syscalls. */
+# define TRACE_PROCESS 00000010 /* Trace process-related syscalls. */
+# define TRACE_SIGNAL 00000020 /* Trace signal-related syscalls. */
+# define TRACE_DESC 00000040 /* Trace file descriptor-related syscalls. */
+# define TRACE_MEMORY 00000100 /* Trace memory mapping-related syscalls. */
+# define SYSCALL_NEVER_FAILS 00000200 /* Syscall is always successful. */
+# define MEMORY_MAPPING_CHANGE 00000400 /* Trigger proc/maps cache updating */
+# define STACKTRACE_CAPTURE_ON_ENTER 00001000 /* Capture stacktrace on "entering" stage */
+# define TRACE_INDIRECT_SUBCALL 00002000 /* Syscall is an indirect socket/ipc subcall. */
+# define COMPAT_SYSCALL_TYPES 00004000 /* A compat syscall that uses compat types. */
+# define TRACE_STAT 00010000 /* Trace {,*_}{,old}{,x}stat{,64} syscalls. */
+# define TRACE_LSTAT 00020000 /* Trace *lstat* syscalls. */
+# define TRACE_STATFS 00040000 /* Trace statfs, statfs64, and statvfs syscalls. */
+# define TRACE_FSTATFS 00100000 /* Trace fstatfs, fstatfs64 and fstatvfs syscalls. */
+# define TRACE_STATFS_LIKE 00200000 /* Trace statfs-like, fstatfs-like and ustat syscalls. */
+# define TRACE_FSTAT 00400000 /* Trace *fstat{,at}{,64} syscalls. */
+# define TRACE_STAT_LIKE 01000000 /* Trace *{,l,f}stat{,x,at}{,64} syscalls. */
+# define TRACE_PURE 02000000 /* Trace getter syscalls with no arguments. */
#endif /* !STRACE_SYSENT_H */
#ifdef MIPS
-#ifdef HAVE_LINUX_UTSNAME_H
-# include <linux/utsname.h>
-#endif
-#ifdef HAVE_ASM_SYSMIPS_H
-# include <asm/sysmips.h>
-#endif
-
-#ifndef __NEW_UTS_LEN
-# define __NEW_UTS_LEN 64
-#endif
-
-#include "xlat/sysmips_operations.h"
+# ifdef HAVE_LINUX_UTSNAME_H
+# include <linux/utsname.h>
+# endif
+# ifdef HAVE_ASM_SYSMIPS_H
+# include <asm/sysmips.h>
+# endif
+
+# ifndef __NEW_UTS_LEN
+# define __NEW_UTS_LEN 64
+# endif
+
+# include "xlat/sysmips_operations.h"
SYS_FUNC(sysmips)
{
*/
#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
+# define _GNU_SOURCE 1
#endif
#include <errno.h>
#ifdef __ia64__
extern int __clone2(int (*fn) (void *), void *child_stack_base,
size_t stack_size, int flags, void *arg, ...);
-#define clone2 __clone2
+# define clone2 __clone2
#elif defined(__metag__)
-#define clone2(func, stack_base, size, flags, arg...) \
+# define clone2(func, stack_base, size, flags, arg...) \
clone(func, stack_base, flags, arg)
#else
-#define clone2(func, stack_base, size, flags, arg...) \
+# define clone2(func, stack_base, size, flags, arg...) \
clone(func, (stack_base) + (size), flags, arg)
#endif
/* Direct calls to syscalls, avoiding libc wrappers */
*/
#ifndef _STRACE_TESTS_ACCEPT_COMPAT_H_
-#define _STRACE_TESTS_ACCEPT_COMPAT_H_
+# define _STRACE_TESTS_ACCEPT_COMPAT_H_
-#include <unistd.h>
-#include <sys/socket.h>
-#include <asm/unistd.h>
+# include <unistd.h>
+# include <sys/socket.h>
+# include <asm/unistd.h>
-#if defined __NR_socketcall && defined __sparc__
+# if defined __NR_socketcall && defined __sparc__
/*
* Work around the fact that
* - glibc >= 2.26 uses accept4 syscall to implement accept() call on sparc;
return syscall(__NR_socketcall, 5, args);
}
-#else
-# define do_accept accept
-#endif
+# else
+# define do_accept accept
+# endif
#endif /* !_STRACE_TESTS_ACCEPT_COMPAT_H_ */
* This has to be a macro, otherwise the compiler complains that
* initializer element is not constant.
*/
- #define MAP_INFO_SZ (sizeof(*map_info) + 64)
+#define MAP_INFO_SZ (sizeof(*map_info) + 64)
struct bpf_map_info_struct *map_info = calloc(1, MAP_INFO_SZ);
struct BPF_OBJ_GET_INFO_BY_FD_struct bpf_map_get_info_attr = {
.bpf_fd = map_fd,
* This has to be a macro, otherwise the compiler complains that
* initializer element is not constant.
*/
- #define PROG_INFO_SZ (sizeof(*prog_info) + 64)
+# define PROG_INFO_SZ (sizeof(*prog_info) + 64)
struct bpf_prog_info_struct *prog_info = calloc(1, PROG_INFO_SZ);
struct bpf_insn *xlated_prog = tail_alloc(sizeof(*xlated_prog) * 42);
uint32_t *map_ids = tail_alloc(sizeof(*map_ids) * 2);
#ifdef HAVE_LINUX_BTRFS_H
-#include <errno.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <limits.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/sysmacros.h>
-#include <sys/vfs.h>
-#include <linux/fs.h>
-#include <linux/btrfs.h>
-#include <linux/magic.h>
-#include "xlat.h"
-
-#include "xlat/btrfs_balance_args.h"
-#include "xlat/btrfs_balance_flags.h"
-#include "xlat/btrfs_balance_state.h"
-#include "xlat/btrfs_compress_types.h"
-#include "xlat/btrfs_cont_reading_from_srcdev_mode.h"
-#include "xlat/btrfs_defrag_flags.h"
-#include "xlat/btrfs_dev_stats_values.h"
-#include "xlat/btrfs_dev_stats_flags.h"
-#include "xlat/btrfs_qgroup_inherit_flags.h"
-#include "xlat/btrfs_qgroup_limit_flags.h"
-#include "xlat/btrfs_scrub_flags.h"
-#include "xlat/btrfs_send_flags.h"
-#include "xlat/btrfs_space_info_flags.h"
-#include "xlat/btrfs_snap_flags_v2.h"
-#include "xlat/btrfs_tree_objectids.h"
-#include "xlat/btrfs_features_compat.h"
-#include "xlat/btrfs_features_compat_ro.h"
-#include "xlat/btrfs_features_incompat.h"
-#include "xlat/btrfs_key_types.h"
-
-#ifdef HAVE_LINUX_FIEMAP_H
-# include <linux/fiemap.h>
-# include "xlat/fiemap_flags.h"
-# include "xlat/fiemap_extent_flags.h"
-#endif
-
-#ifndef BTRFS_LABEL_SIZE
-# define BTRFS_LABEL_SIZE 256
-#endif
-
-#ifndef BTRFS_NAME_LEN
-# define BTRFS_NAME_LEN 255
-#endif
-
-#ifndef FS_IOC_GETFSLABEL
-# define FS_IOC_GETFSLABEL BTRFS_IOC_GET_FSLABEL
-#endif
-
-#ifndef FS_IOC_SETFSLABEL
-# define FS_IOC_SETFSLABEL BTRFS_IOC_SET_FSLABEL
-#endif
+# include <errno.h>
+# include <fcntl.h>
+# include <inttypes.h>
+# include <limits.h>
+# include <stdint.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <unistd.h>
+# include <sys/ioctl.h>
+# include <sys/stat.h>
+# include <sys/sysmacros.h>
+# include <sys/vfs.h>
+# include <linux/fs.h>
+# include <linux/btrfs.h>
+# include <linux/magic.h>
+# include "xlat.h"
+
+# include "xlat/btrfs_balance_args.h"
+# include "xlat/btrfs_balance_flags.h"
+# include "xlat/btrfs_balance_state.h"
+# include "xlat/btrfs_compress_types.h"
+# include "xlat/btrfs_cont_reading_from_srcdev_mode.h"
+# include "xlat/btrfs_defrag_flags.h"
+# include "xlat/btrfs_dev_stats_values.h"
+# include "xlat/btrfs_dev_stats_flags.h"
+# include "xlat/btrfs_qgroup_inherit_flags.h"
+# include "xlat/btrfs_qgroup_limit_flags.h"
+# include "xlat/btrfs_scrub_flags.h"
+# include "xlat/btrfs_send_flags.h"
+# include "xlat/btrfs_space_info_flags.h"
+# include "xlat/btrfs_snap_flags_v2.h"
+# include "xlat/btrfs_tree_objectids.h"
+# include "xlat/btrfs_features_compat.h"
+# include "xlat/btrfs_features_compat_ro.h"
+# include "xlat/btrfs_features_incompat.h"
+# include "xlat/btrfs_key_types.h"
+
+# ifdef HAVE_LINUX_FIEMAP_H
+# include <linux/fiemap.h>
+# include "xlat/fiemap_flags.h"
+# include "xlat/fiemap_extent_flags.h"
+# endif
+
+# ifndef BTRFS_LABEL_SIZE
+# define BTRFS_LABEL_SIZE 256
+# endif
+
+# ifndef BTRFS_NAME_LEN
+# define BTRFS_NAME_LEN 255
+# endif
+
+# ifndef FS_IOC_GETFSLABEL
+# define FS_IOC_GETFSLABEL BTRFS_IOC_GET_FSLABEL
+# endif
+
+# ifndef FS_IOC_SETFSLABEL
+# define FS_IOC_SETFSLABEL BTRFS_IOC_SET_FSLABEL
+# endif
/*
* Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in
const char uuid_reference_string[] = "01234567-89ab-cdef-fedc-ba9876543210";
-#ifndef BTRFS_IOC_QUOTA_RESCAN
+# ifndef BTRFS_IOC_QUOTA_RESCAN
struct btrfs_ioctl_quota_rescan_args {
uint64_t flags, progress, reserved[6];
};
-# define BTRFS_IOC_QUOTA_RESCAN \
+# define BTRFS_IOC_QUOTA_RESCAN \
_IOW(BTRFS_IOCTL_MAGIC, 44, struct btrfs_ioctl_quota_rescan_args)
-# define BTRFS_IOC_QUOTA_RESCAN_STATUS \
+# define BTRFS_IOC_QUOTA_RESCAN_STATUS \
_IOR(BTRFS_IOCTL_MAGIC, 45, struct btrfs_ioctl_quota_rescan_args)
-#endif
+# endif
-#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT
-# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
-#endif
+# ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT
+# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
+# endif
-#ifndef BTRFS_IOC_GET_FEATURES
-# define BTRFS_IOC_GET_FEATURES \
+# ifndef BTRFS_IOC_GET_FEATURES
+# define BTRFS_IOC_GET_FEATURES \
_IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags)
-# define BTRFS_IOC_SET_FEATURES \
+# define BTRFS_IOC_SET_FEATURES \
_IOW(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[2])
-# define BTRFS_IOC_GET_SUPPORTED_FEATURES \
+# define BTRFS_IOC_GET_SUPPORTED_FEATURES \
_IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[3])
-#endif
+# endif
-#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS
+# ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS
struct btrfs_ioctl_feature_flags {
uint64_t compat_flags;
uint64_t compat_ro_flags;
uint64_t incompat_flags;
};
-#endif
+# endif
-#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START
+# ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START
struct btrfs_ioctl_defrag_range_args {
uint64_t start;
uint64_t len;
uint32_t compress_type;
uint32_t unused[4];
};
-#endif
+# endif
-#ifndef FIDEDUPERANGE
-# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range)
+# ifndef FIDEDUPERANGE
+# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range)
struct file_dedupe_range_info {
int64_t dest_fd; /* in - destination file */
uint64_t dest_offset; /* in - start of extent in destination */
uint32_t reserved2; /* must be zero */
struct file_dedupe_range_info info[0];
};
-#endif
+# endif
-#ifndef BTRFS_IOC_TREE_SEARCH_V2
-# define BTRFS_IOC_TREE_SEARCH_V2 \
+# ifndef BTRFS_IOC_TREE_SEARCH_V2
+# define BTRFS_IOC_TREE_SEARCH_V2 \
_IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args_v2)
struct btrfs_ioctl_search_args_v2 {
struct btrfs_ioctl_search_key key; /* in/out - search parameters */
* to store item */
uint64_t buf[0]; /* out - found items */
};
-#endif
+# endif
static const char *
return devid;
}
-#define ioc(x_) sprint_xlat_(x_, #x_)
+# define ioc(x_) sprint_xlat_(x_, #x_)
void
prfl_btrfs(const struct xlat *xlat, const unsigned long long val,
args.dest_offset);
}
-#define BTRFS_COMPRESS_TYPES 2
-#define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1)
+# define BTRFS_COMPRESS_TYPES 2
+# define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1)
static void
btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args,
.fspath = 0,
};
-#ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS
+# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS
args.flags =
-#else
+# else
args.reserved[3] =
-#endif
+# endif
0xdeadc0defacefeeeULL;
args.fspath = (uintptr_t) buf;
args.reserved[0] = 0;
args.reserved[2] = 0;
-#ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS
+# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS
args.flags =
-#else
+# else
args.reserved[3] =
-#endif
+# endif
1;
ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args);
args.fspath);
args.reserved[1] = 0;
-#ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS
+# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS
args.flags =
-#else
+# else
args.reserved[3] =
-#endif
+# endif
0;
ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args);
"}) = -1 EBADF (%m)\n",
ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size, args.fspath);
-#ifdef HAVE_LINUX_FIEMAP_H
+# ifdef HAVE_LINUX_FIEMAP_H
if (btrfs_test_root) {
int size;
struct stat si;
close(fd);
free(fiemap);
}
-#endif /* HAVE_LINUX_FIEMAP_H */
+# endif /* HAVE_LINUX_FIEMAP_H */
}
/*
static void
btrfs_test_extent_same_ioctl(void)
{
-#ifdef BTRFS_IOC_FILE_EXTENT_SAME
+# ifdef BTRFS_IOC_FILE_EXTENT_SAME
struct file_dedupe_range args = {
.src_offset = 1024,
.src_length = 10240,
close(fd2);
}
free(argsp);
-#endif /* BTRFS_IOC_FILE_EXTENT_SAME */
+# endif /* BTRFS_IOC_FILE_EXTENT_SAME */
}
static void
#if defined __NR_chmod
-#include <fcntl.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
+# include <fcntl.h>
+# include <stdio.h>
+# include <unistd.h>
+# include <errno.h>
int
main(void)
syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100);
printf("execveat(AT_FDCWD, \"%s\""
", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ... /* %p */]"
-#if VERBOSE
+# if VERBOSE
", [\"%s\", \"%s\", %p, %p, %p, ... /* %p */]"
-#else
+# else
", %p /* 5 vars, unterminated */"
-#endif
+# endif
", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n",
Q_FILENAME, q_argv[0], q_argv[1], q_argv[2],
argv[3], argv[4], argv[5], (char *) tail_argv + sizeof(argv),
-#if VERBOSE
+# if VERBOSE
q_envp[0], q_envp[1], envp[2], envp[3], envp[4],
(char *) tail_envp + sizeof(envp),
-#else
+# else
tail_envp,
-#endif
+# endif
errno2name());
tail_argv[ARRAY_SIZE(q_argv)] = NULL;
syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100);
printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]"
-#if VERBOSE
+# if VERBOSE
", [\"%s\", \"%s\"]"
-#else
+# else
", %p /* 2 vars */"
-#endif
+# endif
", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n",
Q_FILENAME, q_argv[0], q_argv[1], q_argv[2],
-#if VERBOSE
+# if VERBOSE
q_envp[0], q_envp[1],
-#else
+# else
tail_envp,
-#endif
+# endif
errno2name());
syscall(__NR_execveat, -100, FILENAME, tail_argv + 2, tail_envp + 1, 0x1100);
printf("execveat(AT_FDCWD, \"%s\", [\"%s\"]"
-#if VERBOSE
+# if VERBOSE
", [\"%s\"]"
-#else
+# else
", %p /* 1 var */"
-#endif
+# endif
", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n",
Q_FILENAME, q_argv[2],
-#if VERBOSE
+# if VERBOSE
q_envp[1],
-#else
+# else
tail_envp + 1,
-#endif
+# endif
errno2name());
TAIL_ALLOC_OBJECT_CONST_PTR(char *, empty);
syscall(__NR_execveat, -100, FILENAME, empty, empty, 0x1100);
printf("execveat(AT_FDCWD, \"%s\", []"
-#if VERBOSE
+# if VERBOSE
", []"
-#else
+# else
", %p /* 0 vars */"
-#endif
+# endif
", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n",
Q_FILENAME,
-#if !VERBOSE
+# if !VERBOSE
empty,
-#endif
+# endif
errno2name());
char *const str_a = tail_alloc(DEFAULT_STRLEN + 2);
printf("execveat(AT_FDCWD, \"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]);
for (i = 1; i < DEFAULT_STRLEN; ++i)
printf(", \"%s\"", a[i]);
-#if VERBOSE
+# if VERBOSE
printf(", \"%s\"", a[i]);
-#else
+# else
printf(", ...");
-#endif
-#if VERBOSE
+# endif
+# if VERBOSE
printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]);
for (i = 1; i <= DEFAULT_STRLEN; ++i)
printf(", \"%s\"", b[i]);
printf("]");
-#else
+# else
printf("], %p /* %u vars */", b, DEFAULT_STRLEN + 1);
-#endif
+# endif
printf(", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n",
errno2name());
printf("execveat(AT_FDCWD, \"%s\", [\"%s\"", Q_FILENAME, a[1]);
for (i = 2; i <= DEFAULT_STRLEN; ++i)
printf(", \"%s\"", a[i]);
-#if VERBOSE
+# if VERBOSE
printf("], [\"%s\"", b[1]);
for (i = 2; i <= DEFAULT_STRLEN; ++i)
printf(", \"%s\"", b[i]);
printf("]");
-#else
+# else
printf("], %p /* %d vars */", b + 1, DEFAULT_STRLEN);
-#endif
+# endif
printf(", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n",
errno2name());
*/
#ifndef STRACE_TESTS_FADVISE_H
-#define STRACE_TESTS_FADVISE_H
+# define STRACE_TESTS_FADVISE_H
# include <limits.h>
# include <stdio.h>
# include <unistd.h>
# include <sys/fanotify.h>
-#if XLAT_RAW
-# define str_fan_mark_add "0x1"
-# define str_fan_modify_ondir "0x40000002"
-# define str_at_fdcwd "-100"
-#elif XLAT_VERBOSE
-# define str_fan_mark_add "0x1 /* FAN_MARK_ADD */"
-# define str_fan_modify_ondir "0x40000002 /* FAN_MODIFY|FAN_ONDIR */"
-# define str_at_fdcwd "-100 /* AT_FDCWD */"
-#else
-# define str_fan_mark_add "FAN_MARK_ADD"
-# define str_fan_modify_ondir "FAN_MODIFY|FAN_ONDIR"
-# define str_at_fdcwd "AT_FDCWD"
-#endif
+# if XLAT_RAW
+# define str_fan_mark_add "0x1"
+# define str_fan_modify_ondir "0x40000002"
+# define str_at_fdcwd "-100"
+# elif XLAT_VERBOSE
+# define str_fan_mark_add "0x1 /* FAN_MARK_ADD */"
+# define str_fan_modify_ondir "0x40000002 /* FAN_MODIFY|FAN_ONDIR */"
+# define str_at_fdcwd "-100 /* AT_FDCWD */"
+# else
+# define str_fan_mark_add "FAN_MARK_ADD"
+# define str_fan_modify_ondir "FAN_MODIFY|FAN_ONDIR"
+# define str_at_fdcwd "AT_FDCWD"
+# endif
/* Performs fanotify_mark call via the syscall interface. */
static void
const char *str;
};
-#define STR16 "0123456789abcdef"
-#define STR64 STR16 STR16 STR16 STR16
+# define STR16 "0123456789abcdef"
+# define STR64 STR16 STR16 STR16 STR16
int
main(void)
{ F8ILL_KULONG_MASK, "0" },
{ (kernel_ulong_t) 0xdec0deddefaced00ULL,
"0xefaced00"
-#if !XLAT_RAW
+# if !XLAT_RAW
" /* FAN_MARK_??? */"
-#endif
+# endif
},
{ (kernel_ulong_t) 0xda7a105700000040ULL,
-#if XLAT_RAW
+# if XLAT_RAW
"0x40"
-#elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
"0x40 /* FAN_MARK_IGNORED_SURV_MODIFY */"
-#else
+# else
"FAN_MARK_IGNORED_SURV_MODIFY"
-#endif
+# endif
},
{ (kernel_ulong_t) 0xbadc0deddeadfeedULL,
-#if XLAT_RAW || XLAT_VERBOSE
+# if XLAT_RAW || XLAT_VERBOSE
"0xdeadfeed"
-#endif
-#if XLAT_VERBOSE
+# endif
+# if XLAT_VERBOSE
" /* "
-#endif
-#if !XLAT_RAW
+# endif
+# if !XLAT_RAW
"FAN_MARK_ADD|FAN_MARK_DONT_FOLLOW|FAN_MARK_ONLYDIR|"
"FAN_MARK_IGNORED_MASK|FAN_MARK_IGNORED_SURV_MODIFY|"
"FAN_MARK_FLUSH|0xdeadfe00"
-#endif
-#if XLAT_VERBOSE
+# endif
+# if XLAT_VERBOSE
" */"
-#endif
+# endif
},
};
static const struct strval64 masks[] = {
{ ARG_ULL_STR(0) },
{ 0xdeadfeedfacebeefULL,
-#if XLAT_RAW || XLAT_VERBOSE
+# if XLAT_RAW || XLAT_VERBOSE
"0xdeadfeedfacebeef"
-#endif
-#if XLAT_VERBOSE
+# endif
+# if XLAT_VERBOSE
" /* "
-#endif
-#if !XLAT_RAW
+# endif
+# if !XLAT_RAW
"FAN_ACCESS|FAN_MODIFY|FAN_CLOSE_WRITE|FAN_OPEN|"
"FAN_ACCESS_PERM|FAN_ONDIR|FAN_EVENT_ON_CHILD|"
"0xdeadfeedb2ccbec4"
-#endif
-#if XLAT_VERBOSE
+# endif
+# if XLAT_VERBOSE
" */"
-#endif
+# endif
},
{ ARG_ULL_STR(0xffffffffb7fcbfc4)
-#if !XLAT_RAW
+# if !XLAT_RAW
" /* FAN_??? */"
-#endif
+# endif
},
};
static const struct strval dirfds[] = {
{ (kernel_ulong_t) 0xfacefeed00000001ULL, "1" },
{ (kernel_ulong_t) 0xdec0ded0ffffffffULL,
-#if XLAT_RAW
+# if XLAT_RAW
"-1"
-#elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
"-1 /* FAN_NOFD */"
-#else
+# else
"FAN_NOFD"
-#endif
+# endif
},
{ (kernel_ulong_t) 0xbadfacedffffff9cULL, str_at_fdcwd },
{ (kernel_ulong_t) 0xdefaced1beeff00dULL, "-1091571699" },
TEST_SYSCALL_STR, name, &fl, errstr);
}
-#define TEST_FLOCK64_UNDECODED(cmd) test_flock64_undecoded(cmd, #cmd)
+# define TEST_FLOCK64_UNDECODED(cmd) test_flock64_undecoded(cmd, #cmd)
static void
test_flock64_lk64(void)
const char *str;
};
-#define STR16 "0123456789abcdef"
-#define STR64 STR16 STR16 STR16 STR16
+# define STR16 "0123456789abcdef"
+# define STR64 STR16 STR16 STR16 STR16
int
main(void)
# include <stdio.h>
# include <unistd.h>
-#define MAX_STRLEN 32
+# define MAX_STRLEN 32
static long ngroups;
static void
# include <sys/socket.h>
# include <arpa/inet.h>
-#define multi4addr "224.0.0.3"
-#define multi6addr "ff01::c"
+# define multi4addr "224.0.0.3"
+# define multi6addr "ff01::c"
static const char *errstr;
*/
#ifndef STRACE_TESTS_INIT_DELETE_MODULE_H
-#define STRACE_TESTS_INIT_DELETE_MODULE_H
+# define STRACE_TESTS_INIT_DELETE_MODULE_H
# include <stdbool.h>
# include <stdio.h>
{
uint64_t data = 0;
-#ifndef POWERPC
+# ifndef POWERPC
struct termios tty;
(void) ioctl(-1, TCGETS, &tty);
printf("ioctl(-1, TCGETS, %p)"
" = -1 EBADF (%m)\n", &tty);
-#endif
+# endif
(void) ioctl(-1, MMTIMER_GETRES, &data);
printf("ioctl(-1, MMTIMER_GETRES, %p)"
# define ALIGNED_OFFSET(t_, m_) \
ALIGNED_SIZE(offsetof(t_, m_), t_)
-# ifndef DM_DEV_ARM_POLL
-# define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, 0x10, struct dm_ioctl)
-# endif
+# ifndef DM_DEV_ARM_POLL
+# define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, 0x10, struct dm_ioctl)
+# endif
static const char str129[] = STR32 STR32 STR32 STR32 "6";
# endif /* VERBOSE */
printf("}) = %s\n", errstr);
- #define FILL_DM_TARGET(id, id_next) \
+# define FILL_DM_TARGET(id, id_next) \
do { \
init_dm_target_spec(&dm_arg_open3->target##id, id); \
dm_arg_open3->target##id.next = \
memcpy(dm_arg_open3->param##id, str129 + id * 2, id); \
dm_arg_open3->param##id[id] = '\0'; \
} while (0)
- #define PRINT_DM_TARGET(id) \
+# define PRINT_DM_TARGET(id) \
do { \
print_dm_target_spec(&dm_arg_open3->target##id, id); \
printf("\"%.*s\"}, ", id, str129 + id * 2); \
ioctl(-1, EVIOCSFF, ffe);
print_ffe_common(ffe, "FF_CONSTANT");
-# if VERBOSE
+# if VERBOSE
printf(", constant={level=%hd", ffe->u.constant.level);
print_envelope(&ffe->u.constant.envelope);
printf("}");
-# else
+# else
printf("...");
-# endif
+# endif
errno = EBADF;
printf("}) = -1 EBADF (%m)\n");
-# if VERBOSE
+# if VERBOSE
ffe->type = FF_RAMP;
ioctl(-1, EVIOCSFF, ffe);
print_ffe_common(ffe, "FF_RAMP");
print_ffe_common(ffe, "0xff /* FF_??? */");
errno = EBADF;
printf("}) = -1 EBADF (%m)\n");
-# endif
+# endif
ioctl(-1, _IOC(_IOC_READ, 0x45, 0x1, 0xff), lmagic);
printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n",
# define KVM_MAX_CPUID_ENTRIES 80
# endif
-#include "xlat.h"
-#include "xlat/kvm_cpuid_flags.h"
+# include "xlat.h"
+# include "xlat/kvm_cpuid_flags.h"
static int
kvm_ioctl(int fd, unsigned long cmd, const char *cmd_str, void *arg)
return rc;
}
-#define KVM_IOCTL(fd_, cmd_, arg_) \
+# define KVM_IOCTL(fd_, cmd_, arg_) \
kvm_ioctl((fd_), (cmd_), #cmd_, (arg_))
static const char dev[] = "/dev/kvm";
{
printf("{cs=");
print_kvm_segment(&sregs->cs);
-#if VERBOSE
+# if VERBOSE
printf(", ds=");
print_kvm_segment(&sregs->ds);
printf(", es=");
printf("%#jx", (uintmax_t) sregs->interrupt_bitmap[i]);
}
printf("]");
-#else
+# else
printf(", ...");
-#endif
+# endif
printf("}");
}
print_kvm_regs(const struct kvm_regs *regs)
{
printf("{rax=%#jx", (uintmax_t) regs->rax);
-#if VERBOSE
+# if VERBOSE
printf(", rbx=%#jx, rcx=%#jx, rdx=%#jx, rsi=%#jx, rdi=%#jx",
(uintmax_t) regs->rbx, (uintmax_t) regs->rcx,
(uintmax_t) regs->rdx, (uintmax_t) regs->rsi,
(uintmax_t) regs->rdi);
-#else
+# else
printf(", ...");
-#endif
+# endif
printf(", rsp=%#jx, rbp=%#jx", (uintmax_t) regs->rsp,
(uintmax_t) regs->rbp);
-#if VERBOSE
+# if VERBOSE
printf(", r8=%#jx, r9=%#jx, r10=%#jx, r11=%#jx, r12=%#jx, r13=%#jx"
", r14=%#jx, r15=%#jx",
(uintmax_t) regs->r8, (uintmax_t) regs->r9,
(uintmax_t) regs->r10, (uintmax_t) regs->r11,
(uintmax_t) regs->r12, (uintmax_t) regs->r13,
(uintmax_t) regs->r14, (uintmax_t) regs->r15);
-#else
+# else
printf(", ...");
-#endif
+# endif
printf(", rip=%#jx, rflags=%#jx}", (uintmax_t) regs->rip,
(uintmax_t) regs->rflags);
}
{
printf("ioctl(%d<%s>, %s, {nent=%u, entries=[",
fd, fd_dev, ioctl_name, cpuid->nent);
-#if VERBOSE
+# if VERBOSE
for (size_t i = 0; i < cpuid->nent; i++) {
if (i)
printf(", ");
cpuid->entries[i].eax, cpuid->entries[i].ebx,
cpuid->entries[i].ecx, cpuid->entries[i].edx);
}
-#else
+# else
if (cpuid->nent)
printf("...");
-#endif
+# endif
printf("]}) = 0\n");
}
* "anon_inode:kvm-vcpu:0" -> "anon_inode:kvm-vcpu"
*/
vcpu_dev[strlen (vcpu_dev) - 2] = '\0';
-#ifdef KVM_NO_CPUID_CALLBACK
+# ifdef KVM_NO_CPUID_CALLBACK
KVM_NO_CPUID_CALLBACK;
-#endif
+# endif
}
printf("ioctl(%d<%s>, KVM_CREATE_VCPU, 0) = %d<%s>\n",
#include "print_fields.h"
#define XLAT_MACROS_ONLY
-# include "xlat/loop_cmds.h"
+#include "xlat/loop_cmds.h"
#undef XLAT_MACROS_ONLY
#ifndef ABBREV
#include <linux/nbd.h>
#define XLAT_MACROS_ONLY
-# include "xlat/nbd_ioctl_cmds.h"
-# include "xlat/nbd_ioctl_flags.h"
+#include "xlat/nbd_ioctl_cmds.h"
+#include "xlat/nbd_ioctl_flags.h"
#undef XLAT_MACROS_ONLY
#define RVAL_EBADF " = -1 EBADF (%m)\n"
# endif
# define XLAT_MACROS_ONLY
-# include "xlat/perf_ioctl_cmds.h"
+# include "xlat/perf_ioctl_cmds.h"
# undef XLAT_MACROS_ONLY
# define STR16 "0123456789abcdef"
#ifdef HAVE_STRUCT_PTP_SYS_OFFSET
-#include <errno.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <linux/ptp_clock.h>
-
-#include "xlat.h"
-#include "xlat/ptp_flags_options.h"
+# include <errno.h>
+# include <fcntl.h>
+# include <inttypes.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <unistd.h>
+# include <sys/ioctl.h>
+# include <linux/ptp_clock.h>
+
+# include "xlat.h"
+# include "xlat/ptp_flags_options.h"
static void
test_no_device(void)
#include <linux/random.h>
#define XLAT_MACROS_ONLY
-# include "xlat/random_ioctl_cmds.h"
+#include "xlat/random_ioctl_cmds.h"
#undef XLAT_MACROS_ONLY
#define RVAL_EBADF " = -1 EBADF (%m)\n"
# include <linux/ioctl.h>
# include <linux/userfaultfd.h>
-#include "xlat.h"
-#include "xlat/uffd_api_features.h"
+# include "xlat.h"
+# include "xlat/uffd_api_features.h"
int
main(void)
errno = saved_errno;
printf(
-#ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
+# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
", buffersize=%u"
-#endif
+# endif
"}}) = -1 EBADF (%m)\n"
-#ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
+# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
, f->fmt.sdr.buffersize
-#endif
+# endif
);
break;
#endif
struct v4l2_queryctrl *const p_v4l2_queryctrl =
page_end - sizeof(*p_v4l2_queryctrl);
ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl);
-# ifdef V4L2_CTRL_FLAG_NEXT_CTRL
+#ifdef V4L2_CTRL_FLAG_NEXT_CTRL
printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL"
"|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n",
p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL);
-# else
+#else
printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})"
" = -1 EBADF (%m)\n", p_v4l2_queryctrl->id);
-# endif
+#endif
TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_queryctrl, p_queryctrl);
p_queryctrl->id = V4L2_CID_SATURATION;
# include <arpa/inet.h>
# include <net/if.h>
-#define multi4addr "224.0.0.3"
-#define multi6addr "ff01::c"
-#define interface "127.0.0.1"
+# define multi4addr "224.0.0.3"
+# define multi6addr "ff01::c"
+# define interface "127.0.0.1"
int
main(void)
* musl sets size to SIZE_MAX if size argument is greater than
* PTRDIFF_MAX - musl/src/ipc/shmget.c
*/
- #ifdef __GLIBC__
+#ifdef __GLIBC__
(size_t) 0xdec0ded1dec0ded2ULL;
- #else
+#else
(size_t) 0x1e55c0de5dec0dedULL;
- #endif
+#endif
static const unsigned int bogus_ipc_shm_flags =
IPC_CREAT | IPC_EXCL | SHM_HUGETLB | SHM_NORESERVE;
static const unsigned int huge_mask = SHM_HUGE_MASK << SHM_HUGE_SHIFT;
const char *str;
};
-#define CMDLINE_STR "deadcodebaddatadefaced"
+# define CMDLINE_STR "deadcodebaddatadefaced"
int
main(void)
/* From ioctl_dm.c */
# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345"
-#if XLAT_RAW
-# define XARG_STR(v_) (v_), STRINGIFY(v_)
-#elif XLAT_VERBOSE
-# define XARG_STR(v_) (v_), STRINGIFY(v_) " /* " #v_ " */"
-#else
-# define XARG_STR ARG_STR
-#endif
+# if XLAT_RAW
+# define XARG_STR(v_) (v_), STRINGIFY(v_)
+# elif XLAT_VERBOSE
+# define XARG_STR(v_) (v_), STRINGIFY(v_) " /* " #v_ " */"
+# else
+# define XARG_STR ARG_STR
+# endif
/*
* When this is called with positive size, the buffer provided is an "out"
long rc = syscall(__NR_keyctl, cmd, args[0], args[1], args[2], args[3]);
const char *errstr = sprintrc(rc);
-#if XLAT_RAW
+# if XLAT_RAW
printf("keyctl(%#x", (unsigned) cmd);
-#elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
printf("keyctl(%#x /* %s */", (unsigned) cmd, cmd_str);
-#else
+# else
printf("keyctl(%s", cmd_str);
-#endif
+# endif
for (i = 0; i < cnt; i++) {
printf(", ");
print_arg(args[i], arg_str[i], arg_fmt[i], arg_sz[i], rc);
.base = 3141592653U
};
static const char *kcdhp_str = "{private="
-#if XLAT_RAW || XLAT_VERBOSE
+# if XLAT_RAW || XLAT_VERBOSE
"-6"
-#endif
-#if XLAT_VERBOSE
+# endif
+# if XLAT_VERBOSE
" /* "
-#endif
-#if !XLAT_RAW
+# endif
+# if !XLAT_RAW
"KEY_SPEC_GROUP_KEYRING"
-#endif
-#if XLAT_VERBOSE
+# endif
+# if XLAT_VERBOSE
" */"
-#endif
+# endif
", prime=1234567890, base=-1153374643}";
/*
/* Invalid command */
do_keyctl((kernel_ulong_t) 0xbadc0dedfacefeedULL,
-#if XLAT_VERBOSE
+# if XLAT_VERBOSE
"KEYCTL_???"
-#else
+# else
"0xfacefeed"
-# if !XLAT_RAW
+# if !XLAT_RAW
" /* KEYCTL_??? */"
+# endif
# endif
-#endif
,
sizeof(kernel_ulong_t),
(kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL,
do_keyctl(ARG_STR(KEYCTL_SETPERM),
sizeof(int32_t), XARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL,
sizeof(uint32_t), 0xffffffffU,
-#if XLAT_RAW || XLAT_VERBOSE
+# if XLAT_RAW || XLAT_VERBOSE
"0xffffffff"
-#endif
-#if XLAT_VERBOSE
+# endif
+# if XLAT_VERBOSE
" /* "
-#endif
-#if !XLAT_RAW
+# endif
+# if !XLAT_RAW
"KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|"
"KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|"
"KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|"
"KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|"
"KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|"
"0xc0c0c0c0"
-#endif
-#if XLAT_VERBOSE
+# endif
+# if XLAT_VERBOSE
" */"
-#endif
+# endif
, NULL,
0UL);
do_keyctl(ARG_STR(KEYCTL_SETPERM),
sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL,
sizeof(uint32_t), 0xc0c0c0c0,
"0xc0c0c0c0"
-#if !XLAT_RAW
+# if !XLAT_RAW
" /* KEY_??? */"
-#endif
+# endif
,
NULL,
0UL);
sizeof(kernel_ulong_t),
(kernel_ulong_t) 0xfeedf157badc0dedLLU,
"-1159983635"
-#if !XLAT_RAW
+# if !XLAT_RAW
" /* KEY_REQKEY_DEFL_??? */"
-#endif
+# endif
, NULL, 0UL);
int rc = -1;
errno = ENOSYS;
-# ifdef __NR_socketcall
+#ifdef __NR_socketcall
static int have_socketcall = -1;
if (have_socketcall < 0) {
const long args[] = { a1, a2, a3, a4, a5 };
rc = syscall(__NR_socketcall, call, args);
} else
-# endif
+#endif
{
if (nr != -1)
rc = syscall(nr, a1, a2, a3, a4, a5);
if (i)
printf(", ");
if (i >= IOV_MAX
-# if !VERBOSE
+#if !VERBOSE
|| i >= DEFAULT_STRLEN
-# endif
+#endif
) {
printf("...");
break;
void
printrc(long rc)
{
-#ifdef __x86_64__
+# ifdef __x86_64__
int err = -rc;
/* Thanks, long return type of syscall(2) */
errno = err;
printf(" %s (%m)", errno2name());
}
-#else
+# else
printf("%s", sprintrc(rc));
-#endif
+# endif
puts("");
}
printf("\"");
}
-#if DUMPIO_READ || DUMPIO_WRITE
+# if DUMPIO_READ || DUMPIO_WRITE
static void
dumpstr(unsigned char start, unsigned int count)
{
}
}
}
-#endif /* DUMPIO_READ || DUMPIO_WRITE */
+# endif /* DUMPIO_READ || DUMPIO_WRITE */
static void
cleanup(void)
.l2_psm = htobs(h_psm),
.l2_bdaddr.b = "abcdef",
.l2_cid = htobs(h_cid),
-#ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
+# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
.l2_bdaddr_type = 0xce,
-#endif
+# endif
};
void *l2 = tail_memdup(&c_l2, sizeof(c_l2));
unsigned int len = sizeof(c_l2);
", l2_psm=htobs(L2CAP_PSM_DYN_START + %hu)"
", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x"
", l2_cid=htobs(L2CAP_CID_DYN_START + %hu)"
-#ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
+# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
", l2_bdaddr_type=0xce /* BDADDR_??? */"
-#endif
+# endif
"}, %u) = %d EBADF (%m)\n",
(short) (h_psm - 0x1001),
c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1],
c_l2.l2_psm = htobs(1);
c_l2.l2_cid = htobs(1);
-#ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
+# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
c_l2.l2_bdaddr_type = BDADDR_LE_RANDOM;
-#endif
+# endif
memcpy(l2, &c_l2, sizeof(c_l2));
ret = connect(-1, l2, len);
printf("connect(-1, {sa_family=AF_BLUETOOTH"
", l2_psm=htobs(L2CAP_PSM_SDP)"
", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x"
", l2_cid=htobs(L2CAP_CID_SIGNALING)"
-#ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
+# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
", l2_bdaddr_type=BDADDR_LE_RANDOM"
-#endif
+# endif
"}, %u) = %d EBADF (%m)\n",
c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1],
c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3],
c_l2.l2_psm = htobs(0xbad);
c_l2.l2_cid = htobs(8);
-#ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
+# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
c_l2.l2_bdaddr_type = 3;
-#endif
+# endif
memcpy(l2, &c_l2, sizeof(c_l2));
ret = connect(-1, l2, len);
printf("connect(-1, {sa_family=AF_BLUETOOTH"
", l2_psm=htobs(0xbad /* L2CAP_PSM_??? */)"
", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x"
", l2_cid=htobs(0x8 /* L2CAP_CID_??? */)"
-#ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
+# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE
", l2_bdaddr_type=0x3 /* BDADDR_??? */"
-#endif
+# endif
"}, %u) = %d EBADF (%m)\n",
c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1],
c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3],
fd, nlh->nlmsg_len, num, nlh->nlmsg_len, sprintrc(rc));
}
-#if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS
+# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS
static void
test_ack_flags(const int fd)
{
.nlmsg_type = NLMSG_ERROR,
};
-#ifdef NLM_F_CAPPED
+# ifdef NLM_F_CAPPED
nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED,
rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0);
printf("sendto(%d, {len=%u, type=NLMSG_ERROR"
", flags=NLM_F_REQUEST|NLM_F_CAPPED, seq=0, pid=0}"
", %u, MSG_DONTWAIT, NULL, 0) = %s\n",
fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc));
-#endif
+# endif
-#ifdef NLM_F_ACK_TLVS
+# ifdef NLM_F_ACK_TLVS
nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK_TLVS;
rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0);
printf("sendto(%d, {len=%u, type=NLMSG_ERROR"
", flags=NLM_F_REQUEST|NLM_F_ACK_TLVS, seq=0, pid=0}"
", %u, MSG_DONTWAIT, NULL, 0) = %s\n",
fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc));
-#endif
+# endif
-#if defined NLM_F_CAPPED && defined NLM_F_ACK_TLVS
+# if defined NLM_F_CAPPED && defined NLM_F_ACK_TLVS
nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED | NLM_F_ACK_TLVS;
rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0);
printf("sendto(%d, {len=%u, type=NLMSG_ERROR"
", flags=NLM_F_REQUEST|NLM_F_CAPPED|NLM_F_ACK_TLVS, seq=0, pid=0}"
", %u, MSG_DONTWAIT, NULL, 0) = %s\n",
fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc));
-#endif
+# endif
}
-#endif
+# endif
int main(void)
{
send_query(fd);
test_nlmsgerr(fd);
test_nlmsg_done(fd);
-#if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS
+# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS
test_ack_flags(fd);
-#endif
+# endif
puts("+++ exited with 0 +++");
return 0;
DEFAULT_STRLEN, str, DEFAULT_STRLEN,
printf("{type=\"%s\"}", str));
-#ifdef HAVE_STRUCT_CRYPTO_REPORT_HASH
+# ifdef HAVE_STRUCT_CRYPTO_REPORT_HASH
static const struct crypto_report_hash rhash = {
.type = "efgh",
.blocksize = 0xabcdefdc,
PRINT_FIELD_U(", ", rhash, blocksize);
PRINT_FIELD_U(", ", rhash, digestsize);
printf("}"));
-#endif
+# endif
-#ifdef HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER
+# ifdef HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER
static const struct crypto_report_blkcipher rblkcipher = {
.type = "abcd",
.geniv = "efgh",
PRINT_FIELD_U(", ", rblkcipher, max_keysize);
PRINT_FIELD_U(", ", rblkcipher, ivsize);
printf("}"));
-#endif
+# endif
-#ifdef HAVE_STRUCT_CRYPTO_REPORT_AEAD
+# ifdef HAVE_STRUCT_CRYPTO_REPORT_AEAD
static const struct crypto_report_aead raead = {
.type = "abcd",
.geniv = "efgh",
PRINT_FIELD_U(", ", raead, maxauthsize);
PRINT_FIELD_U(", ", raead, ivsize);
printf("}"));
-#endif
+# endif
-#ifdef HAVE_STRUCT_CRYPTO_REPORT_RNG
+# ifdef HAVE_STRUCT_CRYPTO_REPORT_RNG
static const struct crypto_report_rng rrng = {
.type = "abcd",
.seedsize = 0xabcdefac
printf("{type=\"abcd\"");
PRINT_FIELD_U(", ", rrng, seedsize);
printf("}"));
-#endif
+# endif
-#ifdef HAVE_STRUCT_CRYPTO_REPORT_CIPHER
+# ifdef HAVE_STRUCT_CRYPTO_REPORT_CIPHER
static const struct crypto_report_cipher rcipher = {
.type = "abcd",
.blocksize = 0xabcdefac,
PRINT_FIELD_U(", ", rcipher, min_keysize);
PRINT_FIELD_U(", ", rcipher, max_keysize);
printf("}"));
-#endif
+# endif
puts("+++ exited with 0 +++");
return 0;
# include <linux/ip.h>
# include <linux/rtnetlink.h>
-#define FRA_TUN_ID 12
-#define FRA_TABLE 15
-#define FRA_UID_RANGE 20
-#define FRA_PROTOCOL 21
-#define FRA_IP_PROTO 22
-#define FRA_SPORT_RANGE 23
-#define FRA_DPORT_RANGE 24
+# define FRA_TUN_ID 12
+# define FRA_TABLE 15
+# define FRA_UID_RANGE 20
+# define FRA_PROTOCOL 21
+# define FRA_IP_PROTO 22
+# define FRA_SPORT_RANGE 23
+# define FRA_DPORT_RANGE 24
# ifndef HAVE_STRUCT_FIB_RULE_PORT_RANGE
struct fib_rule_port_range {
FRA_TABLE, pattern, table_id,
printf("RT_TABLE_DEFAULT"));
-#ifdef HAVE_STRUCT_FIB_RULE_UID_RANGE
+# ifdef HAVE_STRUCT_FIB_RULE_UID_RANGE
static const struct fib_rule_uid_range range = {
.start = 0xabcdedad,
.end = 0xbcdeadba
PRINT_FIELD_U("{", range, start);
PRINT_FIELD_U(", ", range, end);
printf("}"));
-#endif
-#if defined HAVE_BE64TOH || defined be64toh
+# endif
+# if defined HAVE_BE64TOH || defined be64toh
const uint64_t tun_id = 0xabcdcdbeedabadef;
TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
init_rtmsg, print_rtmsg,
FRA_TUN_ID, pattern, tun_id,
printf("htobe64(%" PRIu64 ")", be64toh(tun_id)));
-#endif
+# endif
uint8_t proto;
PRINT_FIELD_U(", ", st64, tx_window_errors);
PRINT_FIELD_U(", ", st64, rx_compressed);
PRINT_FIELD_U(", ", st64, tx_compressed);
-#ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER
+# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER
PRINT_FIELD_U(", ", st64, rx_nohandler);
-#endif
+# endif
printf("}"));
-#ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER
+# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER
const unsigned int sizeof_stats64 =
offsetofend(struct rtnl_link_stats64, tx_compressed);
TEST_NLATTR(fd, nlh0, hdrlen,
PRINT_FIELD_U(", ", st64, rx_compressed);
PRINT_FIELD_U(", ", st64, tx_compressed);
printf("}"));
-#endif /* HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER */
+# endif /* HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER */
#endif /* HAVE_STRUCT_RTNL_LINK_STATS64 */
struct nlattr nla = {
*/
#ifndef STRACE_TESTS_NLATTR_IFLA_H
-#define STRACE_TESTS_NLATTR_IFLA_H
+# define STRACE_TESTS_NLATTR_IFLA_H
-#include "tests.h"
+# include "tests.h"
-#ifndef IFLA_ATTR
-# error "Please define IFLA_ATTR before including this file"
-#endif
+# ifndef IFLA_ATTR
+# error "Please define IFLA_ATTR before including this file"
+# endif
static const unsigned int hdrlen = sizeof(struct ifinfomsg);
#endif
#define XLAT_MACROS_ONLY
-# include "xlat/rtnl_ifla_af_spec_inet_attrs.h"
-# include "xlat/rtnl_ifla_af_spec_inet6_attrs.h"
+#include "xlat/rtnl_ifla_af_spec_inet_attrs.h"
+#include "xlat/rtnl_ifla_af_spec_inet6_attrs.h"
#undef XLAT_MACROS_ONLY
#ifndef HAVE_STRUCT_IFLA_CACHEINFO
#include <linux/rtnetlink.h>
#define XLAT_MACROS_ONLY
-# include <xlat/rtnl_link_attrs.h>
-# include <xlat/rtnl_ifla_info_attrs.h>
+#include <xlat/rtnl_link_attrs.h>
+#include <xlat/rtnl_ifla_info_attrs.h>
#undef XLAT_MACROS_ONLY
#define IFLA_ATTR IFLA_LINKINFO
.ndts_rcv_probes_ucast = 0xbcdefeacdadecdfe,
.ndts_periodic_gc_runs = 0xedffeadedeffbecc,
.ndts_forced_gc_runs = 0xfeefefeabedeedcd,
-#ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS
+# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS
.ndts_table_fulls = 0xadebfefaecdfeade
-#endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */
+# endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */
};
TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
init_ndtmsg, print_ndtmsg,
PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_ucast);
PRINT_FIELD_U(", ", ndtst, ndts_periodic_gc_runs);
PRINT_FIELD_U(", ", ndtst, ndts_forced_gc_runs);
-#ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS
+# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS
PRINT_FIELD_U(", ", ndtst, ndts_table_fulls);
-#endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */
+# endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */
printf("}"));
#endif /* HAVE_STRUCT_NDT_STATS */
PRINT_FIELD_U(", ", sb, packets);
printf("}"));
-#ifdef HAVE_STRUCT_GNET_STATS_RATE_EST
+# ifdef HAVE_STRUCT_GNET_STATS_RATE_EST
static const struct gnet_stats_rate_est est = {
.bps = 0xebcdaebd,
.pps = 0xabdceade,
PRINT_FIELD_U("{", est, bps);
PRINT_FIELD_U(", ", est, pps);
printf("}"));
-#endif
+# endif
-#ifdef HAVE_STRUCT_GNET_STATS_QUEUE
+# ifdef HAVE_STRUCT_GNET_STATS_QUEUE
static const struct gnet_stats_queue qstats = {
.qlen = 0xabcdeabd,
.backlog = 0xbcdaebad,
PRINT_FIELD_U(", ", qstats, requeues);
PRINT_FIELD_U(", ", qstats, overlimits);
printf("}"));
-#endif
+# endif
-#ifdef HAVE_STRUCT_GNET_STATS_RATE_EST64
+# ifdef HAVE_STRUCT_GNET_STATS_RATE_EST64
static const struct gnet_stats_rate_est64 est64 = {
.bps = 0xacbdcdefafecaebf,
.pps = 0xcdabeabdfeabceaf
PRINT_FIELD_U("{", est64, bps);
PRINT_FIELD_U(", ", est64, pps);
printf("}"));
-#endif
+# endif
puts("+++ exited with 0 +++");
return 0;
memset(args, 0, sizeof(*args) * 4);
xselect(0);
-#ifndef PATH_TRACING_FD
+# ifndef PATH_TRACING_FD
printf("select(NULL) = %s\n", errstr);
-#endif
+# endif
xselect((uintptr_t) args);
-#ifndef PATH_TRACING_FD
+# ifndef PATH_TRACING_FD
printf("select(%p) = %s\n", args, errstr);
-#endif
+# endif
puts("+++ exited with 0 +++");
return 0;
# include <stdio.h>
# include <unistd.h>
-#ifdef O_TMPFILE
+# ifdef O_TMPFILE
/* The kernel & C libraries often inline O_DIRECTORY. */
-# define STRACE_O_TMPFILE (O_TMPFILE & ~O_DIRECTORY)
-#else
-# define STRACE_O_TMPFILE 0
-#endif
+# define STRACE_O_TMPFILE (O_TMPFILE & ~O_DIRECTORY)
+# else
+# define STRACE_O_TMPFILE 0
+# endif
static const char sample[] = "openat.sample";
flags_data.raw = ((uint64_t *) attr)[5];
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP
attr->precise_ip;
-# else
+# else
flags_data.flags.precise_ip;
-# endif
+# endif
printf(", precise_ip=%" PRIu64 " /* %s */", val, precise_ip_desc);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA
attr->mmap_data;
-# else
+# else
flags_data.flags.mmap_data;
-# endif
+# endif
printf(", mmap_data=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL
attr->sample_id_all;
-# else
+# else
flags_data.flags.sample_id_all;
-# endif
+# endif
printf(", sample_id_all=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST
attr->exclude_host;
-# else
+# else
flags_data.flags.exclude_host;
-# endif
+# endif
printf(", exclude_host=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST
attr->exclude_guest;
-# else
+# else
flags_data.flags.exclude_guest;
-# endif
+# endif
printf(", exclude_guest=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL
attr->exclude_callchain_kernel;
-# else
+# else
flags_data.flags.exclude_callchain_kernel;
-# endif
+# endif
printf(", exclude_callchain_kernel=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER
attr->exclude_callchain_user;
-# else
+# else
flags_data.flags.exclude_callchain_user;
-# endif
+# endif
printf(", exclude_callchain_user=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2
attr->mmap2;
-# else
+# else
flags_data.flags.mmap2;
-# endif
+# endif
printf(", mmap2=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC
attr->comm_exec;
-# else
+# else
flags_data.flags.comm_exec;
-# endif
+# endif
printf(", comm_exec=%" PRIu64, val);
use_clockid = val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID
attr->use_clockid;
-# else
+# else
flags_data.flags.use_clockid;
-# endif
+# endif
printf(", use_clockid=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH
attr->context_switch;
-# else
+# else
flags_data.flags.context_switch;
-# endif
+# endif
printf(", context_switch=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD
attr->write_backward;
-# else
+# else
flags_data.flags.write_backward;
-# endif
+# endif
printf(", write_backward=%" PRIu64, val);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES
attr->namespaces;
-# else
+# else
flags_data.flags.namespaces;
-# endif
+# endif
printf(", namespaces=%" PRIu64, val);
val = flags_data.flags.__reserved_1;
printf(", bp_type=%s", bp_type);
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1
attr->config1;
-# else
+# else
((uint64_t *) attr)[56 / sizeof(uint64_t)];
-# endif
+# endif
printf(", %s=%#" PRIx64,
attr->type == PERF_TYPE_BREAKPOINT ? "bp_addr" : "config1",
val);
}
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2
attr->config2;
-# else
+# else
((uint64_t *) attr)[64 / sizeof(uint64_t)];
-# endif
+# endif
if (attr->type == PERF_TYPE_BREAKPOINT)
printf(", bp_len=%" PRIu64, val);
else
}
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER
attr->sample_regs_user;
-# else
+# else
((uint64_t *) attr)[80 / sizeof(uint64_t)];
-# endif
+# endif
printf(", sample_regs_user=%#" PRIx64, val);
if (size <= 88) {
}
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER
attr->sample_stack_user;
-# else
+# else
((uint32_t *) attr)[88 / sizeof(uint32_t)];
-# endif
+# endif
/*
* Print branch sample type only in case PERF_SAMPLE_STACK_USER
* is set in the sample_type field.
}
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR
attr->sample_regs_intr;
-# else
+# else
((uint64_t *) attr)[96 / sizeof(uint64_t)];
-# endif
+# endif
printf(", sample_regs_intr=%#" PRIx64, val);
/* End of version 4 of the structure */
}
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK
attr->aux_watermark;
-# else
+# else
((uint32_t *) attr)[104 / sizeof(uint32_t)];
-# endif
+# endif
printf(", aux_watermark=%" PRIu32, (uint32_t) val);
if (size <= 108) {
}
val =
-# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK
+# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK
attr->sample_max_stack;
-# else
+# else
((uint16_t *) attr)[108 / sizeof(uint16_t)];
-# endif
+# endif
printf(", sample_max_stack=%" PRIu16, (uint16_t) val);
if (size <= 110) {
# include "xlat.h"
# include "xlat/perf_event_open_flags.h"
-#if ULONG_MAX > UINT_MAX
-#define LONG_STR_PREFIX "ffffffff"
-#else
-#define LONG_STR_PREFIX ""
-#endif
+# if ULONG_MAX > UINT_MAX
+# define LONG_STR_PREFIX "ffffffff"
+# else
+# define LONG_STR_PREFIX ""
+# endif
static const char *printaddr(void *ptr)
{
# include <string.h>
# include <unistd.h>
-#define PRINT_EVENT(flag, member) \
+# define PRINT_EVENT(flag, member) \
do { \
if (member & flag) { \
if (member != pfd->member) \
PRINT_EVENT(POLLIN, events);
PRINT_EVENT(POLLPRI, events);
PRINT_EVENT(POLLOUT, events);
-#ifdef POLLRDNORM
+# ifdef POLLRDNORM
PRINT_EVENT(POLLRDNORM, events);
-#endif
-#ifdef POLLWRNORM
+# endif
+# ifdef POLLWRNORM
PRINT_EVENT(POLLWRNORM, events);
-#endif
-#ifdef POLLRDBAND
+# endif
+# ifdef POLLRDBAND
PRINT_EVENT(POLLRDBAND, events);
-#endif
-#ifdef POLLWRBAND
+# endif
+# ifdef POLLWRBAND
PRINT_EVENT(POLLWRBAND, events);
-#endif
+# endif
PRINT_EVENT(POLLERR, events);
PRINT_EVENT(POLLHUP, events);
PRINT_EVENT(POLLNVAL, events);
PRINT_EVENT(POLLIN, revents);
PRINT_EVENT(POLLPRI, revents);
PRINT_EVENT(POLLOUT, revents);
-#ifdef POLLRDNORM
+# ifdef POLLRDNORM
PRINT_EVENT(POLLRDNORM, revents);
-#endif
-#ifdef POLLWRNORM
+# endif
+# ifdef POLLWRNORM
PRINT_EVENT(POLLWRNORM, revents);
-#endif
-#ifdef POLLRDBAND
+# endif
+# ifdef POLLRDBAND
PRINT_EVENT(POLLRDBAND, revents);
-#endif
-#ifdef POLLWRBAND
+# endif
+# ifdef POLLWRBAND
PRINT_EVENT(POLLWRBAND, revents);
-#endif
+# endif
PRINT_EVENT(POLLERR, revents);
PRINT_EVENT(POLLHUP, revents);
PRINT_EVENT(POLLNVAL, revents);
&& defined BPF_JUMP \
&& defined BPF_STMT
-#define SOCK_FILTER_ALLOW_SYSCALL(nr) \
+# define SOCK_FILTER_ALLOW_SYSCALL(nr) \
BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \
BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW)
-#define SOCK_FILTER_DENY_SYSCALL(nr, err) \
+# define SOCK_FILTER_DENY_SYSCALL(nr, err) \
BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \
BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err)))
-#define SOCK_FILTER_KILL_PROCESS \
+# define SOCK_FILTER_KILL_PROCESS \
BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)
-#define PRINT_ALLOW_SYSCALL(nr) \
+# define PRINT_ALLOW_SYSCALL(nr) \
printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \
"BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \
__NR_ ## nr)
-#define PRINT_DENY_SYSCALL(nr, err) \
+# define PRINT_DENY_SYSCALL(nr, err) \
printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \
"BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \
__NR_ ## nr, err)
tprintf("%s", "");
-#if defined __x86_64__ && defined __ILP32__
+# if defined __x86_64__ && defined __ILP32__
/*
* x32 is the only architecture where preadv2 takes 5 arguments,
* see preadv64v2 in kernel sources.
*/
rc = syscall(__NR_preadv2, -1, NULL, vlen, pos_l, 1);
-#else
+# else
const kernel_ulong_t pos_h =
(sizeof(pos_l) == sizeof(pos)) ?
(kernel_ulong_t) 0xbadc0deddeadbeefULL :
(kernel_ulong_t) (pos >> 32);
rc = syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1);
-#endif
+# endif
if (rc != -1 || (ENOSYS != errno && EBADF != errno))
perror_msg_and_fail("preadv2");
test_dumpio = EBADF == errno;
tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = %s\n",
(unsigned long) vlen, pos, sprintrc(rc));
-#if defined __x86_64__ && defined __ILP32__
+# if defined __x86_64__ && defined __ILP32__
/*
* x32 is the only architecture where pwritev2 takes 5 arguments,
* see pwritev64v2 in kernel sources.
*/
rc = syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, 1);
-#else
+# else
rc = syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1);
-#endif
+# endif
if (rc != -1 || (ENOSYS != errno && EBADF != errno))
perror_msg_and_fail("pwritev2");
tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = %s\n",
# include "xlat/if_dqinfo_flags.h"
# include "xlat/if_dqinfo_valid.h"
-#define QUOTA_STR(_arg) (_arg), gen_quotacmd(#_arg, _arg)
-#define QUOTA_ID_STR(_arg) (_arg), gen_quotaid(#_arg, _arg)
-#define QUOTA_STR_INVALID(_arg, str) (_arg), gen_quotacmd(str, _arg)
+# define QUOTA_STR(_arg) (_arg), gen_quotacmd(#_arg, _arg)
+# define QUOTA_ID_STR(_arg) (_arg), gen_quotaid(#_arg, _arg)
+# define QUOTA_STR_INVALID(_arg, str) (_arg), gen_quotacmd(str, _arg)
void
print_dqblk(long rc, void *ptr, void *arg)
PRINT_FIELD_U(", ", *di, dqi_igrace);
printf(", dqi_flags=");
-#if XLAT_RAW
+# if XLAT_RAW
printf("%#x", di->dqi_flags);
-#elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
printf("%#x /* ", di->dqi_flags);
printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???");
printf(" */");
-#else /* XLAT_ABBREV */
+# else /* XLAT_ABBREV */
printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???");
-#endif
+# endif
printf(", dqi_valid=");
-#if XLAT_RAW
+# if XLAT_RAW
printf("%#x", di->dqi_valid);
-#elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
printf("%#x /* ", di->dqi_valid);
printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???");
printf(" */");
-#else /* XLAT_ABBREV */
+# else /* XLAT_ABBREV */
printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???");
-#endif
+# endif
printf("}");
}
return;
}
printf("[");
-#if XLAT_RAW
+# if XLAT_RAW
printf("%#x]", *fmtval);
return;
-#else
+# else
switch (*fmtval) {
case 1:
fmtstr = "QFMT_VFS_OLD";
printf("%#x /* QFMT_VFS_??? */]", *fmtval);
return;
}
-#endif
-#if XLAT_VERBOSE
+# endif
+# if XLAT_VERBOSE
printf("%#x /* %s */]", *fmtval, fmtstr);
-#else
+# else
printf("%s]", fmtstr);
-#endif
+# endif
}
const char *
{
static char quotacmd_str[2048];
-#if XLAT_RAW
+# if XLAT_RAW
snprintf(quotacmd_str, sizeof(quotacmd_str), "%u", cmd);
-#elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
snprintf(quotacmd_str, sizeof(quotacmd_str), "%u /* %s */", cmd, abbrev_str);
-#else
+# else
return abbrev_str;
-#endif
+# endif
return quotacmd_str;
}
{
static char quotaid_str[1024];
-#if XLAT_RAW
+# if XLAT_RAW
snprintf(quotaid_str, sizeof(quotaid_str), "%#x", id);
-#elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
snprintf(quotaid_str, sizeof(quotaid_str), "%#x /* %s */", id, abbrev_str);
-#else
+# else
return abbrev_str;
-#endif
+# endif
return quotaid_str;
}
snprintf(invalid_cmd_str, sizeof(invalid_cmd_str),
"QCMD(Q_QUOTAON, %#x /* ???QUOTA */)",
QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed)));
-#if XLAT_RAW
+# if XLAT_RAW
snprintf(invalid_id_str, sizeof(invalid_id_str),
"%#x", bogus_id);
-#else
+# else
snprintf(invalid_id_str, sizeof(invalid_id_str),
"%#x /* QFMT_VFS_??? */", bogus_id);
-#endif
+# endif
check_quota(CQF_ID_STR, QCMD(Q_QUOTAON, 0xfacefeed),
gen_quotacmd(invalid_cmd_str, QCMD(Q_QUOTAON, 0xfacefeed)),
bogus_dev, bogus_dev_str,
*/
#ifndef STRACE_TESTS_QUOTACTL_H
-#define STRACE_TESTS_QUOTACTL_H
+# define STRACE_TESTS_QUOTACTL_H
# include <inttypes.h>
# include <stdarg.h>
errstr = sprintrc(rc);
-#ifdef INJECT_RETVAL
+# ifdef INJECT_RETVAL
if (rc != INJECT_RETVAL)
error_msg_and_fail("Got a return value of %ld != %d",
rc, INJECT_RETVAL);
snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr);
errstr = inj_errstr;
-#endif
+# endif
printf("quotactl(%s, %s", cmd_str, special_str);
(uintmax_t) pgoff, flags1_str, errstr);
# endif
-#ifdef MAP_HUGETLB
-# ifndef MAP_HUGE_2MB
-# ifndef MAP_HUGE_SHIFT
-# define MAP_HUGE_SHIFT 26
-# endif
-# define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
-# endif /* !MAP_HUGE_2MB */
+# ifdef MAP_HUGETLB
+# ifndef MAP_HUGE_2MB
+# ifndef MAP_HUGE_SHIFT
+# define MAP_HUGE_SHIFT 26
+# endif
+# define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
+# endif /* !MAP_HUGE_2MB */
addr = (kernel_ulong_t) 0xfacefeeddeadf00dULL;
size = (kernel_ulong_t) 0xdefaced1bad2beefULL;
prot = (kernel_ulong_t) 0xdefaced00000000ULL | PROT_NONE;
* HP PA-RISC is the only architecture that has MAP_TYPE defined to 0x3, which
* is also used for MAP_SHARED_VALIDATE since Linux commit v4.15-rc1~71^2^2~23.
*/
-# ifdef __hppa__
-# define MAP_TYPE_str "MAP_SHARED_VALIDATE"
-# else
-# define MAP_TYPE_str "0xf /* MAP_??? */"
-# endif
-# define flags2_str \
+# ifdef __hppa__
+# define MAP_TYPE_str "MAP_SHARED_VALIDATE"
+# else
+# define MAP_TYPE_str "0xf /* MAP_??? */"
+# endif
+# define flags2_str \
MAP_TYPE_str "|MAP_FIXED|MAP_NORESERVE|MAP_HUGETLB|21<<MAP_HUGE_SHIFT"
-# if XLAT_RAW
+# if XLAT_RAW
printf("remap_file_pages(%#jx, %ju, %#jx, %ju, %#jx) = %s\n",
(uintmax_t) addr, (uintmax_t) size, (uintmax_t) prot,
(uintmax_t) pgoff, (uintmax_t) flags, errstr);
-# elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
printf("remap_file_pages(%#jx, %ju, %#jx /* %s */, %ju, %#jx /* %s */)"
" = %s\n",
(uintmax_t) addr, (uintmax_t) size, (uintmax_t) prot,
prot == PROT_NONE ? "PROT_NONE" : "PROT_???",
(uintmax_t) pgoff, (uintmax_t) flags, flags2_str, errstr);
-# else /* XLAT_ABBREV */
+# else /* XLAT_ABBREV */
printf("remap_file_pages(%#jx, %ju, %s, %ju, %s) = %s\n",
(uintmax_t) addr, (uintmax_t) size,
prot == PROT_NONE ? "PROT_NONE" :
"0xdefaced00000000 /* PROT_??? */",
(uintmax_t) pgoff, flags2_str, errstr);
-# endif
-#endif /* MAP_HUGETLB */
+# endif
+# endif /* MAP_HUGETLB */
puts("+++ exited with 0 +++");
return 0;
(long long) req.tv_sec, zero_extend_signed_to_ull(req.tv_nsec),
(long long) rem.tv_sec, zero_extend_signed_to_ull(rem.tv_nsec));
puts("--- SIGALRM \\{si_signo=SIGALRM, si_code=SI_KERNEL\\} ---");
-#ifdef __arm__
+# ifdef __arm__
/* old kernels used to overwrite ARM_r0 with -EINTR */
-# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|"
-#else
-# define ALTERNATIVE_NANOSLEEP_REQ ""
-#endif
+# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|"
+# else
+# define ALTERNATIVE_NANOSLEEP_REQ ""
+# endif
printf("(nanosleep\\((%s\\{tv_sec=%lld, tv_nsec=%llu\\})"
", %p|restart_syscall\\(<\\.\\.\\."
" resuming interrupted nanosleep \\.\\.\\.>)\\) = 0\n",
break;
}
if (size) {
-#if WORDS_BIGENDIAN
+# if WORDS_BIGENDIAN
if (size < sizeof(long))
tprintf("rt_sigpending(%s, %u) = 0\n",
"[]", size);
else
-#endif
+# endif
tprintf("rt_sigpending(%s, %u) = 0\n",
text, size);
} else {
&& defined BPF_JUMP \
&& defined BPF_STMT
-#define SOCK_FILTER_ALLOW_SYSCALL(nr) \
+# define SOCK_FILTER_ALLOW_SYSCALL(nr) \
BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \
BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW)
-#define SOCK_FILTER_DENY_SYSCALL(nr, err) \
+# define SOCK_FILTER_DENY_SYSCALL(nr, err) \
BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \
BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err)))
-#define SOCK_FILTER_KILL_PROCESS \
+# define SOCK_FILTER_KILL_PROCESS \
BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)
-#define PRINT_ALLOW_SYSCALL(nr) \
+# define PRINT_ALLOW_SYSCALL(nr) \
tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \
"BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \
__NR_ ## nr)
-#define PRINT_DENY_SYSCALL(nr, err) \
+# define PRINT_DENY_SYSCALL(nr, err) \
tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \
"BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \
__NR_ ## nr, err)
# include <stdio.h>
# include <unistd.h>
-#ifdef HAVE_LINUX_UTSNAME_H
-# include <linux/utsname.h>
-#endif
+# ifdef HAVE_LINUX_UTSNAME_H
+# include <linux/utsname.h>
+# endif
-#ifndef __NEW_UTS_LEN
-# define __NEW_UTS_LEN 64
-#endif
+# ifndef __NEW_UTS_LEN
+# define __NEW_UTS_LEN 64
+# endif
int
main(void)
# include <unistd.h>
struct set_sa {
-#if defined MIPS
+# if defined MIPS
unsigned int flags;
unsigned long handler;
unsigned long mask[1];
-#elif defined ALPHA
+# elif defined ALPHA
unsigned long handler;
unsigned long mask[1];
unsigned int flags;
-#else
+# else
unsigned long handler;
unsigned long mask[1];
unsigned long flags;
unsigned long restorer;
-#endif
+# endif
}
-#ifdef ALPHA
+# ifdef ALPHA
ATTRIBUTE_PACKED
-#endif
+# endif
;
typedef struct set_sa struct_set_sa;
-#ifdef MIPS
+# ifdef MIPS
struct get_sa {
unsigned int flags;
typedef struct get_sa struct_get_sa;
-#else
+# else
typedef struct set_sa struct_get_sa;
-#endif
+# endif
static long
k_sigaction(const kernel_ulong_t signum, const kernel_ulong_t new_act,
return syscall(__NR_sigaction, signum, new_act, old_act);
}
-#if defined SPARC || defined SPARC64
+# if defined SPARC || defined SPARC64
/*
* See arch/sparc/kernel/sys_sparc_32.c:sys_sparc_sigaction
* and arch/sparc/kernel/sys_sparc32.c:compat_sys_sparc_sigaction
*/
-# define ADDR_INT ((unsigned int) -0xdefaced)
-# define SIGNO_INT ((unsigned int) -SIGUSR1)
-# define SIG_STR "-SIGUSR1"
-#else
-# define ADDR_INT ((unsigned int) 0xdefaced)
-# define SIGNO_INT ((unsigned int) SIGUSR1)
-# define SIG_STR "SIGUSR1"
-#endif
+# define ADDR_INT ((unsigned int) -0xdefaced)
+# define SIGNO_INT ((unsigned int) -SIGUSR1)
+# define SIG_STR "-SIGUSR1"
+# else
+# define ADDR_INT ((unsigned int) 0xdefaced)
+# define SIGNO_INT ((unsigned int) SIGUSR1)
+# define SIG_STR "SIGUSR1"
+# endif
static const kernel_ulong_t signo =
(kernel_ulong_t) 0xbadc0ded00000000ULL | SIGNO_INT;
static const kernel_ulong_t addr =
sigdelset(mask.libc, SIGHUP);
memcpy(new_act->mask, mask.old, sizeof(mask.old));
-#ifdef SA_RESTORER
+# ifdef SA_RESTORER
new_act->flags = SA_RESTORER;
new_act->restorer = (unsigned long) 0xdeadfacecafef00dULL;
-# define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx"
-# define SA_RESTORER_ARGS , new_act->restorer
-#else
+# define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx"
+# define SA_RESTORER_ARGS , new_act->restorer
+# else
new_act->flags = SA_NODEFER;
-# define SA_RESTORER_FMT ", sa_flags=SA_NODEFER"
-# define SA_RESTORER_ARGS
-#endif
+# define SA_RESTORER_FMT ", sa_flags=SA_NODEFER"
+# define SA_RESTORER_ARGS
+# endif
k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act);
printf("sigaction(" SIG_STR ", {sa_handler=%#lx, sa_mask=~[HUP]"
sigdelset(&u.libc_mask, SIGUSR2);
const unsigned long mask2 = u.old_mask;
-#if SIGNAL_MASK_BY_REF
+# if SIGNAL_MASK_BY_REF
k_sigsuspend((uintptr_t) &mask1, 0xdeadbeef, (uintptr_t) &mask2);
-#else
+# else
k_sigsuspend(mask1, 0xdeadbeef, mask2);
-#endif
+# endif
if (EINTR != errno)
perror_msg_and_skip("sigsuspend");
#ifdef MANGLE
-#define f0 _ZN2ns2f0Ei
-#define f1 _ZN2ns2f1Ei
-#define f2 _ZN2ns2f2Ei
-#define f3 _ZN2ns2f3Ei
+# define f0 _ZN2ns2f0Ei
+# define f1 _ZN2ns2f1Ei
+# define f2 _ZN2ns2f2Ei
+# define f3 _ZN2ns2f3Ei
#endif
*/
#ifndef STRACE_TESTS_H
-#define STRACE_TESTS_H
+# define STRACE_TESTS_H
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+# ifdef HAVE_CONFIG_H
+# include "config.h"
+# endif
-#ifdef TESTS_SIZEOF_KERNEL_LONG_T
-# undef SIZEOF_KERNEL_LONG_T
-# define SIZEOF_KERNEL_LONG_T TESTS_SIZEOF_KERNEL_LONG_T
-#endif
+# ifdef TESTS_SIZEOF_KERNEL_LONG_T
+# undef SIZEOF_KERNEL_LONG_T
+# define SIZEOF_KERNEL_LONG_T TESTS_SIZEOF_KERNEL_LONG_T
+# endif
-#ifdef TESTS_SIZEOF_LONG
-# undef SIZEOF_LONG
-# define SIZEOF_LONG TESTS_SIZEOF_LONG
-#endif
+# ifdef TESTS_SIZEOF_LONG
+# undef SIZEOF_LONG
+# define SIZEOF_LONG TESTS_SIZEOF_LONG
+# endif
-#include <stdbool.h>
-#include <sys/types.h>
-#include "kernel_types.h"
-#include "gcc_compat.h"
-#include "macros.h"
+# include <stdbool.h>
+# include <sys/types.h>
+# include "kernel_types.h"
+# include "gcc_compat.h"
+# include "macros.h"
/*
* The printf-like function to use in header files
* shared between strace and its tests.
*/
-#ifndef STRACE_PRINTF
-# define STRACE_PRINTF printf
-#endif
+# ifndef STRACE_PRINTF
+# define STRACE_PRINTF printf
+# endif
/* Tests of "strace -v" are expected to define VERBOSE to 1. */
-#ifndef VERBOSE
-# define VERBOSE 0
-#endif
+# ifndef VERBOSE
+# define VERBOSE 0
+# endif
/* xlat verbosity defaults */
-#ifndef XLAT_RAW
-# define XLAT_RAW 0
-#endif
-#ifndef XLAT_VERBOSE
-# define XLAT_VERBOSE 0
-#endif
-
-#ifndef DEFAULT_STRLEN
+# ifndef XLAT_RAW
+# define XLAT_RAW 0
+# endif
+# ifndef XLAT_VERBOSE
+# define XLAT_VERBOSE 0
+# endif
+
+# ifndef DEFAULT_STRLEN
/* Default maximum # of bytes printed in printstr et al. */
-# define DEFAULT_STRLEN 32
-#endif
+# define DEFAULT_STRLEN 32
+# endif
/* Cached sysconf(_SC_PAGESIZE). */
size_t get_page_size(void);
void perror_msg_and_skip(const char *, ...)
ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
-#ifndef perror_msg_and_fail
-# define perror_msg_and_fail(fmt_, ...) \
+# ifndef perror_msg_and_fail
+# define perror_msg_and_fail(fmt_, ...) \
perror_msg_and_fail("%s:%d: " fmt_, __FILE__, __LINE__, ##__VA_ARGS__)
-#endif
-#ifndef perror_msg_and_fail
-# define error_msg_and_fail(fmt_, ...) \
+# endif
+# ifndef perror_msg_and_fail
+# define error_msg_and_fail(fmt_, ...) \
error_msg_and_fail("%s:%d: " fmt_, __FILE__, __LINE__, ##__VA_ARGS__)
-#endif
+# endif
/* Stat the specified file and skip the test if the stat call failed. */
void skip_if_unavailable(const char *);
void *tail_memdup(const void *, const size_t)
ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((2));
-#define midtail_alloc(after_, before_) \
+# define midtail_alloc(after_, before_) \
((void *) ((char *) tail_alloc(((before_) + (after_))) + (before_)))
/*
* of a mapped memory region.
* Assign its address to the specified constant pointer.
*/
-#define TAIL_ALLOC_OBJECT_CONST_PTR(type_name, type_ptr) \
+# define TAIL_ALLOC_OBJECT_CONST_PTR(type_name, type_ptr) \
type_name *const type_ptr = tail_alloc(sizeof(*type_ptr))
/*
* of a mapped memory region.
* Assign its address to the specified variable pointer.
*/
-#define TAIL_ALLOC_OBJECT_VAR_PTR(type_name, type_ptr) \
+# define TAIL_ALLOC_OBJECT_VAR_PTR(type_name, type_ptr) \
type_name *type_ptr = tail_alloc(sizeof(*type_ptr))
/*
/* Create a netlink socket. */
int create_nl_socket_ext(int proto, const char *name);
-#define create_nl_socket(proto) create_nl_socket_ext((proto), #proto)
+# define create_nl_socket(proto) create_nl_socket_ext((proto), #proto)
/* Create a pipe with maximized descriptor numbers. */
void pipe_maxfd(int pipefd[2]);
/* if_nametoindex("lo") */
unsigned int ifindex_lo(void);
-#ifdef HAVE_IF_INDEXTONAME
-# define IFINDEX_LO_STR "if_nametoindex(\"lo\")"
-#else
-# define IFINDEX_LO_STR "1"
-#endif
+# ifdef HAVE_IF_INDEXTONAME
+# define IFINDEX_LO_STR "if_nametoindex(\"lo\")"
+# else
+# define IFINDEX_LO_STR "1"
+# endif
-#define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t))
-#define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL)
+# define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t))
+# define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL)
/*
* For 64-bit kernel_ulong_t and 32-bit pointer,
# define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1)
/* Zero-extend a signed integer type to unsigned long long. */
-#define zero_extend_signed_to_ull(v) \
+# define zero_extend_signed_to_ull(v) \
(sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \
sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \
sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \
(unsigned long long) (v))
/* Sign-extend an unsigned integer type to long long. */
-#define sign_extend_unsigned_to_ll(v) \
+# define sign_extend_unsigned_to_ll(v) \
(sizeof(v) == sizeof(char) ? (long long) (char) (v) : \
sizeof(v) == sizeof(short) ? (long long) (short) (v) : \
sizeof(v) == sizeof(int) ? (long long) (int) (v) : \
sizeof(v) == sizeof(long) ? (long long) (long) (v) : \
(long long) (v))
-#define SKIP_MAIN_UNDEFINED(arg) \
+# define SKIP_MAIN_UNDEFINED(arg) \
int main(void) { error_msg_and_skip("undefined: %s", arg); }
-#if WORDS_BIGENDIAN
-# define LL_PAIR(HI, LO) (HI), (LO)
-#else
-# define LL_PAIR(HI, LO) (LO), (HI)
-#endif
-#define LL_VAL_TO_PAIR(llval) LL_PAIR((long) ((llval) >> 32), (long) (llval))
+# if WORDS_BIGENDIAN
+# define LL_PAIR(HI, LO) (HI), (LO)
+# else
+# define LL_PAIR(HI, LO) (LO), (HI)
+# endif
+# define LL_VAL_TO_PAIR(llval) LL_PAIR((long) ((llval) >> 32), (long) (llval))
-#define ARG_STR(_arg) (_arg), #_arg
-#define ARG_ULL_STR(_arg) _arg##ULL, #_arg
+# define ARG_STR(_arg) (_arg), #_arg
+# define ARG_ULL_STR(_arg) _arg##ULL, #_arg
/*
* Assign an object of type DEST_TYPE at address DEST_ADDR
* using memcpy to avoid potential unaligned access.
*/
-#define SET_STRUCT(DEST_TYPE, DEST_ADDR, ...) \
+# define SET_STRUCT(DEST_TYPE, DEST_ADDR, ...) \
do { \
DEST_TYPE dest_type_tmp_var = { __VA_ARGS__ }; \
memcpy(DEST_ADDR, &dest_type_tmp_var, sizeof(dest_type_tmp_var)); \
} while (0)
-#define NLMSG_ATTR(nlh, hdrlen) ((void *)(nlh) + NLMSG_SPACE(hdrlen))
+# define NLMSG_ATTR(nlh, hdrlen) ((void *)(nlh) + NLMSG_SPACE(hdrlen))
#endif /* !STRACE_TESTS_H */
sev.sigev_un.sigev_thread.attribute,
tid[2]);
-#ifndef SIGEV_THREAD_ID
-# define SIGEV_THREAD_ID 4
-#endif
+# ifndef SIGEV_THREAD_ID
+# define SIGEV_THREAD_ID 4
+# endif
sev.sigev_notify = SIGEV_THREAD_ID;
sev.sigev_un.tid = getpid();
if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[3]))
#if defined __NR_utimensat && defined UTIME_NOW && defined UTIME_OMIT
-#if SIZEOF_KERNEL_LONG_T == 4
+# if SIZEOF_KERNEL_LONG_T == 4
# define big_tv_sec "-559038737"
# define huge_tv_sec "-559038737"
# else
# define IS_STATX 0
# endif
-#if !XLAT_RAW /* Fixes -Wunused warning */
+# if !XLAT_RAW /* Fixes -Wunused warning */
static void
print_ftype(const unsigned int mode)
{
{
printf("%#o", mode & ~S_IFMT);
}
-#endif
+# endif
static void
print_st_mode(const unsigned int mode)
{
-#if XLAT_RAW
+# if XLAT_RAW
printf("%#o", mode);
-#elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
printf("%#o /* ", mode);
print_ftype(mode);
printf("|");
print_perms(mode);
printf(" */");
-#else
+# else
print_ftype(mode);
printf("|");
print_perms(mode);
-#endif
+# endif
}
# if !IS_STATX
static char devid[256];
int ret;
-#if XLAT_RAW
+# if XLAT_RAW
ret = snprintf(devid, sizeof(devid),
"%#llx", val);
-#elif XLAT_VERBOSE
+# elif XLAT_VERBOSE
ret = snprintf(devid, sizeof(devid),
"%#llx /* makedev(%#x, %#x) */",
val, major(val), minor(val));
-#else /* XLAT_ABBREV */
+# else /* XLAT_ABBREV */
ret = snprintf(devid, sizeof(devid),
"makedev(%#x, %#x)",
major(val), minor(val));
-#endif
+# endif
if (ret < 0)
perror_msg_and_fail("sprint_makedev(%llx)", val);
if ((unsigned) ret >= sizeof(devid))
# define HAVE_NSEC 0
# endif
-#define PRINT_ST_TIME(field) \
+# define PRINT_ST_TIME(field) \
do { \
printf(", st_" #field "=%lld", \
sign_extend_unsigned_to_ll(st->st_ ## field)); \
*/
#ifndef STRACE_TRACE_EVENT_H
-#define STRACE_TRACE_EVENT_H
+# define STRACE_TRACE_EVENT_H
/* Possible trace event loop states. Returned by next_event() and dispatched by
* dispatch_event(). */
*/
#ifndef STRACE_UNWIND_H
-#define STRACE_UNWIND_H
+# define STRACE_UNWIND_H
-#include "defs.h"
+# include "defs.h"
/*
* Type used in stacktrace walker.
tprints("}");
}
-#define PRINT_FIELD_UFFDIO_RANGE(prefix_, where_, field_) \
+# define PRINT_FIELD_UFFDIO_RANGE(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
tprintf_uffdio_range(&(where_).field_); \
struct { uint32_t base; uint32_t len; } *iov32;
struct { uint64_t base; uint64_t len; } *iov64;
} iovu;
-#define iov iovu.iov64
-#define sizeof_iov \
+# define iov iovu.iov64
+# define sizeof_iov \
(current_wordsize == 4 ? (unsigned int) sizeof(*iovu.iov32) \
: (unsigned int) sizeof(*iovu.iov64))
-#define iov_iov_base(i) \
+# define iov_iov_base(i) \
(current_wordsize == 4 ? (uint64_t) iovu.iov32[i].base : iovu.iov64[i].base)
-#define iov_iov_len(i) \
+# define iov_iov_len(i) \
(current_wordsize == 4 ? (uint64_t) iovu.iov32[i].len : iovu.iov64[i].len)
#else
struct iovec *iov;
-#define sizeof_iov ((unsigned int) sizeof(*iov))
-#define iov_iov_base(i) ptr_to_kulong(iov[i].iov_base)
-#define iov_iov_len(i) iov[i].iov_len
+# define sizeof_iov ((unsigned int) sizeof(*iov))
+# define iov_iov_base(i) ptr_to_kulong(iov[i].iov_base)
+# define iov_iov_len(i) iov[i].iov_len
#endif
int i;
unsigned int size = sizeof_iov * len;
tprints(prefix);
tprints("fmt.sdr={pixelformat=");
print_pixelformat(f->fmt.sdr.pixelformat, v4l2_sdr_fmts);
-#ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
+# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
tprintf(", buffersize=%u",
f->fmt.sdr.buffersize);
-#endif
+# endif
tprints("}");
break;
#endif
*/
#ifndef STRACE_WAIT_H
-#define STRACE_WAIT_H
+# define STRACE_WAIT_H
-#include "defs.h"
+# include "defs.h"
-#include <sys/wait.h>
+# include <sys/wait.h>
-#include "static_assert.h"
+# include "static_assert.h"
/*
* On Linux, the "core dumped" flag is hard-coded to 0x80:
* fs/coredump.c:do_coredump() between v3.7-rc1~134^2~4 and v3.10-rc1~143^2~41,
* or fs/exec.c:do_coredump() before v3.7-rc1~134^2~4
*/
-#ifndef WCOREFLAG
-# define WCOREFLAG 0x80
-#else
+# ifndef WCOREFLAG
+# define WCOREFLAG 0x80
+# else
static_assert((WCOREFLAG) == 0x80, "WCOREFLAG != 0x80");
-#endif
-#ifndef WCOREDUMP
-# define WCOREDUMP(status) ((status) & (WCOREFLAG))
-#endif
+# endif
+# ifndef WCOREDUMP
+# define WCOREDUMP(status) ((status) & (WCOREFLAG))
+# endif
-#ifndef W_STOPCODE
-# define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
-#endif
-#ifndef W_EXITCODE
-# define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#endif
-#ifndef W_CONTINUED
-# define W_CONTINUED 0xffff
-#endif
+# ifndef W_STOPCODE
+# define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+# endif
+# ifndef W_EXITCODE
+# define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
+# endif
+# ifndef W_CONTINUED
+# define W_CONTINUED 0xffff
+# endif
#endif /* STRACE_WAIT_H */
*/
#ifndef STRACE_XLAT_H
-#define STRACE_XLAT_H
+# define STRACE_XLAT_H
# include <stdint.h>
/** Always print both raw number and xlat processing result. */
XLAT_STYLE_VERBOSE = XLAT_STYLE_RAW | XLAT_STYLE_ABBREV,
-#define XLAT_STYLE_FORMAT_SHIFT 2
-#define XLAT_STYLE_VERBOSITY_MASK ((1 << XLAT_STYLE_FORMAT_SHIFT) - 1)
+# define XLAT_STYLE_FORMAT_SHIFT 2
+# define XLAT_STYLE_VERBOSITY_MASK ((1 << XLAT_STYLE_FORMAT_SHIFT) - 1)
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,
-#define XLAT_STYLE_FORMAT_MASK (3 << XLAT_STYLE_FORMAT_SHIFT)
+# 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_STYLE_SPEC_BITS (XLAT_STYLE_FORMAT_SHIFT + 2)
+# define XLAT_STYLE_MASK ((1 << XLAT_STYLE_SPEC_BITS) - 1)
};
struct xlat {
#if defined MAP_RENAME && MAP_RENAME == MAP_ANONYMOUS /* MAP_RENAME is unusual */
# ifndef STRACE_WORKAROUND_FOR_MAP_RENAME
-# define STRACE_WORKAROUND_FOR_MAP_RENAME
+# define STRACE_WORKAROUND_FOR_MAP_RENAME
/* glibc erroneously defines MAP_RENAME to MAP_ANONYMOUS on some architectures. */
/* This is just wrong and has to be fixed. */
-# undef MAP_RENAME
+# undef MAP_RENAME
# endif
#endif /* MAP_RENAME */
MAP_SYNC 0x80000
-# if defined MAP_UNINITIALIZED && MAP_UNINITIALIZED > 0
+#if defined MAP_UNINITIALIZED && MAP_UNINITIALIZED > 0
MAP_UNINITIALIZED
-# endif
+#endif
#if defined __alpha__
MAP_FIXED_NOREPLACE 0x200000
#if defined O_NDELAY && O_NDELAY & O_NONBLOCK /* O_NDELAY is unusual */
# ifndef STRACE_WORKAROUND_FOR_O_NDELAY
-# define STRACE_WORKAROUND_FOR_O_NDELAY
+# define STRACE_WORKAROUND_FOR_O_NDELAY
/* On sparc32 O_NDELAY is erroneously defined to (0x0004 | O_NONBLOCK). */
/* On many architectures O_NDELAY is defined to O_NONBLOCK. */
/* Both cases are wrong and have to be fixed. */
-# undef O_NDELAY
+# undef O_NDELAY
# endif
#endif /* O_NDELAY & O_NONBLOCK */
*/
#ifndef STRACE_XMALLOC_H
-#define STRACE_XMALLOC_H
+# define STRACE_XMALLOC_H
-#include <stddef.h>
-#include "gcc_compat.h"
+# include <stddef.h>
+# include "gcc_compat.h"
-#define xcalloc strace_calloc
-#define xmalloc strace_malloc
+# define xcalloc strace_calloc
+# define xmalloc strace_malloc
void *xcalloc(size_t nmemb, size_t size)
ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1, 2));
*/
#ifndef STRACE_XSTRING_H
-#define STRACE_XSTRING_H
+# define STRACE_XSTRING_H
-#include <stdarg.h>
-#include <stdio.h>
+# include <stdarg.h>
+# include <stdio.h>
-#include "error_prints.h"
-#include "gcc_compat.h"
+# include "error_prints.h"
+# include "gcc_compat.h"
/**
* Print to static buffer and die on (really unexpected) errors and overflows.
* @param fmt_ Format string.
* @param ... Format arguments.
*/
-#define xsnprintf(str_, size_, fmt_, ...) \
+# define xsnprintf(str_, size_, fmt_, ...) \
xsnprintf_((str_), (size_), __func__, #fmt_ ", " #__VA_ARGS__, \
(fmt_), __VA_ARGS__)
* @param fmt_ Format string.
* @param ... Format arguments.
*/
-#define xsprintf(str_, fmt_, ...) \
+# define xsprintf(str_, fmt_, ...) \
xsnprintf((str_), sizeof(str_) + MUST_BE_ARRAY(str_), (fmt_), \
__VA_ARGS__)
* @param ... Format arguments.
* @return New position.
*/
-#define xappendstr(str_, pos_, fmt_, ...) \
+# define xappendstr(str_, pos_, fmt_, ...) \
(xsnprintf((pos_), sizeof(str_) + MUST_BE_ARRAY(str_) - \
get_pos_diff_((str_), sizeof(str_), (pos_), __func__, \
"xappendstr(" #str_ ", " #pos_ ", " #fmt_ ", " \