Ejemplo n.º 1
0
/*ARGSUSED*/
static int
list_probe(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp, void *arg)
{
	dtrace_probeinfo_t p;

	oprintf("%5d %10s %17s %33s %s\n", pdp->dtpd_id,
	    pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func, pdp->dtpd_name);

	if (g_verbose && dtrace_probe_info(dtp, pdp, &p) == 0)
		print_probe_info(&p);

	return (0);
}
Ejemplo n.º 2
0
static int
probe(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp, void *data)
{
	dtrace_probeinfo_t p;
	dtrace_argdesc_t arg;
	char buf[BUFSIZ];
	int i;

	(void) printf("\r%6d", ++g_count);
	(void) fflush(stdout);

	if (dtrace_probe_info(dtp, pdp, &p) != 0) {
		(void) printf(" failed to get probe info for "
		    "%s:%s:%s:%s [%d]\n", pdp->dtpd_provider, pdp->dtpd_mod,
		    pdp->dtpd_func, pdp->dtpd_name, pdp->dtpd_id);
		g_errs++;
		return (0);
	}

	for (i = 0; i < p.dtp_argc; i++) {
		if (p.dtp_argv[i].dtt_type == CTF_ERR) {
			bzero(&arg, sizeof (dtrace_argdesc_t));
			arg.dtargd_id = pdp->dtpd_id;
			arg.dtargd_ndx = i;
			(void) ioctl(g_fd, DTRACEIOC_PROBEARG, &arg);

			(void) printf(" failed to get types for args[%d] "
			    "of %s:%s:%s:%s [%d]: <%s> -> <%s>\n", i,
			    pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func,
			    pdp->dtpd_name, pdp->dtpd_id,
			    arg.dtargd_native, arg.dtargd_xlate);

			g_errs++;

			if (g_errexit)
				return (-1);

		} else if (g_verbose) {
			(void) printf("%d args[%d] : %s\n", pdp->dtpd_id, i,
			    ctf_type_name(p.dtp_argv[i].dtt_ctfp,
			    p.dtp_argv[i].dtt_type, buf, sizeof (buf)));
		}
	}

	return (0);
}
Ejemplo n.º 3
0
/*ARGSUSED*/
static int
info_stmt(dtrace_hdl_t *dtp, dtrace_prog_t *pgp,
    dtrace_stmtdesc_t *stp, dtrace_ecbdesc_t **last)
{
	dtrace_ecbdesc_t *edp = stp->dtsd_ecbdesc;
	dtrace_probedesc_t *pdp = &edp->dted_probe;
	dtrace_probeinfo_t p;

	if (edp == *last)
		return (0);

	oprintf("\n%s:%s:%s:%s\n",
	    pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func, pdp->dtpd_name);

	if (dtrace_probe_info(dtp, pdp, &p) == 0)
		print_probe_info(&p);

	*last = edp;
	return (0);
}