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 | ||
5ab4c5cb | 19 | #include <jni.h> |
5ab4c5cb | 20 | |
cc885e49 | 21 | #define TRACEPOINT_DEFINE |
2b6f8df9 | 22 | #define TRACEPOINT_CREATE_PROBES |
2ac85198 | 23 | #include "lttng_ust_java.h" |
2b6f8df9 | 24 | |
a58ac6c8 | 25 | JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointString(JNIEnv *env, |
2ac85198 MD |
26 | jobject jobj, |
27 | jstring ev_name, | |
28 | jstring args) | |
5ab4c5cb PMF |
29 | { |
30 | jboolean iscopy; | |
2b6f8df9 MD |
31 | const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, |
32 | &iscopy); | |
5ab4c5cb PMF |
33 | const char *args_cstr = (*env)->GetStringUTFChars(env, args, &iscopy); |
34 | ||
8b9dbb05 | 35 | tracepoint(lttng_ust_java, string, ev_name_cstr, args_cstr); |
a58ac6c8 AM |
36 | |
37 | (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); | |
38 | (*env)->ReleaseStringUTFChars(env, args, args_cstr); | |
5ab4c5cb | 39 | } |