btrace: Use function segment index in call iterator.

Remove FUNCTION pointer in struct btrace_call_iterator and use an index into
the list of function segments instead.
This commit is contained in:
Tim Wiederhake
2017-05-30 12:47:37 +02:00
parent 521103fd00
commit f158f20875
4 changed files with 101 additions and 119 deletions

View File

@@ -172,7 +172,7 @@ struct btrace_function
segment in control-flow order. */
unsigned int insn_offset;
/* The function number in control-flow order.
/* The 1-based function number in control-flow order.
If INSN is empty indicating a gap in the trace due to a decode error,
we still count the gap as a function. */
unsigned int number;
@@ -209,9 +209,8 @@ struct btrace_call_iterator
/* The branch trace information for this thread. Will never be NULL. */
const struct btrace_thread_info *btinfo;
/* The branch trace function segment.
This will be NULL for the iterator pointing to the end of the trace. */
const struct btrace_function *function;
/* The index of the function segment in BTINFO->FUNCTIONS. */
unsigned int index;
};
/* Branch trace iteration state for "record instruction-history". */