Lines Matching refs:pevent

149 static int cmdline_init(struct tep_handle *pevent)  in cmdline_init()  argument
151 struct cmdline_list *cmdlist = pevent->cmdlist; in cmdline_init()
156 cmdlines = malloc(sizeof(*cmdlines) * pevent->cmdline_count); in cmdline_init()
170 qsort(cmdlines, pevent->cmdline_count, sizeof(*cmdlines), cmdline_cmp); in cmdline_init()
172 pevent->cmdlines = cmdlines; in cmdline_init()
173 pevent->cmdlist = NULL; in cmdline_init()
178 static const char *find_cmdline(struct tep_handle *pevent, int pid) in find_cmdline() argument
186 if (!pevent->cmdlines && cmdline_init(pevent)) in find_cmdline()
191 comm = bsearch(&key, pevent->cmdlines, pevent->cmdline_count, in find_cmdline()
192 sizeof(*pevent->cmdlines), cmdline_cmp); in find_cmdline()
207 int tep_pid_is_registered(struct tep_handle *pevent, int pid) in tep_pid_is_registered() argument
215 if (!pevent->cmdlines && cmdline_init(pevent)) in tep_pid_is_registered()
220 comm = bsearch(&key, pevent->cmdlines, pevent->cmdline_count, in tep_pid_is_registered()
221 sizeof(*pevent->cmdlines), cmdline_cmp); in tep_pid_is_registered()
233 static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid) in add_new_comm() argument
235 struct cmdline *cmdlines = pevent->cmdlines; in add_new_comm()
245 cmdline = bsearch(&key, pevent->cmdlines, pevent->cmdline_count, in add_new_comm()
246 sizeof(*pevent->cmdlines), cmdline_cmp); in add_new_comm()
252 cmdlines = realloc(cmdlines, sizeof(*cmdlines) * (pevent->cmdline_count + 1)); in add_new_comm()
258 cmdlines[pevent->cmdline_count].comm = strdup(comm); in add_new_comm()
259 if (!cmdlines[pevent->cmdline_count].comm) { in add_new_comm()
265 cmdlines[pevent->cmdline_count].pid = pid; in add_new_comm()
267 if (cmdlines[pevent->cmdline_count].comm) in add_new_comm()
268 pevent->cmdline_count++; in add_new_comm()
270 qsort(cmdlines, pevent->cmdline_count, sizeof(*cmdlines), cmdline_cmp); in add_new_comm()
271 pevent->cmdlines = cmdlines; in add_new_comm()
285 int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid) in tep_register_comm() argument
289 if (pevent->cmdlines) in tep_register_comm()
290 return add_new_comm(pevent, comm, pid); in tep_register_comm()
305 item->next = pevent->cmdlist; in tep_register_comm()
307 pevent->cmdlist = item; in tep_register_comm()
308 pevent->cmdline_count++; in tep_register_comm()
313 int tep_register_trace_clock(struct tep_handle *pevent, const char *trace_clock) in tep_register_trace_clock() argument
315 pevent->trace_clock = strdup(trace_clock); in tep_register_trace_clock()
316 if (!pevent->trace_clock) { in tep_register_trace_clock()
370 static int func_map_init(struct tep_handle *pevent) in func_map_init() argument
377 func_map = malloc(sizeof(*func_map) * (pevent->func_count + 1)); in func_map_init()
381 funclist = pevent->funclist; in func_map_init()
394 qsort(func_map, pevent->func_count, sizeof(*func_map), func_cmp); in func_map_init()
399 func_map[pevent->func_count].func = NULL; in func_map_init()
400 func_map[pevent->func_count].addr = 0; in func_map_init()
401 func_map[pevent->func_count].mod = NULL; in func_map_init()
403 pevent->func_map = func_map; in func_map_init()
404 pevent->funclist = NULL; in func_map_init()
410 __find_func(struct tep_handle *pevent, unsigned long long addr) in __find_func() argument
415 if (!pevent->func_map) in __find_func()
416 func_map_init(pevent); in __find_func()
420 func = bsearch(&key, pevent->func_map, pevent->func_count, in __find_func()
421 sizeof(*pevent->func_map), func_bcmp); in __find_func()
442 int tep_set_function_resolver(struct tep_handle *pevent, in tep_set_function_resolver() argument
453 free(pevent->func_resolver); in tep_set_function_resolver()
454 pevent->func_resolver = resolver; in tep_set_function_resolver()
466 void tep_reset_function_resolver(struct tep_handle *pevent) in tep_reset_function_resolver() argument
468 free(pevent->func_resolver); in tep_reset_function_resolver()
469 pevent->func_resolver = NULL; in tep_reset_function_resolver()
473 find_func(struct tep_handle *pevent, unsigned long long addr) in find_func() argument
477 if (!pevent->func_resolver) in find_func()
478 return __find_func(pevent, addr); in find_func()
480 map = &pevent->func_resolver->map; in find_func()
483 map->func = pevent->func_resolver->func(pevent->func_resolver->priv, in find_func()
500 const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr) in tep_find_function() argument
504 map = find_func(pevent, addr); in tep_find_function()
521 tep_find_function_address(struct tep_handle *pevent, unsigned long long addr) in tep_find_function_address() argument
525 map = find_func(pevent, addr); in tep_find_function_address()
542 int tep_register_function(struct tep_handle *pevent, char *func, in tep_register_function() argument
550 item->next = pevent->funclist; in tep_register_function()
563 pevent->funclist = item; in tep_register_function()
564 pevent->func_count++; in tep_register_function()
583 void tep_print_funcs(struct tep_handle *pevent) in tep_print_funcs() argument
587 if (!pevent->func_map) in tep_print_funcs()
588 func_map_init(pevent); in tep_print_funcs()
590 for (i = 0; i < (int)pevent->func_count; i++) { in tep_print_funcs()
592 pevent->func_map[i].addr, in tep_print_funcs()
593 pevent->func_map[i].func); in tep_print_funcs()
594 if (pevent->func_map[i].mod) in tep_print_funcs()
595 printf(" [%s]\n", pevent->func_map[i].mod); in tep_print_funcs()
625 static int printk_map_init(struct tep_handle *pevent) in printk_map_init() argument
632 printk_map = malloc(sizeof(*printk_map) * (pevent->printk_count + 1)); in printk_map_init()
636 printklist = pevent->printklist; in printk_map_init()
648 qsort(printk_map, pevent->printk_count, sizeof(*printk_map), printk_cmp); in printk_map_init()
650 pevent->printk_map = printk_map; in printk_map_init()
651 pevent->printklist = NULL; in printk_map_init()
657 find_printk(struct tep_handle *pevent, unsigned long long addr) in find_printk() argument
662 if (!pevent->printk_map && printk_map_init(pevent)) in find_printk()
667 printk = bsearch(&key, pevent->printk_map, pevent->printk_count, in find_printk()
668 sizeof(*pevent->printk_map), printk_cmp); in find_printk()
682 int tep_register_print_string(struct tep_handle *pevent, const char *fmt, in tep_register_print_string() argument
691 item->next = pevent->printklist; in tep_register_print_string()
709 pevent->printklist = item; in tep_register_print_string()
710 pevent->printk_count++; in tep_register_print_string()
726 void tep_print_printk(struct tep_handle *pevent) in tep_print_printk() argument
730 if (!pevent->printk_map) in tep_print_printk()
731 printk_map_init(pevent); in tep_print_printk()
733 for (i = 0; i < (int)pevent->printk_count; i++) { in tep_print_printk()
735 pevent->printk_map[i].addr, in tep_print_printk()
736 pevent->printk_map[i].printk); in tep_print_printk()
745 static int add_event(struct tep_handle *pevent, struct event_format *event) in add_event() argument
748 struct event_format **events = realloc(pevent->events, sizeof(event) * in add_event()
749 (pevent->nr_events + 1)); in add_event()
753 pevent->events = events; in add_event()
755 for (i = 0; i < pevent->nr_events; i++) { in add_event()
756 if (pevent->events[i]->id > event->id) in add_event()
759 if (i < pevent->nr_events) in add_event()
760 memmove(&pevent->events[i + 1], in add_event()
761 &pevent->events[i], in add_event()
762 sizeof(event) * (pevent->nr_events - i)); in add_event()
764 pevent->events[i] = event; in add_event()
765 pevent->nr_events++; in add_event()
767 event->pevent = pevent; in add_event()
1619 field->elementsize = event->pevent ? in event_read_fields()
1620 event->pevent->long_size : in event_read_fields()
2904 find_func_handler(struct tep_handle *pevent, char *func_name) in find_func_handler() argument
2908 if (!pevent) in find_func_handler()
2911 for (func = pevent->func_handlers; func; func = func->next) { in find_func_handler()
2919 static void remove_func_handler(struct tep_handle *pevent, char *func_name) in remove_func_handler() argument
2924 next = &pevent->func_handlers; in remove_func_handler()
3038 func = find_func_handler(event->pevent, token); in process_function()
3326 unsigned long long tep_read_number(struct tep_handle *pevent, in tep_read_number() argument
3333 return data2host2(pevent, ptr); in tep_read_number()
3335 return data2host4(pevent, ptr); in tep_read_number()
3337 return data2host8(pevent, ptr); in tep_read_number()
3365 *value = tep_read_number(field->event->pevent, in tep_read_number_field()
3373 static int get_common_info(struct tep_handle *pevent, in get_common_info() argument
3383 if (!pevent->events) { in get_common_info()
3388 event = pevent->events[0]; in get_common_info()
3399 static int __parse_common(struct tep_handle *pevent, void *data, in __parse_common() argument
3405 ret = get_common_info(pevent, name, offset, size); in __parse_common()
3409 return tep_read_number(pevent, data + *offset, *size); in __parse_common()
3412 static int trace_parse_common_type(struct tep_handle *pevent, void *data) in trace_parse_common_type() argument
3414 return __parse_common(pevent, data, in trace_parse_common_type()
3415 &pevent->type_size, &pevent->type_offset, in trace_parse_common_type()
3419 static int parse_common_pid(struct tep_handle *pevent, void *data) in parse_common_pid() argument
3421 return __parse_common(pevent, data, in parse_common_pid()
3422 &pevent->pid_size, &pevent->pid_offset, in parse_common_pid()
3426 static int parse_common_pc(struct tep_handle *pevent, void *data) in parse_common_pc() argument
3428 return __parse_common(pevent, data, in parse_common_pc()
3429 &pevent->pc_size, &pevent->pc_offset, in parse_common_pc()
3433 static int parse_common_flags(struct tep_handle *pevent, void *data) in parse_common_flags() argument
3435 return __parse_common(pevent, data, in parse_common_flags()
3436 &pevent->flags_size, &pevent->flags_offset, in parse_common_flags()
3440 static int parse_common_lock_depth(struct tep_handle *pevent, void *data) in parse_common_lock_depth() argument
3442 return __parse_common(pevent, data, in parse_common_lock_depth()
3443 &pevent->ld_size, &pevent->ld_offset, in parse_common_lock_depth()
3447 static int parse_common_migrate_disable(struct tep_handle *pevent, void *data) in parse_common_migrate_disable() argument
3449 return __parse_common(pevent, data, in parse_common_migrate_disable()
3450 &pevent->ld_size, &pevent->ld_offset, in parse_common_migrate_disable()
3463 struct event_format *tep_find_event(struct tep_handle *pevent, int id) in tep_find_event() argument
3470 if (pevent->last_event && pevent->last_event->id == id) in tep_find_event()
3471 return pevent->last_event; in tep_find_event()
3475 eventptr = bsearch(&pkey, pevent->events, pevent->nr_events, in tep_find_event()
3476 sizeof(*pevent->events), events_id_cmp); in tep_find_event()
3479 pevent->last_event = *eventptr; in tep_find_event()
3496 tep_find_event_by_name(struct tep_handle *pevent, in tep_find_event_by_name() argument
3502 if (pevent->last_event && in tep_find_event_by_name()
3503 strcmp(pevent->last_event->name, name) == 0 && in tep_find_event_by_name()
3504 (!sys || strcmp(pevent->last_event->system, sys) == 0)) in tep_find_event_by_name()
3505 return pevent->last_event; in tep_find_event_by_name()
3507 for (i = 0; i < pevent->nr_events; i++) { in tep_find_event_by_name()
3508 event = pevent->events[i]; in tep_find_event_by_name()
3516 if (i == pevent->nr_events) in tep_find_event_by_name()
3519 pevent->last_event = event; in tep_find_event_by_name()
3526 struct tep_handle *pevent = event->pevent; in eval_num_arg() local
3548 val = tep_read_number(pevent, data + arg->field.field->offset, in eval_num_arg()
3588 field_size = pevent->long_size; in eval_num_arg()
3592 offset = tep_read_number(pevent, in eval_num_arg()
3621 val = tep_read_number(pevent, in eval_num_arg()
3722 offset = tep_read_number(pevent, in eval_num_arg()
3734 offset = tep_read_number(pevent, in eval_num_arg()
3809 static void print_bitmask_to_seq(struct tep_handle *pevent, in print_bitmask_to_seq() argument
3841 if (pevent->file_bigendian) in print_bitmask_to_seq()
3867 struct tep_handle *pevent = event->pevent; in print_str_arg() local
3904 field->size == pevent->long_size) { in print_str_arg()
3919 addr = (pevent->long_size == 8) ? in print_str_arg()
3924 printk = find_printk(pevent, addr); in print_str_arg()
3981 offset = tep_read_number(pevent, in print_str_arg()
4012 offset = tep_read_number(pevent, in print_str_arg()
4063 str_offset = data2host4(pevent, data + arg->string.offset); in print_str_arg()
4081 bitmask_offset = data2host4(pevent, data + arg->bitmask.offset); in print_str_arg()
4084 print_bitmask_to_seq(pevent, s, format, len_arg, in print_str_arg()
4216 struct tep_handle *pevent = event->pevent; in make_bprint_args() local
4224 field = pevent->bprint_buf_field; in make_bprint_args()
4225 ip_field = pevent->bprint_ip_field; in make_bprint_args()
4238 pevent->bprint_buf_field = field; in make_bprint_args()
4239 pevent->bprint_ip_field = ip_field; in make_bprint_args()
4242 ip = tep_read_number(pevent, data + ip_field->offset, ip_field->size); in make_bprint_args()
4319 vsize = pevent->long_size; in make_bprint_args()
4336 val = tep_read_number(pevent, bptr, vsize); in make_bprint_args()
4393 struct tep_handle *pevent = event->pevent; in get_bprint_format() local
4399 field = pevent->bprint_fmt_field; in get_bprint_format()
4407 pevent->bprint_fmt_field = field; in get_bprint_format()
4410 addr = tep_read_number(pevent, data + field->offset, field->size); in get_bprint_format()
4412 printk = find_printk(pevent, addr); in get_bprint_format()
4794 struct tep_handle *pevent = field->event->pevent; in tep_print_field() local
4800 val = tep_read_number(pevent, data + offset, len); in tep_print_field()
4820 val = tep_read_number(pevent, data + field->offset, in tep_print_field()
4869 struct tep_handle *pevent = event->pevent; in pretty_print() local
4961 if (pevent->long_size == 4) in pretty_print()
5021 func = find_func(pevent, val); in pretty_print()
5031 if (pevent->long_size == 8 && ls == 1 && in pretty_print()
5138 void tep_data_lat_fmt(struct tep_handle *pevent, in tep_data_lat_fmt() argument
5153 lat_flags = parse_common_flags(pevent, data); in tep_data_lat_fmt()
5154 pc = parse_common_pc(pevent, data); in tep_data_lat_fmt()
5157 lock_depth = parse_common_lock_depth(pevent, data); in tep_data_lat_fmt()
5159 lock_depth = parse_common_lock_depth(pevent, data); in tep_data_lat_fmt()
5168 migrate_disable = parse_common_migrate_disable(pevent, data); in tep_data_lat_fmt()
5170 migrate_disable = parse_common_migrate_disable(pevent, data); in tep_data_lat_fmt()
5218 int tep_data_type(struct tep_handle *pevent, struct tep_record *rec) in tep_data_type() argument
5220 return trace_parse_common_type(pevent, rec->data); in tep_data_type()
5230 struct event_format *tep_data_event_from_type(struct tep_handle *pevent, int type) in tep_data_event_from_type() argument
5232 return tep_find_event(pevent, type); in tep_data_event_from_type()
5242 int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec) in tep_data_pid() argument
5244 return parse_common_pid(pevent, rec->data); in tep_data_pid()
5254 int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec) in tep_data_preempt_count() argument
5256 return parse_common_pc(pevent, rec->data); in tep_data_preempt_count()
5268 int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec) in tep_data_flags() argument
5270 return parse_common_flags(pevent, rec->data); in tep_data_flags()
5281 const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid) in tep_data_comm_from_pid() argument
5285 comm = find_cmdline(pevent, pid); in tep_data_comm_from_pid()
5290 pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *next) in pid_from_cmdlist() argument
5297 cmdlist = pevent->cmdlist; in pid_from_cmdlist()
5318 struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm, in tep_data_pid_from_comm() argument
5327 if (!pevent->cmdlines) in tep_data_pid_from_comm()
5328 return pid_from_cmdlist(pevent, comm, next); in tep_data_pid_from_comm()
5335 if (next < pevent->cmdlines || in tep_data_pid_from_comm()
5336 next >= pevent->cmdlines + pevent->cmdline_count) in tep_data_pid_from_comm()
5343 cmdline = pevent->cmdlines; in tep_data_pid_from_comm()
5345 while (cmdline < pevent->cmdlines + pevent->cmdline_count) { in tep_data_pid_from_comm()
5360 int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) in tep_cmdline_pid() argument
5371 if (!pevent->cmdlines || in tep_cmdline_pid()
5372 cmdline < pevent->cmdlines || in tep_cmdline_pid()
5373 cmdline >= pevent->cmdlines + pevent->cmdline_count) in tep_cmdline_pid()
5393 if (event->pevent->print_raw || (event->flags & EVENT_FL_PRINTRAW)) in tep_event_info()
5430 tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) in tep_find_event_by_record() argument
5439 type = trace_parse_common_type(pevent, record->data); in tep_find_event_by_record()
5441 return tep_find_event(pevent, type); in tep_find_event_by_record()
5453 void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, in tep_print_event_task() argument
5461 pid = parse_common_pid(pevent, data); in tep_print_event_task()
5462 comm = find_cmdline(pevent, pid); in tep_print_event_task()
5464 if (pevent->latency_format) { in tep_print_event_task()
5481 void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, in tep_print_event_time() argument
5492 use_usec_format = is_timestamp_in_us(pevent->trace_clock, in tep_print_event_time()
5499 if (pevent->latency_format) { in tep_print_event_time()
5500 tep_data_lat_fmt(pevent, s, record); in tep_print_event_time()
5504 if (pevent->flags & TEP_NSEC_OUTPUT) { in tep_print_event_time()
5531 void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s, in tep_print_event_data() argument
5548 void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, in tep_print_event() argument
5553 event = tep_find_event_by_record(pevent, record); in tep_print_event()
5556 int type = trace_parse_common_type(pevent, record->data); in tep_print_event()
5566 tep_print_event_task(pevent, s, event, record); in tep_print_event()
5567 tep_print_event_time(pevent, s, event, record, use_trace_clock); in tep_print_event()
5568 tep_print_event_data(pevent, s, event, record); in tep_print_event()
5619 struct event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type sort_type) in tep_list_events() argument
5624 events = pevent->sort_events; in tep_list_events()
5626 if (events && pevent->last_type == sort_type) in tep_list_events()
5630 events = malloc(sizeof(*events) * (pevent->nr_events + 1)); in tep_list_events()
5634 memcpy(events, pevent->events, sizeof(*events) * pevent->nr_events); in tep_list_events()
5635 events[pevent->nr_events] = NULL; in tep_list_events()
5637 pevent->sort_events = events; in tep_list_events()
5641 pevent->last_type = sort_type; in tep_list_events()
5660 qsort(events, pevent->nr_events, sizeof(*events), sort); in tep_list_events()
5661 pevent->last_type = sort_type; in tep_list_events()
5930 int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long size, in tep_parse_header_page() argument
5940 pevent->header_page_ts_size = sizeof(long long); in tep_parse_header_page()
5941 pevent->header_page_size_size = long_size; in tep_parse_header_page()
5942 pevent->header_page_data_offset = sizeof(long long) + long_size; in tep_parse_header_page()
5943 pevent->old_format = 1; in tep_parse_header_page()
5948 parse_header_field("timestamp", &pevent->header_page_ts_offset, in tep_parse_header_page()
5949 &pevent->header_page_ts_size, 1); in tep_parse_header_page()
5950 parse_header_field("commit", &pevent->header_page_size_offset, in tep_parse_header_page()
5951 &pevent->header_page_size_size, 1); in tep_parse_header_page()
5952 parse_header_field("overwrite", &pevent->header_page_overwrite, in tep_parse_header_page()
5954 parse_header_field("data", &pevent->header_page_data_offset, in tep_parse_header_page()
5955 &pevent->header_page_data_size, 1); in tep_parse_header_page()
5983 static int find_event_handle(struct tep_handle *pevent, struct event_format *event) in find_event_handle() argument
5987 for (next = &pevent->handlers; *next; in find_event_handle()
6025 struct tep_handle *pevent, const char *buf, in __tep_parse_format() argument
6068 event->pevent = pevent; in __tep_parse_format()
6080 if (pevent && find_event_handle(pevent, event)) in __tep_parse_format()
6132 __parse_event(struct tep_handle *pevent, in __parse_event() argument
6137 int ret = __tep_parse_format(eventp, pevent, buf, size, sys); in __parse_event()
6143 if (pevent && add_event(pevent, event)) { in __parse_event()
6174 enum tep_errno tep_parse_format(struct tep_handle *pevent, in tep_parse_format() argument
6179 return __parse_event(pevent, eventp, buf, size, sys); in tep_parse_format()
6196 enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf, in tep_parse_event() argument
6200 return __parse_event(pevent, &event, buf, size, sys); in tep_parse_event()
6210 int tep_strerror(struct tep_handle *pevent __maybe_unused, in tep_strerror()
6291 offset = tep_read_number(event->pevent, in tep_get_field_raw()
6424 struct tep_handle *pevent = event->pevent; in tep_print_func_field() local
6435 func = find_func(pevent, val); in tep_print_func_field()
6480 int tep_register_print_function(struct tep_handle *pevent, in tep_register_print_function() argument
6492 func_handle = find_func_handler(pevent, name); in tep_register_print_function()
6500 remove_func_handler(pevent, name); in tep_register_print_function()
6547 func_handle->next = pevent->func_handlers; in tep_register_print_function()
6548 pevent->func_handlers = func_handle; in tep_register_print_function()
6567 int tep_unregister_print_function(struct tep_handle *pevent, in tep_unregister_print_function() argument
6572 func_handle = find_func_handler(pevent, name); in tep_unregister_print_function()
6574 remove_func_handler(pevent, name); in tep_unregister_print_function()
6580 static struct event_format *search_event(struct tep_handle *pevent, int id, in search_event() argument
6588 event = tep_find_event(pevent, id); in search_event()
6596 event = tep_find_event_by_name(pevent, sys_name, event_name); in search_event()
6620 int tep_register_event_handler(struct tep_handle *pevent, int id, in tep_register_event_handler() argument
6627 event = search_event(pevent, id, sys_name, event_name); in tep_register_event_handler()
6662 handle->next = pevent->handlers; in tep_register_event_handler()
6663 pevent->handlers = handle; in tep_register_event_handler()
6704 int tep_unregister_event_handler(struct tep_handle *pevent, int id, in tep_unregister_event_handler() argument
6712 event = search_event(pevent, id, sys_name, event_name); in tep_unregister_event_handler()
6726 for (next = &pevent->handlers; *next; next = &(*next)->next) { in tep_unregister_event_handler()
6747 struct tep_handle *pevent = calloc(1, sizeof(*pevent)); in tep_alloc() local
6749 if (pevent) in tep_alloc()
6750 pevent->ref_count = 1; in tep_alloc()
6752 return pevent; in tep_alloc()
6755 void tep_ref(struct tep_handle *pevent) in tep_ref() argument
6757 pevent->ref_count++; in tep_ref()
6803 void tep_free(struct tep_handle *pevent) in tep_free() argument
6812 if (!pevent) in tep_free()
6815 cmdlist = pevent->cmdlist; in tep_free()
6816 funclist = pevent->funclist; in tep_free()
6817 printklist = pevent->printklist; in tep_free()
6819 pevent->ref_count--; in tep_free()
6820 if (pevent->ref_count) in tep_free()
6823 if (pevent->cmdlines) { in tep_free()
6824 for (i = 0; i < pevent->cmdline_count; i++) in tep_free()
6825 free(pevent->cmdlines[i].comm); in tep_free()
6826 free(pevent->cmdlines); in tep_free()
6836 if (pevent->func_map) { in tep_free()
6837 for (i = 0; i < (int)pevent->func_count; i++) { in tep_free()
6838 free(pevent->func_map[i].func); in tep_free()
6839 free(pevent->func_map[i].mod); in tep_free()
6841 free(pevent->func_map); in tep_free()
6852 while (pevent->func_handlers) { in tep_free()
6853 func_handler = pevent->func_handlers; in tep_free()
6854 pevent->func_handlers = func_handler->next; in tep_free()
6858 if (pevent->printk_map) { in tep_free()
6859 for (i = 0; i < (int)pevent->printk_count; i++) in tep_free()
6860 free(pevent->printk_map[i].printk); in tep_free()
6861 free(pevent->printk_map); in tep_free()
6871 for (i = 0; i < pevent->nr_events; i++) in tep_free()
6872 tep_free_format(pevent->events[i]); in tep_free()
6874 while (pevent->handlers) { in tep_free()
6875 handle = pevent->handlers; in tep_free()
6876 pevent->handlers = handle->next; in tep_free()
6880 free(pevent->trace_clock); in tep_free()
6881 free(pevent->events); in tep_free()
6882 free(pevent->sort_events); in tep_free()
6883 free(pevent->func_resolver); in tep_free()
6885 free(pevent); in tep_free()
6888 void tep_unref(struct tep_handle *pevent) in tep_unref() argument
6890 tep_free(pevent); in tep_unref()