public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Having systemtap-crash subpackage rpm
@ 2010-04-09 21:36 William Cohen
  2010-04-13 15:41 ` Frank Ch. Eigler
  0 siblings, 1 reply; 2+ messages in thread
From: William Cohen @ 2010-04-09 21:36 UTC (permalink / raw)
  To: systemtap

[-- Attachment #1: Type: text/plain, Size: 2255 bytes --]

I have been experimenting with the support for kdump/crash and trying to write things up. The first thing I noticed is the flag to control building crash analysis support. The current RPM build has that turned off to avoid having the main systemtap RPM have dependencies on crash. Wouldn't it be preferable to have the crash support placed in a separate sub package, so people don't have to rebuild systemtap to use with kdump/crash? The attached patch is an suggested patched to create that subpackage.

Experiences trying out kdump/crash to extract the information were not entirely successful. I was able to get a vmcore, which I was able to load in crash. However, I wasn't able to extrace the data from the systemtap module. Below are the details of the steps taken to produce the core file and extract the data from the systemtap module. Any comments on what I need to do to get this information out of the vmcore?


I set up a RHEL-5 machine to try this out on using the instructions at:

http://kbase.redhat.com/faq/docs/DOC-6039

Installed the all the systemtap rpms including the systemtap-crash rpm. Start a script using fligh recorder mode (-F):

cd /tmp #so iotime.ko module is in a known place
stap -F -m iotime /usr/share/doc/systemtap-1.2/examples/io/iotime.stp

Disconnecting from systemtap module.
To reconnect, type "staprun -A iotime"


As root crash the machine:
 
echo "c" > /proc/sysrq-trigger

Wait for the machine to crash and reboot. Then look in /var/crash for a dump file:

$ ls /var/crash
2010-04-09-17\:02

As root start up crash with information about the kernel:

crash /var/crash/2010-04-09-17\:02/vmcore /usr/lib/debug/lib/modules/`uname -r`/vmlinux

Once crash gives a command prompt load the systemtap supporting shared library:

extend /usr/lib64/systemtap/staplog.so

Find out about the staplog command with:

help staplog

Should be able to get information with:

staplog iotime

However, need to have debuginfo for the file according to the output:

staplog: WARNING: The debuginfo of the trace module hasn't been loaded.
You may not be able to retrieve the correct trace data.
--- generating 'iotime/global' ---
  subbufs ready on relayfs:1
  n_subbufs:8, read subbuf from:0(0) to:0(0) (offset:0-31808)



-Will



[-- Attachment #2: stap-rpm-crash.diff --]
[-- Type: text/plain, Size: 1939 bytes --]

diff --git a/systemtap.spec b/systemtap.spec
index 059a47b..ef64dff 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -1,6 +1,6 @@
 %{!?with_sqlite: %global with_sqlite 1}
 %{!?with_docs: %global with_docs 1}
-%{!?with_crash: %global with_crash 0}
+%{!?with_crash: %global with_crash 1}
 %{!?with_rpm: %global with_rpm 1}
 %{!?with_bundled_elfutils: %global with_bundled_elfutils 0}
 %{!?elfutils_version: %global elfutils_version 0.127}
@@ -52,9 +52,6 @@ BuildRequires: m4
 %else
 BuildRequires: elfutils-devel >= %{elfutils_version}
 %endif
-%if %{with_crash}
-Requires: crash
-%endif
 
 %if %{with_docs}
 BuildRequires: /usr/bin/latex /usr/bin/dvips /usr/bin/ps2pdf latex2html
@@ -176,6 +173,20 @@ SystemTap grapher is a utility for real-time visualization of
 data from SystemTap instrumentation scripts.
 %endif
 
+%if %{with_crash}
+%package crash
+Summary: SystemTap Instrumentation System support for crash core analysis tool
+Group: Development/System
+License: GPLv2+
+URL: http://sourceware.org/systemtap/
+Requires: crash
+
+%description crash
+The crash core analysis tool can be extended with shared libraries.
+This rpm includes the needed shared library to read SystemTap data
+in a core dump.
+%endif
+
 %prep
 %setup -q %{?setup_elfutils}
 
@@ -421,15 +432,9 @@ exit 0
 %{_datadir}/%{name}/runtime
 %{_datadir}/%{name}/tapset
 
-%if %{with_bundled_elfutils} || %{with_crash}
-%dir %{_libdir}/%{name}
-%endif
 %if %{with_bundled_elfutils}
 %{_libdir}/%{name}/lib*.so*
 %endif
-%if %{with_crash}
-%{_libdir}/%{name}/staplog.so*
-%endif
 
 # Make sure that the uprobes module can be built by root and by the server
 %dir %attr(0775,root,stap-server) %{_datadir}/%{name}/runtime/uprobes
@@ -447,6 +452,12 @@ exit 0
 
 %doc README AUTHORS NEWS COPYING
 
+%if %{with_crash}
+%files crash
+%defattr(-,root,root)
+%{_libdir}/%{name}/staplog.so*
+%endif
+
 %files testsuite
 %defattr(-,root,root)
 %{_datadir}/%{name}/testsuite

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

* Re: [PATCH] Having systemtap-crash subpackage rpm
  2010-04-09 21:36 [PATCH] Having systemtap-crash subpackage rpm William Cohen
@ 2010-04-13 15:41 ` Frank Ch. Eigler
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Ch. Eigler @ 2010-04-13 15:41 UTC (permalink / raw)
  To: William Cohen; +Cc: systemtap

William Cohen <wcohen@redhat.com> writes:

> I have been experimenting with the support for kdump/crash and
> trying to write things up. The first thing I noticed is the flag to
> control building crash analysis support. The current RPM build has
> that turned off to avoid having the main systemtap RPM have
> dependencies on crash.

That's not the reason.  And indeed, including staplog.so in the
systemtap package does not require a dependency on the crash rpm,
only a buildreq on crash-devel.  That latter buildreq is the problem:
crash-devel is not universally available.


> Experiences trying out kdump/crash to extract the information were
> not entirely successful. [...]

Right, this area is not tested/maintained well enough.  Please open a
bug report.


- FChE

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

end of thread, other threads:[~2010-04-13 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 21:36 [PATCH] Having systemtap-crash subpackage rpm William Cohen
2010-04-13 15:41 ` Frank Ch. Eigler

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 read-only IMAP folder(s) and NNTP newsgroup(s).