Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp409589rdb; Tue, 23 Jan 2024 03:39:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDkTlW8JytR1Bu4TX0Ve5Va7rsgJ6KhSpcdGLmtnflkPK8qxGMwfFw93qgUO3nw0UaOb2d X-Received: by 2002:a05:6a00:1d06:b0:6da:e558:7335 with SMTP id a6-20020a056a001d0600b006dae5587335mr3621402pfx.12.1706009961448; Tue, 23 Jan 2024 03:39:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706009961; cv=pass; d=google.com; s=arc-20160816; b=uhwwl2uNeqlDf1utFO72tjoANF6LvjJSH7PZMYQCcfcuqmmLwgLKf5VjpuixKeuY5l Opmlzh6KbP8LYecf9ddSxy6iFnueqc7FmIpX4HemnI0temEBn1XiBPkbQ9Bh9MEx78P3 CpaPu7wMb5rqVQBwLOQ2Atf1Spmo2KipWy0a60PdvhnFYMIg428wUUGBjT9DttpLdz/p yunyRyVlNPkW5rk6M/A8UbEm54uAGRhUrZ1WVvtgUDtmaTjnIuvXxFMRyDZNEMmCnM2Q bNIn6bBELhjjImoUMNHt8lHzfu4ro8FXV3VV+xF+JP1ayqNyMJmr0OdFhJJS0qJgajOC 6RNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=whec6Cac3bElRgyPe2mOFTEfYz2yGiYa1HUmY9pncIA=; fh=24ymrmafKpDLVFDYpnBPctyAg0l8NnpSyw4PUqfDy8A=; b=j0zCjKTvu5d+vvjFmOuufzT6X2YuH/Tu8/pLE/rssJ6/n6VFB74MdC3vHnb0ePAlpK 5js2vB6jOD73pfeVDMpQkBbTxz/9naJ+ufWGVa/2/wDkr8Brqixlb8qRZpUcskydNjVk LqlcKXGEN47iLzLfOMQGMv5OKzUMo17AN//6Q+zqPMPGp4EV/qrrkBG7Th4X6VNBRwfq 2rFOiQcjkx+hQM5Baus02y2j0un1dN4xFOY9F84Ll/ZE3ZPLFyEamuHW8ugIZMf4E0Uh 46+UZXwtGkW2PaRL30BVtqC6rhtDk/Xp2DTcxcDu4e9pVLtxnlKi3qJSn+oVGYdt2b7c uY6A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aA88Lxg9; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-35199-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f11-20020a056a00238b00b006dbded2500asi3617992pfc.17.2024.01.23.03.39.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 03:39:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35199-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aA88Lxg9; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-35199-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9D657B21F20 for ; Tue, 23 Jan 2024 11:32:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E73A5D8E0; Tue, 23 Jan 2024 11:32:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aA88Lxg9" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FA143D7B; Tue, 23 Jan 2024 11:32:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.120 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706009553; cv=none; b=meR5CNHbefbDgyBE89cHXbwuD8QzG7et5A4Pw0pHC2EkQFqFEmNanB0XVnxKa6Z3WWaiuosffnB8rNrbmV8ADpwno3Y2yil67933ElhHqD8O0nMJokMFn6a+DXeST3RUpD/Y4ka9BV8rFpGbn3t3a0v4bT+FW9WiB9op9cjF1G0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706009553; c=relaxed/simple; bh=zouesPAIO0cDhcbx3mfu1OwAwsS4EMUtfV+8BsSAPX0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lQeOgsfRFrYaRsr72TOhTuZrNP+hRy2Z1ffe2AoiHrt5sbiPhsmC2vMCb6dokNS+EjuQksVWmvIymXfSjoAmiaeD/v9tyxjkYvLWb47+VbPw3YzvnaJ7Fy2/znCkp5XQwkPl9Hv5yCz10N0s3aSgTMt/Hthu0LFNW72Vwh1vRI0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=aA88Lxg9; arc=none smtp.client-ip=192.55.52.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706009551; x=1737545551; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=zouesPAIO0cDhcbx3mfu1OwAwsS4EMUtfV+8BsSAPX0=; b=aA88Lxg9cfc65zl2DaBXmPZV1UDVOC84T2M51j69rV03jBu7J+itpMDL VMk/RMi8gcigVNgZhfMovqAwhp+597aKvONOH9TOalH6Rpfo4v8dLjOhS b/sEtsigpA13wZwudcxDYCmeaLsEqK3c0doGkcT+NDbbMZg4j+XVCsm8L FtuyaeTYdqb51c1i8Of73qbMdxbcabFebUyYR+dVke0jqSsMb9aW95uZi vyUpL8PyOAjowMyJniIQKg0dPkxHogxaKkh2o/HmkajOG/6WNaNt/Hfzo hLwXn/K/D+ogGuvUtMmmJeiopSWWP7V3zcb91SHwWGn24vLTx+NhOCHWp Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="400347730" X-IronPort-AV: E=Sophos;i="6.05,214,1701158400"; d="scan'208";a="400347730" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2024 03:32:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,214,1701158400"; d="scan'208";a="1570277" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.57.4]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2024 03:32:26 -0800 Message-ID: <089e43c5-1e0e-4c6e-9b91-827b01012b23@intel.com> Date: Tue, 23 Jan 2024 13:32:19 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/1] tools: perf: Expose sample ID / stream ID to python scripts Content-Language: en-US To: Ben Gainey , 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, will@kernel.org References: <20240123103137.1890779-1-ben.gainey@arm.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20240123103137.1890779-1-ben.gainey@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 23/01/24 12:31, Ben Gainey wrote: > 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. That is documented in tools/perf/Documentation/db-export.txt. It was anticipated that more arguments could be added, so that should be OK. > > 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(-) >