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
11
votes
2 answers

Writing a DTrace consumer in C

I'd like to write a C program on FreeBSD 10.1 that implements a DTrace consumer using libdtrace. I know that I need to start with a call to dtrace_open() - e.g. I have found this old presentation, but I can't get even started, since there is no…
oberstet
  • 21,353
  • 10
  • 64
  • 97
11
votes
3 answers

Why iosnoop (IO snooping files on disk) returns paths with question marks?

If I'm running sudo iosnoop | grep "gem" and then in another terminal run gem env in the iosnoop terminal I see: dtrace: error on enabled probe ID 4 (ID 1106: io:mach_kernel:buf_strategy:start): illegal operation in action #3 at DIF offset…
static
  • 8,126
  • 15
  • 63
  • 89
9
votes
4 answers

Can I use dtrace on OS X 10.5 to determine which of my perl subs is causing the most memory allocation?

We have a pretty big perl codebase. Some processes that run for multiple hours (ETL jobs) suddenly started consuming a lot more RAM than usual. Analysis of the changes in the relevant release is a slow and frustrating process. I am hoping to…
astletron
  • 1,387
  • 1
  • 14
  • 26
9
votes
3 answers

Missing JAVA Procedure names in Time Profiler, Instruments, OS X

I am writing an algorithm implementation using Java. Until OS X 10.7, I used the Shark Profiler to profile my implementation, which worked rather nicely. However, the new Instruments does not find the procedure names anymore. I already tried running…
HdM
  • 169
  • 1
  • 11
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
1 answer

How does Instruments collect data from iOS without DTrace being available?

I am trying to understand the inner workings of XCode's Instruments. On MacOS, it can rely on DTrace to gather all kinds of profiling data. On iOS, it is also capable of lots of things, but I have read repeatedly that DTrace has not been ported to…
random6174
  • 474
  • 4
  • 16
9
votes
3 answers

How to use hotspot probes in dtrace on Mac OS X Leopard?

My Leopard system has dtrace built in. I also have Java 6 installed, using the Apple-provided installer: $ java -version java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211) Java HotSpot(TM) 64-Bit Server VM (build…
user66237
  • 793
  • 1
  • 5
  • 19
8
votes
1 answer

Is it possible to get the result of objc method in dtrace?

I wrote an action that fires when any objc method return (objc:::return). For now, I need to get the return value. Is it possible?
Kentzo
  • 3,881
  • 29
  • 54
8
votes
0 answers

Xcode Instruments - equivalents for Windows?

Xcode's Instruments make me feel physically I'll. They're based on DTrace - which has some loose equivalents in Windows - but the GUI Apple made for them makes them usable in a day to day way. Visual Studio just doesn't seem to have tools to…
Chris Becke
  • 34,244
  • 12
  • 79
  • 148
8
votes
2 answers

How do you print an associative array in DTrace?

The question pretty much sums it up. "dtrace 'print an associative array'" has exactly one google hit and the similar searches are equally useless. EDIT: If I were to use an aggregation, I'm not aware that I'd still be able to remove entries. My…
Sniggerfardimungus
  • 11,583
  • 10
  • 52
  • 97
8
votes
2 answers

How do I print a CFStringRef in a DTrace action?

I have a DTrace probe catching calls to a function, and one of the function's arguments is a CFStringRef. This is private structure that holds a pointer to a unicode string. But the CFStringRef is not itself a char*, so normal DTrace methods like…
TALlama
  • 16,017
  • 8
  • 38
  • 47
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
7
votes
1 answer

Profiling Java applications with DTrace on macOS

I am trying to profile a Java application using DTrace on macOS Sierra 10.12. I am using the JDK8: ⋊> ~ java -version java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14,…
struct54
  • 196
  • 6
7
votes
1 answer

How do I use the HotSpot DTrace probes on SmartOS?

On Mac OS X, I can find the HotSpot probes of running Java programs by running: cody.mello@ashur ~ (1) % sudo dtrace -ln 'hotspot*:::' Password: Invalid connection: com.apple.coresymbolicationd ID PROVIDER MODULE …
argentpyro
  • 73
  • 3
6
votes
3 answers

iphone: strace, dtruss, dtrace or equivalent?

Does anyone know if there is something like strace, dtruss, or dtrace for iPhone? tester-iPhone:/tmp root$ apt-cache search dtruss tester-iPhone:/tmp root$ apt-cache search dtrace tester-iPhone:/tmp root$ apt-cache search trace tester-iPhone:/tmp…
osmund sadler
  • 1,021
  • 2
  • 15
  • 27
1
2
3
17 18