The "simple" backend is actually more complicated to use than the "log"
backend. Update the quickstart documentation to feature the "log"
backend instead of the "simple" backend.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
docs/devel/tracing.rst | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst
index 76cc1b24fa..e60058bf55 100644
--- a/docs/devel/tracing.rst
+++ b/docs/devel/tracing.rst
@@ -11,22 +11,22 @@ for debugging, profiling, and observing execution.
Quickstart
==========
-1. Build with the 'simple' trace backend::
+Enable tracing of ``memory_region_ops_read`` and ``memory_region_ops_write``
+events::
- ./configure --enable-trace-backends=simple
- make
+ $ qemu --trace "memory_region_ops_*" ...
+ ...
+ 719585@1608130130.441188:memory_region_ops_read cpu 0 mr 0x562fdfbb3820 addr 0x3cc value 0x67 size 1
+ 719585@1608130130.441190:memory_region_ops_write cpu 0 mr 0x562fdfbd2f00 addr 0x3d4 value 0x70e size 2
-2. Create a file with the events you want to trace::
+This output comes from the "log" trace backend that is enabled by default when
+``./configure --enable-trace-backends=BACKENDS`` was not explicitly specified.
- echo memory_region_ops_read >/tmp/events
+More than one trace event pattern can be specified by providing a file
+instead::
-3. Run the virtual machine to produce a trace file::
-
- qemu --trace events=/tmp/events ... # your normal QEMU invocation
-
-4. Pretty-print the binary trace file::
-
- ./scripts/simpletrace.py trace-events-all trace-* # Override * with QEMU <pid>
+ $ echo "memory_region_ops_*" >/tmp/events
+ $ qemu --trace events=/tmp/events ...
Trace events
============
@@ -195,7 +195,7 @@ script.
The trace backends are chosen at configure time::
- ./configure --enable-trace-backends=simple
+ ./configure --enable-trace-backends=simple,dtrace
For a list of supported trace backends, try ./configure --help or see below.
If multiple backends are enabled, the trace is sent to them all.
@@ -227,10 +227,11 @@ uses DPRINTF().
Simpletrace
-----------
-The "simple" backend supports common use cases and comes as part of the QEMU
-source tree. It may not be as powerful as platform-specific or third-party
-trace backends but it is portable. This is the recommended trace backend
-unless you have specific needs for more advanced backends.
+The "simple" backend writes binary trace logs to a file from a thread, making
+it lower overhead than the "log" backend. A Python API is available for writing
+offline trace file analysis scripts. It may not be as powerful as
+platform-specific or third-party trace backends but it is portable and has no
+special library dependencies.
Monitor commands
~~~~~~~~~~~~~~~~
--
2.29.2
On Wed, 16 Dec 2020 at 16:09, Stefan Hajnoczi <stefanha@redhat.com> wrote: > > The "simple" backend is actually more complicated to use than the "log" > backend. Update the quickstart documentation to feature the "log" > backend instead of the "simple" backend. > > Suggested-by: Peter Maydell <peter.maydell@linaro.org> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> > --- > docs/devel/tracing.rst | 35 ++++++++++++++++++----------------- > 1 file changed, 18 insertions(+), 17 deletions(-) > > diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst > index 76cc1b24fa..e60058bf55 100644 > --- a/docs/devel/tracing.rst > +++ b/docs/devel/tracing.rst > @@ -11,22 +11,22 @@ for debugging, profiling, and observing execution. > Quickstart > ========== > > -1. Build with the 'simple' trace backend:: > +Enable tracing of ``memory_region_ops_read`` and ``memory_region_ops_write`` > +events:: > > - ./configure --enable-trace-backends=simple > - make > + $ qemu --trace "memory_region_ops_*" ... > + ... > + 719585@1608130130.441188:memory_region_ops_read cpu 0 mr 0x562fdfbb3820 addr 0x3cc value 0x67 size 1 > + 719585@1608130130.441190:memory_region_ops_write cpu 0 mr 0x562fdfbd2f00 addr 0x3d4 value 0x70e size 2 > > -2. Create a file with the events you want to trace:: > +This output comes from the "log" trace backend that is enabled by default when > +``./configure --enable-trace-backends=BACKENDS`` was not explicitly specified. > > - echo memory_region_ops_read >/tmp/events > +More than one trace event pattern can be specified by providing a file > +instead:: Does --trace really not let you specify more than one pattern without resorting to putting them into a file? That sounds like a deficiency compared to -d (which allows -d trace:PATTERN,trace:PATTERN...) that we could look at fixing... Anyway, Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
On Thu, 31 Dec 2020, Peter Maydell wrote: > On Wed, 16 Dec 2020 at 16:09, Stefan Hajnoczi <stefanha@redhat.com> wrote: >> >> The "simple" backend is actually more complicated to use than the "log" >> backend. Update the quickstart documentation to feature the "log" >> backend instead of the "simple" backend. >> >> Suggested-by: Peter Maydell <peter.maydell@linaro.org> >> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> >> --- >> docs/devel/tracing.rst | 35 ++++++++++++++++++----------------- >> 1 file changed, 18 insertions(+), 17 deletions(-) >> >> diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst >> index 76cc1b24fa..e60058bf55 100644 >> --- a/docs/devel/tracing.rst >> +++ b/docs/devel/tracing.rst >> @@ -11,22 +11,22 @@ for debugging, profiling, and observing execution. >> Quickstart >> ========== >> >> -1. Build with the 'simple' trace backend:: >> +Enable tracing of ``memory_region_ops_read`` and ``memory_region_ops_write`` >> +events:: >> >> - ./configure --enable-trace-backends=simple >> - make >> + $ qemu --trace "memory_region_ops_*" ... >> + ... >> + 719585@1608130130.441188:memory_region_ops_read cpu 0 mr 0x562fdfbb3820 addr 0x3cc value 0x67 size 1 >> + 719585@1608130130.441190:memory_region_ops_write cpu 0 mr 0x562fdfbd2f00 addr 0x3d4 value 0x70e size 2 >> >> -2. Create a file with the events you want to trace:: >> +This output comes from the "log" trace backend that is enabled by default when >> +``./configure --enable-trace-backends=BACKENDS`` was not explicitly specified. >> >> - echo memory_region_ops_read >/tmp/events >> +More than one trace event pattern can be specified by providing a file >> +instead:: > > Does --trace really not let you specify more than one pattern > without resorting to putting them into a file? That sounds like a > deficiency compared to -d (which allows -d trace:PATTERN,trace:PATTERN...) > that we could look at fixing... Ir's possible to give more patterns in multiple options, I'm using that, such as: -trace enable="pci*" -trace enable="ide*" For a lot of patterns using a file may be clearer though. This reminds me to the plainlog backend I've submitted. What happened to that? See: https://lists.nongnu.org/archive/html/qemu-devel/2020-06/msg07296.html I'd like a solution that can be set at compile time and does not need another command line option to turn off time stamps. (Timestamps are annoyong when comparing logs that's often necessary to check changes.) I'm still using my plainlog patch but I have to disable that when bisecting. Regards, BALATON Zoltan > Anyway, > Reviewed-by: Peter Maydell <peter.maydell@linaro.org> > > thanks > -- PMM > >
On Thu, Dec 31, 2020 at 09:36:50PM +0100, BALATON Zoltan wrote: > On Thu, 31 Dec 2020, Peter Maydell wrote: > > On Wed, 16 Dec 2020 at 16:09, Stefan Hajnoczi <stefanha@redhat.com> wrote: > > > > > > The "simple" backend is actually more complicated to use than the "log" > > > backend. Update the quickstart documentation to feature the "log" > > > backend instead of the "simple" backend. > > > > > > Suggested-by: Peter Maydell <peter.maydell@linaro.org> > > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> > > > --- > > > docs/devel/tracing.rst | 35 ++++++++++++++++++----------------- > > > 1 file changed, 18 insertions(+), 17 deletions(-) > > > > > > diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst > > > index 76cc1b24fa..e60058bf55 100644 > > > --- a/docs/devel/tracing.rst > > > +++ b/docs/devel/tracing.rst > > > @@ -11,22 +11,22 @@ for debugging, profiling, and observing execution. > > > Quickstart > > > ========== > > > > > > -1. Build with the 'simple' trace backend:: > > > +Enable tracing of ``memory_region_ops_read`` and ``memory_region_ops_write`` > > > +events:: > > > > > > - ./configure --enable-trace-backends=simple > > > - make > > > + $ qemu --trace "memory_region_ops_*" ... > > > + ... > > > + 719585@1608130130.441188:memory_region_ops_read cpu 0 mr 0x562fdfbb3820 addr 0x3cc value 0x67 size 1 > > > + 719585@1608130130.441190:memory_region_ops_write cpu 0 mr 0x562fdfbd2f00 addr 0x3d4 value 0x70e size 2 > > > > > > -2. Create a file with the events you want to trace:: > > > +This output comes from the "log" trace backend that is enabled by default when > > > +``./configure --enable-trace-backends=BACKENDS`` was not explicitly specified. > > > > > > - echo memory_region_ops_read >/tmp/events > > > +More than one trace event pattern can be specified by providing a file > > > +instead:: > > > > Does --trace really not let you specify more than one pattern > > without resorting to putting them into a file? That sounds like a > > deficiency compared to -d (which allows -d trace:PATTERN,trace:PATTERN...) > > that we could look at fixing... > > Ir's possible to give more patterns in multiple options, I'm using that, > such as: > > -trace enable="pci*" -trace enable="ide*" > > For a lot of patterns using a file may be clearer though. > > This reminds me to the plainlog backend I've submitted. What happened to > that? See: > > https://lists.nongnu.org/archive/html/qemu-devel/2020-06/msg07296.html > > I'd like a solution that can be set at compile time and does not need > another command line option to turn off time stamps. (Timestamps are > annoyong when comparing logs that's often necessary to check changes.) I'm > still using my plainlog patch but I have to disable that when bisecting. Thanks for reminding me. I don't remember what happened to that, sorry! I will revisit the plainlog series and let you know. Stefan
© 2016 - 2026 Red Hat, Inc.