[Qemu-devel] [PATCH v4 5/6] hypertrace: Add guest-side user-level library

2016-12-26 Thread Lluís Vilanova
Provides guest library "libqemu-hypertrace-guest.a" to abstract access to the hypertrace channel. Signed-off-by: Lluís Vilanova --- Makefile|6 + configure |2 hypertrace/guest/user/Makefile | 30 +++

[Qemu-devel] [PATCH v4 2/6] hypertrace: Add tracing event "guest_hypertrace"

2016-12-26 Thread Lluís Vilanova
Generates the "guest_hypertrace" event with a user-configurable number of arguments. Signed-off-by: Lluís Vilanova --- Makefile.objs |2 ++ configure | 34 ++ trace-events| 11 +++ trace/Makefile.objs |2 +

[Qemu-devel] [PATCH v4 4/6] hypertrace: [softmmu] Add QEMU-side proxy to "guest_hypertrace" event

2016-12-26 Thread Lluís Vilanova
Uses a virtual device to trigger the hypertrace channel event. Signed-off-by: Lluís Vilanova --- hypertrace/Makefile.objs |5 + hypertrace/softmmu.c | 235 ++ include/hw/pci/pci.h |2 3 files changed, 241 insertions(+), 1 deletion

[Qemu-devel] [PATCH v4 3/6] hypertrace: [*-user] Add QEMU-side proxy to "guest_hypertrace" event

2016-12-26 Thread Lluís Vilanova
QEMU detects when the guest uses 'mmap' on hypertrace's control channel file, and then uses 'mprotect' to detect accesses to it, which are used to trigger tracing event "guest_hypertrace". Signed-off-by: Lluís Vilanova --- Makefile.objs|4

[Qemu-devel] [PATCH v4 1/6] hypertrace: Add documentation

2016-12-26 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- docs/hypertrace.txt | 237 +++ docs/tracing.txt|3 + 2 files changed, 240 insertions(+) create mode 100644 docs/hypertrace.txt diff --git a/docs/hypertrace.txt b/docs/hypertrace.txt new file mode 100644

[Qemu-devel] [PATCH v4 0/6] hypertrace: Lightweight guest-to-QEMU trace channel

2016-12-26 Thread Lluís Vilanova
a full description, use-cases and an example. Signed-off-by: Lluís Vilanova --- Changes in v4 = * Fix typo in stap script example. * Fix compilation instructions in doc/hypertrace.txt. * Rebase on 0737f32daf. Changes in v3 = * Rebase on 4a58f35. * Remove debuggin

Re: [Qemu-devel] [PATCH v3 0/6] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches

2016-12-26 Thread Lluís Vilanova
Richard Henderson writes: > On 12/23/2016 10:51 AM, Lluís Vilanova wrote: >>> On 12/22/2016 10:35 AM, Lluís Vilanova wrote: >>>> To handle both issues, this series replicates the shared physical TB cache, >>>> creating a separate physical TB cache for every com

[Qemu-devel] [Bug 1652373] [NEW] User-mode QEMU is not deterministic

2016-12-23 Thread Lluís Vilanova
Public bug reported: QEMU in user-mode (linux-user or bsd-user) has no way to get the equivalent of the "-icount" argument found in softmmu mode. It is true that some system calls in user-mode can prevent deterministic execution, but it would be very simple to patch time-related syscalls to retur

Re: [Qemu-devel] [PATCH v3 0/6] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches

2016-12-23 Thread Lluís Vilanova
Richard Henderson writes: > On 12/22/2016 10:35 AM, Lluís Vilanova wrote: >> To handle both issues, this series replicates the shared physical TB cache, >> creating a separate physical TB cache for every combination of event states >> (those with the 'vcpu' and &#x

[Qemu-devel] [PATCH v3 3/6] exec: [tcg] Use multiple physical TB caches

2016-12-22 Thread Lluís Vilanova
vent states on a per-vCPU basis. Signed-off-by: Lluís Vilanova --- cpu-exec.c|5 +++- include/exec/exec-all.h |6 + include/exec/tb-context.h |2 +- include/qom/cpu.h |2 ++ qom/cpu.c |2 ++ translate-al

[Qemu-devel] [PATCH v3 0/6] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches

2016-12-22 Thread Lluís Vilanova
so more efficient than eliding TCG code only when *zero* vCPUs are tracing an event, since enabling it on a single vCPU will impact the performance of all other vCPUs that are not tracing that event. Note on overheads: I suspect the culprit of the 1.15x overhead lies in the double dereference Sig

[Qemu-devel] [PATCH v3 5/6] trace: [tcg] Do not generate TCG code to trace dinamically-disabled events

2016-12-22 Thread Lluís Vilanova
code (since otherwise TCG would simply not call it). Signed-off-by: Lluís Vilanova --- scripts/tracetool/__init__.py|1 + scripts/tracetool/format/h.py| 24 ++-- scripts/tracetool/format/tcg_h.py| 19 --- scripts/tracetool

[Qemu-devel] [PATCH v3 1/6] exec: [tcg] Refactor flush of per-CPU virtual TB cache

2016-12-22 Thread Lluís Vilanova
The function is reused in later patches. Signed-off-by: Lluís Vilanova --- cputlb.c|2 +- include/exec/exec-all.h |6 ++ translate-all.c | 14 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cputlb.c b/cputlb.c index

[Qemu-devel] [PATCH v3 4/6] exec: [tcg] Switch physical TB cache based on vCPU tracing state

2016-12-22 Thread Lluís Vilanova
nts will execute code from the same physical TB cache. This is used on the next patch to optimize TCG code related to event tracing. Signed-off-by: Lluís Vilanova --- cpu-exec.c |6 ++ include/qom/cpu.h |1 + qom/cpu.c |1 + trace/control-targe

[Qemu-devel] [PATCH v3 2/6] trace: Make trace_get_vcpu_event_count() inlinable

2016-12-22 Thread Lluís Vilanova
Later patches will make use of it. Signed-off-by: Lluís Vilanova --- trace/control-internal.h |5 + trace/control.c |9 ++--- trace/control.h |2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/trace/control-internal.h b/trace/control

[Qemu-devel] [PATCH v3 6/6] trace: [tcg, trivial] Re-align generated code

2016-12-22 Thread Lluís Vilanova
Last patch removed a nesting level in generated code. Re-align all code generated by backends to be 4-column aligned. Signed-off-by: Lluís Vilanova --- scripts/tracetool/backend/dtrace.py |2 +- scripts/tracetool/backend/ftrace.py | 20 ++-- scripts/tracetool/backend

Re: [Qemu-devel] my attempt at new QEMU website

2016-10-19 Thread Lluís Vilanova
Paolo Bonzini writes: > Hi all, > another small PSA. :) I have created a small but hopefully useful > example of a new QEMU website at http://qemu-bonzini.rhcloud.com/. The > site aims at providing and also a home for blog posts about QEMU. Tiny nit pick: I would clarify that user-mode emulatio

Re: [Qemu-devel] How to get the guest virtual address when the guest program is executed?

2016-10-14 Thread Lluís Vilanova
Peter Maydell writes: > On 14 October 2016 at 10:21, 凌英剑 wrote: >> I've been trying to get GVA when the memory access instruction is >> executed,so I traced a function tcg_qemu_tb_exec() and I found the address >> used by ld/st operations is HVA. >> I would like to know how can I transform HVA to

Re: [Qemu-devel] [PULL 00/20] Tracing patches

2016-10-07 Thread Lluís Vilanova
Daniel P Berrange writes: > On Fri, Oct 07, 2016 at 03:46:27PM +0200, Lluís Vilanova wrote: >> Peter Maydell writes: >> >> > On 7 October 2016 at 11:09, Stefan Hajnoczi wrote: >> >> The following changes since commit >> >> e902754e3d0890945dd

Re: [Qemu-devel] [PULL 00/20] Tracing patches

2016-10-07 Thread Lluís Vilanova
Peter Maydell writes: > On 7 October 2016 at 11:09, Stefan Hajnoczi wrote: >> The following changes since commit e902754e3d0890945ddcc1b33748ed73762ddb8d: >> >> Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.8-20161006' >> into staging (2016-10-06 13:34:00 +0100) >> >> are availa

[Qemu-devel] [PATCH] trace: Add missing execution mode of guest events

2016-10-05 Thread Lluís Vilanova
Add missing execution mode documentation for the 'guest_cpu_enter' and 'guest_cpu_reset' events. Signed-off-by: Lluís Vilanova --- trace-events |2 ++ 1 file changed, 2 insertions(+) diff --git a/trace-events b/trace-events index 1a4e092..6764124 100644 --- a/trac

Re: [Qemu-devel] [RFC] Tracing guest register usage

2016-10-05 Thread Lluís Vilanova
Richard Henderson writes: > On 09/30/2016 08:13 AM, Lluís Vilanova wrote: >>> (2) an internal state change >>> to DisasContext, reflected in INDEX_op_insn_start, with no changes to any >>> TCG >>> registers. So you'll not actually be tracking eflags

Re: [Qemu-devel] [PATCH v6 20/20] trace: introduce a formal group name for trace events

2016-10-05 Thread Lluís Vilanova
roup name 'common' is used, > which is suitable for the current usage where there is > only one global trace-events file used for code generation. > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Daniel P. Berrange Reviewed-by: Lluís Vilanova > --- > scripts/tracetool.p

Re: [Qemu-devel] [PATCH v6 04/20] trace: convert code to use event iterators

2016-10-05 Thread Lluís Vilanova
Daniel P Berrange writes: > This converts the HMP/QMP monitor API implementations > and some internal trace control methods to use the new > trace event iterator APIs. > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Daniel P. Berrange Reviewed-by: Lluís Vilanova >

Re: [Qemu-devel] [RFC] Tracing guest register usage

2016-09-30 Thread Lluís Vilanova
Richard Henderson writes: > On 09/28/2016 06:21 AM, Lluís Vilanova wrote: >> Hi! I've kept working on extending the guest instruction tracing features, >> and >> added support to trace which registers are read/written by guest instructions >> (when executing

Re: [Qemu-devel] [PATCH v3 1/6] hypertrace: Add documentation

2016-09-30 Thread Lluís Vilanova
Daniel P Berrange writes: > On Wed, Sep 28, 2016 at 03:05:36PM +0200, Lluís Vilanova wrote: >> Signed-off-by: Lluís Vilanova >> --- >> docs/hypertrace.txt | 232 >> +++ >> docs/tracing.txt|3 + &

Re: [Qemu-devel] [PATCH v5 20/20] trace: introduce a formal group name for trace events

2016-09-30 Thread Lluís Vilanova
Daniel P Berrange writes: > The declarations in the generated-tracers.h file are > assuming there's only ever going to be one instance > of this header, as they are not namespaced. When we > have one header per event group, if a single source > file needs to include multiple sets of trace events,

Re: [Qemu-devel] [PATCH v5 14/20] trace: dynamically allocate trace_dstate in CPUState

2016-09-30 Thread Lluís Vilanova
ime, > we can't statically declare a bitmap without making > an assumption about the max event count. This problem > can be solved by dynamically allocating the per-CPU > dstate bitmap. > Signed-off-by: Daniel P. Berrange Besides the comments below: Reviewed-by: Lluís Vilanov

Re: [Qemu-devel] [PATCH v5 09/20] trace: give each trace event a named TraceEvent struct

2016-09-30 Thread Lluís Vilanova
e Besides the comment below: Reviewed-by: Lluís Vilanova > --- > scripts/tracetool/__init__.py| 1 + > scripts/tracetool/format/events_c.py | 19 +-- > scripts/tracetool/format/events_h.py | 11 --- > trace/control-internal.h

Re: [Qemu-devel] [PATCH v5 04/20] trace: convert code to use event iterators

2016-09-30 Thread Lluís Vilanova
Daniel P Berrange writes: > This converts the HMP/QMP monitor API implementations > and some internal trace control methods to use the new > trace event iterator APIs. > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Daniel P. Berrange > --- > monitor.c | 26 ++ > trace/co

[Qemu-devel] [RFC] Tracing guest register usage

2016-09-28 Thread Lluís Vilanova
Hi! I've kept working on extending the guest instruction tracing features, and added support to trace which registers are read/written by guest instructions (when executing with TCG). I've basically extended "tcg_global_mem_new_*" to associate global TCG registers with a guest (vCPU) register numb

[Qemu-devel] [PATCH v3 4/6] hypertrace: [softmmu] Add QEMU-side proxy to "guest_hypertrace" event

2016-09-28 Thread Lluís Vilanova
Uses a virtual device to trigger the hypertrace channel event. Signed-off-by: Lluís Vilanova --- hypertrace/Makefile.objs |5 + hypertrace/softmmu.c | 235 ++ include/hw/pci/pci.h |2 3 files changed, 241 insertions(+), 1 deletion

[Qemu-devel] [PATCH v3 2/6] hypertrace: Add tracing event "guest_hypertrace"

2016-09-28 Thread Lluís Vilanova
Generates the "guest_hypertrace" event with a user-configurable number of arguments. Signed-off-by: Lluís Vilanova --- Makefile.objs |2 ++ configure | 34 ++ trace-events| 11 +++ trace/Makefile.objs |2 +

Re: [Qemu-devel] [PATCH v5 02/20] trace: remove double-underscore in event name

2016-09-28 Thread Lluís Vilanova
ate the systemtap > macro with the double underscore squished, it is > simpler to just avoid this usage in the first place. > Signed-off-by: Daniel P. Berrange Reviewed-by: Lluís Vilanova > --- > hw/scsi/spapr_vscsi.c | 2 +- > hw/scsi/trace-events | 2 +- > 2 files chang

[Qemu-devel] [PATCH v3 0/6] hypertrace: Lightweight guest-to-QEMU trace channel

2016-09-28 Thread Lluís Vilanova
a full description, use-cases and an example. Signed-off-by: Lluís Vilanova --- Changes in v3 = * Rebase on 4a58f35. * Remove debugging printf's. * Fix style issues identified by checkpatch. * Fix control channel mapping in guest linux module. * Add a short event desc

[Qemu-devel] [PATCH v3 6/6] hypertrace: Add guest-side Linux module

2016-09-28 Thread Lluís Vilanova
Provides guest Linux kernel module "qemu-hypertrace.ko" to abstract access to the hypertrace channel. Signed-off-by: Lluís Vilanova --- Makefile |4 - configure |4 + hypertrace/guest/li

[Qemu-devel] [PATCH v3 5/6] hypertrace: Add guest-side user-level library

2016-09-28 Thread Lluís Vilanova
Provides guest library "libqemu-hypertrace-guest.a" to abstract access to the hypertrace channel. Signed-off-by: Lluís Vilanova --- Makefile|6 + configure |2 hypertrace/guest/user/Makefile | 30 +++

[Qemu-devel] [PATCH v3 3/6] hypertrace: [*-user] Add QEMU-side proxy to "guest_hypertrace" event

2016-09-28 Thread Lluís Vilanova
QEMU detects when the guest uses 'mmap' on hypertrace's control channel file, and then uses 'mprotect' to detect accesses to it, which are used to trigger tracing event "guest_hypertrace". Signed-off-by: Lluís Vilanova --- Makefile.objs|4

[Qemu-devel] [PATCH v3 1/6] hypertrace: Add documentation

2016-09-28 Thread Lluís Vilanova
Signed-off-by: Lluís Vilanova --- docs/hypertrace.txt | 232 +++ docs/tracing.txt|3 + 2 files changed, 235 insertions(+) create mode 100644 docs/hypertrace.txt diff --git a/docs/hypertrace.txt b/docs/hypertrace.txt new file mode 100644

Re: [Qemu-devel] [RFC PATCH v2 0/6] translate: [tcg] Generic translation framework

2016-09-26 Thread Lluís Vilanova
Lluís Vilanova writes: > This series proposes a generic (target-agnostic) instruction translation > framework. > It basically provides a generic main loop for instruction disassembly, which > calls target-specific functions when necessary. This generalization makes > inserting

Re: [Qemu-devel] [PATCH v2 4/5] trace: [tcg] Do not generate TCG code to trace dinamically-disabled events

2016-09-26 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Thu, Sep 15, 2016 at 05:50:58PM +0200, Lluís Vilanova wrote: > In the subject line: > s/dinamically-disabled/dynamically/ >> for e in events: >> +# tracer without checks >> +out('', >> +

Re: [Qemu-devel] [PATCH v4 08/17] trace: remove the TraceEventID and TraceEventVCPUID enums

2016-09-22 Thread Lluís Vilanova
Lluís Vilanova writes: > Daniel P Berrange writes: >> On Thu, Sep 22, 2016 at 02:35:38PM +0200, Lluís Vilanova wrote: >>> Daniel P Berrange writes: > [...] >>> > diff --git a/scripts/tracetool/format/events_h.py >>> > b/scripts/tracetool/format/ev

[Qemu-devel] [PATCH] trace: Document the execution mode of guest events

2016-09-22 Thread Lluís Vilanova
Explicitly state in which execution mode (user, softmmu, all) are guest events available for tracing. Signed-off-by: Lluís Vilanova --- trace-events |3 +++ 1 file changed, 3 insertions(+) diff --git a/trace-events b/trace-events index 9922bcd..e0c3f91 100644 --- a/trace-events +++ b/trace

Re: [Qemu-devel] [PATCH v4 08/17] trace: remove the TraceEventID and TraceEventVCPUID enums

2016-09-22 Thread Lluís Vilanova
Daniel P Berrange writes: > On Thu, Sep 22, 2016 at 02:35:38PM +0200, Lluís Vilanova wrote: >> Daniel P Berrange writes: [...] >> > diff --git a/scripts/tracetool/format/events_h.py >> > b/scripts/tracetool/format/events_h.py >> > index 80a66c5..5da1d4c 100644

Re: [Qemu-devel] [PATCH v4 14/17] trace: get rid of generated-events.h/generated-events.c

2016-09-22 Thread Lluís Vilanova
there > is one less file to be generated. > Signed-off-by: Daniel P. Berrange Other than the comment below: Reviewed-by: Lluís Vilanova > --- > Makefile | 3 -- > include/trace-tcg.h | 1 - > include/trace.h

Re: [Qemu-devel] [PATCH v4 12/17] trace: dynamically allocate trace_dstate in CPUState

2016-09-22 Thread Lluís Vilanova
Daniel P Berrange writes: > The CPUState struct has a bitmap tracking which VCPU > events are currently active. This is indexed based on > the event ID values, and sized according the maximum > TraceEventVCPUID enum value. > When we start dynamically assigning IDs at runtime, > we can't staticall

Re: [Qemu-devel] [PATCH v4 00/17] Refactor trace to allow modular build

2016-09-22 Thread Lluís Vilanova
Daniel P Berrange writes: > These patches were previously posted as part of my giant > trace events modular build series [...] BTW, thanks for the effort. Not only will this improve build times, but I can build a further simplification of the auto-generated files on top (I'll try to merge the tra

Re: [Qemu-devel] [PATCH v4 17/17] trace: pass trace-events to tracetool as a positional param

2016-09-22 Thread Lluís Vilanova
Daniel P Berrange writes: > Instead of reading the contents of 'trace-events' from stdin, > accept the filename as a positional parameter. This also > allows for reading from multiple files, though this facility > is not used at this time. > Signed-off-by: Daniel P. Berr

Re: [Qemu-devel] [PATCH v4 11/17] trace: provide mechanism for registering trace events

2016-09-22 Thread Lluís Vilanova
all necessary and sufficient): Reviewed-by: Lluís Vilanova > --- > include/qemu/module.h| 2 ++ > qemu-img.c | 1 + > qemu-io.c| 1 + > qemu-nbd.c | 1 + > scripts/tracetool/form

Re: [Qemu-devel] [PATCH v4 06/17] trace: break circular dependency in event-internal.h

2016-09-22 Thread Lluís Vilanova
ch > following this move event-internal.h to the top of > generated-events.h, so we can expose TraceEvent > struct variables in generated-events.h > Signed-off-by: Daniel P. Berrange Reviewed-by: Lluís Vilanova > --- > trace/event-internal.h | 7 ++- > 1 file changed, 2

Re: [Qemu-devel] [PATCH v4 08/17] trace: remove the TraceEventID and TraceEventVCPUID enums

2016-09-22 Thread Lluís Vilanova
Daniel P. Berrange Disregarding comment below: Reviewed-by: Lluís Vilanova > --- > scripts/tracetool/backend/simple.py | 4 ++-- > scripts/tracetool/format/events_c.py | 16 +++- > scripts/tracetool/format/events_h.py | 18 +++--- > scripts/tr

Re: [Qemu-devel] [PATCH v4 13/17] trace: dynamically allocate event IDs at runtime

2016-09-22 Thread Lluís Vilanova
g to figure out > globally unique numbering at build time. > Signed-off-by: Daniel P. Berrange Reviewed-by: Lluís Vilanova > --- > scripts/tracetool/format/events_c.py | 10 ++ > scripts/tracetool/format/events_h.py | 7 --- > trace/control.c |

Re: [Qemu-devel] [PATCH v4 07/17] trace: give each trace event a named TraceEvent struct

2016-09-22 Thread Lluís Vilanova
Daniel P Berrange writes: > Currently we only expose a TraceEvent array, which must > be indexed via the TraceEventID enum constants. This > changes the generator to expose a named TraceEvent > instance for each event, with an _EV suffix. > Signed-off-by: Daniel P. Berrange > --- > scripts/trac

Re: [Qemu-devel] [PATCH v4 02/17] trace: convert code to use event iterators

2016-09-22 Thread Lluís Vilanova
Daniel P Berrange writes: > This converts the HMP/QMP monitor API implementations > and some internal trace control methods to use the new > trace event iterator APIs. > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Daniel P. Berrange > --- > monitor.c | 26 ++ > trace/co

Re: [Qemu-devel] [PATCH v3 17/18] trace: pass trace-events to tracetool as a positional param

2016-09-20 Thread Lluís Vilanova
Daniel P Berrange writes: > On Mon, Sep 19, 2016 at 08:18:51PM +0200, Lluís Vilanova wrote: >> Daniel P Berrange writes: >> >> > Instead of reading the contents of 'trace-events' from stdin, >> > accept the filename as a positional parameter. This also

Re: [Qemu-devel] [PATCH v3 13/18] trace: dynamically allocate event IDs at runtime

2016-09-20 Thread Lluís Vilanova
Daniel P Berrange writes: > On Mon, Sep 19, 2016 at 08:05:12PM +0200, Lluís Vilanova wrote: >> Daniel P Berrange writes: >> >> > Instead of having the code generator assign event IDs and >> > event VCPU IDs, assign them when the events are registered >>

Re: [Qemu-devel] [PATCH v3 02/18] trace: convert code to use event iterators

2016-09-20 Thread Lluís Vilanova
Daniel P Berrange writes: > On Mon, Sep 19, 2016 at 06:59:17PM +0200, Lluís Vilanova wrote: >> Daniel P Berrange writes: >> >> > This converts the HMP/QMP monitor API implementations >> > and some internal trace control methods to use the new >> > trace

Re: [Qemu-devel] [PATCH v3 18/18] trace: introduce a formal group name for trace events

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > The declarations in the generated-tracers.h file are > assuming there's only ever going to be one instance > of this header, as they are not namespaced. When we > have one header per event group, if a single source > file needs to include multiple sets of trace events,

Re: [Qemu-devel] [PATCH v3 16/18] trace: push reading of events up a level to tracetool main

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > Move the reading of events out of the 'tracetool.generate' > method and into tracetool.main, so that the latter is not > tied to generating from a single source of events. > Signed-off-by: Daniel P. Berrange Reviewed-by: Lluís Vilano

Re: [Qemu-devel] [PATCH v3 14/18] trace: get rid of generated-events.h/generated-events.c

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > Currently the generated-events.[ch] files contain the > event dstates, constants and TraceEvent structs, while the > generated-tracers.[ch] files contain the actual trace > probe logic. With the removal of usage of the event enums > from the API there is no longer any c

Re: [Qemu-devel] [PATCH v3 15/18] trace: rename _read_events to read_events

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > The _read_events method is used by callers outside of > its module, so should be a public method, not private. > Signed-off-by: Daniel P. Berrange Reviewed-by: Lluís Vilanova > --- > scripts/simpletrace.py| 6 +++--- > scripts/tra

Re: [Qemu-devel] [PATCH v3 17/18] trace: pass trace-events to tracetool as a positional param

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > Instead of reading the contents of 'trace-events' from stdin, > accept the filename as a positional parameter. This also > allows for reading from multiple files, though this facility > is not used at this time. > Signed-off-by: Daniel P. Berrange > --- > Makefile.ta

Re: [Qemu-devel] [PATCH v3 08/18] trace: remove the TraceEventID and TraceEventVCPUID enums

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > The TraceEventID and TraceEventVCPUID enums constants are > no longer actually used for anything critical. > The TRACE_EVENT_COUNT limit is used to determine the size > of the TraceEvents array, and can be removed if we just > NULL terminate the array instead. > The T

Re: [Qemu-devel] [PATCH v3 13/18] trace: dynamically allocate event IDs at runtime

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > Instead of having the code generator assign event IDs and > event VCPU IDs, assign them when the events are registered > at runtime. This will allow us allow code to be generated > from individual trace-events without having to figure out > globally unique numbering at

Re: [Qemu-devel] [PATCH v3 12/18] trace: dynamically allocate trace_dstate in CPUState

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > The CPUState struct has a bitmap tracking which VCPU > events are currently active. This is indexed based on > the event ID values, and sized according the maximum > TraceEventVCPUID enum value. > When we start dynamically assigning IDs at runtime, > we can't staticall

Re: [Qemu-devel] [PATCH v3 06/18] trace: break circular dependancy in event-internal.h

2016-09-19 Thread Lluís Vilanova
Typo in subject: dependancy -> dependency Daniel P Berrange writes: > Currently event-internal.h includes generated-events.h, > while generated-events.h includes event-internal.h > causing a circular dependency. > event-internal.h requires that the content of > generated-events.h comes first, so

Re: [Qemu-devel] [PATCH v3 04/18] trace: remove global 'uint16 dstate[]' array

2016-09-19 Thread Lluís Vilanova
y_id into a > macro, this still hits the fast path, and cache affinity > is ensured by declaring all the uint16 vars adjacent to > each other. > Signed-off-by: Daniel P. Berrange Besides Eric's comments: Reviewed-by: Lluís Vilanova > --- > scripts/tracetool/__init_

Re: [Qemu-devel] [PATCH v3 07/18] trace: give each trace event a named TraceEvent struct

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > Currently we only expose a TraceEvent array, which must > be indexed via the TraceEventID enum constants. This > changes the generator to expose a named TraceEvent > instance for each event, with an _EV suffix. > Signed-off-by: Daniel P. Berrange > --- > scripts/trac

Re: [Qemu-devel] [PATCH v3 02/18] trace: convert code to use event iterators

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > This converts the HMP/QMP monitor API implementations > and some internal trace control methods to use the new > trace event iterator APIs. > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Daniel P. Berrange > --- > monitor.c | 26 > trace/cont

Re: [Qemu-devel] [PATCH v3 05/18] trace: remove duplicate control.h includes in generated-tracers.h

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > The format/h.py file adds an include for control.h to > generated-tracers.h. ftrace, log and syslog, then > add more duplicate includes for control.h. > Signed-off-by: Daniel P. Berrange Reviewed-by: Lluís Vilanova > --- > scripts/tracetool/bac

Re: [Qemu-devel] [PATCH v3 03/18] trace: remove some now unused functions

2016-09-19 Thread Lluís Vilanova
Daniel P Berrange writes: > The trace_event_count, trace_event_id and > trace_event_pattern methods are no longer required > now that everything is using the iterator APIs > The trace_event_set_state and trace_event_set_vcpu_state > macros were also unused. Wouldn't it make more sense to fold th

Re: [Qemu-devel] [PATCH v3 01/18] trace: add trace event iterator APIs

2016-09-19 Thread Lluís Vilanova
to apply a pattern match filter > to events, further removing the need for the pattern > Signed-off-by: Daniel P. Berrange As for patch contents: Reviewed-by: Lluís Vilanova > --- > trace/control.c | 21 + > trace/control.h | 27 +++ &

[Qemu-devel] [PATCH v3 0/3] trace: Add events to track vCPU lifecycle

2016-09-19 Thread Lluís Vilanova
. Signed-off-by: Lluís Vilanova --- Changes in v3 = * Remove code for trace_fini_vcpu(), since there is no full support for hot-unplugging. Changes in v2 = * Properly support vCPU hot-plugging to "inherit" dynamic event states. * Rename event "gue

[Qemu-devel] [PATCH v3 2/3] trace: Add event "guest_cpu_enter"

2016-09-19 Thread Lluís Vilanova
Signals the hot-plugging of a new virtual (guest) CPU. Signed-off-by: Lluís Vilanova --- trace-events |8 trace/control-target.c |3 +++ 2 files changed, 11 insertions(+) diff --git a/trace-events b/trace-events index 616cc52..16a1cb4 100644 --- a/trace-events +++ b

[Qemu-devel] [PATCH v3 1/3] trace: Properly initialize dynamic event states in hot-plugged vCPUs

2016-09-19 Thread Lluís Vilanova
Every time a vCPU is hot-plugged, it will "inherit" its tracing state from the global state array. That is, if *any* existing vCPU has an event enabled, new vCPUs will have too. Signed-off-by: Lluís Vilanova --- bsd-user/main.c|1 - linux-user/main.c |1 -

[Qemu-devel] [PATCH v3 3/3] trace: Add event "guest_cpu_reset"

2016-09-19 Thread Lluís Vilanova
Signals the reset of the state a virtual (guest) CPU. Signed-off-by: Lluís Vilanova --- qom/cpu.c|3 +++ trace-events |5 + 2 files changed, 8 insertions(+) diff --git a/qom/cpu.c b/qom/cpu.c index 7e2e523..5f0ec6e 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -29,6 +29,7

Re: [Qemu-devel] [PATCH v2 1/6] Pass generic CPUState to gen_intermediate_code()

2016-09-19 Thread Lluís Vilanova
Richard Henderson writes: > On 09/09/2016 06:03 AM, Lluís Vilanova wrote: >> -void gen_intermediate_code(CPUAlphaState *env, struct TranslationBlock *tb) >> +void gen_intermediate_code(CPUState *cpu, struct TranslationBlock *tb) >> { >> -AlphaCPU *

Re: [Qemu-devel] [PATCH v2 0/3] trace: Add events to track vCPU lifecycle

2016-09-15 Thread Lluís Vilanova
no-reply writes: > Hi, > Your series failed automatic build test. Please find the testing commands and > their output below. If you have docker installed, you can probably reproduce > it > locally. > Type: series > Message-id: 147395313099.671.7091947764472506776.st...@fimbulvetr.bsc.es > Subje

[Qemu-devel] [PATCH v2 1/5] exec: [tcg] Refactor flush of per-CPU virtual TB cache

2016-09-15 Thread Lluís Vilanova
The function is reused in later patches. Signed-off-by: Lluís Vilanova --- cputlb.c|2 +- include/exec/exec-all.h |6 ++ translate-all.c |9 +++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cputlb.c b/cputlb.c index d068ee5

[Qemu-devel] [PATCH v2 0/5] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches

2016-09-15 Thread Lluís Vilanova
code only when *zero* vCPUs are tracing an event, since enabling it on a single vCPU will impact the performance of all other vCPUs that are not tracing that event. Signed-off-by: Lluís Vilanova --- Changes in v2 = * Fix bitmap copy in cpu_tb_cache_set_apply(). * Split generated code

[Qemu-devel] [PATCH v2 4/5] trace: [tcg] Do not generate TCG code to trace dinamically-disabled events

2016-09-15 Thread Lluís Vilanova
code (since otherwise TCG would simply not call it). Signed-off-by: Lluís Vilanova --- scripts/tracetool/format/h.py| 23 +-- scripts/tracetool/format/tcg_h.py| 20 +--- scripts/tracetool/format/tcg_helper_c.py |3 ++- 3 files changed

[Qemu-devel] [PATCH v2 5/5] trace: [tcg, trivial] Re-align generated code

2016-09-15 Thread Lluís Vilanova
Last patch removed a nesting level in generated code. Re-align all code generated by backends to be 4-column aligned. Signed-off-by: Lluís Vilanova --- scripts/tracetool/backend/dtrace.py |2 +- scripts/tracetool/backend/ftrace.py | 20 ++-- scripts/tracetool/backend

[Qemu-devel] [PATCH v2 3/5] exec: [tcg] Switch physical TB cache based on vCPU tracing state

2016-09-15 Thread Lluís Vilanova
nts will execute code from the same physical TB cache. This is used on the next patch to optimize TCG code related to event tracing. Signed-off-by: Lluís Vilanova --- cpu-exec.c |6 ++ trace/control-target.c |2 ++ trace/control.h|3 +++ translate-al

[Qemu-devel] [PATCH v2 2/5] exec: [tcg] Use multiple physical TB caches

2016-09-15 Thread Lluís Vilanova
vent states on a per-vCPU basis. Signed-off-by: Lluís Vilanova --- cpu-exec.c|5 include/exec/exec-all.h |6 + include/exec/tb-context.h |2 +- include/qom/cpu.h |4 +++- qom/cpu.c |1 + translate-al

[Qemu-devel] [PATCH v2 1/3] trace: Properly initialize dynamic event states in hot-plugged vCPUs

2016-09-15 Thread Lluís Vilanova
Every time a vCPU is hot-plugged, it will "inherit" its tracing state from the global state array. That is, if *any* existing vCPU has an event enabled, new vCPUs will have too. Signed-off-by: Lluís Vilanova --- bsd-user/main.c|1 - linux-user/main.c |1 -

[Qemu-devel] [PATCH v2 2/3] trace: Add event "guest_cpu_enter"

2016-09-15 Thread Lluís Vilanova
Signals the hot-plugging of a new virtual (guest) CPU. Signed-off-by: Lluís Vilanova --- trace-events |8 trace/control-target.c |3 +++ 2 files changed, 11 insertions(+) diff --git a/trace-events b/trace-events index 616cc52..16a1cb4 100644 --- a/trace-events +++ b

[Qemu-devel] [PATCH v2 3/3] trace: Add event "guest_cpu_reset"

2016-09-15 Thread Lluís Vilanova
Signals the reset of the state a virtual (guest) CPU. Signed-off-by: Lluís Vilanova --- qom/cpu.c|3 +++ trace-events |5 + 2 files changed, 8 insertions(+) diff --git a/qom/cpu.c b/qom/cpu.c index 7e2e523..5f0ec6e 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -29,6 +29,7

[Qemu-devel] [PATCH v2 0/3] trace: Add events to track vCPU lifecycle

2016-09-15 Thread Lluís Vilanova
. Signed-off-by: Lluís Vilanova --- Changes in v2 = * Properly support vCPU hot-plugging to "inherit" dynamic event states. * Rename event "guest_cpu_init" to "guest_cpu_enter". Lluís Vilanova (3): trace: Properly initialize dynamic event states in

Re: [Qemu-devel] [PATCH 4/4] trace: [tcg] Do not generate TCG code to trace dinamically-disabled events

2016-09-15 Thread Lluís Vilanova
Daniel P Berrange writes: > On Wed, Sep 14, 2016 at 11:23:38PM +0200, Lluís Vilanova wrote: >> If an event is dynamically disabled, the TCG code that calls the >> execution-time tracer is not generated. >> >> Removes the overheads of execution-time tracers for dynamic

Re: [Qemu-devel] [PATCH 1/2] trace: Add "cpu_init" event

2016-09-15 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Thu, Sep 15, 2016 at 02:51:59PM +0200, Lluís Vilanova wrote: >> Stefan Hajnoczi writes: >> >> > On Wed, Sep 14, 2016 at 06:01:17PM +0200, Lluís Vilanova wrote: >> >> Stefan Hajnoczi writes: >> >> >> >> >

Re: [Qemu-devel] [PATCH 3/4] exec: [tcg] Switch physical TB cache based on vCPU tracing state

2016-09-15 Thread Lluís Vilanova
Lluís Vilanova writes: > Uses the per-vCPU event state in CPUState->trace_dstate (a bitmap) as an > index to a physical TB cache that will contain code specific to the set > of dynamically enabled events. > Two vCPUs tracing different events will execute code from different >

Re: [Qemu-devel] [PATCH 1/2] trace: Add "cpu_init" event

2016-09-15 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Wed, Sep 14, 2016 at 06:01:17PM +0200, Lluís Vilanova wrote: >> Stefan Hajnoczi writes: >> >> > On Tue, Sep 06, 2016 at 04:25:53PM +0200, Lluís Vilanova wrote: >> >> +## vCPU >> >> + >> >> +# Cre

Re: [Qemu-devel] [PATCH v2 5/6] trace: remove use of event ID enums from APIs

2016-09-15 Thread Lluís Vilanova
Daniel P Berrange writes: > On Thu, Sep 15, 2016 at 01:26:06AM +0200, Lluís Vilanova wrote: >> Daniel P Berrange writes: >> >> > Since there will shortly be multiple event groups allowed, >> > we can no longer use the TraceEventID and TraceEventVCPUID >> &

Re: [Qemu-devel] [PATCH v2 4/6] trace: remove global 'uint16 dstate[]' array

2016-09-14 Thread Lluís Vilanova
Daniel P Berrange writes: > Instead of having a global dstate array, declare a single > 'uint16 TRACE_${EVENT_NAME}_DSTATE' variable for each > trace event. Record a pointer to this variable in the > TraceEvent struct too. > By turning trace_event_get_state_dynamic_by_id into a > macro, this stil

Re: [Qemu-devel] [PATCH v2 6/6] trace: use -1 instead of TRACE_VCPU_EVENT_COUNT as magic value

2016-09-14 Thread Lluís Vilanova
Daniel P Berrange writes: > The TraceEvent struct vcpu_id field uses the constant > TRACE_VCPU_EVENT_COUNT as a magic value to indicate this > is not a per-VCPU event. The max count value will be > different for each event group though, so this is no > longer suitable. Instead use the value (size_

Re: [Qemu-devel] [PATCH v2 5/6] trace: remove use of event ID enums from APIs

2016-09-14 Thread Lluís Vilanova
Daniel P Berrange writes: > Since there will shortly be multiple event groups allowed, > we can no longer use the TraceEventID and TraceEventVCPUID > enums in the trace control APIs. There will in fact be > multiple distinct enums, and the enum values will only be > required to be unique per group

Re: [Qemu-devel] [PATCH v2 3/6] trace: remove some now unused functions

2016-09-14 Thread Lluís Vilanova
Daniel P. Berrange Reviewed-by: Lluís Vilanova > --- > trace/control-internal.h | 11 - > trace/control.c | 22 -- > trace/control.h | 59 > > 3 files changed, 92 deletions(-) >

Re: [Qemu-devel] [PATCH v2 2/6] trace: convert code to use event iterators

2016-09-14 Thread Lluís Vilanova
Daniel P Berrange writes: > This converts the HMP/QMP monitor API implementations > and some internal trace control methods to use the new > trace event iterator APIs. > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Daniel P. Berrange > --- > monitor.c | 16 ++ > trace/control.c

Re: [Qemu-devel] [PATCH v2 1/6] trace: add trace event iterator APIs

2016-09-14 Thread Lluís Vilanova
Daniel P Berrange writes: > Currently methods which want to iterate over trace events, > do so using the trace_event_count() and trace_event_id() > methods. This leaks the concept of a single ID enum to > the callers. There is an alternative trace_event_pattern() > method which can be used in an i

[Qemu-devel] [PATCH 2/4] exec: [tcg] Use multiple physical TB caches

2016-09-14 Thread Lluís Vilanova
vent states on a per-vCPU basis. Signed-off-by: Lluís Vilanova --- cpu-exec.c|5 include/exec/exec-all.h |6 + include/exec/tb-context.h |2 +- include/qom/cpu.h |4 +++- qom/cpu.c |1 + translate-al

<    1   2   3   4   5   6   7   8   9   10   >