From patchwork Mon May 28 08:45:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 137033 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2560090lji; Mon, 28 May 2018 01:45:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrPQRHWVJyvRBWFLg5zM6JQeIk7dfdrsPkGL5gJu3anZFQ+9kGV+SgMpNtOo1/EsMNnwuxa X-Received: by 2002:a17:902:5c6:: with SMTP id f64-v6mr12694189plf.50.1527497158344; Mon, 28 May 2018 01:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527497158; cv=none; d=google.com; s=arc-20160816; b=YNdjDUD9lCsm8oOo8V0X2S4Nt+7sDA3dfpDxvc/qmIf0wySqGO00TbmGReqmZqt/vN 2qZZwELoP77b60j+8wHkoiUIBFwxj6gsPrUxdLtrPuUdHf1Nh0PrbeEzJj5Mx02MVMAT quqKpX3lBfDBfj8TilgLTy5wYDlBVXbNBY6Oc1NGUnMaYISE8wteXTFxKwzLh9l867fG cmMqUrjk64UKdJmOkIXJkPMt7+zoN7ZmA9W8VLuQUmFvIRwzSNnFTGj3kADatD/i1JtZ vVNiEhSbZRsbkwG9yKhJDmnePdqrI0irXhs43YDmYbGrKSbi15UAQF2QggClNoCEVzEy obRQ== 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=W59tNB57wInzBpuu/xyHcq17cjkj3WVu3Y/l3/GZUG9aWebXwA2dCsQmz4IxTXF173 nOAjB5vghV5sxwuIDU+F2weNEl2g3dx7sA3PHEPyzuqZqsVw8CnACkVWaD4E4ssbaGck R976nlBSnXpRB5Wrv1RT+dyBhuVnNvbs44wd+4xqtR/bgtkS9QkJRh7vgCbQmJtoT+U4 qu2IMmLWe+Xr/40W64D4oAoRfgTFI3Mc80qdljv3ZQAS0Tpo92v5tuEVUHBsUswb6b2e th1iIBYxRX2oAOU+36FXCRJ3oFZzsGZq43EMg60KstAb41kOqidnB0xH5Z8ToaJxilGv GVuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S0hLWFsg; 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 g1-v6si23565221pgo.637.2018.05.28.01.45.58; Mon, 28 May 2018 01:45: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=S0hLWFsg; 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 S932149AbeE1Ip4 (ORCPT + 30 others); Mon, 28 May 2018 04:45:56 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:41868 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932106AbeE1Ipu (ORCPT ); Mon, 28 May 2018 04:45:50 -0400 Received: by mail-wr0-f195.google.com with SMTP id u12-v6so18927799wrn.8 for ; Mon, 28 May 2018 01:45:50 -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=S0hLWFsgE3mmA3xopC+6pgFgANkdef1gSr3NR5eGgGGtXjM4wPBjKa93Oc9tNJXOIt JH2MlVlPySkHPlNrslrc6JrzNZzaqevOpUQ92zVDW5C20ficnGXxn5Be4HNE3rjPDsuy 9lrimUSKk8sWGosAn6OdnDUZQuTmttfyMHOhg= 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=O6lCSXYGgfrpyM0lBecc6hOZGGfcZtEyJKsZVgqssXKCo0UJh6Zjn3Dc+3xUp49QD7 d4QmJXYDLgTHC07wdxhPdA5aj8cWBjLtgESsOZhX+xUq5461yYkiQub1zAY9RZG6dSP5 UbVJuAb725l8WQcvMDoI5HAyN0e7VnRuBkHlWzJGoOmoh51099y4hrM9n+5+repqQG3P cZ0fgFARCJtFlIoI1YxEpxYkTz/7zVg0VdtBI68Nt7Mo6EcrlQRDPMk9/xncne7qPkdO HFV1TVpGIajyahve/n9LTXRgy4ieD/YjdCa76JhJgvPXymUl/rmf11X+2tvx9En+LzT8 DrUg== X-Gm-Message-State: ALKqPwepMJe3baXD8+w3XyVleH0Zus2ItslKPyyRkRmiWd6EZBrAqJQQ B12XcDCs7XHfTVYIfkEdyph8GA== X-Received: by 2002:adf:af6b:: with SMTP id z98-v6mr9416956wrc.250.1527497149509; Mon, 28 May 2018 01:45:49 -0700 (PDT) Received: from localhost.localdomain ([45.76.138.171]) by smtp.gmail.com with ESMTPSA id 123-v6sm21783013wmt.19.2018.05.28.01.45.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 May 2018 01:45:48 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Jonathan Corbet , Robert Walker , mike.leach@linaro.org, kim.phillips@arm.co, Tor Jeremiassen Cc: 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, coresight@lists.linaro.org, Leo Yan Subject: [RFT v3 2/4] perf script python: Add addr into perf sample dict Date: Mon, 28 May 2018 16:45:01 +0800 Message-Id: <1527497103-3593-3-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527497103-3593-1-git-send-email-leo.yan@linaro.org> References: <1527497103-3593-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);