Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6817897rdb; Tue, 2 Jan 2024 14:56:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFm1NO1MrWZyKRUhL6i1JbulBo1HYagKleKR8VV2x2tx2GxnkR7EmCfen/kf8oZRv2l+xiW X-Received: by 2002:a17:90a:ca14:b0:28c:65ee:3c37 with SMTP id x20-20020a17090aca1400b0028c65ee3c37mr204704pjt.9.1704236186712; Tue, 02 Jan 2024 14:56:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704236186; cv=none; d=google.com; s=arc-20160816; b=UgoBztZDhapJkbPhCgTZe0YzMsRn+u49Qv1StqiToEfqsfUzxvVbQk0fwtxJewk0Ff XzyDBL3KuhficqFYMO6VbG/wtSsHSZXxvMhyUZGS+vWIaB2ASfpB/c+znN/T+Lbc7eW4 ZkkbsYK4LC0e5xCN5lE/pMnGnuhisV90J7C9f/aDcgoASySEXI6mdg2OOI4WVw8e92Ah D63+9WSkfdVZrjOp7U2IVqtPcsBVsmr6VK1eaV2WkLhJtuG59UkV2Yoep/ROUAMXV+Ns c7i4wsPe9SmBx957zo81veN8mV3n/aWeg1NMoU+xqmSZ0vwKA0FCgaI9oxxEWNlViIfd LN/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=p56agRjSKKcueVcq0lbWdo8QWJunCZKI+nGr/1RWnZE=; fh=nyEdS10mxrsMOkkMNreKeRijF5sNyQpzU0pkmR/jRFE=; b=dUjIP4NDJq2Yf1p13/VTUzVuBmioy/2DIzmRMSwhHJnAx+W0+KoAUeRA4pWRC6nHlj eNR/hT0UDWUsMin8P0o9QzjlPHk1k8/3dj8UFlF46vB4NBj1gTDYWogXqEueI1PJ3Swk VJnUzVsVBKHiTiDSJdoP4ejcPW0ZKoDqiSSChAVd92c1MquZYcl/NDLXNKGIw+9d6wh6 nlb81N8np5+5d5xpqeSFz1wO2s5vXO8wXzALfs92Zj7QHp127paHf558uv/0klpeo2Q7 tqoWu7xBc/MRiHwh1N2z+MWUwcbjRcW5g/oa3+N/e6p9Z0I1jXawZsz0Ez9ZZLWjokC6 tGjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O97ADtH/"; spf=pass (google.com: domain of linux-kernel+bounces-14957-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e3-20020a636903000000b005cdde899923si14807836pgc.758.2024.01.02.14.56.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 14:56:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14957-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O97ADtH/"; spf=pass (google.com: domain of linux-kernel+bounces-14957-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 595CA284128 for ; Tue, 2 Jan 2024 22:56:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3089917736; Tue, 2 Jan 2024 22:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O97ADtH/" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 608FC17725; Tue, 2 Jan 2024 22:56:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B43E5C433CA; Tue, 2 Jan 2024 22:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704236176; bh=p56agRjSKKcueVcq0lbWdo8QWJunCZKI+nGr/1RWnZE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=O97ADtH/0ZL4RXc3DGoqpfQTzd5jHFbwSmqr3CI42EGJLHJVUVvPy3EOmJS4i+dPj kjrbLpL2u37ZttXBQuv6iWKHLwCpCNg122YIVic805S7Vg8Tdf0FTAGZpaeS6NofmI 3zEWiKPcAthIGzuBxJJZy/n9RdsX5H+o14zpAGj6q438qx2D9o+IeAzCABjyxn5uxH EWWm6FofJ1aUQAtYdnY9p0X0iFsDvRkK2JZ36ElZdxNkJyw51RoQRUiJw4QKV/A+PO 4Hz/tAr9QxfNfDkgYD2nQdwuPtTar+bQ/pA2FIe9Q3dL+YPqhs8G3YzbZm4UPAQvON MNKkalq2odgsw== Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-50e80d40a41so7587404e87.1; Tue, 02 Jan 2024 14:56:16 -0800 (PST) X-Gm-Message-State: AOJu0Yze8a4kwssiEkeogQEe/jaSIX7+I0kN3gZVj5i44AgaN5w69Ofa bZOTIwmVY5O42b4YAgxb2Ex31fUZV/19fCMiNE4= X-Received: by 2002:a19:6550:0:b0:50e:30b3:b8ff with SMTP id c16-20020a196550000000b0050e30b3b8ffmr6957406lfj.16.1704236174949; Tue, 02 Jan 2024 14:56:14 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231211045543.31741-1-khuey@kylehuey.com> <20231211045543.31741-2-khuey@kylehuey.com> In-Reply-To: <20231211045543.31741-2-khuey@kylehuey.com> From: Song Liu Date: Tue, 2 Jan 2024 14:56:03 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/4] perf/bpf: Call bpf handler directly, not through overflow machinery To: Kyle Huey Cc: Kyle Huey , linux-kernel@vger.kernel.org, Andrii Nakryiko , Jiri Olsa , Namhyung Kim , Marco Elver , Yonghong Song , "Robert O'Callahan" , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Dec 10, 2023 at 8:55=E2=80=AFPM Kyle Huey wrote: > > To ultimately allow bpf programs attached to perf events to completely > suppress all of the effects of a perf event overflow (rather than just th= e > sample output, as they do today), call bpf_overflow_handler() from > __perf_event_overflow() directly rather than modifying struct perf_event'= s > overflow_handler. Return the bpf program's return value from > bpf_overflow_handler() so that __perf_event_overflow() knows how to > proceed. Remove the now unnecessary orig_overflow_handler from struct > perf_event. > > This patch is solely a refactoring and results in no behavior change. > > Signed-off-by: Kyle Huey > Suggested-by: Namhyung Kim Acked-by: Song Liu