[PATCH v4 0/2] trace: Add a trace backend for the recorder library

Christophe de Dinechin posted 2 patches 3 years, 9 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200723132903.1980743-1-dinechin@redhat.com
Maintainers: "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Markus Armbruster <armbru@redhat.com>
MAINTAINERS                           |  1 +
configure                             | 14 ++++++++
hmp-commands.hx                       | 23 +++++++++++-
monitor/misc.c                        | 25 +++++++++++++
scripts/tracetool/backend/recorder.py | 52 +++++++++++++++++++++++++++
trace/Makefile.objs                   |  1 +
trace/control.c                       |  5 +++
trace/recorder.c                      | 27 ++++++++++++++
trace/recorder.h                      | 32 +++++++++++++++++
util/module.c                         |  6 ++++
util/qemu-thread-common.h             |  7 ++++
11 files changed, 192 insertions(+), 1 deletion(-)
create mode 100644 scripts/tracetool/backend/recorder.py
create mode 100644 trace/recorder.c
create mode 100644 trace/recorder.h
[PATCH v4 0/2] trace: Add a trace backend for the recorder library
Posted by Christophe de Dinechin 3 years, 9 months ago
The recorder library implements low-cost always-on tracing, with three
usage models:

1. Flight recorder: Dump information on recent events in case of crash
2. Tracing: Individual traces can be enabled using environment variables
3. Real-time graphing / control, using the recorder_scope application

This short series introduces a new "recorder" back-end which connects
to the recorder. Traces using the recorder are intentionally "always on",
because the recorder library is primarily designed to record
information for later playback in case of crash, tracing being only a
secondary capability.

An example is given of how the recorder can also be used separately
from generated traces. The example uses locking, which can make sense
for both post-mortem and real-time graphing.

Changes in v3:
* Address coding style issues (C++ comments, wrong include, etc)
* Fix args type for HMP command (for now, still a single command)
* Add basic help for HMP command
* Use pkg-config for recorder information. This requires recorder
  1.0.10 or later.

Changes in v4:
* Rebased on current master
* Fix GPL v2-only license
* Remove confusing #ifdef around #include "trace/recorder.h"
* Added myself as a reviewer for trace subsystem

Later patches wil address larger topics that were discussed that
would impact other tracing mechanisms, as well as GitHub / GitLab
build tests.

Christophe de Dinechin (2):
  trace: Add support for recorder back-end
  trace: Example of non-tracing recorder use

 MAINTAINERS                           |  1 +
 configure                             | 14 ++++++++
 hmp-commands.hx                       | 23 +++++++++++-
 monitor/misc.c                        | 25 +++++++++++++
 scripts/tracetool/backend/recorder.py | 52 +++++++++++++++++++++++++++
 trace/Makefile.objs                   |  1 +
 trace/control.c                       |  5 +++
 trace/recorder.c                      | 27 ++++++++++++++
 trace/recorder.h                      | 32 +++++++++++++++++
 util/module.c                         |  6 ++++
 util/qemu-thread-common.h             |  7 ++++
 11 files changed, 192 insertions(+), 1 deletion(-)
 create mode 100644 scripts/tracetool/backend/recorder.py
 create mode 100644 trace/recorder.c
 create mode 100644 trace/recorder.h

-- 
2.26.2



Re: [PATCH v4 0/2] trace: Add a trace backend for the recorder library
Posted by Stefan Hajnoczi 3 years, 9 months ago
On Thu, Jul 23, 2020 at 03:29:01PM +0200, Christophe de Dinechin wrote:
> The recorder library implements low-cost always-on tracing, with three
> usage models:
> 
> 1. Flight recorder: Dump information on recent events in case of crash
> 2. Tracing: Individual traces can be enabled using environment variables
> 3. Real-time graphing / control, using the recorder_scope application
> 
> This short series introduces a new "recorder" back-end which connects
> to the recorder. Traces using the recorder are intentionally "always on",
> because the recorder library is primarily designed to record
> information for later playback in case of crash, tracing being only a
> secondary capability.
> 
> An example is given of how the recorder can also be used separately
> from generated traces. The example uses locking, which can make sense
> for both post-mortem and real-time graphing.
> 
> Changes in v3:
> * Address coding style issues (C++ comments, wrong include, etc)
> * Fix args type for HMP command (for now, still a single command)
> * Add basic help for HMP command
> * Use pkg-config for recorder information. This requires recorder
>   1.0.10 or later.
> 
> Changes in v4:
> * Rebased on current master
> * Fix GPL v2-only license
> * Remove confusing #ifdef around #include "trace/recorder.h"
> * Added myself as a reviewer for trace subsystem
> 
> Later patches wil address larger topics that were discussed that
> would impact other tracing mechanisms, as well as GitHub / GitLab
> build tests.

Thanks, I will take a look next week. QEMU is in freeze at the moment
and new features are not being added until QEMU 5.1 is released.

Stefan