Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1144957rdb; Fri, 19 Jan 2024 09:26:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6J7vIblacYwfuJcHCFet6wKMn4EuanJteqnvtfsWIsLuPDVvglZ71rMO0o+V/1byel2G8 X-Received: by 2002:a17:906:71db:b0:a28:b37e:416b with SMTP id i27-20020a17090671db00b00a28b37e416bmr57022ejk.147.1705685180142; Fri, 19 Jan 2024 09:26:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705685180; cv=pass; d=google.com; s=arc-20160816; b=cXx0hCtTAuo0jL+x1D9OV0rJ33HobQMB9k/Hqb7z0qeyfPzlOYwuBzl+LxKhs15Da+ MlI+L0Qi0qhsN0sp8kqH2y1vjDfGJO/TJQTtfqF7Q1h02n1JssyTKHWjLJUX4ZotNUTC x5XpyafdqOsL/DwVfcSMmhywELM0VLMRspfLANAHViEpEbVJ8DBt6YH/K9fcX+as/WWC naK2b/mCh0x0u8LxjOqBKaHvM9ZYmQ0V0LStsbnS/8R5GXbO0ILJzo1kmXSyTFNSmddW if/w29lkoCzGHrc8FAJ54ut9oM2OdjGgGdXKSRMCclJABif0IALImOayRtTUtjaE4UoB y/zg== ARC-Message-Signature: i=2; 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=U34psyH8aptdFqkXlm0+TXEwYf7TCa0PNNn1SfKweUY=; fh=QSktUphJXtuclp8Qp4OEvhfsH4L+iARuBKsTPkhsEC8=; b=m8nm24KIQ6qsUUPs2JcMX059gkUS9U2v9Z9JimcJQaZxMQcIKjl3Xq/r5QbisOV7oZ 6Z6m8SIFQEYmL28Wjq92elSo0q5+eOaPKJKWbxli3iFgK51fo6Or3vcGj6Tq9N1SJvwH 0k43vt9OlULVcfKuUvoOkKmasWriuk0Kd0xJLYc2uO8dX5K2eubjE/OfrS7qB83X3bf1 thlcm9TIO+/pxT1K3nrKYk7UWHUwPm2ExVuC9VKFcrkDp2IDRZFlEfjoqdpb35T6jFyN RSwv6U+EjVBrrr8NTj1KVtz7QIki2ljzzy3MhKqo28Nkw89uJUPWurFX379RR/7tphcR qRKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GnLuMoyk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31419-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p4-20020a1709066a8400b00a2a2c6da5acsi7780165ejr.93.2024.01.19.09.26.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 09:26:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GnLuMoyk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31419-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9F7501F264AE for ; Fri, 19 Jan 2024 17:20:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA54355E48; Fri, 19 Jan 2024 17:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GnLuMoyk" 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 095DD1E89D; Fri, 19 Jan 2024 17:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705684786; cv=none; b=j/k5xCbVGFunFblfZZWwdGr6y5OxuvD5fTcg+FphXeJBhGsiR4z2Tx4vKiJuWS7Kc3PCMBt3QYpJ/4164UvL10zy6mt1RbqHGDGqFf4AunDfZxQFbMgfZvmJi4yBlHUMPJICOAiCWmXvShFbWZrC5OIU78+v/DW7JqKbX7NadwM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705684786; c=relaxed/simple; bh=bDhF8B6h1xrXw6H8tlXIPJgaraDfw0PAGv0Mm821Yjw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=uOicQK5So3kFpgST0Eryu1+AC4qS/gYAD1BztGUDa5k13IGE70bvR2JFiI6svxPGvIGh0QFKzxKqO8V/+dqpY7r9dYoCIBuXUUtcaI1nwsf4Jefe2VwVS9e7Ll4YzwIJKpDlWvxEdXYjtVpKRJr4aWTF7Vy/rzuIBR8S6L4gnK8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GnLuMoyk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7FF5C433C7; Fri, 19 Jan 2024 17:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705684785; bh=bDhF8B6h1xrXw6H8tlXIPJgaraDfw0PAGv0Mm821Yjw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GnLuMoyk6ly5HfBq21se67MsvK/Q7e7JKHUOerIz5zh609pBTiTfkdbUA2z+79JuE 2jtGT5ofzalSuGd1cpmxrTKVErTR/NwKqmSPjadpk5aHZP7CeedhBLYBkWLoOeNp3u fdejNEjOLSgU/ShNLSY0AFjDfFa2RIq4YkZythXdDFqHG8y9s5OKnyAv05xo+JOOTH 7XUvxznQh80eSCxo+NdTPODJppFmy6Gy3P1Dz6xccWHF+eB0sLvOR3/4neVRlNWnVE uNkcMMP6kEYuMjPGk10mktEJwLcmYkx9sJcRZxrvIFXEvEoOiqI4dZ8f4NGz3btAmJ MRqc1PVl0q/tA== Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-50f11e3ba3aso1359085e87.1; Fri, 19 Jan 2024 09:19:44 -0800 (PST) X-Gm-Message-State: AOJu0YyHhTXkCOoJtq2iEfzSHHi5EuubrwHL78kkUetCNPahaf46JlWq SIFaqglGQBVAMbOX3lu8gfNWBuQefRPjjE5raCvtvMDD7xKbXzo/tWeTAmULcS+wdyZDN4Ff/aa e5Um1uJe6cCQeGVnO25U33c7iCnk= X-Received: by 2002:a05:6512:401c:b0:50e:246d:7566 with SMTP id br28-20020a056512401c00b0050e246d7566mr7313lfb.7.1705684783008; Fri, 19 Jan 2024 09:19:43 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240119001352.9396-1-khuey@kylehuey.com> <20240119001352.9396-5-khuey@kylehuey.com> In-Reply-To: <20240119001352.9396-5-khuey@kylehuey.com> From: Song Liu Date: Fri, 19 Jan 2024 09:19:31 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 4/4] selftest/bpf: Test a perf bpf program that suppresses side effects. To: Kyle Huey Cc: Kyle Huey , linux-kernel@vger.kernel.org, Andrii Nakryiko , Jiri Olsa , Namhyung Kim , Marco Elver , Yonghong Song , "Robert O'Callahan" , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Mykola Lysenko , Shuah Khan , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 18, 2024 at 4:14=E2=80=AFPM Kyle Huey wrote: > Acked-by: Song Liu with a couple nitpicks below. [...] > +int sigio_count, sigtrap_count; > + > +static void handle_sigio(int sig __always_unused) > +{ > + ++sigio_count; > +} > + > +static void handle_sigtrap(int signum __always_unused, > + siginfo_t *info, > + void *ucontext __always_unused) > +{ > + ASSERT_EQ(info->si_code, TRAP_PERF, "wrong si_code"); nit: I would just call it "si_code", not "wrong si_code". > + ++sigtrap_count; > +} [...] > + if (!ASSERT_OK(sigaction(SIGTRAP, &action, &previous_sigtrap), "s= igaction")) > + return; > + > + previous_sigio =3D signal(SIGIO, handle_sigio); > + if (!ASSERT_NEQ(previous_sigio, SIG_ERR, "signal")) > + goto cleanup; nit: If we goto cleanup here, we will do signal(SIGIO, SIG_ERR); This is a no-op, so it is not a real issue. But it is not very clean. [...]