public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Probing padzero problem
@ 2016-09-05 22:30 Paddie O'Brien
  2016-09-06 15:34 ` Frank Ch. Eigler
  0 siblings, 1 reply; 2+ messages in thread
From: Paddie O'Brien @ 2016-09-05 22:30 UTC (permalink / raw)
  To: systemtap

Hi,

# stap -L 'kernel.function("padzero")'
kernel.function("padzero@fs/binfmt_elf.c:113") $elf_bss:long unsigned int

But when I try to probe it with:

probe kernel.function("padzero@fs/binfmt_elf.c:113")
{
        printf("%s\n", probefunc())
        print("0x%x\n", $elf_bss)
}

I get:

WARNING: For probing a particular line, use a .statement() probe, not .function
(): keyword at pgd.stp:1:1
 source: probe kernel.function("padzero@fs/binfmt_elf.c:113")
         ^
semantic error: no line records for fs/binfmt_elf.c:113 [man error::dwarf] (try
 :118)

semantic error: while resolving probe point: identifier 'kernel' at :1:7
        source: probe kernel.function("padzero@fs/binfmt_elf.c:113")
                      ^

semantic error: no match (similar functions: padzero, mmap_zero, d_drop, die, d
m_io)

What am I doing wrong?

Thanks.

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

* Re: Probing padzero problem
  2016-09-05 22:30 Probing padzero problem Paddie O'Brien
@ 2016-09-06 15:34 ` Frank Ch. Eigler
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Ch. Eigler @ 2016-09-06 15:34 UTC (permalink / raw)
  To: Paddie O'Brien; +Cc: systemtap


paddieobrien wrote:

> [...]
> # stap -L 'kernel.function("padzero")'
> kernel.function("padzero@fs/binfmt_elf.c:113") $elf_bss:long unsigned int
> But when I try to probe it with:
> probe kernel.function("padzero@fs/binfmt_elf.c:113")
> [...]=
> WARNING: For probing a particular line, use a .statement() probe, not .function
> semantic error: no line records for fs/binfmt_elf.c:113 [man error::dwarf] (try

Sorry, systemtap is misleading you.  tl;dr: use instead: probe
kernel.function("padzero") { }

Systemtap accepts filename:linenumber suffixes for function probes,
but sort of reluctantly, as an ambiguity resolution tool.  People have
confused .statement() and .function() probes many times in the past,
so the warning is there to nudge them away.

It prints the function's declaration file:line in the "stap -l" report
and elsewhere.  But it doesn't compare incoming file:line values
against the declarations, only against (statement-oriented) line
records.  Thus it doesn't find a match (because there is no statement
on that first declaration line), and gives the silly error.

Systemtap should perhaps not list the file:line number in stap -l output.
Systemtap should definitely accept the declaration file:line suffix for
a function probe.

- FChE

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

end of thread, other threads:[~2016-09-06 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-05 22:30 Probing padzero problem Paddie O'Brien
2016-09-06 15:34 ` 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).