Lines Matching refs:tev
993 struct probe_trace_event *tev) in parse_probe_trace_command() argument
995 struct probe_trace_point *tp = &tev->point; in parse_probe_trace_command()
1015 &pr, (float *)(void *)&tev->group, in parse_probe_trace_command()
1016 (float *)(void *)&tev->event); in parse_probe_trace_command()
1022 pr_debug("Group:%s Event:%s probe:%c\n", tev->group, tev->event, pr); in parse_probe_trace_command()
1032 tev->nargs = argc - 2; in parse_probe_trace_command()
1033 tev->args = zalloc(sizeof(struct probe_trace_arg) * tev->nargs); in parse_probe_trace_command()
1034 if (tev->args == NULL) { in parse_probe_trace_command()
1038 for (i = 0; i < tev->nargs; i++) { in parse_probe_trace_command()
1044 tev->args[i].name = strdup(argv[i + 2]); in parse_probe_trace_command()
1046 tev->args[i].value = strdup(p); in parse_probe_trace_command()
1047 if (tev->args[i].name == NULL || tev->args[i].value == NULL) { in parse_probe_trace_command()
1262 char *synthesize_probe_trace_command(struct probe_trace_event *tev) in synthesize_probe_trace_command() argument
1264 struct probe_trace_point *tp = &tev->point; in synthesize_probe_trace_command()
1274 tev->group, tev->event, in synthesize_probe_trace_command()
1279 for (i = 0; i < tev->nargs; i++) { in synthesize_probe_trace_command()
1280 ret = synthesize_probe_trace_arg(&tev->args[i], buf + len, in synthesize_probe_trace_command()
1293 static int convert_to_perf_probe_event(struct probe_trace_event *tev, in convert_to_perf_probe_event() argument
1300 pev->event = strdup(tev->event); in convert_to_perf_probe_event()
1301 pev->group = strdup(tev->group); in convert_to_perf_probe_event()
1306 ret = kprobe_convert_to_perf_probe(&tev->point, &pev->point); in convert_to_perf_probe_event()
1311 pev->nargs = tev->nargs; in convert_to_perf_probe_event()
1315 for (i = 0; i < tev->nargs && ret >= 0; i++) { in convert_to_perf_probe_event()
1316 if (tev->args[i].name) in convert_to_perf_probe_event()
1317 pev->args[i].name = strdup(tev->args[i].name); in convert_to_perf_probe_event()
1319 ret = synthesize_probe_trace_arg(&tev->args[i], in convert_to_perf_probe_event()
1370 static void clear_probe_trace_event(struct probe_trace_event *tev) in clear_probe_trace_event() argument
1375 if (tev->event) in clear_probe_trace_event()
1376 free(tev->event); in clear_probe_trace_event()
1377 if (tev->group) in clear_probe_trace_event()
1378 free(tev->group); in clear_probe_trace_event()
1379 if (tev->point.symbol) in clear_probe_trace_event()
1380 free(tev->point.symbol); in clear_probe_trace_event()
1381 for (i = 0; i < tev->nargs; i++) { in clear_probe_trace_event()
1382 if (tev->args[i].name) in clear_probe_trace_event()
1383 free(tev->args[i].name); in clear_probe_trace_event()
1384 if (tev->args[i].value) in clear_probe_trace_event()
1385 free(tev->args[i].value); in clear_probe_trace_event()
1386 if (tev->args[i].type) in clear_probe_trace_event()
1387 free(tev->args[i].type); in clear_probe_trace_event()
1388 ref = tev->args[i].ref; in clear_probe_trace_event()
1395 if (tev->args) in clear_probe_trace_event()
1396 free(tev->args); in clear_probe_trace_event()
1397 memset(tev, 0, sizeof(*tev)); in clear_probe_trace_event()
1501 struct probe_trace_event tev; in show_perf_probe_events() local
1511 memset(&tev, 0, sizeof(tev)); in show_perf_probe_events()
1524 ret = parse_probe_trace_command(ent->s, &tev); in show_perf_probe_events()
1526 ret = convert_to_perf_probe_event(&tev, &pev); in show_perf_probe_events()
1531 clear_probe_trace_event(&tev); in show_perf_probe_events()
1546 struct probe_trace_event tev; in get_probe_trace_event_names() local
1549 memset(&tev, 0, sizeof(tev)); in get_probe_trace_event_names()
1553 ret = parse_probe_trace_command(ent->s, &tev); in get_probe_trace_event_names()
1557 ret = e_snprintf(buf, 128, "%s:%s", tev.group, in get_probe_trace_event_names()
1558 tev.event); in get_probe_trace_event_names()
1562 ret = strlist__add(sl, tev.event); in get_probe_trace_event_names()
1563 clear_probe_trace_event(&tev); in get_probe_trace_event_names()
1576 static int write_probe_trace_event(int fd, struct probe_trace_event *tev) in write_probe_trace_event() argument
1579 char *buf = synthesize_probe_trace_command(tev); in write_probe_trace_event()
1640 struct probe_trace_event *tev = NULL; in __add_probe_trace_events() local
1658 tev = &tevs[i]; in __add_probe_trace_events()
1665 event = tev->point.symbol; in __add_probe_trace_events()
1678 tev->event = strdup(event); in __add_probe_trace_events()
1679 tev->group = strdup(group); in __add_probe_trace_events()
1680 if (tev->event == NULL || tev->group == NULL) { in __add_probe_trace_events()
1684 ret = write_probe_trace_event(fd, tev); in __add_probe_trace_events()
1693 pev->event = tev->event; in __add_probe_trace_events()
1694 pev->group = tev->group; in __add_probe_trace_events()
1712 printf("\tperf record -e %s:%s -aR sleep 1\n\n", tev->group, in __add_probe_trace_events()
1713 tev->event); in __add_probe_trace_events()
1727 struct probe_trace_event *tev; in convert_to_probe_trace_events() local
1735 tev = *tevs = zalloc(sizeof(struct probe_trace_event)); in convert_to_probe_trace_events()
1736 if (tev == NULL) in convert_to_probe_trace_events()
1740 tev->point.symbol = strdup(pev->point.function); in convert_to_probe_trace_events()
1741 if (tev->point.symbol == NULL) { in convert_to_probe_trace_events()
1745 tev->point.offset = pev->point.offset; in convert_to_probe_trace_events()
1746 tev->point.retprobe = pev->point.retprobe; in convert_to_probe_trace_events()
1747 tev->nargs = pev->nargs; in convert_to_probe_trace_events()
1748 if (tev->nargs) { in convert_to_probe_trace_events()
1749 tev->args = zalloc(sizeof(struct probe_trace_arg) in convert_to_probe_trace_events()
1750 * tev->nargs); in convert_to_probe_trace_events()
1751 if (tev->args == NULL) { in convert_to_probe_trace_events()
1755 for (i = 0; i < tev->nargs; i++) { in convert_to_probe_trace_events()
1757 tev->args[i].name = strdup(pev->args[i].name); in convert_to_probe_trace_events()
1758 if (tev->args[i].name == NULL) { in convert_to_probe_trace_events()
1763 tev->args[i].value = strdup(pev->args[i].var); in convert_to_probe_trace_events()
1764 if (tev->args[i].value == NULL) { in convert_to_probe_trace_events()
1769 tev->args[i].type = strdup(pev->args[i].type); in convert_to_probe_trace_events()
1770 if (tev->args[i].type == NULL) { in convert_to_probe_trace_events()
1779 sym = __find_kernel_function_by_name(tev->point.symbol, NULL); in convert_to_probe_trace_events()
1782 tev->point.symbol); in convert_to_probe_trace_events()
1789 clear_probe_trace_event(tev); in convert_to_probe_trace_events()
1790 free(tev); in convert_to_probe_trace_events()