Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2486845rdb; Fri, 8 Dec 2023 09:26:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHX7M4TIjho3SYTUwGMYRcXHuNfqHjIO3Wjdb1bw7yIl9ChCxs3TJaqqiTjhOVjRWTRYI9M X-Received: by 2002:a17:90a:7c06:b0:286:6cc1:5fb3 with SMTP id v6-20020a17090a7c0600b002866cc15fb3mr442363pjf.54.1702056387981; Fri, 08 Dec 2023 09:26:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702056387; cv=none; d=google.com; s=arc-20160816; b=Bg/LmrzD+ckCfrDTAVA3vZGjKgPd/lS5WdBpihRMqMGmp6bNJ+6MUSZyxo67ckkA7h iXZw3DXdyJeb9RhqO/RFzB3o5PRTOO7ZyjptzHXUyO/nzjlrik1alseiWh7t6ZmH4Qvm Jr+fRH0CX/eUu+YJzbVXXgqMxVJLCyhHIBvc7XPSZaClO7zpAXy9pUhywGeeH7NFae5q ZxphVrvUXUxZS73ShnfxGqJv9+WBkEoJLJCR69mGxuyZSKYPi0zpwznfg02ofV75EPXO Cpu9m/2QAuDLCFmh5w1cVticMUI2NJKW4KE/cXXt9sEu4m8iHsrgXkMCqjJaspnkdZtr 7G1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=Jf7+7tFzSD8qqtogMd1f4MDWwJNPOY49ljcon1DGW4c=; fh=cd6f3jNh3j7Qvd5mXmd/oCoIQnwAYeKd0j29JiSirLE=; b=qEWTEdxehb3QkgK3+UxqSVoOKxQJ0od0dMIXR4AwZPv25MoHb7QKducTiOCwl51tgj aWUq4+dyKSinKRnCssXByuTDFOjkvI2fDrIvw/svImaEC0dxk/fAWN7S6BOg1OTdZoe+ 7iXRXaHuLddS3UPsp86yKLRJ3YMzQF8i0QFftg7G+8PTqR7vQXs/bsAe7JGrEneAJx73 //ZSbqSoeSqQm36viDaFbFwIWL+txU42F9kaBZjnDFs6VtHJwRrNee6sVYtKiipc/h1v HrM4GcjPQa50FBcig+/ZqeKTvypOCt6PDMsB+I6jvr/NNOF1EWzebuCvR6Mfd6goX5Ki QPSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Yb5s4ke7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id kx9-20020a17090b228900b002867c645d4bsi3229630pjb.13.2023.12.08.09.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 09:26:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Yb5s4ke7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B4CA78076E50; Fri, 8 Dec 2023 09:25:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574250AbjLHRZJ (ORCPT + 99 others); Fri, 8 Dec 2023 12:25:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233780AbjLHRZG (ORCPT ); Fri, 8 Dec 2023 12:25:06 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57B1C137; Fri, 8 Dec 2023 09:25:13 -0800 (PST) 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="379432363" X-IronPort-AV: E=Sophos;i="6.04,261,1695711600"; d="scan'208";a="379432363" 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 08 Dec 2023 09:25:41 -0800 (PST) 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