Skip to content

Commit 5045a9d

Browse files
committed
/home/fox/release/dtrace/2008/dtrace-20080407.tar.bz2
0 parents  commit 5045a9d

File tree

430 files changed

+134885
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

430 files changed

+134885
-0
lines changed

LICENSING.NOTICE

Lines changed: 387 additions & 0 deletions
Large diffs are not rendered by default.

README

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Linux port of DTrace
2+
3+
April 2008
4+
Paul D. Fox
5+
6+
7+
This is a pre-alpha, work-in-progress port of Sun's DTrace kernel
8+
debugging tool for Linux. It is not prime-time and much of it
9+
doesnt compile.
10+
11+
I have taken a variety of approaches to get where I am:
12+
13+
custom include dir:
14+
15+
- <linux> for user land tools which front-ends /usr/include and
16+
/usr/include/sys
17+
- <sys> for the kernel drivers.
18+
19+
makefiles are incomplete - I use 'makefile' and will clean up Suns
20+
Makefile and Makefile.targ and other extraneous subdirs to simplify things.
21+
22+
make-me is a temporary script to build the kernel drivers.
23+
24+
No top-level makefile at present. In cmd/dtrace/dtrace is a 64-bit dtrace
25+
binary built on RedHat FC8. Will remove that and make it buildable.
26+
27+
Kernel drivers assume access to /usr/src/linux -- needs to be fixed.
28+
kernel drivers dont compile yet. Lots of use of
29+
30+
# if defined(sun)
31+
...
32+
# endif
33+
34+
for bits we wont want (much cribbed from the FreeBSD port).
35+
36+
Some code has
37+
38+
# if linux
39+
...
40+
#endif
41+
42+
where its definitely Linux time.
43+
44+
No GPL code in here at present; all CDDL.
45+
46+
'tags' files are CRiSP format cross-reference files. If you dont have
47+
CRiSP, delete them and build your own !

archive.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
NAME=dtrace
2+
MAJ_VERSION=1
3+
MIN_VERSION=0001
4+
EXCLUDE=""
5+
EXCLUDE_DIRS=""
6+
#date Wed Mar 1 11:30:37 GMT 2006

checksum.lst

Lines changed: 435 additions & 0 deletions
Large diffs are not rendered by default.

cmd/dtrace/.gdbinit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dir ../../lib/libctf
2+
dir ../../lib/libdtrace/common
3+
dir ../../lib/liblinux

cmd/dtrace/demo/Makefile

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#
2+
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3+
#
4+
# The contents of this file are subject to the terms of the
5+
# Common Development and Distribution License, Version 1.0 only.
6+
# See the file usr/src/LICENSING.NOTICE in this distribution or
7+
# http://www.opensolaris.org/license/ for details.
8+
#
9+
#pragma ident "@(#)Makefile 1.2 04/12/18 SMI"
10+
11+
include ../../Makefile.cmd
12+
13+
DFILES = \
14+
applicat.d \
15+
badopen.d \
16+
begin.d \
17+
callout.d \
18+
clause.d \
19+
clear.d \
20+
countdown.d \
21+
counter.d \
22+
dateprof.d \
23+
delay.d \
24+
denorm.d \
25+
end.d \
26+
error.d \
27+
errorpath.d \
28+
find.d \
29+
firebird.d \
30+
hello.d \
31+
howlong.d \
32+
interp.d \
33+
interval.d \
34+
intr.d \
35+
iocpu.d \
36+
iosnoop.d \
37+
iothrough.d \
38+
iotime.d \
39+
iprb.d \
40+
kstat.d \
41+
ksyms.d \
42+
libc.d \
43+
lquantize.d \
44+
lwptime.d \
45+
normalize.d \
46+
nscd.d \
47+
pri.d \
48+
printa.d \
49+
pritime.d \
50+
prof.d \
51+
profpri.d \
52+
progtime.d \
53+
putnext.d \
54+
qlen.d \
55+
qtime.d \
56+
renormalize.d \
57+
restest.d \
58+
ring.d \
59+
rtime.d \
60+
rwinfo.d \
61+
rwtime.d \
62+
sig.d \
63+
soffice.d \
64+
spec.d \
65+
specopen.d \
66+
ssd.d \
67+
syscall.d \
68+
tick.d \
69+
ticktime.d \
70+
time.d \
71+
tracewrite.d \
72+
trunc.d \
73+
trussrw.d \
74+
userfunc.d \
75+
whatfor.d \
76+
whatlock.d \
77+
where.d \
78+
whererun.d \
79+
whoexec.d \
80+
whofor.d \
81+
whoio.d \
82+
whopreempt.d \
83+
whoqueue.d \
84+
whosteal.d \
85+
whowrite.d \
86+
writes.d \
87+
writesbycmd.d \
88+
writesbycmdfd.d \
89+
writetime.d \
90+
writetimeq.d \
91+
xioctl.d \
92+
xterm.d \
93+
xwork.d
94+
95+
DEMOFILES = \
96+
$(DFILES) \
97+
index.html \
98+
sunlogo.gif
99+
100+
MKDEMO = mkdemo
101+
CLEANFILES += $(DFILES) $(MKDEMO)
102+
103+
ROOTDEMODIR = $(ROOT)/usr/demo/dtrace
104+
ROOTDEMOFILES = $(DEMOFILES:%=$(ROOTDEMODIR)/%)
105+
106+
all: $(DEMOFILES)
107+
108+
clobber clean:
109+
-$(RM) $(CLEANFILES)
110+
111+
clean.lint install_h lint:
112+
113+
install: $(ROOTDEMOFILES)
114+
115+
$(ROOTDEMODIR):
116+
$(INS.dir)
117+
118+
$(ROOTDEMODIR)/%: %
119+
$(INS.file)
120+
121+
%.html: $(DFILES) $(MKDEMO)
122+
./$(MKDEMO) $@
123+
124+
%.d: $(MKDEMO)
125+
./$(MKDEMO) $@
126+
127+
%: %.pl
128+
$(CP) $< $@
129+
$(CHMOD) 755 $@
130+
131+
$(ROOTDEMOFILES): $(ROOTDEMODIR)
132+
133+
$(ROOTDEMODIR) := OWNER = root
134+
$(ROOTDEMODIR) := GROUP = bin
135+
$(ROOTDEMODIR) := DIRMODE = 755
136+
137+
$(ROOTDEMOFILES) := OWNER = root
138+
$(ROOTDEMOFILES) := GROUP = bin
139+
$(ROOTDEMOFILES) := FILEMODE = 644

cmd/dtrace/demo/act/time.d

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#pragma D option quiet
2+
#pragma D option destructive
3+
#pragma D option switchrate=5sec
4+
5+
tick-1sec
6+
/n++ < 5/
7+
{
8+
printf("walltime : %Y\n", walltimestamp);
9+
printf("date : ");
10+
system("date");
11+
printf("\n");
12+
}
13+
14+
tick-1sec
15+
/n == 5/
16+
{
17+
exit(0);
18+
}

cmd/dtrace/demo/agg/clear.d

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#pragma D option quiet
2+
3+
BEGIN
4+
{
5+
last = timestamp;
6+
}
7+
8+
syscall:::entry
9+
{
10+
@func[execname] = count();
11+
}
12+
13+
tick-10sec
14+
{
15+
normalize(@func, (timestamp - last) / 1000000000);
16+
printa(@func);
17+
clear(@func);
18+
last = timestamp;
19+
}

cmd/dtrace/demo/agg/dateprof.d

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
syscall::exec:return,
2+
syscall::exece:return
3+
/execname == "date"/
4+
{
5+
self->start = vtimestamp;
6+
}
7+
8+
syscall:::entry
9+
/self->start/
10+
{
11+
/*
12+
* We linearly quantize on the current virtual time minus our
13+
* process's start time. We divide by 1000 to yield microseconds
14+
* rather than nanoseconds. The range runs from 0 to 10 milliseconds
15+
* in steps of 100 microseconds; we expect that no date(1) process
16+
* will take longer than 10 milliseconds to complete.
17+
*/
18+
@["system calls over time"] =
19+
lquantize((vtimestamp - self->start) / 1000, 0, 10000, 100);
20+
}
21+
22+
syscall::rexit:entry
23+
/self->start/
24+
{
25+
self->start = 0;
26+
}

cmd/dtrace/demo/agg/denorm.d

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#pragma D option quiet
2+
3+
BEGIN
4+
{
5+
start = timestamp;
6+
}
7+
8+
syscall:::entry
9+
{
10+
@func[execname] = count();
11+
}
12+
13+
END
14+
{
15+
this->seconds = (timestamp - start) / 1000000000;
16+
printf("Ran for %d seconds.\n", this->seconds);
17+
18+
printf("Per-second rate:\n");
19+
normalize(@func, this->seconds);
20+
printa(@func);
21+
22+
printf("\nRaw counts:\n");
23+
denormalize(@func);
24+
printa(@func);
25+
}

0 commit comments

Comments
 (0)