From patchwork Tue Oct 22 15:59:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13845962 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 D3B89D2CDFD for ; Tue, 22 Oct 2024 16:32:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+awhEeJ1ePh1h3sAxruYPMwmoHW3EPAmANvAf/aCSfM=; b=3v6wy3NyRX7HPFkYj1jcYfs64m gcFPV0linBIxXSNLo61xsAQ7LrfAtD+Z/yaEvJWFrepXpVUqdcIqyJc6Tn0tTZQfkVUqGjWgLPXwD 5nQoIFMZvEWd6sVxHv7SQAKT77wsujXRIOk5LsEc0ikKZUObG8Q2BAyVnZb+3yDlm8XdTWMaq3+CQ l6RTVjFRWfoTlI9idfnoyuSTl6yKMZJ7uhQ1VaCBIZLoG1JH/F6v7B2lzRG9CvT9Ob1N2Iajfw/kI mQ8FOAraoHyB1xdxTZ/5qIlgI1hpx0kTyjq4+IhwVhYwP7ifmxdnrRTsAy4/gh/3MvsEajNOzFjog Pr4WR+cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3Hnr-0000000BTgX-2hVf; Tue, 22 Oct 2024 16:32:15 +0000 Received: from mgamail.intel.com ([192.198.163.15]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3HJ1-0000000BLlq-2KBn for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 16:00:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729612824; x=1761148824; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qSLmULyuQLTlYMQgi0y7aT2AgtmJ5HDHawdb49crJfs=; b=iFstUyNnjowaoIien41LByURh9DMKc+Y3ysrUh0OWn9htEf+szoa/Bw6 MppEGzjE8tEYaKaEB1y91Epm+rwdst8eciq3MREowmk7tuMK423s0IGXb MbEYqkEo6jSgNO6rrnKgwcwAEE65x2s+sX75R+rdDsKRQTa8owAdO48cp pAdp7xGj4UUPCL6vVYq1lSUu70sZwoPp6KZ3m0LG8GzICJSeD8hy7/Mli p9ixSB4ejY6YTs14t2viXD3YfOkQ3tPx/Aw9c96qXH/nvrcu3UFiYVDVf ntuNpyZVd+A8ZbP4N4LxQIiWs6li7OziWYvancWOWGet6RBD4r3fKX+U2 A==; X-CSE-ConnectionGUID: 5wQ1LKh5QpKTKVD7EKFGSg== X-CSE-MsgGUID: tgs+AbFUQCme+npGJJwhOQ== X-IronPort-AV: E=McAfee;i="6700,10204,11233"; a="29270942" X-IronPort-AV: E=Sophos;i="6.11,223,1725346800"; d="scan'208";a="29270942" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2024 09:00:23 -0700 X-CSE-ConnectionGUID: mLD736aNSEC4gZKMQJR+rQ== X-CSE-MsgGUID: amvlgsNDTg6uaMHp0nad6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,223,1725346800"; d="scan'208";a="79858558" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.ger.corp.intel.com) ([10.246.16.81]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2024 09:00:14 -0700 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 , Andi Kleen , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, H Peter Anvin , Kan Liang , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V14 05/11] perf tools: Add aux_start_paused, aux_pause and aux_resume Date: Tue, 22 Oct 2024 18:59:11 +0300 Message-ID: <20241022155920.17511-6-adrian.hunter@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241022155920.17511-1-adrian.hunter@intel.com> References: <20241022155920.17511-1-adrian.hunter@intel.com> 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-20241022_090023_626002_85E2A8DC X-CRM114-Status: GOOD ( 12.45 ) 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 Add struct perf_event_attr members to support pause and resume of AUX area tracing. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Reviewed-by: Andi Kleen --- tools/include/uapi/linux/perf_event.h | 11 ++++++++++- tools/perf/util/perf_event_attr_fprintf.c | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index 4842c36fdf80..0524d541d4e3 100644 --- a/tools/include/uapi/linux/perf_event.h +++ b/tools/include/uapi/linux/perf_event.h @@ -511,7 +511,16 @@ struct perf_event_attr { __u16 sample_max_stack; __u16 __reserved_2; __u32 aux_sample_size; - __u32 __reserved_3; + + union { + __u32 aux_action; + struct { + __u32 aux_start_paused : 1, /* start AUX area tracing paused */ + aux_pause : 1, /* on overflow, pause AUX area tracing */ + aux_resume : 1, /* on overflow, resume AUX area tracing */ + __reserved_3 : 29; + }; + }; /* * User provided data if sigtrap=1, passed back to user via diff --git a/tools/perf/util/perf_event_attr_fprintf.c b/tools/perf/util/perf_event_attr_fprintf.c index 59fbbba79697..29db0aef9a74 100644 --- a/tools/perf/util/perf_event_attr_fprintf.c +++ b/tools/perf/util/perf_event_attr_fprintf.c @@ -335,6 +335,9 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, PRINT_ATTRf(sample_max_stack, p_unsigned); PRINT_ATTRf(aux_sample_size, p_unsigned); PRINT_ATTRf(sig_data, p_unsigned); + PRINT_ATTRf(aux_start_paused, p_unsigned); + PRINT_ATTRf(aux_pause, p_unsigned); + PRINT_ATTRf(aux_resume, p_unsigned); return ret; }