Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp439396lqp; Tue, 11 Jun 2024 08:44:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjv3rvKDNjOKlN/Xkb+nFheramno1FTKPG/Jdgdl0LtsiqV9hGidr/UqzP84d/GBqRM0VUV9V+78B6QdMeXmJl+zJGnmG2B6JHIXiV9A== X-Google-Smtp-Source: AGHT+IGhM4XXceGX/67zWmxUXMpAD2Ocqb0RU5ExQ1KqMd7jfEGhGS/PhqAGB0AeyJwz/iknmkUY X-Received: by 2002:a17:90a:8a0e:b0:2c2:dffd:1db1 with SMTP id 98e67ed59e1d1-2c2dffd2021mr7742846a91.41.1718120661240; Tue, 11 Jun 2024 08:44:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718120661; cv=pass; d=google.com; s=arc-20160816; b=uasgZJFOWDiHD+6J9B3+6hKughFWRcVtDpJ6VAiiMuD15VRJ76oBbmIyldoEDReFQP sa5zpmutqRmDxF3y+QtaaIKt5rvYXU1VzNL6X4THDld1TRm6v3TKEplSWjl0YSfceGAC UV8DV/6aNQeLbF5Jea2tqEWQY4rWE250pLquUXFgJIe0S04SkFpCzFwHGLrqdA87xxhR TPyO2CFb9liEz4okhvuLX/sgFXGPMdcNOXKx0dO4ONv4HzISYLEiBSrmlpLuzsu7klXK ZRq+9xO6RMbf8wwArT3OOq326tC/B5vvu2uSXuZZkmDskzm4e7loTRSiAY4rcw7Psc7Z XAPQ== 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=tW82GS7eKzLFVwObKnP68TgmFv9WSJzEe3Ta59uYnqo=; fh=vr/moSsfyD/Ivn/oQVJBcynCrtNxOCEwAw3WVBLsh/0=; b=QFy0OD/Utr60CYktbxXaLkK9qDSOAmc60FbmHWECXACDGQc4g2XlzPqvSOJVbztTYS TtK5PLOc4aV9zwpuEMkHto+SDvNBompkW/he84ZHWOwV4DXgZfNBGj/ndcsSPxpkGSe6 LppK/vqZWJs67Wqa8ls5hsfWajgp1jQnDkkJ2FKitnstGoUUGVvs+4qm07Y9u/hUdZcH NOyZIlyeI0wjtjsRBcbyfJ8JPKRzgDppCr9jyk/4al+G7eDu1uuYCR1TakNbjYiBIs9R wVsKe1l8187Z/cX3zQUFWcdAMy0ydKG+B1ttSmXVnlTTI3Ziaf6Atlmo7KFSjAK/15zl /gZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pb3XMvIf; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210171-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2df8ac1bcsi5916241a91.130.2024.06.11.08.44.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210171-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=@gmail.com header.s=20230601 header.b=Pb3XMvIf; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210171-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 D6114282A14 for ; Tue, 11 Jun 2024 15:44:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26B3938DE5; Tue, 11 Jun 2024 15:44:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Pb3XMvIf" Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B11BB376E9; Tue, 11 Jun 2024 15:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718120649; cv=none; b=L7Wxzn+xWmYtY/GSxx7afSiundFTZAbbJvm7OYiIt1ZiOkBNG+6quVhSSzVqQ56IY51VAqPY/SwRk90lUwDGc5MCDLu0CWlh9RU2DaqswSBSx+Vi7cptoMDCzELVZwX4myqL+2j9SEn3XEq4VN96vLzF9JWxX7Kqq1P6n25nCu4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718120649; c=relaxed/simple; bh=DBNsg1rC/jcnLIlq0lcqjsD/lY864vvTgshgHj3EhX8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LHuBzem9IMAyjA988gFOJmEIyMDfJiZfWHlg81Yx2roMZEhVDW59RT705V+YdOkvCnjBkBkLDB9DR/GSHTiwUnu9Q11HgvAcatlYNIuMWPW7WFYFZr1RGuxaACya32jdHQpGadZACKWyZzWjpsQfpPs8tmjduq04Dk6EI/1SWxM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Pb3XMvIf; arc=none smtp.client-ip=209.85.128.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-62f39fcb010so3401097b3.1; Tue, 11 Jun 2024 08:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718120646; x=1718725446; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tW82GS7eKzLFVwObKnP68TgmFv9WSJzEe3Ta59uYnqo=; b=Pb3XMvIf9GGTFJR/2aZRpFaQVH+nkJCh3iOZw1Yf/4/n12VodcGYzyOazahX29BLmx j/jx5091DYexpKYE2uC5cEoYeEpdYuYQmiwu2dHV9BNCJG0EtfKwAcWC8pgy+g6YlKBx e/olUyQkfjT174sJ8tr9btR1mStSglvKSW3F81TlyRrES30GXJxni0bi1x+rxVrBsycQ kwLydi+zOl9uM7sZQKVCgS+ScSdmREzbkou+Zg7CdpTMppqcW7cEtwwHGYoBO9sP3ws4 arQ+u9eF1MIRT2kCDNQexNWDfvycwVhGa4T35eViHS+f6+Npx7ddTLCjZfgxAaFewZxa z4eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718120646; x=1718725446; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tW82GS7eKzLFVwObKnP68TgmFv9WSJzEe3Ta59uYnqo=; b=YI6hBGTw+pJhlU7tMydTseDawYP0EJ4uPppUT++emzb6AKOzyUQPPjSPYGo5fuNt/G s44uSFnlPI++dub1a+gqjL3uQF4pQieYuaHKlhC1XymayLrQq3wTDgUOr6ATnzWgAa+L yWx6mpi63eeQ1mZqC7buY6CwbX4SAXlQd/Ls8+QkBzE25y6Kc3p6SXYNyZdewkxtzyJh ZNt6W7fTjzSIbcOgi7J32jWEaL3SZ5E3bC1kfsQbd04JiApFpet6INMUKlPn3prpWeKZ ewxgv/gLHO3wZLd9Ayv9QVpNzudL70bVtq5vYnfYTikNLAt/4DRo5OsGet/wHu02no7F U0sQ== X-Forwarded-Encrypted: i=1; AJvYcCVrosTkNyec4BYGMB55COiCY4+ny33TW7QQ0a9X0ZnQKmeONgbfI85Zi4UoRjdTAgiYc66k8k+8ifBKWti86Gv5VWcAmCPePfC+TFmCuaGoH/Pm1qLFmIEe+tiLkUp/ZgbvoDLi9447EQu+q1PJKV48Klu/2HNkDh7w174EhOcI/aUhHpeLxGRrBduF5a/3gt1hgwN6x1bmPxniRfMgUpxeul550dONYzD+jA== X-Gm-Message-State: AOJu0YzrFoAICRhtCeWKX3Ejd3fEiPfE/zyo9RMYaQN8WmhwX4T78G7C +LrasnCaG301nrom/LFqlFZvu5xrTnSFXUNtNTOLUzJGCzjehkDwFuHA25Ae8i30q/IZEqHghLo vW+10Ij5xP9d0wOgi1Bqgj7gG6s4= X-Received: by 2002:a81:52d7:0:b0:61b:3356:d28c with SMTP id 00721157ae682-62cd5571b37mr125787047b3.2.1718120646450; Tue, 11 Jun 2024 08:44:06 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240608172147.2779890-1-howardchu95@gmail.com> In-Reply-To: From: Howard Chu Date: Tue, 11 Jun 2024 23:43:56 +0800 Message-ID: Subject: Re: [PATCH] perf trace: Fix syscall untraceable bug To: Arnaldo Carvalho de Melo Cc: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, kan.liang@linux.intel.com, mic@digikod.net, gnoack@google.com, brauner@kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Arnaldo, On Tue, Jun 11, 2024 at 11:25=E2=80=AFPM Arnaldo Carvalho de Melo wrote: > > On Sun, Jun 09, 2024 at 01:21:46AM +0800, Howard Chu wrote: > > as for the perf trace output: > > > > before > > > > perf $ perf trace -e faccessat2 --max-events=3D1 > > [no output] > > > > after > > > > perf $ ./perf trace -e faccessat2 --max-events=3D1 > > 0.000 ( 0.037 ms): waybar/958 faccessat2(dfd: 40, filename: "ueven= t") =3D 0 > > Yeah, before there is no output, after, with the following test case: > > =E2=AC=A2[acme@toolbox c]$ cat faccessat2.c > #include /* Definition of AT_* constants */ > #include /* Definition of SYS_* constants */ > #include > #include > > /* Provide own perf_event_open stub because glibc doesn't */ > __attribute__((weak)) > int faccessat2(int dirfd, const char *pathname, int mode, int flags) > { > return syscall(SYS_faccessat2, dirfd, pathname, mode, flags); > } > > int main(int argc, char *argv[]) > { > int err =3D faccessat2(123, argv[1], X_OK, AT_EACCESS | AT_SYMLIN= K_NOFOLLOW); > > printf("faccessat2(123, %s, X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLO= W) =3D %d\n", argv[1], err); > return err; > } > =E2=AC=A2[acme@toolbox c]$ make faccessat2 > cc faccessat2.c -o faccessat2 > =E2=AC=A2[acme@toolbox c]$ ./faccessat2 bla > faccessat2(123, bla, X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW) =3D -1 > =E2=AC=A2[acme@toolbox c]$ > > In the other terminal, as root: > > root@number:~# perf trace --call-graph dwarf -e faccessat2 --max-events= =3D1 > 0.000 ( 0.034 ms): bash/62004 faccessat2(dfd: 123, filename: "bla", = mode: X, flags: EACCESS|SYMLINK_NOFOLLOW) =3D -1 EBADF (Bad file descriptor= ) > syscall (/usr/lib64/libc.so.6) > faccessat2 (/home/acme/c/faccessat= 2) > main (/home/acme/c/faccessat2) > __libc_start_call_main (/usr/lib64= /libc.so.6) > __libc_start_main@@GLIBC_2.34 (/us= r/lib64/libc.so.6) > _start (/home/acme/c/faccessat2) > root@number:~# > > Now to write another test case, this time for the landlock syscall, to > test your btf_enum patch. > > In the future please add the test case so that one can quickly reproduce > your testing steps. Thank you for testing this patch, sorry for the inconvenience, I will attach tests to speed up reproduction in the future. Also, your simplification looks good, thank you so much. Thanks, Howard > > - Arnaldo