Questions tagged [dtrace]

DTrace is a comprehensive dynamic tracing framework for the Solaris Operating Environment, Mac OS X 10.5+ and FreeBSD.

DTrace is a comprehensive dynamic tracing framework for the Solaris Operating Environment; it provides a powerful infrastructure to permit administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.

DTrace can be used to get a global overview of a running system, such as the amount of memory, CPU time, file-system and network resources used by the active processes. It can also provide much more fine-grained information, such as a log of the arguments with which a specific function is being called, or a list of the processes accessing a specific file.

Resources

266 questions
1
vote
1 answer

dtrace java API on Oracle Solaris?

I would like to use dtrace from a Java application on machine running Solaris Sparc. I have seen examples of the DTrace Java API in a few places including here: https://blogs.oracle.com/sundararajan/entry/using_dtrace_java_api and…
user2048466
  • 185
  • 3
  • 13
1
vote
1 answer

Is it possible to probe the entry in a C++ class using Dtrace?

I would like to see when the program enters in a class using Dtrace. For instance: dtrace -c './myProgram' -n 'pid$target:myProgram:function:entry' it fires when the program myProgram enters in the function function, now how can I write a probe…
Alessandro
  • 266
  • 1
  • 2
  • 13
1
vote
3 answers

How to supply multi line command to subprocess.Popen?

I need to be able to run a multi line dtrace script via python subprocess.Popen, and tried this... have the following code snippet in python but this does not work, what is the correct approach for handling such templates? cmd =…
Shrikanth R K
  • 85
  • 1
  • 1
  • 9
1
vote
0 answers

How to dtrace (or other method) library functions that were compiled with -fvisibility=hidden

If I have a library that was compiled with -fvisibility=hidden and many of the functions are not exported, i.e. were not given this attribute in the code: __attribute__ ((visibility ("default"))) Is there a way to use dtrace or any other utility to…
jar
  • 381
  • 3
  • 15
1
vote
0 answers

Memory leak in node app - how to investigate on Mac OS X?

I have app build with restify.js and I detected memory leak. I am lucky because memory leak is "heavy" and I can reproduce it easily. It behaves the same on my local Mac and on Heroku where app is hosted. As a proove here are memory usage statistics…
user606521
  • 14,486
  • 30
  • 113
  • 204
1
vote
2 answers

How can I know what built-in functions does the DTrace provide?

As we know, the DTrace running on different OSs provides different built-in functions. For example, the older versions of Solaris do not have inet_ntop() available in DTrace. So when I write a DTrace script running on a special OS, how can I know…
Nan Xiao
  • 16,671
  • 18
  • 103
  • 164
1
vote
1 answer

DTracing objc_msgSend doesn't print the receiver class name

I am using dtrace to print all the objc_msgSend in my code. With what I've done so far I can see the selector's name but I cannot get the correct class name. This is my dtrace script: #!/usr/sbin/dtrace -qs pid$target::objc_msgSend:entry { …
Vame
  • 2,033
  • 2
  • 18
  • 29
1
vote
0 answers

Why the DTrace doesn't output function return log?

When my program receives a TCP connection request, it calls spawn_thread() to add the total thread number, and spawns a child thread to handle TCP connection.When the child thread complete the task, it closes the TCP connection, and calls…
Nan Xiao
  • 16,671
  • 18
  • 103
  • 164
1
vote
1 answer

does dtruss under OS X give consistent results when tracing java?

I'm new to developing on OS X, coming from a more Linux oriented background. I was having issues with a java application, so decided to grab a system call trace to see what it was doing. I got inconsistent behaviour when using dtruss for the…
tom
  • 303
  • 2
  • 13
1
vote
1 answer

Is there any good way to access structure in user-land?

I want to use Dtrace to get the value of a member in a structure in user-land, not kernel. The C code likes this: typedef struct { int a; }st_A; void fun1(st_A *p) { ...... } The Dtrace script likes this: #!/usr/sbin/dtrace…
Nan Xiao
  • 16,671
  • 18
  • 103
  • 164
1
vote
2 answers

Why is the syscall read argument null?

The dtrace dtrace -n 'syscall::read:entry { @[fds[arg0].fi_fs] = count(); }' I want to find the argument read fds trace -lvn 'syscall::*read*:entry' 933 syscall read_nocancel entry Probe Description…
fuyou001
  • 1,594
  • 4
  • 16
  • 27
1
vote
1 answer

how to find arguments mean in dtrace

the code dtrace -n 'syscall::read:entry /execname != "dtrace"/ { @reads[execname, fds[arg0].fi_pathname] = count(); }' dtrace: description 'syscall::read:entry ' matched 1 probe ^C bash /proc/1709/psinfo …
fuyou001
  • 1,594
  • 4
  • 16
  • 27
1
vote
2 answers

dtrace: How to get symlink target from file

I am using dtrace to record all files being deleted. Is it possible to find out what the symlink target is (if it's a symlink)? I want to output the symlink filename and the target filename for logging in case I need to restore the link later. One…
user2533268
  • 85
  • 3
  • 9
1
vote
1 answer

How to print libstdc++ string content with dtrace

I want to write a dtrace probe that would match a function with std::string argument and print the string's content: void func(std::string some) { /* some code here */ } I tried to implement the probe like…
Pavel Davydov
  • 3,379
  • 3
  • 28
  • 41
1
vote
0 answers

Custom instruments how to output aggregations like dtrace script

I am trying to convert below dtrace script to custom instrument. How should we configure the END probe to show the output the aggregated output. pid$target:myApp:main:entry/((pid == $target))/{ starttime =…
smustafa
  • 11
  • 3