Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/truss/truss.h
Show All 32 Lines | |||||
#define ABSOLUTETIMESTAMPS 0x00000004 | #define ABSOLUTETIMESTAMPS 0x00000004 | ||||
#define NOSIGS 0x00000008 | #define NOSIGS 0x00000008 | ||||
#define EXECVEARGS 0x00000010 | #define EXECVEARGS 0x00000010 | ||||
#define EXECVEENVS 0x00000020 | #define EXECVEENVS 0x00000020 | ||||
#define COUNTONLY 0x00000040 | #define COUNTONLY 0x00000040 | ||||
#define DISPLAYTIDS 0x00000080 | #define DISPLAYTIDS 0x00000080 | ||||
struct procinfo; | struct procinfo; | ||||
struct syscall; | |||||
struct trussinfo; | struct trussinfo; | ||||
/* | |||||
* The lookup of normal system calls are optimized by using a fixed | |||||
* array for the first 1024 system calls that can be indexed directly. | |||||
* Unknown system calls with other IDs are stored in a linked list. | |||||
*/ | |||||
#define SYSCALL_NORMAL_COUNT 1024 | |||||
struct extra_syscall { | |||||
STAILQ_ENTRY(extra_syscall) entries; | |||||
struct syscall *sc; | |||||
u_int number; | |||||
}; | |||||
struct procabi { | struct procabi { | ||||
const char *type; | const char *type; | ||||
enum sysdecode_abi abi; | enum sysdecode_abi abi; | ||||
int (*fetch_args)(struct trussinfo *, u_int); | int (*fetch_args)(struct trussinfo *, u_int); | ||||
int (*fetch_retval)(struct trussinfo *, long *, int *); | int (*fetch_retval)(struct trussinfo *, long *, int *); | ||||
STAILQ_HEAD(, extra_syscall) extra_syscalls; | |||||
struct syscall *syscalls[SYSCALL_NORMAL_COUNT]; | |||||
}; | }; | ||||
#define PROCABI(abi) DATA_SET(procabi, abi) | #define PROCABI(abi) DATA_SET(procabi, abi) | ||||
/* | /* | ||||
* This is confusingly named. It holds per-thread state about the | * This is confusingly named. It holds per-thread state about the | ||||
* currently executing system call. syscall.h defines a struct | * currently executing system call. syscall.h defines a struct | ||||
* syscall that holds metadata used to format system call arguments. | * syscall that holds metadata used to format system call arguments. | ||||
* | * | ||||
* NB: args[] stores the raw argument values (e.g. from registers) | * NB: args[] stores the raw argument values (e.g. from registers) | ||||
* passed to the system call. s_args[] stores a string representation | * passed to the system call. s_args[] stores a string representation | ||||
* of a system call's arguments. These do not necessarily map one to | * of a system call's arguments. These do not necessarily map one to | ||||
* one. A system call description may omit individual arguments | * one. A system call description may omit individual arguments | ||||
* (padding) or combine adjacent arguments (e.g. when passing an off_t | * (padding) or combine adjacent arguments (e.g. when passing an off_t | ||||
* argument on a 32-bit system). The nargs member contains the count | * argument on a 32-bit system). The nargs member contains the count | ||||
* of valid pointers in s_args[], not args[]. | * of valid pointers in s_args[], not args[]. | ||||
*/ | */ | ||||
struct current_syscall { | struct current_syscall { | ||||
struct syscall *sc; | struct syscall *sc; | ||||
const char *name; | unsigned int number; | ||||
int number; | |||||
unsigned long args[10]; | |||||
unsigned int nargs; | unsigned int nargs; | ||||
unsigned long args[10]; | |||||
char *s_args[10]; /* the printable arguments */ | char *s_args[10]; /* the printable arguments */ | ||||
}; | }; | ||||
struct threadinfo | struct threadinfo | ||||
{ | { | ||||
LIST_ENTRY(threadinfo) entries; | LIST_ENTRY(threadinfo) entries; | ||||
struct procinfo *proc; | struct procinfo *proc; | ||||
lwpid_t tid; | lwpid_t tid; | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |