Probing the JVM with BPF/BCC

Thursday, March 31, 2016

Now that BCC has support for USDT probes, another thing I wanted to try is look at OpenJDK probes and extract some useful examples. To follow along, install a recent OpenJDK (I used 1.8) that has USDT probes enabled. On my Fedora 22, sudo dnf install java was just enough for everything. Conveniently, OpenJDK ships with a set of .stp files that contain probe definitions. Here's an example -- and there are many more in your $JAVA_HOME/tapset directory: probe hotspot.thread_start = process("/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.77-1.b03.fc22.x86_64/jre/lib/amd64/server/libjvm.so").mark("thread__start") {   name = "thread_start";   thread_name = user_string_n($arg1, $arg2);   id = $arg3;   native_id = $arg4;   is_daemon = $arg5;   probestr = sprintf("%s(thread_name='%s',id=%d,native_id=%d,is_daemon=%d)",               ...
no comments

Revisiting Value Types vs. Reference Types

Wednesday, April 10, 2013

Why do C#, the .NET Framework, and the CLR need value types and reference types? Why two categories of types? Why the added complexity in training developers to understand why and when to use each type of type? There are many answers, but very few get to the crux of the matter. You could try to justify the need for two types of types by looking at the semantic differences C# affords each. For example, you know that by default, instances of value types are copied when passed to a function, but instances of reference types are not -- only...
2 comments