Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC 0/2 gdbserver] Compute 'traceframe usage' per tracepoint
@ 2012-12-12  1:37 Yao Qi
  2012-12-12  1:38 ` [PATCH 1/2] Test case: check traceframe_usage Yao Qi
  2012-12-12  1:38 ` [PATCH 2/2] Compute traceframe usuage per tracepoint on demand Yao Qi
  0 siblings, 2 replies; 6+ messages in thread
From: Yao Qi @ 2012-12-12  1:37 UTC (permalink / raw)
  To: gdb-patches

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


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

end of thread, other threads:[~2013-01-07 15:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-12  1:37 [RFC 0/2 gdbserver] Compute 'traceframe usage' per tracepoint Yao Qi
2012-12-12  1:38 ` [PATCH 1/2] Test case: check traceframe_usage Yao Qi
2012-12-12  1:38 ` [PATCH 2/2] Compute traceframe usuage per tracepoint on demand Yao Qi
2012-12-17  9:21   ` Yao Qi
2013-01-07 15:39     ` Pedro Alves
2013-01-07 15:56       ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox