From patchwork Thu May 31 10:32:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 10440703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8599B603B5 for ; Thu, 31 May 2018 10:48:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A92C291A2 for ; Thu, 31 May 2018 10:48:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EE9A291AC; Thu, 31 May 2018 10:48:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E6A84291A2 for ; Thu, 31 May 2018 10:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=S1x87Wyymjh2rkpK/+KTR4le0d1GwoX+0w9rGJN7hOQ=; b=MJrwEW3GmYCk+wddaA1F2KTUH8 V/SqBXvO8E/+RIceD+HDjyWHQEdU/4G1KtaA32Skmo6Nb2csEqWGUiVa/85FlDy7kOue7B90ntTvy 6FjWucQqkanbdp1dcYs78Q9oyVAxCJn+L6iWV3boLWKN8ZjZtrHI8539H+wZyunK3/o5g/z5PNCp2 Qqjr7vZpaJ+W5HCmkiHJ24k5kW1byRD5xyZEbwhH8CJ/xjELspwxq4UwkbMaN2TVADQzpEeNrnMeu T8GOMCaFuhE8TKEIF6ungRIyvaEayzP8iNbPc7Vax/GjFtQn/v6kw8lGnC/4sxthrbqdW1a/5KEZ4 OdN3UnKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOL7h-0005yA-Vm; Thu, 31 May 2018 10:48:02 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOL7f-0005cH-CO for linux-arm-kernel@bombadil.infradead.org; Thu, 31 May 2018 10:47:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=D1eEf65VaY+c3sofY6qb3e075VDhg9lFcByqzd4DeZk=; b=uAa3xi1krlWAdue/uilkNDhZ5 T1qpKAChuiV4uubeEyBIzyjLkRUps9ALkZYVD/FZgki7jnaZ/K/benOdPgExJ/+29jc7SXbWUjOVO n1MYk+mORJWrcdL9OyoWFA3AlmVfxiznmloJGUFvM6ac64eq0ipwxkV/hVCKrCfIVAJMI3nW6rpBK YDtc73PFzhJewPlUMCe4M9YIt6FEVvmbX/DzOSooy9jJasevvjxx2kPxAAHojmxHI+Q3V3FHtvZwy ov8I8vuuPcfiNBoREJwABRZdqNVTziXFP2xMIQrirxNOGytoyvYwtvc7YZ2AqBZREbSdOWhMi/5Vg pxDVOQzLA==; Received: from mail.kernel.org ([198.145.29.99]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOKt9-0002kp-7d for linux-arm-kernel@lists.infradead.org; Thu, 31 May 2018 10:33:02 +0000 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4BEAD208AF; Thu, 31 May 2018 10:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527762775; bh=mlu6QK9XxQ6Li+Dl6cAvn4DJKpxSNP8bY/8LRp7/350=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EPOTzMCBxqM5drbQznYWEU1wo9elaU4U9onwpng/vgaCtblaIsBW4+grFwrRQl2s0 3ckxK6pzp2Nmi5iSIXsH2wH0ooXD1J8JgPXKBknQ9e/gqXlFBj0R4p4cAYDsv0aB9Y gN/on6tfUBirdugOB5inJrgvsbiYG/5ngFR4rRa4= From: Arnaldo Carvalho de Melo To: Ingo Molnar Subject: [PATCH 6/7] perf script python: Add addr into perf sample dict Date: Thu, 31 May 2018 07:32:19 -0300 Message-Id: <20180531103220.24684-7-acme@kernel.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180531103220.24684-1-acme@kernel.org> References: <20180531103220.24684-1-acme@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180531_113259_431765_8AB4F50C X-CRM114-Status: GOOD ( 11.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnaldo Carvalho de Melo , Mathieu Poirier , Jonathan Corbet , Clark Williams , coresight@lists.linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Tor Jeremiassen , linux-perf-users@vger.kernel.org, Alexander Shishkin , Peter Zijlstra , Leo Yan , Namhyung Kim , Robert Walker , kim.phillips@arm.co, Jiri Olsa , linux-arm-kernel@lists.infradead.org, Mike Leach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Yan ARM CoreSight auxtrace uses 'sample->addr' to record the target address for branch instructions, so the data of 'sample->addr' is required for tracing data analysis. This commit collects data of 'sample->addr' into perf sample dict, finally can be used for python script for parsing event. Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Jonathan Corbet Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Walker Cc: Tor Jeremiassen Cc: coresight@lists.linaro.org Cc: kim.phillips@arm.co Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Link: http://lkml.kernel.org/r/1527497103-3593-3-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/scripting-engines/trace-event-python.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 10dd5fce082b..7f8afacd08ee 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -531,6 +531,8 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, PyLong_FromUnsignedLongLong(sample->period)); pydict_set_item_string_decref(dict_sample, "phys_addr", PyLong_FromUnsignedLongLong(sample->phys_addr)); + pydict_set_item_string_decref(dict_sample, "addr", + PyLong_FromUnsignedLongLong(sample->addr)); set_sample_read_in_dict(dict_sample, sample, evsel); pydict_set_item_string_decref(dict, "sample", dict_sample);