mbox series

[v3,0/2] trace: Add a trace backend for the recorder library

Message ID 20200706170255.1165105-1-dinechin@redhat.com (mailing list archive)
Headers show
Series trace: Add a trace backend for the recorder library | expand

Message

Christophe de Dinechin July 6, 2020, 5:02 p.m. UTC
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.

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

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

Comments

no-reply@patchew.org July 6, 2020, 5:44 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20200706170255.1165105-1-dinechin@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [PATCH v3 0/2] trace: Add a trace backend for the recorder library
Type: series
Message-id: 20200706170255.1165105-1-dinechin@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
26ef33b trace: Example of non-tracing recorder use
64ee20b trace: Add support for recorder back-end

=== OUTPUT BEGIN ===
1/2 Checking commit 64ee20b304ab (trace: Add support for recorder back-end)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#148: 
new file mode 100644

WARNING: Block comments use a leading /* on a separate line
#267: FILE: trace/recorder.c:20:
+    /* Allow a dump in case we receive some unhandled signal

WARNING: Block comments use * on subsequent lines
#268: FILE: trace/recorder.c:21:
+    /* Allow a dump in case we receive some unhandled signal
+       For example, send USR2 to a hung process to get a dump */

WARNING: Block comments use a trailing */ on a separate line
#268: FILE: trace/recorder.c:21:
+       For example, send USR2 to a hung process to get a dump */

ERROR: do not use C99 // comments
#310: FILE: trace/recorder.h:32:
+#endif // TRACE_RECORDER_H

ERROR: do not use C99 // comments
#331: FILE: util/module.c:158:
+        // New recorders may have been pulled in, activate them if necessary

total: 2 errors, 4 warnings, 245 lines checked

Patch 1/2 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

2/2 Checking commit 26ef33b3f9e1 (trace: Example of non-tracing recorder use)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200706170255.1165105-1-dinechin@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com