From patchwork Thu Nov 23 12:18:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13466183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02F2DC624B4 for ; Thu, 23 Nov 2023 12:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=5MvvjEZlJjlqnQWX/dsl28DQevkQ6hkRuQ5BpEFW0X8=; b=M105O2AA9ZKa7c CTQf2xWA/WxH14m6SVSRfsYuYjF/pN2B6FjlaKCPWx+BtwcG5A9Rz1UYOpQ4n8fZNGnb2eOiGLwIS 4SJHwDKTVJ/zb/R+n8ELjayN2koIsNm87PWSxhboiVXR1R2r4chrf5lP8+cdFlCC37fMht/Pzgps4 Qofat3v87DpvuclBOjpcspKn84z386VRFnP3K4O3p9cqH68cdJEwsOghOStClNir2x5b2UqIwS0fY S9pSLrS9qJ1QFA/97eBP4GvFZms7BJ+VzRlbYZUGNKiCfpZcCBlcDB9sqo8e0IBqCXYqhZDn6h5Ec 5MBc09RaosplwpuLhufA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r68fx-004lbD-1e; Thu, 23 Nov 2023 12:19:21 +0000 Received: from mgamail.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r68ft-004lZq-06 for linux-arm-kernel@lists.infradead.org; Thu, 23 Nov 2023 12:19:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700741957; x=1732277957; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bQdpKQROgueA3Gs7uL4fvcxngYtStie2+8CIT0nxY54=; b=bEuqbg8eNijE+DfC1XuZwCq85H26ujKX+CcvcCD8hol8umr8QYRNX0lh ozcYK6qd9CKSmXOwK3isrjJ8Z9pWFsjTtG+WBNt8M7e14Y7xN0KqGd0ZK NPx01em9EfkC5vjK1sQBywqjqhX7vt1sybXWvmoDozdX+/BJz4ZckXc9v XDMDPiUA2Bhk1r+QHldvwYarfa3BaPoOQAlmrT8XJ1pWwv/6yShGPKhXG bFakvm452lrkcrz51PUtOVgfs0OqA6PjJrmQxA3RxQyBI0XJ44O2fDUXS pIUBSlIIDxAOKh07ciJNlQQo7QtdZLgcendOhGBUohUPqkp5C7dx/UkMf g==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="478456326" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="478456326" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 04:19:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="890774781" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="890774781" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.41.107]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 04:19:06 -0800 From: Adrian Hunter To: Peter Zijlstra Cc: Ingo Molnar , Mark Rutland , Alexander Shishkin , Heiko Carstens , Thomas Richter , Hendrik Brueckner , Suzuki K Poulose , Mike Leach , James Clark , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Yicong Yang , Jonathan Cameron , Will Deacon , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH RFC 0/3] perf/core: Add ability for an event to "pause" or "resume" AUX area tracing Date: Thu, 23 Nov 2023 14:18:48 +0200 Message-Id: <20231123121851.10826-1-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_041917_189692_870AD248 X-CRM114-Status: GOOD ( 11.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Hardware traces, such as instruction traces, can produce a vast amount of trace data, so being able to reduce tracing to more specific circumstances can be useful. The ability to pause or resume tracing when another event happens, can do that. These patches add such a facilty and show how it would work for Intel Processor Trace. Maintainers of other AUX area tracing implementations are requested to consider if this is something they might employ and then whether or not the ABI would work for them. Changes to perf tools are not fleshed out yet. Adrian Hunter (3): perf/core: Add aux_pause, aux_resume, aux_start_paused perf/x86/intel/pt: Add support for pause_resume() perf tools: Add support for AUX area pause_resume() arch/x86/events/intel/pt.c | 12 ++++++ include/linux/perf_event.h | 9 +++++ include/uapi/linux/perf_event.h | 13 ++++++- kernel/events/core.c | 65 +++++++++++++++++++++++++++++-- kernel/events/internal.h | 1 + tools/include/uapi/linux/perf_event.h | 13 ++++++- tools/perf/util/auxtrace.c | 4 ++ tools/perf/util/evsel.c | 9 +++++ tools/perf/util/evsel_config.h | 6 +++ tools/perf/util/parse-events.c | 33 ++++++++++++++++ tools/perf/util/parse-events.h | 3 ++ tools/perf/util/parse-events.l | 3 ++ tools/perf/util/perf_event_attr_fprintf.c | 3 ++ 13 files changed, 167 insertions(+), 7 deletions(-) Regards Adrian