aboutsummaryrefslogtreecommitdiff
path: root/gdb/btrace.h
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2018-02-02 12:29:48 +0100
committerMarkus Metzger <markus.t.metzger@intel.com>2018-04-13 11:35:55 +0200
commit4a4495d62d185bdae17ed6aae6ea8249ad07c799 (patch)
tree94046fea4522f3ca526e3ed6d21cb79b0f7cc95f /gdb/btrace.h
parent69f90c75b369cd2d66988a67bbc2a000dd6b9816 (diff)
downloadgdb-4a4495d62d185bdae17ed6aae6ea8249ad07c799.zip
gdb-4a4495d62d185bdae17ed6aae6ea8249ad07c799.tar.gz
gdb-4a4495d62d185bdae17ed6aae6ea8249ad07c799.tar.bz2
btrace: set/show record btrace cpu
Add new set/show commands to set the processor that is used for enabling errata workarounds when decoding branch trace. The general format is "<vendor>:<identifier>" but we also allow two special values "auto" and "none". The default is "auto", which is the current behaviour of having GDB determine the processor on which the trace was recorded. If that cpu is not known to the trace decoder, e.g. when using an old decoder on a new system, decode may fail with "unknown cpu". In most cases it should suffice to 'downgrade' decode to assume an older cpu. Unfortunately, we can't do this automatically. The other special value, "none", disables errata workarounds. gdb/ * NEWS (New options): announce set/show record btrace cpu. * btrace.c: Include record-btrace.h. (btrace_compute_ftrace_pt): Skip enabling errata workarounds if the vendor is unknown. (btrace_compute_ftrace_1): Add cpu parameter. Update callers. Maybe overwrite the btrace configuration's cpu. (btrace_compute_ftrace): Add cpu parameter. Update callers. (btrace_fetch): Add cpu parameter. Update callers. (btrace_maint_update_pt_packets): Call record_btrace_get_cpu. Maybe overwrite the btrace configuration's cpu. Skip enabling errata workarounds if the vendor is unknown. * python/py-record-btrace.c: Include record-btrace.h. (recpy_bt_begin, recpy_bt_end, recpy_bt_instruction_history) (recpy_bt_function_call_history): Call record_btrace_get_cpu. * record-btrace.c (record_btrace_cpu_state_kind): New. (record_btrace_cpu): New. (set_record_btrace_cpu_cmdlist): New. (record_btrace_get_cpu): New. (require_btrace_thread, record_btrace_info) (record_btrace_resume_thread): Call record_btrace_get_cpu. (cmd_set_record_btrace_cpu_none): New. (cmd_set_record_btrace_cpu_auto): New. (cmd_set_record_btrace_cpu): New. (cmd_show_record_btrace_cpu): New. (_initialize_record_btrace): Initialize set/show record btrace cpu commands. * record-btrace.h (record_btrace_get_cpu): New. testsuite/ * gdb.btrace/cpu.exp: New. doc/ * gdb.texinfo: Document set/show record btrace cpu.
Diffstat (limited to 'gdb/btrace.h')
-rw-r--r--gdb/btrace.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/btrace.h b/gdb/btrace.h
index 5c3f21b..4d57edb 100644
--- a/gdb/btrace.h
+++ b/gdb/btrace.h
@@ -385,8 +385,10 @@ extern void btrace_teardown (struct thread_info *);
extern const char *btrace_decode_error (enum btrace_format format, int errcode);
-/* Fetch the branch trace for a single thread. */
-extern void btrace_fetch (struct thread_info *);
+/* Fetch the branch trace for a single thread. If CPU is not NULL, assume
+ CPU for trace decode. */
+extern void btrace_fetch (struct thread_info *,
+ const struct btrace_cpu *cpu);
/* Clear the branch trace for a single thread. */
extern void btrace_clear (struct thread_info *);