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: 137348 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp6417722lji; Thu, 31 May 2018 03:33:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKJq9OKUK8i1zEGZS+Mf4LHLzIEK1khO5EYZPcQI8obHmLor5mprJKen8I/A7IF+LsSHTXE X-Received: by 2002:a65:5003:: with SMTP id f3-v6mr5101977pgo.425.1527762789411; Thu, 31 May 2018 03:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527762789; cv=none; d=google.com; s=arc-20160816; b=iJ1yStMxgpU2qZDgH4NuZOdhM/ECUGHA8iRM/CZICXq70MFUNnEmYi5LYmACDYi48D yUQZ5f6F4/LQvS1Gc6W4wv87pB6AKi8ekrbaVgO4hZdv00GccklpgYeov6gSes91yxVW 4JcFomJuTw7sv20BG5UHLgnuC1udqCADNUOleWC1SATSMUWuHlCUpzf1PZO5SXPgZ1s1 r3K+c+GEvmL6kffiOQTbETmoi5FVQ1JpHMF6bkwB0ofrKwG9Pe3uXnefg4/yKgkMcVIJ 2pbMio4D4G3WBZ61wRpfaX39ZxF20AnW6ReWDMfa/h4DDBG2VeImFcfPs9RkrUp5L3qH gmHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=D1eEf65VaY+c3sofY6qb3e075VDhg9lFcByqzd4DeZk=; b=pelJV1SHlDYqVoP3FXd2V0T+DOzopdDs2W6+ayguHXLBeVS/tpH4+1pPcrHNIxNJBh g2u5Zic9hnrzlgkyE1K3McLFiTxnO5INqkBu/bIyb/s7wEZJZDVNpEgRjnIfXyFj5uge w1yXNiSlysewFd+gUSnLlgQl0Ew1JXbQJOIrKvjyf+QpqQLG9X40s1jlRdDd9sbrNBei 6D982IsIPj1lhnwJ8mtEWAhLtf4ROy3LyZePoIQMq3+HoI0q2Re3X6IkHrC5E4y6mwkU +2e5MuawCsS9zlJbDgBF7excH4yWDYQzkkvoFvk/UVCW3vNB1WiDTvCOKK6wLB8KuLOL IJYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EPOTzMCB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v41-v6si36811392plg.451.2018.05.31.03.33.09; Thu, 31 May 2018 03:33:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EPOTzMCB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754654AbeEaKdH (ORCPT + 30 others); Thu, 31 May 2018 06:33:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:57190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754622AbeEaKc4 (ORCPT ); Thu, 31 May 2018 06:32:56 -0400 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 Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Leo Yan , Alexander Shishkin , Jiri Olsa , Jonathan Corbet , Mathieu Poirier , Mike Leach , Namhyung Kim , Peter Zijlstra , Robert Walker , Tor Jeremiassen , coresight@lists.linaro.org, kim.phillips@arm.co, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Arnaldo Carvalho de Melo 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.14.3 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);