Re: Linux Kernel GDB tracepoint module 2010-8-30 release

Frank Ch. Eigler
2010-09-04T18:22:25Z

Hi -

Hui Zhu <teawater@gmail.com> wrote:

> I met a issue with build systemtap. Build it need (install
> elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel), but
> ubuntu looks don't have it.

It is there (apt-get builddep systemtap), but you can also use the
bundled-elfutils mode in the README, which uses a private source
tarball / build of elfutils.

> > #! /usr/bin/stap -g
> > probe kernel.function("vfs_readdir") {
> > ï¿½println(%{ jiffies_64 %})
> > ï¿½println($file$)
> > }
>
> parse error: expected literal string or number
> saw: embedded-code at ./1.sh:3:14
> source: println(%{ jiffies_64 %})

This particular script needs to be run with "stap -g" (guru mode)
because it uses embedded-C to access the jiffies_64 value instead of
debuginfo.

> > #! /usr/bin/stap
> > probe kernel.statement("*@fs/readdir.c:29") {
> > ï¿½println($res)
> > }
> >
>
> semantic error: not accessible at this address: identifier '$res' at ./1.sh:3:14
> source: println($res)

That can happen if your line number is not quite right, or if you're
using a version of gcc prior to the VTA (better debuginfo for local
variables) code released in 4.5 (backported to 4.4 in Red Hat
distros). (More recent versions of systemtap may also help.)

If OTOH gdb can access the variable there but systemtap can't, then we
have a bug (and I'd appreciate your time helping collect some extra
data to help fix it).

- FChE