Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] Capturing snapshot on kernel panic
@ 2024-05-15 22:24 Damien Berget via lttng-dev
  2024-05-16 13:37 ` Kienan Stewart via lttng-dev
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Berget via lttng-dev @ 2024-05-15 22:24 UTC (permalink / raw)
  To: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 1938 bytes --]

Good day,
we have been using LTTng successfully to capture snapshots on user defined
tracepoints and it did provide invaluable to debug our issues. Thanks to
all the contributors of this project!

We'd like to know if it would be possible to trigger on a kernel panic? I
might be dubiously possible as you would still need to have the file-system
working to write the results but I should ask.

Looking at available kernel syscall, the "reboot" one seems like a good
candidate, however I was not able to capture a snapshot on it. I have
tested the setup below with "--name=chdir" syscall and it works, "cd" to a
directory will create a trace. But no dice with reboot.

Would you have any suggestions?
Thanks for your help,
Cheers
Damien

============================

# Prep output dir
mkdir /application/trace/
rm -rf /application/trace/*

# Create session
sudo lttng destroy snapshot-trace-session
sudo lttng create snapshot-trace-session --snapshot
--output="/application/trace/"
sudo lttng enable-channel --kernel --num-subbuf=8 channelk
sudo lttng enable-channel --userspace --num-subbuf=8 channelu

# Configure session
sudo lttng enable-event --kernel --syscall --all --channel channelk
sudo lttng enable-event --kernel --tracepoint "sched*" --channel channelk
sudo lttng enable-event --userspace --all --channel channelu
sudo lttng add-context -u -t vtid -t procname
sudo lttng remove-trigger trig_reboot
sudo lttng add-trigger --name=trig_reboot \
        --condition=event-rule-matches --type=kernel:syscall:entry \
        --name=reboot\
        --action=snapshot-session snapshot-trace-session \
        --rate-policy=once-after:1

# start & list info
sudo lttng start
sudo lttng list snapshot-trace-session
sudo lttng list-triggers

#======== test it...
sudo reboot

#======= reconnect and Nothing :(
$ ls -alu /application/trace/
drwxr-xr-x    2 u  u       4096 May 15  2024 .
drwxr-xr-x   10 u  u       4096 May 15  2024 ..

[-- Attachment #1.2: Type: text/html, Size: 2374 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-16 19:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-15 22:24 [lttng-dev] Capturing snapshot on kernel panic Damien Berget via lttng-dev
2024-05-16 13:37 ` Kienan Stewart via lttng-dev
2024-05-16 15:12   ` Kienan Stewart via lttng-dev
2024-05-16 18:22     ` Damien Berget via lttng-dev
2024-05-16 19:56       ` Mathieu Desnoyers via lttng-dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox