Lines Matching full:pp
120 dt_pid_per_sym(dt_pid_probe_t *pp, const GElf_Sym *symp, const char *func) in dt_pid_per_sym() argument
122 dtrace_hdl_t *dtp = pp->dpp_dtp; in dt_pid_per_sym()
123 dt_pcb_t *pcb = pp->dpp_pcb; in dt_pid_per_sym()
124 dt_proc_t *dpr = pp->dpp_dpr; in dt_pid_per_sym()
135 pid = Pstatus(pp->dpp_pr)->pr_pid; in dt_pid_per_sym()
137 pid = proc_getpid(pp->dpp_pr); in dt_pid_per_sym()
140 dt_dprintf("creating probe pid%d:%s:%s:%s\n", (int)pid, pp->dpp_obj, in dt_pid_per_sym()
141 func, pp->dpp_name); in dt_pid_per_sym()
154 dt_pid_objname(ftp->ftps_mod, sizeof (ftp->ftps_mod), pp->dpp_lmid, in dt_pid_per_sym()
155 pp->dpp_obj); in dt_pid_per_sym()
157 if (!isdash && gmatch("return", pp->dpp_name)) { in dt_pid_per_sym()
158 if (dt_pid_create_return_probe(pp->dpp_pr, dtp, ftp, symp, in dt_pid_per_sym()
159 pp->dpp_stret) < 0) { in dt_pid_per_sym()
169 if (!isdash && gmatch("entry", pp->dpp_name)) { in dt_pid_per_sym()
170 if (dt_pid_create_entry_probe(pp->dpp_pr, dtp, ftp, symp) < 0) { in dt_pid_per_sym()
180 glob = strisglob(pp->dpp_name); in dt_pid_per_sym()
182 off = strtoull(pp->dpp_name, &end, 16); in dt_pid_per_sym()
185 "'%s' is an invalid probe name", pp->dpp_name)); in dt_pid_per_sym()
194 err = dt_pid_create_offset_probe(pp->dpp_pr, pp->dpp_dtp, ftp, in dt_pid_per_sym()
213 if (dt_pid_create_glob_offset_probes(pp->dpp_pr, in dt_pid_per_sym()
214 pp->dpp_dtp, ftp, symp, pp->dpp_name) < 0) { in dt_pid_per_sym()
224 pp->dpp_nmatches += nmatches; in dt_pid_per_sym()
234 dt_pid_probe_t *pp = arg; in dt_pid_sym_filt() local
244 if (pp->dpp_last_taken == 0 || in dt_pid_sym_filt()
245 symp->st_value != pp->dpp_last.st_value || in dt_pid_sym_filt()
246 symp->st_size != pp->dpp_last.st_size) { in dt_pid_sym_filt()
257 if ((pp->dpp_last_taken = gmatch(func, pp->dpp_func)) != 0) { in dt_pid_sym_filt()
258 pp->dpp_last = *symp; in dt_pid_sym_filt()
259 return (dt_pid_per_sym(pp, symp, func)); in dt_pid_sym_filt()
269 dt_pid_probe_t *pp = arg; in dt_pid_per_mod() local
270 dtrace_hdl_t *dtp = pp->dpp_dtp; in dt_pid_per_mod()
271 dt_pcb_t *pcb = pp->dpp_pcb; in dt_pid_per_mod()
272 dt_proc_t *dpr = pp->dpp_dpr; in dt_pid_per_mod()
279 (void) Plmid(pp->dpp_pr, pmp->pr_vaddr, &pp->dpp_lmid); in dt_pid_per_mod()
283 if ((pp->dpp_obj = strrchr(obj, '/')) == NULL) in dt_pid_per_mod()
284 pp->dpp_obj = obj; in dt_pid_per_mod()
286 pp->dpp_obj++; in dt_pid_per_mod()
288 if (Pxlookup_by_name(pp->dpp_pr, pp->dpp_lmid, obj, ".stret1", &sym, in dt_pid_per_mod()
290 pp->dpp_stret[0] = sym.st_value; in dt_pid_per_mod()
292 pp->dpp_stret[0] = 0; in dt_pid_per_mod()
294 if (Pxlookup_by_name(pp->dpp_pr, pp->dpp_lmid, obj, ".stret2", &sym, in dt_pid_per_mod()
296 pp->dpp_stret[1] = sym.st_value; in dt_pid_per_mod()
298 pp->dpp_stret[1] = 0; in dt_pid_per_mod()
300 if (Pxlookup_by_name(pp->dpp_pr, pp->dpp_lmid, obj, ".stret4", &sym, in dt_pid_per_mod()
302 pp->dpp_stret[2] = sym.st_value; in dt_pid_per_mod()
304 pp->dpp_stret[2] = 0; in dt_pid_per_mod()
306 if (Pxlookup_by_name(pp->dpp_pr, pp->dpp_lmid, obj, ".stret8", &sym, in dt_pid_per_mod()
308 pp->dpp_stret[3] = sym.st_value; in dt_pid_per_mod()
310 pp->dpp_stret[3] = 0; in dt_pid_per_mod()
312 pp->dpp_stret[0] = 0; in dt_pid_per_mod()
313 pp->dpp_stret[1] = 0; in dt_pid_per_mod()
314 pp->dpp_stret[2] = 0; in dt_pid_per_mod()
315 pp->dpp_stret[3] = 0; in dt_pid_per_mod()
319 (u_longlong_t)pp->dpp_stret[0], (u_longlong_t)pp->dpp_stret[1], in dt_pid_per_mod()
320 (u_longlong_t)pp->dpp_stret[2], (u_longlong_t)pp->dpp_stret[3]); in dt_pid_per_mod()
323 * If pp->dpp_func contains any globbing meta-characters, we need in dt_pid_per_mod()
327 if (!strisglob(pp->dpp_func)) { in dt_pid_per_mod()
337 if (Pxlookup_by_name(pp->dpp_pr, pp->dpp_lmid, obj, in dt_pid_per_mod()
338 pp->dpp_func, &sym, NULL) != 0) { in dt_pid_per_mod()
339 if (strcmp("-", pp->dpp_func) == 0) { in dt_pid_per_mod()
346 sym.st_size = Pstatus(pp->dpp_pr)->pr_dmodel == in dt_pid_per_mod()
352 } else if (!strisglob(pp->dpp_mod)) { in dt_pid_per_mod()
356 pp->dpp_func, pp->dpp_mod)); in dt_pid_per_mod()
374 if (Ppltdest(pp->dpp_pr, sym.st_value) != NULL) in dt_pid_per_mod()
378 (void) Plookup_by_addr(pp->dpp_pr, sym.st_value, pp->dpp_func, in dt_pid_per_mod()
381 return (dt_pid_per_sym(pp, &sym, pp->dpp_func)); in dt_pid_per_mod()
383 uint_t nmatches = pp->dpp_nmatches; in dt_pid_per_mod()
385 if (Psymbol_iter_by_addr(pp->dpp_pr, obj, PR_SYMTAB, in dt_pid_per_mod()
386 BIND_ANY | TYPE_FUNC, dt_pid_sym_filt, pp) == 1) in dt_pid_per_mod()
389 if (nmatches == pp->dpp_nmatches) { in dt_pid_per_mod()
394 if (Psymbol_iter_by_addr(pp->dpp_pr, obj, PR_DYNSYM, in dt_pid_per_mod()
395 BIND_ANY | TYPE_FUNC, dt_pid_sym_filt, pp) == 1) in dt_pid_per_mod()
407 dt_pid_probe_t *pp = arg; in dt_pid_mod_filt() local
409 if (gmatch(obj, pp->dpp_mod)) in dt_pid_mod_filt()
410 return (dt_pid_per_mod(pp, pmp, obj)); in dt_pid_mod_filt()
413 (void) Plmid(pp->dpp_pr, pmp->pr_vaddr, &pp->dpp_lmid); in dt_pid_mod_filt()
415 pp->dpp_lmid = 0; in dt_pid_mod_filt()
418 if ((pp->dpp_obj = strrchr(obj, '/')) == NULL) in dt_pid_mod_filt()
419 pp->dpp_obj = obj; in dt_pid_mod_filt()
421 pp->dpp_obj++; in dt_pid_mod_filt()
423 if (gmatch(pp->dpp_obj, pp->dpp_mod)) in dt_pid_mod_filt()
424 return (dt_pid_per_mod(pp, pmp, obj)); in dt_pid_mod_filt()
427 (void) Plmid(pp->dpp_pr, pmp->pr_vaddr, &pp->dpp_lmid); in dt_pid_mod_filt()
430 dt_pid_objname(name, sizeof (name), pp->dpp_lmid, pp->dpp_obj); in dt_pid_mod_filt()
432 if (gmatch(name, pp->dpp_mod)) in dt_pid_mod_filt()
433 return (dt_pid_per_mod(pp, pmp, obj)); in dt_pid_mod_filt()
490 dt_pid_probe_t pp; in dt_pid_create_pid_probes() local
493 pp.dpp_dtp = dtp; in dt_pid_create_pid_probes()
494 pp.dpp_dpr = dpr; in dt_pid_create_pid_probes()
495 pp.dpp_pr = dpr->dpr_proc; in dt_pid_create_pid_probes()
496 pp.dpp_pcb = pcb; in dt_pid_create_pid_probes()
503 if (Pname_to_map(pp.dpp_pr, PR_OBJ_LDSO) == NULL) { in dt_pid_create_pid_probes()
510 pp.dpp_mod = pdp->dtpd_mod[0] != '\0' ? pdp->dtpd_mod : "*"; in dt_pid_create_pid_probes()
511 pp.dpp_func = pdp->dtpd_func[0] != '\0' ? pdp->dtpd_func : "*"; in dt_pid_create_pid_probes()
512 pp.dpp_name = pdp->dtpd_name[0] != '\0' ? pdp->dtpd_name : "*"; in dt_pid_create_pid_probes()
513 pp.dpp_last_taken = 0; in dt_pid_create_pid_probes()
515 if (strcmp(pp.dpp_func, "-") == 0) { in dt_pid_create_pid_probes()
519 pp.dpp_mod = pdp->dtpd_mod; in dt_pid_create_pid_probes()
521 } else if (strisglob(pp.dpp_mod) || in dt_pid_create_pid_probes()
522 (aout = Pname_to_map(pp.dpp_pr, "a.out")) == NULL || in dt_pid_create_pid_probes()
523 (pmp = Pname_to_map(pp.dpp_pr, pp.dpp_mod)) == NULL || in dt_pid_create_pid_probes()
530 if (strisglob(pp.dpp_name)) { in dt_pid_create_pid_probes()
538 * If pp.dpp_mod contains any globbing meta-characters, we need in dt_pid_create_pid_probes()
542 if (strisglob(pp.dpp_mod)) { in dt_pid_create_pid_probes()
543 ret = Pobject_iter(pp.dpp_pr, dt_pid_mod_filt, &pp); in dt_pid_create_pid_probes()
553 if ((pmp = dt_pid_fix_mod(pdp, pp.dpp_pr)) != NULL) { in dt_pid_create_pid_probes()
559 ret = dt_pid_per_mod(&pp, pmp, obj); in dt_pid_create_pid_probes()