Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 32f88d6

Browse files
committed
Merge tag 'linux_kselftest-fixes-6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kselftest fixes from Shuah Khan: "Fixes to build warnings in several tests and fixes to ftrace tests" * tag 'linux_kselftest-fixes-6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/futex: don't pass a const char* to asprintf(3) selftests/futex: don't redefine .PHONY targets (all, clean) selftests/tracing: Fix event filter test to retry up to 10 times selftests/futex: pass _GNU_SOURCE without a value to the compiler selftests/overlayfs: Fix build error on ppc64 selftests/openat2: Fix build warnings on ppc64 selftests: cachestat: Fix build warnings on ppc64 tracing/selftests: Fix kprobe event name test for .isra. functions selftests/ftrace: Update required config selftests/ftrace: Fix to check required event file kselftest/alsa: Ensure _GNU_SOURCE is defined
2 parents 2ab7951 + 4bf15b1 commit 32f88d6

File tree

11 files changed

+47
-15
lines changed

11 files changed

+47
-15
lines changed

tools/testing/selftests/alsa/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
#
33

4-
CFLAGS += $(shell pkg-config --cflags alsa)
4+
CFLAGS += $(shell pkg-config --cflags alsa) $(KHDR_INCLUDES)
55
LDLIBS += $(shell pkg-config --libs alsa)
66
ifeq ($(LDLIBS),)
77
LDLIBS += -lasound

tools/testing/selftests/cachestat/test_cachestat.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#define _GNU_SOURCE
3+
#define __SANE_USERSPACE_TYPES__ // Use ll64
34

45
#include <stdio.h>
56
#include <stdbool.h>

tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#define _GNU_SOURCE
3+
#define __SANE_USERSPACE_TYPES__ // Use ll64
34

45
#include <inttypes.h>
56
#include <unistd.h>

tools/testing/selftests/ftrace/config

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
CONFIG_KPROBES=y
1+
CONFIG_BPF_SYSCALL=y
2+
CONFIG_DEBUG_INFO_BTF=y
3+
CONFIG_DEBUG_INFO_DWARF4=y
4+
CONFIG_EPROBE_EVENTS=y
5+
CONFIG_FPROBE=y
6+
CONFIG_FPROBE_EVENTS=y
27
CONFIG_FTRACE=y
8+
CONFIG_FTRACE_SYSCALLS=y
9+
CONFIG_FUNCTION_GRAPH_RETVAL=y
310
CONFIG_FUNCTION_PROFILER=y
4-
CONFIG_TRACER_SNAPSHOT=y
5-
CONFIG_STACK_TRACER=y
611
CONFIG_HIST_TRIGGERS=y
7-
CONFIG_SCHED_TRACER=y
8-
CONFIG_PREEMPT_TRACER=y
912
CONFIG_IRQSOFF_TRACER=y
10-
CONFIG_PREEMPTIRQ_DELAY_TEST=m
13+
CONFIG_KALLSYMS_ALL=y
14+
CONFIG_KPROBES=y
15+
CONFIG_KPROBE_EVENTS=y
1116
CONFIG_MODULES=y
1217
CONFIG_MODULE_UNLOAD=y
18+
CONFIG_PREEMPTIRQ_DELAY_TEST=m
19+
CONFIG_PREEMPT_TRACER=y
20+
CONFIG_PROBE_EVENTS_BTF_ARGS=y
1321
CONFIG_SAMPLES=y
1422
CONFIG_SAMPLE_FTRACE_DIRECT=m
1523
CONFIG_SAMPLE_TRACE_PRINTK=m
16-
CONFIG_KALLSYMS_ALL=y
24+
CONFIG_SCHED_TRACER=y
25+
CONFIG_STACK_TRACER=y
26+
CONFIG_TRACER_SNAPSHOT=y
27+
CONFIG_UPROBES=y
28+
CONFIG_UPROBE_EVENTS=y

tools/testing/selftests/ftrace/test.d/dynevent/test_duplicates.tc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
# SPDX-License-Identifier: GPL-2.0
33
# description: Generic dynamic event - check if duplicate events are caught
4-
# requires: dynamic_events "e[:[<group>/][<event>]] <attached-group>.<attached-event> [<args>]":README
4+
# requires: dynamic_events "e[:[<group>/][<event>]] <attached-group>.<attached-event> [<args>]":README events/syscalls/sys_enter_openat
55

66
echo 0 > events/enable
77

tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ fail() { #msg
1010
}
1111

1212
sample_events() {
13-
echo > trace
1413
echo 1 > events/kmem/kmem_cache_free/enable
1514
echo 1 > tracing_on
1615
ls > /dev/null
@@ -22,6 +21,7 @@ echo 0 > tracing_on
2221
echo 0 > events/enable
2322

2423
echo "Get the most frequently calling function"
24+
echo > trace
2525
sample_events
2626

2727
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
3232

3333
echo "Test event filter function name"
3434
echo "call_site.function == $target_func" > events/kmem/kmem_cache_free/filter
35+
36+
sample_events
37+
max_retry=10
38+
while [ `grep kmem_cache_free trace| wc -l` -eq 0 ]; do
3539
sample_events
40+
max_retry=$((max_retry - 1))
41+
if [ $max_retry -eq 0 ]; then
42+
exit_fail
43+
fi
44+
done
3645

3746
hitcnt=`grep kmem_cache_free trace| grep $target_func | wc -l`
3847
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`
4958

5059
echo "Test event filter function address"
5160
echo "call_site.function == 0x$address" > events/kmem/kmem_cache_free/filter
61+
echo > trace
62+
sample_events
63+
max_retry=10
64+
while [ `grep kmem_cache_free trace| wc -l` -eq 0 ]; do
5265
sample_events
66+
max_retry=$((max_retry - 1))
67+
if [ $max_retry -eq 0 ]; then
68+
exit_fail
69+
fi
70+
done
5371

5472
hitcnt=`grep kmem_cache_free trace| grep $target_func | wc -l`
5573
misscnt=`grep kmem_cache_free trace| grep -v $target_func | wc -l`

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ find_dot_func() {
3030
fi
3131

3232
grep " [tT] .*\.isra\..*" /proc/kallsyms | cut -f 3 -d " " | while read f; do
33-
if grep -s $f available_filter_functions; then
33+
cnt=`grep -s $f available_filter_functions | wc -l`;
34+
if [ $cnt -eq 1 ]; then
3435
echo $f
3536
break
3637
fi

tools/testing/selftests/futex/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ SUBDIRS := functional
33

44
TEST_PROGS := run.sh
55

6-
.PHONY: all clean
7-
86
include ../lib.mk
97

108
all:

tools/testing/selftests/futex/functional/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
INCLUDES := -I../include -I../../ $(KHDR_INCLUDES)
3-
CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES)
3+
CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE= -pthread $(INCLUDES) $(KHDR_INCLUDES)
44
LDLIBS := -lpthread -lrt
55

66
LOCAL_HDRS := \

tools/testing/selftests/futex/functional/futex_requeue_pi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ int unit_test(int broadcast, long lock, int third_party_owner, long timeout_ns)
360360

361361
int main(int argc, char *argv[])
362362
{
363-
const char *test_name;
363+
char *test_name;
364364
int c, ret;
365365

366366
while ((c = getopt(argc, argv, "bchlot:v:")) != -1) {

0 commit comments

Comments
 (0)