Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751654AbdGGPSI (ORCPT ); Fri, 7 Jul 2017 11:18:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbdGGPSG (ORCPT ); Fri, 7 Jul 2017 11:18:06 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 53781158AAF Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=acme@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 53781158AAF Date: Fri, 7 Jul 2017 12:18:00 -0300 From: Arnaldo Carvalho de Melo To: Arun Kalyanasundaram Cc: Arnaldo Carvalho de Melo , Tom Zanussi , linux-kernel@vger.kernel.org, David Carrillo-Cisneros Subject: Re: perf script: Question: Python trace processing script contains the tid of the process in the common_pid attribute Message-ID: <20170707151800.GC3734@redhat.com> References: <20170701144703.GA5504@redhat.com> <20170705192545.GI27350@kernel.org> <20170705192640.GJ27350@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 07 Jul 2017 15:18:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1131 Lines: 29 Em Wed, Jul 05, 2017 at 04:51:26PM -0700, Arun Kalyanasundaram escreveu: > Arnaldo: > So, I think what you are suggesting is, we should check the signature > of the hook to determine if it has an additional attribute and only > then should we provide the dict. May be something like this: > > PyObject* custom_dict = PyObject_GetAttrString(handler, "other_fields_dict"); > if (custom_dict) > //Add dict to PyTuple > > Do you think this would be a better approach? I think that we should provide as much as possible the common info about a sample at all the sample processing routines, be it the initial, tracepoint specific one, the one for non-tracepoint samples and the trace_unhandled one. So scripts not using this optional argument will work with older versions of the perf tool as well as with new ones that support it. One could say that to use a script that wants this optional argument, a new enough version of the tool is required. So yeah, I think this is a better approach. The details of how to best do this method signature signing need to be figured out, of course. Thanks for working on this! - Arnaldo