Questions tagged [dtruss]

`dtruss` is a script for `DTrace` that traces all types of system calls, but unlike other scripts can trace multiple processes at the same time.

dtruss is a script for DTrace that traces all types of system calls, but unlike other scripts can trace multiple processes at the same time. dtruss can also launch and trace a program.

dtruss supports various options, including the printing of system call timing for use when analyzing performance.

See more:

22 questions
121
votes
3 answers

How to trace system calls of a program in Mac OS X?

I wanted to trace the system calls made by the find command to debug some performance issues however I could not figure out how to do this on Mac OS X Yosemite. How can I trace system calls for an arbitrary program similarly to what strace does on…
Michaël Le Barbier
  • 6,103
  • 5
  • 28
  • 57
11
votes
3 answers

Globally set node_modules location for project

If I write var moment = require('moment'); in my project, Node wastes a lot of time looking in places that do not actually contain the file, as this dtruss output shows. PID/THRD RELATIVE SYSCALL(args) = return …
Kevin Burke
  • 61,194
  • 76
  • 188
  • 305
9
votes
2 answers

dtruss fails on ps on OS X 10.11

I was trying to see which syscall ps uses to get the command line of a process on OS X 10.11 (El Capitan), and ran into the following error: # dtruss ps -p 43520 -o args dtrace: failed to execute ps: dtrace cannot control executables signed with…
Dan
  • 7,155
  • 2
  • 29
  • 54
9
votes
0 answers

How can I get dtruss on Mac OS X to successfully trace child processes?

The dtruss man page says: -f follow children as they are forked which sounds like exactly what I want. However, observe the following behavior: WhiteAndNerdy% uname -a Darwin WhiteAndNerdy.local 13.4.0 Darwin Kernel Version 13.4.0: Wed…
user31708
  • 630
  • 5
  • 11
7
votes
1 answer

Dtruss not showing mmap/sbrk calls?

I've recently decided to learn more about systems programming, and felt it would be helpful to see what my code is actually doing under the hood. To do this, I wrote a short LinkedList class in C++ and decided to trace it using dtruss (read:…
Lazycrow
  • 73
  • 3
4
votes
1 answer

What does "dynamic variable drops with non-empty dirty list" mean in dtrace?

I am tracing a process on OSX 10.13 using dtruss trying to understand why it freezes up while doing a socket connect. However when it reaches the connect the tracer freezes and then displays 783 dynamic variable drops with non-empty dirty list on…
horseyguy
  • 29,455
  • 20
  • 103
  • 145
4
votes
0 answers

Tracing iPhone Simulator to speed up launching time

iPhone Simulator takes several minutes to boot-up so I am tracing the elapses time of the system calls to aim speed up the booting time: sudo dtruss -a -f "sudo -u flopez…
Freeman
  • 5,810
  • 3
  • 47
  • 48
3
votes
1 answer

Why are there not any execve calls in my dtruss trace?

I have a script like this: script.sh #!/bin/bash clang -v If I do a dtruss on it then I would expect to see an execve call to clang. $ sudo dtruss -f -a -e ./script.sh However, the trace does not contain an execve. Instead there is an error:…
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
1
vote
0 answers

How do I see all service calls (or syscall) on mac os x?

-Edit- Looks like using csrutil to disable system protection solved it. Is there a less extreme solution? I'd like to see all the syscall/service calls my app makes to the OS. Below it doesn't seem to be logging any calls. I was expecting to see…
Stan
  • 161
  • 8
1
vote
0 answers

macOS app issue with Apple System Integrity Protection

I am working on a macOS app. The app is already live on the mac App store. Some of my users are reporting that they can not open the app. To find out the exact reason, I reached out to one of the user and asked him to start dtruss and then open app…
Ajay
  • 1,622
  • 20
  • 36
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
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

Catching Mach system calls using dtruss

I ran dtruss on vmmap that is a process that read the virtual memory of another remote process. I would expect that some of mach_port system calls would appear in the output of my command, but couldn't trace any (i.e. mach_vm_read, task_for_pid,…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
1
vote
1 answer

What is the best method to detect which files are used/modified/created/deleted by a process?

I want to write software that will detect all used/created/modified/deleted files during the execution of a process (and its child processes). The process has not yet run - the user provides a command line which will later be subprocessed via bash,…
J.J
  • 3,459
  • 1
  • 29
  • 35
1
2