From: Steven Rostedt <rostedt@goodmis.org>
To: tz.stoyanov@gmail.com
Cc: y.karadz@gmail.com, linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 2/2] trace-cmd: Save the tracee memory map into the trace.dat file.
Date: Mon, 17 Jun 2019 10:12:10 -0400 [thread overview]
Message-ID: <20190617101210.6bbf05ac@gandalf.local.home> (raw)
In-Reply-To: <20190617093722.71de482b@gandalf.local.home>
On Mon, 17 Jun 2019 09:37:22 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> As stated in the last email. The vector size is hard coded as 2, which
> is why I'm reluctant to add a vector version now. If it was dynamic,
> then that would be more of a reason. Here we can just create our own
> structure and use that:
>
> struct tracecmd_map_file {
> int nr_maps;
> int maps_len;
> char *maps;
> }
>
> Or something like that.
As you can't send that to the tracecmd_add_option, you would need
something more like this:
struct tracecmd_map_file {
int nr_maps;
int maps_len;
char maps[0];
};
And then you would need to copy it first before sending it:
struct tracecmd_map_file *tmap;
tmap = malloc(sizeof(*tmap) + s.len + 1);
and copy the buffer:
memcpy(&tmap->maps[0], s.buffer, s.len + 1);
before sending it to tracecmd_add_option();
-- Steve
prev parent reply other threads:[~2019-06-17 14:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 11:52 [PATCH 0/2] Save tracee memory map into trace.dat file tz.stoyanov
2019-06-17 11:52 ` [PATCH 1/2] trace-cmd: Implemented new API tracecmd_add_option_v() tz.stoyanov
2019-06-17 13:06 ` Steven Rostedt
2019-06-17 13:18 ` Ceco
2019-06-17 13:39 ` Steven Rostedt
2019-06-17 11:52 ` [PATCH 2/2] trace-cmd: Save the tracee memory map into the trace.dat file tz.stoyanov
2019-06-17 13:37 ` Steven Rostedt
2019-06-17 14:12 ` Steven Rostedt [this message]
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=20190617101210.6bbf05ac@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=tz.stoyanov@gmail.com \
--cc=y.karadz@gmail.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;
as well as URLs for NNTP newsgroup(s).