Mirror of the BLOAT repository
https://www.cs.purdue.edu/homes/hosking/bloat/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
885 B
39 lines
885 B
#include <jni.h>
|
|
#include <stdio.h>
|
|
#include <fcntl.h>
|
|
#include <sys/time.h>
|
|
#include "EDU_purdue_cs_bloat_benchmark_Shade.h"
|
|
|
|
#define MAIN_NAME "main"
|
|
#define MAIN_SIG "([Ljava/lang/String;)V"
|
|
|
|
JNIEXPORT void JNICALL Java_EDU_purdue_cs_bloat_benchmark_Shade_run(
|
|
JNIEnv *env, jclass clazz, jclass main, jobjectArray args, jboolean quit)
|
|
{
|
|
jmethodID method;
|
|
|
|
(*env)->ExceptionClear(env);
|
|
|
|
method = (*env)->GetStaticMethodID(env, main, MAIN_NAME, MAIN_SIG);
|
|
|
|
if ((*env)->ExceptionOccurred(env) != NULL) {
|
|
fprintf(stderr, "Method not found: %s%s\n", MAIN_NAME, MAIN_SIG);
|
|
(*env)->ExceptionDescribe(env);
|
|
(*env)->ExceptionClear(env);
|
|
return;
|
|
}
|
|
|
|
system("sh ./run_pre");
|
|
|
|
if (quit) {
|
|
fprintf(stderr, "0x%x\n", &gethrtime);
|
|
fflush(stderr);
|
|
return;
|
|
}
|
|
|
|
gethrtime();
|
|
|
|
(*env)->CallStaticVoidMethod(env, main, method, args);
|
|
|
|
gethrtime();
|
|
}
|
|
|