From owner-p4-projects@FreeBSD.ORG Mon May 15 00:54:51 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AE49316A409; Mon, 15 May 2006 00:54:51 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 268BA16A408 for ; Mon, 15 May 2006 00:54:50 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA3FE43D4C for ; Mon, 15 May 2006 00:54:49 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k4F0seRa021211 for ; Mon, 15 May 2006 00:54:40 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4F0sewJ021208 for perforce@freebsd.org; Mon, 15 May 2006 00:54:40 GMT (envelope-from jb@freebsd.org) Date: Mon, 15 May 2006 00:54:40 GMT Message-Id: <200605150054.k4F0sewJ021208@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 97172 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2006 00:55:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=97172 Change 97172 by jb@jb_freebsd2 on 2006/05/15 00:54:02 Synthesize a 'lwpsinfo_t' from a 'struct thread' for no other reason that to pass some more tests. I don't really understand why 'curlwpsinfo' is necessary. Perhaps that is just conevient on Solaris. As far as FreeBSD is concerned, why not just use 'curthread'? Affected files ... .. //depot/projects/dtrace/src/cddl/lib/libdtrace/psinfo.d#2 edit Differences ... ==== //depot/projects/dtrace/src/cddl/lib/libdtrace/psinfo.d#2 (text+ko) ==== @@ -56,10 +56,39 @@ pr_addr = 0; }; +typedef struct lwpsinfo { + id_t pr_lwpid; /* thread ID. */ + int pr_flag; /* thread flags. */ + int pr_pri; /* thread priority. */ + char pr_state; /* numeric lwp state */ + char pr_sname; /* printable character for pr_state */ + short pr_syscall; /* system call number (if in syscall) */ + uintptr_t + pr_addr; /* internal address of lwp */ + uintptr_t + pr_wchan; /* sleep address */ +} lwpsinfo_t; + +#pragma D binding "1.0" translator +translator lwpsinfo_t < struct thread *T > { + pr_lwpid = T->td_tid; + pr_pri = T->td_priority; + pr_flag = T->td_flags; + pr_state = 0; /* XXX */ + pr_sname = '?'; /* XXX */ + pr_syscall = 0; /* XXX */ + pr_addr = (uintptr_t)T; + pr_wchan = (uintptr_t)T->td_wchan; +}; + inline psinfo_t *curpsinfo = xlate (curthread->td_proc); #pragma D attributes Stable/Stable/Common curpsinfo #pragma D binding "1.0" curpsinfo +inline lwpsinfo_t *curlwpsinfo = xlate (curthread); +#pragma D attributes Stable/Stable/Common curlwpsinfo +#pragma D binding "1.0" curlwpsinfo + /* * ppid, uid and gid are used frequently enough to merit their own inlines... */