PERFORCE change 126859 for review

John Birrell jb at FreeBSD.org
Thu Sep 27 02:57:58 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=126859

Change 126859 by jb at 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);


More information about the p4-projects mailing list