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

Cannot change permissions for dtrace on MacOS

I was looking at this article. It recommends allow the usage of dtrace without root for current user, so I run: $ sudo chmod u+s /usr/sbin/dtrace Password: # I enter in my password chmod: Unable to change file mode on /usr/sbin/dtrace: Operation not…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
1
vote
0 answers

Installing Ruby on OSX Sierra Hangs Indefinitely on "make" (processes "sleeping")

OSX 10.12.6 / Xcode 9.2 For some reason the make process is stalling indefinitely when I try to install a new Ruby version or really do anything that involves native extensions in Ruby. At first I noticed that this was happening when I tried to run…
sixty4bit
  • 7,422
  • 7
  • 33
  • 57
1
vote
1 answer

Java DTrace bridge on OS X

I am trying to grab filesystem events on OS / Kernel level on OS X. There are 2 requirements i have to follow. The first one is to do this in java as the whole project im developing for is written in java. The second one is that i have to find out…
ins0m
  • 850
  • 10
  • 20
1
vote
0 answers

Tracing `getaddrinfo()` on OSX

There's a program that is spending a long time in getaddrinfo(). Is there any way on OSX to see what address it is looking up? I've tried using this DTrace script but unfortunately I get this error: dtrace: failed to compile script…
Timmmm
  • 88,195
  • 71
  • 364
  • 509
1
vote
1 answer

Locating file descriptor leak in OS X application

Background I have some very complex application. It is composition of couple libraries. Now QA team found the some problem (something reports an error). Fromm logs I can see that application is leaking a file descriptors (+1000 after 7 hours of…
Marek R
  • 32,568
  • 6
  • 55
  • 140
1
vote
1 answer

What are bsdthread_register, ulock_wake and other system calls reported by dtruss?

Here is an example interaction with dtruss on my macOS machine. $ cat main.c int main() { return 0; } $ clang main.c $ sudo dtruss ./a.out dtrace: system integrity protection is on, some features will not be available SYSCALL(args) =…
jameshfisher
  • 34,029
  • 31
  • 121
  • 167
1
vote
1 answer

How to change returned value of function

There is a function in this program, that currently returns a 1. I would prefer for it to return a 0. uregs[R_PC] is the program counter. arg0 is the program counter offset from where we left the function (assembly, "ret"). From this I deduce: we…
Birchlabs
  • 7,437
  • 5
  • 35
  • 54
1
vote
1 answer

Why can't I trace syscalls made by `/bin/echo`?

I was wondering what syscalls are made by echo (the command, not the shell built-in), so I decided to snoop it via dtrace. Specifically I used dtruss. Consider that the following works (tracing all syscalls made by sed): sudo dtruss…
Birchlabs
  • 7,437
  • 5
  • 35
  • 54
1
vote
0 answers

Printing double in DTrace script for user application defined probe

I'm trying to print a double argument in a DTrace script from a user defined probe. The probe is defined as such: /** * Fired when the garbage collection threshold is changed with a certain factor * @param factor the factor with which the GC…
Dekker1
  • 5,565
  • 25
  • 33
1
vote
0 answers

Dtrace matched a probe with nothing to display

I'm a beginner to Dtrace. I installed dtrace4linux on my Opensuse. Just wrote a simple command to count the occurrence of kernel stack call. But nothing printed really frustrated me. Dtrace is such a platform dependent tool I know it is deeply…
tuan long
  • 605
  • 1
  • 9
  • 18
1
vote
1 answer

DTrace missing Java frames with ustack(). Running on Joyent SmartOS infrastructure container

I cannot get any Java stack with dtrace in a Joyent SmartOS instance. I tried the java:15.1.1 image and a plain SmartOS 'base64' image, where I installed openjdk 8. I most basic example: cat Loop.java [root@7e8c2a25-c852-4967-b60c-7b4fbd9a1de5…
Gamlor
  • 12,978
  • 7
  • 43
  • 70
1
vote
2 answers

Find process where a particular system call returns a particular error

On OS X El Capitan, my log file system.log feels with hundreds of the following lines at times 03/07/2016 11:52:17.000 kernel[0]: hfs_clonefile: cluster_read failed - 34 but there is no indication of the process where this happens. Apart from that,…
user1428153
1
vote
1 answer

How to filter list of syscalls only to specific process name?

I've the following dtrace one-liner: sudo dtrace -n 'syscall:::entry { @num[probefunc] = count(); }' which prints number of syscall count by program (after hitting Ctrl-C. How do I add filter above probe to only apply to a process by its name (e.g.…
kenorb
  • 155,785
  • 88
  • 678
  • 743
1
vote
3 answers

Objective C API for Checking File Download from Browser on OSX

I noticed with Sophos Anti-Virus for Mac OSX that when I download a file, it immediately scans it. This works without a browser plugin in any of the browsers I have installed and tested. Therefore, on OSX, what Objective C API does one use in an…
Volomike
  • 23,743
  • 21
  • 113
  • 209
1
vote
0 answers

dtrace OS X thread name

I'm trying to get the thread name in a dtrace script on OS X. The script should record the context switches of threads in my application. #!/usr/sbin/dtrace -s #pragma D option quiet BEGIN { printf("Start dtrace script: time %ul\n\n",…
woodtluk
  • 935
  • 8
  • 20