From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH RFC 4/9] ftrace_regression: add new case to ftrace_regression/ dir
Date: Thu, 17 Mar 2016 17:49:14 +0100 [thread overview]
Message-ID: <20160317164914.GE31815@rei.lan> (raw)
In-Reply-To: <1457079898-9449-5-git-send-email-liwang@redhat.com>
Hi!
> +LOOP=10
> +
> +TSTACK_TRACE_PATH=/proc/sys/kernel/stack_tracer_enabled
> +
> +cd $TRACING_PATH
Why cant we setup a few variables to use in the code below instead of
changing the test directory?
EXC_PAGE_FAULT_ENABLE="$TRACING_PATH/events/exceptions/page_fault_kernel/enable"
MM_PAGE_FAULT_ENABLE="$TRACING_PATH/events/kmem/mm_kernel_pagefault/enable"
> +grep -q CONFIG_STACK_TRACER=y /boot/config-`uname -r`
This is not portable. Some distributions store the config in different
places while others don't have it at all.
Can't we do [ -e "$TSTACK_TRACE_PATH" ] or similar instead?
> +if [ $? -ne 0 ];then
> + echo "Stack Tracer is not cofigured in This kernel. Skip the test"
You must correctly report the TCONF here. If you have used the test.sh
library you could have simply done tst_resm TCONF "..." and there would
ne no need for the else branch as well.
> +else
> + for ((i = 0; i < $LOOP; i++))
> + {
This is bashism. You should do 'for i in $(seq $LOOP); do' instead.
> + echo 1 > $TSTACK_TRACE_PATH
> + echo userstacktrace > trace_options
> + grep -q "^userstacktrace" trace_options
> +
> + if [ -f "events/exceptions/page_fault_kernel/enable" ]; then
> + PAGE_FAULT_KERNEL_ENABLE=`cat events/exceptions/page_fault_kernel/enable`
> + echo 1 > events/exceptions/page_fault_kernel/enable
> + else
> + MM_KERNEL_PAGEFAULT_ENABLE=`cat events/kmem/mm_kernel_pagefault/enable`
> + echo 1 > events/kmem/mm_kernel_pagefault/enable
> + fi
> + }
> +
> + if [ -f "events/exceptions/page_fault_kernel/enable" ]; then
> + echo "$PAGE_FAULT_KERNEL_ENABLE" > events/exceptions/page_fault_kernel/enable
> + else
> + echo "$MM_KERNEL_PAGEFAULT_ENABLE" > events/kmem/mm_kernel_pagefault/enable
> + fi
> + # echo "No panic, Still alive."
No unused code in test please.
> +fi
> +
> +cd - > /dev/null
> --
> 1.8.3.1
>
>
> --
> Mailing list info: http://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2016-03-17 16:49 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 8:24 [LTP] [PATCH RFC 0/9] tracing: make ftrace tests to be extended Li Wang
2016-03-04 8:24 ` [LTP] [PATCH RFC 1/9] ftrace_stress: remove the useless file ftrace_get_page_size.c Li Wang
2016-03-04 8:24 ` [LTP] [PATCH RFC 2/9] tracing[1]: reorganize ftrace-stress tests to general tests Li Wang
2016-03-04 8:24 ` [LTP] [PATCH RFC 3/9] tracing[2]: reorganize ftrace stress " Li Wang
2016-03-04 8:24 ` [LTP] [PATCH RFC 4/9] ftrace_regression: add new case to ftrace_regression/ dir Li Wang
2016-03-04 8:24 ` [LTP] [PATCH RFC 5/9] ftrace_regression: add a new testcase Li Wang
2016-03-04 8:24 ` [LTP] [PATCH RFC 6/9] ftrace_stress: skip unsupported tests Li Wang
2016-03-04 8:24 ` [LTP] [PATCH RFC 7/9] ftrace_stress: keep the name of testscipt in sync with tracing file Li Wang
2016-03-04 8:24 ` [LTP] [PATCH RFC 8/9] ftrace_stress: update the trace_options test Li Wang
2016-03-04 8:24 ` [LTP] [PATCH RFC 9/9] ftrace_stress: add two new tests Li Wang
2016-03-17 18:08 ` Cyril Hrubis
2016-03-18 14:08 ` Chunyu Hu
2016-03-21 12:09 ` Cyril Hrubis
2016-03-17 17:19 ` [LTP] [PATCH RFC 8/9] ftrace_stress: update the trace_options test Cyril Hrubis
2016-03-17 17:28 ` Cyril Hrubis
2016-03-18 13:24 ` Chunyu Hu
2016-03-18 13:21 ` Chunyu Hu
2016-03-17 17:07 ` [LTP] [PATCH RFC 6/9] ftrace_stress: skip unsupported tests Cyril Hrubis
2016-03-18 13:08 ` Chunyu Hu
2016-03-17 16:50 ` [LTP] [PATCH RFC 5/9] ftrace_regression: add a new testcase Cyril Hrubis
2016-03-18 7:57 ` Li Wang
2016-03-17 16:49 ` Cyril Hrubis [this message]
2016-03-17 16:39 ` [LTP] [PATCH RFC 3/9] tracing[2]: reorganize ftrace stress tests to general tests Cyril Hrubis
2016-03-18 10:42 ` Li Wang
2016-03-21 12:21 ` Cyril Hrubis
2016-03-22 8:27 ` Li Wang
2016-03-17 16:29 ` [LTP] [PATCH RFC 1/9] ftrace_stress: remove the useless file ftrace_get_page_size.c Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160317164914.GE31815@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.