detail.tcl
4.05 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#
# Copyright (C) 1996-1998 by the Board of Trustees
# of Leland Stanford Junior University.
#
# This file is part of the SimOS distribution.
# See LICENSE file for terms of the license.
#
###
### detail.tcl
###
### Sample tcl file to generate byPC/byData detailed tables
### Detailed tables are written out in a binary format. To extract
### information out of them, see the comment at the end
### of this file.
###
###
### Setup annotations to enable the detailed tables
### at start time and dump its contents in binary files
### on kill -SIGUSR and at the end of the simulation.
###
proc EnableDetailTable {table} {
annotation set simos enter "detail set $table \$CPU yes"
annotation set simos sigusr "detail dump $table"
annotation set simos exit "detail dump $table"
}
###
### Sets up 2 detailed tables, by data and by pc to study at the
### communication patterns of the OS.
###
proc DetailKernelByPCByData { } {
detail create kernel.bydata byData {
{bucketSize 4}
{highResSize 4096}
{field readSample writeSample}
{field dL2Miss}
{field dTlb}
{highResRange 0x80000000 0x10000000}
}
detail create kernel.bypc byPC {
{bucketSize 4}
{highResSize 64}
{field cycleSample }
{field instrSample }
{field iL2Miss}
{field iL2Stall}
{field dL2Miss}
{field dL2Stall}
{field dTlb}
{field iTlb}
{highResRange 0x80000000 0x1000000}
}
EnableDetailTable kernel.bydata
EnableDetailTable kernel.bypc
}
proc DetailUserByPCByData { } {
detail create user.bydata byData {
{bucketSize 4}
{highResSize 4096}
{field readSample writeSample}
{field dL2Miss}
{field trueSharing.ice trueSharing.cold trueSharing.inv trueSharing.capinv trueSharing.cap}
{field falseSharing.ice falseSharing.cold}
{field falseSharing.inv falseSharing.capinv}
{field falseSharing.cap}
{highResRange 0x04000000 0x1000000}
}
detail create user.bypc byPC {
{bucketSize 4}
{highResSize 64}
{field instrSample}
{field dL2Miss}
{field trueSharing.ice trueSharing.cold trueSharing.inv trueSharing.capinv trueSharing.cap}
{field falseSharing.ice falseSharing.cold}
{field falseSharing.inv falseSharing.capinv}
{field falseSharing.cap}
{highResRange 0x10000000 0x1000000}
}
EnableDetailTable user.bydata
EnableDetailTable user.bypc
}
###################################################################
###
### using msdump to extract information
###################################################################
### msdump is a hacked up program (simulation/apps/unix/memstat_tools)
### that takes a binary detailed table, matches the virtual addresses
### with symbolic information provided by the user to form a textual
### output
###
### Use: msdump [-r] -s symbol_file -m binary_file { column }
###
###
### options:
### -r: if selected, each inidividual bucket will be written
### out separately and matched with the closest symbol. By
### default, buckets whose virtual address corresponds to the
### same set of symbols are grouped together.
###
### -s symbol_file: Specifies the name of the input symbol file. The
### file must be in the format provided by "nm -B", and the symbols
### must be sorted in ascending virtual address order. For example,
### "nm -B irix-mp-5.3 | sort >symbol" would generate a suitable
### symbol file to study the kernel.
###
### -m input_file: the name of the byPC or byData detail file.
###
### {column}: Specifies the sequence of fields that are to be written out
### in the output file. By default, all fields are printed out in
### the order they were defined. msdump lists the field definitiions
### as recorded in the header of the binary detail file.
###
### Note: msdump is a C program that must be compile by typing make
### in simulation/apps/unix/memstat_tools