From: Chakib Mouzaoui <cmouzaoui@scalecomputing.com>
To: systemtap@sourceware.org
Subject: User-level callee probe error
Date: Fri, 10 Sep 2021 15:54:17 -0700 [thread overview]
Message-ID: <HAQ8ZQ.QS99YB3553LF3@scalecomputing.com> (raw)
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
reply other threads:[~2021-09-10 22:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=HAQ8ZQ.QS99YB3553LF3@scalecomputing.com \
--to=cmouzaoui@scalecomputing.com \
--cc=systemtap@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).