Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-13 Thread Jiri Olsa
On Tue, Jul 12, 2016 at 03:48:10PM -0400, Steven Rostedt wrote: > On Tue, 12 Jul 2016 16:27:16 -0300 > Arnaldo Carvalho de Melo wrote: > > > Em Tue, Jul 12, 2016 at 09:48:36AM -0400, Steven Rostedt escreveu: > > > On Tue, 12 Jul 2016 15:35:52 +0200 > > > Jiri Olsa

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-13 Thread Jiri Olsa
On Tue, Jul 12, 2016 at 03:48:10PM -0400, Steven Rostedt wrote: > On Tue, 12 Jul 2016 16:27:16 -0300 > Arnaldo Carvalho de Melo wrote: > > > Em Tue, Jul 12, 2016 at 09:48:36AM -0400, Steven Rostedt escreveu: > > > On Tue, 12 Jul 2016 15:35:52 +0200 > > > Jiri Olsa wrote: > > > > > > > On

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Steven Rostedt
On Tue, 12 Jul 2016 16:27:16 -0300 Arnaldo Carvalho de Melo wrote: > Em Tue, Jul 12, 2016 at 09:48:36AM -0400, Steven Rostedt escreveu: > > On Tue, 12 Jul 2016 15:35:52 +0200 > > Jiri Olsa wrote: > > > > > On Tue, Jul 12, 2016 at 09:00:01AM -0400, Steven

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Steven Rostedt
On Tue, 12 Jul 2016 16:27:16 -0300 Arnaldo Carvalho de Melo wrote: > Em Tue, Jul 12, 2016 at 09:48:36AM -0400, Steven Rostedt escreveu: > > On Tue, 12 Jul 2016 15:35:52 +0200 > > Jiri Olsa wrote: > > > > > On Tue, Jul 12, 2016 at 09:00:01AM -0400, Steven Rostedt wrote: > > > > On Tue, 12

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Arnaldo Carvalho de Melo
Em Tue, Jul 12, 2016 at 09:48:36AM -0400, Steven Rostedt escreveu: > On Tue, 12 Jul 2016 15:35:52 +0200 > Jiri Olsa wrote: > > > On Tue, Jul 12, 2016 at 09:00:01AM -0400, Steven Rostedt wrote: > > > On Tue, 12 Jul 2016 14:52:45 +0200 > > > Jiri Olsa wrote: >

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Arnaldo Carvalho de Melo
Em Tue, Jul 12, 2016 at 09:48:36AM -0400, Steven Rostedt escreveu: > On Tue, 12 Jul 2016 15:35:52 +0200 > Jiri Olsa wrote: > > > On Tue, Jul 12, 2016 at 09:00:01AM -0400, Steven Rostedt wrote: > > > On Tue, 12 Jul 2016 14:52:45 +0200 > > > Jiri Olsa wrote: > > > > > > > > > > hum, so string

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Steven Rostedt
On Tue, 12 Jul 2016 15:35:52 +0200 Jiri Olsa wrote: > On Tue, Jul 12, 2016 at 09:00:01AM -0400, Steven Rostedt wrote: > > On Tue, 12 Jul 2016 14:52:45 +0200 > > Jiri Olsa wrote: > > > > > > > hum, so string is not passed to trace buffer with 0 at the end?

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Steven Rostedt
On Tue, 12 Jul 2016 15:35:52 +0200 Jiri Olsa wrote: > On Tue, Jul 12, 2016 at 09:00:01AM -0400, Steven Rostedt wrote: > > On Tue, 12 Jul 2016 14:52:45 +0200 > > Jiri Olsa wrote: > > > > > > > hum, so string is not passed to trace buffer with 0 at the end? > > > > strlen() returns only

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Jiri Olsa
On Tue, Jul 12, 2016 at 09:00:01AM -0400, Steven Rostedt wrote: > On Tue, 12 Jul 2016 14:52:45 +0200 > Jiri Olsa wrote: > > > > hum, so string is not passed to trace buffer with 0 at the end? > > strlen() returns only the length of the string (minus the \0 at the > end).

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Jiri Olsa
On Tue, Jul 12, 2016 at 09:00:01AM -0400, Steven Rostedt wrote: > On Tue, 12 Jul 2016 14:52:45 +0200 > Jiri Olsa wrote: > > > > hum, so string is not passed to trace buffer with 0 at the end? > > strlen() returns only the length of the string (minus the \0 at the > end). yea,

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Steven Rostedt
On Tue, 12 Jul 2016 14:52:45 +0200 Jiri Olsa wrote: > hum, so string is not passed to trace buffer with 0 at the end? strlen() returns only the length of the string (minus the \0 at the end). > > I'll check the option of passing everything as PyByteArray. > If it's the same

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Steven Rostedt
On Tue, 12 Jul 2016 14:52:45 +0200 Jiri Olsa wrote: > hum, so string is not passed to trace buffer with 0 at the end? strlen() returns only the length of the string (minus the \0 at the end). > > I'll check the option of passing everything as PyByteArray. > If it's the same for user, we'll

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Jiri Olsa
On Tue, Jul 12, 2016 at 08:37:28AM -0400, Steven Rostedt wrote: > On Tue, 12 Jul 2016 10:11:56 +0200 > Jiri Olsa wrote: > > > > --- > > diff --git a/tools/perf/util/scripting-engines/trace-event-python.c > > b/tools/perf/util/scripting-engines/trace-event-python.c > > index

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Jiri Olsa
On Tue, Jul 12, 2016 at 08:37:28AM -0400, Steven Rostedt wrote: > On Tue, 12 Jul 2016 10:11:56 +0200 > Jiri Olsa wrote: > > > > --- > > diff --git a/tools/perf/util/scripting-engines/trace-event-python.c > > b/tools/perf/util/scripting-engines/trace-event-python.c > > index

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Steven Rostedt
On Tue, 12 Jul 2016 10:11:56 +0200 Jiri Olsa wrote: > --- > diff --git a/tools/perf/util/scripting-engines/trace-event-python.c > b/tools/perf/util/scripting-engines/trace-event-python.c > index 75e9790ebb96..9f810e6c739a 100644 > ---

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Steven Rostedt
On Tue, 12 Jul 2016 10:11:56 +0200 Jiri Olsa wrote: > --- > diff --git a/tools/perf/util/scripting-engines/trace-event-python.c > b/tools/perf/util/scripting-engines/trace-event-python.c > index 75e9790ebb96..9f810e6c739a 100644 > --- a/tools/perf/util/scripting-engines/trace-event-python.c >

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Jiri Olsa
On Mon, Jul 11, 2016 at 11:54:52AM -0400, Steven Rostedt wrote: > On Sun, 10 Jul 2016 13:08:02 +0200 > Jiri Olsa wrote: > > > Jirka reported that python code returns all arrays as strings. > > This makes impossible to get all items for byte array tracepoint > > field containing

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-12 Thread Jiri Olsa
On Mon, Jul 11, 2016 at 11:54:52AM -0400, Steven Rostedt wrote: > On Sun, 10 Jul 2016 13:08:02 +0200 > Jiri Olsa wrote: > > > Jirka reported that python code returns all arrays as strings. > > This makes impossible to get all items for byte array tracepoint > > field containing 0x00 value item.

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-11 Thread Steven Rostedt
On Sun, 10 Jul 2016 13:08:02 +0200 Jiri Olsa wrote: > Jirka reported that python code returns all arrays as strings. > This makes impossible to get all items for byte array tracepoint > field containing 0x00 value item. > > Fixing this by scanning full length of the array and

Re: [PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-11 Thread Steven Rostedt
On Sun, 10 Jul 2016 13:08:02 +0200 Jiri Olsa wrote: > Jirka reported that python code returns all arrays as strings. > This makes impossible to get all items for byte array tracepoint > field containing 0x00 value item. > > Fixing this by scanning full length of the array and returning > it as

[PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-10 Thread Jiri Olsa
Jirka reported that python code returns all arrays as strings. This makes impossible to get all items for byte array tracepoint field containing 0x00 value item. Fixing this by scanning full length of the array and returning it as PyByteArray object in case non printable byte is found. Cc:

[PATCH 10/10] perf script python: Fix string vs byte array resolving

2016-07-10 Thread Jiri Olsa
Jirka reported that python code returns all arrays as strings. This makes impossible to get all items for byte array tracepoint field containing 0x00 value item. Fixing this by scanning full length of the array and returning it as PyByteArray object in case non printable byte is found. Cc: