Perl+DTrace=Instruction Tracing

As promised, an ugly perl script that can be used to generate a custom DTrace script which will generate an instruction trace.

For instance:

trogdor:utrace -> ls
hello\*      hello.c     utrace.pl\*  utrace.txt\* 
trogdor:utrace -> utrace.pl -i hello
trogdor:utrace -> sudo dtrace -Cs hello.t -c hello
...

For the interested, here is the text of the traced program, the DTrace script, and the output generated.

The perl script is no where near "feature complete", nor is it an example of good perl programming practice ( parts of it are legible ). But, say it with me, it scratched an itch :).

-ejo

Comments:

Post a Comment:
Comments are closed for this entry.
About

ejo

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks