All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] top(1) utility implementation in QEMU
@ 2016-09-26 13:44 prashanth sunder
  2016-09-26 16:28 ` Daniel P. Berrange
  0 siblings, 1 reply; 8+ messages in thread
From: prashanth sunder @ 2016-09-26 13:44 UTC (permalink / raw)
  To: qemu-devel

Hi All,

Summary of the discussion and different approaches we had on IRC
regarding a top(1) tool in qemu

Implement unique naming for all event loop resources.  Sometimes a
string literal can be used but other times the unique name needs to be
generated at runtime (e.g. filename for an fd).

Approach 1)
For a built-in QMP implementation:
We have callbacks from fds, BHs and Timers
So everytime one of them is registered - we add them to the list(what
we see through QMP)
and when they are unregistered - we remove them from the list.
Ex: aio_set_fd_handler(fd, NULL, NULL, NULL) - unregistering an fd -
will remove the fd from the list.

QMP API:
set-event-loop-profiling enable=on/off
[interval=seconds] [iothread=name] and it emits a QMP event with
[{name, counter, time_elapsed}]

Pros:
It works on all systems.
Cons:
Information present inside glib is exposed only via systemtap tracing
- these will not be available via QMP.
For example - I/O in chardevs, network IO etc

Approach 2)
Using Trace:
Add trace event for each type of event loop resource (timer, fd, bh,
etc) in order to see when a resource fires.
Write top(1)-like SystemTap script to get data from the trace backend.

Pros:
No performance overhead using trace

Cons:
The data available from trace depends on the trace-backend that qemu
is configured with.
It is dependent on availability of SystemTap and is backend specific

Approach 3)
Use Trace and extract trace backend data through QMP

Pros:
No performance overhead using trace

Cons:
User has to configure QMP to point to the trace backend.

Please let me know which implementation it is that I should follow and work on.

If I've missed out on anything important. Please add those points to this mail.

Regards,
Prashanth Sunder

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-11 13:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 13:44 [Qemu-devel] top(1) utility implementation in QEMU prashanth sunder
2016-09-26 16:28 ` Daniel P. Berrange
2016-09-29  2:45   ` Fam Zheng
2016-09-30 17:08     ` Markus Armbruster
2016-10-01 12:12       ` Fam Zheng
2016-10-04  7:42         ` Markus Armbruster
2016-10-11 12:51           ` Fam Zheng
2016-10-11 13:09             ` Daniel P. Berrange

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.