diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-06-24 01:00:16 +0545 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-06-24 10:40:17 -0400 |
commit | cf304b56ca48631836bdc4035134b5b5ec3b9d49 (patch) | |
tree | 212abab3cf0d73509a5b1e714b7e361f94d19529 | |
parent | 87d1b30944783ae0efb49236c6d872d775a37417 (diff) | |
download | gdb-cf304b56ca48631836bdc4035134b5b5ec3b9d49.zip gdb-cf304b56ca48631836bdc4035134b5b5ec3b9d49.tar.gz gdb-cf304b56ca48631836bdc4035134b5b5ec3b9d49.tar.bz2 |
sim: trace: add set of system helpers
Some code paths trace on a system instance and not a cpu instance (like
the events code), so add some helpers for those cases.
-rw-r--r-- | sim/common/ChangeLog | 7 | ||||
-rw-r--r-- | sim/common/sim-trace.h | 21 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 21a3fe3..63978bf 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,12 @@ 2015-06-24 Mike Frysinger <vapier@gentoo.org> + * sim-trace.h (STRACE, STRACE_INSN, STRACE_DECODE, STRACE_EXTRACT, + STRACE_LINENUM, STRACE_MEMORY, STRACE_MODEL, STRACE_ALU, STRACE_CORE, + STRACE_EVENTS, STRACE_FPU, STRACE_VPU, STRACE_BRANCH, STRACE_SYSCALL, + STRACE_DEBUG): Define. + +2015-06-24 Mike Frysinger <vapier@gentoo.org> + * sim-trace.c (trace_options): Update help text for trace-alu, trace-fpu, trace-vpu, and trace-semantics. * sim-trace.h (TRACE_ALU_IDX): Update comment text. diff --git a/sim/common/sim-trace.h b/sim/common/sim-trace.h index 0fa44ff..4ef2584 100644 --- a/sim/common/sim-trace.h +++ b/sim/common/sim-trace.h @@ -211,6 +211,27 @@ typedef struct _trace_data { #define STRACE_BRANCH_P(sd) STRACE_P (sd, TRACE_BRANCH_IDX) #define STRACE_SYSCALL_P(sd) STRACE_P (sd, TRACE_SYSCALL_IDX) #define STRACE_DEBUG_P(sd) STRACE_P (sd, TRACE_DEBUG_IDX) + +/* Helper functions for printing messages. */ +#define STRACE(sd, idx, fmt, args...) \ + do { \ + if (STRACE_P (sd, idx)) \ + trace_generic (sd, NULL, idx, fmt, ## args); \ + } while (0) +#define STRACE_INSN(sd, fmt, args...) STRACE (sd, TRACE_INSN_IDX, fmt, ## args) +#define STRACE_DECODE(sd, fmt, args...) STRACE (sd, TRACE_DECODE_IDX, fmt, ## args) +#define STRACE_EXTRACT(sd, fmt, args...) STRACE (sd, TRACE_EXTRACT_IDX, fmt, ## args) +#define STRACE_LINENUM(sd, fmt, args...) STRACE (sd, TRACE_LINENUM_IDX, fmt, ## args) +#define STRACE_MEMORY(sd, fmt, args...) STRACE (sd, TRACE_MEMORY_IDX, fmt, ## args) +#define STRACE_MODEL(sd, fmt, args...) STRACE (sd, TRACE_MODEL_IDX, fmt, ## args) +#define STRACE_ALU(sd, fmt, args...) STRACE (sd, TRACE_ALU_IDX, fmt, ## args) +#define STRACE_CORE(sd, fmt, args...) STRACE (sd, TRACE_CORE_IDX, fmt, ## args) +#define STRACE_EVENTS(sd, fmt, args...) STRACE (sd, TRACE_EVENTS_IDX, fmt, ## args) +#define STRACE_FPU(sd, fmt, args...) STRACE (sd, TRACE_FPU_IDX, fmt, ## args) +#define STRACE_VPU(sd, fmt, args...) STRACE (sd, TRACE_VPU_IDX, fmt, ## args) +#define STRACE_BRANCH(sd, fmt, args...) STRACE (sd, TRACE_BRANCH_IDX, fmt, ## args) +#define STRACE_SYSCALL(sd, fmt, args...) STRACE (sd, TRACE_SYSCALL_IDX, fmt, ## args) +#define STRACE_DEBUG(sd, fmt, args...) STRACE (sd, TRACE_DEBUG_IDX, fmt, ## args) /* CPU tracing support. */ |