From patchwork Fri Dec 8 17:24:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13485724 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 63ED9C4167B for ; Fri, 8 Dec 2023 17:25:40 +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=jq1J7unWwp1Mz5R4srUa2hqR+euF4+EKcYhs586eRW8=; b=1JLByd4LG4vf9y b7ICbhiiy5PxDxx05KWhagmNvTjy4go/CnS+NhtkWy95a++Y21EVn6N8c8TIK/qrX34Ai/zApGgUF KDdiS8jzWTtErUfGilSJ9GXXeNWqoL+XbXBtCgktlvQMHwpIX7Ww7GqFTwyfE6AIgFRPeAsSURW6j fnmRORLQONqe2Xi4JtWeqSY596q8L1VI+WC/wIrBRrCbCIVQcaLpQh5+pboKd64norz33eTjYmg35 hpB0EmfxjIyqq483x8Sra2jNj7uEB/rnojlsthBo8cIpId9AW2Q16lqyo0S/+opQaOh1/jNFJLBrA 0k5oVWQXt379HXv+YzWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rBebE-00GAik-0p; Fri, 08 Dec 2023 17:25:16 +0000 Received: from mgamail.intel.com ([134.134.136.126]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rBebB-00GAhM-19 for linux-arm-kernel@lists.infradead.org; Fri, 08 Dec 2023 17:25:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702056313; x=1733592313; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=HS9B5laS4FVE8LbmCpzPPPQI/CT1mCILRKewwhWMU8E=; b=Yb5s4ke7Myoo3PJ9FcgyFccWloEr1oshSFKaFolYD4SqSyLzh9s8NCvf OAoqYkrwKoncrE8ZESmfWn2dUm24Qcj1yxWie5DIGKMklZltyTaBiEKkX fgurYVS703WfoUzQ1mb8tjb/wjdvyesfkbLfZDVak7pIjAAX9JLeBfGaL pbfxA+TNWP5QzFpSndMVlFXMrW63QMb977GsoWaAblp3vQpWzmocl5gIx nUc+O5ThtzzzlVSj3gtOCEicO6Xi+Wr7igmpcmc2W8KlmEeEw0YwHvIBo 1K46d1wklkWImIKJPBGxYchrDq/oesFT7cwkpdtJep3RXllgKPhN4G99y A==; X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="379432368" X-IronPort-AV: E=Sophos;i="6.04,261,1695711600"; d="scan'208";a="379432368" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2023 09:25:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="772201553" X-IronPort-AV: E=Sophos;i="6.04,261,1695711600"; d="scan'208";a="772201553" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.249.34.218]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2023 09:25:01 -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 V2 0/4] perf/core: Add ability for an event to "pause" or "resume" AUX area tracing Date: Fri, 8 Dec 2023 19:24:45 +0200 Message-Id: <20231208172449.35444-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-20231208_092513_461739_C3617F1E X-CRM114-Status: GOOD ( 14.38 ) 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. Changes in RFC V2: Use ->stop() / ->start() instead of ->pause_resume() Move aux_start_paused bit into aux_output_cfg Tighten up when Intel PT pause / resume is allowed Add an example of how it might work for CoreSight Adrian Hunter (4): 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 coresight: Have a stab at support for pause / resume arch/x86/events/intel/pt.c | 63 ++++++++++++++++++++- arch/x86/events/intel/pt.h | 4 ++ drivers/hwtracing/coresight/coresight-etm-perf.c | 29 ++++++++-- include/linux/perf_event.h | 15 +++++ include/uapi/linux/perf_event.h | 11 +++- kernel/events/core.c | 72 +++++++++++++++++++++++- kernel/events/internal.h | 1 + tools/include/uapi/linux/perf_event.h | 11 +++- 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 + 15 files changed, 255 insertions(+), 12 deletions(-) Regards Adrian