perf jvmti: Separate jvmti cmlr check
The Compiled Method Load Record (cmlr) is JDK specific interface to access JVM stack info. This makes the jvmti agent code not compile under another jdk, which does not support that. Separating jvmti cmlr check into special feature check, and adding HAVE_JVMTI_CMLR macro to indicate that. Mark cmlr code in jvmti/libjvmti.c with HAVE_JVMTI_CMLR, so we can compile it on system without cmlr support. This change makes the jvmti compile with java-1.8.0-ibm package. It's without the line numbers support, but the rest works. Adding NO_JVMTI_CMLR compile variable for testing. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ben Gainey <ben.gainey@arm.com> Cc: Gustavo Luiz Duarte <gduarte@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/20181121154341.21521-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
ecd94f1be3
commit
dd1d0044dd
@@ -6,7 +6,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <err.h>
|
||||
#include <jvmti.h>
|
||||
#ifdef HAVE_JVMTI_CMLR
|
||||
#include <jvmticmlr.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
#include "jvmti_agent.h"
|
||||
@@ -27,6 +29,7 @@ static void print_error(jvmtiEnv *jvmti, const char *msg, jvmtiError ret)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_JVMTI_CMLR
|
||||
static jvmtiError
|
||||
do_get_line_numbers(jvmtiEnv *jvmti, void *pc, jmethodID m, jint bci,
|
||||
jvmti_line_info_t *tab, jint *nr)
|
||||
@@ -125,6 +128,15 @@ get_line_numbers(jvmtiEnv *jvmti, const void *compile_info, jvmti_line_info_t **
|
||||
*nr_lines = lines_total;
|
||||
return JVMTI_ERROR_NONE;
|
||||
}
|
||||
#else /* HAVE_JVMTI_CMLR */
|
||||
|
||||
static jvmtiError
|
||||
get_line_numbers(jvmtiEnv *jvmti __maybe_unused, const void *compile_info __maybe_unused,
|
||||
jvmti_line_info_t **tab __maybe_unused, int *nr_lines __maybe_unused)
|
||||
{
|
||||
return JVMTI_ERROR_NONE;
|
||||
}
|
||||
#endif /* HAVE_JVMTI_CMLR */
|
||||
|
||||
static void
|
||||
copy_class_filename(const char * class_sign, const char * file_name, char * result, size_t max_length)
|
||||
|
||||
Reference in New Issue
Block a user