Lines Matching refs:pev
218 static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
222 bool need_dwarf = perf_probe_event_need_dwarf(pev);
236 ntevs = find_probe_trace_events(fd, pev, tevs, max_tevs);
245 synthesize_perf_probe_point(&pev->point));
451 static int show_available_vars_at(int fd, struct perf_probe_event *pev,
461 buf = synthesize_perf_probe_point(&pev->point);
466 ret = find_available_vars_at(fd, pev, &vls, max_vls, externs);
549 static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
553 if (perf_probe_event_need_dwarf(pev)) {
682 static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
684 struct perf_probe_point *pp = &pev->point;
708 pev->event = strdup(arg);
709 if (pev->event == NULL)
711 pev->group = NULL;
934 int parse_perf_probe_command(const char *cmd, struct perf_probe_event *pev)
950 ret = parse_perf_probe_point(argv[0], pev);
955 pev->nargs = argc - 1;
956 pev->args = zalloc(sizeof(struct perf_probe_arg) * pev->nargs);
957 if (pev->args == NULL) {
961 for (i = 0; i < pev->nargs && ret >= 0; i++) {
962 ret = parse_perf_probe_arg(argv[i + 1], &pev->args[i]);
964 is_c_varname(pev->args[i].var) && pev->point.retprobe) {
977 bool perf_probe_event_need_dwarf(struct perf_probe_event *pev)
981 if (pev->point.file || pev->point.line || pev->point.lazy_line)
984 for (i = 0; i < pev->nargs; i++)
985 if (is_c_varname(pev->args[i].var))
1155 char *synthesize_perf_probe_command(struct perf_probe_event *pev)
1160 buf = synthesize_perf_probe_point(&pev->point);
1165 for (i = 0; i < pev->nargs; i++) {
1167 pev->args[i].name);
1294 struct perf_probe_event *pev)
1300 pev->event = strdup(tev->event);
1301 pev->group = strdup(tev->group);
1302 if (pev->event == NULL || pev->group == NULL)
1306 ret = kprobe_convert_to_perf_probe(&tev->point, &pev->point);
1311 pev->nargs = tev->nargs;
1312 pev->args = zalloc(sizeof(struct perf_probe_arg) * pev->nargs);
1313 if (pev->args == NULL)
1317 pev->args[i].name = strdup(tev->args[i].name);
1321 pev->args[i].name = strdup(buf);
1323 if (pev->args[i].name == NULL && ret >= 0)
1328 clear_perf_probe_event(pev);
1333 void clear_perf_probe_event(struct perf_probe_event *pev)
1335 struct perf_probe_point *pp = &pev->point;
1339 if (pev->event)
1340 free(pev->event);
1341 if (pev->group)
1342 free(pev->group);
1349 for (i = 0; i < pev->nargs; i++) {
1350 if (pev->args[i].name)
1351 free(pev->args[i].name);
1352 if (pev->args[i].var)
1353 free(pev->args[i].var);
1354 if (pev->args[i].type)
1355 free(pev->args[i].type);
1356 field = pev->args[i].field;
1365 if (pev->args)
1366 free(pev->args);
1367 memset(pev, 0, sizeof(*pev));
1465 static int show_perf_probe_event(struct perf_probe_event *pev)
1472 place = synthesize_perf_probe_point(&pev->point);
1476 ret = e_snprintf(buf, 128, "%s:%s", pev->group, pev->event);
1482 if (pev->nargs > 0) {
1484 for (i = 0; i < pev->nargs; i++) {
1485 ret = synthesize_perf_probe_arg(&pev->args[i],
1502 struct perf_probe_event pev;
1512 memset(&pev, 0, sizeof(pev));
1526 ret = convert_to_perf_probe_event(&tev, &pev);
1528 ret = show_perf_probe_event(&pev);
1530 clear_perf_probe_event(&pev);
1635 static int __add_probe_trace_events(struct perf_probe_event *pev,
1659 if (pev->event)
1660 event = pev->event;
1662 if (pev->point.function)
1663 event = pev->point.function;
1666 if (pev->group)
1667 group = pev->group;
1691 event = pev->event;
1692 group = pev->group;
1693 pev->event = tev->event;
1694 pev->group = tev->group;
1695 show_perf_probe_event(pev);
1697 pev->event = (char *)event;
1698 pev->group = (char *)group;
1721 static int convert_to_probe_trace_events(struct perf_probe_event *pev,
1730 ret = try_to_find_probe_trace_events(pev, tevs, max_tevs, module);
1740 tev->point.symbol = strdup(pev->point.function);
1745 tev->point.offset = pev->point.offset;
1746 tev->point.retprobe = pev->point.retprobe;
1747 tev->nargs = pev->nargs;
1756 if (pev->args[i].name) {
1757 tev->args[i].name = strdup(pev->args[i].name);
1763 tev->args[i].value = strdup(pev->args[i].var);
1768 if (pev->args[i].type) {
1769 tev->args[i].type = strdup(pev->args[i].type);
1796 struct perf_probe_event *pev;
1820 pkgs[i].pev = &pevs[i];
1822 ret = convert_to_probe_trace_events(pkgs[i].pev,
1833 ret = __add_probe_trace_events(pkgs[i].pev, pkgs[i].tevs,