Receiving the error "Can't resolve rq struct in sched_switch tracepoint" using systemtap on RHEL5

Solution Verified - Updated -

Issue

  • I was trying to create a script to profile the scheduler and I wanted to know which cpu the sched_switch function was being on.  I looked at the sched_switch tracepoint and saw that it has a struct rq, which should contain a member variable "int cpu".
  • When I try to use it, I get an error on the console:

    [root@lab300g5 ~]# stap -L 'kernel.trace("sched_switch")'
    kernel.trace("sched_switch") 
    $rq:struct rq* $prev:struct task_struct* $next:struct task_struct*
    
    semantic error: unresolved struct rq: identifier '$rq' at lookAtRq.stp:2:8
            source:         cpu = $rq->cpu;
                                  ^
    Pass 2: analysis failed.  Try again with another '--vp 01' option.
    

Environment

  • Red Hat Enterprise Linux 5
  • systemtap-1.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.