Received: from eggs.gnu.org ([208.118.235.92]:36161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKUQS-000691-8u for qemu-devel@nongnu.org; Tue, 26 Mar 2013 10:00:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKUQM-0007em-7L for qemu-devel@nongnu.org; Tue, 26 Mar 2013 10:00:32 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:37410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKUQL-0007e0-Pz for qemu-devel@nongnu.org; Tue, 26 Mar 2013 10:00:26 -0400 Received: from gw.ac.upc.edu (gw.ac.upc.es [147.83.30.3]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id r2QE0MJk005037 for ; Tue, 26 Mar 2013 15:00:22 +0100 Received: from localhost (unknown [84.88.51.85]) by gw.ac.upc.edu (Postfix) with ESMTP id A402B6B01C4 for ; Tue, 26 Mar 2013 15:00:21 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 26 Mar 2013 15:00:21 +0100 Message-Id: <20130326140021.4471.99597.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC][PATCH 00/22] instrument: Let the user wrap/override specific event tracing routines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org NOTE: Applies on top of the "trace: Generic event state description" seri= es (already in the tracing tree), and is based on revision a4bcea3 fro= m master. TODO: Make sure no TCG code is executing during 'instr_unload' (qemu_cpu_= kick? tb_lock?) The whole set of patch series is available at: https://projects.gso.ac.upc.edu/projects/qemu-dbi Adds the "instrument" event property to declare which tracing events in Q= EMU must be instrumentable. Still, in case the user only wants to wrap around= the tracing events, the original tracing implementation is accessible through= the appropriate routines. The instrumentation can be performed either through a dynamically-loaded = library or through user-provided code that is compiled into QEMU itself (useful w= hen instrumenting high-frequency events, as the fast-path of the instrumentat= ion can be inlined into QEMU). As a side-effect this series adds an API for the instrumentation code to = have some basic interaction with QEMU. See the documentation added in the first patch for more information. Signed-off-by: Llu=C3=ADs Vilanova --- Llu=C3=ADs Vilanova (22): instrument: Add documentation trace: [simple] Do not include "trace/simple.h" in generated tracer= headers trace: Let the user specify her own trace-events file tracetool: Use method 'Event.api' to get the name of public routine= s trace: Minimize inclusions of "qemu-common.h" to avoid inclusion lo= ops instrument: [none] Add null instrumentation linux-user: Use absolute include path instrument: [static] Call statically linked user-provided routines instrument: [dynamic] Call dynamically linked user-provided routine= s instrument: Add internal control interface instrument: [hmp] Add control interface qapi: Add a primitive to include other files from a QAPI schema fil= e [trivial] Set the input root directory when parsing QAPI files instrument: [qmp, qapi] Add control interface Let makefiles add entries to the set of target architecture objects instrument: Add commandline options to start with an instrumentatio= n library instrument: Add client-side API to enumerate events instrument: Add client-side API to control tracing state of events instrument: Add client-side API to control event instrumentation build: Fix installation of target-dependant files instrument: Install headers for dynamic instrumentation clients trace: Do not use the word 'new' in event arguments .gitignore | 4=20 Makefile | 46 ++- Makefile.objs | 8=20 Makefile.target | 7=20 bsd-user/main.c | 24 + bsd-user/syscall.c | 5=20 configure | 96 +++++ docs/instrumentation.txt | 481 +++++++++++++++++++++= ++++++ docs/tracing.txt | 9 + hmp-commands.hx | 42 ++ hw/virtio.c | 1=20 include/qapi/qmp/qerror.h | 9 + include/trace.h | 2=20 instrument/Makefile.objs | 86 +++++ instrument/api-control.c | 14 + instrument/api-trace.c | 14 + instrument/cmdline.c | 94 +++++ instrument/cmdline.h | 41 ++ instrument/control-internal.h | 33 ++ instrument/control.c | 139 ++++++++ instrument/control.h | 133 +++++++ instrument/hmp.c | 65 ++++ instrument/hmp.h | 21 + instrument/qapi-schema.json | 33 ++ instrument/qemu-instr/control-internal.h | 64 ++++ instrument/qemu-instr/control.h | 185 ++++++++++ instrument/qemu-instr/trace-internal.h | 27 ++ instrument/qemu-instr/trace.h | 91 +++++ instrument/qemu-instr/visibility-internal.h | 94 +++++ instrument/qmp.c | 59 +++ libcacard/Makefile | 2=20 linux-user/main.c | 29 ++ linux-user/syscall.c | 4=20 monitor.c | 5=20 qapi-schema.json | 2=20 qemu-options.hx | 18 + qmp-commands.hx | 72 ++++ qmp.c | 4=20 rules.mak | 3=20 scripts/qapi-commands.py | 10 - scripts/qapi-types.py | 10 - scripts/qapi-visit.py | 10 - scripts/qapi.py | 12 + scripts/tracetool.py | 12 + scripts/tracetool/__init__.py | 26 + scripts/tracetool/backend/dtrace.py | 4=20 scripts/tracetool/backend/instr_dynamic.py | 93 +++++ scripts/tracetool/backend/instr_none.py | 44 ++ scripts/tracetool/backend/instr_static.py | 82 +++++ scripts/tracetool/backend/simple.py | 11 - scripts/tracetool/backend/stderr.py | 3=20 scripts/tracetool/backend/ust.py | 6=20 scripts/tracetool/format/api_c.py | 24 + scripts/tracetool/format/api_events_h.py | 56 +++ scripts/tracetool/format/api_h.py | 39 ++ scripts/tracetool/format/events_c.py | 40 ++ scripts/tracetool/format/h.py | 13 + scripts/tracetool/format/qemu_h.py | 68 ++++ trace-events | 8=20 trace/Makefile.objs | 10 - trace/control-internal.h | 2=20 trace/control.c | 2=20 trace/control.h | 7=20 trace/default.c | 2=20 trace/event-internal.h | 15 + trace/simple.c | 6=20 trace/simple.h | 1=20 trace/stderr.c | 4=20 vl.c | 36 ++ 69 files changed, 2670 insertions(+), 52 deletions(-) create mode 100644 docs/instrumentation.txt create mode 100644 instrument/Makefile.objs create mode 100644 instrument/api-control.c create mode 100644 instrument/api-trace.c create mode 100644 instrument/cmdline.c create mode 100644 instrument/cmdline.h create mode 100644 instrument/control-internal.h create mode 100644 instrument/control.c create mode 100644 instrument/control.h create mode 100644 instrument/hmp.c create mode 100644 instrument/hmp.h create mode 100644 instrument/qapi-schema.json create mode 100644 instrument/qemu-instr/control-internal.h create mode 100644 instrument/qemu-instr/control.h create mode 100644 instrument/qemu-instr/trace-internal.h create mode 100644 instrument/qemu-instr/trace.h create mode 100644 instrument/qemu-instr/visibility-internal.h create mode 100644 instrument/qmp.c create mode 100644 scripts/tracetool/backend/instr_dynamic.py create mode 100644 scripts/tracetool/backend/instr_none.py create mode 100644 scripts/tracetool/backend/instr_static.py create mode 100644 scripts/tracetool/format/api_c.py create mode 100644 scripts/tracetool/format/api_events_h.py create mode 100644 scripts/tracetool/format/api_h.py create mode 100644 scripts/tracetool/format/qemu_h.py