From patchwork Tue Jun 4 15:37:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 13685586 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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 2C78113D501 for ; Tue, 4 Jun 2024 15:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717515480; cv=none; b=ljE60PcVny13mHqfmGhSQZ6C22gb1uC9lJx/VwPaigOcDF9WGJiiR5mPNRuEW/sYYn2QuGKTMECrDZKm8oaUPoAy+XnDaQ/rCCUUmE5HL7CnPU179dQj0dYnp+3D5VEQFl5BFFZZOQ/kVyj6gLme1yBRemrtKavviPZOOS0ZEUQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717515480; c=relaxed/simple; bh=yufnEfjGW3HHBVtqyVbl8i0X8WGcbqJ5OlJiTm6LOAg=; h=Content-Type:Message-ID:Date:MIME-Version:To:Cc:From:Subject; b=SH7ky+xCBGz67LBsNn5bA7Q7ZBAPLteuVjhdIh3fkwHWBw/ntgyw9CHc6zFOENNFaxbd3I1pFjul9qdeWrK/vc+Cj3IEEXDeQLlR4rAKHZlJBaXYRRcAZ8whJ4jUTHVfxslxSxtRAZQD2m14u1P/e5ga8Y9cSoFUESQw+wL5sL4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Xgk0dV5L; arc=none smtp.client-ip=209.85.166.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Xgk0dV5L" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-36da9b73a54so2063035ab.1 for ; Tue, 04 Jun 2024 08:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1717515477; x=1718120277; darn=vger.kernel.org; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=j8BS3K41v6vgBbioXVVAOSNpMUGdv3zQtA0n00+8Wuw=; b=Xgk0dV5Lh4zENT8dVh8W0gmNx1zrA/zQgAQtuwc8ZJycCPyNJJ+stBrPWMSNsa4F4A AScl/DUPA2V/dd5ND9jJqbVJdfM7vhk4i0RbaiJhMpE6DcH589PWA1e/h9L72kjNV09k PRhu/FZQpmPJ0V+fsXO4OVzdOT1NH1KVlbqlc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717515477; x=1718120277; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=j8BS3K41v6vgBbioXVVAOSNpMUGdv3zQtA0n00+8Wuw=; b=hGGT7imIxgDpGDvE6XUCPEJOTLh0xpwb/XDCaRvwEQDWdmVvcAHYM8ih7RqtMxwJTh 98RSb/15oPbTjRwUS31a2T2I95rSlPVlhUaOan7uggHrRPt5SepVRpG1w2AWHZZyTvvC T9TKanQ6gGqLdSwtlelWKpi0rm2BarFYHspXO/XGEUH/WXvhRDlQN7YIyn4E0oikN5/S dzMzy4ANbq4/m1/IuuKH24N+N/IW2lHh8d9IwY3NDUvGUKiIJlfXHG4+vX9GFtIB3Imf KUNop5GQul20MowhNFta+HO35JupKGDtduFhi2bpFg2QQyF/cxPB2cwifUroADW2Xube EOoQ== X-Forwarded-Encrypted: i=1; AJvYcCXljm8ILJByP4DHB07By+EQrEz6vkLCx7Zt+ricA9fKrwlewiCNhYgWDDNhmu50bf0Jd7jOuGgKylYlfZF4SlW4wx5g0heq+1aoEYbAInXd X-Gm-Message-State: AOJu0YwFoE6Ws86qksa9PXeLPn+OzOUXQu2EAByPg5IlpsHUIjzDFelm J6nQPrLsMr0BJykRioRKHIinNrARkPEq7vxUChN4alm4qxSFrLloSQzJDNL6HZc= X-Google-Smtp-Source: AGHT+IHNEGfTxEHa76QD6xzIQ1Rm3YwNHHZnaTi0tPzC2d4j5y9r/vzRHiEKoKMe6zTKqrFX3vL09A== X-Received: by 2002:a92:ca4d:0:b0:374:99fc:c83a with SMTP id e9e14a558f8ab-374a94fe190mr28608815ab.3.1717515477060; Tue, 04 Jun 2024 08:37:57 -0700 (PDT) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3748a1dda21sm22215475ab.3.2024.06.04.08.37.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jun 2024 08:37:56 -0700 (PDT) Message-ID: Date: Tue, 4 Jun 2024 09:37:55 -0600 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Linus Torvalds Cc: shuah , Shuah Khan , Michael Ellerman , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org From: Shuah Khan Subject: [GIT PULL] Kselftest fixes for Linux 6.10-rc3 Hi Linus, Please pull this urgent kselftest fixes update for Linux 6.10-rc3. This kselftest fixes update consists of fixes to build warnings in several tests and fixes to ftrace tests. diff for pull request is attached. thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0: Linux 6.10-rc1 (2024-05-26 15:20:12 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-fixes-6.10-rc3 for you to fetch changes up to 4bf15b1c657d22d1d70173e43264e4606dfe75ff: selftests/futex: don't pass a const char* to asprintf(3) (2024-05-31 14:37:10 -0600) ---------------------------------------------------------------- linux_kselftest-fixes-6.10-rc3 This kselftest fixes update consists of fixes to build warnings in several tests and fixes to ftrace tests. ---------------------------------------------------------------- John Hubbard (3): selftests/futex: pass _GNU_SOURCE without a value to the compiler selftests/futex: don't redefine .PHONY targets (all, clean) selftests/futex: don't pass a const char* to asprintf(3) Mark Brown (1): kselftest/alsa: Ensure _GNU_SOURCE is defined Masami Hiramatsu (Google) (3): selftests/ftrace: Fix to check required event file selftests/ftrace: Update required config selftests/tracing: Fix event filter test to retry up to 10 times Michael Ellerman (3): selftests: cachestat: Fix build warnings on ppc64 selftests/openat2: Fix build warnings on ppc64 selftests/overlayfs: Fix build error on ppc64 Steven Rostedt (Google) (1): tracing/selftests: Fix kprobe event name test for .isra. functions tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/cachestat/test_cachestat.c | 1 + .../selftests/filesystems/overlayfs/dev_in_maps.c | 1 + tools/testing/selftests/ftrace/config | 26 ++++++++++++++++------ .../ftrace/test.d/dynevent/test_duplicates.tc | 2 +- .../ftrace/test.d/filter/event-filter-function.tc | 20 ++++++++++++++++- .../ftrace/test.d/kprobe/kprobe_eventname.tc | 3 ++- tools/testing/selftests/futex/Makefile | 2 -- tools/testing/selftests/futex/functional/Makefile | 2 +- .../selftests/futex/functional/futex_requeue_pi.c | 2 +- tools/testing/selftests/openat2/openat2_test.c | 1 + 11 files changed, 47 insertions(+), 15 deletions(-) ---------------------------------------------------------------- diff --git a/tools/testing/selftests/alsa/Makefile b/tools/testing/selftests/alsa/Makefile index 5af9ba8a4645..c1ce39874e2b 100644 --- a/tools/testing/selftests/alsa/Makefile +++ b/tools/testing/selftests/alsa/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 # -CFLAGS += $(shell pkg-config --cflags alsa) +CFLAGS += $(shell pkg-config --cflags alsa) $(KHDR_INCLUDES) LDLIBS += $(shell pkg-config --libs alsa) ifeq ($(LDLIBS),) LDLIBS += -lasound diff --git a/tools/testing/selftests/cachestat/test_cachestat.c b/tools/testing/selftests/cachestat/test_cachestat.c index b171fd53b004..632ab44737ec 100644 --- a/tools/testing/selftests/cachestat/test_cachestat.c +++ b/tools/testing/selftests/cachestat/test_cachestat.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE +#define __SANE_USERSPACE_TYPES__ // Use ll64 #include #include diff --git a/tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c b/tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c index 759f86e7d263..2862aae58b79 100644 --- a/tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c +++ b/tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE +#define __SANE_USERSPACE_TYPES__ // Use ll64 #include #include diff --git a/tools/testing/selftests/ftrace/config b/tools/testing/selftests/ftrace/config index e59d985eeff0..048a312abf40 100644 --- a/tools/testing/selftests/ftrace/config +++ b/tools/testing/selftests/ftrace/config @@ -1,16 +1,28 @@ -CONFIG_KPROBES=y +CONFIG_BPF_SYSCALL=y +CONFIG_DEBUG_INFO_BTF=y +CONFIG_DEBUG_INFO_DWARF4=y +CONFIG_EPROBE_EVENTS=y +CONFIG_FPROBE=y +CONFIG_FPROBE_EVENTS=y CONFIG_FTRACE=y +CONFIG_FTRACE_SYSCALLS=y +CONFIG_FUNCTION_GRAPH_RETVAL=y CONFIG_FUNCTION_PROFILER=y -CONFIG_TRACER_SNAPSHOT=y -CONFIG_STACK_TRACER=y CONFIG_HIST_TRIGGERS=y -CONFIG_SCHED_TRACER=y -CONFIG_PREEMPT_TRACER=y CONFIG_IRQSOFF_TRACER=y -CONFIG_PREEMPTIRQ_DELAY_TEST=m +CONFIG_KALLSYMS_ALL=y +CONFIG_KPROBES=y +CONFIG_KPROBE_EVENTS=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y +CONFIG_PREEMPTIRQ_DELAY_TEST=m +CONFIG_PREEMPT_TRACER=y +CONFIG_PROBE_EVENTS_BTF_ARGS=y CONFIG_SAMPLES=y CONFIG_SAMPLE_FTRACE_DIRECT=m CONFIG_SAMPLE_TRACE_PRINTK=m -CONFIG_KALLSYMS_ALL=y +CONFIG_SCHED_TRACER=y +CONFIG_STACK_TRACER=y +CONFIG_TRACER_SNAPSHOT=y +CONFIG_UPROBES=y +CONFIG_UPROBE_EVENTS=y diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc b/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc index d3a79da215c8..5f72abe6fa79 100644 --- a/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc +++ b/tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # description: Generic dynamic event - check if duplicate events are caught -# requires: dynamic_events "e[:[/][]] . []":README +# requires: dynamic_events "e[:[/][]] . []":README events/syscalls/sys_enter_openat echo 0 > events/enable diff --git a/tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc b/tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc index 3f74c09c56b6..118247b8dd84 100644 --- a/tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc +++ b/tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc @@ -10,7 +10,6 @@ fail() { #msg } sample_events() { - echo > trace echo 1 > events/kmem/kmem_cache_free/enable echo 1 > tracing_on ls > /dev/null @@ -22,6 +21,7 @@ echo 0 > tracing_on echo 0 > events/enable echo "Get the most frequently calling function" +echo > trace sample_events target_func=`cat trace | grep -o 'call_site=\([^+]*\)' | sed 's/call_site=//' | sort | uniq -c | sort | tail -n 1 | sed 's/^[ 0-9]*//'` @@ -32,7 +32,16 @@ echo > trace echo "Test event filter function name" echo "call_site.function == $target_func" > events/kmem/kmem_cache_free/filter + +sample_events +max_retry=10 +while [ `grep kmem_cache_free trace| wc -l` -eq 0 ]; do sample_events +max_retry=$((max_retry - 1)) +if [ $max_retry -eq 0 ]; then + exit_fail +fi +done hitcnt=`grep kmem_cache_free trace| grep $target_func | wc -l` misscnt=`grep kmem_cache_free trace| grep -v $target_func | wc -l` @@ -49,7 +58,16 @@ address=`grep " ${target_func}\$" /proc/kallsyms | cut -d' ' -f1` echo "Test event filter function address" echo "call_site.function == 0x$address" > events/kmem/kmem_cache_free/filter +echo > trace +sample_events +max_retry=10 +while [ `grep kmem_cache_free trace| wc -l` -eq 0 ]; do sample_events +max_retry=$((max_retry - 1)) +if [ $max_retry -eq 0 ]; then + exit_fail +fi +done hitcnt=`grep kmem_cache_free trace| grep $target_func | wc -l` misscnt=`grep kmem_cache_free trace| grep -v $target_func | wc -l` diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc index 1f6981ef7afa..ba19b81cef39 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc @@ -30,7 +30,8 @@ find_dot_func() { fi grep " [tT] .*\.isra\..*" /proc/kallsyms | cut -f 3 -d " " | while read f; do - if grep -s $f available_filter_functions; then + cnt=`grep -s $f available_filter_functions | wc -l`; + if [ $cnt -eq 1 ]; then echo $f break fi diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile index 11e157d7533b..78ab2cd111f6 100644 --- a/tools/testing/selftests/futex/Makefile +++ b/tools/testing/selftests/futex/Makefile @@ -3,8 +3,6 @@ SUBDIRS := functional TEST_PROGS := run.sh -.PHONY: all clean - include ../lib.mk all: diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile index a392d0917b4e..994fa3468f17 100644 --- a/tools/testing/selftests/futex/functional/Makefile +++ b/tools/testing/selftests/futex/functional/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) -CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) +CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE= -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt LOCAL_HDRS := \ diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c index 7f3ca5c78df1..215c6cb539b4 100644 --- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c +++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c @@ -360,7 +360,7 @@ int unit_test(int broadcast, long lock, int third_party_owner, long timeout_ns) int main(int argc, char *argv[]) { - const char *test_name; + char *test_name; int c, ret; while ((c = getopt(argc, argv, "bchlot:v:")) != -1) { diff --git a/tools/testing/selftests/openat2/openat2_test.c b/tools/testing/selftests/openat2/openat2_test.c index 9024754530b2..5790ab446527 100644 --- a/tools/testing/selftests/openat2/openat2_test.c +++ b/tools/testing/selftests/openat2/openat2_test.c @@ -5,6 +5,7 @@ */ #define _GNU_SOURCE +#define __SANE_USERSPACE_TYPES__ // Use ll64 #include #include #include