From patchwork Mon May 21 08:52:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 136434 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp51829lji; Mon, 21 May 2018 01:53:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqPNt5O+n73kPD4tgfQK/87yMKYqTmM3Hrf55hAYI+UocIag4E+5q8KrEPf6H5+mHqLGKbT X-Received: by 2002:a17:902:6ac6:: with SMTP id i6-v6mr20004698plt.31.1526892838560; Mon, 21 May 2018 01:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526892838; cv=none; d=google.com; s=arc-20160816; b=nvDkhNLSYBzS4HgO6KeNDCqEfhu0JwxUI1/XYYFq8VkMh23+K0rk26grXuIiAmJBnW wKZFdIyMfy4EmWW1SoBnSH7euv56mtz1p+dHzzEC52hFl6TnnEGjpgx4O8uievpzP6KX YWuH4gw8DPZeIeQ+KpZAejMb+66W92ZIf55TZODmTPrYLeZhULFzZ5Cw1SjR532OiFSr xoqCENT+pejdoyxlmnWRq0YHOdt9n+NnqqcgwtsWveXzwle/hytZKoyhv69p8KWKG3vf sBtY5/V2YVshvVROtAe26WrENNvw8OTYeBdNwDJt/+a37AnoQNVvH9/7xZClBwK4r7CV C+KQ== 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=g2s0qKAeszFhKKHrQ+56mjV/yVHzAXmicKjIaEfOtZk=; b=GYOv+POXcJAdBeuI1yPR8dRqsb27jNUSjlpk9j426tn1B5MhCAgmIjeLUkWgLp5bht ZezeN/6xhb479BInCorv3/CeVajpnwf0C+6DXU2a5028g+xwu0evaKhRyEmQ+w4PMonI O4Ab02/9/g+3FPeF+6FK1+W8r+/WpWOBHov/DS7e2b1PKn8KV8yma/ADLGf6VO9k/bO7 9Eg7hsmuTEWVmGWkJZp9FYNdwLyOQS3VUVUKMn1R9qnLMRlll9pO+f4WqDA4sSYAZaIG VABr+I0dot1dqFl8mXbNOLdebfHM07sYngPIL2+quvgMgQU19kisEWsnas8Bg7SKLS0q gCtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GE279JS2; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73-v6si6838802pge.55.2018.05.21.01.53.58; Mon, 21 May 2018 01:53:58 -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=@linaro.org header.s=google header.b=GE279JS2; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752231AbeEUIxz (ORCPT + 29 others); Mon, 21 May 2018 04:53:55 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33087 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbeEUIxs (ORCPT ); Mon, 21 May 2018 04:53:48 -0400 Received: by mail-pf0-f195.google.com with SMTP id a20-v6so6769167pfo.0 for ; Mon, 21 May 2018 01:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=g2s0qKAeszFhKKHrQ+56mjV/yVHzAXmicKjIaEfOtZk=; b=GE279JS20lqPnyDT/EctkUZE9fTNwX7lTGyFFiii8DuW9FqzqUwbuB36MhTqT8qREB kr0ikmOfxnmdi9bjoTt8ivGLdPJDv8p7S9diaJUWxNJixSLt7APFpFf5Kn0axt0Grff3 1YswPReSsmyAlRfroZ5unoR4PHFmkPYbtmnKs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=g2s0qKAeszFhKKHrQ+56mjV/yVHzAXmicKjIaEfOtZk=; b=M9Kju6f7YzxlUL0uZ3tGnNC3EP/fsDNbaIapDjZtRRzrLOJOCTOoh1k3ZKfetAqj/n /nDXphxiYIV2s2g7YB+PpGqS7ELO5GuCV9hjbV50KG7negOeSe2WL9mo+KE090Vax1fg 52lGerlW22MkG2+xnwOSN9dZSLifAkWAKpmDetKlsc3oy5ad79JGN0NLIoR5f1dH3+8c gLqimS1lnrDjJO9qB6AdXQHjyCjOsK/gk8qyLuO1myo1a7F1nZL8fyxIT/3uGO6ygPMM UJut4HYWF17GO6A2VpwS4xxixKixvnsXxq4+fJBuVPOydqFSngBkm7v7MbfYRJoIpARE IgIw== X-Gm-Message-State: ALKqPwdBYw3fKmHm47oZ8FG+bbtEQAgyeiPgDiIeGQk9Gqay5I7CVazB t8EUw4zAtjtmXZuzeskm7dv+xA== X-Received: by 2002:a62:3ec2:: with SMTP id y63-v6mr19235088pfj.102.1526892827728; Mon, 21 May 2018 01:53:47 -0700 (PDT) Received: from localhost.localdomain (li1209-69.members.linode.com. [45.79.110.69]) by smtp.gmail.com with ESMTPSA id 16-v6sm28553918pfq.115.2018.05.21.01.53.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 May 2018 01:53:46 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Jonathan Corbet , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Tor Jeremiassen , mike.leach@linaro.org, kim.phillips@arm.com, Robert Walker , coresight@lists.linaro.org Cc: Leo Yan Subject: [RFT v2 2/4] perf script python: Add addr into perf sample dict Date: Mon, 21 May 2018 16:52:26 +0800 Message-Id: <1526892748-326-3-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526892748-326-1-git-send-email-leo.yan@linaro.org> References: <1526892748-326-1-git-send-email-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- tools/perf/util/scripting-engines/trace-event-python.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 10dd5fc..7f8afac 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);