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
6
votes
1 answer

What DTrace scripts makes it worthwhile to test and profile Java programs on Solaris

I have found the DTrace intriguing but have personally failed to see a use-case that allow me to get information that I cannot get otherwise anyway without using DTrace. Hence, I would like to hear what I have overlooked. What can I do on my vmware…
Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
6
votes
1 answer

Using DTrace to get stack traces / profiling data on Rust

I'm trying to get a nice flamegraph of my Rust code. Unfortunately, Xcode 8.3 doesn't support exporting profiling data anymore, so I've been trying to use DTrace to get the profiling data. I have enabled debug info in my Cargo.toml for the release…
GolDDranks
  • 3,272
  • 4
  • 22
  • 30
6
votes
0 answers

How to trace and debug a hanging apache process

I have a problem with my PHP backend I can't figure out. I experience intermittent "hanging" of some apache processes when requesting the API (PHP code returning json). Apache never fails to deliver files (html, css, js etc.), it's just a limited…
swenedo
  • 3,074
  • 8
  • 30
  • 49
6
votes
3 answers

How to get memory usage high water mark on OSX

I'd like to be able to test some guesses about memory complexity of various command line utilities. Taking as a simple example grep pattern file I'd like to see how memory usage varies with the size of pattern and the size of file. For time…
Lindsay Winkler
  • 751
  • 5
  • 13
6
votes
2 answers

Dtrace script that returns %CPU, %Memory and network in/out aggregated by zone

I need a DTrace script that returns CPU usage percentage, memory usage percentage and network input and output bytes used, aggregating the data by zone. Something like this: ZONE %CPU %MEM NET_INPUT NET_OUTPUT zone1 25% 12% 86012 1294 zone2…
greuze
  • 4,250
  • 5
  • 43
  • 62
6
votes
2 answers

Understanding output of dtruss

Could anyone point me to a reference on how to understand/interpret the report outputted by dtruss (mac) or dtrace? I just tried dtruss on a simple program. For example, I got the following output: PID/THRD SYSCALL(args) =…
Gary
  • 1,828
  • 1
  • 20
  • 27
6
votes
4 answers

Why does DTrace give me invalid-address errors sometimes but not always?

My program: typedef struct objc_class { struct objc_class *isa; struct objc_class *super_class; char *name; long version; long info; long instance_size; void *ivars; void *methodLists; void *cache; void…
Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
6
votes
3 answers

Profiling Node.js using DTrace

I am currently profiling my node.js application.I found this blog: http://blog.nodejs.org/2012/04/25/profiling-node-js/ that suggests I should use Dtrace. I installed dtrace on ubuntu 12.04 using steps given here:…
nerandell
  • 401
  • 6
  • 16
5
votes
1 answer

How can I get command arguments with D-trace on OSX

I'm trying to preview run commands with the args with D-trace. I tried something like this: sudo dtrace -n 'syscall::execve:return {printf("%s\n", curpsinfo->pr_psargs);}' But on OSX this code returns only commands names not their args. I find this…
Maciek Sawicki
  • 6,717
  • 9
  • 34
  • 48
5
votes
2 answers

recording `open` syscalls on mac

I would like to know what calls are made to open(2) in a bash script. I wrote the following program which intercepts syscalls: #include #define _GNU_SOURCE #include #include #include #define…
Jason Eveleth
  • 139
  • 1
  • 5
5
votes
1 answer

Getting BPF programs working with USDT probes (Dtrace) in Linux

So I'm following this link to attach a BPF program to user space probes, Dtrace format (see section User Statically Defined Tracepoints). C program: #include int main() { DTRACE_PROBE("hello-usdt", "probe-main"); } The checks to…
mdaniel
  • 191
  • 1
  • 12
5
votes
0 answers

dtrace and linux perf tools not working in ubuntu

I have a node.js application running on a aws ubuntu instance. I was trying to generate flamegraphs using dtrace and linux perf tools but none of them seem working. these are steps I am following : linux perf tools:…
user6348718
  • 1,355
  • 5
  • 21
  • 28
5
votes
1 answer

libdtrace buffered output

I'm trying to use dtrace through libdtrace (on Snow Leopard; 10.6.4). I want to catch the printed output of my dtrace script within my own program. One way to do so would be to have the output go to a temporary file and read it from there. However,…
Sami
  • 3,263
  • 3
  • 29
  • 37
5
votes
0 answers

How do I get per-process network and disk IO counters on Mac OS X without DTrace?

I've been writing a small utility to get per-process statistics on Mac OS X. It launches the processes it inspects. One of the features I really want to include is momentary Net and Disk IO; unfortunately, the only way I've found to really get at…
Chris Zelenak
  • 2,158
  • 17
  • 20
5
votes
0 answers

How can I use DTrace on Yosemite with Ruby 2.2.2?

I've configured and installed Ruby 2.2.2 with DTrace enabled (--enable-dtrace). It appears to have done so successfully: "checking whether dtrace USDT is available... yes" and "dtrace" on another check (instead of "no"). Testing with: sudo dtrace …
SexxLuthor
  • 4,460
  • 3
  • 18
  • 25
1 2
3
17 18