Re: [RFC 0/4] perf script python: Provide perf_sample dict to all handlers
Thank you for taking a look into it. I don't see the garbled output. Can you please send me the perf.data file or a way to reproduce it? On Tue, Jul 18, 2017 at 1:35 AM, Jiri Olsawrote: > On Mon, Jul 17, 2017 at 03:10:36PM -0700, Arun Kalyanasundaram wrote: >> The process_event python hook receives a dict with all perf_sample entries. >> >> Other handlers (e.g. trace_unhandled, python_process_tracepoint) predate the >> introduction of this dict and do not receive it. This patch series adds the >> dict to all handlers, aiming to unify the information passed to them. >> >> This change adds an additional argument to the affected handlers. To keep >> backwards compatibility (and avoid unnecessary work), do not pass the >> aforementioned dict if the number of arguments signals that handler version >> predates this change. >> >> Initial Discussion: https://lkml.org/lkml/2017/7/1/108 >> >> Arun Kalyanasundaram (4): >> perf script python: Allocate memory only if handler exists >> perf script python: Refactor creation of perf sample dict >> perf script python: Add perf_sample dict to tracepoint handlers >> perf script python: Generate hooks with additional argument >> >> .../util/scripting-engines/trace-event-python.c| 189 >> ++--- >> 1 file changed, 128 insertions(+), 61 deletions(-) > > looks good, but any idea the perf-script.py output gives > some trash at the end of 'comm' args? like: > > sched__sched_stat_runtime 1 199971.01018286921999 perf > comm=perf^@^@-x86_64-l^@, pid=21999 > > > thanks, > jirka
Re: [RFC 0/4] perf script python: Provide perf_sample dict to all handlers
Thank you for taking a look into it. I don't see the garbled output. Can you please send me the perf.data file or a way to reproduce it? On Tue, Jul 18, 2017 at 1:35 AM, Jiri Olsa wrote: > On Mon, Jul 17, 2017 at 03:10:36PM -0700, Arun Kalyanasundaram wrote: >> The process_event python hook receives a dict with all perf_sample entries. >> >> Other handlers (e.g. trace_unhandled, python_process_tracepoint) predate the >> introduction of this dict and do not receive it. This patch series adds the >> dict to all handlers, aiming to unify the information passed to them. >> >> This change adds an additional argument to the affected handlers. To keep >> backwards compatibility (and avoid unnecessary work), do not pass the >> aforementioned dict if the number of arguments signals that handler version >> predates this change. >> >> Initial Discussion: https://lkml.org/lkml/2017/7/1/108 >> >> Arun Kalyanasundaram (4): >> perf script python: Allocate memory only if handler exists >> perf script python: Refactor creation of perf sample dict >> perf script python: Add perf_sample dict to tracepoint handlers >> perf script python: Generate hooks with additional argument >> >> .../util/scripting-engines/trace-event-python.c| 189 >> ++--- >> 1 file changed, 128 insertions(+), 61 deletions(-) > > looks good, but any idea the perf-script.py output gives > some trash at the end of 'comm' args? like: > > sched__sched_stat_runtime 1 199971.01018286921999 perf > comm=perf^@^@-x86_64-l^@, pid=21999 > > > thanks, > jirka
Re: [RFC 0/4] perf script python: Provide perf_sample dict to all handlers
On Mon, Jul 17, 2017 at 03:10:36PM -0700, Arun Kalyanasundaram wrote: > The process_event python hook receives a dict with all perf_sample entries. > > Other handlers (e.g. trace_unhandled, python_process_tracepoint) predate the > introduction of this dict and do not receive it. This patch series adds the > dict to all handlers, aiming to unify the information passed to them. > > This change adds an additional argument to the affected handlers. To keep > backwards compatibility (and avoid unnecessary work), do not pass the > aforementioned dict if the number of arguments signals that handler version > predates this change. > > Initial Discussion: https://lkml.org/lkml/2017/7/1/108 > > Arun Kalyanasundaram (4): > perf script python: Allocate memory only if handler exists > perf script python: Refactor creation of perf sample dict > perf script python: Add perf_sample dict to tracepoint handlers > perf script python: Generate hooks with additional argument > > .../util/scripting-engines/trace-event-python.c| 189 > ++--- > 1 file changed, 128 insertions(+), 61 deletions(-) looks good, but any idea the perf-script.py output gives some trash at the end of 'comm' args? like: sched__sched_stat_runtime 1 199971.01018286921999 perf comm=perf^@^@-x86_64-l^@, pid=21999 thanks, jirka
Re: [RFC 0/4] perf script python: Provide perf_sample dict to all handlers
On Mon, Jul 17, 2017 at 03:10:36PM -0700, Arun Kalyanasundaram wrote: > The process_event python hook receives a dict with all perf_sample entries. > > Other handlers (e.g. trace_unhandled, python_process_tracepoint) predate the > introduction of this dict and do not receive it. This patch series adds the > dict to all handlers, aiming to unify the information passed to them. > > This change adds an additional argument to the affected handlers. To keep > backwards compatibility (and avoid unnecessary work), do not pass the > aforementioned dict if the number of arguments signals that handler version > predates this change. > > Initial Discussion: https://lkml.org/lkml/2017/7/1/108 > > Arun Kalyanasundaram (4): > perf script python: Allocate memory only if handler exists > perf script python: Refactor creation of perf sample dict > perf script python: Add perf_sample dict to tracepoint handlers > perf script python: Generate hooks with additional argument > > .../util/scripting-engines/trace-event-python.c| 189 > ++--- > 1 file changed, 128 insertions(+), 61 deletions(-) looks good, but any idea the perf-script.py output gives some trash at the end of 'comm' args? like: sched__sched_stat_runtime 1 199971.01018286921999 perf comm=perf^@^@-x86_64-l^@, pid=21999 thanks, jirka