Beispiel #1
0
static int
xhci_mdb_walk_xhci_init(mdb_walk_state_t *wsp)
{
	GElf_Sym sym;
	uintptr_t addr;

	if (wsp->walk_addr != 0) {
		mdb_warn("::walk xhci only supports global walks\n");
		return (WALK_ERR);
	}

	if (mdb_lookup_by_obj("xhci", "xhci_soft_state", &sym) != 0) {
		mdb_warn("failed to find xhci_soft_state symbol");
		return (WALK_ERR);
	}

	if (mdb_vread(&addr, sizeof (addr), sym.st_value) != sizeof (addr)) {
		mdb_warn("failed to read xhci_soft_state at %p", addr);
		return (WALK_ERR);
	}

	wsp->walk_addr = addr;
	if (mdb_layered_walk("softstate", wsp) != 0) {
		mdb_warn("failed to walk softstate");
		return (WALK_ERR);
	}

	return (WALK_NEXT);
}
Beispiel #2
0
static int
mac_srs_walk_init(mdb_walk_state_t *wsp)
{
	if (mdb_layered_walk(LAYERED_WALKER_FOR_SRS, wsp) == -1) {
		mdb_warn("failed to walk 'mac_srs'");
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}
Beispiel #3
0
static int
mac_ring_walk_init(mdb_walk_state_t *wsp)
{
	if (mdb_layered_walk(LAYERED_WALKER_FOR_RING, wsp) == -1) {
		mdb_warn("failed to walk `mac_ring`");
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}
Beispiel #4
0
int
tcp_stacks_walk_init(mdb_walk_state_t *wsp)
{
	if (mdb_layered_walk("netstack", wsp) == -1) {
		mdb_warn("can't walk 'netstack'");
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}
Beispiel #5
0
int
cyccpu_walk_init(mdb_walk_state_t *wsp)
{
	if (mdb_layered_walk("cpu", wsp) == -1) {
		mdb_warn("couldn't walk 'cpu'");
		return (WALK_ERR);
	}

	return (WALK_NEXT);
}
Beispiel #6
0
int
mi_payload_walk_init(mdb_walk_state_t *wsp)
{
	const mi_payload_walk_arg_t *arg = wsp->walk_arg;

	if (mdb_layered_walk(arg->mi_pwa_walker, wsp) == -1) {
		mdb_warn("can't walk '%s'", arg->mi_pwa_walker);
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}
Beispiel #7
0
int
zsd_walk_init(mdb_walk_state_t *wsp)
{
	if (wsp->walk_addr == 0) {
		mdb_warn("global walk not supported\n");
		return (WALK_ERR);
	}
	wsp->walk_addr += offsetof(struct zone, zone_zsd);
	if (mdb_layered_walk("list", wsp) == -1) {
		mdb_warn("couldn't walk 'list'");
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}
Beispiel #8
0
static int
walk_thread_info_init(mdb_walk_state_t *wsp)
{
	if (mdb_readvar(&wsp->walk_addr, "thread_list") == -1) {
		mdb_warn("unable to read thread_list");
		return (WALK_ERR);
	}

	if (mdb_layered_walk("uu_list_node", wsp) == -1) {
		mdb_warn("couldn't walk 'uu_list_node'");
		return (WALK_ERR);
	}

	return (WALK_NEXT);
}
Beispiel #9
0
/*
 * Initialize a walk for the NCA timer list.  Note that local walks
 * are not supported since this walk is layered on top of "nca_cpu"
 * which doesn't support them (and they're not too useful here anyway).
 */
static int
nca_timer_walk_init(mdb_walk_state_t *wsp)
{
	if (wsp->walk_addr != 0) {
		mdb_warn("nca_timer_walk does not support local walks\n");
		return (WALK_DONE);
	}

	if (mdb_layered_walk("nca_cpu", wsp) == -1) {
		mdb_warn("cannot walk nca_cpu");
		return (WALK_ERR);
	}

	return (WALK_NEXT);
}
Beispiel #10
0
int
allpages_walk_init(mdb_walk_state_t *wsp)
{
	if (wsp->walk_addr != 0) {
		mdb_warn("allpages only supports global walks.\n");
		return (WALK_ERR);
	}

	if (mdb_layered_walk("memseg", wsp) == -1) {
		mdb_warn("couldn't walk 'memseg'");
		return (WALK_ERR);
	}

	wsp->walk_data = mdb_alloc(sizeof (page_t) * PAGE_BUFFER, UM_SLEEP);
	return (WALK_NEXT);
}
Beispiel #11
0
/*
 * Walker to list the tasks in a session.  The session is
 * provided as input.
 */
static int
srpt_task_walk_init(mdb_walk_state_t *wsp)
{
	if (wsp->walk_addr == NULL) {
		mdb_warn("<srpt_session_t addr>::walk srpt_tasks\n");
		return (WALK_ERR);
	}

	wsp->walk_addr += offsetof(srpt_session_t, ss_task_list);

	if (mdb_layered_walk("list", wsp) == -1) {
		mdb_warn("session task list walk failed");
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}
Beispiel #12
0
/*
 * To walk groups we have to have our own somewhat-complicated state machine. We
 * basically start by walking the mac_impl_t walker as all groups are stored off
 * of the various mac_impl_t in the system. The tx and rx rings are kept
 * separately. So we'll need to walk through all the rx rings and then all of
 * the tx rings.
 */
static int
mac_group_walk_init(mdb_walk_state_t *wsp)
{
	int ret;

	if (wsp->walk_addr != 0) {
		mdb_warn("non-global walks are not supported\n");
		return (WALK_ERR);
	}

	if ((ret = mdb_layered_walk(LAYERED_WALKER_FOR_GROUP, wsp)) == -1) {
		mdb_warn("couldn't walk '%s'", LAYERED_WALKER_FOR_GROUP);
		return (ret);
	}

	return (WALK_NEXT);
}
Beispiel #13
0
int
zone_walk_init(mdb_walk_state_t *wsp)
{
	GElf_Sym sym;

	if (wsp->walk_addr == 0) {
		if (mdb_lookup_by_name("zone_active", &sym) == -1) {
			mdb_warn("failed to find 'zone_active'");
			return (WALK_ERR);
		}
		wsp->walk_addr = (uintptr_t)sym.st_value;
	}
	if (mdb_layered_walk("list", wsp) == -1) {
		mdb_warn("couldn't walk 'list'");
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}
Beispiel #14
0
/*
 * Walker to list the SCSI sessions per target. The target is
 * provided as input.
 */
static int
srpt_scsi_session_walk_init(mdb_walk_state_t *wsp)
{
	/*
	 * Input should be a srpt_target_port_t, read it to get the
	 * srpt_session_t
	 */
	if (wsp->walk_addr == NULL) {
		mdb_warn("<srpt_target_port_t addr>::walk srpt_scsi_session\n");
		return (WALK_ERR);
	}

	wsp->walk_addr += offsetof(srpt_target_port_t, tp_sess_list);

	if (mdb_layered_walk("list", wsp) == -1) {
		mdb_warn("target session list walk failed");
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}
Beispiel #15
0
/*
 * Walker to list the channels per SRP target service. The target port is
 * provided as input.
 */
static int
srpt_channel_walk_init(mdb_walk_state_t *wsp)
{
	/*
	 * Input should be a srpt_target_port_t, read it to get the
	 * list of channels
	 */
	if (wsp->walk_addr == NULL) {
		mdb_warn("<srpt_target_port_t addr>::walk srpt_channel\n");
		return (WALK_ERR);
	}

	wsp->walk_addr += offsetof(srpt_target_port_t, tp_ch_list);

	if (mdb_layered_walk("list", wsp) == -1) {
		mdb_warn("Could not walk tp_ch_list");
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}
Beispiel #16
0
static int
xhci_mdb_walk_xhci_device_init(mdb_walk_state_t *wsp)
{
	uintptr_t addr;

	if (wsp->walk_addr == 0) {
		mdb_warn("::walk xhci_device requires an xhci_t\n");
		return (WALK_ERR);
	}

	addr = wsp->walk_addr;
	addr += offsetof(xhci_t, xhci_usba);
	addr += offsetof(xhci_usba_t, xa_devices);
	wsp->walk_addr = (uintptr_t)addr;
	if (mdb_layered_walk("list", wsp) != 0) {
		mdb_warn("failed to walk list");
		return (WALK_ERR);
	}

	return (WALK_NEXT);
}
Beispiel #17
0
/*
 * Walker to list the addresses of all the active I/O Controllers
 */
static int
srpt_ioc_walk_init(mdb_walk_state_t *wsp)
{
	srpt_ctxt_t	*srpt;
	uintptr_t	srpt_global_addr, list_addr;

	if (mdb_readvar(&srpt, "srpt_ctxt") == -1) {
		mdb_warn("failed to read srpt soft state");
		return (WALK_ERR);
	}

	srpt_global_addr = (uintptr_t)srpt;

	list_addr = srpt_global_addr + offsetof(srpt_ctxt_t, sc_ioc_list);

	wsp->walk_addr = list_addr;

	if (mdb_layered_walk("list", wsp) == -1) {
		mdb_warn("list walk failed");
		return (WALK_ERR);
	}
	return (WALK_NEXT);
}