Hi,
Tracing infrastructure is now a part of upstream QEMU, which allows
options to choose different trace backends to handle trace-events of
interest. The choice of 'simple' trace backend allows users to
dynamically enable/disable trace events for a running qemu instance as
well as to set options for logging traces to a desired file via the qemu
monitor.
While the QMP interfaces are still under discussion
(http://www.mail-archive.com/qemu-devel@xxxxxxxxxx/msg44535.html), I
propose the following extensions for virsh to make use of human-monitor
tracing commands:
1. virsh trace-events DOMAIN-ID [set TRACE-EVENT ON ]
----------------------------------------------------
- Implements QEMU monitor command 'trace event' to change state of a
particular trace-event.
- Eg, virsh trace-events DOMAIN-ID set ABC on
: changes state of trace-event 'ABC' to enabled.
- When specified without arguments, it implements QEMU monitor command
to show all currently available trace events and their state for a
specific instance.
- Eg, virsh trace-events DOMAIN-ID
: lists all trace-events with their state for that instance.
2. virsh trace-file DOMAIN_ID [set FILENAME | --enable | --disable]
-------------------------------------------------------------------
- Implements the qemu monitor command : trace-file
- Without any arguments, it lists the currently active trace output
file with its state.
- The 'set' subcommand changes the output file to FILENAME.
- The --enable and --disable switches respectively enable and disable
writing of trace data to output file.
The catch is, these are only available for 'simple' trace backend for
qemu, so one would need to be careful of handling failures when these
commands are passed to qemu instances compiled with a different trace
backend.
It would have been much easier if there existed a generic virsh command
to pass commands to the QEMU monitor. I saw some patches for
qemu-monitor-command option for
virsh,(http://www.mail-archive.com/libvir-list@xxxxxxxxxx/msg26237.html)
but looks like it is not upstream right now.
In order to support QEMU tracing, would this be a better bet than
implementing virsh extensions listed above ?
If yes, any chance we might have it in for the next release ?
Awaiting feedback,
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list