Lines Matching refs:hdl
57 tnfctl_handle_t *hdl;
69 /* allocate hdl and zero fill */
70 hdl = calloc(1, sizeof (*hdl));
71 if (hdl == NULL) {
76 hdl->proc_p = proc_p;
77 hdl->mode = DIRECT_MODE;
78 hdl->called_exit = B_FALSE;
81 hdl->p_read = _tnfctl_read_targ;
82 hdl->p_write = _tnfctl_write_targ;
83 hdl->p_obj_iter = _tnfctl_loadobj_iter;
84 hdl->p_getpid = _tnfctl_pid_get;
90 prexstat = _tnfctl_elf_dbgent(hdl, &dbgaddr);
104 prexstat = _tnfctl_set_state(hdl);
108 prexstat = _tnfctl_external_getlock(hdl);
112 *ret_val = hdl;
118 free(hdl);
133 tnfctl_handle_t *hdl;
144 /* allocate hdl and zero fill */
145 hdl = calloc(1, sizeof (*hdl));
146 if (hdl == NULL) {
151 hdl->proc_p = proc_p;
152 hdl->mode = DIRECT_MODE;
153 hdl->called_exit = B_FALSE;
156 hdl->p_read = _tnfctl_read_targ;
157 hdl->p_write = _tnfctl_write_targ;
158 hdl->p_obj_iter = _tnfctl_loadobj_iter;
159 hdl->p_getpid = _tnfctl_pid_get;
166 prexstat = step_to_end_of_exec(hdl);
168 proc_p = hdl->proc_p;
175 prexstat = _tnfctl_elf_dbgent(hdl, &dbgaddr);
189 prexstat = _tnfctl_set_state(hdl);
194 prexstat = _tnfctl_external_getlock(hdl);
198 *ret_val = hdl;
205 free(hdl);
218 tnfctl_handle_t *hdl;
221 /* allocate hdl and zero fill */
222 hdl = calloc(1, sizeof (*hdl));
223 if (hdl == NULL) {
227 hdl->proc_p = prochandle;
228 hdl->mode = INDIRECT_MODE;
229 hdl->called_exit = B_FALSE;
232 hdl->p_read = config->p_read;
233 hdl->p_write = config->p_write;
234 hdl->p_obj_iter = config->p_obj_iter;
235 hdl->p_getpid = config->p_getpid;
238 prexstat = _tnfctl_set_state(hdl);
240 free(hdl);
244 prexstat = _tnfctl_external_getlock(hdl);
246 free(hdl);
249 *ret_val = hdl;
260 tnfctl_handle_t *hdl;
263 /* allocate hdl and zero fill */
264 hdl = calloc(1, sizeof (*hdl));
265 if (hdl == NULL) {
270 prexstat = _tnfctl_prbk_init(hdl);
274 hdl->mode = KERNEL_MODE;
275 hdl->targ_pid = 0;
278 _tnfctl_prbk_get_other_funcs(&hdl->allocfunc, &hdl->commitfunc,
279 &hdl->rollbackfunc, &hdl->endfunc);
280 _tnfctl_prbk_test_func(&hdl->testfunc);
283 prexstat = _tnfctl_refresh_kernel(hdl);
287 *ret_val = hdl;
298 tnfctl_trace_attrs_get(tnfctl_handle_t *hdl, tnfctl_trace_attrs_t *attrs)
304 LOCK_SYNC(hdl, prexstat, release_lock);
306 attrs->targ_pid = hdl->targ_pid;
307 attrs->trace_file_name = hdl->trace_file_name;
308 attrs->trace_buf_size = hdl->trace_buf_size;
309 attrs->trace_min_size = hdl->trace_min_size;
310 attrs->trace_buf_state = hdl->trace_buf_state;
311 attrs->trace_state = hdl->trace_state;
312 attrs->filter_state = hdl->kpidfilter_state;
315 UNLOCK(hdl, release_lock);
325 tnfctl_buffer_alloc(tnfctl_handle_t *hdl, const char *trace_file_name,
330 if (hdl->mode == KERNEL_MODE) {
332 prexstat = _tnfctl_prbk_buffer_alloc(hdl, trace_file_size);
339 if (hdl->trace_file_name != NULL) {
344 prexstat = _tnfctl_create_tracefile(hdl, trace_file_name,
357 tnfctl_buffer_dealloc(tnfctl_handle_t *hdl)
361 if (hdl->mode != KERNEL_MODE)
365 prexstat = _tnfctl_prbk_buffer_dealloc(hdl);
496 _tnfctl_external_getlock(tnfctl_handle_t *hdl)
504 prexstat = _tnfctl_sym_find(hdl, TNFCTL_INTERNAL_TRACEFLAG,
510 prbstat = hdl->p_read(hdl->proc_p, targ_symbol_ptr,
522 prexstat = _tnfctl_sym_find(hdl, TNFCTL_EXTERNAL_TRACEDPID,
528 prbstat = hdl->p_write(hdl->proc_p, targ_symbol_ptr,
529 &(hdl->targ_pid), sizeof (hdl->targ_pid));
536 hdl->targ_pid));