Lines Matching refs:hdl

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