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: 16999 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp401817vqx; Thu, 23 Nov 2023 04:19:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsaGzcHW0+71mPDlMjAEhabdfXFneThNTB7mJwPmsyLtqQMb+/uUafvKbgalJJuRgPcGuw X-Received: by 2002:a05:6830:1489:b0:6b9:4d79:e08a with SMTP id s9-20020a056830148900b006b94d79e08amr5965829otq.32.1700741969787; Thu, 23 Nov 2023 04:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700741969; cv=none; d=google.com; s=arc-20160816; b=0YNpAnkBuB67nfWuaJhlAocdgCZBaMH3trgBB5k5344Ad41qhMdlxuT5TQmh/G2sg+ JSfR5raZOSwxNAUZavXEA9jPHrDe1Np1AZeSfYnydsziYbcgIWEoIjfX+hrPJNCaH3qD G+8sJpHMsaIBcmrem7PxWtVH29S2i2Q2PSqt01ty6SMqyI2i1+UAKgqIVcZIfaoqOQ08 sqX7y3N3lWKAKMlB4spJ+iPaY1B04c0jc+EwM36RtfxOx9Wy1+VHSRQYWta+s32cH+wr dagEfN8zv9vkaf7rDHNGUPDgzI4Es4LxGhOEyWJjRfQfRHkRFKb1ASbmSFqdl0ntBAqD 3eGA== 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=+SHj8utvqbEPSYS0qsiV9la+u4LBUSBTRrIBnWoEwGs=; fh=cd6f3jNh3j7Qvd5mXmd/oCoIQnwAYeKd0j29JiSirLE=; b=u6d6yix1X0tzCaC2sACwNHlujwjFVQ2h+qJwO2UYkQnK+7+z1lH7m7sM8cGrSO1rcY k/Lx0ip12oUU0AjeAUSy9O745oq3xdNAVpuxDPxq8cR3EPxqWprfwesQ60GGhP9p8MA7 qvvEefMELpS4IxsW4OqycQWPBHw6leMHHjBy4Vc1BdvlQfSKg1TcqIc1PdEHV17D/Xzy kC4pVAN8Tjx9grJ2sUT+c8a/n+fgeWHJHNRWFN2HzyF3PFIWBj3cs3Ckw09NOChaqbUV mJyBrtiAA/A0wkiIYGqZrztPM/AIHiBAlUx2uSRNWvzgpmv4EHehBkoZNsrxvqCDCcLI AaIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=P9N2QDQY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bz8-20020a056a02060800b005c1faa82bfesi1206245pgb.857.2023.11.23.04.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 04:19:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=P9N2QDQY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id BB03782972E3; Thu, 23 Nov 2023 04:19:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345255AbjKWMTG (ORCPT + 99 others); Thu, 23 Nov 2023 07:19:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345168AbjKWMTF (ORCPT ); Thu, 23 Nov 2023 07:19:05 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FC811B6; Thu, 23 Nov 2023 04:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700741952; x=1732277952; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bQdpKQROgueA3Gs7uL4fvcxngYtStie2+8CIT0nxY54=; b=P9N2QDQYAL4Oj5xl36hBoKllks2wA2Iep2V0a+sWbZS81MraBq1jmwDT GbfICuT1oIIitDIP8NFHjHLglQYaap0w01E4iWj+rgCtudUKIYgb2seaf nERSRG0RS0yfuw3cLTkvMK07UeJrm49Lox5gLXNah95wi0Yv23v6h4Co0 2lLRwEMLXj0NdhOGuosReLNYfZhglXmrSnG6hwxcjSvvGH+oFV1j545Nn 3G+yQ8RJi0Gr3rvtI+qffAHboPQQWI7Xm20Q9dKHqzukV2WsiUt9j9cjO Z0p+YhdKBZcAeB8mNvA8DnfTqGa4yvYKcixC552L+eg39uoF77HnDT7k/ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="478456331" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="478456331" 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-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 04:19:24 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783357211369979208 X-GMAIL-MSGID: 1783357211369979208 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