mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kees Cook <keescook@chromium.org>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>, Arnd Bergmann <arnd@arndb.de>,
	John Stultz <john.stultz@linaro.org>,
	Shuah Khan <shuahkhan@gmail.com>,
	arve@android.com, Rebecca Schultz Zavin <rebecca@android.com>,
	Jesper Juhl <jj@chaosbits.net>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Thomas Meyer <thomas@m3y3r.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Marco Stornelli <marco.stornelli@gmail.com>,
	WANG Cong <xiyou.wangcong@gmail.com>,
	linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	linaro-kernel@lists.linaro.org, patches@linaro.org,
	kernel-team@android.com
Subject: Re: [PATCH 0/5] Function tracing support for pstore
Date: Wed, 30 May 2012 15:43:37 -0400	[thread overview]
Message-ID: <1338407017.13348.311.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <20120526133412.GA18001@lizard>

On Sat, 2012-05-26 at 06:34 -0700, Anton Vorontsov wrote:
> Hi all,
> 

Sorry for the late reply, Monday was US holiday, and I've been working
days on finding (and fixing) a very nasty bug.

> With this support kernel can save functions call chain log into a
> persistent ram buffer that can be decoded and dumped after reboot
> through pstore filesystem. It can be used to determine what function
> was last called before a hang or an unexpected reset (caused by, for
> example, a buggy driver that abuses HW).
> 

Nice!

> Here's a "nano howto", to get the idea:
> 
>  # mount -t debugfs debugfs /sys/kernel/debug/
>  # cd /sys/kernel/debug/tracing
>  # echo persistent > current_tracer
>  # reboot -f
>  [...]
>  # mount -t pstore pstore /mnt/
>  # tail /mnt/ftrace-ramoops
>  0 ffffffff8101ea64  ffffffff8101bcda  native_apic_mem_read <- disconnect_bsp_APIC+0x6a/0xc0
>  0 ffffffff8101ea44  ffffffff8101bcf6  native_apic_mem_write <- disconnect_bsp_APIC+0x86/0xc0
>  0 ffffffff81020084  ffffffff8101a4b5  hpet_disable <- native_machine_shutdown+0x75/0x90
>  0 ffffffff81005f94  ffffffff8101a4bb  iommu_shutdown_noop <- native_machine_shutdown+0x7b/0x90
>  0 ffffffff8101a6a1  ffffffff8101a437  native_machine_emergency_restart <- native_machine_restart+0x37/0x40
>  0 ffffffff811f9876  ffffffff8101a73a  acpi_reboot <- native_machine_emergency_restart+0xaa/0x1e0
>  0 ffffffff8101a514  ffffffff8101a772  mach_reboot_fixups <- native_machine_emergency_restart+0xe2/0x1e0
>  0 ffffffff811d9c54  ffffffff8101a7a0  __const_udelay <- native_machine_emergency_restart+0x110/0x1e0
>  0 ffffffff811d9c34  ffffffff811d9c80  __delay <- __const_udelay+0x30/0x40
>  0 ffffffff811d9d14  ffffffff811d9c3f  delay_tsc <- __delay+0xf/0x20
> 
> Mostly the code comes from trace_persistent.c driver found in the
> Android git tree, written by Colin Cross <ccross@android.com>
> (according to sign-off history). I reworked the driver a little bit,
> and ported it to pstore subsystem.
> 
> The patches depend on a pile of other pstore-related work, so
> if anyone is willing to try the patches, they would rather grab
> the whole git tree:
> 	git://git.infradead.org/users/cbou/linux-pstore.git
> or gitweb:
> 	http://git.infradead.org/users/cbou/linux-pstore.git
> 
> 
> Note that so far I've tried to not change the original idea, but if
> we consider inclusion, there are some open questions:
> 
> 1. Should we merge persistent tracer with normal function tracer,
>    i.e. add some flag that makes function tracer to duplicate the
>    events into pstore (via a callback to pstore)?
> 

What about making it a trace option? That is,
in .../debug/tracing/options, have 'persistent' and when that's
selected, we change to using the persistent buffer. This could be for
both function tracing and event tracing.

I'm currently working on getting 'multi' buffers working. I plan on
presenting it at Linux Plumbers for more feedback. But it will be adding
a lot of hooks that would probably make this rather trivial to
implement.

-- Steve

> 2. If we keep the two separate, should the code live in fs/pstore
>    or kernel/trace?.. I can see valid points for both approaches.
> 
> Thanks,



      parent reply	other threads:[~2012-05-30 19:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-26 13:34 Anton Vorontsov
2012-05-26 13:39 ` [PATCH 1/5] tracing: Fix initialization failure path in tracing_set_tracer() Anton Vorontsov
2012-05-30 19:44   ` Steven Rostedt
2012-05-26 13:39 ` [PATCH 2/5] pstore: Introduce write_buf backend callback Anton Vorontsov
2012-05-29 16:28   ` Kees Cook
2012-05-29 18:00     ` Luck, Tony
2012-06-08  2:11       ` Anton Vorontsov
2012-05-26 13:39 ` [PATCH 3/5] pstore: Add persistent function tracing Anton Vorontsov
2012-05-26 13:39 ` [PATCH 4/5] pstore/ram: Convert to write_buf callback Anton Vorontsov
2012-05-26 13:39 ` [PATCH 5/5] pstore/ram: Add ftrace messages handling Anton Vorontsov
2012-05-30 19:43 ` Steven Rostedt [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=1338407017.13348.311.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=anton.vorontsov@linaro.org \
    --cc=arnd@arndb.de \
    --cc=arve@android.com \
    --cc=ccross@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=fweisbec@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jj@chaosbits.net \
    --cc=john.stultz@linaro.org \
    --cc=keescook@chromium.org \
    --cc=kernel-team@android.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.stornelli@gmail.com \
    --cc=mingo@redhat.com \
    --cc=patches@linaro.org \
    --cc=rdunlap@xenotime.net \
    --cc=rebecca@android.com \
    --cc=sboyd@codeaurora.org \
    --cc=shuahkhan@gmail.com \
    --cc=thomas@m3y3r.de \
    --cc=tony.luck@intel.com \
    --cc=xiyou.wangcong@gmail.com \
    /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

all inboxes | Powered by JetHome®