Lines Matching refs:tep
164 static int cmdline_init(struct tep_handle *tep) in cmdline_init() argument
166 struct cmdline_list *cmdlist = tep->cmdlist; in cmdline_init()
171 cmdlines = malloc(sizeof(*cmdlines) * tep->cmdline_count); in cmdline_init()
185 qsort(cmdlines, tep->cmdline_count, sizeof(*cmdlines), cmdline_cmp); in cmdline_init()
187 tep->cmdlines = cmdlines; in cmdline_init()
188 tep->cmdlist = NULL; in cmdline_init()
193 static const char *find_cmdline(struct tep_handle *tep, int pid) in find_cmdline() argument
201 if (!tep->cmdlines && cmdline_init(tep)) in find_cmdline()
206 comm = bsearch(&key, tep->cmdlines, tep->cmdline_count, in find_cmdline()
207 sizeof(*tep->cmdlines), cmdline_cmp); in find_cmdline()
222 bool tep_is_pid_registered(struct tep_handle *tep, int pid) in tep_is_pid_registered() argument
230 if (!tep->cmdlines && cmdline_init(tep)) in tep_is_pid_registered()
235 comm = bsearch(&key, tep->cmdlines, tep->cmdline_count, in tep_is_pid_registered()
236 sizeof(*tep->cmdlines), cmdline_cmp); in tep_is_pid_registered()
248 static int add_new_comm(struct tep_handle *tep, in add_new_comm() argument
251 struct tep_cmdline *cmdlines = tep->cmdlines; in add_new_comm()
263 cmdline = bsearch(&key, tep->cmdlines, tep->cmdline_count, in add_new_comm()
264 sizeof(*tep->cmdlines), cmdline_cmp); in add_new_comm()
281 cmdlines = realloc(cmdlines, sizeof(*cmdlines) * (tep->cmdline_count + 1)); in add_new_comm()
286 tep->cmdlines = cmdlines; in add_new_comm()
294 if (!tep->cmdline_count) { in add_new_comm()
296 tep->cmdlines[0] = key; in add_new_comm()
297 tep->cmdline_count++; in add_new_comm()
302 cmdline = bsearch(&key, tep->cmdlines, tep->cmdline_count - 1, in add_new_comm()
303 sizeof(*tep->cmdlines), cmdline_slot_cmp); in add_new_comm()
305 cnt = tep->cmdline_count; in add_new_comm()
309 cnt -= cmdline - tep->cmdlines; in add_new_comm()
313 if (key.pid > tep->cmdlines[tep->cmdline_count - 1].pid) { in add_new_comm()
314 tep->cmdlines[tep->cmdline_count++] = key; in add_new_comm()
317 cmdline = &tep->cmdlines[0]; in add_new_comm()
322 tep->cmdline_count++; in add_new_comm()
327 static int _tep_register_comm(struct tep_handle *tep, in _tep_register_comm() argument
332 if (tep->cmdlines) in _tep_register_comm()
333 return add_new_comm(tep, comm, pid, override); in _tep_register_comm()
348 item->next = tep->cmdlist; in _tep_register_comm()
350 tep->cmdlist = item; in _tep_register_comm()
351 tep->cmdline_count++; in _tep_register_comm()
366 int tep_register_comm(struct tep_handle *tep, const char *comm, int pid) in tep_register_comm() argument
368 return _tep_register_comm(tep, comm, pid, false); in tep_register_comm()
381 int tep_override_comm(struct tep_handle *tep, const char *comm, int pid) in tep_override_comm() argument
383 if (!tep->cmdlines && cmdline_init(tep)) { in tep_override_comm()
387 return _tep_register_comm(tep, comm, pid, true); in tep_override_comm()
437 static int func_map_init(struct tep_handle *tep) in func_map_init() argument
444 func_map = malloc(sizeof(*func_map) * (tep->func_count + 1)); in func_map_init()
448 funclist = tep->funclist; in func_map_init()
461 qsort(func_map, tep->func_count, sizeof(*func_map), func_cmp); in func_map_init()
466 func_map[tep->func_count].func = NULL; in func_map_init()
467 func_map[tep->func_count].addr = 0; in func_map_init()
468 func_map[tep->func_count].mod = NULL; in func_map_init()
470 tep->func_map = func_map; in func_map_init()
471 tep->funclist = NULL; in func_map_init()
477 __find_func(struct tep_handle *tep, unsigned long long addr) in __find_func() argument
482 if (!tep->func_map) in __find_func()
483 func_map_init(tep); in __find_func()
487 func = bsearch(&key, tep->func_map, tep->func_count, in __find_func()
488 sizeof(*tep->func_map), func_bcmp); in __find_func()
508 int tep_set_function_resolver(struct tep_handle *tep, in tep_set_function_resolver() argument
519 free(tep->func_resolver); in tep_set_function_resolver()
520 tep->func_resolver = resolver; in tep_set_function_resolver()
532 void tep_reset_function_resolver(struct tep_handle *tep) in tep_reset_function_resolver() argument
534 free(tep->func_resolver); in tep_reset_function_resolver()
535 tep->func_resolver = NULL; in tep_reset_function_resolver()
539 find_func(struct tep_handle *tep, unsigned long long addr) in find_func() argument
543 if (!tep->func_resolver) in find_func()
544 return __find_func(tep, addr); in find_func()
546 map = &tep->func_resolver->map; in find_func()
549 map->func = tep->func_resolver->func(tep->func_resolver->priv, in find_func()
566 const char *tep_find_function(struct tep_handle *tep, unsigned long long addr) in tep_find_function() argument
570 map = find_func(tep, addr); in tep_find_function()
587 tep_find_function_address(struct tep_handle *tep, unsigned long long addr) in tep_find_function_address() argument
591 map = find_func(tep, addr); in tep_find_function_address()
608 int tep_register_function(struct tep_handle *tep, char *func, in tep_register_function() argument
616 item->next = tep->funclist; in tep_register_function()
629 tep->funclist = item; in tep_register_function()
630 tep->func_count++; in tep_register_function()
649 void tep_print_funcs(struct tep_handle *tep) in tep_print_funcs() argument
653 if (!tep->func_map) in tep_print_funcs()
654 func_map_init(tep); in tep_print_funcs()
656 for (i = 0; i < (int)tep->func_count; i++) { in tep_print_funcs()
658 tep->func_map[i].addr, in tep_print_funcs()
659 tep->func_map[i].func); in tep_print_funcs()
660 if (tep->func_map[i].mod) in tep_print_funcs()
661 printf(" [%s]\n", tep->func_map[i].mod); in tep_print_funcs()
691 static int printk_map_init(struct tep_handle *tep) in printk_map_init() argument
698 printk_map = malloc(sizeof(*printk_map) * (tep->printk_count + 1)); in printk_map_init()
702 printklist = tep->printklist; in printk_map_init()
714 qsort(printk_map, tep->printk_count, sizeof(*printk_map), printk_cmp); in printk_map_init()
716 tep->printk_map = printk_map; in printk_map_init()
717 tep->printklist = NULL; in printk_map_init()
723 find_printk(struct tep_handle *tep, unsigned long long addr) in find_printk() argument
728 if (!tep->printk_map && printk_map_init(tep)) in find_printk()
733 printk = bsearch(&key, tep->printk_map, tep->printk_count, in find_printk()
734 sizeof(*tep->printk_map), printk_cmp); in find_printk()
748 int tep_register_print_string(struct tep_handle *tep, const char *fmt, in tep_register_print_string() argument
757 item->next = tep->printklist; in tep_register_print_string()
775 tep->printklist = item; in tep_register_print_string()
776 tep->printk_count++; in tep_register_print_string()
792 void tep_print_printk(struct tep_handle *tep) in tep_print_printk() argument
796 if (!tep->printk_map) in tep_print_printk()
797 printk_map_init(tep); in tep_print_printk()
799 for (i = 0; i < (int)tep->printk_count; i++) { in tep_print_printk()
801 tep->printk_map[i].addr, in tep_print_printk()
802 tep->printk_map[i].printk); in tep_print_printk()
811 static int add_event(struct tep_handle *tep, struct tep_event *event) in add_event() argument
814 struct tep_event **events = realloc(tep->events, sizeof(event) * in add_event()
815 (tep->nr_events + 1)); in add_event()
819 tep->events = events; in add_event()
821 for (i = 0; i < tep->nr_events; i++) { in add_event()
822 if (tep->events[i]->id > event->id) in add_event()
825 if (i < tep->nr_events) in add_event()
826 memmove(&tep->events[i + 1], in add_event()
827 &tep->events[i], in add_event()
828 sizeof(event) * (tep->nr_events - i)); in add_event()
830 tep->events[i] = event; in add_event()
831 tep->nr_events++; in add_event()
833 event->tep = tep; in add_event()
1705 field->elementsize = event->tep ? in event_read_fields()
1706 event->tep->long_size : in event_read_fields()
2988 find_func_handler(struct tep_handle *tep, char *func_name) in find_func_handler() argument
2992 if (!tep) in find_func_handler()
2995 for (func = tep->func_handlers; func; func = func->next) { in find_func_handler()
3003 static void remove_func_handler(struct tep_handle *tep, char *func_name) in remove_func_handler() argument
3008 next = &tep->func_handlers; in remove_func_handler()
3161 func = find_func_handler(event->tep, token); in process_function()
3446 unsigned long long tep_read_number(struct tep_handle *tep, in tep_read_number() argument
3455 return data2host2(tep, *(unsigned short *)ptr); in tep_read_number()
3457 return data2host4(tep, *(unsigned int *)ptr); in tep_read_number()
3460 return data2host8(tep, val); in tep_read_number()
3488 *value = tep_read_number(field->event->tep, in tep_read_number_field()
3496 static int get_common_info(struct tep_handle *tep, in get_common_info() argument
3506 if (!tep->events) { in get_common_info()
3511 event = tep->events[0]; in get_common_info()
3522 static int __parse_common(struct tep_handle *tep, void *data, in __parse_common() argument
3528 ret = get_common_info(tep, name, offset, size); in __parse_common()
3532 return tep_read_number(tep, data + *offset, *size); in __parse_common()
3535 static int trace_parse_common_type(struct tep_handle *tep, void *data) in trace_parse_common_type() argument
3537 return __parse_common(tep, data, in trace_parse_common_type()
3538 &tep->type_size, &tep->type_offset, in trace_parse_common_type()
3542 static int parse_common_pid(struct tep_handle *tep, void *data) in parse_common_pid() argument
3544 return __parse_common(tep, data, in parse_common_pid()
3545 &tep->pid_size, &tep->pid_offset, in parse_common_pid()
3549 static int parse_common_pc(struct tep_handle *tep, void *data) in parse_common_pc() argument
3551 return __parse_common(tep, data, in parse_common_pc()
3552 &tep->pc_size, &tep->pc_offset, in parse_common_pc()
3556 static int parse_common_flags(struct tep_handle *tep, void *data) in parse_common_flags() argument
3558 return __parse_common(tep, data, in parse_common_flags()
3559 &tep->flags_size, &tep->flags_offset, in parse_common_flags()
3563 static int parse_common_lock_depth(struct tep_handle *tep, void *data) in parse_common_lock_depth() argument
3565 return __parse_common(tep, data, in parse_common_lock_depth()
3566 &tep->ld_size, &tep->ld_offset, in parse_common_lock_depth()
3570 static int parse_common_migrate_disable(struct tep_handle *tep, void *data) in parse_common_migrate_disable() argument
3572 return __parse_common(tep, data, in parse_common_migrate_disable()
3573 &tep->ld_size, &tep->ld_offset, in parse_common_migrate_disable()
3586 struct tep_event *tep_find_event(struct tep_handle *tep, int id) in tep_find_event() argument
3593 if (tep->last_event && tep->last_event->id == id) in tep_find_event()
3594 return tep->last_event; in tep_find_event()
3598 eventptr = bsearch(&pkey, tep->events, tep->nr_events, in tep_find_event()
3599 sizeof(*tep->events), events_id_cmp); in tep_find_event()
3602 tep->last_event = *eventptr; in tep_find_event()
3619 tep_find_event_by_name(struct tep_handle *tep, in tep_find_event_by_name() argument
3625 if (tep->last_event && in tep_find_event_by_name()
3626 strcmp(tep->last_event->name, name) == 0 && in tep_find_event_by_name()
3627 (!sys || strcmp(tep->last_event->system, sys) == 0)) in tep_find_event_by_name()
3628 return tep->last_event; in tep_find_event_by_name()
3630 for (i = 0; i < tep->nr_events; i++) { in tep_find_event_by_name()
3631 event = tep->events[i]; in tep_find_event_by_name()
3639 if (i == tep->nr_events) in tep_find_event_by_name()
3642 tep->last_event = event; in tep_find_event_by_name()
3649 struct tep_handle *tep = event->tep; in eval_num_arg() local
3671 val = tep_read_number(tep, data + arg->field.field->offset, in eval_num_arg()
3711 field_size = tep->long_size; in eval_num_arg()
3715 offset = tep_read_number(tep, in eval_num_arg()
3744 val = tep_read_number(tep, in eval_num_arg()
3845 offset = tep_read_number(tep, in eval_num_arg()
3857 offset = tep_read_number(tep, in eval_num_arg()
3932 static void print_bitmask_to_seq(struct tep_handle *tep, in print_bitmask_to_seq() argument
3964 if (tep->file_bigendian) in print_bitmask_to_seq()
3990 struct tep_handle *tep = event->tep; in print_str_arg() local
4027 field->size == tep->long_size) { in print_str_arg()
4042 addr = (tep->long_size == 8) ? in print_str_arg()
4047 printk = find_printk(tep, addr); in print_str_arg()
4104 offset = tep_read_number(tep, in print_str_arg()
4135 offset = tep_read_number(tep, in print_str_arg()
4185 str_offset = data2host4(tep, in print_str_arg()
4204 bitmask_offset = data2host4(tep, in print_str_arg()
4210 print_bitmask_to_seq(tep, s, format, len_arg, in print_str_arg()
4342 struct tep_handle *tep = event->tep; in make_bprint_args() local
4350 field = tep->bprint_buf_field; in make_bprint_args()
4351 ip_field = tep->bprint_ip_field; in make_bprint_args()
4364 tep->bprint_buf_field = field; in make_bprint_args()
4365 tep->bprint_ip_field = ip_field; in make_bprint_args()
4368 ip = tep_read_number(tep, data + ip_field->offset, ip_field->size); in make_bprint_args()
4458 vsize = tep->long_size; in make_bprint_args()
4475 val = tep_read_number(tep, bptr, vsize); in make_bprint_args()
4532 struct tep_handle *tep = event->tep; in get_bprint_format() local
4538 field = tep->bprint_fmt_field; in get_bprint_format()
4546 tep->bprint_fmt_field = field; in get_bprint_format()
4549 addr = tep_read_number(tep, data + field->offset, field->size); in get_bprint_format()
4551 printk = find_printk(tep, addr); in get_bprint_format()
4618 static int parse_ip4_print_args(struct tep_handle *tep, in parse_ip4_print_args() argument
4628 if (tep->file_bigendian) in parse_ip4_print_args()
4779 ret = parse_ip4_print_args(event->tep, ptr, &reverse); in print_ipv4_arg()
4887 ret = parse_ip4_print_args(event->tep, ptr, &reverse); in print_ipsa_arg()
5085 offset = tep_read_number(event->tep, in print_raw_buff_arg()
5119 struct tep_handle *tep = field->event->tep; in tep_print_field() local
5125 val = tep_read_number(tep, data + offset, len); in tep_print_field()
5147 val = tep_read_number(tep, data + field->offset, in tep_print_field()
5202 func = find_func(event->tep, val); in print_function()
5208 if (event->tep->long_size == 4) in print_function()
5568 if (event->tep->long_size == 8 && ls == 1 && in parse_arg_format()
5765 static void data_latency_format(struct tep_handle *tep, struct trace_seq *s, in data_latency_format() argument
5782 lat_flags = parse_common_flags(tep, data); in data_latency_format()
5783 pc = parse_common_pc(tep, data); in data_latency_format()
5786 lock_depth = parse_common_lock_depth(tep, data); in data_latency_format()
5788 lock_depth = parse_common_lock_depth(tep, data); in data_latency_format()
5797 migrate_disable = parse_common_migrate_disable(tep, data); in data_latency_format()
5799 migrate_disable = parse_common_migrate_disable(tep, data); in data_latency_format()
5855 int tep_data_type(struct tep_handle *tep, struct tep_record *rec) in tep_data_type() argument
5857 return trace_parse_common_type(tep, rec->data); in tep_data_type()
5867 int tep_data_pid(struct tep_handle *tep, struct tep_record *rec) in tep_data_pid() argument
5869 return parse_common_pid(tep, rec->data); in tep_data_pid()
5879 int tep_data_preempt_count(struct tep_handle *tep, struct tep_record *rec) in tep_data_preempt_count() argument
5881 return parse_common_pc(tep, rec->data); in tep_data_preempt_count()
5893 int tep_data_flags(struct tep_handle *tep, struct tep_record *rec) in tep_data_flags() argument
5895 return parse_common_flags(tep, rec->data); in tep_data_flags()
5906 const char *tep_data_comm_from_pid(struct tep_handle *tep, int pid) in tep_data_comm_from_pid() argument
5910 comm = find_cmdline(tep, pid); in tep_data_comm_from_pid()
5915 pid_from_cmdlist(struct tep_handle *tep, const char *comm, struct tep_cmdline *next) in pid_from_cmdlist() argument
5922 cmdlist = tep->cmdlist; in pid_from_cmdlist()
5943 struct tep_cmdline *tep_data_pid_from_comm(struct tep_handle *tep, const char *comm, in tep_data_pid_from_comm() argument
5952 if (!tep->cmdlines) in tep_data_pid_from_comm()
5953 return pid_from_cmdlist(tep, comm, next); in tep_data_pid_from_comm()
5960 if (next < tep->cmdlines || in tep_data_pid_from_comm()
5961 next >= tep->cmdlines + tep->cmdline_count) in tep_data_pid_from_comm()
5968 cmdline = tep->cmdlines; in tep_data_pid_from_comm()
5970 while (cmdline < tep->cmdlines + tep->cmdline_count) { in tep_data_pid_from_comm()
5986 int tep_cmdline_pid(struct tep_handle *tep, struct tep_cmdline *cmdline) in tep_cmdline_pid() argument
5997 if (!tep->cmdlines || in tep_cmdline_pid()
5998 cmdline < tep->cmdlines || in tep_cmdline_pid()
5999 cmdline >= tep->cmdlines + tep->cmdline_count) in tep_cmdline_pid()
6038 tep_find_event_by_record(struct tep_handle *tep, struct tep_record *record) in tep_find_event_by_record() argument
6047 type = trace_parse_common_type(tep, record->data); in tep_find_event_by_record()
6049 return tep_find_event(tep, type); in tep_find_event_by_record()
6059 static void print_event_time(struct tep_handle *tep, struct trace_seq *s, in print_event_time() argument
6098 static void print_string(struct tep_handle *tep, struct trace_seq *s, in print_string() argument
6106 data_latency_format(tep, s, type->format, record); in print_string()
6108 pid = parse_common_pid(tep, record->data); in print_string()
6109 comm = find_cmdline(tep, pid); in print_string()
6123 static void print_int(struct tep_handle *tep, struct trace_seq *s, in print_int() argument
6134 param = parse_common_pid(tep, record->data); in print_int()
6137 return print_event_time(tep, s, type->format, event, record); in print_int()
6197 void tep_print_event(struct tep_handle *tep, struct trace_seq *s, in tep_print_event() argument
6211 event = tep_find_event_by_record(tep, record); in tep_print_event()
6226 print_string(tep, s, record, event, in tep_print_event()
6230 print_int(tep, s, record, event, in tep_print_event()
6293 static struct tep_event **list_events_copy(struct tep_handle *tep) in list_events_copy() argument
6297 if (!tep) in list_events_copy()
6300 events = malloc(sizeof(*events) * (tep->nr_events + 1)); in list_events_copy()
6304 memcpy(events, tep->events, sizeof(*events) * tep->nr_events); in list_events_copy()
6305 events[tep->nr_events] = NULL; in list_events_copy()
6342 struct tep_event **tep_list_events(struct tep_handle *tep, in tep_list_events() argument
6347 if (!tep) in tep_list_events()
6350 events = tep->sort_events; in tep_list_events()
6351 if (events && tep->last_type == sort_type) in tep_list_events()
6355 events = list_events_copy(tep); in tep_list_events()
6359 tep->sort_events = events; in tep_list_events()
6363 tep->last_type = sort_type; in tep_list_events()
6368 list_events_sort(events, tep->nr_events, sort_type); in tep_list_events()
6369 tep->last_type = sort_type; in tep_list_events()
6384 struct tep_event **tep_list_events_copy(struct tep_handle *tep, in tep_list_events_copy() argument
6389 if (!tep) in tep_list_events_copy()
6392 events = list_events_copy(tep); in tep_list_events_copy()
6400 list_events_sort(events, tep->nr_events, sort_type); in tep_list_events_copy()
6669 int tep_parse_header_page(struct tep_handle *tep, char *buf, unsigned long size, in tep_parse_header_page() argument
6679 tep->header_page_ts_size = sizeof(long long); in tep_parse_header_page()
6680 tep->header_page_size_size = long_size; in tep_parse_header_page()
6681 tep->header_page_data_offset = sizeof(long long) + long_size; in tep_parse_header_page()
6682 tep->old_format = 1; in tep_parse_header_page()
6687 parse_header_field("timestamp", &tep->header_page_ts_offset, in tep_parse_header_page()
6688 &tep->header_page_ts_size, 1); in tep_parse_header_page()
6689 parse_header_field("commit", &tep->header_page_size_offset, in tep_parse_header_page()
6690 &tep->header_page_size_size, 1); in tep_parse_header_page()
6691 parse_header_field("overwrite", &tep->header_page_overwrite, in tep_parse_header_page()
6693 parse_header_field("data", &tep->header_page_data_offset, in tep_parse_header_page()
6694 &tep->header_page_data_size, 1); in tep_parse_header_page()
6722 static int find_event_handle(struct tep_handle *tep, struct tep_event *event) in find_event_handle() argument
6726 for (next = &tep->handlers; *next; in find_event_handle()
6764 struct tep_handle *tep, const char *buf, in parse_format() argument
6807 event->tep = tep; in parse_format()
6819 if (tep && find_event_handle(tep, event)) in parse_format()
6875 __parse_event(struct tep_handle *tep, in __parse_event() argument
6880 int ret = parse_format(eventp, tep, buf, size, sys); in __parse_event()
6886 if (tep && add_event(tep, event)) { in __parse_event()
6917 enum tep_errno tep_parse_format(struct tep_handle *tep, in tep_parse_format() argument
6922 return __parse_event(tep, eventp, buf, size, sys); in tep_parse_format()
6939 enum tep_errno tep_parse_event(struct tep_handle *tep, const char *buf, in tep_parse_event() argument
6943 return __parse_event(tep, &event, buf, size, sys); in tep_parse_event()
7005 offset = tep_read_number(event->tep, in tep_get_field_raw()
7142 struct tep_handle *tep = event->tep; in tep_print_func_field() local
7153 func = find_func(tep, val); in tep_print_func_field()
7198 int tep_register_print_function(struct tep_handle *tep, in tep_register_print_function() argument
7210 func_handle = find_func_handler(tep, name); in tep_register_print_function()
7218 remove_func_handler(tep, name); in tep_register_print_function()
7265 func_handle->next = tep->func_handlers; in tep_register_print_function()
7266 tep->func_handlers = func_handle; in tep_register_print_function()
7285 int tep_unregister_print_function(struct tep_handle *tep, in tep_unregister_print_function() argument
7290 func_handle = find_func_handler(tep, name); in tep_unregister_print_function()
7292 remove_func_handler(tep, name); in tep_unregister_print_function()
7298 static struct tep_event *search_event(struct tep_handle *tep, int id, in search_event() argument
7306 event = tep_find_event(tep, id); in search_event()
7314 event = tep_find_event_by_name(tep, sys_name, event_name); in search_event()
7344 int tep_register_event_handler(struct tep_handle *tep, int id, in tep_register_event_handler() argument
7351 event = search_event(tep, id, sys_name, event_name); in tep_register_event_handler()
7386 handle->next = tep->handlers; in tep_register_event_handler()
7387 tep->handlers = handle; in tep_register_event_handler()
7428 int tep_unregister_event_handler(struct tep_handle *tep, int id, in tep_unregister_event_handler() argument
7436 event = search_event(tep, id, sys_name, event_name); in tep_unregister_event_handler()
7450 for (next = &tep->handlers; *next; next = &(*next)->next) { in tep_unregister_event_handler()
7471 struct tep_handle *tep = calloc(1, sizeof(*tep)); in tep_alloc() local
7473 if (tep) { in tep_alloc()
7474 tep->ref_count = 1; in tep_alloc()
7475 tep->host_bigendian = tep_is_bigendian(); in tep_alloc()
7478 return tep; in tep_alloc()
7481 void tep_ref(struct tep_handle *tep) in tep_ref() argument
7483 tep->ref_count++; in tep_ref()
7486 int tep_get_ref(struct tep_handle *tep) in tep_get_ref() argument
7488 if (tep) in tep_get_ref()
7489 return tep->ref_count; in tep_get_ref()
7536 void tep_free(struct tep_handle *tep) in tep_free() argument
7545 if (!tep) in tep_free()
7548 cmdlist = tep->cmdlist; in tep_free()
7549 funclist = tep->funclist; in tep_free()
7550 printklist = tep->printklist; in tep_free()
7552 tep->ref_count--; in tep_free()
7553 if (tep->ref_count) in tep_free()
7556 if (tep->cmdlines) { in tep_free()
7557 for (i = 0; i < tep->cmdline_count; i++) in tep_free()
7558 free(tep->cmdlines[i].comm); in tep_free()
7559 free(tep->cmdlines); in tep_free()
7569 if (tep->func_map) { in tep_free()
7570 for (i = 0; i < (int)tep->func_count; i++) { in tep_free()
7571 free(tep->func_map[i].func); in tep_free()
7572 free(tep->func_map[i].mod); in tep_free()
7574 free(tep->func_map); in tep_free()
7585 while (tep->func_handlers) { in tep_free()
7586 func_handler = tep->func_handlers; in tep_free()
7587 tep->func_handlers = func_handler->next; in tep_free()
7591 if (tep->printk_map) { in tep_free()
7592 for (i = 0; i < (int)tep->printk_count; i++) in tep_free()
7593 free(tep->printk_map[i].printk); in tep_free()
7594 free(tep->printk_map); in tep_free()
7604 for (i = 0; i < tep->nr_events; i++) in tep_free()
7605 free_tep_event(tep->events[i]); in tep_free()
7607 while (tep->handlers) { in tep_free()
7608 handle = tep->handlers; in tep_free()
7609 tep->handlers = handle->next; in tep_free()
7613 free(tep->events); in tep_free()
7614 free(tep->sort_events); in tep_free()
7615 free(tep->func_resolver); in tep_free()
7616 free_tep_plugin_paths(tep); in tep_free()
7618 free(tep); in tep_free()
7621 void tep_unref(struct tep_handle *tep) in tep_unref() argument
7623 tep_free(tep); in tep_unref()