Skip to content

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

Open

Description

@codeorcode

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?

Activity

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