Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [RFC 0/2 gdbserver] Compute 'traceframe usage' per tracepoint
Date: Wed, 12 Dec 2012 01:37:00 -0000	[thread overview]
Message-ID: <1355276266-23163-1-git-send-email-yao@codesourcery.com> (raw)

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


             reply	other threads:[~2012-12-12  1:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12  1:37 Yao Qi [this message]
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
2012-12-12  1:38 ` [PATCH 1/2] Test case: check traceframe_usage Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355276266-23163-1-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox