#define PGTRACE_STACK_DEPTH 8
typedef enum {
- PGTRACE_RW_LOAD,
- PGTRACE_RW_STORE,
- PGTRACE_RW_PREFETCH
+ PGTRACE_RW_LOAD,
+ PGTRACE_RW_STORE,
+ PGTRACE_RW_PREFETCH
} pgtrace_rw_t;
typedef struct {
- vm_offset_t ad_addr;
- uint64_t ad_data;
+ vm_offset_t ad_addr;
+ uint64_t ad_data;
} pgtrace_addr_data_t;
typedef struct {
- uint64_t rr_time;
- pgtrace_rw_t rr_rw;
- uint8_t rr_num;
- pgtrace_addr_data_t rr_addrdata[RR_NUM_MAX];
+ uint64_t rr_time;
+ pgtrace_rw_t rr_rw;
+ uint8_t rr_num;
+ pgtrace_addr_data_t rr_addrdata[RR_NUM_MAX];
} pgtrace_run_result_t;
#ifdef CONFIG_PGTRACE_NONKEXT
#define PGTRACE_OPTION_SPIN 0x4
typedef struct {
- struct {
- uint32_t sl_bytes;
- } stat_logger;
-
- struct {
- uint64_t sd_ldr;
- uint64_t sd_str;
- uint64_t sd_ldrs;
- uint64_t sd_ldtr;
- uint64_t sd_sttr;
- uint64_t sd_ldtrs;
- uint64_t sd_ldp;
- uint64_t sd_stp;
- uint64_t sd_ldpsw;
- uint64_t sd_prfm;
-
- uint64_t sd_c335;
- uint64_t sd_c336;
- uint64_t sd_c337;
- uint64_t sd_c338;
- uint64_t sd_c339;
- uint64_t sd_c3310;
- uint64_t sd_c3311;
- uint64_t sd_c3312;
- uint64_t sd_c3313;
- uint64_t sd_c3314;
- uint64_t sd_c3315;
- uint64_t sd_c3316;
- } stat_decoder;
+ struct {
+ uint32_t sl_bytes;
+ } stat_logger;
+
+ struct {
+ uint64_t sd_ldr;
+ uint64_t sd_str;
+ uint64_t sd_ldrs;
+ uint64_t sd_ldtr;
+ uint64_t sd_sttr;
+ uint64_t sd_ldtrs;
+ uint64_t sd_ldp;
+ uint64_t sd_stp;
+ uint64_t sd_ldpsw;
+ uint64_t sd_prfm;
+
+ uint64_t sd_c335;
+ uint64_t sd_c336;
+ uint64_t sd_c337;
+ uint64_t sd_c338;
+ uint64_t sd_c339;
+ uint64_t sd_c3310;
+ uint64_t sd_c3311;
+ uint64_t sd_c3312;
+ uint64_t sd_c3313;
+ uint64_t sd_c3314;
+ uint64_t sd_c3315;
+ uint64_t sd_c3316;
+ } stat_decoder;
} pgtrace_stats_t;
void pgtrace_init(void);
extern "C" {
#endif
typedef struct {
- vm_offset_t addr;
- uint64_t bytes;
+ vm_offset_t addr;
+ uint64_t bytes;
} pgtrace_instruction_info_t;
-typedef struct {
- uint64_t id;
- pgtrace_run_result_t res;
- void *stack[PGTRACE_STACK_DEPTH];
+typedef struct {
+ uint64_t id;
+ pgtrace_run_result_t res;
+ void *stack[PGTRACE_STACK_DEPTH];
} log_t;
typedef int (*run_func_t)(uint32_t inst, vm_offset_t pa, vm_offset_t va, void *ss, pgtrace_run_result_t *res);
typedef void (*write_func_t)(pgtrace_run_result_t res);
typedef struct {
- uint64_t magic;
- char *arch;
- char *desc;
- decode_func_t decode;
- run_func_t run;
+ uint64_t magic;
+ char *arch;
+ char *desc;
+ decode_func_t decode;
+ run_func_t run;
} decoder_t;
typedef struct {
- uint64_t magic;
- char *arch;
- char *desc;
- write_func_t write;
+ uint64_t magic;
+ char *arch;
+ char *desc;
+ write_func_t write;
} logger_t;
//------------------------------------