Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp379176rdb; Tue, 23 Jan 2024 02:32:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKV8uQULOxeYA1LTNAAB+Doo8Y0f6bMuPo1JJIAnmcfOvTZoE/2QqacF7FTI9/HWkfyN0O X-Received: by 2002:a05:6830:1d98:b0:6dd:e00c:833a with SMTP id y24-20020a0568301d9800b006dde00c833amr6851444oti.20.1706005935871; Tue, 23 Jan 2024 02:32:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706005935; cv=pass; d=google.com; s=arc-20160816; b=lF+e2vtOC63vn0iW4+tvnXe22oVdlqzQL0L8v+Evl6ZqOQGZ8Kv19/dTZQJPcy3KHO omJy5QWEju6bgoVx/o37EKvZRvXgXaNUTdpbw1X0KjfjOTFtg15QdJ0f2WhfVXY1vT7L Zcz9I0Emal2kJBg8IU9Oc7b/OopyS9cQN/1ldUu0xUihlO07jLUCzdAvaXFmjkIyJcrJ XVqlPW8/cV4Az21VPCElcr7Yl1l4ChwVUIpI6duEjGF+QfnPwjPtCKgGxBJIaZqxdumS RxWpv9vbH38jlKYWhbrWsPGtdjY6NcIk7HWCF7vcvQaErVQBVsTf2mqxjevYS8CBBXkO mtoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=zaMzzPFW7fNNQw4i7yK1z55BqXbxbSFxzqP6whVfzi0=; fh=rTG5NIABeCUS1wWiHAjc60eclX3r/xBdGX1ZVSIbqVA=; b=b2Ew2huNyWyoVWV/XmC/RyDHK/0fR+0mHA4jN+jxKkZzJJvQESnvBE1fJY9ltGrEN0 vIv9jitS0vfwShR9xUywyGgfzB+DvtqoLUMM4QymnbbItFbr6Y9VbfF424tWAzpo50tQ zBkWaupA9lZk/R/fRBpfi4/8fAUMn2xNtOc7YkFGWBt+kmcRwJzRlpkGW6f3MLVaH4T2 heEePdC1ehasbMeLQThCy5R+/TNM1RJYVRFKZSByg9I+DaKs8Mqkq2VoeU49rUkGtp0q SM+p+BtjUVq8h50O01Dgrt8PpXm2GL4y6BfZlO6n50dBV7ZbGX/RIW8S5tHugPKN1bjc 3NJQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-35094-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35094-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o11-20020a05622a044b00b004283ab4f730si7445685qtx.798.2024.01.23.02.32.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:32:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35094-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-35094-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35094-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9B6291C227FB for ; Tue, 23 Jan 2024 10:32:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91DCB5C60D; Tue, 23 Jan 2024 10:32:08 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F40575C5F8; Tue, 23 Jan 2024 10:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706005928; cv=none; b=RdNQrP5RKwKOD5AaZ3oAKhZpWvIuildav0+ZVwjyDXdNRRgQOquAhu2PJSGp0NfksTxxMCcY8XZNJMoqC1sCoB/P85/TuRHtlwiymlBuTMIxf9HH/L0V+7u166Huo3oHZyDx7Zp3w4bhMqfGsPj/yExOQ5yJAjDa0HzP3Jfd1p0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706005928; c=relaxed/simple; bh=YGE1daHDtPYZs7zC99WV4cn2vlXjvAdbUjEsLpZJ46U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LEAsEZPgSu+VmFxZYdrZcPuZBiQRsvmrmD2GyE/yPk7WBIBgJcxepxxvVQV0Ofg7MAmO1egn4Srsl9WWz/V3ccDbum0JYj6qDEs43TI5ILjRNr/JtJNAuhochVr4LVniGPXzseqdxzi6piHSJeKqKmcSXBU5Ex3K6f/haI5bkSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C656E1FB; Tue, 23 Jan 2024 02:32:50 -0800 (PST) Received: from e126817.. (e126817.cambridge.arm.com [10.2.3.5]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8A1643F5A1; Tue, 23 Jan 2024 02:32:03 -0800 (PST) From: Ben Gainey To: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com, will@kernel.org, Ben Gainey Subject: [PATCH 0/1] tools: perf: Expose sample ID / stream ID to python scripts Date: Tue, 23 Jan 2024 10:31:36 +0000 Message-ID: <20240123103137.1890779-1-ben.gainey@arm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch modifies the perf python scripting engine so that the ID and STREAM_ID are exposed as part of the sample so that they may be correlated to the corresponding throttle/unthrottle event (for example). NB: For scripts where perf_db_export_mode = True, this may be a breaking change depending on how the script is constructed. Each field is passed to `sample_table` as an argument so any script that is written as: def sample_table(db_id, evsel_id, machine_id, ..., cyc_cnt, flags) will now fail due to the changed number of arguments with: TypeError: sample_table() takes 25 positional arguments but 27 were given Scripts that use: def sample_table(*args) or some variation thereof will not be affected. When `perf_db_export_mode = False`, the script should be unaffected as all the arguments are inserted into a dictionary. The export-to-xxx.py scripts use the (..., *x) form so are not affected. Ben Gainey (1): tools: perf: Expose sample ID / stream ID to python scripts tools/perf/Documentation/perf-script-python.txt | 4 ++-- tools/perf/util/scripting-engines/trace-event-python.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) -- 2.43.0