From: Steven Rostedt <rostedt@goodmis.org>
To: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Cc: Amit Shah <amit.shah@redhat.com>,
Anthony Liguori <anthony@codemonkey.ws>,
Arnd Bergmann <arnd@arndb.de>, Borislav Petkov <bp@amd64.org>,
"Franch Ch. Eigler" <fche@redhat.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Herbert Xu <herbert@gondor.hengli.com.au>,
Ingo Molnar <mingo@redhat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Rusty Russell <rusty@rustcorp.com.au>,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org,
yrl.pp-manager.tt@hitachi.com
Subject: Re: [PATCH 3/5] trace-cmd: Support trace-agent of virtio-trace
Date: Wed, 22 Aug 2012 09:51:45 -0400 [thread overview]
Message-ID: <1345643505.5069.36.camel@gandalf.local.home> (raw)
In-Reply-To: <20120822084322.17293.70186.stgit@ltc189.sdl.hitachi.co.jp>
On Wed, 2012-08-22 at 17:43 +0900, Yoshihiro YUNOMAE wrote:
> Add read path and control path to use trace-agent of virtio-trace.
> When we use trace-agent, trace-cmd will be used as follows:
> # AGENT_READ_DIR=/tmp/virtio-trace/tracing \
> AGENT_CTL=/tmp/virtio-trace/agent-ctl-path.in \
> TRACING_DIR=/tmp/virtio-trace/debugfs/tracing \\
Ha! You used "TRACING_DIR" but patch one introduces TRACE_DIR. Lets
change this to DEBUG_TRACING_DIR instead anyway.
Also, I don't like the generic environment variables. Perhaps
VIRTIO_TRACE_DIR, or AGENT_TRACE_DIR and AGENT_TRACE_CTL. Lets try to
keep the environment namespace sparse.
> trace-cmd record -e "sched:*"
> Here, AGENT_READ_DIR is the path for a reading directory of virtio-trace,
> AGENT_CTL is a control path of trace-agent, and TRACING_DIR is a debugfs path
> of a guest.
>
> Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
> ---
>
> trace-cmd.h | 1 +
> trace-recorder.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
> trace-util.c | 18 +++++++++++++++++
> 3 files changed, 75 insertions(+), 1 deletions(-)
>
> diff --git a/trace-cmd.h b/trace-cmd.h
> index f904dc5..75506ed 100644
> --- a/trace-cmd.h
> +++ b/trace-cmd.h
> @@ -72,6 +72,7 @@ static inline int tracecmd_host_bigendian(void)
> }
>
> char *tracecmd_find_tracing_dir(void);
> +char *guest_agent_tracing_read_dir(void);
>
> /* --- Opening and Reading the trace.dat file --- */
>
> diff --git a/trace-recorder.c b/trace-recorder.c
> index 215affc..3b750e9 100644
> --- a/trace-recorder.c
> +++ b/trace-recorder.c
> @@ -33,6 +33,7 @@
> #include <unistd.h>
> #include <ctype.h>
> #include <errno.h>
> +#include <stdbool.h>
>
> #include "trace-cmd.h"
>
> @@ -43,6 +44,8 @@ struct tracecmd_recorder {
> int page_size;
> int cpu;
> int stop;
> + int ctl_fd;
> + bool agent_existing;
Thanks for the reminder. I need to convert a lot to use 'bool' instead.
> };
>
> void tracecmd_free_recorder(struct tracecmd_recorder *recorder)
> @@ -59,11 +62,29 @@ void tracecmd_free_recorder(struct tracecmd_recorder *recorder)
> free(recorder);
> }
>
> +static char *use_trace_agent_dir(char *ctl_path,
> + struct tracecmd_recorder *recorder)
> +{
> + ctl_path = strdup(ctl_path);
> + if (!ctl_path)
> + die("malloc");
> + warning("Use environmental control path: %s\n", ctl_path);
s/Use/Using/
-- Steve
> +
> + recorder->ctl_fd = open(ctl_path, O_WRONLY);
> + if (recorder->ctl_fd < 0)
> + return NULL;
> +
> + recorder->agent_existing = true;
> +
> + return guest_agent_tracing_read_dir();
> +}
> +
next prev parent reply other threads:[~2012-08-22 13:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 8:42 [PATCH 0/5] trace-cmd: Add a recorder readable feature for virtio-trace Yoshihiro YUNOMAE
2012-08-22 8:43 ` [PATCH 1/5] trace-cmd: Use TRACE_DIR envrionment variable if defined Yoshihiro YUNOMAE
2012-08-22 13:37 ` Steven Rostedt
2012-08-22 8:43 ` [PATCH 2/5] trace-cmd: Use tracing directory to count CPUs Yoshihiro YUNOMAE
2012-08-22 13:41 ` Steven Rostedt
2012-08-23 2:01 ` Masami Hiramatsu
2012-08-23 3:00 ` Masami Hiramatsu
2012-08-23 9:08 ` Steven Rostedt
2012-08-23 12:30 ` Masami Hiramatsu
2012-08-22 8:43 ` [PATCH 3/5] trace-cmd: Support trace-agent of virtio-trace Yoshihiro YUNOMAE
2012-08-22 13:51 ` Steven Rostedt [this message]
2012-08-23 3:13 ` Yoshihiro YUNOMAE
2012-08-22 8:43 ` [PATCH 4/5] trace-cmd: Add non-blocking option for open() and splice_read() Yoshihiro YUNOMAE
2012-08-22 8:43 ` [PATCH 5/5] trace-cmd: Use polling function Yoshihiro YUNOMAE
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=1345643505.5069.36.camel@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=amit.shah@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=arnd@arndb.de \
--cc=bp@amd64.org \
--cc=fche@redhat.com \
--cc=fweisbec@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.hengli.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.linux-foundation.org \
--cc=yoshihiro.yunomae.ez@hitachi.com \
--cc=yrl.pp-manager.tt@hitachi.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).