detail.tcl 4.05 KB
#
# 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