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

Http process hang at PHP's Imagick's setFont(or any font operation) in macOS 10.12

I've asked for this problem before. I open this questions because I found another thing I don't know how to do. I've checked the problem using DTrace, and I found when I try to access the PHP, the system will go into infinite loop of…
guitarpoet
  • 395
  • 1
  • 5
  • 12
0
votes
1 answer

NullPointerException when Starting an application with BTrace agent

I am using BTrace 1.2 and followed user guide from BTrace website. I have no problems using BTrace on running programs with command: btrace AllMethods.class but when I try to start application with BTrace agent using either: java…
Artur
  • 3,284
  • 2
  • 29
  • 35
0
votes
2 answers

`probemod` on Mac OS X prints mysterious hexdump instead of module name

The following works fine for grabbing the function name of every syscall made by some command (here we trace the date command): sudo dtrace -n 'syscall:::entry { @[probefunc] = count(); }' -c "date" It yields output such as: read_nocancel …
Birchlabs
  • 7,437
  • 5
  • 35
  • 54
0
votes
1 answer

How do I proceed with memory, .so filenames and hex offsets

Don't flame me for this but it's genuine. I am writing a multi threaded python application that runs for a very long time, typically 2-3 hours with 10 processes. This machine isn't slow it's just a lot of calculations. The issue is that sometimes…
user1610950
  • 1,837
  • 5
  • 33
  • 49
0
votes
1 answer

Tracing system calls using dtrace

I am running an application that runs with a process Id 423. Basically want to debug this process. The problem is that, using the command sudo dtruss -a -t open_nocancel -p 423 I dont see print messages executed and also systems signals like sudo…
Krishna Kalyan
  • 1,672
  • 2
  • 20
  • 43
0
votes
1 answer

Dtrace from C does not yield same profiling result compared to command line

I want to programmatically trace stacks from C for Node.js (JS addresses aside). The following command gives me stacks with resolved c++ symbols. sudo dtrace -C -n 'profile-101 /pid == 13221/ { ustack() }' The following C code only returns…
eljefedelrodeodeljefe
  • 6,304
  • 7
  • 29
  • 61
0
votes
2 answers

How to activate sh DTrace Provider?

I've found out about patches (and updates) for an x86 sh binary in 2007 to support sh DTrace provider. However I can't find any probes on OS X. I'm checking by: $ sudo dtrace -l | grep command-entry See: /bin/sh DTrace Provider at Oracle site (same…
kenorb
  • 155,785
  • 88
  • 678
  • 743
0
votes
0 answers

dtrace how to get socket type in syscall::write:

I want to trace bytes written to a socket. I know I can get fileinfo_t from fds[arg0]. Is there a way to get type of a socket in syscall::write:? How can I safely transfer this information from syscall::write:entry to syscall::write:return to count…
Andrey
  • 1
0
votes
0 answers

Dtrace invalid address error when extracting process command line

I'd like to have dtrace script that print new processes' cmdline and their matching parent name. i.e. : if I ran /Users/bla/myexec arg1 arg2 arg3 from bash I will get something like : parent is bash process is --> /Users/bla/myexec arg1 arg2…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
0
votes
1 answer

peculiarity about creating a file using output redirection and opening a file with cat

I noticed that creating a file using output redirection involves neither creat() or open() system call. I thinks this is due to the stdin and stdout always exist and are always open. But how can I detect (i.e., using dtrace) file creation/read/write…
techie11
  • 1,243
  • 15
  • 30
0
votes
1 answer

OSX: dtrace printf(), write_nocancel() output base on dtruss script

I need to see my program's printf output in sync with the dtrace output. I like to build my own version of dtrace command that produce the equivalent output of the "sudo dtruss -t write_nocancel ls" command. This is the "correct dtruss…
tony-p-lee
  • 797
  • 1
  • 7
  • 13
0
votes
2 answers

dtrace: use pid provider on multiple libraries simultaneously

This dtrace script will fire every time any function is called in libx by process 12345. dtrace -q -n 'pid12345:libx::entry { printf("probe fired"); }' But what I really want is to detect function calls in several libraries, say libx, liby, and…
user2048466
  • 185
  • 3
  • 13
0
votes
0 answers

Can tools such as gcov and dtrace be used to understand unfamiliar code bases?

I'm working with some new code, in c/c++ while most of my experience has been in higher level languages. I can read the code or run it in the debugger and step through it, but I wonder if are tools which will do any of the following: -Record how…
Shahbaz
  • 10,395
  • 21
  • 54
  • 83
0
votes
0 answers

Spurious dtrace user stack traces?

I am using dtrace to sample stack traces of a process like this: # /usr/sbin/dtrace -p $MYPID -x ustackframes=100 stack.d -s -o stack.log Where stack.d looks like: profile-99 /execname == "mybinary"/ { @[execname, ustack()] = count(); } I am…
maxschlepzig
  • 35,645
  • 14
  • 145
  • 182
0
votes
1 answer

dtrace probes missing on yosemite system ruby

On a fresh yosemite install (the one you can download from the mac store) it seems that the ruby dtrace provider is missing: $ sudo dtrace -l -P ruby ID PROVIDER MODULE FUNCTION NAME dtrace: failed to match…
nicolai86
  • 47
  • 3