[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/46] qemu-io: add option to enable tracing
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 04/46] qemu-io: add option to enable tracing |
Date: |
Thu, 5 Apr 2012 17:51:42 +0200 |
From: Stefan Hajnoczi <address@hidden>
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 <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-io.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index 3189530..e6fcd77 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"
@@ -1783,6 +1784,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",
@@ -1794,7 +1796,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' },
@@ -1806,6 +1808,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;
@@ -1837,6 +1840,11 @@ int main(int argc, char **argv)
case 'k':
flags |= BDRV_O_NATIVE_AIO;
break;
+ case 'T':
+ if (!trace_backend_init(optarg, NULL)) {
+ exit(1); /* error message will have been printed */
+ }
+ break;
case 'V':
printf("%s version %s\n", progname, VERSION);
exit(0);
--
1.7.6.5
- [Qemu-devel] [PULL 00/46] Block patches, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 03/46] qcow2: Remove unused parameter in get_cluster_table(), Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 02/46] tracetool: Forbid argument name 'next', Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 04/46] qemu-io: add option to enable tracing,
Kevin Wolf <=
- [Qemu-devel] [PATCH 01/46] trace-events: Rename 'next' argument, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 05/46] block: push recursive flushing up from drivers, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 06/46] aio: move BlockDriverAIOCB to qemu-aio.h, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 07/46] ide: IDENTIFY word 86 bit 14 is reserved, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 10/46] ide: Adds wwn=hex qdev option, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 08/46] ide: Add "model=s" qdev option, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 17/46] vdi: merge aio_read_cb and aio_write_cb into callers, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 18/46] vdi: move aiocb fields to locals, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 23/46] block: disable I/O throttling on sync api, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 24/46] block: cancel jobs when a device is ready to go away, Kevin Wolf, 2012/04/05