From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792913402; b=XcdGsBctkGuKfdsRauuzhOluMvoFtEoPAv+MEWHwlDLDubzkRkhmqL7geEPLX/+P/0tM AxlorNkLFz7bVzICdsAoZdgGiAtA32e014hlh5hihXWdpOK6LMBj5Qh10A2rbFiJwxwD0 5eJ4GN9RVSnUFb7c5RcuAeNso9lch5XWAlyc0l6l5PRPMs4Hwtp2vXdPNyfimSj4gp78p IZHtqg0DKC3UNy1/GhksvH0PImwME/taCTfCWxZT5IoKhz+YhYTpoatZdi8tqvhWrWrkj 8o8AqlOtlEfs3dL3eMylwzLqfPqQvP1nhx/YPBq3GFzWXeRgZdVPBTFiXqgRZWp1ecA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792913402; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=Ca84V1D9B8Ybj/7LgOQ6VhiC3u886cles4dpmUcGdP0=; b=a0SbbiSZwJ6DezNzqHd1BjgTLFKRk0s0kqs4U3DMLJ8VsHfCiGnVDoRt9lpJWceO+zc7 6CgHjlN50cafAYw8wfPMXDnqRKIF4hGhZxpr2XDDBGznuXS+sEgjdnZ48O7nonwi3NzcS SRl2YmmOGrAfhJPwvqysdLMQkWtwwP++XqBeh0LClMnThvucYsKeOtw59xzcZz6f3jvvi 1LaLc6h0jy5ohU77luBuETvMpY4b0kw5whqXdTBSTlvxAJsZoAc/IxYBx625WHa/tbnVJ 5GlJBM5MLwunr6izVbwN4Ls2a6fZCxS52ZgOwz8AsyoznvzH+WOzvUFR+c6ndX4HjIQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=sbXu8TmW; arc=none smtp.remote-ip=209.85.214.175 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17F84606A31A for ; Sun, 25 Oct 2026 07:30:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 17F84606A31A 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=sbXu8TmW Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2e8da6ef7ddso10498045ad.3 for ; Sun, 25 Oct 2026 00:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792913401; x=1793518201; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Ca84V1D9B8Ybj/7LgOQ6VhiC3u886cles4dpmUcGdP0=; b=sbXu8TmWoOHQrI8owKBYY+cShhIySq2CbLFlzir2i5fc2R9j8kIlcd1bA32HTv1ljK s1c2pu7rkeKozyEjYZYB2Se7ES828YwyltBHAF4G/PBj12X2ENqFNv/QOHoiHY85ldEr Er99edSVkY9kP97jiC21DjEYoMpySlGGzgtBxikkbnOTpQEXQa+wAMHSOZ2Y3lnJEcjn XcnLmHktz3Z6c3s1dTd4bxl3NmpHIGbdFh63JcXGLlyERo9Jc0iuoGSp+HNZQzv9KW1g njhcF7ceKgvztm6cz8xMA+PAGFaFY/iqmp6RtdZFZXfbcQ7PimdO446S0ZuU/OBO4xt0 U6Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792913401; x=1793518201; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Ca84V1D9B8Ybj/7LgOQ6VhiC3u886cles4dpmUcGdP0=; b=Z59B957iDoOxcYlgJt+RDKYkNoYDp9iO9DfhXvlDx6zkZWAXmscUyMbf9Vugh45t8C hsQBFujyMvZsQFq+triQR/A4BWHV2eXeD083cAsOwn4KfJeRv/wNUqZO6gyeFa2EHoB/ Q8Rv5aYsqw97p58HlxxR47wGUSZplrWWnqbJjC9J6UZ/rpdB+bj/k9hpMgdG6F+b9GL0 CaAXcB+tHDDl42XWw1WJYKuxZDgRBWh6a6TDAsr+RuKiHaJzOM9bFIvoHLEhlFr8QVHu Cp+LV7oamQTmjuT7nJniAQ93Y+hzm63dwzk+zSob1dfhzM5RKgSU3l3cBXdhfotyMZ3h b2xQ== X-Gm-Message-State: AFq9FYLwHyiWnayc8Nu9wGQwXZ8UGGLVv2ht5C7ImHTehvXFaR2p9We+ s4yWu2G2HFsDtM9sOGZI5u/usqQYe6saA+2Yvl5+9RikTIdIngZPnxuA+/yntGHTw/4= X-Gm-Gg: AYBFou0lh8SA6PZhs64WbN3qzSQWVd+jIY9W1KZrV8eVLyU7EydLi3wru6WI3IIF2R2 FuS04ORX0VpE/ZJNxKP0RFB7Gi1zU0arYkBIxWG6XB0vI0oZwtY3SWN4zdVWjqUbRHYoYY9l8tn 0RpyD9wYlMZPBn84mCWPLY/JCpeVrO+izuEcCl2oqD4IWjqqI6o20sQltXsPap2wq8loe1CUJkF MCTBME8Gn1gZkEjpYG9Ru2lE0RbWM7YgNx3oi+/gT6WJTSUNwpo0SUsXCeBGFVEq+DKd/zNx/52 2DrTHlWLhKRpuVL82ENVZcQq/8uzxETeNPl0drpBw+GvcN/9hgJs33Sb/PFQWMkEIX1Q+0H7G93 YQE4840hnBUFSMRG2yUJ4zlLbVQimsL22TxMcU0zHPoDpISrxWBY1fHvkKMG/t8eeOpPY4mDbO6 XcwS33ccURTNvNCRI/mByiS1e51o9IyDNJeDRfPGNYbJTyMNWKc6tAWBTJMc0AkuGuH5Cz5q1hM 4hnELSgv3/wpqcHzPF95ZTOhwFM2yWS+fDTUtes+D6Al7TCHJbA5lY= X-Received: by 2002:a17:902:ce03:b0:2e2:e3aa:7a35 with SMTP id d9443c01a7336-2ea9c7fb4c2mr32015315ad.36.1792913401389; Sun, 25 Oct 2026 00:30:01 -0700 (PDT) Received: from localhost ([182.216.53.174]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ea9b121725sm7788525ad.14.2026.10.25.00.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2026 00:30:01 -0700 (PDT) From: Jaewon Jung To: Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH] selftests/ftrace: Add debugfs requirement suffix Date: Sun, 25 Oct 2026 16:29:41 +0900 Message-ID: <20261025072956.1739981-1-jaewon8868@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add a :debugfs requirement suffix to check interfaces under debugfs. Use it in the kprobe optimization test to report unsupported instead of failed when debugfs is unavailable. Tested on x86_64 with QEMU: - debugfs not mounted: UNSUPPORTED - debugfs mounted: PASS Signed-off-by: Jaewon Jung --- tools/testing/selftests/ftrace/test.d/functions | 10 ++++++++++ .../selftests/ftrace/test.d/kprobe/kprobe_opt_types.tc | 4 ++-- tools/testing/selftests/ftrace/test.d/template | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions index 826141e299e5..3cf8ac5fb4d4 100644 --- a/tools/testing/selftests/ftrace/test.d/functions +++ b/tools/testing/selftests/ftrace/test.d/functions @@ -145,6 +145,7 @@ check_requires() { # Check required files and tracers p=${i%:program} r=${i%:README} t=${i%:tracer} + d=${i%:debugfs} if [ "$p" != "$i" ]; then if ! which "$p" ; then echo "Required program $p is not found." @@ -166,6 +167,15 @@ check_requires() { # Check required files and tracers echo "Required feature pattern \"$r\" is not in README." exit_unsupported fi + elif [ "$d" != "$i" ]; then + DEBUGFS_DIR=$(awk '$3 == "debugfs" { print $2; exit }' /proc/mounts) + if [ -z "$DEBUGFS_DIR" ]; then + echo "Required filesystem debugfs is not mounted." + exit_unsupported + elif [ ! -e "$DEBUGFS_DIR/$d" ]; then + echo "Required debugfs interface $d doesn't exist." + exit_unsupported + fi elif [ ! -e "$i" ]; then echo "Required feature interface $i doesn't exist." exit_unsupported diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_opt_types.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_opt_types.tc index 9f5d99328086..25f7192f887b 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_opt_types.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_opt_types.tc @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (C) 2023 Akanksha J N, IBM corporation # description: Register/unregister optimized probe -# requires: kprobe_events +# requires: kprobe_events kprobes/list:debugfs case `uname -m` in x86_64) @@ -22,7 +22,7 @@ for i in `seq 0 255`; do echo "p:testprobe $FUNCTION_FORK+${i}" > kprobe_events || continue echo 1 > events/kprobes/enable || continue (echo "forked") - PROBE=$(grep $FUNCTION_FORK /sys/kernel/debug/kprobes/list) + PROBE=$(grep $FUNCTION_FORK "$DEBUGFS_DIR/kprobes/list") echo 0 > events/kprobes/enable echo > kprobe_events if echo $PROBE | grep -q OPTIMIZED; then diff --git a/tools/testing/selftests/ftrace/test.d/template b/tools/testing/selftests/ftrace/test.d/template index 2cd8947edf72..d4a2500498f6 100644 --- a/tools/testing/selftests/ftrace/test.d/template +++ b/tools/testing/selftests/ftrace/test.d/template @@ -5,6 +5,7 @@ # The required tracer needs :tracer suffix, e.g. function:tracer # The required README string needs :README suffix, e.g. "x8/16/32/64":README # and the README string is treated as a fixed-string instead of regexp pattern. +# The required debugfs interface needs :debugfs suffix, e.g. kprobes/list:debugfs # you have to add ".tc" extention for your testcase file # Note that all tests are run with "errexit" option. -- 2.43.0