public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* User-level callee probe error
@ 2021-09-10 22:54 Chakib Mouzaoui
  0 siblings, 0 replies; only message in thread
From: Chakib Mouzaoui @ 2021-09-10 22:54 UTC (permalink / raw)
  To: systemtap

 Hello!

I'm having some issues using the "callee" probe when user-level 
tracing. I wrote a toy program that places several callees inside the 
main function. Here's the source for toy.cpp:

#include <iostream>

int square(const int x)
{
  return x * x;
}

int triple(const int x)
{
  return 3 * x;
}

int lastdigit10(const int x)
{
  return x % 10;
}

int main(int argc, char* argv[])
{
  const int a = 1;
  const int y = triple(a);
  const int z = square(y);
  std::cout << "Result: " << lastdigit10(z) + 1 << std::endl;
  return 0;
}

The toy program compiles and runs as expected:

$ g++ -g -Wall toy.cpp -o toy
$ ./toy
Result: 10
$

I can furthermore see call, exported, and return probes corresponding 
to the main function and individual callees:

$ sudo stap -l 'process("toy").function("main").*'
process("/home/build/stap_tutorial/toy").function("main@/home/build/stap_tutorial/toy.cpp:18").call
process("/home/build/stap_tutorial/toy").function("main@/home/build/stap_tutorial/toy.cpp:18").exportedprocess("/home/build/stap_tutorial/toy").function("main@/home/build/stap_tutorial/toy.cpp:18").return
$ sudo stap -l 'process("toy").function("square").*'
process("/home/build/stap_tutorial/toy").function("square@/home/build/stap_tutorial/toy.cpp:3").call
process("/home/build/stap_tutorial/toy").function("square@/home/build/stap_tutorial/toy.cpp:3").exported
process("/home/build/stap_tutorial/toy").function("square@/home/build/stap_tutorial/toy.cpp:3").return


However, when probing for callees, I run into an error:
$ sudo stap -v -e 'probe process("toy").function("main").callees 
{println ("test")}'
Pass 1: parsed user script and 478 library scripts using 
239084virt/80876res/12212shr/68356data kb, in 170usr/30sys/212real ms.
semantic error: while resolving probe point: identifier 'process' at 
<input>:1:7
        source: probe process("toy").function("main").callees {println 
("test")}
                      ^

semantic error: no match (similar functions: main, _fini, _init, 
_start, _Z6squarei)

Pass 2: analyzed script: 0 probes, 0 functions, 0 embeds, 0 globals 
using 240536virt/84120res/13724shr/69808data kb, in 10usr/10sys/10real 
ms.
Pass 2: analysis failed. [man error::pass2]

I also get the same error when repacing 'callees' with 'callee("*")' or 
even 'callee("square")'. Do you know what could be causing this?

Thank you!
Chakib Mouzaoui


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-10 22:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 22:54 User-level callee probe error Chakib Mouzaoui

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