Skip to content

Function tracing support for pstore

Anton Vorontsov lkml 4 versions – In review

Get series with b4
b4 am 20120710001004.GA22744@lizard

Versions newest first · linked by author and title

  1. v4 Latest8 patches 13 repliesIn review
  2. v37 patches 2 repliesSuperseded
  3. v26 patches 12 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches5 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8tracing: Fix initialization failure path in tracing_set_tracer()kernel/trace/trace.c+4 -30 replies
2/8pstore: Introduce write_buf backend callbackfs/pstore/platform.c include/linux/pstore.h+14 -00 replies
3/8pstore: Add persistent function tracingfs/pstore/Kconfig fs/pstore/Makefile fs/pstore/ftrace.c +4 more+208 -517 replies
4/8tracing/function: Introduce persistent trace optionkernel/trace/trace_functions.c+20 -51 reply
5/8pstore/ram: Convert to write_buf callbackfs/pstore/ram.c+9 -80 replies
6/8pstore/ram: Add ftrace messages handlingDocumentation/ramoops.txt fs/pstore/ram.c include/linux/pstore_ram.h+59 -40 replies
7/8pstore/ram: Make tracing log versionedfs/pstore/Kconfig fs/pstore/ram.c fs/pstore/ram_core.c +1 more+17 -119 replies
8/8tracing/function: Convert func_set_flag() to a switch statementkernel/trace/trace_functions.c+9 -60 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSteven Rostedt
SeriesA-b
1/8A-b
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/8] Function tracing support for pstore

Hi all,

In v4:
- A few cosmetic changes in func_set_flag(), as suggested by Steven Rostedt. Firstly, in the patch that adds pstore option, I use 'else if' for the new bit (it keeps changes minimal), but then there is a new separate patch (the last in the series) that converts the whole thing into a switch construction.

In v3:
- Make traces versioned, as suggested by Steven, Tony and Colin. (The version tag is stored in the PRZ signature, see the last patch for the implementation details).
- Add Steven's Ack on the first patch.

In v2:
- Do not introduce a separate 'persistent' tracer, but introduce an option to the existing 'function' tracer.

Rationale for this patch set:

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).

Here's a "nano howto", to get the idea:

 # mount -t debugfs debugfs /sys/kernel/debug/
 # cd /sys/kernel/debug/tracing
 # echo function > current_tracer
 # echo 1 > options/func_pstore
 # 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 <[email protected]> (according to sign-off history). I reworked the driver a little bit, and ported it to pstore subsystem.

---
 Documentation/ramoops.txt      |   25 +++++++++
 fs/pstore/Kconfig              |   13 +++++
 fs/pstore/Makefile             |    1 +
 fs/pstore/ftrace.c             |   35 +++++++++++++
 fs/pstore/inode.c              |  111 ++++++++++++++++++++++++++++++++++++++--
 fs/pstore/internal.h           |   43 ++++++++++++++++
 fs/pstore/platform.c           |   12 ++++-
 fs/pstore/ram.c                |   65 +++++++++++++++++------
 fs/pstore/ram_core.c           |   12 +++--
 include/linux/pstore.h         |   13 +++++
 include/linux/pstore_ram.h     |    3 +-
 kernel/trace/trace.c           |    7 +--
 kernel/trace/trace_functions.c |   36 +++++++++----
 13 files changed, 337 insertions(+), 39 deletions(-)
Signature · 2 lines
Anton Vorontsov
Email: [email protected]