Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CloudFeng opened this issue Dec 13, 2015 · 5 comments

Comments

@CloudFeng
Copy link

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 !

@dtrace4linux
Copy link
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.

@CloudFeng
Copy link
Author

I did all the steps which in this subsite.

@cadedaniel
Copy link

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

@cpitclaudel
Copy link

Hm. make load causes my kernel to panic.

@yanghaichao12
Copy link

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants