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