From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751419AbdGRIfn (ORCPT ); Tue, 18 Jul 2017 04:35:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38518 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751341AbdGRIfl (ORCPT ); Tue, 18 Jul 2017 04:35:41 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 60EFE7A162 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 60EFE7A162 Date: Tue, 18 Jul 2017 10:35:38 +0200 From: Jiri Olsa To: Arun Kalyanasundaram Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Daniel Borkmann , "David S . Miller" , SeongJae Park , davidcc@google.com, Stephane Eranian Subject: Re: [RFC 0/4] perf script python: Provide perf_sample dict to all handlers Message-ID: <20170718083538.GA22545@krava> References: <20170717221040.88148-1-arunkaly@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170717221040.88148-1-arunkaly@google.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 18 Jul 2017 08:35:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.010182869 21999 perf comm=perf^@^@-x86_64-l^@, pid=21999 thanks, jirka