Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp429554lqp; Tue, 11 Jun 2024 08:29:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRJJUTNDKDAcQJ/4BNslNBnq6hEiKynKXE6tA7tCBZjdVSvQhVxWRdzLXLxAewoidCjKiCf+Ah/qcedknCSVRJnhXkZ3TMCO3NfhFcSA== X-Google-Smtp-Source: AGHT+IGP1pvDBUct6vDIMlevkk3n/jH1foTmPZdLKrcNH9++/5GusKvB06fhEeHQEwGjFqblF6Pl X-Received: by 2002:a05:6a00:c88:b0:704:34c2:b09e with SMTP id d2e1a72fcca58-70434c2b4b8mr7927714b3a.7.1718119741178; Tue, 11 Jun 2024 08:29:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718119741; cv=pass; d=google.com; s=arc-20160816; b=Y+ipQi0sjerzSqMwPjINDpNjTB8YQ5q3QZIt/OL+x3j/oYj6AZI8Nd4+yLsav16nmi ZC51vrl+CDH+zKmR+JyzqCw3nJcoXWXOoOn80tHWcE/fHXl0kCt67zCmLn3L0mRlKDkC ZhEo0pWtBDU8ipKl9DCjr2sAewpa4fcw8du3L4NLN0hubT3CiQhBb4PXa8Ca2idW1HJ0 UeRRZ9CzVBcc8NMhIX/hX/ydFUuKCJLS/zUC4crgASP3s6muLelFDy8m9Gb83Dm+W/ha I2K32luvIEf8C0PRX3VOldJsGP5Vfrt9ZYUiey/Zjnthik1QECCGjpu3FJl9g8BEfujd eb5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zhZ47+PGV0KgNkaYHQfiolIqCVeNK6UpG7cxle94C2Q=; fh=RxDBVMTpKDBx/PMc+9yU/MpVETdAoqX4cLdXrs7Wtog=; b=NZwVOrx7kSrw1lZBsntz9pTpzl+zq9if9I79bldpcIKvlOwzk6d4yRWT8J+JSZIxFf tjvEKIye9YqANGNp2TF0tlFc9WaZVVZL/xc7NfCoKPvAsQerLef1ugQNb/5V4L5+0i6x 55Acm+uSpL9HiTcLqsXqqEe1iny6vYbPdOj6QNyl7CEHSmNR5Hyiov5v549p+W78oFUO yu4HKaJurUYQguOj8xwGI9d953XFHuaUpk0DkGtFYvlffly7OlZIgiB2j7mpALmclqZu znUFx+x5JMc3ly0bSu9UnKWKnazu8LBX5xKlLCfKKnuy/3+kLB+A7hs32dT6ba9NCPWZ xHng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MfERPvMJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210150-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210150-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e383c7584dsi7503489a12.397.2024.06.11.08.29.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:29:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210150-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MfERPvMJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210150-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210150-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 07F54B25A2E for ; Tue, 11 Jun 2024 15:25:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C09912D05D; Tue, 11 Jun 2024 15:25:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MfERPvMJ" 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 D2A3436AEC; Tue, 11 Jun 2024 15:25:01 +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=1718119502; cv=none; b=pi5jPxWNLsuZhn++QnHIug37zorpg3Z8WQw9kNHCJPL9FbXAJ+y/dUAiYR31ij0Vnk6ozH4lfJ1+YewctpiKe12WLhEsbyigDgCE3ayPAU+xisbJ5SIlofEalM6gPsrS9yE37+Q4mgHZvEcTv5orXeFisj1bZT3Bgkl0brD/3OM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718119502; c=relaxed/simple; bh=O1A6EIbresg0Qi18kGElLIKYlhKkknqVsrmv/n129vs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MC5kzpLZxOZrd8pJ1TNK3KdAlnmEWCDeLtk9LSqOyOpkPfnTg69uJzm7VN3n7PbsF7rw7aUTvLyh9R0uMJ6eULKpheQNrVenX7QKcaRCy6WZE2/prxE4/zhuJjZMFNsD+bqXsp5/gfgFJOrfg+Ixh9iA++WqprrD3+UwyB0zFzs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MfERPvMJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90C08C2BD10; Tue, 11 Jun 2024 15:25:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718119501; bh=O1A6EIbresg0Qi18kGElLIKYlhKkknqVsrmv/n129vs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MfERPvMJ8YDbE0SPMQEY3mlvN+wv2WEoxPEoZgqCr8ICh8iBc0j6EUdVRqudBTHHR QAi+3maKaru/CHJyCt0XIEN+p4PDUYI++BceEQbBDyT3wHrOS3FRY0gwW5Fer0X1eU 14+mK1bgsGzGuLuUW7KzkBB8NYLfHipwgU9LhtMenDDUCgOxaFjBtCHTL+UQU0JCEV objpifsD7AiW6YB3dFbd78UaQf1vJx/XmMeZz1AA2nqewSwJMrsM/cHORRNWxmLTn5 h0fG0yrQVysLunPygE4w7w4QUpmbNgNK3Cq7/v/8WzMPKcc0vFJOr7Y2+iZQME9N6Q fHeXdXJ/2YHNw== Date: Tue, 11 Jun 2024 12:24:56 -0300 From: Arnaldo Carvalho de Melo To: Howard Chu 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 Subject: Re: [PATCH] perf trace: Fix syscall untraceable bug Message-ID: References: <20240608172147.2779890-1-howardchu95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240608172147.2779890-1-howardchu95@gmail.com> 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=1 > [no output] > > after > > perf $ ./perf trace -e faccessat2 --max-events=1 > 0.000 ( 0.037 ms): waybar/958 faccessat2(dfd: 40, filename: "uevent") = 0 Yeah, before there is no output, after, with the following test case: ⬢[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 = faccessat2(123, argv[1], X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW); printf("faccessat2(123, %s, X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW) = %d\n", argv[1], err); return err; } ⬢[acme@toolbox c]$ make faccessat2 cc faccessat2.c -o faccessat2 ⬢[acme@toolbox c]$ ./faccessat2 bla faccessat2(123, bla, X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW) = -1 ⬢[acme@toolbox c]$ In the other terminal, as root: root@number:~# perf trace --call-graph dwarf -e faccessat2 --max-events=1 0.000 ( 0.034 ms): bash/62004 faccessat2(dfd: 123, filename: "bla", mode: X, flags: EACCESS|SYMLINK_NOFOLLOW) = -1 EBADF (Bad file descriptor) syscall (/usr/lib64/libc.so.6) faccessat2 (/home/acme/c/faccessat2) main (/home/acme/c/faccessat2) __libc_start_call_main (/usr/lib64/libc.so.6) __libc_start_main@@GLIBC_2.34 (/usr/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. - Arnaldo