Blame liblttng-ust-java/org/lttng/ust/LTTngUst.java

Packit c04fcb
/**
Packit c04fcb
 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Packit c04fcb
 * Copyright (C) 2012 Alexandre Montplaisir <alexandre.montplaisir@polymtl.ca>
Packit c04fcb
 *
Packit c04fcb
 * This library is free software; you can redistribute it and/or
Packit c04fcb
 * modify it under the terms of the GNU Lesser General Public
Packit c04fcb
 * License as published by the Free Software Foundation; only
Packit c04fcb
 * version 2.1 of the License.
Packit c04fcb
 *
Packit c04fcb
 * This library is distributed in the hope that it will be useful,
Packit c04fcb
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit c04fcb
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Packit c04fcb
 * Lesser General Public License for more details.
Packit c04fcb
 *
Packit c04fcb
 * You should have received a copy of the GNU Lesser General Public
Packit c04fcb
 * License along with this library; if not, write to the Free Software
Packit c04fcb
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Packit c04fcb
 */
Packit c04fcb
Packit c04fcb
package org.lttng.ust;
Packit c04fcb
Packit c04fcb
/**
Packit c04fcb
 * This class implements the the Java side of the LTTng-UST Java interface.
Packit c04fcb
 *
Packit c04fcb
 * First, make sure you have installed "liblttng-ust-java.so" where the linker
Packit c04fcb
 * can find it. You can then call LTTngUst.init() from your Java program to
Packit c04fcb
 * connect the methods exposed here to the native library.
Packit c04fcb
 *
Packit c04fcb
 * Because of limitations in the probe declaration, all trace events generated
Packit c04fcb
 * by this library will have "lttng_ust_java" for domain, and "<type>_event" for
Packit c04fcb
 * event name in the CTF trace files. The "name" parameter will instead appear
Packit c04fcb
 * as the first element of the event's payload.
Packit c04fcb
 *
Packit c04fcb
 * @author Mathieu Desnoyers
Packit c04fcb
 * @author Alexandre Montplaisir
Packit c04fcb
 *
Packit c04fcb
 */
Packit c04fcb
public abstract class LTTngUst {
Packit c04fcb
Packit c04fcb
    /**
Packit c04fcb
     * Initialize the UST tracer. This should always be called first, before any
Packit c04fcb
     * tracepoint* method.
Packit c04fcb
     */
Packit c04fcb
    public static void init() {
Packit c04fcb
        System.loadLibrary("lttng-ust-java"); //$NON-NLS-1$
Packit c04fcb
    }
Packit c04fcb
Packit c04fcb
    /**
Packit c04fcb
     * Insert a tracepoint with a payload of type Integer.
Packit c04fcb
     *
Packit c04fcb
     * @param name
Packit c04fcb
     *            The name assigned to this event. For best performance, this
Packit c04fcb
     *            should be a statically-defined String, or a literal.
Packit c04fcb
     * @param payload
Packit c04fcb
     *            The int payload
Packit c04fcb
     */
Packit c04fcb
    public static native void tracepointInt(String name, int payload);
Packit c04fcb
Packit c04fcb
    /**
Packit c04fcb
     * Insert a tracepoint with a payload consisting of two integers.
Packit c04fcb
     *
Packit c04fcb
     * @param name
Packit c04fcb
     *            The name assigned to this event. For best performance, this
Packit c04fcb
     *            should be a statically-defined String, or a literal.
Packit c04fcb
     * @param payload1
Packit c04fcb
     *            The first int payload
Packit c04fcb
     * @param payload2
Packit c04fcb
     *            The second int payload
Packit c04fcb
     */
Packit c04fcb
    public static native void
Packit c04fcb
    tracepointIntInt(String name, int payload1, int payload2);
Packit c04fcb
Packit c04fcb
    /**
Packit c04fcb
     * Insert a tracepoint with a payload of type Long
Packit c04fcb
     *
Packit c04fcb
     * @param name
Packit c04fcb
     *            The name assigned to this event. For best performance, this
Packit c04fcb
     *            should be a statically-defined String, or a literal.
Packit c04fcb
     * @param payload
Packit c04fcb
     *            The long payload
Packit c04fcb
     */
Packit c04fcb
    public static native void tracepointLong(String name, long payload);
Packit c04fcb
Packit c04fcb
    /**
Packit c04fcb
     * Insert a tracepoint with a payload consisting of two longs.
Packit c04fcb
     *
Packit c04fcb
     * @param name
Packit c04fcb
     *            The name assigned to this event. For best performance, this
Packit c04fcb
     *            should be a statically-defined String, or a literal.
Packit c04fcb
     * @param payload1
Packit c04fcb
     *            The first long payload
Packit c04fcb
     * @param payload2
Packit c04fcb
     *            The second long payload
Packit c04fcb
     */
Packit c04fcb
    public static native void
Packit c04fcb
    tracepointLongLong(String name, long payload1, long payload2);
Packit c04fcb
Packit c04fcb
    /**
Packit c04fcb
     * Insert a tracepoint with a String payload.
Packit c04fcb
     *
Packit c04fcb
     * @param name
Packit c04fcb
     *            The name assigned to this event. For best performance, this
Packit c04fcb
     *            should be a statically-defined String, or a literal.
Packit c04fcb
     * @param payload
Packit c04fcb
     *            The String payload
Packit c04fcb
     */
Packit c04fcb
    public static native void tracepointString(String name, String payload);
Packit c04fcb
Packit c04fcb
}
Packit c04fcb