79ad97afc7cb73570917201c9dcbcbe35b026eb0
[lttng-ust.git] / liblttng-ust-java / org / lttng / ust / LTTngUst.java
1 /**
2 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 * Copyright (C) 2012 Alexandre Montplaisir <alexandre.montplaisir@polymtl.ca>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; only
8 * version 2.1 of the License.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 package org.lttng.ust;
21
22 /**
23 * This class implements the the Java side of the LTTng-UST Java interface.
24 *
25 * First, make sure you have installed "liblttng-ust-java.so" where the linker
26 * can find it. You can then call LTTngUst.init() from your Java program to
27 * connect the methods exposed here to the native library.
28 *
29 * Because of limitations in the probe declaration, all trace events generated
30 * by this library will have "lttng_ust_java" for domain, and "<type>_event" for
31 * event name in the CTF trace files. The "name" parameter will instead appear
32 * as the first element of the event's payload.
33 *
34 * @author Mathieu Desnoyers
35 * @author Alexandre Montplaisir
36 *
37 */
38 public abstract class LTTngUst {
39
40 /**
41 * Initialize the UST tracer. This should always be called first, before any
42 * tracepoint* method.
43 */
44 public static void init() {
45 System.loadLibrary("lttng-ust-java"); //$NON-NLS-1$
46 }
47
48 /**
49 * Insert a tracepoint with a payload of type Integer.
50 *
51 * @param name
52 * The name assigned to this event. For best performance, this
53 * should be a statically-defined String, or a literal.
54 * @param payload
55 * The int payload
56 */
57 public static native void tracepointInt(String name, int payload);
58
59 /**
60 * Insert a tracepoint with a payload consisting of two integers.
61 *
62 * @param name
63 * The name assigned to this event. For best performance, this
64 * should be a statically-defined String, or a literal.
65 * @param payload1
66 * The first int payload
67 * @param payload2
68 * The second int payload
69 */
70 public static native void
71 tracepointIntInt(String name, int payload1, int payload2);
72
73 /**
74 * Insert a tracepoint with a payload of type Long
75 *
76 * @param name
77 * The name assigned to this event. For best performance, this
78 * should be a statically-defined String, or a literal.
79 * @param payload
80 * The long payload
81 */
82 public static native void tracepointLong(String name, long payload);
83
84 /**
85 * Insert a tracepoint with a payload consisting of two longs.
86 *
87 * @param name
88 * The name assigned to this event. For best performance, this
89 * should be a statically-defined String, or a literal.
90 * @param payload1
91 * The first long payload
92 * @param payload2
93 * The second long payload
94 */
95 public static native void
96 tracepointLongLong(String name, long payload1, long payload2);
97
98 /**
99 * Insert a tracepoint with a String payload.
100 *
101 * @param name
102 * The name assigned to this event. For best performance, this
103 * should be a statically-defined String, or a literal.
104 * @param payload
105 * The String payload
106 */
107 public static native void tracepointString(String name, String payload);
108
109 }
110
This page took 0.030755 seconds and 3 git commands to generate.