Fix preprocessor indentation
Indent the C preprocessor directives to reflect their nesting using the following script: $ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do cppi < "$f" > "$f".cppi; mv "$f".cppi "$f" done
This commit is contained in:
parent
51bd6db1ef
commit
d6c71dd061
@ -7,9 +7,9 @@
|
||||
|
||||
/* 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 */
|
||||
|
2
block.c
2
block.c
@ -47,7 +47,7 @@ typedef struct blk_user_trace_setup {
|
||||
|
||||
/* 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
|
||||
|
94
bpf_attr.h
94
bpf_attr.h
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
@ -19,21 +19,21 @@
|
||||
* v4.16-rc1~123^2~109^2~5^2~4.
|
||||
*/
|
||||
|
||||
#ifndef BPF_OBJ_NAME_LEN
|
||||
# ifndef BPF_OBJ_NAME_LEN
|
||||
# define BPF_OBJ_NAME_LEN 16U
|
||||
#else
|
||||
# else
|
||||
# if BPF_OBJ_NAME_LEN != 16U
|
||||
# error "Unexpected value of BPF_OBJ_NAME_LEN"
|
||||
# endif
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifndef BPF_TAG_SIZE
|
||||
# ifndef BPF_TAG_SIZE
|
||||
# define BPF_TAG_SIZE 8
|
||||
#else
|
||||
# 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;
|
||||
@ -47,9 +47,9 @@ struct BPF_MAP_CREATE_struct {
|
||||
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;
|
||||
@ -57,9 +57,9 @@ struct BPF_MAP_LOOKUP_ELEM_struct {
|
||||
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;
|
||||
@ -68,18 +68,18 @@ struct BPF_MAP_UPDATE_ELEM_struct {
|
||||
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;
|
||||
@ -87,9 +87,9 @@ struct BPF_MAP_GET_NEXT_KEY_struct {
|
||||
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;
|
||||
@ -106,9 +106,9 @@ struct BPF_PROG_LOAD_struct {
|
||||
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;
|
||||
@ -116,12 +116,12 @@ struct BPF_OBJ_PIN_struct {
|
||||
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;
|
||||
@ -130,9 +130,9 @@ struct BPF_PROG_ATTACH_struct {
|
||||
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;
|
||||
@ -140,9 +140,9 @@ struct BPF_PROG_DETACH_struct {
|
||||
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;
|
||||
@ -155,9 +155,9 @@ struct BPF_PROG_TEST_RUN_struct /* test */ {
|
||||
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;
|
||||
@ -165,12 +165,12 @@ struct BPF_PROG_GET_NEXT_ID_struct {
|
||||
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;
|
||||
@ -178,9 +178,9 @@ struct BPF_PROG_GET_FD_BY_ID_struct {
|
||||
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;
|
||||
@ -188,9 +188,9 @@ struct BPF_MAP_GET_FD_BY_ID_struct {
|
||||
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;
|
||||
@ -198,9 +198,9 @@ struct BPF_OBJ_GET_INFO_BY_FD_struct /* info */ {
|
||||
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;
|
||||
@ -211,18 +211,18 @@ struct BPF_PROG_QUERY_struct /* query */ {
|
||||
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;
|
||||
@ -241,9 +241,9 @@ struct bpf_map_info_struct {
|
||||
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;
|
||||
@ -267,8 +267,8 @@ struct bpf_prog_info_struct {
|
||||
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 */
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_BPF_FILTER_H
|
||||
#define STRACE_BPF_FILTER_H
|
||||
# define STRACE_BPF_FILTER_H
|
||||
|
||||
struct bpf_filter_block {
|
||||
uint16_t code;
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_BPF_FPROG_H
|
||||
#define STRACE_BPF_FPROG_H
|
||||
# define STRACE_BPF_FPROG_H
|
||||
|
||||
struct bpf_fprog {
|
||||
unsigned short len;
|
||||
|
118
btrfs.c
118
btrfs.c
@ -10,10 +10,10 @@
|
||||
|
||||
#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>
|
||||
|
||||
@ -32,8 +32,8 @@ typedef struct btrfs_ioctl_vol_args_v2
|
||||
|
||||
#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
|
||||
@ -41,15 +41,15 @@ typedef struct btrfs_ioctl_vol_args_v2
|
||||
*/
|
||||
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;
|
||||
@ -58,13 +58,13 @@ struct btrfs_ioctl_defrag_range_args {
|
||||
uint32_t compress_type;
|
||||
uint32_t unused[4];
|
||||
};
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifndef BTRFS_LABEL_SIZE
|
||||
# ifndef BTRFS_LABEL_SIZE
|
||||
# define BTRFS_LABEL_SIZE 256
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifndef BTRFS_IOC_QUOTA_RESCAN
|
||||
# ifndef BTRFS_IOC_QUOTA_RESCAN
|
||||
struct btrfs_ioctl_quota_rescan_args {
|
||||
uint64_t flags, progress, reserved[6];
|
||||
};
|
||||
@ -72,22 +72,22 @@ struct btrfs_ioctl_quota_rescan_args {
|
||||
struct btrfs_ioctl_quota_rescan_args)
|
||||
# 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
|
||||
# ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT
|
||||
# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifndef 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 _IOW(BTRFS_IOCTL_MAGIC, 57, \
|
||||
struct btrfs_ioctl_feature_flags[2])
|
||||
# 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
|
||||
# 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 {
|
||||
@ -97,34 +97,34 @@ struct btrfs_ioctl_search_args_v2 {
|
||||
* to store item */
|
||||
uint64_t buf[0]; /* out - found items */
|
||||
};
|
||||
#endif
|
||||
# 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"
|
||||
# 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)
|
||||
@ -135,7 +135,7 @@ 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
|
||||
@ -222,9 +222,9 @@ btrfs_print_qgroup_limit(const struct btrfs_qgroup_limit *lim)
|
||||
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)
|
||||
|
||||
@ -718,9 +718,9 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
|
||||
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;
|
||||
@ -729,16 +729,16 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
|
||||
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);
|
||||
@ -892,11 +892,11 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
|
||||
|
||||
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("}");
|
||||
@ -1262,9 +1262,9 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
|
||||
|
||||
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
|
||||
|
28
cacheflush.c
28
cacheflush.c
@ -20,15 +20,15 @@
|
||||
# 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
|
||||
};
|
||||
|
||||
@ -72,18 +72,18 @@ SYS_FUNC(cacheflush)
|
||||
|
||||
#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
|
||||
};
|
||||
|
||||
|
452
defs.h
452
defs.h
@ -9,67 +9,67 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_DEFS_H
|
||||
#define STRACE_DEFS_H
|
||||
# define STRACE_DEFS_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
# 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>
|
||||
# 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 <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"
|
||||
# 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
|
||||
# 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)
|
||||
# if defined(__GLIBC__) && defined(__sigemptyset) && !defined(sigemptyset)
|
||||
# define sigemptyset __sigemptyset
|
||||
#endif
|
||||
# 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
|
||||
# endif
|
||||
# ifndef DEFAULT_ACOLUMN
|
||||
# define DEFAULT_ACOLUMN 40 /* default alignment column for results */
|
||||
#endif
|
||||
# endif
|
||||
/*
|
||||
* Maximum number of args to a syscall.
|
||||
*
|
||||
@ -77,94 +77,94 @@ extern char *stpcpy(char *dst, const char *src);
|
||||
* linux/<ARCH>/syscallent*.h:
|
||||
* all have nargs <= 6 except mips o32 which has nargs <= 7.
|
||||
*/
|
||||
#ifndef MAX_ARGS
|
||||
# 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
|
||||
# ifndef DEFAULT_SORTBY
|
||||
# define DEFAULT_SORTBY "time"
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* To force NOMMU build, set to 1 */
|
||||
#define NOMMU_SYSTEM 0
|
||||
# define NOMMU_SYSTEM 0
|
||||
|
||||
#ifndef ERESTARTSYS
|
||||
# ifndef ERESTARTSYS
|
||||
# define ERESTARTSYS 512
|
||||
#endif
|
||||
#ifndef ERESTARTNOINTR
|
||||
# endif
|
||||
# ifndef ERESTARTNOINTR
|
||||
# define ERESTARTNOINTR 513
|
||||
#endif
|
||||
#ifndef ERESTARTNOHAND
|
||||
# endif
|
||||
# ifndef ERESTARTNOHAND
|
||||
# define ERESTARTNOHAND 514
|
||||
#endif
|
||||
#ifndef ERESTART_RESTARTBLOCK
|
||||
# endif
|
||||
# ifndef ERESTART_RESTARTBLOCK
|
||||
# define ERESTART_RESTARTBLOCK 516
|
||||
#endif
|
||||
# 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"
|
||||
# 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
|
||||
# if SUPPORTED_PERSONALITIES > 1
|
||||
# define PERSONALITY1_WORDSIZE 4
|
||||
# define PERSONALITY1_KLONGSIZE PERSONALITY1_WORDSIZE
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if SUPPORTED_PERSONALITIES > 2
|
||||
# if SUPPORTED_PERSONALITIES > 2
|
||||
# define PERSONALITY2_WORDSIZE 4
|
||||
# define PERSONALITY2_KLONGSIZE PERSONALITY0_KLONGSIZE
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if SUPPORTED_PERSONALITIES > 1 && defined HAVE_M32_MPERS
|
||||
# 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
|
||||
# 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
|
||||
# endif
|
||||
|
||||
#if SUPPORTED_PERSONALITIES > 2 && defined HAVE_MX32_MPERS
|
||||
# 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
|
||||
# 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
|
||||
# endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# ifdef WORDS_BIGENDIAN
|
||||
# define is_bigendian true
|
||||
#else
|
||||
# else
|
||||
# define is_bigendian false
|
||||
#endif
|
||||
# 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 \
|
||||
@ -186,7 +186,7 @@ struct inject_opts {
|
||||
struct inject_data data;
|
||||
};
|
||||
|
||||
#define MAX_ERRNO_VALUE 4095
|
||||
# define MAX_ERRNO_VALUE 4095
|
||||
|
||||
/* Trace Control Block */
|
||||
struct tcb {
|
||||
@ -197,9 +197,9 @@ 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 */
|
||||
@ -216,20 +216,20 @@ struct tcb {
|
||||
|
||||
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?
|
||||
*
|
||||
@ -241,51 +241,51 @@ struct tcb {
|
||||
* 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 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 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)
|
||||
# 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"
|
||||
# include "xlat.h"
|
||||
|
||||
extern const struct xlat addrfams[];
|
||||
|
||||
@ -338,24 +338,24 @@ extern const struct xlat tcp_states[];
|
||||
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,
|
||||
@ -405,18 +405,18 @@ extern struct path_set {
|
||||
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 *);
|
||||
|
||||
@ -495,7 +495,7 @@ static inline int set_tcb_priv_ulong(struct tcb *tcp, unsigned long val)
|
||||
*/
|
||||
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))
|
||||
|
||||
/**
|
||||
@ -510,7 +510,7 @@ tfetch_mem(struct tcb *tcp, const kernel_ulong_t addr,
|
||||
{
|
||||
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))
|
||||
|
||||
/**
|
||||
@ -533,7 +533,7 @@ tfetch_mem_ignore_syserror(struct tcb *tcp, const kernel_ulong_t addr,
|
||||
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
|
||||
@ -542,7 +542,7 @@ umoven_or_printaddr(struct tcb *tcp, const kernel_ulong_t addr,
|
||||
{
|
||||
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))
|
||||
|
||||
/**
|
||||
@ -551,7 +551,7 @@ umoven_or_printaddr(struct tcb *tcp, const kernel_ulong_t addr,
|
||||
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))
|
||||
|
||||
@ -561,7 +561,7 @@ umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const kernel_ulong_t addr,
|
||||
{
|
||||
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))
|
||||
|
||||
@ -574,9 +574,9 @@ umovestr(struct tcb *, kernel_ulong_t addr, unsigned int len, char *laddr);
|
||||
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);
|
||||
@ -625,14 +625,14 @@ str_strip_prefix_len(const char *str, const char *prefix, size_t prefix_len)
|
||||
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);
|
||||
@ -644,13 +644,13 @@ extern int print_quoted_cstring(const char *, unsigned int);
|
||||
/* a refers to the lower numbered u_arg,
|
||||
* b refers to the higher numbered u_arg
|
||||
*/
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# ifdef WORDS_BIGENDIAN
|
||||
# define ULONG_LONG(a, b) \
|
||||
((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))
|
||||
#else
|
||||
# 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));
|
||||
@ -663,15 +663,15 @@ printaddr(const kernel_ulong_t addr)
|
||||
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,
|
||||
@ -691,9 +691,9 @@ printxval_searchn(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
* 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__))
|
||||
|
||||
@ -708,9 +708,9 @@ printxval_indexn(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
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)
|
||||
|
||||
@ -745,7 +745,7 @@ enum xlat_style_private_flag_bits {
|
||||
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 */
|
||||
@ -757,17 +757,17 @@ enum xlat_style_private_flags {
|
||||
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 *);
|
||||
@ -870,7 +870,7 @@ printpathn(struct tcb *, kernel_ulong_t addr, unsigned int n);
|
||||
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);
|
||||
@ -896,7 +896,7 @@ extern void
|
||||
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);
|
||||
|
||||
@ -947,7 +947,7 @@ extern void print_bpf_filter_code(const uint16_t code, bool extended);
|
||||
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. */
|
||||
@ -966,7 +966,7 @@ DECL_IOCTL(scsi);
|
||||
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);
|
||||
@ -976,7 +976,7 @@ struct nlmsghdr;
|
||||
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) \
|
||||
@ -1000,18 +1000,18 @@ extern void ts_sub(struct timespec *, const struct timespec *, const struct time
|
||||
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)
|
||||
@ -1080,7 +1080,7 @@ tprint_iov(struct tcb *tcp, kernel_ulong_t len, kernel_ulong_t addr,
|
||||
tprint_iov_upto(tcp, len, addr, decode_iov, -1);
|
||||
}
|
||||
|
||||
#ifdef ALPHA
|
||||
# ifdef ALPHA
|
||||
typedef struct {
|
||||
int tv_sec, tv_usec;
|
||||
} timeval32_t;
|
||||
@ -1091,9 +1091,9 @@ extern const char *sprint_timeval32(struct tcb *, kernel_ulong_t addr);
|
||||
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
|
||||
@ -1109,7 +1109,7 @@ enum user_desc_print_filter {
|
||||
|
||||
extern void print_user_desc(struct tcb *, kernel_ulong_t addr,
|
||||
enum user_desc_print_filter filter);
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* Strace log generation machinery.
|
||||
*
|
||||
@ -1150,18 +1150,18 @@ print_mac_addr(const char *prefix, const uint8_t addr[], size_t size)
|
||||
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
|
||||
# else
|
||||
# define set_personality(personality) ((void)0)
|
||||
# define current_personality 0
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if SUPPORTED_PERSONALITIES == 1
|
||||
# if SUPPORTED_PERSONALITIES == 1
|
||||
# define current_wordsize PERSONALITY0_WORDSIZE
|
||||
# define current_klongsize PERSONALITY0_KLONGSIZE
|
||||
#else
|
||||
# else
|
||||
# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_WORDSIZE == PERSONALITY1_WORDSIZE
|
||||
# define current_wordsize PERSONALITY0_WORDSIZE
|
||||
# else
|
||||
@ -1172,10 +1172,10 @@ extern unsigned current_wordsize;
|
||||
# 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
|
||||
@ -1184,7 +1184,7 @@ extern unsigned current_klongsize;
|
||||
* 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
|
||||
@ -1198,18 +1198,18 @@ print_big_u64_addr(const uint64_t addr)
|
||||
tprints(" or ");
|
||||
}
|
||||
}
|
||||
#else /* !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 */
|
||||
# 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
|
||||
# else
|
||||
# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG 0
|
||||
#endif
|
||||
# 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)) \
|
||||
@ -1218,18 +1218,18 @@ printnum_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
|
||||
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)
|
||||
@ -1256,7 +1256,7 @@ printnum_ptr(struct tcb *tcp, kernel_ulong_t addr)
|
||||
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)
|
||||
@ -1276,7 +1276,7 @@ printnum_ptr(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)
|
||||
@ -1296,9 +1296,9 @@ printnum_ptr(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
|
||||
@ -1307,7 +1307,7 @@ printnum_kptr(struct tcb *tcp, kernel_ulong_t addr)
|
||||
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)
|
||||
@ -1315,7 +1315,7 @@ 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)
|
||||
@ -1323,9 +1323,9 @@ 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)) \
|
||||
@ -1333,16 +1333,16 @@ printpair_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
|
||||
|
||||
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;
|
||||
}
|
||||
@ -1351,11 +1351,11 @@ truncate_klong_to_current_wordsize(const kernel_long_t 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;
|
||||
}
|
||||
@ -1364,12 +1364,12 @@ truncate_kulong_to_current_wordsize(const kernel_ulong_t 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) : \
|
||||
@ -1379,7 +1379,7 @@ truncate_kulong_to_current_wordsize(const kernel_ulong_t 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) : \
|
||||
@ -1398,13 +1398,13 @@ extern const char *const personality_names[];
|
||||
/* 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
|
||||
# else
|
||||
# define sysent sysent0
|
||||
# define ioctlent ioctlent0
|
||||
#endif
|
||||
# endif
|
||||
|
||||
extern unsigned nsyscalls;
|
||||
extern unsigned nioctlents;
|
||||
@ -1413,17 +1413,17 @@ extern const unsigned int nsyscall_vec[SUPPORTED_PERSONALITIES];
|
||||
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 */
|
||||
# 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 */
|
||||
# endif /* !IN_MPERS_BOOTSTRAP */
|
||||
|
||||
/* Checks that sysent[scno] is not out of range. */
|
||||
static inline bool
|
||||
@ -1445,12 +1445,12 @@ scno_is_valid(kernel_ulong_t scno)
|
||||
&& !(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 */
|
||||
|
2
delay.h
2
delay.h
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#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);
|
||||
|
2
dm.c
2
dm.c
@ -98,7 +98,7 @@ dm_decode_values(struct tcb *tcp, const unsigned int code,
|
||||
}
|
||||
}
|
||||
|
||||
#include "xlat/dm_flags.h"
|
||||
# include "xlat/dm_flags.h"
|
||||
|
||||
static void
|
||||
dm_decode_flags(const struct dm_ioctl *ioc)
|
||||
|
@ -11,11 +11,11 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
||||
@ -31,29 +31,29 @@ void error_msg_and_die(const char *fmt, ...)
|
||||
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 */
|
||||
|
2
evdev.c
2
evdev.c
@ -186,7 +186,7 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
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_))
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#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>
|
||||
|
12
f_owner_ex.h
12
f_owner_ex.h
@ -6,16 +6,16 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
# else
|
||||
# error struct f_owner_ex definition not found in <linux/fcntl.h>
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* !STRACE_F_OWNER_EX_H */
|
||||
|
2
filter.h
2
filter.h
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_FILTER_H
|
||||
#define STRACE_FILTER_H
|
||||
# define STRACE_FILTER_H
|
||||
|
||||
struct number_set;
|
||||
typedef int (*string_to_uint_func)(const char *);
|
||||
|
20
flock.h
20
flock.h
@ -7,24 +7,24 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
# else
|
||||
# error struct flock definition not found in <linux/fcntl.h>
|
||||
#endif
|
||||
# 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
|
||||
# else
|
||||
# error struct flock64 definition not found in <linux/fcntl.h>
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* !STRACE_FLOCK_H */
|
||||
|
86
gcc_compat.h
86
gcc_compat.h
@ -7,114 +7,114 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_GCC_COMPAT_H
|
||||
#define STRACE_GCC_COMPAT_H
|
||||
# define STRACE_GCC_COMPAT_H
|
||||
|
||||
#if defined __GNUC__ && defined __GNUC_MINOR__
|
||||
# if defined __GNUC__ && defined __GNUC_MINOR__
|
||||
# define GNUC_PREREQ(maj, min) \
|
||||
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
||||
#else
|
||||
# else
|
||||
# define GNUC_PREREQ(maj, min) 0
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if defined __clang__ && defined __clang_major__ && defined __clang_minor__
|
||||
# if defined __clang__ && defined __clang_major__ && defined __clang_minor__
|
||||
# define CLANG_PREREQ(maj, min) \
|
||||
((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
|
||||
#else
|
||||
# else
|
||||
# define CLANG_PREREQ(maj, min) 0
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if !(GNUC_PREREQ(2, 0) || CLANG_PREREQ(1, 0))
|
||||
# if !(GNUC_PREREQ(2, 0) || CLANG_PREREQ(1, 0))
|
||||
# define __attribute__(x) /* empty */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(2, 5)
|
||||
# if GNUC_PREREQ(2, 5)
|
||||
# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
|
||||
#else
|
||||
# else
|
||||
# define ATTRIBUTE_NORETURN /* empty */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(2, 7)
|
||||
# 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
|
||||
# else
|
||||
# define ATTRIBUTE_FORMAT(args) /* empty */
|
||||
# define ATTRIBUTE_ALIGNED(arg) /* empty */
|
||||
# define ATTRIBUTE_PACKED /* empty */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(3, 0)
|
||||
# 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
|
||||
# else
|
||||
# define SAME_TYPE(x, y) 0
|
||||
# define MUST_BE_ARRAY(a) 0
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(3, 0)
|
||||
# if GNUC_PREREQ(3, 0)
|
||||
# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
|
||||
#else
|
||||
# else
|
||||
# define ATTRIBUTE_MALLOC /* empty */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(3, 1)
|
||||
# if GNUC_PREREQ(3, 1)
|
||||
# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
|
||||
#else
|
||||
# else
|
||||
# define ATTRIBUTE_NOINLINE /* empty */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(4, 0)
|
||||
# if GNUC_PREREQ(4, 0)
|
||||
# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
|
||||
#else
|
||||
# else
|
||||
# define ATTRIBUTE_SENTINEL /* empty */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(4, 1)
|
||||
# if GNUC_PREREQ(4, 1)
|
||||
# define ALIGNOF(t_) __alignof__(t_)
|
||||
#else
|
||||
# else
|
||||
# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(4, 3)
|
||||
# if GNUC_PREREQ(4, 3)
|
||||
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
|
||||
#else
|
||||
# else
|
||||
# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(7, 0)
|
||||
# if GNUC_PREREQ(7, 0)
|
||||
# define ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__))
|
||||
#else
|
||||
# else
|
||||
# define ATTRIBUTE_FALLTHROUGH ((void) 0)
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if CLANG_PREREQ(2, 8)
|
||||
# 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 \
|
||||
_Pragma("clang diagnostic pop");
|
||||
#elif GNUC_PREREQ(4, 2)
|
||||
# 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 \
|
||||
_Pragma("GCC diagnostic pop");
|
||||
#else
|
||||
# else
|
||||
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT /* empty */
|
||||
# define DIAG_POP_IGNORE_OVERRIDE_INIT /* empty */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if GNUC_PREREQ(6, 0)
|
||||
# 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 \
|
||||
_Pragma("GCC diagnostic pop");
|
||||
#else
|
||||
# else
|
||||
# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
|
||||
# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* !STRACE_GCC_COMPAT_H */
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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 *);
|
||||
|
14
ipc_defs.h
14
ipc_defs.h
@ -7,21 +7,21 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_IPC_DEFS_H
|
||||
#define STRACE_IPC_DEFS_H
|
||||
# define STRACE_IPC_DEFS_H
|
||||
|
||||
#ifdef HAVE_SYS_IPC_H
|
||||
# ifdef HAVE_SYS_IPC_H
|
||||
# include <sys/ipc.h>
|
||||
#elif defined HAVE_LINUX_IPC_H
|
||||
# elif defined HAVE_LINUX_IPC_H
|
||||
# include <linux/ipc.h>
|
||||
/* While glibc uses __key, the kernel uses key. */
|
||||
# define __key key
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if !defined IPC_64
|
||||
# if !defined IPC_64
|
||||
# define IPC_64 0x100
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#define PRINTCTL(flagset, arg, dflt) \
|
||||
# define PRINTCTL(flagset, arg, dflt) \
|
||||
do { \
|
||||
if ((arg) & IPC_64) { \
|
||||
print_xlat(IPC_64); \
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
@ -35,15 +35,15 @@ typedef struct {
|
||||
char d_name[1];
|
||||
} kernel_dirent;
|
||||
|
||||
#if SIZEOF_KERNEL_LONG_T > SIZEOF_LONG
|
||||
# if SIZEOF_KERNEL_LONG_T > SIZEOF_LONG
|
||||
# define PRI_kl "ll"
|
||||
#else
|
||||
# else
|
||||
# define PRI_kl "l"
|
||||
#endif
|
||||
# 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
|
||||
@ -54,17 +54,17 @@ typedef struct {
|
||||
* 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
|
||||
# if SIZEOF_LONG == 4
|
||||
# define PRI__64 "ll"
|
||||
#elif defined ALPHA || defined IA64 || defined __powerpc64__ \
|
||||
# elif defined ALPHA || defined IA64 || defined __powerpc64__ \
|
||||
|| (defined MIPS && !defined __ANDROID__)
|
||||
# define PRI__64 "l"
|
||||
#else
|
||||
# else
|
||||
# define PRI__64 "ll"
|
||||
#endif
|
||||
# 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 */
|
||||
|
@ -6,16 +6,16 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
@ -6,11 +6,11 @@
|
||||
*/
|
||||
|
||||
#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)
|
||||
|
2
kvm.c
2
kvm.c
@ -107,7 +107,7 @@ map_len(struct mmap_cache_entry_t *map_info)
|
||||
: 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)
|
||||
|
@ -9,11 +9,11 @@
|
||||
*/
|
||||
|
||||
#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 _LARGEFILE64_SOURCE
|
||||
# ifdef HAVE_FOPEN64
|
||||
# define fopen_stream fopen64
|
||||
# else
|
||||
@ -25,7 +25,7 @@
|
||||
# define read_dir readdir64
|
||||
# define struct_rlimit struct rlimit64
|
||||
# define set_rlimit setrlimit64
|
||||
#else
|
||||
# else
|
||||
# define fopen_stream fopen
|
||||
# define struct_stat struct stat
|
||||
# define stat_file stat
|
||||
@ -33,6 +33,6 @@
|
||||
# define read_dir readdir
|
||||
# define struct_rlimit struct rlimit
|
||||
# define set_rlimit setrlimit
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* STRACE_LARGEFILE_WRAPPERS_H */
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
@ -17,7 +17,7 @@ raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
|
||||
{
|
||||
*err = 0;
|
||||
|
||||
#ifdef __thumb__ /* && FRAME_POINTERS_ENABLED */
|
||||
# ifdef __thumb__ /* && FRAME_POINTERS_ENABLED */
|
||||
|
||||
register kernel_ulong_t rt;
|
||||
register kernel_ulong_t r0 __asm__("r0");
|
||||
@ -26,7 +26,7 @@ raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
|
||||
: "r"(nr)
|
||||
: "memory");
|
||||
|
||||
#else
|
||||
# else
|
||||
|
||||
register kernel_ulong_t r7 __asm__("r7") = nr;
|
||||
register kernel_ulong_t r0 __asm__("r0");
|
||||
@ -35,7 +35,7 @@ raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
|
||||
: "r"(r7)
|
||||
: "memory");
|
||||
|
||||
#endif
|
||||
# endif
|
||||
|
||||
return r0;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_ASM_STAT_H
|
||||
#define STRACE_ASM_STAT_H
|
||||
# define STRACE_ASM_STAT_H
|
||||
|
||||
# undef dev_t
|
||||
# undef gid_t
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
222
linux/dummy.h
222
linux/dummy.h
@ -8,140 +8,140 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
# ifndef HAVE_STRUCT_USER_DESC
|
||||
# define sys_modify_ldt printargs
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if !(defined HAVE_STRUCT_USER_DESC || defined M68K || defined MIPS)
|
||||
# if !(defined HAVE_STRUCT_USER_DESC || defined M68K || defined MIPS)
|
||||
# define sys_set_thread_area printargs
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if !(defined HAVE_STRUCT_USER_DESC || defined M68K)
|
||||
# if !(defined HAVE_STRUCT_USER_DESC || defined M68K)
|
||||
# define sys_get_thread_area printargs
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifdef ALPHA
|
||||
# ifdef ALPHA
|
||||
# define sys_getdtablesize printargs
|
||||
#endif
|
||||
# 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 */
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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];
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
@ -19,7 +19,7 @@ typedef struct {
|
||||
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 */
|
||||
|
@ -6,10 +6,10 @@
|
||||
*/
|
||||
|
||||
#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 {
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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];
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
@ -45,18 +45,18 @@ enum {
|
||||
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 */
|
||||
|
@ -6,6 +6,6 @@
|
||||
*/
|
||||
|
||||
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]
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
@ -17,12 +17,12 @@ struct packet_diag_req {
|
||||
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;
|
||||
@ -52,11 +52,11 @@ struct packet_diag_info {
|
||||
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 {
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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. */
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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];
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
@ -6,11 +6,11 @@
|
||||
*/
|
||||
|
||||
#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 {
|
||||
|
@ -6,12 +6,12 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
@ -19,7 +19,7 @@ typedef struct {
|
||||
/* 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 */
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,13 +8,13 @@
|
||||
*/
|
||||
|
||||
#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);
|
||||
@ -25,6 +25,6 @@ extern SYS_FUNC(setgroups16);
|
||||
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 */
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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];
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
@ -18,12 +18,12 @@ struct unix_diag_req {
|
||||
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;
|
||||
|
@ -25,9 +25,9 @@ get_personality_from_syscall_info(const struct ptrace_syscall_info *sci)
|
||||
|
||||
kernel_ulong_t scno = sci->entry.nr;
|
||||
|
||||
#ifndef __X32_SYSCALL_BIT
|
||||
# ifndef __X32_SYSCALL_BIT
|
||||
# define __X32_SYSCALL_BIT 0x40000000
|
||||
#endif
|
||||
# endif
|
||||
|
||||
if (pers == 0 && (scno & __X32_SYSCALL_BIT)) {
|
||||
/*
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
|
@ -50,9 +50,9 @@ arch_get_scno(struct tcb *tcp)
|
||||
if ((long long) x86_64_regs.orig_rax != -1) {
|
||||
currpers = 2;
|
||||
} else {
|
||||
# ifdef X32
|
||||
#ifdef X32
|
||||
currpers = 2;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_RAW_SYSCALL_H
|
||||
#define STRACE_RAW_SYSCALL_H
|
||||
# define STRACE_RAW_SYSCALL_H
|
||||
|
||||
# include "kernel_types.h"
|
||||
|
||||
|
2
loop.c
2
loop.c
@ -19,7 +19,7 @@ typedef struct loop_info struct_loop_info;
|
||||
#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"
|
||||
|
4
lseek.c
4
lseek.c
@ -30,11 +30,11 @@ SYS_FUNC(lseek)
|
||||
|
||||
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];
|
||||
}
|
||||
|
36
macros.h
36
macros.h
@ -6,36 +6,36 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
# ifndef MAX
|
||||
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
# endif
|
||||
# ifndef MIN
|
||||
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#define CLAMP(val, min, max) MIN(MAX(min, val), max)
|
||||
# endif
|
||||
# define CLAMP(val, min, max) MIN(MAX(min, val), max)
|
||||
|
||||
#ifndef ROUNDUP
|
||||
# ifndef ROUNDUP
|
||||
# define ROUNDUP(val_, div_) ((((val_) + (div_) - 1) / (div_)) * (div_))
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifndef offsetofend
|
||||
# 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)
|
||||
@ -47,7 +47,7 @@ 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 */
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_MMAP_CACHE_H
|
||||
#define STRACE_MMAP_CACHE_H
|
||||
# define STRACE_MMAP_CACHE_H
|
||||
|
||||
/*
|
||||
* Keep a sorted array of cache entries,
|
||||
|
@ -5,9 +5,9 @@
|
||||
*/
|
||||
|
||||
#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 *);
|
||||
|
||||
|
10
mpers_type.h
10
mpers_type.h
@ -8,11 +8,11 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_MPERS_TYPE_H
|
||||
#define STRACE_MPERS_TYPE_H
|
||||
# define STRACE_MPERS_TYPE_H
|
||||
|
||||
#include "macros.h"
|
||||
# include "macros.h"
|
||||
|
||||
#ifdef IN_MPERS
|
||||
# ifdef IN_MPERS
|
||||
# define DEF_MPERS_TYPE(args) STRINGIFY(args.h)
|
||||
# ifdef MPERS_IS_m32
|
||||
# define MPERS_PREFIX m32_
|
||||
@ -21,7 +21,7 @@
|
||||
# define MPERS_PREFIX mx32_
|
||||
# define MPERS_DEFS "mx32_type_defs.h"
|
||||
# endif
|
||||
#else
|
||||
# else
|
||||
# define MPERS_PREFIX
|
||||
# define DEF_MPERS_TYPE(args) "empty.h"
|
||||
# if IN_MPERS_BOOTSTRAP
|
||||
@ -30,6 +30,6 @@
|
||||
# define MPERS_DEFS "native_defs.h"
|
||||
# endif
|
||||
typedef unsigned long mpers_ptr_t;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* !STRACE_MPERS_TYPE_H */
|
||||
|
2
msghdr.h
2
msghdr.h
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_MSGHDR_H
|
||||
#define STRACE_MSGHDR_H
|
||||
# define STRACE_MSGHDR_H
|
||||
|
||||
/* For definitions of struct msghdr and struct mmsghdr. */
|
||||
# include <sys/socket.h>
|
||||
|
@ -12,7 +12,7 @@
|
||||
#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"
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
@ -18,12 +18,12 @@ is_negated_errno(kernel_ulong_t val)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
4
net.c
4
net.c
@ -65,8 +65,8 @@
|
||||
#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"
|
||||
|
40
netlink.h
40
netlink.h
@ -7,42 +7,42 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_NETLINK_H
|
||||
#define STRACE_NETLINK_H
|
||||
# define STRACE_NETLINK_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <sys/socket.h>
|
||||
#include <linux/netlink.h>
|
||||
# include <stdbool.h>
|
||||
# include <sys/socket.h>
|
||||
# include <linux/netlink.h>
|
||||
|
||||
#ifndef NETLINK_SOCK_DIAG
|
||||
# ifndef NETLINK_SOCK_DIAG
|
||||
# define NETLINK_SOCK_DIAG 4
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifndef NLM_F_NONREC
|
||||
# ifndef NLM_F_NONREC
|
||||
# define NLM_F_NONREC 0x100
|
||||
#endif
|
||||
#ifndef NLM_F_CAPPED
|
||||
# endif
|
||||
# ifndef NLM_F_CAPPED
|
||||
# define NLM_F_CAPPED 0x100
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#undef NLMSG_HDRLEN
|
||||
#define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
|
||||
# undef NLMSG_HDRLEN
|
||||
# define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
|
||||
|
||||
#ifndef NLMSG_MIN_TYPE
|
||||
# ifndef NLMSG_MIN_TYPE
|
||||
# define NLMSG_MIN_TYPE 0x10
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifndef NLA_ALIGN
|
||||
# ifndef NLA_ALIGN
|
||||
# define NLA_ALIGN(len) (((len) + 3) & ~3)
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#undef NLA_HDRLEN
|
||||
#define NLA_HDRLEN ((unsigned int) NLA_ALIGN(sizeof(struct nlattr)))
|
||||
# undef NLA_HDRLEN
|
||||
# define NLA_HDRLEN ((unsigned int) NLA_ALIGN(sizeof(struct nlattr)))
|
||||
|
||||
#ifndef NLA_TYPE_MASK
|
||||
# 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
|
||||
# endif
|
||||
|
||||
static inline bool
|
||||
is_nlmsg_ok(const struct nlmsghdr *const nlh, const ssize_t len)
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#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 */
|
||||
|
@ -8,9 +8,9 @@
|
||||
*/
|
||||
|
||||
#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, \
|
||||
|
@ -65,7 +65,7 @@ print_smc_diag_cursor(const struct smc_diag_cursor *const cursor)
|
||||
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_); \
|
||||
|
@ -7,9 +7,9 @@
|
||||
*/
|
||||
|
||||
#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, \
|
||||
@ -34,7 +34,7 @@ struct inet_diag_sockid;
|
||||
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_)); \
|
||||
|
6
nlattr.h
6
nlattr.h
@ -8,9 +8,9 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
@ -52,7 +52,7 @@ decode_nlattr(struct tcb *,
|
||||
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 *) \
|
||||
|
18
nsfs.h
18
nsfs.h
@ -6,23 +6,23 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
# ifdef HAVE_LINUX_NSFS_H
|
||||
# include <linux/nsfs.h>
|
||||
#else
|
||||
# else
|
||||
# define NSIO 0xb7
|
||||
# define NS_GET_USERNS _IO(NSIO, 0x1)
|
||||
# define NS_GET_PARENT _IO(NSIO, 0x2)
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifndef NS_GET_NSTYPE
|
||||
# ifndef NS_GET_NSTYPE
|
||||
# define NS_GET_NSTYPE _IO(NSIO, 0x3)
|
||||
#endif
|
||||
#ifndef NS_GET_OWNER_UID
|
||||
# endif
|
||||
# ifndef NS_GET_OWNER_UID
|
||||
# define NS_GET_OWNER_UID _IO(NSIO, 0x4)
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* !STRACE_NSFS_H */
|
||||
|
12
nsig.h
12
nsig.h
@ -6,17 +6,17 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_NSIG_H
|
||||
#define STRACE_NSIG_H
|
||||
# define STRACE_NSIG_H
|
||||
|
||||
#include <signal.h>
|
||||
# include <signal.h>
|
||||
|
||||
#ifndef NSIG
|
||||
# ifndef NSIG
|
||||
# warning NSIG is not defined, using 32
|
||||
# define NSIG 32
|
||||
#elif NSIG < 32
|
||||
# elif NSIG < 32
|
||||
# error NSIG < 32
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#define NSIG_BYTES (NSIG / 8)
|
||||
# define NSIG_BYTES (NSIG / 8)
|
||||
|
||||
#endif /* !STRACE_NSIG_H */
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -11,17 +11,17 @@
|
||||
|
||||
#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
|
||||
# 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"
|
||||
# include "xlat/atomic_ops.h"
|
||||
|
||||
SYS_FUNC(or1k_atomic)
|
||||
{
|
||||
|
2
perf.c
2
perf.c
@ -114,7 +114,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* 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; \
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
@ -12,7 +12,7 @@
|
||||
#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"
|
||||
|
@ -7,55 +7,55 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
# ifndef STRACE_PRINTF
|
||||
# define STRACE_PRINTF tprintf
|
||||
#endif
|
||||
# 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_), \
|
||||
@ -63,7 +63,7 @@
|
||||
(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_), \
|
||||
@ -71,7 +71,7 @@
|
||||
(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_), \
|
||||
@ -79,7 +79,7 @@
|
||||
(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_); \
|
||||
@ -88,7 +88,7 @@
|
||||
(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_), \
|
||||
@ -100,7 +100,7 @@
|
||||
* 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_); \
|
||||
@ -109,9 +109,9 @@
|
||||
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) \
|
||||
@ -121,14 +121,14 @@
|
||||
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_, \
|
||||
@ -136,14 +136,14 @@
|
||||
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_, \
|
||||
@ -152,88 +152,88 @@
|
||||
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"); \
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#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>
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "nr_prefix.c"
|
||||
|
||||
#ifndef IN_MPERS
|
||||
#include "printsiginfo.h"
|
||||
# include "printsiginfo.h"
|
||||
#endif
|
||||
|
||||
#include "xlat/audit_arch.h"
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#ifndef STRACE_PRINTSIGINFO_H
|
||||
#define STRACE_PRINTSIGINFO_H
|
||||
# define STRACE_PRINTSIGINFO_H
|
||||
|
||||
extern void printsiginfo(const siginfo_t *);
|
||||
|
||||
|
@ -138,7 +138,7 @@ SYS_FUNC(ptrace)
|
||||
printaddr(addr);
|
||||
}
|
||||
|
||||
# if defined IA64 || defined SPARC || defined SPARC64
|
||||
#if defined IA64 || defined SPARC || defined SPARC64
|
||||
switch (request) {
|
||||
# ifdef IA64
|
||||
case PTRACE_PEEKDATA:
|
||||
@ -156,7 +156,7 @@ SYS_FUNC(ptrace)
|
||||
return RVAL_DECODED;
|
||||
# endif /* SPARC || SPARC64 */
|
||||
}
|
||||
# endif /* IA64 || SPARC || SPARC64 */
|
||||
#endif /* IA64 || SPARC || SPARC64 */
|
||||
|
||||
tprints(", ");
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user