public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Systemtap kernel backtraces not working on 4.14.14
@ 2018-01-24  8:49 Avi Kivity
  2018-01-24 19:01 ` Frank Ch. Eigler
  2018-01-24 19:04 ` Florian Weimer
  0 siblings, 2 replies; 4+ messages in thread
From: Avi Kivity @ 2018-01-24  8:49 UTC (permalink / raw)
  To: systemtap

I have a centos installation with 4.14.14 installed. Since the systemtap 
that came in the box wouldn't work with that kernel, I built git HEAD. A 
script that calls print_syms() used to display a backtrace, but now only 
shows systemtap kmod symbols and one entry from the kernel proper:


   at:       8483   to: rcu_sched
  0xffffffffa0335150 : 0xffffffffa0335150 
[stap_fc3e91a0b756c0a804d73b3d051959b6__1891+0xd150/0x0]
  0xffffffffa0336476 : 0xffffffffa0336476 
[stap_fc3e91a0b756c0a804d73b3d051959b6__1891+0xe476/0x0]
  0xffffffffa0336eb4 : 0xffffffffa0336eb4 
[stap_fc3e91a0b756c0a804d73b3d051959b6__1891+0xeeb4/0x0]
  0xffffffffa0339ecc : 0xffffffffa0339ecc 
[stap_fc3e91a0b756c0a804d73b3d051959b6__1891+0x11ecc/0x0]
  0xffffffffa0328014 : 0xffffffffa0328014 
[stap_fc3e91a0b756c0a804d73b3d051959b6__1891+0x14/0x0]
  0xffffffff817db0a5 : __schedule+0x395/0x880 [kernel]
  0x0 : 0x0

Here is the script:


global mon, trace, header, nr_trace, start_system_time


# mon[tid()] = 1    if it's a reactor thread that we're tracing
# mon[tid()] = 0        if we don't care about this thread

# trace[tid(), idx]     multiline trace of recent events in rid()
# header[tid(), idx]    header for trace above
# nr_trace[tid()]       number of lines in trace

probe syscall.io_submit {
     if (cpu() != 7) { next }

     t = tid()
     mon[t] = 1
     start_system_time[t] = task_stime()
     ts = sprintf("%d", t)
     start_stopwatch(ts)
}

function add_trace(task_id, other_label, other_name) {
     ts = sprintf("%d", task_id)
     idx = nr_trace[task_id]++
     header[task_id, idx] = sprintf("at: %10d %s: %s", 
read_stopwatch_us(ts), other_label, other_name)
     trace[task_id, idx] = backtrace()
}

probe scheduler.ctxswitch {
     if (cpu() != 7) { next }

     from = prev_tid
     to = next_tid
     if (mon[from]) {
         add_trace(from, "from", next_task_name)
     }
     if (mon[to]) {
         add_trace(to, "  to", prev_task_name)
     }
}

probe syscall.io_submit.return {
     if (cpu() != 7) { next }

     t = tid()
     mon[t] = 0
     ts = sprintf("%d", t)
     tm = read_stopwatch_ms(ts)
     systime = cputime_to_msecs(task_stime() - start_system_time[t])
     if (t in nr_trace) {
         nr = nr_trace[t]
         if (tm >= 10) {
             printf("wall %6d ms sys %6d ms\n", tm, systime)
             for (idx = 0; idx != nr; ++idx) {
                printf("  %s\n", header[t, idx])
                print_syms(trace[t, idx])
             }
         }
         for (idx = 0; idx != nr; ++idx) {
            delete trace[t, idx]
            delete header[t, idx]
         }
         delete nr_trace[t]
     }
     delete_stopwatch(ts)
}


Is there something in the kernel configuration I need to turn on 
(.config taken from elrepo's -ml kernel)? Or a missing dependency while 
building systemtap? Maybe systemtap can't cope with retpolines?

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

end of thread, other threads:[~2018-01-25  8:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-24  8:49 Systemtap kernel backtraces not working on 4.14.14 Avi Kivity
2018-01-24 19:01 ` Frank Ch. Eigler
2018-01-25  8:23   ` Avi Kivity
2018-01-24 19:04 ` Florian Weimer

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