projects/linux·commit 4541fec3

Merge tag 'linux-kselftest-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

4541fec3 · Linus Torvalds <[email protected]> · 2015-04-13 08:59:21 -07:00

Pull kselftest updates from Shuah Khan:
 "This is a milestone update in a sense.  Several new tests and install
  and packaging support is added in this update.

  This update adds install and packaging tools developed on top of
  back-end shared logic enhancemnets to run and install tests.  In
  addition several timer tests are added.

   - New timer tests from John Stultz

   - rtc test from Prarit Bhargava

   - Enhancements to un and install tests from Michael Ellerman

   - Install and packaging tools from Shuah Khan

   - Cross-compilation enablement from Tyler Baker

   - A couple of bug fixes"

* tag 'linux-kselftest-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (42 commits)
  ftracetest: Do not use usleep directly
  selftest/mqueue: enable cross compilation
  selftest/ipc: enable cross compilation
  selftest/memfd: include default header install path
  selftest/mount: enable cross compilation
  selftest/memfd: enable cross compilation
  kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM
  selftests: Change memory on-off-test.sh name to be unique
  selftests: change cpu on-off-test.sh name to be unique
  selftests/mount: Make git ignore all binaries in mount test suite
  kselftests: timers: Reduce default runtime on inconsistency-check and set-timer-lat
  ftracetest: Convert exit -1 to exit $FAIL
  ftracetest: Cope properly with stack tracer not being enabled
  tools, update rtctest.c to verify passage of time
  Documentation, split up rtc.txt into documentation and test file
  selftests: Add tool to generate kselftest tar archive
  selftests: Add kselftest install tool
  selftests: Set CC using CROSS_COMPILE once in lib.mk
  selftests: Add install support for the powerpc tests
  selftests/timers: Use shared logic to run and install tests
  ...
Commit
4541fec3104bef0c60633f9e180be94ea5ccc2b7
Parents
39a88044 · 2bfd4d1f

Merge commit. Changes below are compared with the first parent: 39a88044.

Changes

69 files changed · +3366 −459

FileStatusAddDelContent
Documentation/rtc.txtmodified+1−263View file
MAINTAINERSmodified+1−0View file
tools/testing/selftests/Makefilemodified+33−0View file
tools/testing/selftests/breakpoints/Makefilemodified+3−2View file
tools/testing/selftests/cpu-hotplug/Makefilemodified+4−3View file
tools/testing/selftests/cpu-hotplug/on-off-test.sh → tools/testing/selftests/cpu-hotplug/cpu-on-off-test.shrenamed+0−0View file
tools/testing/selftests/efivarfs/Makefilemodified+4−3View file
tools/testing/selftests/efivarfs/efivarfs.shmodified+0−0View file
tools/testing/selftests/exec/Makefilemodified+6−3View file
tools/testing/selftests/firmware/Makefilemodified+2−18View file
tools/testing/selftests/firmware/fw_filesystem.shmodified+0−0View file
tools/testing/selftests/firmware/fw_userhelper.shmodified+0−0View file
tools/testing/selftests/ftrace/Makefilemodified+3−2View file
tools/testing/selftests/ftrace/test.d/00basic/basic4.tcmodified+1−1View file
tools/testing/selftests/ftrace/test.d/event/event-enable.tcmodified+11−4View file
tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tcmodified+11−4View file
tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tcmodified+14−1View file
tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tcmodified+4−2View file
tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tcmodified+1−1View file
tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tcmodified+1−1View file
tools/testing/selftests/gen_kselftest_tar.shadded+55−0View file
tools/testing/selftests/ipc/Makefilemodified+4−7View file
tools/testing/selftests/kcmp/Makefilemodified+3−3View file
tools/testing/selftests/kselftest_install.shadded+37−0View file
tools/testing/selftests/lib.mkadded+35−0View file
tools/testing/selftests/memfd/Makefilemodified+8−6View file
tools/testing/selftests/memory-hotplug/Makefilemodified+6−3View file
tools/testing/selftests/memory-hotplug/on-off-test.sh → tools/testing/selftests/memory-hotplug/mem-on-off-test.shrenamed+0−0View file
tools/testing/selftests/mount/.gitignoreadded+1−0View file
tools/testing/selftests/mount/Makefilemodified+7−8View file
tools/testing/selftests/mqueue/Makefilemodified+17−5View file
tools/testing/selftests/net/Makefilemodified+5−5View file
tools/testing/selftests/net/run_afpackettestsmodified+0−0View file
tools/testing/selftests/net/run_netsocktestsmodified+0−0View file
tools/testing/selftests/powerpc/Makefilemodified+18−4View file
tools/testing/selftests/powerpc/copyloops/Makefilemodified+5−10View file
tools/testing/selftests/powerpc/mm/Makefilemodified+5−10View file
tools/testing/selftests/powerpc/pmu/Makefilemodified+26−22View file
tools/testing/selftests/powerpc/pmu/ebb/Makefilemodified+5−8View file
tools/testing/selftests/powerpc/primitives/Makefilemodified+5−10View file
tools/testing/selftests/powerpc/stringloops/Makefilemodified+5−10View file
tools/testing/selftests/powerpc/tm/Makefilemodified+5−10View file
tools/testing/selftests/ptrace/Makefilemodified+3−2View file
tools/testing/selftests/size/Makefilemodified+3−4View file
tools/testing/selftests/sysctl/Makefilemodified+3−9View file
tools/testing/selftests/sysctl/run_numerictestsmodified+0−0View file
tools/testing/selftests/sysctl/run_stringtestsmodified+0−0View file
tools/testing/selftests/timers/Makefilemodified+33−5View file
tools/testing/selftests/timers/alarmtimer-suspend.cadded+185−0View file
tools/testing/selftests/timers/change_skew.cadded+107−0View file
tools/testing/selftests/timers/clocksource-switch.cadded+179−0View file
tools/testing/selftests/timers/inconsistency-check.cadded+204−0View file
tools/testing/selftests/timers/leap-a-day.cadded+319−0View file
tools/testing/selftests/timers/leapcrash.cadded+120−0View file
tools/testing/selftests/timers/mqueue-lat.cadded+124−0View file
tools/testing/selftests/timers/nanosleep.cadded+174−0View file
tools/testing/selftests/timers/nsleep-lat.cadded+190−0View file
tools/testing/selftests/timers/posix_timers.cmodified+4−5View file
tools/testing/selftests/timers/raw_skew.cadded+154−0View file
tools/testing/selftests/timers/rtctest.cadded+271−0View file
tools/testing/selftests/timers/set-2038.cadded+144−0View file
tools/testing/selftests/timers/set-tai.cadded+79−0View file
tools/testing/selftests/timers/set-timer-lat.cadded+216−0View file
tools/testing/selftests/timers/skew_consistency.cadded+89−0View file
tools/testing/selftests/timers/threadtest.cadded+204−0View file
tools/testing/selftests/timers/valid-adjtimex.cadded+202−0View file
tools/testing/selftests/user/Makefilemodified+3−2View file
tools/testing/selftests/vm/Makefilemodified+4−3View file
tools/testing/selftests/vm/run_vmtestsmodified+0−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/rtc.txt

View file
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt
index 596b60c..8446f1e 100644
--- a/Documentation/rtc.txt
+++ b/Documentation/rtc.txt
@@ -204,266 +204,4 @@ Some common examples:
* RTC_PIE_ON, RTC_PIE_OFF: These are also emulated by the generic code.
-If all else fails, check out the rtc-test.c driver!
-
-
--------------------- 8< ---------------- 8< -----------------------------
-
-/*
- * Real Time Clock Driver Test/Example Program
- *
- * Compile with:
- * gcc -s -Wall -Wstrict-prototypes rtctest.c -o rtctest
- *
- * Copyright (C) 1996, Paul Gortmaker.
- *
- * Released under the GNU General Public License, version 2,
- * included herein by reference.
- *
- */
-
-#include <stdio.h>
-#include <linux/rtc.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-
-
-/*
- * This expects the new RTC class driver framework, working with
- * clocks that will often not be clones of what the PC-AT had.
- * Use the command line to specify another RTC if you need one.
- */
-static const char default_rtc[] = "/dev/rtc0";
-
-
-int main(int argc, char **argv)
-{
- int i, fd, retval, irqcount = 0;
- unsigned long tmp, data;
- struct rtc_time rtc_tm;
- const char *rtc = default_rtc;
-
- switch (argc) {
- case 2:
- rtc = argv[1];
- /* FALLTHROUGH */
- case 1:
- break;
- default:
- fprintf(stderr, "usage: rtctest [rtcdev]\n");
- return 1;
- }
-
- fd = open(rtc, O_RDONLY);
-
- if (fd == -1) {
- perror(rtc);
- exit(errno);
- }
-
- fprintf(stderr, "\n\t\t\tRTC Driver Test Example.\n\n");
-
- /* Turn on update interrupts (one per second) */
- retval = ioctl(fd, RTC_UIE_ON, 0);
- if (retval == -1) {
- if (errno == ENOTTY) {
- fprintf(stderr,
- "\n...Update IRQs not supported.\n");
- goto test_READ;
- }
- perror("RTC_UIE_ON ioctl");
- exit(errno);
- }
-
- fprintf(stderr, "Counting 5 update (1/sec) interrupts from reading %s:",
- rtc);
- fflush(stderr);
- for (i=1; i<6; i++) {
- /* This read will block */
- retval = read(fd, &data, sizeof(unsigned long));
- if (retval == -1) {
- perror("read");
- exit(errno);
- }
- fprintf(stderr, " %d",i);
- fflush(stderr);
- irqcount++;
- }
-
- fprintf(stderr, "\nAgain, from using select(2) on /dev/rtc:");
- fflush(stderr);
- for (i=1; i<6; i++) {
- struct timeval tv = {5, 0}; /* 5 second timeout on select */
- fd_set readfds;
-
- FD_ZERO(&readfds);
- FD_SET(fd, &readfds);
- /* The select will wait until an RTC interrupt happens. */
- retval = select(fd+1, &readfds, NULL, NULL, &tv);
- if (retval == -1) {
- perror("select");
- exit(errno);
- }
- /* This read won't block unlike the select-less case above. */
- retval = read(fd, &data, sizeof(unsigned long));
- if (retval == -1) {
- perror("read");
- exit(errno);
- }
- fprintf(stderr, " %d",i);
- fflush(stderr);
- irqcount++;
- }
-
- /* Turn off update interrupts */
- retval = ioctl(fd, RTC_UIE_OFF, 0);
- if (retval == -1) {
- perror("RTC_UIE_OFF ioctl");
- exit(errno);
- }
-
-test_READ:
- /* Read the RTC time/date */
- retval = ioctl(fd, RTC_RD_TIME, &rtc_tm);
- if (retval == -1) {
- perror("RTC_RD_TIME ioctl");
- exit(errno);
- }
-
- fprintf(stderr, "\n\nCurrent RTC date/time is %d-%d-%d, %02d:%02d:%02d.\n",
- rtc_tm.tm_mday, rtc_tm.tm_mon + 1, rtc_tm.tm_year + 1900,
- rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
-
- /* Set the alarm to 5 sec in the future, and check for rollover */
- rtc_tm.tm_sec += 5;
- if (rtc_tm.tm_sec >= 60) {
- rtc_tm.tm_sec %= 60;
- rtc_tm.tm_min++;
- }
- if (rtc_tm.tm_min == 60) {
- rtc_tm.tm_min = 0;
- rtc_tm.tm_hour++;
- }
- if (rtc_tm.tm_hour == 24)
- rtc_tm.tm_hour = 0;
-
- retval = ioctl(fd, RTC_ALM_SET, &rtc_tm);
- if (retval == -1) {
- if (errno == ENOTTY) {
- fprintf(stderr,
- "\n...Alarm IRQs not supported.\n");
- goto test_PIE;
- }
- perror("RTC_ALM_SET ioctl");
- exit(errno);
- }
-
- /* Read the current alarm settings */
- retval = ioctl(fd, RTC_ALM_READ, &rtc_tm);
- if (retval == -1) {
- perror("RTC_ALM_READ ioctl");
- exit(errno);
- }
-
- fprintf(stderr, "Alarm time now set to %02d:%02d:%02d.\n",
- rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
-
- /* Enable alarm interrupts */
- retval = ioctl(fd, RTC_AIE_ON, 0);
- if (retval == -1) {
- perror("RTC_AIE_ON ioctl");
- exit(errno);
- }
-
- fprintf(stderr, "Waiting 5 seconds for alarm...");
- fflush(stderr);
- /* This blocks until the alarm ring causes an interrupt */
- retval = read(fd, &data, sizeof(unsigned long));
- if (retval == -1) {
- perror("read");
- exit(errno);
- }
- irqcount++;
- fprintf(stderr, " okay. Alarm rang.\n");
-
- /* Disable alarm interrupts */
- retval = ioctl(fd, RTC_AIE_OFF, 0);
- if (retval == -1) {
- perror("RTC_AIE_OFF ioctl");
- exit(errno);
- }
-
-test_PIE:
- /* Read periodic IRQ rate */
- retval = ioctl(fd, RTC_IRQP_READ, &tmp);
- if (retval == -1) {
- /* not all RTCs support periodic IRQs */
- if (errno == ENOTTY) {
- fprintf(stderr, "\nNo periodic IRQ support\n");
- goto done;
- }
- perror("RTC_IRQP_READ ioctl");
- exit(errno);
- }
- fprintf(stderr, "\nPeriodic IRQ rate is %ldHz.\n", tmp);
-
- fprintf(stderr, "Counting 20 interrupts at:");
- fflush(stderr);
-
- /* The frequencies 128Hz, 256Hz, ... 8192Hz are only allowed for root. */
- for (tmp=2; tmp<=64; tmp*=2) {
-
- retval = ioctl(fd, RTC_IRQP_SET, tmp);
- if (retval == -1) {
- /* not all RTCs can change their periodic IRQ rate */
- if (errno == ENOTTY) {
- fprintf(stderr,
- "\n...Periodic IRQ rate is fixed\n");
- goto done;
- }
- perror("RTC_IRQP_SET ioctl");
- exit(errno);
- }
-
- fprintf(stderr, "\n%ldHz:\t", tmp);
- fflush(stderr);
-
- /* Enable periodic interrupts */
- retval = ioctl(fd, RTC_PIE_ON, 0);
- if (retval == -1) {
- perror("RTC_PIE_ON ioctl");
- exit(errno);
- }
-
- for (i=1; i<21; i++) {
- /* This blocks */
- retval = read(fd, &data, sizeof(unsigned long));
- if (retval == -1) {
- perror("read");
- exit(errno);
- }
- fprintf(stderr, " %d",i);
- fflush(stderr);
- irqcount++;
- }
-
- /* Disable periodic interrupts */
- retval = ioctl(fd, RTC_PIE_OFF, 0);
- if (retval == -1) {
- perror("RTC_PIE_OFF ioctl");
- exit(errno);
- }
- }
-
-done:
- fprintf(stderr, "\n\n\t\t\t *** Test complete ***\n");
-
- close(fd);
-
- return 0;
-}
+If all else fails, check out the tools/testing/selftests/timers/rtctest.c test!

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index efbcb50..e8bdf1b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8559,6 +8559,7 @@ F: include/uapi/linux/timex.h
F: kernel/time/clocksource.c
F: kernel/time/time*.c
F: kernel/time/ntp.c
+F: tools/testing/selftests/timers/
SC1200 WDT DRIVER
M: Zwane Mwaikambo <[email protected]>

tools/testing/selftests/Makefile

View file
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 0db5713..d643d52 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -55,7 +55,40 @@ clean_hotplug:
make -C $$TARGET clean; \
done;
+INSTALL_PATH ?= install
+INSTALL_PATH := $(abspath $(INSTALL_PATH))
+ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
+
+install:
+ifdef INSTALL_PATH
+ @# Ask all targets to install their files
+ mkdir -p $(INSTALL_PATH)
+ for TARGET in $(TARGETS); do \
+ mkdir -p $(INSTALL_PATH)/$$TARGET ; \
+ make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
+ done;
+
+ @# Ask all targets to emit their test scripts
+ echo "#!/bin/bash" > $(ALL_SCRIPT)
+ echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
+ echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
+
+ for TARGET in $(TARGETS); do \
+ echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
+ echo "echo ========================================" >> $(ALL_SCRIPT); \
+ echo "cd $$TARGET" >> $(ALL_SCRIPT); \
+ make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
+ echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
+ done;
+
+ chmod u+x $(ALL_SCRIPT)
+else
+ $(error Error: set INSTALL_PATH to use install)
+endif
+
clean:
for TARGET in $(TARGETS); do \
make -C $$TARGET clean; \
done;
+
+.PHONY: install

tools/testing/selftests/breakpoints/Makefile

View file
diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
index e18b42b..1822356 100644
--- a/tools/testing/selftests/breakpoints/Makefile
+++ b/tools/testing/selftests/breakpoints/Makefile
@@ -16,8 +16,9 @@ else
echo "Not an x86 target, can't build breakpoints selftests"
endif
-run_tests:
- @./breakpoint_test || echo "breakpoints selftests: [FAIL]"
+TEST_PROGS := breakpoint_test
+
+include ../lib.mk
clean:
rm -fr breakpoint_test

tools/testing/selftests/cpu-hotplug/Makefile

View file
diff --git a/tools/testing/selftests/cpu-hotplug/Makefile b/tools/testing/selftests/cpu-hotplug/Makefile
index e9c28d8..fe1f991 100644
--- a/tools/testing/selftests/cpu-hotplug/Makefile
+++ b/tools/testing/selftests/cpu-hotplug/Makefile
@@ -1,9 +1,10 @@
all:
-run_tests:
- @/bin/bash ./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]"
+TEST_PROGS := cpu-on-off-test.sh
+
+include ../lib.mk
run_full_test:
- @/bin/bash ./on-off-test.sh -a || echo "cpu-hotplug selftests: [FAIL]"
+ @/bin/bash ./cpu-on-off-test.sh -a || echo "cpu-hotplug selftests: [FAIL]"
clean:

tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh

View file
diff --git a/tools/testing/selftests/cpu-hotplug/on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
old mode 100644
new mode 100755
similarity index 100%
rename from tools/testing/selftests/cpu-hotplug/on-off-test.sh
rename to tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh

tools/testing/selftests/efivarfs/Makefile

View file
diff --git a/tools/testing/selftests/efivarfs/Makefile b/tools/testing/selftests/efivarfs/Makefile
index 29e8c6b..736c3dd 100644
--- a/tools/testing/selftests/efivarfs/Makefile
+++ b/tools/testing/selftests/efivarfs/Makefile
@@ -1,12 +1,13 @@
-CC = $(CROSS_COMPILE)gcc
CFLAGS = -Wall
test_objs = open-unlink create-read
all: $(test_objs)
-run_tests: all
- @/bin/bash ./efivarfs.sh || echo "efivarfs selftests: [FAIL]"
+TEST_PROGS := efivarfs.sh
+TEST_FILES := $(test_objs)
+
+include ../lib.mk
clean:
rm -f $(test_objs)

tools/testing/selftests/efivarfs/efivarfs.sh

View file
diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh
old mode 100644
new mode 100755

tools/testing/selftests/exec/Makefile

View file
diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile
index 66dfc2c..4edb7d0 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -1,4 +1,3 @@
-CC = $(CROSS_COMPILE)gcc
CFLAGS = -Wall
BINARIES = execveat
DEPS = execveat.symlink execveat.denatured script subdir
@@ -18,8 +17,12 @@ execveat.denatured: execveat
%: %.c
$(CC) $(CFLAGS) -o $@ $^
-run_tests: all
- ./execveat
+TEST_PROGS := execveat
+TEST_FILES := $(DEPS)
+
+include ../lib.mk
+
+override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
clean:
rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*

tools/testing/selftests/firmware/Makefile

View file
diff --git a/tools/testing/selftests/firmware/Makefile b/tools/testing/selftests/firmware/Makefile
index e23cce0..9bf8223 100644
--- a/tools/testing/selftests/firmware/Makefile
+++ b/tools/testing/selftests/firmware/Makefile
@@ -3,25 +3,9 @@
# No binaries, but make sure arg-less "make" doesn't trigger "run_tests"
all:
-fw_filesystem:
- @if /bin/sh ./fw_filesystem.sh ; then \
- echo "fw_filesystem: ok"; \
- else \
- echo "fw_filesystem: [FAIL]"; \
- exit 1; \
- fi
+TEST_PROGS := fw_filesystem.sh fw_userhelper.sh
-fw_userhelper:
- @if /bin/sh ./fw_userhelper.sh ; then \
- echo "fw_userhelper: ok"; \
- else \
- echo "fw_userhelper: [FAIL]"; \
- exit 1; \
- fi
-
-run_tests: all fw_filesystem fw_userhelper
+include ../lib.mk
# Nothing to clean up.
clean:
-
-.PHONY: all clean run_tests fw_filesystem fw_userhelper

tools/testing/selftests/firmware/fw_filesystem.sh

View file
diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
old mode 100644
new mode 100755

tools/testing/selftests/firmware/fw_userhelper.sh

View file
diff --git a/tools/testing/selftests/firmware/fw_userhelper.sh b/tools/testing/selftests/firmware/fw_userhelper.sh
old mode 100644
new mode 100755

tools/testing/selftests/ftrace/Makefile

View file
diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile
index 76cc9f1..3467206 100644
--- a/tools/testing/selftests/ftrace/Makefile
+++ b/tools/testing/selftests/ftrace/Makefile
@@ -1,7 +1,8 @@
all:
-run_tests:
- @/bin/sh ./ftracetest || echo "ftrace selftests: [FAIL]"
+TEST_PROGS := ftracetest
+
+include ../lib.mk
clean:
rm -rf logs/*

tools/testing/selftests/ftrace/test.d/00basic/basic4.tc

View file
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/basic4.tc b/tools/testing/selftests/ftrace/test.d/00basic/basic4.tc
index fd9c49a..aa51f6c 100644
--- a/tools/testing/selftests/ftrace/test.d/00basic/basic4.tc
+++ b/tools/testing/selftests/ftrace/test.d/00basic/basic4.tc
@@ -2,4 +2,4 @@
# description: Basic event tracing check
test -f available_events -a -f set_event -a -d events
# check scheduler events are available
-grep -q sched available_events && exit 0 || exit -1
\ No newline at end of file
+grep -q sched available_events && exit 0 || exit $FAIL

tools/testing/selftests/ftrace/test.d/event/event-enable.tc

View file
diff --git a/tools/testing/selftests/ftrace/test.d/event/event-enable.tc b/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
index 668616d..87eb9d6 100644
--- a/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
@@ -9,7 +9,11 @@ do_reset() {
fail() { #msg
do_reset
echo $1
- exit -1
+ exit $FAIL
+}
+
+yield() {
+ ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
}
if [ ! -f set_event -o ! -d events/sched ]; then
@@ -21,7 +25,8 @@ reset_tracer
do_reset
echo 'sched:sched_switch' > set_event
-usleep 1
+
+yield
count=`cat trace | grep sched_switch | wc -l`
if [ $count -eq 0 ]; then
@@ -31,7 +36,8 @@ fi
do_reset
echo 1 > events/sched/sched_switch/enable
-usleep 1
+
+yield
count=`cat trace | grep sched_switch | wc -l`
if [ $count -eq 0 ]; then
@@ -41,7 +47,8 @@ fi
do_reset
echo 0 > events/sched/sched_switch/enable
-usleep 1
+
+yield
count=`cat trace | grep sched_switch | wc -l`
if [ $count -ne 0 ]; then

tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc

View file
diff --git a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
index 655c415..ced27ef 100644
--- a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
@@ -9,7 +9,11 @@ do_reset() {
fail() { #msg
do_reset
echo $1
- exit -1
+ exit $FAIL
+}
+
+yield() {
+ ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
}
if [ ! -f set_event -o ! -d events/sched ]; then
@@ -21,7 +25,8 @@ reset_tracer
do_reset
echo 'sched:*' > set_event
-usleep 1
+
+yield
count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
if [ $count -lt 3 ]; then
@@ -31,7 +36,8 @@ fi
do_reset
echo 1 > events/sched/enable
-usleep 1
+
+yield
count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
if [ $count -lt 3 ]; then
@@ -41,7 +47,8 @@ fi
do_reset
echo 0 > events/sched/enable
-usleep 1
+
+yield
count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
if [ $count -ne 0 ]; then

tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc

View file
diff --git a/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc b/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
index 4808457..0bb5df3 100644
--- a/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
@@ -9,7 +9,11 @@ do_reset() {
fail() { #msg
do_reset
echo $1
- exit -1
+ exit $FAIL
+}
+
+yield() {
+ ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
}
if [ ! -f available_events -o ! -f set_event -o ! -d events ]; then
@@ -21,6 +25,9 @@ reset_tracer
do_reset
echo '*:*' > set_event
+
+yield
+
count=`cat trace | grep -v ^# | wc -l`

This diff is incomplete. Download the complete patch.

tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/gen_kselftest_tar.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/ipc/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/kcmp/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/kselftest_install.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/lib.mk

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/memfd/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/memory-hotplug/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/memory-hotplug/mem-on-off-test.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/mount/.gitignore

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/mount/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/mqueue/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/run_afpackettests

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/run_netsocktests

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/powerpc/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/powerpc/copyloops/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/powerpc/mm/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/powerpc/pmu/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/powerpc/pmu/ebb/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/powerpc/primitives/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/powerpc/stringloops/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/powerpc/tm/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/ptrace/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/size/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/sysctl/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/sysctl/run_numerictests

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/sysctl/run_stringtests

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/alarmtimer-suspend.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/change_skew.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/clocksource-switch.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/inconsistency-check.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/leap-a-day.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/leapcrash.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/mqueue-lat.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/nanosleep.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/nsleep-lat.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/posix_timers.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/raw_skew.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/rtctest.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/set-2038.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/set-tai.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/set-timer-lat.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/skew_consistency.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/threadtest.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/timers/valid-adjtimex.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/user/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/vm/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/vm/run_vmtests

View file

This diff is incomplete. Download the complete patch.