public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/11] btrace: Turn linked list of function call segments into vector
@ 2017-02-17 13:27 Tim Wiederhake
  2017-02-17 13:27 ` [PATCH 01/11] btrace: Use struct btrace_thread_info fields directly Tim Wiederhake
                   ` (11 more replies)
  0 siblings, 12 replies; 20+ messages in thread
From: Tim Wiederhake @ 2017-02-17 13:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: markus.t.metzger

Hi all,

this series removes the extra list of btrace function call segments in struct
btrace_thread_info.  To achieve this, the doubly linked list of function call
segments in struct btrace_thread_info is replaced by a (GDB) vector.  In some
instances, struct btrace_thread_info is initialized by memset'ing it to 0x00,
so we can't use std::vector (yet).

Patch 1, 2 and 3 are preparation, patch 4 and 5 change the iterators
(struct btrace_call_iterator and struct btrace_insn_iterator) to use indices
instead of pointers, patch 6 to 11 actually replace the the linked list in
struct btrace_thread_info.

Patch 6 to 11 is actually only one patch that is split up for easier review.
As we push more function call segments in the vector when we decode the trace,
the vector may run out of space and reallocate, rendering all pointers invalid
and preventing incremental change from pointer usage to index usage.

Patch 6 introduces some temporary pre-allocating of memory for this vector,
which is removed in patch 11.  This wastes a lot of memory but allows for
testing each step of the transition.

Regards,
Tim

Tim Wiederhake (11):
  btrace: Use struct btrace_thread_info fields directly.
  btrace: Change parameters to use btrace_thread_info.
  btrace: Add btinfo to instruction interator.
  btrace: Use function segment index in call iterator.
  btrace: Use function segment index in insn iterator.
  [SQUASH] btrace: Save function calls in a vector.
  [SQUASH] btrace: Adjust struct btrace_function::up.
  [SQUASH] btrace: Adjust struct btrace_function::{flow,segment}.
  [SQUASH] btrace: Remove struct btrace_thread_info::{begin,end}.
  [SQUASH] btrace: Remove bfun_s vector.
  [SQUASH] btrace: Cleanup.

 gdb/btrace.c                  | 843 ++++++++++++++++++++----------------------
 gdb/btrace.h                  |  56 ++-
 gdb/python/py-record-btrace.c |  12 +-
 gdb/record-btrace.c           |  32 +-
 4 files changed, 462 insertions(+), 481 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-02-24  9:33 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17 13:27 [PATCH 00/11] btrace: Turn linked list of function call segments into vector Tim Wiederhake
2017-02-17 13:27 ` [PATCH 01/11] btrace: Use struct btrace_thread_info fields directly Tim Wiederhake
2017-02-17 13:27 ` [PATCH 11/11] [SQUASH] btrace: Cleanup Tim Wiederhake
2017-02-17 13:27 ` [PATCH 05/11] btrace: Use function segment index in insn iterator Tim Wiederhake
2017-02-24  9:32   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 02/11] btrace: Change parameters to use btrace_thread_info Tim Wiederhake
2017-02-24  9:32   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 09/11] [SQUASH] btrace: Remove struct btrace_thread_info::{begin,end} Tim Wiederhake
2017-02-17 13:27 ` [PATCH 08/11] [SQUASH] btrace: Adjust struct btrace_function::{flow,segment} Tim Wiederhake
2017-02-24  9:33   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 06/11] [SQUASH] btrace: Save function calls in a vector Tim Wiederhake
2017-02-24  9:33   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 07/11] [SQUASH] btrace: Adjust struct btrace_function::up Tim Wiederhake
2017-02-24  9:33   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 10/11] [SQUASH] btrace: Remove bfun_s vector Tim Wiederhake
2017-02-17 13:27 ` [PATCH 04/11] btrace: Use function segment index in call iterator Tim Wiederhake
2017-02-24  9:32   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 03/11] btrace: Add btinfo to instruction interator Tim Wiederhake
2017-02-24  9:32   ` Metzger, Markus T
2017-02-24  9:32 ` [PATCH 00/11] btrace: Turn linked list of function call segments into vector Metzger, Markus T

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).