Lines Matching refs:tep

170 static int cmdline_init(struct tep_handle *tep)  in cmdline_init()  argument
172 struct cmdline_list *cmdlist = tep->cmdlist; in cmdline_init()
177 cmdlines = malloc(sizeof(*cmdlines) * tep->cmdline_count); in cmdline_init()
191 qsort(cmdlines, tep->cmdline_count, sizeof(*cmdlines), cmdline_cmp); in cmdline_init()
193 tep->cmdlines = cmdlines; in cmdline_init()
194 tep->cmdlist = NULL; in cmdline_init()
199 static const char *find_cmdline(struct tep_handle *tep, int pid) in find_cmdline() argument
207 if (!tep->cmdlines && cmdline_init(tep)) in find_cmdline()
212 comm = bsearch(&key, tep->cmdlines, tep->cmdline_count, in find_cmdline()
213 sizeof(*tep->cmdlines), cmdline_cmp); in find_cmdline()
228 bool tep_is_pid_registered(struct tep_handle *tep, int pid) in tep_is_pid_registered() argument
236 if (!tep->cmdlines && cmdline_init(tep)) in tep_is_pid_registered()
241 comm = bsearch(&key, tep->cmdlines, tep->cmdline_count, in tep_is_pid_registered()
242 sizeof(*tep->cmdlines), cmdline_cmp); in tep_is_pid_registered()
254 static int add_new_comm(struct tep_handle *tep, in add_new_comm() argument
257 struct tep_cmdline *cmdlines = tep->cmdlines; in add_new_comm()
269 cmdline = bsearch(&key, tep->cmdlines, tep->cmdline_count, in add_new_comm()
270 sizeof(*tep->cmdlines), cmdline_cmp); in add_new_comm()
287 cmdlines = realloc(cmdlines, sizeof(*cmdlines) * (tep->cmdline_count + 1)); in add_new_comm()
292 tep->cmdlines = cmdlines; in add_new_comm()
300 if (!tep->cmdline_count) { in add_new_comm()
302 tep->cmdlines[0] = key; in add_new_comm()
303 tep->cmdline_count++; in add_new_comm()
308 cmdline = bsearch(&key, tep->cmdlines, tep->cmdline_count - 1, in add_new_comm()
309 sizeof(*tep->cmdlines), cmdline_slot_cmp); in add_new_comm()
311 cnt = tep->cmdline_count; in add_new_comm()
315 cnt -= cmdline - tep->cmdlines; in add_new_comm()
319 if (key.pid > tep->cmdlines[tep->cmdline_count - 1].pid) { in add_new_comm()
320 tep->cmdlines[tep->cmdline_count++] = key; in add_new_comm()
323 cmdline = &tep->cmdlines[0]; in add_new_comm()
328 tep->cmdline_count++; in add_new_comm()
333 static int _tep_register_comm(struct tep_handle *tep, in _tep_register_comm() argument
338 if (tep->cmdlines) in _tep_register_comm()
339 return add_new_comm(tep, comm, pid, override); in _tep_register_comm()
354 item->next = tep->cmdlist; in _tep_register_comm()
356 tep->cmdlist = item; in _tep_register_comm()
357 tep->cmdline_count++; in _tep_register_comm()
372 int tep_register_comm(struct tep_handle *tep, const char *comm, int pid) in tep_register_comm() argument
374 return _tep_register_comm(tep, comm, pid, false); in tep_register_comm()
387 int tep_override_comm(struct tep_handle *tep, const char *comm, int pid) in tep_override_comm() argument
389 if (!tep->cmdlines && cmdline_init(tep)) { in tep_override_comm()
393 return _tep_register_comm(tep, comm, pid, true); in tep_override_comm()
443 static int func_map_init(struct tep_handle *tep) in func_map_init() argument
450 func_map = malloc(sizeof(*func_map) * (tep->func_count + 1)); in func_map_init()
454 funclist = tep->funclist; in func_map_init()
467 qsort(func_map, tep->func_count, sizeof(*func_map), func_cmp); in func_map_init()
472 func_map[tep->func_count].func = NULL; in func_map_init()
473 func_map[tep->func_count].addr = 0; in func_map_init()
474 func_map[tep->func_count].mod = NULL; in func_map_init()
476 tep->func_map = func_map; in func_map_init()
477 tep->funclist = NULL; in func_map_init()
483 __find_func(struct tep_handle *tep, unsigned long long addr) in __find_func() argument
488 if (!tep->func_map) in __find_func()
489 func_map_init(tep); in __find_func()
493 func = bsearch(&key, tep->func_map, tep->func_count, in __find_func()
494 sizeof(*tep->func_map), func_bcmp); in __find_func()
514 int tep_set_function_resolver(struct tep_handle *tep, in tep_set_function_resolver() argument
525 free(tep->func_resolver); in tep_set_function_resolver()
526 tep->func_resolver = resolver; in tep_set_function_resolver()
538 void tep_reset_function_resolver(struct tep_handle *tep) in tep_reset_function_resolver() argument
540 free(tep->func_resolver); in tep_reset_function_resolver()
541 tep->func_resolver = NULL; in tep_reset_function_resolver()
545 find_func(struct tep_handle *tep, unsigned long long addr) in find_func() argument
549 if (!tep->func_resolver) in find_func()
550 return __find_func(tep, addr); in find_func()
552 map = &tep->func_resolver->map; in find_func()
555 map->func = tep->func_resolver->func(tep->func_resolver->priv, in find_func()
572 const char *tep_find_function(struct tep_handle *tep, unsigned long long addr) in tep_find_function() argument
576 map = find_func(tep, addr); in tep_find_function()
593 tep_find_function_address(struct tep_handle *tep, unsigned long long addr) in tep_find_function_address() argument
597 map = find_func(tep, addr); in tep_find_function_address()
614 int tep_register_function(struct tep_handle *tep, char *func, in tep_register_function() argument
622 item->next = tep->funclist; in tep_register_function()
635 tep->funclist = item; in tep_register_function()
636 tep->func_count++; in tep_register_function()
655 void tep_print_funcs(struct tep_handle *tep) in tep_print_funcs() argument
659 if (!tep->func_map) in tep_print_funcs()
660 func_map_init(tep); in tep_print_funcs()
662 for (i = 0; i < (int)tep->func_count; i++) { in tep_print_funcs()
664 tep->func_map[i].addr, in tep_print_funcs()
665 tep->func_map[i].func); in tep_print_funcs()
666 if (tep->func_map[i].mod) in tep_print_funcs()
667 printf(" [%s]\n", tep->func_map[i].mod); in tep_print_funcs()
697 static int printk_map_init(struct tep_handle *tep) in printk_map_init() argument
704 printk_map = malloc(sizeof(*printk_map) * (tep->printk_count + 1)); in printk_map_init()
708 printklist = tep->printklist; in printk_map_init()
720 qsort(printk_map, tep->printk_count, sizeof(*printk_map), printk_cmp); in printk_map_init()
722 tep->printk_map = printk_map; in printk_map_init()
723 tep->printklist = NULL; in printk_map_init()
729 find_printk(struct tep_handle *tep, unsigned long long addr) in find_printk() argument
734 if (!tep->printk_map && printk_map_init(tep)) in find_printk()
739 printk = bsearch(&key, tep->printk_map, tep->printk_count, in find_printk()
740 sizeof(*tep->printk_map), printk_cmp); in find_printk()
754 int tep_register_print_string(struct tep_handle *tep, const char *fmt, in tep_register_print_string() argument
763 item->next = tep->printklist; in tep_register_print_string()
781 tep->printklist = item; in tep_register_print_string()
782 tep->printk_count++; in tep_register_print_string()
798 void tep_print_printk(struct tep_handle *tep) in tep_print_printk() argument
802 if (!tep->printk_map) in tep_print_printk()
803 printk_map_init(tep); in tep_print_printk()
805 for (i = 0; i < (int)tep->printk_count; i++) { in tep_print_printk()
807 tep->printk_map[i].addr, in tep_print_printk()
808 tep->printk_map[i].printk); in tep_print_printk()
817 static int add_event(struct tep_handle *tep, struct tep_event *event) in add_event() argument
820 struct tep_event **events = realloc(tep->events, sizeof(event) * in add_event()
821 (tep->nr_events + 1)); in add_event()
825 tep->events = events; in add_event()
827 for (i = 0; i < tep->nr_events; i++) { in add_event()
828 if (tep->events[i]->id > event->id) in add_event()
831 if (i < tep->nr_events) in add_event()
832 memmove(&tep->events[i + 1], in add_event()
833 &tep->events[i], in add_event()
834 sizeof(event) * (tep->nr_events - i)); in add_event()
836 tep->events[i] = event; in add_event()
837 tep->nr_events++; in add_event()
839 event->tep = tep; in add_event()
1691 field->elementsize = event->tep ? in event_read_fields()
1692 event->tep->long_size : in event_read_fields()
2976 find_func_handler(struct tep_handle *tep, char *func_name) in find_func_handler() argument
2980 if (!tep) in find_func_handler()
2983 for (func = tep->func_handlers; func; func = func->next) { in find_func_handler()
2991 static void remove_func_handler(struct tep_handle *tep, char *func_name) in remove_func_handler() argument
2996 next = &tep->func_handlers; in remove_func_handler()
3110 func = find_func_handler(event->tep, token); in process_function()
3398 unsigned long long tep_read_number(struct tep_handle *tep, in tep_read_number() argument
3407 return tep_data2host2(tep, *(unsigned short *)ptr); in tep_read_number()
3409 return tep_data2host4(tep, *(unsigned int *)ptr); in tep_read_number()
3412 return tep_data2host8(tep, val); in tep_read_number()
3440 *value = tep_read_number(field->event->tep, in tep_read_number_field()
3448 static int get_common_info(struct tep_handle *tep, in get_common_info() argument
3458 if (!tep->events) { in get_common_info()
3463 event = tep->events[0]; in get_common_info()
3474 static int __parse_common(struct tep_handle *tep, void *data, in __parse_common() argument
3480 ret = get_common_info(tep, name, offset, size); in __parse_common()
3484 return tep_read_number(tep, data + *offset, *size); in __parse_common()
3487 static int trace_parse_common_type(struct tep_handle *tep, void *data) in trace_parse_common_type() argument
3489 return __parse_common(tep, data, in trace_parse_common_type()
3490 &tep->type_size, &tep->type_offset, in trace_parse_common_type()
3494 static int parse_common_pid(struct tep_handle *tep, void *data) in parse_common_pid() argument
3496 return __parse_common(tep, data, in parse_common_pid()
3497 &tep->pid_size, &tep->pid_offset, in parse_common_pid()
3501 static int parse_common_pc(struct tep_handle *tep, void *data) in parse_common_pc() argument
3503 return __parse_common(tep, data, in parse_common_pc()
3504 &tep->pc_size, &tep->pc_offset, in parse_common_pc()
3508 static int parse_common_flags(struct tep_handle *tep, void *data) in parse_common_flags() argument
3510 return __parse_common(tep, data, in parse_common_flags()
3511 &tep->flags_size, &tep->flags_offset, in parse_common_flags()
3515 static int parse_common_lock_depth(struct tep_handle *tep, void *data) in parse_common_lock_depth() argument
3517 return __parse_common(tep, data, in parse_common_lock_depth()
3518 &tep->ld_size, &tep->ld_offset, in parse_common_lock_depth()
3522 static int parse_common_migrate_disable(struct tep_handle *tep, void *data) in parse_common_migrate_disable() argument
3524 return __parse_common(tep, data, in parse_common_migrate_disable()
3525 &tep->ld_size, &tep->ld_offset, in parse_common_migrate_disable()
3538 struct tep_event *tep_find_event(struct tep_handle *tep, int id) in tep_find_event() argument
3545 if (tep->last_event && tep->last_event->id == id) in tep_find_event()
3546 return tep->last_event; in tep_find_event()
3550 eventptr = bsearch(&pkey, tep->events, tep->nr_events, in tep_find_event()
3551 sizeof(*tep->events), events_id_cmp); in tep_find_event()
3554 tep->last_event = *eventptr; in tep_find_event()
3571 tep_find_event_by_name(struct tep_handle *tep, in tep_find_event_by_name() argument
3577 if (tep->last_event && in tep_find_event_by_name()
3578 strcmp(tep->last_event->name, name) == 0 && in tep_find_event_by_name()
3579 (!sys || strcmp(tep->last_event->system, sys) == 0)) in tep_find_event_by_name()
3580 return tep->last_event; in tep_find_event_by_name()
3582 for (i = 0; i < tep->nr_events; i++) { in tep_find_event_by_name()
3583 event = tep->events[i]; in tep_find_event_by_name()
3591 if (i == tep->nr_events) in tep_find_event_by_name()
3594 tep->last_event = event; in tep_find_event_by_name()
3601 struct tep_handle *tep = event->tep; in eval_num_arg() local
3623 val = tep_read_number(tep, data + arg->field.field->offset, in eval_num_arg()
3663 field_size = tep->long_size; in eval_num_arg()
3667 offset = tep_read_number(tep, in eval_num_arg()
3696 val = tep_read_number(tep, in eval_num_arg()
3797 offset = tep_read_number(tep, in eval_num_arg()
3809 offset = tep_read_number(tep, in eval_num_arg()
3884 static void print_bitmask_to_seq(struct tep_handle *tep, in print_bitmask_to_seq() argument
3916 if (tep->file_bigendian) in print_bitmask_to_seq()
3942 struct tep_handle *tep = event->tep; in print_str_arg() local
3979 field->size == tep->long_size) { in print_str_arg()
3994 addr = (tep->long_size == 8) ? in print_str_arg()
3999 printk = find_printk(tep, addr); in print_str_arg()
4056 offset = tep_read_number(tep, in print_str_arg()
4087 offset = tep_read_number(tep, in print_str_arg()
4138 str_offset = tep_data2host4(tep, *(unsigned int *)(data + arg->string.offset)); in print_str_arg()
4156 bitmask_offset = tep_data2host4(tep, *(unsigned int *)(data + arg->bitmask.offset)); in print_str_arg()
4159 print_bitmask_to_seq(tep, s, format, len_arg, in print_str_arg()
4291 struct tep_handle *tep = event->tep; in make_bprint_args() local
4299 field = tep->bprint_buf_field; in make_bprint_args()
4300 ip_field = tep->bprint_ip_field; in make_bprint_args()
4313 tep->bprint_buf_field = field; in make_bprint_args()
4314 tep->bprint_ip_field = ip_field; in make_bprint_args()
4317 ip = tep_read_number(tep, data + ip_field->offset, ip_field->size); in make_bprint_args()
4405 vsize = tep->long_size; in make_bprint_args()
4422 val = tep_read_number(tep, bptr, vsize); in make_bprint_args()
4479 struct tep_handle *tep = event->tep; in get_bprint_format() local
4485 field = tep->bprint_fmt_field; in get_bprint_format()
4493 tep->bprint_fmt_field = field; in get_bprint_format()
4496 addr = tep_read_number(tep, data + field->offset, field->size); in get_bprint_format()
4498 printk = find_printk(tep, addr); in get_bprint_format()
4880 struct tep_handle *tep = field->event->tep; in tep_print_field() local
4886 val = tep_read_number(tep, data + offset, len); in tep_print_field()
4906 val = tep_read_number(tep, data + field->offset, in tep_print_field()
4955 struct tep_handle *tep = event->tep; in pretty_print() local
5047 if (tep->long_size == 4) in pretty_print()
5108 func = find_func(tep, val); in pretty_print()
5118 if (tep->long_size == 8 && ls == 1 && in pretty_print()
5220 static void data_latency_format(struct tep_handle *tep, struct trace_seq *s, in data_latency_format() argument
5237 lat_flags = parse_common_flags(tep, data); in data_latency_format()
5238 pc = parse_common_pc(tep, data); in data_latency_format()
5241 lock_depth = parse_common_lock_depth(tep, data); in data_latency_format()
5243 lock_depth = parse_common_lock_depth(tep, data); in data_latency_format()
5252 migrate_disable = parse_common_migrate_disable(tep, data); in data_latency_format()
5254 migrate_disable = parse_common_migrate_disable(tep, data); in data_latency_format()
5310 int tep_data_type(struct tep_handle *tep, struct tep_record *rec) in tep_data_type() argument
5312 return trace_parse_common_type(tep, rec->data); in tep_data_type()
5322 int tep_data_pid(struct tep_handle *tep, struct tep_record *rec) in tep_data_pid() argument
5324 return parse_common_pid(tep, rec->data); in tep_data_pid()
5334 int tep_data_preempt_count(struct tep_handle *tep, struct tep_record *rec) in tep_data_preempt_count() argument
5336 return parse_common_pc(tep, rec->data); in tep_data_preempt_count()
5348 int tep_data_flags(struct tep_handle *tep, struct tep_record *rec) in tep_data_flags() argument
5350 return parse_common_flags(tep, rec->data); in tep_data_flags()
5361 const char *tep_data_comm_from_pid(struct tep_handle *tep, int pid) in tep_data_comm_from_pid() argument
5365 comm = find_cmdline(tep, pid); in tep_data_comm_from_pid()
5370 pid_from_cmdlist(struct tep_handle *tep, const char *comm, struct tep_cmdline *next) in pid_from_cmdlist() argument
5377 cmdlist = tep->cmdlist; in pid_from_cmdlist()
5398 struct tep_cmdline *tep_data_pid_from_comm(struct tep_handle *tep, const char *comm, in tep_data_pid_from_comm() argument
5407 if (!tep->cmdlines) in tep_data_pid_from_comm()
5408 return pid_from_cmdlist(tep, comm, next); in tep_data_pid_from_comm()
5415 if (next < tep->cmdlines || in tep_data_pid_from_comm()
5416 next >= tep->cmdlines + tep->cmdline_count) in tep_data_pid_from_comm()
5423 cmdline = tep->cmdlines; in tep_data_pid_from_comm()
5425 while (cmdline < tep->cmdlines + tep->cmdline_count) { in tep_data_pid_from_comm()
5441 int tep_cmdline_pid(struct tep_handle *tep, struct tep_cmdline *cmdline) in tep_cmdline_pid() argument
5452 if (!tep->cmdlines || in tep_cmdline_pid()
5453 cmdline < tep->cmdlines || in tep_cmdline_pid()
5454 cmdline >= tep->cmdlines + tep->cmdline_count) in tep_cmdline_pid()
5493 tep_find_event_by_record(struct tep_handle *tep, struct tep_record *record) in tep_find_event_by_record() argument
5502 type = trace_parse_common_type(tep, record->data); in tep_find_event_by_record()
5504 return tep_find_event(tep, type); in tep_find_event_by_record()
5514 static void print_event_time(struct tep_handle *tep, struct trace_seq *s, in print_event_time() argument
5553 static void print_string(struct tep_handle *tep, struct trace_seq *s, in print_string() argument
5561 data_latency_format(tep, s, type->format, record); in print_string()
5563 pid = parse_common_pid(tep, record->data); in print_string()
5564 comm = find_cmdline(tep, pid); in print_string()
5578 static void print_int(struct tep_handle *tep, struct trace_seq *s, in print_int() argument
5589 param = parse_common_pid(tep, record->data); in print_int()
5592 return print_event_time(tep, s, type->format, event, record); in print_int()
5652 void tep_print_event(struct tep_handle *tep, struct trace_seq *s, in tep_print_event() argument
5666 event = tep_find_event_by_record(tep, record); in tep_print_event()
5681 print_string(tep, s, record, event, in tep_print_event()
5685 print_int(tep, s, record, event, in tep_print_event()
5748 static struct tep_event **list_events_copy(struct tep_handle *tep) in list_events_copy() argument
5752 if (!tep) in list_events_copy()
5755 events = malloc(sizeof(*events) * (tep->nr_events + 1)); in list_events_copy()
5759 memcpy(events, tep->events, sizeof(*events) * tep->nr_events); in list_events_copy()
5760 events[tep->nr_events] = NULL; in list_events_copy()
5797 struct tep_event **tep_list_events(struct tep_handle *tep, in tep_list_events() argument
5802 if (!tep) in tep_list_events()
5805 events = tep->sort_events; in tep_list_events()
5806 if (events && tep->last_type == sort_type) in tep_list_events()
5810 events = list_events_copy(tep); in tep_list_events()
5814 tep->sort_events = events; in tep_list_events()
5818 tep->last_type = sort_type; in tep_list_events()
5823 list_events_sort(events, tep->nr_events, sort_type); in tep_list_events()
5824 tep->last_type = sort_type; in tep_list_events()
5839 struct tep_event **tep_list_events_copy(struct tep_handle *tep, in tep_list_events_copy() argument
5844 if (!tep) in tep_list_events_copy()
5847 events = list_events_copy(tep); in tep_list_events_copy()
5855 list_events_sort(events, tep->nr_events, sort_type); in tep_list_events_copy()
6124 int tep_parse_header_page(struct tep_handle *tep, char *buf, unsigned long size, in tep_parse_header_page() argument
6134 tep->header_page_ts_size = sizeof(long long); in tep_parse_header_page()
6135 tep->header_page_size_size = long_size; in tep_parse_header_page()
6136 tep->header_page_data_offset = sizeof(long long) + long_size; in tep_parse_header_page()
6137 tep->old_format = 1; in tep_parse_header_page()
6142 parse_header_field("timestamp", &tep->header_page_ts_offset, in tep_parse_header_page()
6143 &tep->header_page_ts_size, 1); in tep_parse_header_page()
6144 parse_header_field("commit", &tep->header_page_size_offset, in tep_parse_header_page()
6145 &tep->header_page_size_size, 1); in tep_parse_header_page()
6146 parse_header_field("overwrite", &tep->header_page_overwrite, in tep_parse_header_page()
6148 parse_header_field("data", &tep->header_page_data_offset, in tep_parse_header_page()
6149 &tep->header_page_data_size, 1); in tep_parse_header_page()
6177 static int find_event_handle(struct tep_handle *tep, struct tep_event *event) in find_event_handle() argument
6181 for (next = &tep->handlers; *next; in find_event_handle()
6219 struct tep_handle *tep, const char *buf, in __tep_parse_format() argument
6262 event->tep = tep; in __tep_parse_format()
6274 if (tep && find_event_handle(tep, event)) in __tep_parse_format()
6326 __parse_event(struct tep_handle *tep, in __parse_event() argument
6331 int ret = __tep_parse_format(eventp, tep, buf, size, sys); in __parse_event()
6337 if (tep && add_event(tep, event)) { in __parse_event()
6368 enum tep_errno tep_parse_format(struct tep_handle *tep, in tep_parse_format() argument
6373 return __parse_event(tep, eventp, buf, size, sys); in tep_parse_format()
6390 enum tep_errno tep_parse_event(struct tep_handle *tep, const char *buf, in tep_parse_event() argument
6394 return __parse_event(tep, &event, buf, size, sys); in tep_parse_event()
6456 offset = tep_read_number(event->tep, in tep_get_field_raw()
6591 struct tep_handle *tep = event->tep; in tep_print_func_field() local
6602 func = find_func(tep, val); in tep_print_func_field()
6647 int tep_register_print_function(struct tep_handle *tep, in tep_register_print_function() argument
6659 func_handle = find_func_handler(tep, name); in tep_register_print_function()
6667 remove_func_handler(tep, name); in tep_register_print_function()
6714 func_handle->next = tep->func_handlers; in tep_register_print_function()
6715 tep->func_handlers = func_handle; in tep_register_print_function()
6734 int tep_unregister_print_function(struct tep_handle *tep, in tep_unregister_print_function() argument
6739 func_handle = find_func_handler(tep, name); in tep_unregister_print_function()
6741 remove_func_handler(tep, name); in tep_unregister_print_function()
6747 static struct tep_event *search_event(struct tep_handle *tep, int id, in search_event() argument
6755 event = tep_find_event(tep, id); in search_event()
6763 event = tep_find_event_by_name(tep, sys_name, event_name); in search_event()
6793 int tep_register_event_handler(struct tep_handle *tep, int id, in tep_register_event_handler() argument
6800 event = search_event(tep, id, sys_name, event_name); in tep_register_event_handler()
6835 handle->next = tep->handlers; in tep_register_event_handler()
6836 tep->handlers = handle; in tep_register_event_handler()
6877 int tep_unregister_event_handler(struct tep_handle *tep, int id, in tep_unregister_event_handler() argument
6885 event = search_event(tep, id, sys_name, event_name); in tep_unregister_event_handler()
6899 for (next = &tep->handlers; *next; next = &(*next)->next) { in tep_unregister_event_handler()
6920 struct tep_handle *tep = calloc(1, sizeof(*tep)); in tep_alloc() local
6922 if (tep) { in tep_alloc()
6923 tep->ref_count = 1; in tep_alloc()
6924 tep->host_bigendian = tep_is_bigendian(); in tep_alloc()
6927 return tep; in tep_alloc()
6930 void tep_ref(struct tep_handle *tep) in tep_ref() argument
6932 tep->ref_count++; in tep_ref()
6935 int tep_get_ref(struct tep_handle *tep) in tep_get_ref() argument
6937 if (tep) in tep_get_ref()
6938 return tep->ref_count; in tep_get_ref()
6985 void tep_free(struct tep_handle *tep) in tep_free() argument
6994 if (!tep) in tep_free()
6997 cmdlist = tep->cmdlist; in tep_free()
6998 funclist = tep->funclist; in tep_free()
6999 printklist = tep->printklist; in tep_free()
7001 tep->ref_count--; in tep_free()
7002 if (tep->ref_count) in tep_free()
7005 if (tep->cmdlines) { in tep_free()
7006 for (i = 0; i < tep->cmdline_count; i++) in tep_free()
7007 free(tep->cmdlines[i].comm); in tep_free()
7008 free(tep->cmdlines); in tep_free()
7018 if (tep->func_map) { in tep_free()
7019 for (i = 0; i < (int)tep->func_count; i++) { in tep_free()
7020 free(tep->func_map[i].func); in tep_free()
7021 free(tep->func_map[i].mod); in tep_free()
7023 free(tep->func_map); in tep_free()
7034 while (tep->func_handlers) { in tep_free()
7035 func_handler = tep->func_handlers; in tep_free()
7036 tep->func_handlers = func_handler->next; in tep_free()
7040 if (tep->printk_map) { in tep_free()
7041 for (i = 0; i < (int)tep->printk_count; i++) in tep_free()
7042 free(tep->printk_map[i].printk); in tep_free()
7043 free(tep->printk_map); in tep_free()
7053 for (i = 0; i < tep->nr_events; i++) in tep_free()
7054 tep_free_event(tep->events[i]); in tep_free()
7056 while (tep->handlers) { in tep_free()
7057 handle = tep->handlers; in tep_free()
7058 tep->handlers = handle->next; in tep_free()
7062 free(tep->events); in tep_free()
7063 free(tep->sort_events); in tep_free()
7064 free(tep->func_resolver); in tep_free()
7066 free(tep); in tep_free()
7069 void tep_unref(struct tep_handle *tep) in tep_unref() argument
7071 tep_free(tep); in tep_unref()