qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] a76ccf: trace: extract stap_escape() function


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] a76ccf: trace: extract stap_escape() function for reuse
Date: Fri, 15 Aug 2014 10:00:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: a76ccf3c1cb06576af091c5ac8bc264515b1bb7f
      
https://github.com/qemu/qemu/commit/a76ccf3c1cb06576af091c5ac8bc264515b1bb7f
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M scripts/tracetool/format/stap.py

  Log Message:
  -----------
  trace: extract stap_escape() function for reuse

SystemTap reserved words sometimes conflict with QEMU variable names.
We escape them to prevent conflicts.

Move escaping into its own function so the next patch can reuse it.

Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3f8b112d6b9ab65e165096582c78154dda1adc69
      
https://github.com/qemu/qemu/commit/3f8b112d6b9ab65e165096582c78154dda1adc69
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    A scripts/tracetool/format/simpletrace_stap.py

  Log Message:
  -----------
  trace: add tracetool simpletrace_stap format

This new tracetool "format" generates a SystemTap .stp file that outputs
simpletrace binary trace data.

In contrast to simpletrace or ftrace, SystemTap does not define its own
trace format.  All output from SystemTap is generated by .stp files.
This patch lets us generate a .stp file that outputs in the simpletrace
binary format.

This makes it possible to reuse simpletrace.py to analyze traces
recorded using SystemTap.  The simpletrace binary format is especially
useful for long-running traces like flight-recorder mode where string
formatting can be expensive.

Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 15327c3df049c9621ff9b542ccbfc3d17203d1f7
      
https://github.com/qemu/qemu/commit/15327c3df049c9621ff9b542ccbfc3d17203d1f7
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M scripts/simpletrace.py

  Log Message:
  -----------
  simpletrace: add simpletrace.py --no-header option

It can be useful to read simpletrace files that have no header.  For
example, a ring buffer may not have a header record but can still be
processed if the user is sure the file format version is compatible.

  $ scripts/simpletrace.py --no-header trace-events trace-file

Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: e0b2fd0efb4d282bc6fa0ed5397f472298a66ca2
      
https://github.com/qemu/qemu/commit/e0b2fd0efb4d282bc6fa0ed5397f472298a66ca2
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M Makefile.target

  Log Message:
  -----------
  trace: install simpletrace SystemTap tapset

The simpletrace SystemTap tapset outputs simpletrace binary traces for
SystemTap probes.  This is useful because SystemTap has no default way
to format or store traces.  The simpletrace SystemTap tapset provides an
easy way to store traces.

The simpletrace.py tool or custom Python scripts using the
simpletrace.py API can analyze SystemTap these traces:

  $ ./configure --enable-trace-backends=dtrace ...
  $ make && make install
  $ stap -e 'probe qemu.system.x86_64.simpletrace.* {}' \
   -c qemu-system-x86_64 >/tmp/trace.out
  $ scripts/simpletrace.py --no-header trace-events /tmp/trace.out
  g_malloc 4.531 pid=15519 size=0xb ptr=0x7f8639c10470
  g_malloc 3.264 pid=15519 size=0x300 ptr=0x7f8639c10490
  g_free 5.155 pid=15519 ptr=0x7f8639c0f7b0

Note that, unlike qemu-system-x86_64.stp and
qemu-system-x86_64.stp-installed, only one file is needed since the
simpletrace SystemTap tapset does not reference the QEMU binary by path.
Therefore it doesn't matter whether the QEMU binary is installed or not.

Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 0bb403b0ae6f8805696a7e73138d93635bebc6f4
      
https://github.com/qemu/qemu/commit/0bb403b0ae6f8805696a7e73138d93635bebc6f4
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M docs/tracing.txt

  Log Message:
  -----------
  trace: [tcg] Add documentation

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: e6d6c4bebf493317deec329069b7e872c2237684
      
https://github.com/qemu/qemu/commit/e6d6c4bebf493317deec329069b7e872c2237684
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    A scripts/tracetool/transform.py

  Log Message:
  -----------
  trace: [tcg] Argument type transformation rules

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b55835ac109b7f5f11a3f12bf445f75b76bc9f01
      
https://github.com/qemu/qemu/commit/b55835ac109b7f5f11a3f12bf445f75b76bc9f01
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M scripts/tracetool/__init__.py

  Log Message:
  -----------
  trace: [tcg] Argument type transformation machinery

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b2b36c22bd8b14de34bd108daa96d89ba41fe8e7
      
https://github.com/qemu/qemu/commit/b2b36c22bd8b14de34bd108daa96d89ba41fe8e7
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M scripts/tracetool/__init__.py
    M scripts/tracetool/format/events_h.py

  Log Message:
  -----------
  trace: [tcg] Add 'tcg' event property

Transforms event:

  tcg name(...) "...", "..."

into two internal events:

  tcg-trans name_trans(...) "..."
  tcg-exec name_exec(...) "..."

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 707c8a98e4c42a559ad8d1ec0e77e28ffd666346
      
https://github.com/qemu/qemu/commit/707c8a98e4c42a559ad8d1ec0e77e28ffd666346
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M .gitignore
    M Makefile
    M scripts/tracetool/__init__.py
    A scripts/tracetool/format/tcg_helper_h.py
    M trace/Makefile.objs

  Log Message:
  -----------
  trace: [tcg] Declare TCG tracing helper routines

Generates file "trace/generated-helpers.h" with TCG helper declarations to trace
events in guest code at execution time ('trace_${event}_exec_proxy').

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 341ea69185239eeb7da73434ac2803790a429e9c
      
https://github.com/qemu/qemu/commit/341ea69185239eeb7da73434ac2803790a429e9c
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M .gitignore
    M Makefile
    M Makefile.objs
    M Makefile.target
    A scripts/tracetool/format/tcg_helper_c.py
    M trace/Makefile.objs

  Log Message:
  -----------
  trace: [tcg] Define TCG tracing helper routines

Generates file "trace/generated-helpers.c" with TCG helper definitions to trace
events in guest code at execution time.

The helpers ('helper_trace_${event}_exec_proxy') cast the TCG-compatible native
argument types to their original types (as defined in "trace-events") and call
the tracing routine ('trace_${event}_exec').

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f4654226d42cff5351b5f0df5913c5cf04775cdc
      
https://github.com/qemu/qemu/commit/f4654226d42cff5351b5f0df5913c5cf04775cdc
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M .gitignore
    M Makefile
    A scripts/tracetool/format/tcg_helper_wrapper_h.py
    M trace/Makefile.objs

  Log Message:
  -----------
  trace: [tcg] Define TCG tracing helper routine wrappers

Generates header "trace/generated-helpers-wrappers.h" with definitions for TCG
helper wrappers.

These wrappers ('gen_helper_trace_${event}_exec_wrapper') transform mixed native
and TCG argument types to TCG types and call the actual TCG helpers
('gen_helper_trace_${event}_exec_proxy').

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 76b53aa32457e63957540d99149901989c075d3c
      
https://github.com/qemu/qemu/commit/76b53aa32457e63957540d99149901989c075d3c
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M include/exec/helper-gen.h
    M include/exec/helper-proto.h
    M include/exec/helper-tcg.h

  Log Message:
  -----------
  trace: [tcg] Include TCG-tracing helpers

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 465830fbd9be22995b34d7b3f8cd35572e1f8a36
      
https://github.com/qemu/qemu/commit/465830fbd9be22995b34d7b3f8cd35572e1f8a36
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M .gitignore
    M Makefile
    A include/trace-tcg.h
    A scripts/tracetool/format/tcg_h.py
    M trace/Makefile.objs

  Log Message:
  -----------
  trace: [tcg] Generate TCG tracing routines

Generate header "trace/generated-tcg-tracers.h" with the necessary routines for
tracing events in guest code:

* trace_${event}_tcg

  Convenience wrapper that calls the translation-time tracer
  'trace_${event}_trans', and calls 'gen_helper_trace_${event}_exec to
  generate the TCG code to later trace the event at execution time.

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 85d8bf2f36ae28b8d4b04f473886ce7f725a8b21
      
https://github.com/qemu/qemu/commit/85d8bf2f36ae28b8d4b04f473886ce7f725a8b21
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M include/trace.h

  Log Message:
  -----------
  trace: [tcg] Include event definitions in "trace.h"

Otherwise the user has to explicitly include an auto-generated header.

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a7e30d84ce8109b50ee73633f72802918836b19f
      
https://github.com/qemu/qemu/commit/a7e30d84ce8109b50ee73633f72802918836b19f
  Author: Lluís Vilanova <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M target-alpha/translate.c
    M target-arm/translate-a64.c
    M target-arm/translate.c
    M target-cris/translate.c
    M target-i386/translate.c
    M target-lm32/translate.c
    M target-m68k/translate.c
    M target-microblaze/translate.c
    M target-mips/translate.c
    M target-openrisc/translate.c
    M target-ppc/translate.c
    M target-s390x/translate.c
    M target-sh4/translate.c
    M target-sparc/translate.c
    M target-unicore32/translate.c
    M target-xtensa/translate.c

  Log Message:
  -----------
  trace: [tcg] Include TCG-tracing header on all targets

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 41ef7b00abff4d31814890a14e5a8e49a177508b
      
https://github.com/qemu/qemu/commit/41ef7b00abff4d31814890a14e5a8e49a177508b
  Author: Alex Bennée <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M scripts/tracetool/__init__.py
    M scripts/tracetool/format/ust_events_h.py

  Log Message:
  -----------
  trace: teach lttng backend to use format strings

This makes the UST backend pay attention to the format string arguments
that are defined when defining payload data. With this you can now
ensure integers are reported in hex mode if you want.

Signed-off-by: Alex Bennée <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 6db8b538663b39c21e12e14e6437aa7f8435f316
      
https://github.com/qemu/qemu/commit/6db8b538663b39c21e12e14e6437aa7f8435f316
  Author: Alex Bennée <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M cpu-exec.c
    M trace-events
    M translate-all.c

  Log Message:
  -----------
  trace: add some tcg tracing support

This adds a couple of tcg specific trace-events which are useful for
tracing execution though tcg generated blocks. It's been tested with
lttng user space tracing but is generic enough for all systems. The tcg
events are:

  * translate_block - when a subject block is translated
  * exec_tb - when a translated block is entered
  * exec_tb_exit - when we exit the translated code
  * exec_tb_nocache - special case translations

Of course we can only trace the entrance to the first block of a chain
as each block will jump directly to the next when it can. See the -d
nochain patch to allow more complete tracing at the expense of
performance.

Signed-off-by: Alex Bennée <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 4ac4458076e1aaf3b01a6361154117df20e22215
      
https://github.com/qemu/qemu/commit/4ac4458076e1aaf3b01a6361154117df20e22215
  Author: Amit Shah <address@hidden>
  Date:   2014-08-12 (Tue, 12 Aug 2014)

  Changed paths:
    M hw/virtio/virtio-rng.c
    M trace-events

  Log Message:
  -----------
  virtio-rng: add some trace events

Add some trace events to virtio-rng for easier debugging

Signed-off-by: Amit Shah <address@hidden>

Reviewed-by: Amos Kong <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5c6b3c50cca2106e5fbcbc6efa94c2f8b9d29fd8
      
https://github.com/qemu/qemu/commit/5c6b3c50cca2106e5fbcbc6efa94c2f8b9d29fd8
  Author: Peter Maydell <address@hidden>
  Date:   2014-08-15 (Fri, 15 Aug 2014)

  Changed paths:
    M .gitignore
    M Makefile
    M Makefile.objs
    M Makefile.target
    M cpu-exec.c
    M docs/tracing.txt
    M hw/virtio/virtio-rng.c
    M include/exec/helper-gen.h
    M include/exec/helper-proto.h
    M include/exec/helper-tcg.h
    A include/trace-tcg.h
    M include/trace.h
    M scripts/simpletrace.py
    M scripts/tracetool/__init__.py
    M scripts/tracetool/format/events_h.py
    A scripts/tracetool/format/simpletrace_stap.py
    M scripts/tracetool/format/stap.py
    A scripts/tracetool/format/tcg_h.py
    A scripts/tracetool/format/tcg_helper_c.py
    A scripts/tracetool/format/tcg_helper_h.py
    A scripts/tracetool/format/tcg_helper_wrapper_h.py
    M scripts/tracetool/format/ust_events_h.py
    A scripts/tracetool/transform.py
    M target-alpha/translate.c
    M target-arm/translate-a64.c
    M target-arm/translate.c
    M target-cris/translate.c
    M target-i386/translate.c
    M target-lm32/translate.c
    M target-m68k/translate.c
    M target-microblaze/translate.c
    M target-mips/translate.c
    M target-openrisc/translate.c
    M target-ppc/translate.c
    M target-s390x/translate.c
    M target-sh4/translate.c
    M target-sparc/translate.c
    M target-unicore32/translate.c
    M target-xtensa/translate.c
    M trace-events
    M trace/Makefile.objs
    M translate-all.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' 
into staging

Tracing pull request

* remotes/stefanha/tags/tracing-pull-request:
  virtio-rng: add some trace events
  trace: add some tcg tracing support
  trace: teach lttng backend to use format strings
  trace: [tcg] Include TCG-tracing header on all targets
  trace: [tcg] Include event definitions in "trace.h"
  trace: [tcg] Generate TCG tracing routines
  trace: [tcg] Include TCG-tracing helpers
  trace: [tcg] Define TCG tracing helper routine wrappers
  trace: [tcg] Define TCG tracing helper routines
  trace: [tcg] Declare TCG tracing helper routines
  trace: [tcg] Add 'tcg' event property
  trace: [tcg] Argument type transformation machinery
  trace: [tcg] Argument type transformation rules
  trace: [tcg] Add documentation
  trace: install simpletrace SystemTap tapset
  simpletrace: add simpletrace.py --no-header option
  trace: add tracetool simpletrace_stap format
  trace: extract stap_escape() function for reuse

Conflicts:
        Makefile.objs


Compare: https://github.com/qemu/qemu/compare/f2fb1da9412a...5c6b3c50cca2

reply via email to

[Prev in Thread] Current Thread [Next in Thread]