Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-29 Thread Peter Maydell
On 26 August 2017 at 01:02, Emilio G. Cota wrote: > An additional "nice to have" would be: > > * Allow inlining of TCG code by the instrumenter. Example use case: > the instrumenter wants to increment a counter every time a > basic block is executed. Instead of calling a callback function on e

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-25 Thread Emilio G. Cota
On Thu, Aug 03, 2017 at 12:54:57 +0100, Stefan Hajnoczi wrote: > > > Please post an example of the API you'd like. > > > > In my opinion, the instrumentation support in this series provides an API > > that > > works in the opposite way you're suggesting (let's ignore the fact that it's > > built

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-25 Thread Emilio G. Cota
On Fri, Jul 28, 2017 at 19:05:43 +0300, Lluís Vilanova wrote: > As for the (minimum) requirements I've collected: > > * Peek at register values and guest memory. > * Enumerate guest cpus. > * Control when events are raised to minimize overheads (e.g., avoid generating > TCG code to trace a guest

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-03 Thread Stefan Hajnoczi
On Wed, Aug 02, 2017 at 06:19:29PM +0300, Lluís Vilanova wrote: > Stefan Hajnoczi writes: > > > On Wed, Aug 02, 2017 at 12:10:14PM +0100, Peter Maydell wrote: > >> On 2 August 2017 at 12:04, Stefan Hajnoczi wrote: > >> > On Tue, Aug 01, 2017 at 02:54:29PM +0100, Peter Maydell wrote: > >> >> and I

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-02 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Wed, Aug 02, 2017 at 12:10:14PM +0100, Peter Maydell wrote: >> On 2 August 2017 at 12:04, Stefan Hajnoczi wrote: >> > On Tue, Aug 01, 2017 at 02:54:29PM +0100, Peter Maydell wrote: >> >> and I don't need the TCG engine to be a library to do that... >> > >> > You do ne

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-02 Thread Stefan Hajnoczi
On Wed, Aug 02, 2017 at 12:10:14PM +0100, Peter Maydell wrote: > On 2 August 2017 at 12:04, Stefan Hajnoczi wrote: > > On Tue, Aug 01, 2017 at 02:54:29PM +0100, Peter Maydell wrote: > >> and I don't need the TCG engine to be a library to do that... > > > > You do need TCG APIs if you want TCG-leve

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-02 Thread Peter Maydell
On 2 August 2017 at 12:04, Stefan Hajnoczi wrote: > On Tue, Aug 01, 2017 at 02:54:29PM +0100, Peter Maydell wrote: >> and I don't need the TCG engine to be a library to do that... > > You do need TCG APIs if you want TCG-level instrumentation, tuning > options, callbacks, etc. I need an API; that

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-02 Thread Stefan Hajnoczi
On Fri, Jul 28, 2017 at 07:21:04PM +0300, Lluís Vilanova wrote: > Stefan Hajnoczi writes: > > > On Thu, Jul 27, 2017 at 11:40:17AM +0100, Peter Maydell wrote: > >> On 27 July 2017 at 11:32, Stefan Hajnoczi wrote: > >> > On Wed, Jul 26, 2017 at 03:44:39PM +0300, Lluís Vilanova wrote: > >> >> And w

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-02 Thread Stefan Hajnoczi
On Tue, Aug 01, 2017 at 02:54:29PM +0100, Peter Maydell wrote: > On 1 August 2017 at 14:48, Stefan Hajnoczi wrote: > > Thanks for sharing the requirements. A stable API is necessary for > > providing these features. > > > > We're essentially talking about libqemu. That means QEMU in library > >

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-01 Thread Peter Maydell
On 1 August 2017 at 14:48, Stefan Hajnoczi wrote: > Thanks for sharing the requirements. A stable API is necessary for > providing these features. > > We're essentially talking about libqemu. That means QEMU in library > form with an API for JIT engine, reverse engineering, instrumentation, > et

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-01 Thread Stefan Hajnoczi
On Fri, Jul 28, 2017 at 07:05:43PM +0300, Lluís Vilanova wrote: > Daniel P Berrange writes: > > > On Fri, Jul 28, 2017 at 02:41:19PM +0100, Peter Maydell wrote: > >> On 28 July 2017 at 14:34, Stefan Hajnoczi wrote: > >> > Lluís/Peter: What are the requirements for instrumentation code > >> > inte

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-08-01 Thread Stefan Hajnoczi
On Fri, Jul 28, 2017 at 07:14:33PM +0300, Lluís Vilanova wrote: > Daniel P Berrange writes: > > > On Fri, Jul 28, 2017 at 02:34:30PM +0100, Stefan Hajnoczi wrote: > >> On Thu, Jul 27, 2017 at 04:45:35PM +0100, Daniel P. Berrange wrote: > >> > On Thu, Jul 27, 2017 at 04:33:01PM +0100, Peter Maydell

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-28 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Thu, Jul 27, 2017 at 11:40:17AM +0100, Peter Maydell wrote: >> On 27 July 2017 at 11:32, Stefan Hajnoczi wrote: >> > On Wed, Jul 26, 2017 at 03:44:39PM +0300, Lluís Vilanova wrote: >> >> And why exactly is this a threat? Because it can be used to "extend" QEMU >> >> w

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-28 Thread Lluís Vilanova
Daniel P Berrange writes: > On Fri, Jul 28, 2017 at 02:34:30PM +0100, Stefan Hajnoczi wrote: >> On Thu, Jul 27, 2017 at 04:45:35PM +0100, Daniel P. Berrange wrote: >> > On Thu, Jul 27, 2017 at 04:33:01PM +0100, Peter Maydell wrote: >> > > On 27 July 2017 at 16:21, Daniel P. Berrange wrote: >> > >

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-28 Thread Lluís Vilanova
Daniel P Berrange writes: > On Fri, Jul 28, 2017 at 02:41:19PM +0100, Peter Maydell wrote: >> On 28 July 2017 at 14:34, Stefan Hajnoczi wrote: >> > Lluís/Peter: What are the requirements for instrumentation code >> > interacting with the running QEMU instance? simpletrace is >> > asynchronous, m

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-28 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Thu, Jul 27, 2017 at 04:45:35PM +0100, Daniel P. Berrange wrote: >> On Thu, Jul 27, 2017 at 04:33:01PM +0100, Peter Maydell wrote: >> > On 27 July 2017 at 16:21, Daniel P. Berrange wrote: >> > > On Thu, Jul 27, 2017 at 11:54:29AM +0100, Peter Maydell wrote: >> > >> Th

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-28 Thread Daniel P. Berrange
On Fri, Jul 28, 2017 at 02:41:19PM +0100, Peter Maydell wrote: > On 28 July 2017 at 14:34, Stefan Hajnoczi wrote: > > Lluís/Peter: What are the requirements for instrumentation code > > interacting with the running QEMU instance? simpletrace is > > asynchronous, meaning it does not wait for anyon

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-28 Thread Daniel P. Berrange
On Fri, Jul 28, 2017 at 02:34:30PM +0100, Stefan Hajnoczi wrote: > On Thu, Jul 27, 2017 at 04:45:35PM +0100, Daniel P. Berrange wrote: > > On Thu, Jul 27, 2017 at 04:33:01PM +0100, Peter Maydell wrote: > > > On 27 July 2017 at 16:21, Daniel P. Berrange wrote: > > > > On Thu, Jul 27, 2017 at 11:54:

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-28 Thread Stefan Hajnoczi
On Thu, Jul 27, 2017 at 11:40:17AM +0100, Peter Maydell wrote: > On 27 July 2017 at 11:32, Stefan Hajnoczi wrote: > > On Wed, Jul 26, 2017 at 03:44:39PM +0300, Lluís Vilanova wrote: > >> And why exactly is this a threat? Because it can be used to "extend" QEMU > >> without touching its sources? Is

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-28 Thread Peter Maydell
On 28 July 2017 at 14:34, Stefan Hajnoczi wrote: > Lluís/Peter: What are the requirements for instrumentation code > interacting with the running QEMU instance? simpletrace is > asynchronous, meaning it does not wait for anyone handle the trace event > before continuing execution, and is therefor

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-28 Thread Stefan Hajnoczi
On Thu, Jul 27, 2017 at 04:45:35PM +0100, Daniel P. Berrange wrote: > On Thu, Jul 27, 2017 at 04:33:01PM +0100, Peter Maydell wrote: > > On 27 July 2017 at 16:21, Daniel P. Berrange wrote: > > > On Thu, Jul 27, 2017 at 11:54:29AM +0100, Peter Maydell wrote: > > >> That said, yes, I was going to as

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-27 Thread Lluís Vilanova
Daniel P Berrange writes: > On Thu, Jul 27, 2017 at 11:54:29AM +0100, Peter Maydell wrote: >> On 27 July 2017 at 11:43, Daniel P. Berrange wrote: >> > Maybe I'm missing something, but aren't all these things >> > already possible via either the statically defined tracepoints >> > QEMU exposes, or

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-27 Thread Daniel P. Berrange
On Thu, Jul 27, 2017 at 04:33:01PM +0100, Peter Maydell wrote: > On 27 July 2017 at 16:21, Daniel P. Berrange wrote: > > On Thu, Jul 27, 2017 at 11:54:29AM +0100, Peter Maydell wrote: > >> That said, yes, I was going to ask if we could do this via > >> leveraging the tracepoint infrastructure and

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-27 Thread Peter Maydell
On 27 July 2017 at 16:21, Daniel P. Berrange wrote: > On Thu, Jul 27, 2017 at 11:54:29AM +0100, Peter Maydell wrote: >> That said, yes, I was going to ask if we could do this via >> leveraging the tracepoint infrastructure and whatever scripting >> facilities it provides. Are there any good worked

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-27 Thread Daniel P. Berrange
On Thu, Jul 27, 2017 at 11:54:29AM +0100, Peter Maydell wrote: > On 27 July 2017 at 11:43, Daniel P. Berrange wrote: > > Maybe I'm missing something, but aren't all these things > > already possible via either the statically defined tracepoints > > QEMU exposes, or by placing dynamic tracepoints o

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-27 Thread Lluís Vilanova
Peter Maydell writes: > On 27 July 2017 at 11:43, Daniel P. Berrange wrote: >> Maybe I'm missing something, but aren't all these things >> already possible via either the statically defined tracepoints >> QEMU exposes, or by placing dynamic tracepoints on arbitrary >> code locations using dtrace/

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-27 Thread Peter Maydell
On 27 July 2017 at 11:43, Daniel P. Berrange wrote: > Maybe I'm missing something, but aren't all these things > already possible via either the statically defined tracepoints > QEMU exposes, or by placing dynamic tracepoints on arbitrary > code locations using dtrace/systemtap/lttng-ust. Last ti

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-27 Thread Daniel P. Berrange
On Wed, Jul 26, 2017 at 12:49:00PM +0100, Peter Maydell wrote: > On 26 July 2017 at 12:26, Stefan Hajnoczi wrote: > > On Tue, Jul 25, 2017 at 02:30:06PM +0100, Peter Maydell wrote: > >> Is your proposal that my-instrumentation.c gets compiled into > >> QEMU at this point? That doesn't seem like a

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-27 Thread Peter Maydell
On 27 July 2017 at 11:32, Stefan Hajnoczi wrote: > On Wed, Jul 26, 2017 at 03:44:39PM +0300, Lluís Vilanova wrote: >> And why exactly is this a threat? Because it can be used to "extend" QEMU >> without touching its sources? Is this a realistic threat? (it's a rather >> brittle >> way to do it, s

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-27 Thread Stefan Hajnoczi
On Wed, Jul 26, 2017 at 03:44:39PM +0300, Lluís Vilanova wrote: > Stefan Hajnoczi writes: > > > On Tue, Jul 25, 2017 at 06:11:43PM +0300, Lluís Vilanova wrote: > >> Peter Maydell writes: > >> > >> > On 25 July 2017 at 14:19, Stefan Hajnoczi wrote: > >> >> Instead I suggest adding a trace backend

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-26 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Tue, Jul 25, 2017 at 06:11:43PM +0300, Lluís Vilanova wrote: >> Peter Maydell writes: >> >> > On 25 July 2017 at 14:19, Stefan Hajnoczi wrote: >> >> Instead I suggest adding a trace backend generates calls to registered >> >> "callback" functions: >> >> >> >> $ cat

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-26 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Tue, Jul 25, 2017 at 05:47:08PM +0300, Lluís Vilanova wrote: >> Stefan Hajnoczi writes: >> >> > On Mon, Jul 24, 2017 at 08:02:24PM +0300, Lluís Vilanova wrote: >> >> This series adds a basic interface to instrument tracing events and >> >> control >> >> their tracing

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-26 Thread Lluís Vilanova
Peter Maydell writes: > On 26 July 2017 at 12:26, Stefan Hajnoczi wrote: >> On Tue, Jul 25, 2017 at 02:30:06PM +0100, Peter Maydell wrote: >>> Is your proposal that my-instrumentation.c gets compiled into >>> QEMU at this point? That doesn't seem like a great idea to >>> me, because it means you

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-26 Thread Peter Maydell
On 26 July 2017 at 12:26, Stefan Hajnoczi wrote: > On Tue, Jul 25, 2017 at 02:30:06PM +0100, Peter Maydell wrote: >> Is your proposal that my-instrumentation.c gets compiled into >> QEMU at this point? That doesn't seem like a great idea to >> me, because it means you can only use this tracing if

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-26 Thread Stefan Hajnoczi
On Tue, Jul 25, 2017 at 05:47:08PM +0300, Lluís Vilanova wrote: > Stefan Hajnoczi writes: > > > On Mon, Jul 24, 2017 at 08:02:24PM +0300, Lluís Vilanova wrote: > >> This series adds a basic interface to instrument tracing events and control > >> their tracing state. > >> > >> The instrumentation

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-26 Thread Stefan Hajnoczi
On Tue, Jul 25, 2017 at 02:30:06PM +0100, Peter Maydell wrote: > On 25 July 2017 at 14:19, Stefan Hajnoczi wrote: > > Instead I suggest adding a trace backend generates calls to registered > > "callback" functions: > > > > $ cat >my-instrumentation.c > > #include "trace/control.h" > > > > st

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-26 Thread Stefan Hajnoczi
On Tue, Jul 25, 2017 at 06:11:43PM +0300, Lluís Vilanova wrote: > Peter Maydell writes: > > > On 25 July 2017 at 14:19, Stefan Hajnoczi wrote: > >> Instead I suggest adding a trace backend generates calls to registered > >> "callback" functions: > >> > >> $ cat >my-instrumentation.c > >> #includ

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-25 Thread Lluís Vilanova
Peter Maydell writes: > On 25 July 2017 at 14:19, Stefan Hajnoczi wrote: >> Instead I suggest adding a trace backend generates calls to registered >> "callback" functions: >> >> $ cat >my-instrumentation.c >> #include "trace/control.h" >> >> static void my_cpu_in(unsigned int addr, char size, u

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-25 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Mon, Jul 24, 2017 at 08:02:24PM +0300, Lluís Vilanova wrote: >> This series adds a basic interface to instrument tracing events and control >> their tracing state. >> >> The instrumentation code is dynamically loaded into QEMU (either when it >> starts >> or later us

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-25 Thread Peter Maydell
On 25 July 2017 at 14:19, Stefan Hajnoczi wrote: > Instead I suggest adding a trace backend generates calls to registered > "callback" functions: > > $ cat >my-instrumentation.c > #include "trace/control.h" > > static void my_cpu_in(unsigned int addr, char size, unsigned int val) > { >

Re: [Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-25 Thread Stefan Hajnoczi
On Mon, Jul 24, 2017 at 08:02:24PM +0300, Lluís Vilanova wrote: > This series adds a basic interface to instrument tracing events and control > their tracing state. > > The instrumentation code is dynamically loaded into QEMU (either when it > starts > or later using its remote control interfaces

[Qemu-devel] [PATCH 00/13] instrument: Add basic event instrumentation

2017-07-24 Thread Lluís Vilanova
This series adds a basic interface to instrument tracing events and control their tracing state. The instrumentation code is dynamically loaded into QEMU (either when it starts or later using its remote control interfaces). All events can be instrumented, but the instrumentable events must be exp