From mboxrd@z Thu Jan 1 00:00:00 1970 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 14F40C3DA49 for ; Thu, 18 Jul 2024 11:52:09 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+aThDcNvYH+xTn1UAd/vTyjcw0pFDf2+xHmJSo8H8Hs=; b=0EMYCR9TsYxDBdzbQbVDYGcBB/ s4TdEK78lqt5TFJr7ov3LXW8GLHul95xO/dnTI15MtstWnQ94Tk1lpqndkH+HjT5LOOADXTDfIKIe NIO22XOkjAUs0o2I/TAQiY7XiMoBd1xDMbk8QDJmoUNm1T4eX1I6P81343W05sG/yw+Bi2zBJry8Y Ok70an/v12nrDkIMLmy0U8cjaxoWWDvAEB9vcn1Ec0upJC+TZXcVHHMmmnH0Pb6csxl6t8VUyW7Tk Rzmd8uR9KsI1fL3nsIlGWWod3OhWMbVREQ+7Km5m1Gr36uOwgL2joEBfB7/ZPkhhRVsOtF4QZ4mww pUQ6B0qA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUPft-0000000GtPF-1ZHj; Thu, 18 Jul 2024 11:51:53 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUPfa-0000000GtLS-1Rzl for linux-arm-kernel@bombadil.infradead.org; Thu, 18 Jul 2024 11:51:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+aThDcNvYH+xTn1UAd/vTyjcw0pFDf2+xHmJSo8H8Hs=; b=BZ+vlkxBfSmzU2MwFIPnfAUitm S417eFMyco97UvGgMwAuQ4qG0c8C42IboCcDQ4/BLFtTYEBszTz3myny6V8Vq6WlDk/h7N5GiHEo+ viWHEDBFgw1k3u1euozXCu0J5A/DklTOKVcok1+KNsy0S4zGsoKLa8Qu9kYzSUuBvXbuJ3S2BwPlp MEw9RxBcKVzw+FFB86a6IVTxJqYUJR5IytWPgnlMIruKGXq7JvS+cpAtpPTX4HOzPYdcMQIXzWvGl c4hxv3fhO+QMF9ZB9xC/QkRvjq+EdF5AaHIcKPG6CRe4kYebxxB1S4KMNUeXZC65nqIv8Y0a7oqjM 1Xr4ZMYA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUPfU-00000001xAi-1LRH; Thu, 18 Jul 2024 11:51:28 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id DF68B3006B7; Thu, 18 Jul 2024 13:51:26 +0200 (CEST) Date: Thu, 18 Jul 2024 13:51:26 +0200 From: Peter Zijlstra To: Adrian Hunter 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 , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH V9 02/13] perf/core: Add aux_pause, aux_resume, aux_start_paused Message-ID: <20240718115126.GK26750@noisy.programming.kicks-ass.net> References: <20240715160712.127117-1-adrian.hunter@intel.com> <20240715160712.127117-3-adrian.hunter@intel.com> <20240718093846.GJ26750@noisy.programming.kicks-ass.net> <14cd68b2-eeee-42e3-87a6-c12d3814bd51@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14cd68b2-eeee-42e3-87a6-c12d3814bd51@intel.com> 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 On Thu, Jul 18, 2024 at 02:19:03PM +0300, Adrian Hunter wrote: > On 18/07/24 12:38, Peter Zijlstra wrote: > > On Mon, Jul 15, 2024 at 07:07:01PM +0300, Adrian Hunter wrote: > >> 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. > >> > >> Add ability for an event to "pause" or "resume" AUX area tracing. > >> > >> Add aux_pause bit to perf_event_attr to indicate that, if the event > >> happens, the associated AUX area tracing should be paused. Ditto > >> aux_resume. Do not allow aux_pause and aux_resume to be set together. > >> > >> Add aux_start_paused bit to perf_event_attr to indicate to an AUX area > >> event that it should start in a "paused" state. > >> > >> Add aux_paused to struct hw_perf_event for AUX area events to keep track of > >> the "paused" state. aux_paused is initialized to aux_start_paused. > >> > >> Add PERF_EF_PAUSE and PERF_EF_RESUME modes for ->stop() and ->start() > >> callbacks. Call as needed, during __perf_event_output(). Add > > > > Why in __perf_event_output() rather than in __perf_event_overflow(). > > Specifically, before bpf_overflow_handler(). > > > > That is, what do we want BPF to be able to do here? To me it seems > > strange that BPF would be able to affect this functionality. You want > > this pause/resume to happen irrespective of how the rest of the event is > > processed, no? > > The thought was to have the output match up with pause/resume, but it > doesn't really make much difference. > > Putting it before the BPF handler is reasonable. OK, let me do that and make a few more edits and see if I can stare at that next patch some.