public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* UProbes fails
@ 2010-09-03  6:01 Tim Beaulen
  2010-09-03  6:55 ` Tim Beaulen
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Beaulen @ 2010-09-03  6:01 UTC (permalink / raw)
  To: systemtap

Hello,

I'm not sure if this is the right mailing list for this question. I
get the following errors when using systemtap:

When trying to profile a KDE style, I get the following errors:

...
WARNING: u*probe failed plasma-desktop[4511]
'process("/usr/lib/kde4/plugins/styles/oxygen.so").function("~KSharedPtr@/usr/include/ksharedptr.h:90").call'
addr b221c162 rc -1
...
WARNING: u*probe failed plasma-desktop[4511]
'process("/usr/lib/kde4/plugins/styles/oxygen.so").function("~QString@/usr/include/qt4/QtCore/qstring.h:869").call'
addr b221c527 rc -1
...
WARNING: u*probe failed kxkb[4521]
'process("/usr/lib/kde4/plugins/styles/oxygen.so").function("~QWeakPointer@/usr/include/qt4/QtCore/qsharedpointer_impl.h:556").call'
addr b2547b12 rc -1
...
ERROR: Skipped too many probes, check MAXSKIPPED or try again with
stap -t for more details.
WARNING: Number of errors: 0, skipped probes: 117



When looking at the source code of these functions, they look like this:
inline ~KSharedPtr() { if (d && !d->ref.deref()) delete d; }
inline QString::~QString() { if (!d->ref.deref()) free(d); }
inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; }

Can someone explain why ubprobes fails on these functions?


The script I'm using:

global starttime;
global timetable;

probe begin
{
    printf("Begin\n");
}

probe process("/usr/lib/kde4/plugins/styles/oxygen.so").function("*").call
{
    starttime[probefunc()] = gettimeofday_ns();

    #printf("%s --> %s\n", thread_indent(1), probefunc());
}

probe process("/usr/lib/kde4/plugins/styles/oxygen.so").function("*").return
{
    if (!([probefunc()] in starttime)) next;

    delta = gettimeofday_ns() - starttime[probefunc()];
    timetable[probefunc()] <<< delta;

    #printf("%s <-- %s\n", thread_indent(-1), probefunc());
}

function print_header()
{
    printf("%60s %10s %20s %20s %20s %20s\n", "Function call",
"Called", "Total ns", "Avg ns", "Min ns", "Max ns");
}

probe end
{
    printf("\n");
    print_header();

    foreach(time in timetable)
        printf("%60s %10d %20d %20d %20d %20d\n", time,
@count(timetable[time]), @sum(timetable[time]), @avg(timetable[time]),
@min(timetable[time]), @max(timetable[time]));
}

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

* Re: UProbes fails
  2010-09-03  6:01 UProbes fails Tim Beaulen
@ 2010-09-03  6:55 ` Tim Beaulen
  2010-09-03  7:14   ` Mark Wielaard
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Beaulen @ 2010-09-03  6:55 UTC (permalink / raw)
  To: systemtap

Follow up:

If uprobes requires the source files to be available, then that might
be the problem.
By accident, the source files got removed after building.

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

* Re: UProbes fails
  2010-09-03  6:55 ` Tim Beaulen
@ 2010-09-03  7:14   ` Mark Wielaard
       [not found]     ` <AANLkTimHwKuUUDxPjfmtMfaByj=cX8HqK-PaAheM8dih@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Wielaard @ 2010-09-03  7:14 UTC (permalink / raw)
  To: Tim Beaulen; +Cc: systemtap

On Fri, 2010-09-03 at 08:55 +0200, Tim Beaulen wrote:
> If uprobes requires the source files to be available, then that might
> be the problem.
> By accident, the source files got removed after building.

No, stap only needs the dwarf debuginfo to know where to place the
probes. You might want to look in the kernel logs (dmesg) if there are
any hints there about why the placement of the uprobes didn't work.

Cheers,

Mark

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

* UProbes fails
       [not found]     ` <AANLkTimHwKuUUDxPjfmtMfaByj=cX8HqK-PaAheM8dih@mail.gmail.com>
@ 2010-09-03 18:27       ` Tim Beaulen
  2010-09-03 19:49         ` Jim Keniston
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Beaulen @ 2010-09-03 18:27 UTC (permalink / raw)
  To: systemtap

Looking at dmesg, I get this information:

In 32-bit apps, uprobes does not currently support probing
instructions whose first byte is 0xf0
Can't place uprobe at pid 4498 vaddr 0xb0bf9750: instruction type
cannot be probed

This means I cant just do probe process("/some/process").function("*").call etc.
A little bit annoying, but absolutely not a problem, systemtap is
luckely flexible enough to work around it.

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

* Re: UProbes fails
  2010-09-03 18:27       ` Tim Beaulen
@ 2010-09-03 19:49         ` Jim Keniston
  0 siblings, 0 replies; 5+ messages in thread
From: Jim Keniston @ 2010-09-03 19:49 UTC (permalink / raw)
  To: Tim Beaulen; +Cc: systemtap

On Fri, 2010-09-03 at 20:27 +0200, Tim Beaulen wrote:
> Looking at dmesg, I get this information:
> 
> In 32-bit apps, uprobes does not currently support probing
> instructions whose first byte is 0xf0
> Can't place uprobe at pid 4498 vaddr 0xb0bf9750: instruction type
> cannot be probed
> 
> This means I cant just do probe process("/some/process").function("*").call etc.
> A little bit annoying, but absolutely not a problem, systemtap is
> luckely flexible enough to work around it.

0xf0 is the lock prefix.  As far as I know, we never enabled probing of
instructions with the f0 prefix because we never got around to testing
it.  Will it work?  I have no evidence either way.

If you want to try it, I think all you need to do is this:
# cd /usr/local/share/systemtap/runtime/uprobes (or wherever it is on
your system)
# Edit ../uprobes2/uprobes_x86.c
In check_legacy_prefix(), move "case 0xf0:" to below the "return -1;"
line.
# rmmod uprobes.ko
# make
# insmod uprobes.ko (optional; stap will do this for you
# stap ...

... and let us know what happens.  Uprobes is outside my bailiwick now,
so if that doesn't work, I can offer only limited support.

Jim


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

end of thread, other threads:[~2010-09-03 19:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-03  6:01 UProbes fails Tim Beaulen
2010-09-03  6:55 ` Tim Beaulen
2010-09-03  7:14   ` Mark Wielaard
     [not found]     ` <AANLkTimHwKuUUDxPjfmtMfaByj=cX8HqK-PaAheM8dih@mail.gmail.com>
2010-09-03 18:27       ` Tim Beaulen
2010-09-03 19:49         ` Jim Keniston

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