linux-kernel-test/tools
Steven Rostedt (Red Hat) 0ded5174e9 ftracetest: Fix hist unsupported result in hist selftests
When histograms are not configured in the kernel, the ftracetest histogram
selftests should return "unsupported" and not "Failed". To detect this, the
test scripts have:

 FEATURE=`grep hist events/sched/sched_process_fork/trigger`
 if [ -z "$FEATURE" ]; then
     echo "hist trigger is not supported"
     exit_unsupported
 fi

The problem is that '-e' is in effect and any error will cause the program
to terminate. The grep for 'hist' fails, because it is not compiled it (thus
unsupported), but because grep has an error code for failing to find the
string, it causes the program to terminate, and is marked as a failed test.

Namhyung Kim recommended to test for the "hist" file located in
events/sched/sched_process_fork/hist instead, as it is more inline with the
other checks. As the hist file is only created if the histogram feature is
enabled, that is a valid check.

Link: http://lkml.kernel.org/r/20160523151538.4ea9ce0c@gandalf.local.home

Suggested-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 76929ab51f ("kselftests/ftrace: Add hist trigger testcases")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-06-20 09:46:21 -04:00
..
arch
build Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-05-26 22:01:22 -07:00
cgroup
firewire
gpio
hv
iio
include
kvm/kvm_stat tools: kvm_stat: Add comments 2016-05-25 16:12:06 +02:00
laptop/freefall
lguest
lib Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-05-16 14:08:43 -07:00
net
nfsd
objtool objtool: Allow building with older libelf 2016-05-17 10:42:46 +02:00
perf Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-06-10 11:15:41 -07:00
power Merge branch 'for-4.7/acpi6.1' into libnvdimm-for-next 2016-05-18 10:07:19 -07:00
scripts
spi
testing ftracetest: Fix hist unsupported result in hist selftests 2016-06-20 09:46:21 -04:00
thermal/tmon
time
usb
virtio ringtest: pass buf != NULL 2016-05-22 19:44:14 +03:00
vm
Makefile - move kvm_stat tool from QEMU repo into tools/kvm/kvm_stat 2016-05-27 13:41:54 -07:00