This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC 0/2 gdbserver] Compute 'traceframe usage' per tracepoint
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Wed, 12 Dec 2012 09:37:44 +0800
- Subject: [RFC 0/2 gdbserver] Compute 'traceframe usage' per tracepoint
Hi,
I happen to see that field 'traceframe_usage' in tracepoint in GDB is
always zero, because its value is from GDBserver and GDBserver doesn't
get a correct one of 'traceframe_usage'. The 'traceframe usage' is
always zero when 'traceframe_usage' was added in this patch,
[PATCH v2] Tracing notes and metadata
http://sourceware.org/ml/gdb-patches/2011-11/msg00484.html
The patch 2/2 fixes this problem by computing the traceframe usage when
replying to packet 'qTP'.
The other approach of fixing this problem
is to continue to use field 'traceframe_usage' of 'struct tracepoint'
and accumulate it when adding a block to a traceframe
(in add_traceframe_block). Each 'traceframe' has the number of
tracepoint, but it is not a good way to iterate the tracepoint list
to find the right tracepoint and increment its field
'traceframe_usuage' inside add_traceframe_block, which should be done
as fast it could be. Then, I thought that we may use pointer to
'struct tracepoint' instead of tracepoint num in 'struct traceframe',
but comments of 'struct traceframe' tell me that I shouldn't do this,
"This object should be as small as possible". If we don't mind
increasing 2 bytes (on 32-bit target) for each 'struct traceframe',
I am OK to replace 'tpnum' with a pointer to 'struct tracepoint',
and post the patches in the other approach.
If we follow the approach of this patch, that means we don't need
the field 'traceframe_usage' in 'struct tracepoint' in GDBserver,
and we can remove it. What do you think?
Test case: check traceframe_usage.
Compute traceframe usuage per tracepoint on demand.
gdb/gdbserver/tracepoint.c | 12 ++++++++-
gdb/testsuite/gdb.trace/disconnected-tracing.c | 8 ++++++
gdb/testsuite/gdb.trace/disconnected-tracing.exp | 29 ++++++++++++++++++----
gdb/testsuite/gdb.trace/infotrace.exp | 27 ++++++++++++++++++++
4 files changed, 70 insertions(+), 6 deletions(-)
--
1.7.7.6