public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Some newbie questions
@ 2016-08-07  8:08 Avi Kivity
  2016-08-07  9:16 ` Avi Kivity
  2016-08-08 14:58 ` David Smith
  0 siblings, 2 replies; 32+ messages in thread
From: Avi Kivity @ 2016-08-07  8:08 UTC (permalink / raw)
  To: systemtap

Hello,

A few newbie questions.

1.  Static library support

I am writing a static library, and would like to ship some scripts with 
the library for its consumers.  The library is named "seastar" and one 
of the consumers is named "scylla".

What should I write as the process name in the script?  As the writer of 
the library, I don't know the name of the process that will be consuming 
the library.  The consumer shouldn't have to write those scripts.  I 
could play sed games to adjust the scripts, but it's very sad to have to 
do this.

2. Inlined functions

 From the manual pages, it seems that inlined functions can be probed 
(minus the .return probe), but I just get an error:

semantic error: while resolving probe point: identifier 'process' at 
script/home/avi/seastar/debug/task-latency.stap:3:7
         source: probe process("scylla").function("reactor::run_tasks()") {
                       ^

semantic error: no match (similar functions: 
_ZN7reactor14run_exit_tasksEv, statfs, dup, mkdir, ntohs)

I will note that "mkdir" does not sound very similar to 
"reactor::run_tasks()" (but I am not a native speaker).

3. Process CPU timers

(more of a feature request)

I'm trying to find causes of latency in my program.  To do that, I'm 
running a periodic timer and checking whether a function takes more time 
than some threshold.

Ideally, I'd be able to arm the timer on the function entry point and 
disarm it on exit, rather than have it run continuously; this would need 
to be a per-thread cpu-time timer (e.g. CLOCK_THREAD_CPUTIME_ID)/

Here's my current script for reference ("running" and "start_time" need 
to become maps for it to be thread-safe):

#!/usr/bin/stap

global start_time
global running

probe begin {
     running = 0
}

probe 
process("/home/avi/urchin/build/release/scylla").mark("reactor_run_tasks_start") 
{
     start_time = gettimeofday_us()
     running = 1
}

probe 
process("/home/avi/urchin/build/release/scylla").mark("reactor_run_tasks_end") 
{
     running = 0
}

probe timer.ms(10) {
     now = gettimeofday_us()
     if (running && (now - start_time) > 30000) {
         printf("detected tasks running for >30ms\n")
         print_usyms(ubacktrace())
     }
}

I'd appreciate any tips as to whether there's a better way to do this.


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

end of thread, other threads:[~2016-08-31 16:44 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-07  8:08 Some newbie questions Avi Kivity
2016-08-07  9:16 ` Avi Kivity
2016-08-08 14:58 ` David Smith
2016-08-09  6:51   ` Avi Kivity
2016-08-09 13:54     ` Mark Wielaard
2016-08-09 14:11       ` Avi Kivity
2016-08-10 15:33         ` Frank Ch. Eigler
2016-08-10 15:39           ` Avi Kivity
2016-08-10 15:40           ` Avi Kivity
2016-08-10 16:47             ` Frank Ch. Eigler
2016-08-11  7:51               ` Avi Kivity
2016-08-11  8:13                 ` Avi Kivity
2016-08-11 16:18                   ` Frank Ch. Eigler
2016-08-17 15:15                     ` Avi Kivity
2016-08-17 18:06                       ` David Smith
2016-08-17 18:22                         ` Avi Kivity
2016-08-17 18:10                       ` Frank Ch. Eigler
2016-08-17 18:30                         ` Avi Kivity
2016-08-17 18:35                           ` Frank Ch. Eigler
2016-08-17 18:42                             ` Avi Kivity
2016-08-25 16:21                             ` Avi Kivity
2016-08-25 17:37                               ` David Smith
2016-08-26 18:39                                 ` Avi Kivity
2016-08-26 20:08                                   ` David Smith
2016-08-26 21:21                                     ` Josh Stone
2016-08-28 13:30                                     ` Avi Kivity
2016-08-28 13:35                                       ` Avi Kivity
2016-08-28 13:45                                         ` Avi Kivity
2016-08-29 18:26                                       ` David Smith
2016-08-31 16:44                                         ` Avi Kivity
2016-08-09 15:17     ` David Smith
2016-08-09 15:28       ` Avi Kivity

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