Commit | Line | Data |
---|---|---|
e92f3e28 MD |
1 | /* |
2 | * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
3 | * | |
4 | * This library is free software; you can redistribute it and/or | |
5 | * modify it under the terms of the GNU Lesser General Public | |
6 | * License as published by the Free Software Foundation; only | |
7 | * version 2.1 of the License. | |
8 | * | |
9 | * This library is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | * Lesser General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU Lesser General Public | |
15 | * License along with this library; if not, write to the Free Software | |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
17 | */ | |
18 | ||
1ddceb36 | 19 | #define _LGPL_SOURCE |
ca7bd68c | 20 | #include "org_lttng_ust_LTTngUst.h" |
5ab4c5cb | 21 | |
cc885e49 | 22 | #define TRACEPOINT_DEFINE |
2b6f8df9 | 23 | #define TRACEPOINT_CREATE_PROBES |
2ac85198 | 24 | #include "lttng_ust_java.h" |
2b6f8df9 | 25 | |
14d1b9ce AM |
26 | JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointInt(JNIEnv *env, |
27 | jobject jobj, | |
28 | jstring ev_name, | |
29 | jint payload) | |
30 | { | |
31 | jboolean iscopy; | |
32 | const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); | |
33 | ||
34 | tracepoint(lttng_ust_java, int_event, ev_name_cstr, payload); | |
35 | ||
36 | (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); | |
37 | } | |
38 | ||
071f1d0b AM |
39 | JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointIntInt(JNIEnv *env, |
40 | jobject jobj, | |
41 | jstring ev_name, | |
42 | jint payload1, | |
43 | jint payload2) | |
44 | { | |
45 | jboolean iscopy; | |
46 | const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); | |
47 | ||
48 | tracepoint(lttng_ust_java, int_int_event, ev_name_cstr, payload1, payload2); | |
49 | ||
50 | (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); | |
51 | } | |
52 | ||
14d1b9ce AM |
53 | JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointLong(JNIEnv *env, |
54 | jobject jobj, | |
55 | jstring ev_name, | |
56 | jlong payload) | |
57 | { | |
58 | jboolean iscopy; | |
59 | const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); | |
60 | ||
61 | tracepoint(lttng_ust_java, long_event, ev_name_cstr, payload); | |
62 | ||
63 | (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); | |
64 | } | |
65 | ||
071f1d0b AM |
66 | JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointLongLong(JNIEnv *env, |
67 | jobject jobj, | |
68 | jstring ev_name, | |
69 | jlong payload1, | |
70 | jlong payload2) | |
71 | { | |
72 | jboolean iscopy; | |
73 | const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); | |
74 | ||
75 | tracepoint(lttng_ust_java, long_long_event, ev_name_cstr, payload1, payload2); | |
76 | ||
77 | (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); | |
78 | } | |
79 | ||
a58ac6c8 | 80 | JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointString(JNIEnv *env, |
2ac85198 MD |
81 | jobject jobj, |
82 | jstring ev_name, | |
14d1b9ce | 83 | jstring payload) |
5ab4c5cb PMF |
84 | { |
85 | jboolean iscopy; | |
14d1b9ce AM |
86 | const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy); |
87 | const char *payload_cstr = (*env)->GetStringUTFChars(env, payload, &iscopy); | |
5ab4c5cb | 88 | |
14d1b9ce | 89 | tracepoint(lttng_ust_java, string_event, ev_name_cstr, payload_cstr); |
a58ac6c8 AM |
90 | |
91 | (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); | |
14d1b9ce | 92 | (*env)->ReleaseStringUTFChars(env, payload, payload_cstr); |
5ab4c5cb | 93 | } |
14d1b9ce | 94 |