• Home
  • Raw
  • Download

Lines Matching refs:pf

1112 static int convert_variable(Dwarf_Die *vr_die, struct probe_finder *pf)  in convert_variable()  argument
1120 ret = convert_variable_location(vr_die, pf->addr, pf->fb_ops, in convert_variable()
1121 pf->tvar); in convert_variable()
1124 " Perhaps, it has been optimized out.\n", pf->pvar->var); in convert_variable()
1127 else if (pf->pvar->field) { in convert_variable()
1128 ret = convert_variable_fields(vr_die, pf->pvar->var, in convert_variable()
1129 pf->pvar->field, &pf->tvar->ref, in convert_variable()
1134 ret = convert_variable_type(vr_die, pf->tvar, pf->pvar->type); in convert_variable()
1140 static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf) in find_variable() argument
1146 if (!is_c_varname(pf->pvar->var)) { in find_variable()
1148 pf->tvar->value = strdup(pf->pvar->var); in find_variable()
1149 if (pf->tvar->value == NULL) in find_variable()
1151 if (pf->pvar->type) { in find_variable()
1152 pf->tvar->type = strdup(pf->pvar->type); in find_variable()
1153 if (pf->tvar->type == NULL) in find_variable()
1156 if (pf->pvar->name) { in find_variable()
1157 pf->tvar->name = strdup(pf->pvar->name); in find_variable()
1158 if (pf->tvar->name == NULL) in find_variable()
1161 pf->tvar->name = NULL; in find_variable()
1165 if (pf->pvar->name) in find_variable()
1166 pf->tvar->name = strdup(pf->pvar->name); in find_variable()
1168 ret = synthesize_perf_probe_arg(pf->pvar, buf, 32); in find_variable()
1174 pf->tvar->name = strdup(buf); in find_variable()
1176 if (pf->tvar->name == NULL) in find_variable()
1180 pf->pvar->var); in find_variable()
1182 if (die_find_variable_at(sp_die, pf->pvar->var, pf->addr, &vr_die)) in find_variable()
1183 ret = convert_variable(&vr_die, pf); in find_variable()
1192 pf->pvar->var, 0, in find_variable()
1194 ret = convert_variable(&vr_die, pf); in find_variable()
1205 pf->pvar->var); in find_variable()
1246 static int call_probe_finder(Dwarf_Die *sp_die, struct probe_finder *pf) in call_probe_finder() argument
1255 sp_die = die_find_real_subprogram(&pf->cu_die, in call_probe_finder()
1256 pf->addr, &die_mem); in call_probe_finder()
1266 ret = dwarf_getlocation_addr(&fb_attr, pf->addr, &pf->fb_ops, &nops, 1); in call_probe_finder()
1268 pf->fb_ops = NULL; in call_probe_finder()
1270 } else if (nops == 1 && pf->fb_ops[0].atom == DW_OP_call_frame_cfa && in call_probe_finder()
1271 pf->cfi != NULL) { in call_probe_finder()
1273 if (dwarf_cfi_addrframe(pf->cfi, pf->addr, &frame) != 0 || in call_probe_finder()
1274 dwarf_frame_cfa(frame, &pf->fb_ops, &nops) != 0) { in call_probe_finder()
1276 (uintmax_t)pf->addr); in call_probe_finder()
1283 ret = pf->callback(sp_die, pf); in call_probe_finder()
1286 pf->fb_ops = NULL; in call_probe_finder()
1294 struct probe_finder *pf = data; in probe_point_line_walker() local
1297 if (lineno != pf->lno || strtailcmp(fname, pf->fname) != 0) in probe_point_line_walker()
1300 pf->addr = addr; in probe_point_line_walker()
1301 ret = call_probe_finder(NULL, pf); in probe_point_line_walker()
1308 static int find_probe_point_by_line(struct probe_finder *pf) in find_probe_point_by_line() argument
1310 return die_walk_lines(&pf->cu_die, probe_point_line_walker, pf); in find_probe_point_by_line()
1354 struct probe_finder *pf = data; in probe_point_lazy_walker() local
1357 if (!line_list__has_line(&pf->lcache, lineno) || in probe_point_lazy_walker()
1358 strtailcmp(fname, pf->fname) != 0) in probe_point_lazy_walker()
1363 pf->addr = addr; in probe_point_lazy_walker()
1364 ret = call_probe_finder(NULL, pf); in probe_point_lazy_walker()
1374 static int find_probe_point_lazy(Dwarf_Die *sp_die, struct probe_finder *pf) in find_probe_point_lazy() argument
1378 if (list_empty(&pf->lcache)) { in find_probe_point_lazy()
1380 ret = find_lazy_match_lines(&pf->lcache, pf->fname, in find_probe_point_lazy()
1381 pf->pev->point.lazy_line); in find_probe_point_lazy()
1386 return die_walk_lines(sp_die, probe_point_lazy_walker, pf); in find_probe_point_lazy()
1398 struct probe_finder *pf = param->data; in probe_point_inline_cb() local
1399 struct perf_probe_point *pp = &pf->pev->point; in probe_point_inline_cb()
1403 param->retval = find_probe_point_lazy(in_die, pf); in probe_point_inline_cb()
1412 pf->addr = addr; in probe_point_inline_cb()
1413 pf->addr += pp->offset; in probe_point_inline_cb()
1415 (uintmax_t)pf->addr); in probe_point_inline_cb()
1417 param->retval = call_probe_finder(in_die, pf); in probe_point_inline_cb()
1429 struct probe_finder *pf = param->data; in probe_point_search_cb() local
1430 struct perf_probe_point *pp = &pf->pev->point; in probe_point_search_cb()
1441 pf->fname = dwarf_decl_file(sp_die); in probe_point_search_cb()
1443 dwarf_decl_line(sp_die, &pf->lno); in probe_point_search_cb()
1444 pf->lno += pp->line; in probe_point_search_cb()
1445 param->retval = find_probe_point_by_line(pf); in probe_point_search_cb()
1449 param->retval = find_probe_point_lazy(sp_die, pf); in probe_point_search_cb()
1451 if (dwarf_entrypc(sp_die, &pf->addr) != 0) { in probe_point_search_cb()
1457 pf->addr += pp->offset; in probe_point_search_cb()
1459 param->retval = call_probe_finder(sp_die, pf); in probe_point_search_cb()
1462 struct dwarf_callback_param _param = {.data = (void *)pf, in probe_point_search_cb()
1473 static int find_probe_point_by_func(struct probe_finder *pf) in find_probe_point_by_func() argument
1475 struct dwarf_callback_param _param = {.data = (void *)pf, in find_probe_point_by_func()
1477 dwarf_getfuncs(&pf->cu_die, probe_point_search_cb, &_param, 0); in find_probe_point_by_func()
1514 static int find_probes(int fd, struct probe_finder *pf) in find_probes() argument
1516 struct perf_probe_point *pp = &pf->pev->point; in find_probes()
1535 pf->cfi = dwarf_getcfi(dbg); in find_probes()
1539 line_list__init(&pf->lcache); in find_probes()
1546 .cu_die = &pf->cu_die, in find_probes()
1547 .sp_die = &pf->sp_die, in find_probes()
1551 .data = pf, in find_probes()
1556 ret = probe_point_search_cb(&pf->sp_die, &probe_param); in find_probes()
1565 diep = dwarf_offdie(dbg, off + cuhl, &pf->cu_die); in find_probes()
1571 pf->fname = cu_find_realpath(&pf->cu_die, pp->file); in find_probes()
1573 pf->fname = NULL; in find_probes()
1575 if (!pp->file || pf->fname) { in find_probes()
1577 ret = find_probe_point_by_func(pf); in find_probes()
1579 ret = find_probe_point_lazy(NULL, pf); in find_probes()
1581 pf->lno = pp->line; in find_probes()
1582 ret = find_probe_point_by_line(pf); in find_probes()
1591 line_list__free(&pf->lcache); in find_probes()
1599 static int add_probe_trace_event(Dwarf_Die *sp_die, struct probe_finder *pf) in add_probe_trace_event() argument
1602 container_of(pf, struct trace_event_finder, pf); in add_probe_trace_event()
1614 ret = convert_to_trace_point(sp_die, pf->addr, pf->pev->point.retprobe, in add_probe_trace_event()
1623 tev->nargs = pf->pev->nargs; in add_probe_trace_event()
1627 for (i = 0; i < pf->pev->nargs; i++) { in add_probe_trace_event()
1628 pf->pvar = &pf->pev->args[i]; in add_probe_trace_event()
1629 pf->tvar = &tev->args[i]; in add_probe_trace_event()
1630 ret = find_variable(sp_die, pf); in add_probe_trace_event()
1643 .pf = {.pev = pev, .callback = add_probe_trace_event}, in find_probe_trace_events()
1655 ret = find_probes(fd, &tf.pf); in find_probe_trace_events()
1680 ret = convert_variable_location(die_mem, af->pf.addr, in collect_variables_cb()
1681 af->pf.fb_ops, NULL); in collect_variables_cb()
1690 if (af->child && dwarf_haspc(die_mem, af->pf.addr)) in collect_variables_cb()
1697 static int add_available_vars(Dwarf_Die *sp_die, struct probe_finder *pf) in add_available_vars() argument
1700 container_of(pf, struct available_var_finder, pf); in add_available_vars()
1712 ret = convert_to_trace_point(sp_die, pf->addr, pf->pev->point.retprobe, in add_available_vars()
1754 .pf = {.pev = pev, .callback = add_available_vars}, in find_available_vars_at()
1766 ret = find_probes(fd, &af.pf); in find_available_vars_at()