* [Qemu-devel] [PATCH] qemu-io: add option to enable tracing
@ 2011-12-21 15:35 Stefan Hajnoczi
2012-03-12 11:39 ` Stefan Hajnoczi
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-12-21 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi
It can be useful to enable QEMU tracing when trying out block layer
interfaces via qemu-io. Tracing can be enabled using the new -t FILE
option where the given file contains a list of trace events to enable
(just like the qemu --trace events=FILE option).
$ echo qemu_vfree >my-events
$ ./qemu-io -t my-events ...
Remember to use ./configure --enable-trace-backend=BACKEND when building
qemu-io.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
qemu-io.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index ffa62fb..ad91fd6 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -17,6 +17,7 @@
#include "qemu-common.h"
#include "block_int.h"
#include "cmd.h"
+#include "trace/control.h"
#define VERSION "0.0.1"
@@ -1722,6 +1723,7 @@ static void usage(const char *name)
" -g, --growable allow file to grow (only applies to protocols)\n"
" -m, --misalign misalign allocations for O_DIRECT\n"
" -k, --native-aio use kernel AIO implementation (on Linux only)\n"
+" -t, --trace FILE enable trace events listed in the given file\n"
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
"\n",
@@ -1733,7 +1735,7 @@ int main(int argc, char **argv)
{
int readonly = 0;
int growable = 0;
- const char *sopt = "hVc:rsnmgk";
+ const char *sopt = "hVc:rsnmgkt:";
const struct option lopt[] = {
{ "help", 0, NULL, 'h' },
{ "version", 0, NULL, 'V' },
@@ -1745,6 +1747,7 @@ int main(int argc, char **argv)
{ "misalign", 0, NULL, 'm' },
{ "growable", 0, NULL, 'g' },
{ "native-aio", 0, NULL, 'k' },
+ { "trace", 1, NULL, 't' },
{ NULL, 0, NULL, 0 }
};
int c;
@@ -1776,6 +1779,9 @@ int main(int argc, char **argv)
case 'k':
flags |= BDRV_O_NATIVE_AIO;
break;
+ case 't':
+ trace_backend_init(optarg, NULL);
+ break;
case 'V':
printf("%s version %s\n", progname, VERSION);
exit(0);
--
1.7.7.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-io: add option to enable tracing
2011-12-21 15:35 [Qemu-devel] [PATCH] qemu-io: add option to enable tracing Stefan Hajnoczi
@ 2012-03-12 11:39 ` Stefan Hajnoczi
2012-03-12 11:49 ` Kevin Wolf
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-03-12 11:39 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, Stefan Hajnoczi
On Wed, Dec 21, 2011 at 3:35 PM, Stefan Hajnoczi
<stefanha@linux.vnet.ibm.com> wrote:
Ping? Do you want to take this through the block tree?
> It can be useful to enable QEMU tracing when trying out block layer
> interfaces via qemu-io. Tracing can be enabled using the new -t FILE
> option where the given file contains a list of trace events to enable
> (just like the qemu --trace events=FILE option).
>
> $ echo qemu_vfree >my-events
> $ ./qemu-io -t my-events ...
>
> Remember to use ./configure --enable-trace-backend=BACKEND when building
> qemu-io.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> ---
> qemu-io.c | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/qemu-io.c b/qemu-io.c
> index ffa62fb..ad91fd6 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -17,6 +17,7 @@
> #include "qemu-common.h"
> #include "block_int.h"
> #include "cmd.h"
> +#include "trace/control.h"
>
> #define VERSION "0.0.1"
>
> @@ -1722,6 +1723,7 @@ static void usage(const char *name)
> " -g, --growable allow file to grow (only applies to protocols)\n"
> " -m, --misalign misalign allocations for O_DIRECT\n"
> " -k, --native-aio use kernel AIO implementation (on Linux only)\n"
> +" -t, --trace FILE enable trace events listed in the given file\n"
> " -h, --help display this help and exit\n"
> " -V, --version output version information and exit\n"
> "\n",
> @@ -1733,7 +1735,7 @@ int main(int argc, char **argv)
> {
> int readonly = 0;
> int growable = 0;
> - const char *sopt = "hVc:rsnmgk";
> + const char *sopt = "hVc:rsnmgkt:";
> const struct option lopt[] = {
> { "help", 0, NULL, 'h' },
> { "version", 0, NULL, 'V' },
> @@ -1745,6 +1747,7 @@ int main(int argc, char **argv)
> { "misalign", 0, NULL, 'm' },
> { "growable", 0, NULL, 'g' },
> { "native-aio", 0, NULL, 'k' },
> + { "trace", 1, NULL, 't' },
> { NULL, 0, NULL, 0 }
> };
> int c;
> @@ -1776,6 +1779,9 @@ int main(int argc, char **argv)
> case 'k':
> flags |= BDRV_O_NATIVE_AIO;
> break;
> + case 't':
> + trace_backend_init(optarg, NULL);
> + break;
> case 'V':
> printf("%s version %s\n", progname, VERSION);
> exit(0);
> --
> 1.7.7.3
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-io: add option to enable tracing
2012-03-12 11:39 ` Stefan Hajnoczi
@ 2012-03-12 11:49 ` Kevin Wolf
2012-03-12 15:03 ` Stefan Hajnoczi
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Wolf @ 2012-03-12 11:49 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-devel, Stefan Hajnoczi
Am 12.03.2012 12:39, schrieb Stefan Hajnoczi:
> On Wed, Dec 21, 2011 at 3:35 PM, Stefan Hajnoczi
> <stefanha@linux.vnet.ibm.com> wrote:
>
> Ping? Do you want to take this through the block tree?
Sorry, I completely missed this one.
>> It can be useful to enable QEMU tracing when trying out block layer
>> interfaces via qemu-io. Tracing can be enabled using the new -t FILE
>> option where the given file contains a list of trace events to enable
>> (just like the qemu --trace events=FILE option).
>>
>> $ echo qemu_vfree >my-events
>> $ ./qemu-io -t my-events ...
>>
>> Remember to use ./configure --enable-trace-backend=BACKEND when building
>> qemu-io.
>>
>> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
>> ---
>> qemu-io.c | 8 +++++++-
>> 1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/qemu-io.c b/qemu-io.c
>> index ffa62fb..ad91fd6 100644
>> --- a/qemu-io.c
>> +++ b/qemu-io.c
>> @@ -17,6 +17,7 @@
>> #include "qemu-common.h"
>> #include "block_int.h"
>> #include "cmd.h"
>> +#include "trace/control.h"
>>
>> #define VERSION "0.0.1"
>>
>> @@ -1722,6 +1723,7 @@ static void usage(const char *name)
>> " -g, --growable allow file to grow (only applies to protocols)\n"
>> " -m, --misalign misalign allocations for O_DIRECT\n"
>> " -k, --native-aio use kernel AIO implementation (on Linux only)\n"
>> +" -t, --trace FILE enable trace events listed in the given file\n"
>> " -h, --help display this help and exit\n"
>> " -V, --version output version information and exit\n"
>> "\n",
>> @@ -1733,7 +1735,7 @@ int main(int argc, char **argv)
>> {
>> int readonly = 0;
>> int growable = 0;
>> - const char *sopt = "hVc:rsnmgk";
>> + const char *sopt = "hVc:rsnmgkt:";
>> const struct option lopt[] = {
>> { "help", 0, NULL, 'h' },
>> { "version", 0, NULL, 'V' },
>> @@ -1745,6 +1747,7 @@ int main(int argc, char **argv)
>> { "misalign", 0, NULL, 'm' },
>> { "growable", 0, NULL, 'g' },
>> { "native-aio", 0, NULL, 'k' },
>> + { "trace", 1, NULL, 't' },
>> { NULL, 0, NULL, 0 }
>> };
>> int c;
>> @@ -1776,6 +1779,9 @@ int main(int argc, char **argv)
>> case 'k':
>> flags |= BDRV_O_NATIVE_AIO;
>> break;
>> + case 't':
>> + trace_backend_init(optarg, NULL);
>> + break;
vl.c checks the return value of trace_backend_init. Shouldn't we do the
same here?
Also, I was considering adding a -t for the cache mode (option name for
consistency with qemu-img). Conversely, we'll probably want to add a
tracing option to qemu-img and -t isn't available any more there. Maybe
we should use a different letter?
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-io: add option to enable tracing
2012-03-12 11:49 ` Kevin Wolf
@ 2012-03-12 15:03 ` Stefan Hajnoczi
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-03-12 15:03 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, Stefan Hajnoczi
On Mon, Mar 12, 2012 at 11:49 AM, Kevin Wolf <kwolf@redhat.com> wrote:
> Am 12.03.2012 12:39, schrieb Stefan Hajnoczi:
>> On Wed, Dec 21, 2011 at 3:35 PM, Stefan Hajnoczi
>> <stefanha@linux.vnet.ibm.com> wrote:
>>> @@ -1776,6 +1779,9 @@ int main(int argc, char **argv)
>>> case 'k':
>>> flags |= BDRV_O_NATIVE_AIO;
>>> break;
>>> + case 't':
>>> + trace_backend_init(optarg, NULL);
>>> + break;
>
> vl.c checks the return value of trace_backend_init. Shouldn't we do the
> same here?
ok
> Also, I was considering adding a -t for the cache mode (option name for
> consistency with qemu-img). Conversely, we'll probably want to add a
> tracing option to qemu-img and -t isn't available any more there. Maybe
> we should use a different letter?
ok
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-12 15:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-21 15:35 [Qemu-devel] [PATCH] qemu-io: add option to enable tracing Stefan Hajnoczi
2012-03-12 11:39 ` Stefan Hajnoczi
2012-03-12 11:49 ` Kevin Wolf
2012-03-12 15:03 ` Stefan Hajnoczi
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).