예제 #1
0
/*
 * Class:     HelperSDT
 * Method:    METHOD_STAP_BT
 * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;)V
 */
JNIEXPORT void JNICALL Java_org_systemtap_byteman_helper_HelperSDT_METHOD_1STAP_1BT
(JNIEnv *env, jobject obj, jstring _rulename, jstring _exception, jint _counter)
{
  char* rulename = get_java_string(env, _rulename);
  char* excp = get_java_string(env, _exception);
  int stdepth = _counter;
  STAP_PROBE3(HelperSDT, method__bt, excp, stdepth, rulename);
}
예제 #2
0
static const char *
pstr (int val)
{
  const char *a = "This is a test message.";
  const char *b = "This is another test message.";

  STAP_PROBE3 (test, ps, a, b, val);

  return val == 0 ? a : b;
}
예제 #3
0
/*
 * Class:     HelperSDT
 * Method:    METHOD_STAP_PROBE2
 * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
 */
JNIEXPORT void JNICALL Java_org_systemtap_byteman_helper_HelperSDT_METHOD_1STAP_1PROBE2
(JNIEnv *env, jobject obj, jstring _rulename, jobject _arg1, jobject _arg2)
{
  char* rulename = get_java_string(env, _rulename);
  _staparg arg1 = {0}; //initialize to zero so we don't get garbage the first time through
  _staparg arg2 = {0};
  arg1 = determine_java_type(env, _arg1, arg1);
  arg2 = determine_java_type(env, _arg2, arg2);
  if(arg1.type == OTHER || arg1.type == NONE)
    arg1.vartype.c = get_java_string(env, _arg1); // we need to create some type of check for strings
  if(arg2.type == OTHER || arg2.type == NONE)
    arg2.vartype.c = get_java_string(env, _arg2);
  STAP_PROBE3(HelperSDT, method__2, arg1.vartype.d, arg2.vartype.d, rulename);

}
예제 #4
0
static void
m4 (const struct funcs *fs, int v)
{
  STAP_PROBE3 (test, m4, fs->val, fs->ps (v), v);
}