%{ #include #include #include %} function task_dump:string(_task:long) %{ struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); char buf[MAXSTRINGLEN]; int cc=0; if (task <= 0) { sprintf(buf+cc, "task NULL"); } else { sprintf(buf+cc, "task %p tk_pid %d tk_status %d\n", task, task->tk_pid, task->tk_status); cc = strlen(buf); } snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); CATCH_DEREF_FAULT(); %}