linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brendan Higgins <brendanhiggins@google.com>
To: Daniel Latypov <dlatypov@google.com>
Cc: davidgow@google.com, linux-kernel@vger.kernel.org,
	kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org,
	skhan@linuxfoundation.org
Subject: Re: [PATCH] kunit: tool: suggest using decode_stacktrace.sh on kernel crash
Date: Tue, 7 Dec 2021 17:58:34 -0500	[thread overview]
Message-ID: <CAFd5g443R4OU4vspOh2yqu=7FBtUaxMbsd_tpr8ZnND1CJveCA@mail.gmail.com> (raw)
In-Reply-To: <20211120032401.2305447-1-dlatypov@google.com>

On Fri, Nov 19, 2021 at 10:24 PM Daniel Latypov <dlatypov@google.com> wrote:
>
> kunit.py isn't very clear that
> 1) it stashes a copy of the unparsed output in $BUILD_DIR/test.log
> 2) it sets $BUILD_DIR=.kunit by default
>
> So it's trickier than it should be for a user to come up with the right
> command to do so.
>
> Make kunit.py print out a command for this if
> a) we saw a test case crash
> b) we only ran one kernel (test.log only contains output from the last)
>
> Example suggested command:
> $ scripts/decode_stacktrace.sh .kunit/vmlinux .kunit < .kunit/test.log | tee .kunit/decoded.log | ./tools/testing/kunit/kunit.py parse
>
> Without debug info a user might see something like
> [14:11:25] Call Trace:
> [14:11:25] ? kunit_binary_assert_format (:?)
> [14:11:25] kunit_try_run_case (test.c:?)
> [14:11:25] ? __kthread_parkme (kthread.c:?)
> [14:11:25] kunit_generic_run_threadfn_adapter (try-catch.c:?)
> [14:11:25] ? kunit_generic_run_threadfn_adapter (try-catch.c:?)
> [14:11:25] kthread (kthread.c:?)
> [14:11:25] new_thread_handler (:?)
> [14:11:25] [CRASHED]
>
> `tee` is in GNU coreutils, so it seems fine to add that into the
> pipeline by default, that way users can inspect the otuput in more
> detail.
>
> Note: to turn on debug info, users would need to do something like
> $ echo -e 'CONFIG_DEBUG_KERNEL=y\nCONFIG_DEBUG_INFO=y' >> .kunit/.kunitconfig
> $ ./tools/testing/kunit/kunit.py config
> $ ./tools/testing/kunit/kunit.py build
> $ <then run decode_stacktrace.sh now vmlinux is updated>
>
> This feels too clunky to include in the instructions.
> With --kconfig_add [1], it would become a bit less painful.
>
> [1] https://lore.kernel.org/linux-kselftest/20211106013058.2621799-2-dlatypov@google.com/
>
> Signed-off-by: Daniel Latypov <dlatypov@google.com>

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>

      reply	other threads:[~2021-12-07 22:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-20  3:24 [PATCH] kunit: tool: suggest using decode_stacktrace.sh on kernel crash Daniel Latypov
2021-12-07 22:58 ` Brendan Higgins [this message]

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='CAFd5g443R4OU4vspOh2yqu=7FBtUaxMbsd_tpr8ZnND1CJveCA@mail.gmail.com' \
    --to=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=skhan@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).