[Spice-devel] [PATCH v2 4/4] qxl-wddm-dod: Add scripts for ETW recording and parsing

2017-07-05 Thread Yuri Benditovich
QxlDodCollectTrace.bat intended for recording of binary traces in end-user environment (end-user runs it when instructed). It uses built-in Windows ability of collecting ETW data. QxlDodParseTrace.bat is to be used by developer to convert received binary traces to formatted text. Signed-off-by: Yu

[Spice-devel] [PATCH v2 2/4] qxl-wddm-dod: add trace definition file for WPP

2017-07-05 Thread Yuri Benditovich
Added file with Windows trace preprocessor definitions, required for generating trace messages. Signed-off-by: Yuri Benditovich --- qxldod/WppTrace.h | 56 +++ qxldod/qxldod.vcxproj.filters | 3 +++ 2 files changed, 59 insertions(+) create mo

[Spice-devel] [PATCH v2 1/4] qxl-wddm-dod: Correct format of printouts

2017-07-05 Thread Yuri Benditovich
Fixed wrong formats of printouts producing errors with WPP. All fixed format strings were wrong mainly due to incorrect format for pointers. Signed-off-by: Yuri Benditovich --- qxldod/QxlDod.cpp | 102 +++--- qxldod/driver.cpp | 2 +- 2 files cha

[Spice-devel] [PATCH v2 0/4] Add ETW support to release version

2017-07-05 Thread Yuri Benditovich
This series of patches allows binary traces to be recorded in customer environment for further offline analysis. ETW (Event tracing for Windows) and WPP (preprocessing of traces) provide minimal overhead when trace session is not active (regular usage) and low throghput and minimal affect when tra

[Spice-devel] [PATCH v2 3/4] qxl-wddm-dod: Support ETW for release version

2017-07-05 Thread Yuri Benditovich
Add ability to produce ETW (Event Tracing for Windows) to release version of the driver to be able to record binary traces in case of problem in customer environment for further analysis. Logging of debug build is not changed. Signed-off-by: Yuri Benditovich --- qxldod/QxlDod.cpp | 3 +++ qx

Re: [Spice-devel] [PATCH 3/4] qxl-wddm-dod: Support ETW for release version

2017-07-05 Thread Yuri Benditovich
On Mon, Jul 3, 2017 at 5:53 PM, Frediano Ziglio wrote: > > > > > Add ability to produce ETW (Event Tracing for Windows) to release > > version of the driver to be able to record binary traces in case > > of problem in customer environment for further analysis. > > Logging of debug build is not ch

Re: [Spice-devel] [spice-common] Some steps toward quic_tmpl.c and quic_rgb_tmpl.c 'unification'

2017-07-05 Thread Frediano Ziglio
> > Hey, > > This is a v2 of the initial 2 patches, but looking a bit closer at the quic > code led me down a rabbit hole ;) We currently have 2 different quic > implementations using the preprocessor as a template engine. These 2 > implementations are quic_tmpl.c which handles 1 byte and 4 bytes

Re: [Spice-devel] [spice-common 01/14] quic: Use #define rather than static const int

2017-07-05 Thread Frediano Ziglio
In my stash pile I have these: diff --git a/common/quic.c b/common/quic.c index c188ed2..aa0d8ab 100644 --- a/common/quic.c +++ b/common/quic.c @@ -173,13 +173,13 @@ struct Encoder { }; /* target wait mask index */ -static const int wmimax = DEFwmimax; +enum { wmimax = DEFwmimax }; /* numb

Re: [Spice-devel] [spice-common 11/14] quic: Use i == 0 rather than !i

2017-07-05 Thread Christophe Fergeau
On Wed, Jul 05, 2017 at 05:30:21AM -0400, Frediano Ziglio wrote: > > > > This helps to make quic_rgb_tmpl.c and quic_tmpl.c more consistent. > > Actually there are less occurrences of "i == 0" in these 2 files. > But in the rest of the files I think X == 0 is more common. I really focused on the

Re: [Spice-devel] [spice-common 11/14] quic: Use i == 0 rather than !i

2017-07-05 Thread Frediano Ziglio
> > This helps to make quic_rgb_tmpl.c and quic_tmpl.c more consistent. Actually there are less occurrences of "i == 0" in these 2 files. But in the rest of the files I think X == 0 is more common. > --- > common/quic_rgb_tmpl.c | 8 > common/quic_tmpl.c | 2 +- > 2 files changed,

Re: [Spice-devel] [PATCH spice-common v3 2/2] log: Force format in log macro to be a string

2017-07-05 Thread Christophe Fergeau
On Wed, Jul 05, 2017 at 04:07:08AM -0400, Frediano Ziglio wrote: > > > > On Tue, Jul 04, 2017 at 10:18:52AM +0100, Frediano Ziglio wrote: > > > Make sure format is a string and not a pointer. > > > This prevents usages like: > > > > > > spice_debug(NULL); > > > > > > This also prevents compute

[Spice-devel] [spice-common 14/14] quic: Remove unused argument in uncompress_row{0, }

2017-07-05 Thread Christophe Fergeau
'correlation_row' is always set to channel->colleration_row, and we already pass 'channel' as an argument. --- common/quic_tmpl.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/common/quic_tmpl.c b/common/quic_tmpl.c index 43ce32b..a0c2aa9 100644 --- a/common/quic

[Spice-devel] [spice-common 11/14] quic: Use i == 0 rather than !i

2017-07-05 Thread Christophe Fergeau
This helps to make quic_rgb_tmpl.c and quic_tmpl.c more consistent. --- common/quic_rgb_tmpl.c | 8 common/quic_tmpl.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/quic_rgb_tmpl.c b/common/quic_rgb_tmpl.c index 19c84e8..b2827eb 100644 --- a/common/quic

[Spice-devel] [spice-common 13/14] quic: Add macros to make quic_tmpl.c much closer to quic_rgb_tmpl.c

2017-07-05 Thread Christophe Fergeau
--- common/quic_tmpl.c | 184 +++-- 1 file changed, 107 insertions(+), 77 deletions(-) diff --git a/common/quic_tmpl.c b/common/quic_tmpl.c index 81aba72..43ce32b 100644 --- a/common/quic_tmpl.c +++ b/common/quic_tmpl.c @@ -40,6 +40,9 @@ #define BP

[Spice-devel] [spice-common 03/14] quic: Fix "corelate" typo

2017-07-05 Thread Christophe Fergeau
--- common/quic_rgb_tmpl.c | 28 common/quic_tmpl.c | 88 +- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/common/quic_rgb_tmpl.c b/common/quic_rgb_tmpl.c index 451e1fd..f240e95 100644 --- a/common/quic_rgb_tmp

[Spice-devel] [spice-common 08/14] quic: Get rid of RLE #define

2017-07-05 Thread Christophe Fergeau
It's always set, no need to have conditional compilation based on it. --- common/quic.c | 9 - common/quic_rgb_tmpl.c | 12 common/quic_tmpl.c | 12 3 files changed, 33 deletions(-) diff --git a/common/quic.c b/common/quic.c index a58ee08..49ac34c 1

[Spice-devel] [spice-common 07/14] quic: Get rid of RLE_STAT #define

2017-07-05 Thread Christophe Fergeau
It's always set, no need to have conditional compilation based on it. TODO: Can we do something for encode_run VS encode_channel_run? --- common/quic.c | 53 ++--- common/quic_tmpl.c | 12 2 files changed, 2 insertions(+), 63 delet

[Spice-devel] [spice-common 12/14] quic: s/decorrelate_drow/correlate_row

2017-07-05 Thread Christophe Fergeau
The naming is odd as this is just an alias for channel->correlate_row. This will also help in subsequent commits to make things more consistent with quic_rgb_tmpl.c --- common/quic_tmpl.c | 54 +++--- 1 file changed, 27 insertions(+), 27 deletions(-)

[Spice-devel] [spice-common 10/14] quic: Introduce CommonState *state variable in templates

2017-07-05 Thread Christophe Fergeau
Most functions in quic_tmpl.c/quic_rgb_tmpl.c have only superficial differences. One of them is using channel->state or encoder->rgb_state. This commit adds a local CommonState *state in all template methods which will be used instead of channel->state or encoder->rgb_state. This makes it easier t

[Spice-devel] [spice-common 02/14] quic: Use upper-case for constant names

2017-07-05 Thread Christophe Fergeau
Constants, especially when defined using #define usually use upper-case naming. --- common/quic.c | 24 common/quic_rgb_tmpl.c | 40 common/quic_tmpl.c | 40 3 files changed, 52

[Spice-devel] [spice-common 01/14] quic: Use #define rather than static const int

2017-07-05 Thread Christophe Fergeau
quic.c is checking at compile-time that 'evol' is 1, 3 or 5. This is a constant, so a static check should be good, but my compiler (gcc 7.1.1) is unable to know 'evol' value at compile-time. Since the removal of spice_static_assert in favour of SPICE_VERIFY, this causes a compile-time failure. ---

[Spice-devel] [spice-common 05/14] quic: Remove configurable PRED

2017-07-05 Thread Christophe Fergeau
It's hardcoded at compile-time, and I don't think it was changed in years... --- common/quic.c | 1 - common/quic_rgb_tmpl.c | 31 --- common/quic_tmpl.c | 38 -- 3 files changed, 70 deletions(-) diff --git a/common/qui

[Spice-devel] [spice-common 06/14] quic: Get rid of QUIC_RGB #define

2017-07-05 Thread Christophe Fergeau
It's always set, no need to have conditional compilation based on it. --- common/quic.c | 151 - common/quic_tmpl.c | 6 --- 2 files changed, 157 deletions(-) diff --git a/common/quic.c b/common/quic.c index f779afb..c561faa 100644 --- a/

[Spice-devel] [spice-common 09/14] quic: Factor common code

2017-07-05 Thread Christophe Fergeau
We don't need 2 different implementations when the only difference is the CommonState which is being used. --- common/quic.c | 194 ++ 1 file changed, 73 insertions(+), 121 deletions(-) diff --git a/common/quic.c b/common/quic.c index 49ac34

[Spice-devel] [spice-common 04/14] quic: Remove configurable RLE_PRED

2017-07-05 Thread Christophe Fergeau
It's hardcoded at compile-time, and I don't think it was changed in years... --- common/quic.c | 3 --- common/quic_rgb_tmpl.c | 55 -- common/quic_tmpl.c | 55 -- 3 files changed, 16 inse

[Spice-devel] [spice-common] Some steps toward quic_tmpl.c and quic_rgb_tmpl.c 'unification'

2017-07-05 Thread Christophe Fergeau
Hey, This is a v2 of the initial 2 patches, but looking a bit closer at the quic code led me down a rabbit hole ;) We currently have 2 different quic implementations using the preprocessor as a template engine. These 2 implementations are quic_tmpl.c which handles 1 byte and 4 bytes images, and th

Re: [Spice-devel] [PATCH spice-common v3 2/2] log: Force format in log macro to be a string

2017-07-05 Thread Frediano Ziglio
> > On Tue, Jul 04, 2017 at 10:18:52AM +0100, Frediano Ziglio wrote: > > Make sure format is a string and not a pointer. > > This prevents usages like: > > > > spice_debug(NULL); > > > > This also prevents computed format strings too but on the other > > hand allows the compiler to check argum