Skip to content

dtrace: failed to initialize dtrace: DTrace device not available on system #119

Open

Description

@CloudFeng

today,I installed dtrace4linux. For my ubuntu system's information:

Ubuntu 14.04.2 LTS X86_64, 3.16.0-37-generic

I used it test the performance for Nginx like this^ref_1:

#!/usr/sbin/dtrace -s

    pid$1::ngx_http_handler:entry
    {
        elapsed = 0;
    }

    pid$1::ngx_http_core_access_phase:entry
    {
        begin = timestamp;
    }

    pid$1::ngx_http_core_access_phase:return
    /begin > 0/
    {
        elapsed += timestamp - begin;
        begin = 0;
    }

    pid$1::ngx_http_finalize_request:return
    /elapsed > 0/
    {
        @elapsed = avg(elapsed);
        elapsed = 0;
    }

When I run this script, it told:

dtrace: failed to initialize dtrace: DTrace device not available on system

I also run this cmd:dtrace -l,it also gave the same error.But I also written a simple script as followed^ref_2:

#!/usr/sbin/dtrace -s
BEGIN
{
    trace("hello");
    exit(0);
}

it worked well.I did not know what happened, so I used google to find the answer.However, nothing found out. Some people also faced it,like this one.

Thanks !

Activity

  1. dtrace4linux commented on Dec 13, 2015

    @dtrace4linux
    Owner

    did you load the driver? ("make load")

    On 13 December 2015 at 16:30, yunfeng notifications@github.com wrote:

    today,I installed dtrace4linux For my ubuntu system's information:

    Ubuntu 14042 LTS X86_64, 3160-37-generic

    I used it test the performance for Nginx like this^ref_1
    https://openrestyorg/download/agentzh-nginx-tutorials-zhcnhtml#02-NginxDirectiveExecOrder04
    :

    #!/usr/sbin/dtrace -s

    pid$1::ngx_http_handler:entry
    {
        elapsed = 0;
    }
    
    pid$1::ngx_http_core_access_phase:entry
    {
        begin = timestamp;
    }
    
    pid$1::ngx_http_core_access_phase:return
    /begin > 0/
    {
        elapsed += timestamp - begin;
        begin = 0;
    }
    
    pid$1::ngx_http_finalize_request:return
    /elapsed > 0/
    {
        @elapsed = avg(elapsed);
        elapsed = 0;
    }
    

    When I run this script, it told:

    dtrace: failed to initialize dtrace: DTrace device not available on system

    I also run this cmd:dtrace -l,it also gave the same errorBut I also
    written a simple script as followed^ref_2
    http://dtraceorg/guide/chp-scripthtml:

    #!/usr/sbin/dtrace -s
    BEGIN
    {
    trace("hello");
    exit(0);
    }

    it worked wellI did not know what happened, so I used google to find the
    answerHowever, nothing found out Some people also faced it,like this one
    http://askubuntucom/questions/648476/dtrace-failed-to-initialize-dtrace-dtrace-device-not-available-on-system-ubuntu

    —
    Reply to this email directly or view it on GitHub
    #119.

  2. CloudFeng commented on Dec 14, 2015

    @CloudFeng
    Author

    I did all the steps which in this subsite.

  3. cadedaniel commented on Mar 28, 2016

    @cadedaniel

    dtrace4linux is implemented as a dynamically loadable kernel module (i.e. it isn't loaded by default). Thus, I believe you need to run make load every time you restart your system.

    https://en.wikipedia.org/wiki/Loadable_kernel_module

  4. cpitclaudel commented on Apr 1, 2018

    @cpitclaudel

    Hm. make load causes my kernel to panic.

  5. yanghaichao12 commented on Dec 10, 2019

    @yanghaichao12

    @cpitclaudel hi, how do you resolve this panic problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions