From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 4/6] Add id of TSV into traceframe_info.
Date: Tue, 25 Jun 2013 16:18:00 -0000 [thread overview]
Message-ID: <51C9BEC4.5070503@redhat.com> (raw)
In-Reply-To: <1371086914-8398-5-git-send-email-yao@codesourcery.com>
On 06/13/2013 02:28 AM, Yao Qi wrote:
> diff --git a/gdb/ctf.c b/gdb/ctf.c
> index 278f950..1f6402d 100644
> --- a/gdb/ctf.c
> +++ b/gdb/ctf.c
> @@ -1778,6 +1778,18 @@ ctf_traceframe_info (void)
> def = bt_ctf_get_field (event, scope, "length");
> r->length = (uint16_t) bt_ctf_get_uint64 (def);
> }
> + else if (strcmp (name, "tsv") == 0)
> + {
> + int32_t vnum;
> + const struct bt_definition *scope
> + = bt_ctf_get_top_level_scope (event,
> + BT_EVENT_FIELDS);
> + const struct bt_definition *def;
> +
> + def = bt_ctf_get_field (event, scope, "num");
> + vnum = (int32_t) bt_ctf_get_uint64 (def);
> + VEC_safe_push (int, info->tvars, vnum);
The VEC holds "int", so this passing through int32_looks a
little odd. And why uint64, if the id is always written
as int32 ?
Both are written as int32_t:
...
/* number */
ctf_save_write_int32 (&writer->tcs, tsv->number);
...
static void
ctf_write_frame_v_block (struct trace_file_writer *self,
int32_t num, uint64_t val)
{
...
/* num. */
ctf_save_align_write (&writer->tcs, (gdb_byte *) &num, 4, 4);
...
BTW, this made me look at the ctf definitions, and I notice that:
ctf_save_write_metadata (&writer->tcs, "\n");
ctf_save_write_metadata (&writer->tcs,
"event {\n\tname = \"tsv_def\";\n"
"\tid = %u;\n\tfields := struct { \n"
"\t\tint64_t initial_value;\n"
"\t\tint32_t number;\n"
"\t\tint32_t builtin;\n"
"\t\tchars name;\n"
"\t};\n"
"};\n", CTF_EVENT_ID_TSV_DEF);
"number" here is int32_t, but here
ctf_save_write_metadata (&writer->tcs, "\n");
ctf_save_write_metadata (&writer->tcs,
"event {\n\tname = \"tsv\";\n\tid = %u;\n"
"\tfields := struct { \n"
"\t\tuint64_t val;\n"
"\t\tuint32_t num;\n"
"\t};\n"
"};\n", CTF_EVENT_ID_TSV);
"num" is uint32_t.
Otherwise this is OK.
Thanks,
--
Pedro Alves
next prev parent reply other threads:[~2013-06-25 16:01 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 13:07 [PATCH 0/5] New MI command -trace-frame-collected Yao Qi
2013-06-07 13:07 ` [PATCH 3/5] Add id of TSV into traceframe_info Yao Qi
2013-06-07 14:39 ` Eli Zaretskii
2013-06-08 11:06 ` Yao Qi
2013-06-07 13:07 ` [PATCH 2/5] Move code to get_traceframe_location Yao Qi
2013-06-07 21:09 ` Pedro Alves
2013-06-07 13:07 ` [PATCH 5/5] New test: gdb.trace/mi-trace-frame-collected.exp Yao Qi
2013-06-07 13:07 ` [PATCH 1/5] Remove global variable tracepoint_list and stepping_list Yao Qi
2013-06-07 20:50 ` Pedro Alves
2013-06-07 13:07 ` [PATCH 4/5] New MI command -trace-frame-collected Yao Qi
2013-06-13 1:29 ` [PATCH 0/6 V2] " Yao Qi
2013-06-13 1:29 ` [PATCH 6/6] New test: gdb.trace/mi-trace-frame-collected.exp Yao Qi
2013-06-25 18:42 ` Pedro Alves
2013-06-26 10:32 ` Yao Qi
2013-06-13 1:29 ` [PATCH 3/6] Move code to get_traceframe_location Yao Qi
2013-06-25 15:43 ` Pedro Alves
2013-06-13 1:29 ` [PATCH 2/6] Emit error in tdump command when traceframe is not selected Yao Qi
2013-06-25 15:32 ` Pedro Alves
2013-06-13 1:29 ` [PATCH 4/6] Add id of TSV into traceframe_info Yao Qi
2013-06-13 3:40 ` Eli Zaretskii
2013-06-25 16:18 ` Pedro Alves [this message]
2013-06-26 8:19 ` Yao Qi
2013-06-13 1:29 ` [PATCH 5/6] New MI command -trace-frame-collected Yao Qi
2013-06-13 14:27 ` Eli Zaretskii
2013-06-14 9:52 ` Yao Qi
2013-06-14 12:34 ` Eli Zaretskii
2013-06-17 10:21 ` Yao Qi
2013-06-17 15:48 ` Eli Zaretskii
2013-06-18 14:09 ` Yao Qi
2013-06-18 17:24 ` Eli Zaretskii
2013-06-25 17:31 ` Pedro Alves
2013-06-26 8:29 ` Yao Qi
2013-06-26 11:22 ` Pedro Alves
2013-06-13 2:46 ` [PATCH 1/6] Remove global variable tracepoint_list and stepping_list Yao Qi
2013-06-25 15:28 ` Pedro Alves
2013-06-24 15:25 ` [ping]: [PATCH 0/6 V2] New MI command -trace-frame-collected 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=51C9BEC4.5070503@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