From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Compute traceframe usuage per tracepoint on demand.
Date: Mon, 07 Jan 2013 15:39:00 -0000 [thread overview]
Message-ID: <50EAEC28.9040704@redhat.com> (raw)
In-Reply-To: <50CEE3CF.8070904@codesourcery.com>
On 12/17/2012 09:20 AM, Yao Qi wrote:
> On 12/12/2012 09:37 AM, Yao Qi wrote:
>> + /* Compute the traceframe usage of tracepoint whose number is
>> + NUM. */
>> + for (tframe = FIRST_TRACEFRAME ();
>> + tframe->tpnum != 0;
>> + tframe = NEXT_TRACEFRAME (tframe))
>> + if (tframe->tpnum == num)
>> + traceframe_usage += tframe->data_size;
>> +
>> sprintf (own_buf, "V%" PRIu64 ":%" PRIu64 "", tpoint->hit_count,
>> - tpoint->traceframe_usage);
>> + traceframe_usage);
>
> It is incorrect for tracepoint with multiple locations, because multiple tracepoints in GDBserver have the same tracepoint number, and each tracepoint has its own traceframe usage.
>
> On 12/12/2012 09:37 AM, Yao Qi wrote:
>> 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',
>
> Looks we have to go this way, in order to get the correct traceframe usage of each tracepoint in GDBserver.
To avoid the size penalty on 64-bit, another option would be
for gdbserver to maintain an internal tracepoint number, unique
for each location, and for traceframes to record that instead
of gdb tracepoint number.
Did you try the other option of accounting for usage in
add_traceframe_block? I suspect it may be simple and not
add much more than a few instructions.
> I'll post a new patch again.
I may have missed it. Have you posted it?
--
Pedro Alves
next prev parent reply other threads:[~2013-01-07 15:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2013-01-07 15:56 ` Pedro Alves
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=50EAEC28.9040704@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.com \
/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