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
0 answers

Creating flamegraphs over specific binary executable

I want to create a flamegraph of my Rust executable (which is in target/release/name-of-binary). I found the perf command to here However, since I'm suing mac os, I don't have perf and have to use dtrace. Although I figured out how to use dtrace for…
Ziva
  • 3,181
  • 15
  • 48
  • 80
1
vote
1 answer

How to learn about kernel variables for DTrace?

I am only interested in answers related to Mac OS X as I would assume the answer would be different based on OS. For example, Apple mentions the kernel variable avenrun in this document. I know that there are many more and I believe a complete list…
ericg
  • 8,413
  • 9
  • 43
  • 77
1
vote
0 answers

Dtrace fbt provider on windows not working

I'm running Dtrace on windows and when trying to execute this command-line script dtrace -n "fbt:nt:*Timer*:entry { @k[probefunc] = count(); } tick-5s { trunc(@k, 10);printa(@k); exit(0); }" as given in official microsoft documentation…
Yash
  • 21
  • 5
1
vote
0 answers

is Perf or DTrace not sampling when the process is blocked(like doing some io)?

Here is an example for profiling, on macos 10.15.4, using clion with https://www.jetbrains.com/help/clion/cpu-profiler.html , I found it only ouput a part of call stacks. #include #include #include void g() { …
onriv
  • 145
  • 1
  • 7
1
vote
1 answer

Use dtrace, lldb or gdb to find which file or line of code was responsible for a line of output in stdout or stderr?

I see a string being output to my Terminal, when I ran an executable. I have the source code (in C) of the executable, but it was not written by me. I compiled it with -g flag. Is there any way to know which line in which file resulted in the…
forgodsakehold
  • 870
  • 10
  • 26
1
vote
0 answers

How to run `dtrace` at reboot and keep it running to monitor a file on MacOS

I am trying to discover what application is creating a file in /private/tmp. I've temporarily turned off sip on this Mac. I created a shell script: #!/bin/bash sudo iosnoop -f /private/tmp/AlTest1.err > /private/tmp/iosnoop.txt I created a crontab…
John
  • 469
  • 1
  • 4
  • 17
1
vote
1 answer

Obtain message content of Erlang messages in dtrace

I was experimenting with Erlang and dtrace, and am interested to know whether the message content exchanged between two Erlang processes can be obtained. In particular, I am interested in the message-send and message-receive probes. I looked at…
Duncan Paul
  • 485
  • 5
  • 13
1
vote
0 answers

DTrace-like function tracing of Rust program on macOS

I have a Rust program that uses a C FFI, and I would like to instrument any time a function from that C FFI is called, and the arguments passed to it. Im developing on macOS, and it seems like DTrace is a good fit, but with the macOS SIP enabled…
zino
  • 1,222
  • 2
  • 17
  • 47
1
vote
1 answer

eBPF vs. System vs. DTrace

Which one is the main one going to be supported by CentOS going forward? I am not an expert at any of these tools, so I would like to know which one I should learn much deeper. Thanks
user855
  • 19,048
  • 38
  • 98
  • 162
1
vote
0 answers

Use DTrace to see stack trace of process modifying file

I'm trying to use DTrace to print the stacktrace of any code that reads or writes a file on the iOS Simulator. I know to use ustack, but need help creating the DTrace script to see which process and what is the stack trace when the file is modified.
Idr
  • 6,000
  • 6
  • 34
  • 49
1
vote
1 answer

Correlating dtrace probes

I'm seeing unexpected results using dtrace, in that my -entry and -return results don't always seem to correlate, I seem to see either too many or too few, and have simplified my script to explore what is going wrong. I'm attempting to profile the…
Lee Hambley
  • 6,270
  • 5
  • 49
  • 81
1
vote
1 answer

Dtrace String Comparison in predicate don't work

I'm fairly new to dtrace. I'm using it on Oracle Linux 7. I want the following probe only to fire when the execname equals a defined string. I've tried different ways without success. The way described in most tutorials didn't work …
tbo007
  • 161
  • 1
  • 3
1
vote
0 answers

Profile C++ code based on "State Threads" library with dtrace

I'm using dtrace to profile a C++ program (It's SRS in case it matters) based on State Threads, a goroutine-like library for writing concurrent C++ code. The command I use: dtrace -n 'profile-199 /pid == '$PID'/ { @[ustack(100)] = count(); }…
Stupident
  • 11
  • 2
  • 2
1
vote
1 answer

Difficulty showing TCP information with dtrace on osx

I want to use dtrace to show information about tcp connect, accepts, and data sends...but i also want to show port and ip information. Is there a way of doing this on osx? I notice that osx does not have a TCP provider (unlike solaris), but is there…
horseyguy
  • 29,455
  • 20
  • 103
  • 145
1
vote
0 answers

Use dtruss to profile node.js server on MacOS

Just experimenting with dtruss/dtrace here. I have this command: sudo dtruss node server.js &> my-dtruss.log that log looks like this: https://gist.github.com/ORESoftware/9b4d47682a8f0ec25330c02b4ef3ea2d my question is, if my NODE_ENV var is set,…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817