Lines Matching defs:jc
114 dtj_get_dtrace_error(dtj_java_consumer_t *jc, dtj_error_t *e)
116 JNIEnv *jenv = jc->dtjj_jenv;
117 dtrace_hdl_t *dtp = jc->dtjj_consumer->dtjc_dtp;
145 dtj_set_callback_handlers(dtj_java_consumer_t *jc)
147 dtrace_hdl_t *dtp = jc->dtjj_consumer->dtjc_dtp;
151 dtj_throw_dtrace_exception(jc,
158 dtj_throw_dtrace_exception(jc,
165 dtj_throw_dtrace_exception(jc,
172 dtj_throw_dtrace_exception(jc,
179 dtj_throw_dtrace_exception(jc,
185 jc->dtjj_consumer->dtjc_flow = (optval != DTRACEOPT_UNSET);
188 dtj_throw_dtrace_exception(jc,
201 dtj_java_consumer_t *jc;
210 jc = pthread_getspecific(g_dtj_consumer_key);
211 jenv = jc->dtjj_jenv;
263 (*jenv)->CallVoidMethod(jenv, jc->dtjj_caller, g_drop_jm, drop);
276 dtj_java_consumer_t *jc;
287 jc = pthread_getspecific(g_dtj_consumer_key);
288 jenv = jc->dtjj_jenv;
290 probe = dtj_new_probedesc(jc, data->dteda_pdesc);
330 (*jenv)->CallVoidMethod(jenv, jc->dtjj_caller, g_error_jm, error);
349 dtj_java_consumer_t *jc;
364 jc = pthread_getspecific(g_dtj_consumer_key);
365 jenv = jc->dtjj_jenv;
387 ++jc->dtjj_consumer->dtjc_procs_ended;
391 ++jc->dtjj_consumer->dtjc_procs_ended;
399 ++jc->dtjj_consumer->dtjc_procs_ended;
440 (*jenv)->CallVoidMethod(jenv, jc->dtjj_caller, g_proc_jm, process);
449 if (!jc->dtjj_exception) {
451 jc->dtjj_exception = e;
461 dtj_java_consumer_t *jc;
463 jc = pthread_getspecific(g_dtj_consumer_key);
465 jc->dtjj_consumer->dtjc_flow =
569 dtj_recdata(dtj_java_consumer_t *jc, uint32_t size, caddr_t addr)
571 JNIEnv *jenv = jc->dtjj_jenv;
629 dtj_java_consumer_t *jc = arg;
630 JNIEnv *jenv = jc->dtjj_jenv;
667 for (r = jc->dtjj_consumer->dtjc_probedata_rec_i;
688 if (jc->dtjj_consumer->dtjc_probedata_act == DTRACEACT_PRINTF) {
689 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
691 jc->dtjj_consumer->dtjc_probedata_rec_i, r - 1);
703 if (jc->dtjj_probedata) {
705 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
711 (*jenv)->CallVoidMethod(jenv, jc->dtjj_caller,
712 g_pdatanext_jm, jc->dtjj_probedata);
713 (*jenv)->DeleteLocalRef(jenv, jc->dtjj_probedata);
714 jc->dtjj_probedata = NULL;
723 (*jenv)->DeleteLocalRef(jenv, jc->dtjj_printa_buffer);
724 jc->dtjj_printa_buffer = NULL;
731 jc->dtjj_consumer->dtjc_probedata_act = act;
732 jc->dtjj_consumer->dtjc_probedata_rec_i = r;
748 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
750 jc->dtjj_consumer->dtjc_probedata_rec_i);
762 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
773 dtj_aggwalk_init(jc);
778 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
780 jc->dtjj_consumer->dtjc_printa_snaptime,
786 if (jc->dtjj_printa_buffer == NULL) {
797 jc->dtjj_printa_buffer = jbuf;
807 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
809 jc->dtjj_consumer->dtjc_probedata_rec_i);
831 dtj_java_consumer_t *jc = arg;
832 JNIEnv *jenv = jc->dtjj_jenv;
852 if ((jprobe = dtj_new_probedesc(jc, pdesc)) == NULL) {
858 if (jc->dtjj_consumer->dtjc_flow) {
928 rec, jc);
931 rec, jc);
933 jobj = dtj_recdata(jc, rec->dtrd_size,
952 if (jc->dtjj_probedata != NULL) {
958 jc->dtjj_probedata = jpdata;
961 jc->dtjj_consumer->dtjc_probedata_rec_i = 0;
962 jc->dtjj_consumer->dtjc_probedata_act = DTRACEACT_NONE;
963 dtj_aggwalk_init(jc);
1036 dtj_java_consumer_t *jc;
1051 jc = pthread_getspecific(g_dtj_consumer_key);
1052 jenv = jc->dtjj_jenv;
1065 return (dtj_agghandler(bufdata, jc));
1092 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
1109 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
1111 jc->dtjj_consumer->dtjc_probedata_rec_i, jstr);
1129 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
1131 jc->dtjj_consumer->dtjc_probedata_rec_i, jstr);
1190 dtj_java_consumer_t *jc = arg;
1195 if (jc->dtjj_aggregate_spec) {
1196 JNIEnv *jenv = jc->dtjj_jenv;
1207 jc->dtjj_aggregate_spec, g_aggspec_cleared_jm, jname);
1297 const dtrace_recdesc_t *rec, dtj_java_consumer_t *jc)
1303 return (dtj_new_stack_record(addr, rec, jc));
1308 const dtrace_recdesc_t *rec, const char *s, dtj_java_consumer_t *jc)
1311 JNIEnv *jenv = jc->dtjj_jenv;
1319 jobj = dtj_new_stack_record(addr, rec, jc);
1336 dtj_attach_frames(jc, jobj, frames);
1348 const dtrace_recdesc_t *rec, dtj_java_consumer_t *jc)
1353 return (dtj_new_symbol_record(addr, rec, jc));
1358 const dtrace_recdesc_t *rec, const char *s, dtj_java_consumer_t *jc)
1361 JNIEnv *jenv = jc->dtjj_jenv;
1368 jobj = dtj_new_symbol_record(addr, rec, jc);
1387 dtj_attach_name(jc, jobj, jstr);
1399 dtj_aggwalk_init(dtj_java_consumer_t *jc)
1401 jc->dtjj_consumer->dtjc_aggid = -1;
1402 jc->dtjj_consumer->dtjc_expected = -1;
1403 if (jc->dtjj_tuple != NULL) {
1405 dtj_throw_illegal_state(jc->dtjj_jenv,
1412 dtj_java_consumer_t *jc)
1414 JNIEnv *jenv = jc->dtjj_jenv;
1470 dtj_java_consumer_t *jc)
1472 JNIEnv *jenv = jc->dtjj_jenv;
1515 dtj_java_consumer_t *jc)
1517 JNIEnv *jenv = jc->dtjj_jenv;
1598 dtj_attach_frames(dtj_java_consumer_t *jc, jobject stack,
1601 JNIEnv *jenv = jc->dtjj_jenv;
1613 dtj_attach_name(dtj_java_consumer_t *jc, jobject symbol, jstring s)
1615 JNIEnv *jenv = jc->dtjj_jenv;
1632 dtj_agghandler(const dtrace_bufdata_t *bufdata, dtj_java_consumer_t *jc)
1634 JNIEnv *jenv = jc->dtjj_jenv;
1666 if (jc->dtjj_consumer->dtjc_printa_snaptime) {
1678 jc->dtjj_printa_buffer, g_buf_append_str_jm, jstr);
1691 if (aggid != jc->dtjj_consumer->dtjc_aggid) {
1692 jc->dtjj_consumer->dtjc_included =
1693 dtj_is_included(aggdata, jc);
1699 if (!jc->dtjj_consumer->dtjc_included) {
1703 jc->dtjj_consumer->dtjc_aggid = aggid;
1725 if (jc->dtjj_consumer->dtjc_expected < 0) {
1734 jc->dtjj_consumer->dtjc_expected = r - 1;
1740 if (jc->dtjj_tuple == NULL) {
1741 jc->dtjj_tuple = (*jenv)->NewObject(jenv,
1743 if (!jc->dtjj_tuple) {
1755 jobj = dtj_new_tuple_stack_record(aggdata, rec, s, jc);
1762 jobj = dtj_new_tuple_symbol_record(aggdata, rec, s, jc);
1765 jobj = dtj_recdata(jc, rec->dtrd_size,
1774 (*jenv)->CallVoidMethod(jenv, jc->dtjj_tuple,
1795 jvalue = dtj_new_aggval(jc, aggdata, rec);
1808 if (!dtj_list_add(jc->dtjj_aggval_list, aggval)) {
1826 if (jc->dtjj_consumer->dtjc_expected == 0) {
1831 jc->dtjj_tuple = (*jenv)->GetStaticObjectField(jenv,
1833 if (jc->dtjj_tuple == NULL) {
1840 if (jc->dtjj_tuple == NULL) {
1841 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
1847 jc->dtjj_tuple, g_tuplesize_jm);
1849 jc->dtjj_consumer->dtjc_expected) {
1850 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
1852 (*jenv)->DeleteLocalRef(jenv, jc->dtjj_tuple);
1853 jc->dtjj_tuple = NULL;
1857 itr = uu_list_walk_start(jc->dtjj_aggval_list, 0);
1865 g_aggrecinit_jm, jc->dtjj_tuple,
1889 if (jc->dtjj_consumer->dtjc_printa_snaptime) {
1892 jc->dtjj_probedata,
1898 jc->dtjj_aggregate, g_aggaddrec_jm,
1910 dtj_list_clear(jc->dtjj_aggval_list, dtj_aggval_destroy,
1914 if (jc->dtjj_consumer->dtjc_printa_snaptime) {
1920 jc->dtjj_printa_buffer, g_tostring_jm);
1930 (*jenv)->CallVoidMethod(jenv, jc->dtjj_printa_buffer,
1933 (*jenv)->CallVoidMethod(jenv, jc->dtjj_probedata,
1934 g_pdataadd_printa_str_jm, jc->dtjj_tuple, jstr);
1942 (*jenv)->DeleteLocalRef(jenv, jc->dtjj_tuple);
1943 jc->dtjj_tuple = NULL;
1944 jc->dtjj_consumer->dtjc_expected = -1;
1955 dtj_is_included(const dtrace_aggdata_t *data, dtj_java_consumer_t *jc)
1957 JNIEnv *jenv = jc->dtjj_jenv;
1959 if (jc->dtjj_aggregate_spec) {
1971 jc->dtjj_aggregate_spec, g_aggspec_included_jm,
1990 dtj_new_aggval(dtj_java_consumer_t *jc, const dtrace_aggdata_t *data,
1993 JNIEnv *jenv = jc->dtjj_jenv;
2013 jvalue = dtj_new_distribution(data, rec, jc);
2056 dtj_stop(dtj_java_consumer_t *jc)
2062 switch (jc->dtjj_consumer->dtjc_state) {
2070 jenv = jc->dtjj_jenv;
2081 rc = dtrace_status(jc->dtjj_consumer->dtjc_dtp);
2083 rc = dtrace_stop(jc->dtjj_consumer->dtjc_dtp);
2097 dtj_throw_dtrace_exception(jc,
2099 dtrace_errmsg(jc->dtjj_consumer->dtjc_dtp,
2100 dtrace_errno(jc->dtjj_consumer->dtjc_dtp)));
2104 jc->dtjj_consumer->dtjc_state = DTJ_CONSUMER_STOP;
2125 dtj_get_aggregate(dtj_java_consumer_t *jc)
2127 JNIEnv *jenv = jc->dtjj_jenv;
2146 (*jenv)->MonitorEnter(jenv, jc->dtjj_consumer_lock);
2152 dtj_aggwalk_init(jc);
2156 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2169 if (dtrace_aggregate_snap(jc->dtjj_consumer->dtjc_dtp) != 0) {
2180 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2184 if (dtj_get_dtrace_error(jc, &e) == DTJ_OK) {
2186 dtj_throw_dtrace_exception(jc, e.dtje_message);
2189 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2202 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2212 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2215 jc->dtjj_aggregate = aggregate;
2238 rc = dtrace_aggregate_print(jc->dtjj_consumer->dtjc_dtp, NULL, NULL);
2242 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2247 if (dtj_get_dtrace_error(jc, &e) != DTJ_OK) {
2249 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2255 dtj_throw_dtrace_exception(jc, e.dtje_message);
2257 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2262 dtj_aggwalk_init(jc);
2266 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2276 rc = dtrace_aggregate_walk(jc->dtjj_consumer->dtjc_dtp, dtj_clear, jc);
2280 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2285 if (dtj_get_dtrace_error(jc, &e) == DTJ_OK) {
2287 dtj_throw_dtrace_exception(jc, e.dtje_message);
2290 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2294 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2300 aggregate = jc->dtjj_aggregate;
2301 jc->dtjj_aggregate = NULL;
2312 dtj_process_requests(dtj_java_consumer_t *jc)
2315 uu_list_t *list = jc->dtjj_consumer->dtjc_request_list;
2316 pthread_mutex_t *list_lock = &jc->dtjj_consumer->
2330 if (dtrace_setopt(jc->dtjj_consumer->dtjc_dtp, opt,
2333 dtj_throw_dtrace_exception(jc,
2335 dtrace_errmsg(jc->dtjj_consumer->dtjc_dtp,
2336 dtrace_errno(jc->dtjj_consumer->dtjc_dtp)));
2355 dtj_consume(dtj_java_consumer_t *jc)
2357 JNIEnv *jenv = jc->dtjj_jenv;
2358 dtrace_hdl_t *dtp = jc->dtjj_consumer->dtjc_dtp;
2363 if (!jc->dtjj_consumer->dtjc_interrupt) {
2367 if (jc->dtjj_consumer->dtjc_interrupt) {
2369 dtj_stop(jc);
2377 } else if (jc->dtjj_consumer->dtjc_process_list != NULL) {
2378 int nprocs = uu_list_numnodes(jc->dtjj_consumer->
2380 if (jc->dtjj_consumer->dtjc_procs_ended == nprocs) {
2382 dtj_stop(jc);
2392 if (dtj_process_requests(jc) != DTJ_OK) {
2408 (*jenv)->MonitorEnter(jenv, jc->dtjj_consumer_lock);
2413 (*jenv)->CallVoidMethod(jenv, jc->dtjj_caller,
2417 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2420 jc->dtjj_consumer->dtjc_printa_snaptime = gethrtime();
2421 switch (dtrace_work(dtp, NULL, dtj_chew, dtj_chewrec, jc)) {
2437 jc->dtjj_consumer->dtjc_printa_snaptime = 0;
2441 jc->dtjj_consumer_lock);
2445 if (dtj_get_dtrace_error(jc, &e) != DTJ_OK) {
2447 jc->dtjj_consumer->dtjc_printa_snaptime = 0;
2450 jc->dtjj_consumer_lock);
2456 dtj_throw_dtrace_exception(jc, e.dtje_message);
2457 jc->dtjj_consumer->dtjc_printa_snaptime = 0;
2460 jc->dtjj_consumer_lock);
2472 jc->dtjj_consumer->dtjc_printa_snaptime = 0;
2474 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2477 jc->dtjj_consumer->dtjc_printa_snaptime = 0;
2482 (*jenv)->CallVoidMethod(jenv, jc->dtjj_caller,
2484 (*jenv)->MonitorExit(jenv, jc->dtjj_consumer_lock);
2497 if (jc->dtjj_exception) {
2498 (*jenv)->Throw(jenv, jc->dtjj_exception);
2499 (*jenv)->DeleteLocalRef(jenv, jc->dtjj_exception);
2500 jc->dtjj_exception = NULL;