From owner-p4-projects@FreeBSD.ORG Thu Sep 27 09:57:58 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6AB5216A420; Thu, 27 Sep 2007 09:57:58 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2870016A41B for ; Thu, 27 Sep 2007 09:57:58 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 22CE113C45B for ; Thu, 27 Sep 2007 09:57:58 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l8R9vv7I089004 for ; Thu, 27 Sep 2007 09:57:57 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l8R9vv81089001 for perforce@freebsd.org; Thu, 27 Sep 2007 09:57:57 GMT (envelope-from jb@freebsd.org) Date: Thu, 27 Sep 2007 09:57:57 GMT Message-Id: <200709270957.l8R9vv81089001@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 126859 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: Thu, 27 Sep 2007 09:57:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=126859 Change 126859 by jb@jb_freebsd1 on 2007/09/27 09:57:33 To avoid infecting the GENERIC kernel with Sun's CDDL, the additional fields that would have just been added to 'struct thread' have to be made opaque. The easiest way I can think of to do this is to allocate extra space when the thread structure is allocated. The value of KDTRACE_THREAD_SIZE is the extra space required. It is then left to the DTrace modules to do the pointer arithmetic to offset 'struct thread *td' to point to the DTrace-specific thread data. I get conflicting opinions about what is protected by copyright and what is not. None of these opinions come from lawyers. However, even if they were from lawyers they would still just be opinions which have no legal precedent. I am accused by one person from Sun of "effectively making up [my] own law, and then complaining that [I'm] forcing [myself] to follow it". I am also accused of making Sun a "straw man" and that I'm "more interested in having the problem than solving it". I have asked Sun for legal clarity. It's notable that, of all the emails I've received from Sun, exactly ZERO have come from anyone with any legal responsibility in Sun. So this is the way forward... obfuscate the bloody code so that it doesn't directly reference any CDDL code. And life goes on. Affected files ... .. //depot/projects/dtrace/src/sys/sys/proc.h#22 edit Differences ... ==== //depot/projects/dtrace/src/sys/sys/proc.h#22 (text+ko) ==== @@ -803,6 +803,21 @@ extern int maxprocperuid; /* Max procs per uid. */ extern u_long ps_arg_cache_limit; +/* + * Space to append to struct thread for DTrace specific thread + * variables. This space is after the 'struct td_sched'. + */ +#define KDTRACE_THREAD_SIZE 128 + +/* Offset from 'struct thread *' to the opaque DTrace fields. */ +extern int kdtrace_thread_offset; + +/* Overall per-thread allocation size. */ +extern int kdtrace_thread_size; + +/* DTrace data for the primary thread in proc0. */ +extern char kdtrace_thread0[]; + LIST_HEAD(proclist, proc); TAILQ_HEAD(procqueue, proc); TAILQ_HEAD(threadqueue, thread);