All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hiraku Toyooka <hiraku.toyooka.gu-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org>
To: "阿口誠司 / AGUCHI,SEIJI"
	<seiji.aguchi.tr-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org>,
	"Kees Cook" <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Tony Luck <tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Linux API <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Anton Vorontsov <anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org>,
	Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>,
	Mark Salyzyn <salyzyn-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>,
	Colin Cross <ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH 2/2] selftests/pstore: add pstore test scripts going with reboot
Date: Thu, 17 Sep 2015 14:54:45 +0900	[thread overview]
Message-ID: <55FA55A5.5020605@hitachi.com> (raw)
In-Reply-To: <753241EEF6DFAB4CAF20F32F515C4E358B347A-RKwZE6o2dOX6mtb5pcma++hNMziWB107FCd8Q96Dh0LR7s880joybQ@public.gmane.org>

Hello,

 >> +prlog "Causing kernel crash ..."
 >> +
 >> +# enable all functions triggered by sysrq
 >> +echo 1 > /proc/sys/kernel/sysrq
 >> +# setting to reboot in 3 seconds after panic
 >> +echo 3 > /proc/sys/kernel/panic
 >> +# setting to cause panic when oops occurs
 >> +echo 1 > /proc/sys/kernel/panic_on_oops
 >> +
 >> +# create a file as reboot flag
 >> +touch $REBOOT_FILE
 >> +sync
 >> +
 >> +# cause crash
 >> +echo c > /proc/sysrq-trigger
 >
 > Do you need to stop kdump service before the sysrq?

Yes, I should check /sys/kernel/kexec_crash_loaded. If the value is
1, this script should try to unload kexec kernel.

 > Or, does it cover oops and kdump case?

No, not yet. I think we should support oops case at first.

Best regards,
Hiraku Toyooka

阿口誠司 / AGUCHI,SEIJI wrote:
>
>> +prlog "Causing kernel crash ..."
>> +
>> +# enable all functions triggered by sysrq
>> +echo 1 > /proc/sys/kernel/sysrq
>> +# setting to reboot in 3 seconds after panic
>> +echo 3 > /proc/sys/kernel/panic
>> +# setting to cause panic when oops occurs
>> +echo 1 > /proc/sys/kernel/panic_on_oops
>> +
>> +# create a file as reboot flag
>> +touch $REBOOT_FILE
>> +sync
>> +
>> +# cause crash
>> +echo c > /proc/sysrq-trigger
>
> Do you need to stop kdump service before the sysrq?
> Or, does it cover oops and kdump case?
>
> Seiji
>
>> -----Original Message-----
>> From: 豊岡拓 / Toyooka,Hiraku
>> Sent: Tuesday, September 15, 2015 11:42 AM
>> To: Kees Cook
>> Cc: LKML; Tony Luck; Linux API; Anton Vorontsov; Shuah Khan; Mark Salyzyn; Colin Cross; 阿口誠司 / AGUCHI,SEIJI
>> Subject: Re: [PATCH 2/2] selftests/pstore: add pstore test scripts going with reboot
>>
>> Hello Kees,
>>
>>   >> +run_crash:
>>   >> +       @sh pstore_crash_test || echo "pstore_crash_test: [FAIL]"
>>   >
>>   > This is probably better written to exit 1 on failure, otherwise it
>>   > just _says_ it fails. (Though lots of selftests in the tree already
>>   > have this problem, it's best to avoid the pattern for new stuff.)
>>   > Maybe something like:
>>   >
>>   >      @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]";
>> exit 1; }
>>
>> OK. I'll add the "exit 1".
>>
>>   >> +prlog -n "Checking dmesg files exist in pstore filesystem ... "
>>   >> +if [ -e dmesg-${backend}-0 ]; then
>>   >> +    prlog "ok"
>>   >> +    for f in `ls dmesg-${backend}-*`; do
>>   >> +       prlog -e "\t${f}"
>>   >> +    done
>>   >> +else
>>   >> +    prlog "FAIL"
>>   >> +    rc=1
>>   >> +fi
>>   >
>>   > This test pattern is repeated a lot. Maybe better to create a helper
>>   > function instead? It could make the tests much more readable.
>>
>> Yes, I should make a helper function in v2.
>>
>> Best regards,
>> Hiraku Toyooka

-- 
Hiraku Toyooka
Systems Productivity Research Dept. / Linux Technology Center
Center for Technology Innovation - Systems Engineering, Hitachi Ltd.

WARNING: multiple messages have this Message-ID (diff)
From: Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
To: "阿口誠司 / AGUCHI,SEIJI" <seiji.aguchi.tr@hitachi.com>,
	"Kees Cook" <keescook@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Tony Luck <tony.luck@intel.com>,
	Linux API <linux-api@vger.kernel.org>,
	Anton Vorontsov <anton@enomsg.org>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Mark Salyzyn <salyzyn@android.com>,
	Colin Cross <ccross@android.com>
Subject: Re: [PATCH 2/2] selftests/pstore: add pstore test scripts going with reboot
Date: Thu, 17 Sep 2015 14:54:45 +0900	[thread overview]
Message-ID: <55FA55A5.5020605@hitachi.com> (raw)
In-Reply-To: <753241EEF6DFAB4CAF20F32F515C4E358B347A@GSjpTK1DCembx02.service.hitachi.net>

Hello,

 >> +prlog "Causing kernel crash ..."
 >> +
 >> +# enable all functions triggered by sysrq
 >> +echo 1 > /proc/sys/kernel/sysrq
 >> +# setting to reboot in 3 seconds after panic
 >> +echo 3 > /proc/sys/kernel/panic
 >> +# setting to cause panic when oops occurs
 >> +echo 1 > /proc/sys/kernel/panic_on_oops
 >> +
 >> +# create a file as reboot flag
 >> +touch $REBOOT_FILE
 >> +sync
 >> +
 >> +# cause crash
 >> +echo c > /proc/sysrq-trigger
 >
 > Do you need to stop kdump service before the sysrq?

Yes, I should check /sys/kernel/kexec_crash_loaded. If the value is
1, this script should try to unload kexec kernel.

 > Or, does it cover oops and kdump case?

No, not yet. I think we should support oops case at first.

Best regards,
Hiraku Toyooka

阿口誠司 / AGUCHI,SEIJI wrote:
>
>> +prlog "Causing kernel crash ..."
>> +
>> +# enable all functions triggered by sysrq
>> +echo 1 > /proc/sys/kernel/sysrq
>> +# setting to reboot in 3 seconds after panic
>> +echo 3 > /proc/sys/kernel/panic
>> +# setting to cause panic when oops occurs
>> +echo 1 > /proc/sys/kernel/panic_on_oops
>> +
>> +# create a file as reboot flag
>> +touch $REBOOT_FILE
>> +sync
>> +
>> +# cause crash
>> +echo c > /proc/sysrq-trigger
>
> Do you need to stop kdump service before the sysrq?
> Or, does it cover oops and kdump case?
>
> Seiji
>
>> -----Original Message-----
>> From: 豊岡拓 / Toyooka,Hiraku
>> Sent: Tuesday, September 15, 2015 11:42 AM
>> To: Kees Cook
>> Cc: LKML; Tony Luck; Linux API; Anton Vorontsov; Shuah Khan; Mark Salyzyn; Colin Cross; 阿口誠司 / AGUCHI,SEIJI
>> Subject: Re: [PATCH 2/2] selftests/pstore: add pstore test scripts going with reboot
>>
>> Hello Kees,
>>
>>   >> +run_crash:
>>   >> +       @sh pstore_crash_test || echo "pstore_crash_test: [FAIL]"
>>   >
>>   > This is probably better written to exit 1 on failure, otherwise it
>>   > just _says_ it fails. (Though lots of selftests in the tree already
>>   > have this problem, it's best to avoid the pattern for new stuff.)
>>   > Maybe something like:
>>   >
>>   >      @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]";
>> exit 1; }
>>
>> OK. I'll add the "exit 1".
>>
>>   >> +prlog -n "Checking dmesg files exist in pstore filesystem ... "
>>   >> +if [ -e dmesg-${backend}-0 ]; then
>>   >> +    prlog "ok"
>>   >> +    for f in `ls dmesg-${backend}-*`; do
>>   >> +       prlog -e "\t${f}"
>>   >> +    done
>>   >> +else
>>   >> +    prlog "FAIL"
>>   >> +    rc=1
>>   >> +fi
>>   >
>>   > This test pattern is repeated a lot. Maybe better to create a helper
>>   > function instead? It could make the tests much more readable.
>>
>> Yes, I should make a helper function in v2.
>>
>> Best regards,
>> Hiraku Toyooka

-- 
Hiraku Toyooka
Systems Productivity Research Dept. / Linux Technology Center
Center for Technology Innovation - Systems Engineering, Hitachi Ltd.

  parent reply	other threads:[~2015-09-17  5:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08 11:06 [PATCH 0/2] selftests/pstore: add pstore test script Hiraku Toyooka
2015-09-08 11:06 ` [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot Hiraku Toyooka
2015-09-08 23:22   ` Mark Salyzyn
2015-09-08 23:22     ` Mark Salyzyn
     [not found]     ` <55EF6DC5.2080207-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>
2015-09-15  2:30       ` Hiraku Toyooka
2015-09-15  2:30         ` Hiraku Toyooka
2015-09-21 21:04         ` Mark Salyzyn
     [not found]           ` <560070D0.90709-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>
2015-09-29  7:18             ` Hiraku Toyooka
2015-09-29  7:18               ` Hiraku Toyooka
2015-09-08 23:37   ` Kees Cook
2015-09-08 23:37     ` Kees Cook
     [not found]     ` <CAGXu5jKLaoAjE5uYkbQW-o6TcjwDL-PS3=HndjD1LpTnN-rnAg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-15  2:31       ` Hiraku Toyooka
2015-09-15  2:31         ` Hiraku Toyooka
     [not found]         ` <55F782E8.80508-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org>
2015-09-16 12:02           ` 阿口誠司 / AGUCHI,SEIJI
2015-09-16 12:02             ` 阿口誠司 / AGUCHI,SEIJI
     [not found]             ` <753241EEF6DFAB4CAF20F32F515C4E358B33C3-RKwZE6o2dOX6mtb5pcma++hNMziWB107FCd8Q96Dh0LR7s880joybQ@public.gmane.org>
2015-09-17  5:54               ` Hiraku Toyooka
2015-09-17  5:54                 ` Hiraku Toyooka
2015-09-08 11:06 ` [PATCH 2/2] selftests/pstore: add pstore test scripts going with reboot Hiraku Toyooka
2015-09-08 11:06   ` Hiraku Toyooka
2015-09-08 23:40   ` Kees Cook
     [not found]     ` <CAGXu5j+Ha0t-acFc+morgUiDRCHGdx8QHySX29PYpnj4QFiJhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-15  2:41       ` Hiraku Toyooka
2015-09-15  2:41         ` Hiraku Toyooka
2015-09-16 12:11         ` 阿口誠司 / AGUCHI,SEIJI
2015-09-16 12:11           ` 阿口誠司 / AGUCHI,SEIJI
     [not found]           ` <753241EEF6DFAB4CAF20F32F515C4E358B347A-RKwZE6o2dOX6mtb5pcma++hNMziWB107FCd8Q96Dh0LR7s880joybQ@public.gmane.org>
2015-09-17  5:54             ` Hiraku Toyooka [this message]
2015-09-17  5:54               ` Hiraku Toyooka
2015-09-08 23:42 ` [PATCH 0/2] selftests/pstore: add pstore test script Kees Cook
2015-09-08 23:42   ` Kees Cook

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=55FA55A5.5020605@hitachi.com \
    --to=hiraku.toyooka.gu-fcd8q96dh0jbdgjk7y7tuq@public.gmane.org \
    --cc=anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org \
    --cc=ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
    --cc=keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=salyzyn-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
    --cc=seiji.aguchi.tr-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org \
    --cc=shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
    --cc=tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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.