Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * Copyright 2004 Sun Microsystems, Inc. All rights reserved. | |
3 | * Use is subject to license terms. | |
4 | */ | |
5 | #pragma ident "@(#)README.trace 1.1 05/07/29 SMI" | |
6 | ||
7 | ## | |
8 | ## Instruction Tracing (trace) | |
9 | ## | |
10 | ## This explains how to enable and use the tracing feature | |
11 | ## | |
12 | ||
13 | [-] Enabling this Features: | |
14 | ||
15 | See README.debug_hook for full details on how to enable this feature. | |
16 | ||
17 | [-] Instruction Tracing: | |
18 | ||
19 | Description: | |
20 | This feature allows you to specify a range of %pc values or instn count | |
21 | ranges for which you want to gather instructon traces for. | |
22 | ||
23 | Format: | |
24 | * debug_hook [trace] [mode] [regs] [start] [end]; | |
25 | * | |
26 | * [trace] - we've already parsed this. That's how we got here. | |
27 | * [mode] - is one of [all, pc, instn] | |
28 | * all : traces all instns (no start, end values) | |
29 | * pc : just trace when %pc is withing start-end range | |
30 | * instn : just trace when instn count is within start-end | |
31 | * [regs] - if defined, we dump the %g,%o,%l,%i regs with each sample. | |
32 | * [start] | |
33 | * [end] - only trace when %pc or inst_cnt is within [start]-[end] | |
34 | * range | |
35 | * | |
36 | * All instruction traces for %pc or instn within the range supplied will | |
37 | * be displayed. | |
38 | * | |
39 | ||
40 | Examples: | |
41 | processor "niagara" { | |
42 | clkfreq 5000000 ; | |
43 | cores 1; | |
44 | vthreads 1; | |
45 | nglobals 4; | |
46 | nwins 8; | |
47 | rstv 0xfff0000020; | |
48 | maxtl 7; | |
49 | // Select one of the following formats: | |
50 | // | |
51 | // debug_hook trace all; | |
52 | // debug_hook trace all regs; | |
53 | // debug_hook trace pc 0x10a200 0x10a208; | |
54 | // debug_hook trace pc regs 0x10a200 0x10a208; | |
55 | // debug_hook trace instn 0x0 0x100; | |
56 | // debug_hook trace instn regs 0x0 0x100; | |
57 | } | |
58 | ||
59 | Viewing Data: | |
60 | All of the instruction trace data gets written to the legion startup window | |
61 | and is formatted as follows (the register dump for each instuction can | |
62 | be toggled using the optional 'regs' flag in the config file as defined above. | |
63 | ||
64 | [cpu] Instn_# tl:tt/gl state %pc [raw_instn] instn | |
65 | ||
66 | [0x0] 0x0 7:0/3 0x4 0xfff0000020 [0x30800038] ba,a 0xfff0000100 | |
67 | g0=0x0000000000000000 o0=0x0000000000000000 l0=0x0000000000000000 i0=0x0000000000000000 | |
68 | g1=0x0000000000000000 o1=0x0000000000000000 l1=0x0000000000000000 i1=0x0000000000000000 | |
69 | g2=0x0000000000000000 o2=0x0000000000000000 l2=0x0000000000000000 i2=0x0000000000000000 | |
70 | g3=0x0000000000000000 o3=0x0000000000000000 l3=0x0000000000000000 i3=0x0000000000000000 | |
71 | g4=0x0000000000000000 o4=0x0000000000000000 l4=0x0000000000000000 i4=0x0000000000000000 | |
72 | g5=0x0000000000000000 o5=0x0000000000000000 l5=0x0000000000000000 i5=0x0000000000000000 | |
73 | g6=0x0000000000000000 o6=0x0000000000000000 l6=0x0000000000000000 i6=0x0000000000000000 | |
74 | g7=0x0000000000000000 o7=0x0000000000000000 l7=0x0000000000000000 i7=0x0000000000000000 | |
75 | ||
76 | ||
77 | Modifying Source: | |
78 | The source for the coverage feature is contained in | |
79 | src/procs/sunsparc/debug/trace.c | |
80 |