Project

General

Profile

Actions

Bug #940

closed

llquantize() dreams of JNI

Added by Rich Lowe over 12 years ago. Updated over 12 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2011-04-21
Due date:
% Done:

100%

Estimated time:
Difficulty:
Tags:
Gerrit CR:
External Bug:

Description

#905 will introduce llquantize() support to DTrace using code contributed by Joyent. However, Joyent didn't add support for this aggregating action to libdtrace_jni, the Java interface to DTrace used by tools such as Chime and D-Light and, more directly for us, used by the test suite to verify libdtrace_jni is functional (most tests are run using both dtrace(1) and the Java API).

Rather than excepting the llquantize() action from testing under the Java API, it's reasonable simple to just add support for llquantize to libdtrace_jni and jdtrace (the Java test wrapper).

Actions #1

Updated by Rich Lowe over 12 years ago

The major problem with adding this support is that the Distribution implementation was not really written with new kinds of distribution in mind, and is somewhat strange in its operation in general.

There is the implicit assumption that the distribution buckets can be set out based solely on arguments passed to the constructor of Distribution, which takes only low and step arguments (for the sake of LinearDistribution). Thanks to the fact it then calls back into its subclasses from its own constructor, we have no access to our own slots during the majority of initialization (as we haven't assigned them yet!). This leaves us with the options:

  1. Add several LogLinear specific arguments to the Distribution constructor
  2. Add a new LogLinear specific Distribution constructor, and use it
  3. Use the 'step' argument to hold the full packed set of options as we receive them from DTrace itself for the JNI interface, but provide more tasteful constructors for everyone else.
  4. Completely re-design the Distribution interface to be much more flexible.

I chose the 3rd option, on the grounds of simplicity and safety. The Distribution classes are both Serializable (in the specific sense of that Java interface name), and serializable (via Java Beans and thence XML). The former is well known for its habit of leaking implementation details, which makes the generally correct choice, the re-implementation of Distribution, considerably more hairy.

Actions #2

Updated by Rich Lowe over 12 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Resolved in r13357 commit:af2b8df56c61

Actions

Also available in: Atom PDF