diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-04 20:32:24 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-04 20:32:24 -0400 |
| commit | 2521129a6d2fd8a81f99cf95055eddea3df914ff (patch) | |
| tree | f8b7879979f656669ce31cbc247b97ae702291fb /tools/testing | |
| parent | 98a96f202203fecad65b44449077c695686ad4db (diff) | |
| parent | 16eb2bfc65ef86d3ac6420d50ddc2c48f0023cee (diff) | |
Merge tag 'char-misc-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char / misc driver patches from Greg KH:
"Here's the big driver misc / char pull request for 3.17-rc1.
Lots of things in here, the thunderbolt support for Apple laptops,
some other new drivers, testing fixes, and other good things. All
have been in linux-next for a long time"
* tag 'char-misc-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (119 commits)
misc: bh1780: Introduce the use of devm_kzalloc
Lattice ECP3 FPGA: Correct endianness
drivers/misc/ti-st: Load firmware from ti-connectivity directory.
dt-bindings: extcon: Add support for SM5502 MUIC device
extcon: sm5502: Change internal hardware switch according to cable type
extcon: sm5502: Detect cable state after completing platform booting
extcon: sm5502: Add support new SM5502 extcon device driver
extcon: arizona: Get MICVDD against extcon device
extcon: Remove unnecessary OOM messages
misc: vexpress: Fix sparse non static symbol warnings
mei: drop unused hw dependent fw status functions
misc: bh1770glc: Use managed functions
pcmcia: remove DEFINE_PCI_DEVICE_TABLE usage
misc: remove DEFINE_PCI_DEVICE_TABLE usage
ipack: Replace DEFINE_PCI_DEVICE_TABLE macro use
drivers/char/dsp56k.c: drop check for negativity of unsigned parameter
mei: fix return value on disconnect timeout
mei: don't schedule suspend in pm idle
mei: start disconnect request timer consistently
mei: reset client connection state on timeout
...
Diffstat (limited to 'tools/testing')
| -rw-r--r-- | tools/testing/selftests/Makefile | 18 | ||||
| -rw-r--r-- | tools/testing/selftests/README.txt | 27 | ||||
| -rw-r--r-- | tools/testing/selftests/cpu-hotplug/Makefile | 3 | ||||
| -rw-r--r-- | tools/testing/selftests/cpu-hotplug/on-off-test.sh | 52 | ||||
| -rw-r--r-- | tools/testing/selftests/kcmp/kcmp_test.c | 2 | ||||
| -rw-r--r-- | tools/testing/selftests/memory-hotplug/Makefile | 3 | ||||
| -rw-r--r-- | tools/testing/selftests/memory-hotplug/on-off-test.sh | 8 | ||||
| -rw-r--r-- | tools/testing/selftests/mqueue/Makefile | 4 | ||||
| -rw-r--r-- | tools/testing/selftests/mqueue/mq_open_tests.c | 20 | ||||
| -rw-r--r-- | tools/testing/selftests/mqueue/mq_perf_tests.c | 40 |
10 files changed, 143 insertions, 34 deletions
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index e66e710cc595..4c2aa357e12f 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile | |||
| @@ -12,6 +12,9 @@ TARGETS += powerpc | |||
| 12 | TARGETS += user | 12 | TARGETS += user |
| 13 | TARGETS += sysctl | 13 | TARGETS += sysctl |
| 14 | 14 | ||
| 15 | TARGETS_HOTPLUG = cpu-hotplug | ||
| 16 | TARGETS_HOTPLUG += memory-hotplug | ||
| 17 | |||
| 15 | all: | 18 | all: |
| 16 | for TARGET in $(TARGETS); do \ | 19 | for TARGET in $(TARGETS); do \ |
| 17 | make -C $$TARGET; \ | 20 | make -C $$TARGET; \ |
| @@ -22,6 +25,21 @@ run_tests: all | |||
| 22 | make -C $$TARGET run_tests; \ | 25 | make -C $$TARGET run_tests; \ |
| 23 | done; | 26 | done; |
| 24 | 27 | ||
| 28 | hotplug: | ||
| 29 | for TARGET in $(TARGETS_HOTPLUG); do \ | ||
| 30 | make -C $$TARGET; \ | ||
| 31 | done; | ||
| 32 | |||
| 33 | run_hotplug: hotplug | ||
| 34 | for TARGET in $(TARGETS_HOTPLUG); do \ | ||
| 35 | make -C $$TARGET run_full_test; \ | ||
| 36 | done; | ||
| 37 | |||
| 38 | clean_hotplug: | ||
| 39 | for TARGET in $(TARGETS_HOTPLUG); do \ | ||
| 40 | make -C $$TARGET clean; \ | ||
| 41 | done; | ||
| 42 | |||
| 25 | clean: | 43 | clean: |
| 26 | for TARGET in $(TARGETS); do \ | 44 | for TARGET in $(TARGETS); do \ |
| 27 | make -C $$TARGET clean; \ | 45 | make -C $$TARGET clean; \ |
diff --git a/tools/testing/selftests/README.txt b/tools/testing/selftests/README.txt index 5e2faf9c55d3..2660d5ff9179 100644 --- a/tools/testing/selftests/README.txt +++ b/tools/testing/selftests/README.txt | |||
| @@ -4,8 +4,15 @@ The kernel contains a set of "self tests" under the tools/testing/selftests/ | |||
| 4 | directory. These are intended to be small unit tests to exercise individual | 4 | directory. These are intended to be small unit tests to exercise individual |
| 5 | code paths in the kernel. | 5 | code paths in the kernel. |
| 6 | 6 | ||
| 7 | Running the selftests | 7 | On some systems, hot-plug tests could hang forever waiting for cpu and |
| 8 | ===================== | 8 | memory to be ready to be offlined. A special hot-plug target is created |
| 9 | to run full range of hot-plug tests. In default mode, hot-plug tests run | ||
| 10 | in safe mode with a limited scope. In limited mode, cpu-hotplug test is | ||
| 11 | run on a single cpu as opposed to all hotplug capable cpus, and memory | ||
| 12 | hotplug test is run on 2% of hotplug capable memory instead of 10%. | ||
| 13 | |||
| 14 | Running the selftests (hotplug tests are run in limited mode) | ||
| 15 | ============================================================= | ||
| 9 | 16 | ||
| 10 | To build the tests: | 17 | To build the tests: |
| 11 | 18 | ||
| @@ -18,14 +25,26 @@ To run the tests: | |||
| 18 | 25 | ||
| 19 | - note that some tests will require root privileges. | 26 | - note that some tests will require root privileges. |
| 20 | 27 | ||
| 21 | 28 | To run only tests targeted for a single subsystem: (including | |
| 22 | To run only tests targetted for a single subsystem: | 29 | hotplug targets in limited mode) |
| 23 | 30 | ||
| 24 | $ make -C tools/testing/selftests TARGETS=cpu-hotplug run_tests | 31 | $ make -C tools/testing/selftests TARGETS=cpu-hotplug run_tests |
| 25 | 32 | ||
| 26 | See the top-level tools/testing/selftests/Makefile for the list of all possible | 33 | See the top-level tools/testing/selftests/Makefile for the list of all possible |
| 27 | targets. | 34 | targets. |
| 28 | 35 | ||
| 36 | Running the full range hotplug selftests | ||
| 37 | ======================================== | ||
| 38 | |||
| 39 | To build the tests: | ||
| 40 | |||
| 41 | $ make -C tools/testing/selftests hotplug | ||
| 42 | |||
| 43 | To run the tests: | ||
| 44 | |||
| 45 | $ make -C tools/testing/selftests run_hotplug | ||
| 46 | |||
| 47 | - note that some tests will require root privileges. | ||
| 29 | 48 | ||
| 30 | Contributing new tests | 49 | Contributing new tests |
| 31 | ====================== | 50 | ====================== |
diff --git a/tools/testing/selftests/cpu-hotplug/Makefile b/tools/testing/selftests/cpu-hotplug/Makefile index 790c23a9db44..e9c28d8dc84b 100644 --- a/tools/testing/selftests/cpu-hotplug/Makefile +++ b/tools/testing/selftests/cpu-hotplug/Makefile | |||
| @@ -3,4 +3,7 @@ all: | |||
| 3 | run_tests: | 3 | run_tests: |
| 4 | @/bin/bash ./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]" | 4 | @/bin/bash ./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]" |
| 5 | 5 | ||
| 6 | run_full_test: | ||
| 7 | @/bin/bash ./on-off-test.sh -a || echo "cpu-hotplug selftests: [FAIL]" | ||
| 8 | |||
| 6 | clean: | 9 | clean: |
diff --git a/tools/testing/selftests/cpu-hotplug/on-off-test.sh b/tools/testing/selftests/cpu-hotplug/on-off-test.sh index bdde7cf428bb..98b1d6565f2c 100644 --- a/tools/testing/selftests/cpu-hotplug/on-off-test.sh +++ b/tools/testing/selftests/cpu-hotplug/on-off-test.sh | |||
| @@ -11,6 +11,8 @@ prerequisite() | |||
| 11 | exit 0 | 11 | exit 0 |
| 12 | fi | 12 | fi |
| 13 | 13 | ||
| 14 | taskset -p 01 $$ | ||
| 15 | |||
| 14 | SYSFS=`mount -t sysfs | head -1 | awk '{ print $3 }'` | 16 | SYSFS=`mount -t sysfs | head -1 | awk '{ print $3 }'` |
| 15 | 17 | ||
| 16 | if [ ! -d "$SYSFS" ]; then | 18 | if [ ! -d "$SYSFS" ]; then |
| @@ -22,6 +24,19 @@ prerequisite() | |||
| 22 | echo $msg cpu hotplug is not supported >&2 | 24 | echo $msg cpu hotplug is not supported >&2 |
| 23 | exit 0 | 25 | exit 0 |
| 24 | fi | 26 | fi |
| 27 | |||
| 28 | echo "CPU online/offline summary:" | ||
| 29 | online_cpus=`cat $SYSFS/devices/system/cpu/online` | ||
| 30 | online_max=${online_cpus##*-} | ||
| 31 | echo -e "\t Cpus in online state: $online_cpus" | ||
| 32 | |||
| 33 | offline_cpus=`cat $SYSFS/devices/system/cpu/offline` | ||
| 34 | if [[ "a$offline_cpus" = "a" ]]; then | ||
| 35 | offline_cpus=0 | ||
| 36 | else | ||
| 37 | offline_max=${offline_cpus##*-} | ||
| 38 | fi | ||
| 39 | echo -e "\t Cpus in offline state: $offline_cpus" | ||
| 25 | } | 40 | } |
| 26 | 41 | ||
| 27 | # | 42 | # |
| @@ -113,15 +128,25 @@ offline_cpu_expect_fail() | |||
| 113 | } | 128 | } |
| 114 | 129 | ||
| 115 | error=-12 | 130 | error=-12 |
| 131 | allcpus=0 | ||
| 116 | priority=0 | 132 | priority=0 |
| 133 | online_cpus=0 | ||
| 134 | online_max=0 | ||
| 135 | offline_cpus=0 | ||
| 136 | offline_max=0 | ||
| 117 | 137 | ||
| 118 | while getopts e:hp: opt; do | 138 | while getopts e:ahp: opt; do |
| 119 | case $opt in | 139 | case $opt in |
| 120 | e) | 140 | e) |
| 121 | error=$OPTARG | 141 | error=$OPTARG |
| 122 | ;; | 142 | ;; |
| 143 | a) | ||
| 144 | allcpus=1 | ||
| 145 | ;; | ||
| 123 | h) | ||
