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 -s script.d -c binary Not working #115

Open
codeorcode opened this issue Jun 20, 2015 · 0 comments
Open

dtrace -s script.d -c binary Not working #115

codeorcode opened this issue Jun 20, 2015 · 0 comments

Comments

@codeorcode
Copy link

I am trying to run this script:

!/usr/sbin/dtrace -q

syscall::read:entry,
syscall::write:entry
/pid == $target/
{
printf("execname:%s | %s(%d, 0x%x, %4d)", execname, probefunc, arg0, arg1, arg2);
printf("\n\t\t\t\t\ttest: %s", copyinstr(arg1));
}

syscall::read:return,
syscall::write:return
/pid == $target/
{
printf("\t\t = %d\n", arg1);
}

The command is: dtrace -s script.d -c "./a.out"

The command should display all reads and writes by my a.out app then exit. But instead it will not exit. I've replaced a.out with a linux command like netstat or ls. Still the script will not exit.

[root@centos6 ~]# dtrace -s b.d -c ./a.out
parent: waiting for child
parent: after waitpid pid=10187 status=137f
child 10187 about to exec ./a.out
rd_loadobj_iter
rd_loadobj_iter: /lib64/ld-2.12.so 0x7f216aee5000
proc-stub:rd_event_enable
proc-stub:rd_event_addr addr=(nil)
proc-stub:rd_event_addr addr=(nil)
proc-stub:rd_event_addr addr=(nil)
dtrace: script 'b.d' matched 8 probes

�CentOS is version 6.6, kernel: 2.6.32-504.23.4.el6.x86_64

Any hint what should I do next?

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

1 participant