/* Mconsole stack trace Added by Allan Graves, Jeff Dike Dumps a stacks registers to the linux console. Usage stack <pid>.  */
void mconsole_stack(struct mc_request *req)
/* Mconsole stack trace Added by Allan Graves, Jeff Dike Dumps a stacks registers to the linux console. Usage stack <pid>.  */
void mconsole_stack(struct mc_request *req)
{
	char *ptr = req->request.data;
	int pid_requested= -1;
	struct task_struct *to = NULL;
	ptr += strlen("stack");
	ptr = skip_spaces(ptr);
	if (sscanf(ptr, "%d", &pid_requested) == 0) {
		mconsole_reply(req, "Please specify a pid", 1, 0);
		return;
	}
	to = find_task_by_pid_ns(pid_requested, &init_pid_ns);
	if ((to == NULL) || (pid_requested == 0)) {
		mconsole_reply(req, "Couldn't find that pid", 1, 0);
		return;
	}
	with_console(req, stack_proc, to);
}