Browse Source

Plan 9 from Bell Labs 2007-11-01

David du Colombier 16 years ago
parent
commit
863c736621

+ 7 - 7
dist/replica/_plan9.db

@@ -5836,7 +5836,7 @@ sys/games - 20000000775 sys sys 1117225532 0
 sys/games/lib - 20000000775 sys sys 1165337608 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1192305216 267301
+sys/games/lib/fortunes - 664 sys sys 1193852802 267533
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -6277,9 +6277,9 @@ sys/lib/dist/pc/inst/watchfd - 775 sys sys 1127670125 362
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
 sys/lib/dist/pc/mkfile - 664 sys sys 1168307754 2210
 sys/lib/dist/pc/multi - 20000000775 sys sys 1147022870 0
-sys/lib/dist/pc/plan9.ini - 664 sys sys 1142177575 236
+sys/lib/dist/pc/plan9.ini - 664 sys sys 1193864577 250
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
-sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1132452554 369
+sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1193864518 383
 sys/lib/dist/pc/plan9.ini.vmware - 664 sys sys 1045500078 168
 sys/lib/dist/pc/proto - 664 sys sys 1169484200 5564
 sys/lib/dist/pc/sub - 20000000775 sys sys 1063856127 0
@@ -7522,7 +7522,7 @@ sys/man/2/assert - 664 sys sys 1102868467 377
 sys/man/2/atof - 664 sys sys 1171668702 2778
 sys/man/2/auth - 664 sys sys 1190243345 7537
 sys/man/2/authsrv - 664 sys sys 1192737581 4583
-sys/man/2/avl - 664 sys sys 1193785216 1936
+sys/man/2/avl - 664 sys sys 1193861693 2447
 sys/man/2/bin - 664 sys sys 985023077 1880
 sys/man/2/bind - 664 sys sys 1015091518 4685
 sys/man/2/bio - 664 sys sys 1193790665 6707
@@ -7742,7 +7742,7 @@ sys/man/4/u9fs - 664 sys sys 1043769139 4748
 sys/man/4/upasfs - 664 sys sys 1034348505 6212
 sys/man/4/usb - 664 sys sys 1172764045 4682
 sys/man/4/usbd - 664 sys sys 1164149441 712
-sys/man/4/usbdisk - 664 sys sys 1193264908 2800
+sys/man/4/usbdisk - 664 sys sys 1193865997 2801
 sys/man/4/vacfs - 664 sys sys 1084333062 1545
 sys/man/4/webcookies - 664 sys sys 1019828742 3525
 sys/man/4/webfs - 664 sys sys 1124711926 6518
@@ -8024,7 +8024,7 @@ sys/src/9/ip/nullmedium.c - 664 sys sys 1086406910 492
 sys/src/9/ip/pktmedium.c - 664 sys sys 1084331746 1314
 sys/src/9/ip/ptclbsum.c - 664 sys sys 1022588099 1243
 sys/src/9/ip/rudp.c - 664 sys sys 1187735906 21590
-sys/src/9/ip/tcp.c - 664 sys sys 1186406232 65963
+sys/src/9/ip/tcp.c - 664 sys sys 1193872007 65959
 sys/src/9/ip/tripmedium.c - 664 sys sys 1045063515 7136
 sys/src/9/ip/udp.c - 664 sys sys 1187735914 13315
 sys/src/9/mkfile - 664 sys sys 1063857477 205
@@ -14353,7 +14353,7 @@ sys/src/cmd/venti/srv/fmtisect.c - 664 sys sys 1177189436 1454
 sys/src/cmd/venti/srv/fns.h - 664 sys sys 1191430752 9231
 sys/src/cmd/venti/srv/graph.c - 664 sys sys 1177189436 4190
 sys/src/cmd/venti/srv/hdisk.c - 664 sys sys 1191257294 16482
-sys/src/cmd/venti/srv/hproc.c - 664 sys sys 1191430754 10333
+sys/src/cmd/venti/srv/hproc.c - 664 sys sys 1193855451 10662
 sys/src/cmd/venti/srv/httpd.c - 664 sys sys 1191430753 22897
 sys/src/cmd/venti/srv/icache.c - 664 sys sys 1193791133 10679
 sys/src/cmd/venti/srv/icachewrite.c - 664 sys sys 1193791073 7532

+ 7 - 7
dist/replica/plan9.db

@@ -5836,7 +5836,7 @@ sys/games - 20000000775 sys sys 1117225532 0
 sys/games/lib - 20000000775 sys sys 1165337608 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1192305216 267301
+sys/games/lib/fortunes - 664 sys sys 1193852802 267533
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -6277,9 +6277,9 @@ sys/lib/dist/pc/inst/watchfd - 775 sys sys 1127670125 362
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
 sys/lib/dist/pc/mkfile - 664 sys sys 1168307754 2210
 sys/lib/dist/pc/multi - 20000000775 sys sys 1147022870 0
-sys/lib/dist/pc/plan9.ini - 664 sys sys 1142177575 236
+sys/lib/dist/pc/plan9.ini - 664 sys sys 1193864577 250
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
-sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1132452554 369
+sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1193864518 383
 sys/lib/dist/pc/plan9.ini.vmware - 664 sys sys 1045500078 168
 sys/lib/dist/pc/proto - 664 sys sys 1169484200 5564
 sys/lib/dist/pc/sub - 20000000775 sys sys 1063856127 0
@@ -7522,7 +7522,7 @@ sys/man/2/assert - 664 sys sys 1102868467 377
 sys/man/2/atof - 664 sys sys 1171668702 2778
 sys/man/2/auth - 664 sys sys 1190243345 7537
 sys/man/2/authsrv - 664 sys sys 1192737581 4583
-sys/man/2/avl - 664 sys sys 1193785216 1936
+sys/man/2/avl - 664 sys sys 1193861693 2447
 sys/man/2/bin - 664 sys sys 985023077 1880
 sys/man/2/bind - 664 sys sys 1015091518 4685
 sys/man/2/bio - 664 sys sys 1193790665 6707
@@ -7742,7 +7742,7 @@ sys/man/4/u9fs - 664 sys sys 1043769139 4748
 sys/man/4/upasfs - 664 sys sys 1034348505 6212
 sys/man/4/usb - 664 sys sys 1172764045 4682
 sys/man/4/usbd - 664 sys sys 1164149441 712
-sys/man/4/usbdisk - 664 sys sys 1193264908 2800
+sys/man/4/usbdisk - 664 sys sys 1193865997 2801
 sys/man/4/vacfs - 664 sys sys 1084333062 1545
 sys/man/4/webcookies - 664 sys sys 1019828742 3525
 sys/man/4/webfs - 664 sys sys 1124711926 6518
@@ -8024,7 +8024,7 @@ sys/src/9/ip/nullmedium.c - 664 sys sys 1086406910 492
 sys/src/9/ip/pktmedium.c - 664 sys sys 1084331746 1314
 sys/src/9/ip/ptclbsum.c - 664 sys sys 1022588099 1243
 sys/src/9/ip/rudp.c - 664 sys sys 1187735906 21590
-sys/src/9/ip/tcp.c - 664 sys sys 1186406232 65963
+sys/src/9/ip/tcp.c - 664 sys sys 1193872007 65959
 sys/src/9/ip/tripmedium.c - 664 sys sys 1045063515 7136
 sys/src/9/ip/udp.c - 664 sys sys 1187735914 13315
 sys/src/9/mkfile - 664 sys sys 1063857477 205
@@ -14353,7 +14353,7 @@ sys/src/cmd/venti/srv/fmtisect.c - 664 sys sys 1177189436 1454
 sys/src/cmd/venti/srv/fns.h - 664 sys sys 1191430752 9231
 sys/src/cmd/venti/srv/graph.c - 664 sys sys 1177189436 4190
 sys/src/cmd/venti/srv/hdisk.c - 664 sys sys 1191257294 16482
-sys/src/cmd/venti/srv/hproc.c - 664 sys sys 1191430754 10333
+sys/src/cmd/venti/srv/hproc.c - 664 sys sys 1193855451 10662
 sys/src/cmd/venti/srv/httpd.c - 664 sys sys 1191430753 22897
 sys/src/cmd/venti/srv/icache.c - 664 sys sys 1193791133 10679
 sys/src/cmd/venti/srv/icachewrite.c - 664 sys sys 1193791073 7532

+ 7 - 0
dist/replica/plan9.log

@@ -53242,3 +53242,10 @@
 1193790605 7 c sys/src/cmd/venti/srv/utils.c - 664 sys sys 1193791159 3751
 1193790605 8 c sys/src/cmd/venti/srv/wrarena.c - 664 sys sys 1193789638 4563
 1193792404 0 c adm/timezone/Australia_West - 664 adm adm 1193791016 130
+1193853605 0 c sys/games/lib/fortunes - 664 sys sys 1193852802 267533
+1193855404 0 c sys/src/cmd/venti/srv/hproc.c - 664 sys sys 1193855451 10662
+1193862605 0 c sys/man/2/avl - 664 sys sys 1193861693 2447
+1193866205 0 c sys/lib/dist/pc/plan9.ini - 664 sys sys 1193864577 250
+1193866205 1 c sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1193864518 383
+1193866205 2 c sys/man/4/usbdisk - 664 sys sys 1193865997 2801
+1193873404 0 c sys/src/9/ip/tcp.c - 664 sys sys 1193872007 65959

+ 3 - 0
sys/games/lib/fortunes

@@ -4202,3 +4202,6 @@ Results 1 - 10 of about 34,900,000 for all else is the work of God.
 This is Radio Clash on pirate satellite.
 We already agreed on a solution. Nobody is interested in implementing it.  - Lucho
 This resource fork intentionally left blank
+checking size of char... 1  - gnu configure
+Nobody wants to argue with Knuth – it is the equivalent of arguing against the second law of thermodynamics.  - Mick West
+Customer stickiness reduces churn making it a valuable benefit.

+ 1 - 0
sys/lib/dist/pc/plan9.ini

@@ -14,3 +14,4 @@ dmamode=ask
 # disable ether and usb probing
 #*nousbprobe=1
 #*noetherprobe=1
+*nobiosload=1

+ 1 - 0
sys/lib/dist/pc/plan9.ini.cd

@@ -12,6 +12,7 @@ vgasize=ask
 dmamode=ask
 adisk=/dev/sdD0/cdboot
 cdboot=yes
+*nobiosload=1
 
 [install]
 nobootprompt=local!/boot/bzroot

+ 35 - 8
sys/man/2/avl

@@ -2,20 +2,21 @@
 .SH NAME
 mkavltree, insertavl, lookupavl, deleteavl, avlwalk, avlnext, avlprev, endwalk - AVL tree routines
 .SH SYNOPSIS
+.\" .ta 0.75i 1.5i 2.25i 3i 3.75i 4.5i
+.ta 0.7i +0.7i +0.7i +0.7i +0.7i +0.7i +0.7i
 .EX
 #include <u.h>
 #include <libc.h>
-#include <bio.h>
 #include <avl.h>
-
-typedef struct Avl	Avl;
+.sp 0.3v
+typedef struct Avl Avl;
 struct Avl
 {
 	Avl	*p;		/* parent */
 	Avl	*n[2];		/* children */
 	int	bal;		/* balance bits */
 };
-
+.sp 0.3v
 Avl	*avlnext(Avlwalk *walk);
 Avl	*avlprev(Avlwalk *walk);
 Avlwalk	*avlwalk(Avltree *tree);
@@ -51,13 +52,19 @@ with the same key that may now be freed.
 .I Lookupavl
 returns the
 .I tree
-node with
-.IR key .
+node that matches
+.I key
+by
+.IR tree 's
+comparison function,
+or
+.B nil
+if none.
 .I Deleteavl
-removes the node with
+removes the node matching
 .I key
 from
-.IR tree .
+.IR tree ;
 .I oldp
 is handled as per
 .IR insertavl .
@@ -79,6 +86,26 @@ tree node in the comparison order
 defined by the comparison function
 associated with the tree associated with
 .IR walk .
+.SH EXAMPLES
+Intended usage seems to be to make an anonymous
+.B Avl
+the first member of the application's tree-node structure,
+then pass these routines tree-node pointers instead of
+.BR Avl* s.
+.IP
+.EX
+typedef struct Node {
+	Avl;
+	uchar	score[VtScoreSize];
+	int	type;
+} Node;
+.sp 0.3v
+Avltree *tree;
+Avl *res;
+Node *np;
+\fI\&...\fP
+	res = lookupavl(tree, np);
+.EE
 .SH SOURCE
 .B /sys/src/libavl
 .SH SEE ALSO

+ 1 - 1
sys/man/4/usbdisk

@@ -153,6 +153,6 @@ so one can invoke
 .IR dossrv (4)
 directly.
 .PP
-USB 1.0 flash disks I/O rates are slow and variable.
+USB 1.0 flash disks' I/O rates are slow and variable.
 Reading and writing in large units (e.g., 4KB) seems to be faster
 by an order of magnitude when transferring large volumes of data.

+ 2 - 2
sys/src/9/ip/tcp.c

@@ -356,8 +356,8 @@ struct Tcppriv
  *  of DoS attack.
  *
  *  To avoid stateless Conv hogs, we pick a sequence number at random.  If
- *  it that number gets acked by the other end, we shut down the connection.
- *  Look for tcpporthogedefense in the code.
+ *  that number gets acked by the other end, we shut down the connection.
+ *  Look for tcpporthogdefense in the code.
  */
 int tcpporthogdefense = 0;
 

+ 68 - 53
sys/src/cmd/venti/srv/hproc.c

@@ -18,6 +18,8 @@ struct Debug
 	Fmt *fmt;
 	int pid;
 	char *stkprefix;
+	int pcoff;
+	int spoff;
 };
 
 static Debug debug = { -1 };
@@ -167,13 +169,11 @@ printmap(char *s, Map *map)
 	}
 }
 
-#define ADDR ulong
-
 static void
-printlocals(Map *map, Symbol *fn, ADDR fp)
+printlocals(Map *map, Symbol *fn, uintptr fp)
 {
 	int i;
-	ulong w;
+	uintptr w;
 	Symbol s;
 	char buf[100];
 
@@ -182,19 +182,19 @@ printlocals(Map *map, Symbol *fn, ADDR fp)
 		if (s.class != CAUTO)
 			continue;
 		snprint(buf, sizeof buf, "%s%s/", debug.stkprefix, s.name);
-		if (get4(map, fp-s.value, &w) > 0)
-			dprint("\t%-10s %10#lux %ld\n", buf, w, w);
+		if (geta(map, fp - s.value, (uvlong*)&w) > 0)
+			dprint("\t%-10s %10#p %ld\n", buf, w, w);
 		else
 			dprint("\t%-10s ?\n", buf);
 	}
 }
 
 static void
-printparams(Map *map, Symbol *fn, ADDR fp)
+printparams(Map *map, Symbol *fn, uintptr fp)
 {
 	int i;
 	Symbol s;
-	ulong w;
+	uintptr w;
 	int first = 0;
 
 	fp += mach->szaddr;			/* skip saved pc */
@@ -204,13 +204,13 @@ printparams(Map *map, Symbol *fn, ADDR fp)
 			continue;
 		if (first++)
 			dprint(", ");
-		if (get4(map, fp+s.value, &w) > 0)
-			dprint("%s=%#lux", s.name, w);
+		if (geta(map, fp + s.value, (uvlong *)&w) > 0)
+			dprint("%s=%#p", s.name, w);
 	}
 }
 
 static void
-printsource(ADDR dot)
+printsource(uintptr dot)
 {
 	char str[100];
 
@@ -222,7 +222,8 @@ printsource(ADDR dot)
 /*
  *	callback on stack trace
  */
-static ulong nextpc;
+static uintptr nextpc;
+
 static void
 ptrace(Map *map, uvlong pc, uvlong sp, Symbol *sym)
 {
@@ -234,7 +235,7 @@ ptrace(Map *map, uvlong pc, uvlong sp, Symbol *sym)
 	printparams(map, sym, sp);
 	dprint(")");
 	if(nextpc != sym->value)
-		dprint("+%#lx ", nextpc - sym->value);
+		dprint("+%#llux ", nextpc - sym->value);
 	printsource(nextpc);
 	dprint("\n");
 	printlocals(map, sym, sp);
@@ -242,35 +243,47 @@ ptrace(Map *map, uvlong pc, uvlong sp, Symbol *sym)
 }
 
 static void
-stacktracepcsp(Map *m, ulong pc, ulong sp)
+stacktracepcsp(Map *m, uintptr pc, uintptr sp)
 {
 	nextpc = 0;
 	if(machdata->ctrace==nil)
 		dprint("no machdata->ctrace\n");
 	else if(machdata->ctrace(m, pc, sp, 0, ptrace) <= 0)
-		dprint("no stack frame: pc=%#lux sp=%#lux\n", pc, sp);
+		dprint("no stack frame: pc=%#p sp=%#p\n", pc, sp);
+}
+
+static void
+ureginit(void)
+{
+	Reglist *r;
+
+	for(r = mach->reglist; r->rname; r++)
+		if (strcmp(r->rname, "PC") == 0)
+			debug.pcoff = r->roffs;
+		else if (strcmp(r->rname, "SP") == 0)
+			debug.spoff = r->roffs;
 }
 
 static void
 stacktrace(Map *m)
 {
-	ulong pc, sp;
+	uintptr pc, sp;
 	
-	if(get4(m, offsetof(Ureg, pc), &pc) < 0){
-		dprint("get4 pc: %r");
+	if(geta(m, debug.pcoff, (uvlong *)&pc) < 0){
+		dprint("geta pc: %r");
 		return;
 	}
-	if(get4(m, offsetof(Ureg, sp), &sp) < 0){
-		dprint("get4 sp: %r");
+	if(geta(m, debug.spoff, (uvlong *)&sp) < 0){
+		dprint("geta sp: %r");
 		return;
 	}
 	stacktracepcsp(m, pc, sp);
 }
 
-static ulong
-star(ulong addr)
+static uintptr
+star(uintptr addr)
 {
-	ulong x;
+	uintptr x;
 	static int warned;
 
 	if(addr == 0)
@@ -281,14 +294,14 @@ star(ulong addr)
 			dprint("no debug.map\n");
 		return 0;
 	}
-	if(get4(debug.map, addr, &x) < 0){
-		dprint("get4 %#lux (pid=%d): %r\n", addr, debug.pid);
+	if(geta(debug.map, addr, (uvlong *)&x) < 0){
+		dprint("geta %#p (pid=%d): %r\n", addr, debug.pid);
 		return 0;
 	}
 	return x;
 }
 
-static ulong
+static uintptr
 resolvev(char *name)
 {
 	Symbol s;
@@ -298,7 +311,7 @@ resolvev(char *name)
 	return s.value;
 }
 
-static ulong
+static uintptr
 resolvef(char *name)
 {
 	Symbol s;
@@ -311,7 +324,7 @@ resolvef(char *name)
 #define FADDR(type, p, name) ((p) + offsetof(type, name))
 #define FIELD(type, p, name) star(FADDR(type, p, name))
 
-static ulong threadpc;
+static uintptr threadpc;
 
 static int
 strprefix(char *big, char *pre)
@@ -335,20 +348,18 @@ tptrace(Map *map, uvlong pc, uvlong sp, Symbol *sym)
 		return;
 	if(strprefix(buf, "/sys/src/libthread/") == 0)
 		return;
-	if(strprefix(buf, "/sys/src/libthread/") == 0)
-		return;
 	threadpc = pc;
 }
 
 static char*
-threadstkline(ulong t)
+threadstkline(uintptr t)
 {
-	ulong pc, sp;
+	uintptr pc, sp;
 	static char buf[500];
 
 	if(FIELD(Thread, t, state) == Running){
-		get4(debug.map, offsetof(Ureg, pc), &pc);
-		get4(debug.map, offsetof(Ureg, sp), &sp);
+		geta(debug.map, debug.pcoff, (uvlong *)&pc);
+		geta(debug.map, debug.spoff, (uvlong *)&sp);
 	}else{
 		// pc = FIELD(Thread, t, sched[JMPBUFPC]);
 		pc = resolvef("longjmp");
@@ -364,9 +375,9 @@ threadstkline(ulong t)
 }
 
 static void
-proc(ulong p)
+proc(uintptr p)
 {
-	dprint("p=(Proc)%#lux pid %d ", p, FIELD(Proc, p, pid));
+	dprint("p=(Proc)%#p pid %d ", p, FIELD(Proc, p, pid));
 	if(FIELD(Proc, p, thread) == 0)
 		dprint(" Sched\n");
 	else
@@ -394,7 +405,7 @@ fmtbufflush(Fmt *f)
 }
 
 static char*
-debugstr(ulong s)
+debugstr(uintptr s)
 {
 	static char buf[4096];
 	char *p, *e;
@@ -413,7 +424,7 @@ debugstr(ulong s)
 }
 
 static char*
-threadfmt(ulong t)
+threadfmt(uintptr t)
 {
 	static char buf[4096];
 	Fmt fmt;
@@ -421,7 +432,7 @@ threadfmt(ulong t)
 
 	fmtbufinit(&fmt, buf, sizeof buf);
 	
-	fmtprint(&fmt, "t=(Thread)%#lux ", t);
+	fmtprint(&fmt, "t=(Thread)%#p ", t);
 	switch(s = FIELD(Thread, t, state)){
 	case Running:
 		fmtprint(&fmt, " Running   ");
@@ -451,16 +462,16 @@ threadfmt(ulong t)
 
 
 static void
-thread(ulong t)
+thread(uintptr t)
 {
 	dprint("%s\n", threadfmt(t));
 }
 
 static void
-threadapply(ulong p, void (*fn)(ulong))
+threadapply(uintptr p, void (*fn)(uintptr))
 {
 	int oldpid, pid;
-	ulong tq, t;
+	uintptr tq, t;
 	
 	oldpid = debug.pid;
 	pid = FIELD(Proc, p, pid);
@@ -476,30 +487,29 @@ threadapply(ulong p, void (*fn)(ulong))
 }
 
 static void
-pthreads1(ulong t)
+pthreads1(uintptr t)
 {
 	dprint("\t");
 	thread(t);
 }
 
 static void
-pthreads(ulong p)
+pthreads(uintptr p)
 {
 	threadapply(p, pthreads1);
 }
 
 static void
-lproc(ulong p)
+lproc(uintptr p)
 {
 	proc(p);
 	pthreads(p);
 }
 
 static void
-procapply(void (*fn)(ulong))
+procapply(void (*fn)(uintptr))
 {
-	ulong proc;
-	ulong pq;
+	uintptr proc, pq;
 	
 	pq = resolvev("_threadpq");
 	if(pq == 0){
@@ -529,9 +539,9 @@ procs(HConnect *c)
 }
 
 static void
-threadstack(ulong t)
+threadstack(uintptr t)
 {
-	ulong pc, sp;
+	uintptr pc, sp;
 
 	if(FIELD(Thread, t, state) == Running){
 		stacktrace(debug.map);
@@ -545,7 +555,7 @@ threadstack(ulong t)
 
 
 static void
-tstacks(ulong t)
+tstacks(uintptr t)
 {
 	dprint("\t");
 	thread(t);
@@ -554,7 +564,7 @@ tstacks(ulong t)
 }
 
 static void
-pstacks(ulong p)
+pstacks(uintptr p)
 {
 	proc(p);
 	threadapply(p, tstacks);
@@ -611,9 +621,14 @@ int
 hproc(HConnect *c)
 {
 	void (*fn)(HConnect*);
-	static char buf[65536];
 	Fmt fmt;
+	static int beenhere;
+	static char buf[65536];
 
+	if (!beenhere) {
+		beenhere = 1;
+		ureginit();
+	}
 	if(strcmp(c->req.uri, "/proc/all") == 0)
 		fn = all;
 	else if(strcmp(c->req.uri, "/proc/segment") == 0)