diff options
author | Ron Dreslinski <rdreslin@umich.edu> | 2004-11-17 09:54:38 -0500 |
---|---|---|
committer | Ron Dreslinski <rdreslin@umich.edu> | 2004-11-17 09:54:38 -0500 |
commit | f9ff53241f607e87d903f0d6b956db8d4cfab14b (patch) | |
tree | a2122d7583153e3bbcc47435cbd5319ef9189d0f | |
parent | ec636ed43f3bb96b5413214948372661519e296c (diff) | |
parent | 7da367d5ddba0cd72fbd351de3479c90b9e91b8c (diff) | |
download | gem5-f9ff53241f607e87d903f0d6b956db8d4cfab14b.tar.xz |
Merge zizzer:/z/m5/Bitkeeper/m5
into zazzer.eecs.umich.edu:/z/rdreslin/m5bk/clean
--HG--
extra : convert_revision : a64b84993c8852b19b1572c6913bf3dc6f6fc249
34 files changed, 660 insertions, 129 deletions
diff --git a/SConscript b/SConscript index 7769d0708..3938f792f 100644 --- a/SConscript +++ b/SConscript @@ -109,6 +109,7 @@ base_sources = Split(''' cpu/full_cpu/issue.cc cpu/full_cpu/ls_queue.cc cpu/full_cpu/machine_queue.cc + cpu/full_cpu/pc_sample_profile.cc cpu/full_cpu/pipetrace.cc cpu/full_cpu/readyq.cc cpu/full_cpu/reg_info.cc diff --git a/base/callback.hh b/base/callback.hh index 342ab7e0f..cc2a2f429 100644 --- a/base/callback.hh +++ b/base/callback.hh @@ -32,7 +32,7 @@ #include <list> /** - * Generic callback class. This base class provides a virutal process + * Generic callback class. This base class provides a virtual process * function that gets called when the callback queue is processed. */ class Callback @@ -103,6 +103,8 @@ class CallbackQueue } }; +/// Helper template class to turn a simple class member function into +/// a callback. template <class T, void (T::* F)()> class MakeCallback : public Callback { @@ -111,8 +113,9 @@ class MakeCallback : public Callback public: MakeCallback(T *o) - : object(o) + : object(o) { } + void process() { (object->*F)(); } }; diff --git a/base/inet.hh b/base/inet.hh index 10b782a6c..4f3857a15 100644 --- a/base/inet.hh +++ b/base/inet.hh @@ -348,9 +348,9 @@ struct UdpHdr : public udp_hdr uint16_t sport() const { return ntohs(uh_sport); } uint16_t dport() const { return ntohs(uh_dport); } uint16_t len() const { return ntohs(uh_ulen); } - uint16_t sum() const { return ntohs(uh_sum); } + uint16_t sum() const { return uh_sum; } - void sum(uint16_t sum) { uh_sum = htons(sum); } + void sum(uint16_t sum) { uh_sum = sum; } int size() const { return sizeof(udp_hdr); } const uint8_t *bytes() const { return (const uint8_t *)this; } diff --git a/base/loader/symtab.cc b/base/loader/symtab.cc index f6abf7e3d..2a29a8575 100644 --- a/base/loader/symtab.cc +++ b/base/loader/symtab.cc @@ -38,6 +38,8 @@ using namespace std; +SymbolTable *debugSymbolTable = NULL; + bool SymbolTable::insert(Addr address, string symbol) { @@ -95,26 +97,20 @@ SymbolTable::load(const string &filename) } bool -SymbolTable::findNearestSymbol(Addr address, string &symbol) const +SymbolTable::findNearestSymbol(Addr address, string &symbol, + Addr &sym_address, Addr &next_sym_address) const { - ATable::const_iterator i = addrTable.lower_bound(address); - - // check for PALCode - if (address & 0x1) - return false; + // find first key *larger* than desired address + ATable::const_iterator i = addrTable.upper_bound(address); - // first check for the end - if (i == addrTable.end()) - i--; - else if (i == addrTable.begin() && (*i).first != address) + // if very first key is larger, we're out of luck + if (i == addrTable.begin()) return false; - else if ((*i).first != address) - i--; - - symbol = (*i).second; - if (address != (*i).first) - symbol += csprintf("+%d", address - (*i).first); + next_sym_address = i->first; + --i; + sym_address = i->first; + symbol = i->second; return true; } @@ -140,19 +136,3 @@ SymbolTable::findAddress(const string &symbol, Addr &address) const address = (*i).second; return true; } - -string -SymbolTable::find(Addr addr) const -{ - string s; - findSymbol(addr, s); - return s; -} - -Addr -SymbolTable::find(const string &symbol) const -{ - Addr a = 0; - findAddress(symbol, a); - return a; -} diff --git a/base/loader/symtab.hh b/base/loader/symtab.hh index 48230c7a2..5ae29b057 100644 --- a/base/loader/symtab.hh +++ b/base/loader/symtab.hh @@ -49,12 +49,35 @@ class SymbolTable bool insert(Addr address, std::string symbol); bool load(const std::string &file); - bool findNearestSymbol(Addr address, std::string &symbol) const; + /// Find the nearest symbol equal to or less than the supplied + /// address (e.g., the label for the enclosing function). + /// @param address The address to look up. + /// @param symbol Return reference for symbol string. + /// @param sym_address Return reference for symbol address. + /// @param next_sym_address Address of following symbol (for + /// determining valid range of symbol). + /// @retval True if a symbol was found. + bool findNearestSymbol(Addr address, std::string &symbol, + Addr &sym_address, Addr &next_sym_address) const; + + /// Overload for findNearestSymbol() for callers who don't care + /// about next_sym_address. + bool findNearestSymbol(Addr address, std::string &symbol, + Addr &sym_address) const + { + Addr dummy; + return findNearestSymbol(address, symbol, sym_address, dummy); + } + + bool findSymbol(Addr address, std::string &symbol) const; bool findAddress(const std::string &symbol, Addr &address) const; - - std::string find(Addr addr) const; - Addr find(const std::string &symbol) const; }; +/// Global unified debugging symbol table (for target). Conceptually +/// there should be one of these per System object for full system, +/// and per Process object for non-full-system, but so far one big +/// global one has worked well enough. +extern SymbolTable *debugSymbolTable; + #endif // __SYMTAB_HH__ diff --git a/configs/boot/nat-netperf-maerts-client.rcS b/configs/boot/nat-netperf-maerts-client.rcS new file mode 100644 index 000000000..24d7c2ca1 --- /dev/null +++ b/configs/boot/nat-netperf-maerts-client.rcS @@ -0,0 +1,48 @@ +#!/bin/sh +SERVER=192.168.0.1 +CLIENT=10.0.0.2 + +echo "setting up network..." +ifconfig lo 127.0.0.1 +ifconfig eth0 $CLIENT txqueuelen 1000 + +echo "modifying route table..." +route add default gw 10.0.0.1 + +echo "0" > /proc/sys/net/ipv4/tcp_timestamps +echo "0" > /proc/sys/net/ipv4/tcp_sack +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_rmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_wmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_mem +echo "262143" > /proc/sys/net/core/rmem_max +echo "262143" > /proc/sys/net/core/wmem_max +echo "262143" > /proc/sys/net/core/rmem_default +echo "262143" > /proc/sys/net/core/wmem_default +echo "262143" > /proc/sys/net/core/optmem_max +echo "100000" > /proc/sys/net/core/netdev_max_backlog + +echo -n "waiting for server..." +/usr/bin/netcat -c -l -p 8000 + +BINARY=/benchmarks/netperf/netperf +TEST="TCP_MAERTS" +SHORT_ARGS="-l -100k" +LONG_ARGS="-k16384,0 -K16384,0 -- -m 65536 -M 65536 -s 262144 -S 262144" + + +SHORT="$BINARY -H $SERVER -t $TEST $SHORT_ARGS" +LONG="$BINARY -H $SERVER -t $TEST $LONG_ARGS" + +echo "starting test..." +echo "netperf warmup" +echo $SHORT +eval $SHORT + +echo "netperf benchmark" +echo $LONG +/sbin/m5 ivlb 1 +/sbin/m5 resetstats +/sbin/m5 dumpresetstats 2000000000 2000000000 +/sbin/m5 checkpoint 2000000000 2000000000 +eval $LONG +/sbin/m5 exit diff --git a/configs/boot/nat-netperf-server.rcS b/configs/boot/nat-netperf-server.rcS new file mode 100644 index 000000000..c0646b61c --- /dev/null +++ b/configs/boot/nat-netperf-server.rcS @@ -0,0 +1,30 @@ +#!/bin/sh +SERVER=192.168.0.1 +CLIENT=10.0.0.2 +NATBOX=192.168.0.2 + +echo "setting up network..." +ifconfig lo 127.0.0.1 +ifconfig eth0 $SERVER txqueuelen 1000 + +echo "0" > /proc/sys/net/ipv4/tcp_timestamps +echo "0" > /proc/sys/net/ipv4/tcp_sack +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_rmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_wmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_mem +echo "262143" > /proc/sys/net/core/rmem_max +echo "262143" > /proc/sys/net/core/wmem_max +echo "262143" > /proc/sys/net/core/rmem_default +echo "262143" > /proc/sys/net/core/wmem_default +echo "262143" > /proc/sys/net/core/optmem_max +echo "100000" > /proc/sys/net/core/netdev_max_backlog + +echo "running netserver..." +/benchmarks/netperf/netserver + +echo -n "signal client to begin..." +echo "server ready" | /usr/bin/netcat -c $NATBOX 8000 +echo "done." + +echo "starting bash..." +exec /bin/bash diff --git a/configs/boot/nat-netperf-stream-client.rcS b/configs/boot/nat-netperf-stream-client.rcS new file mode 100644 index 000000000..9e29378c8 --- /dev/null +++ b/configs/boot/nat-netperf-stream-client.rcS @@ -0,0 +1,48 @@ +#!/bin/sh +SERVER=192.168.0.1 +CLIENT=10.0.0.2 + +echo "setting up network..." +ifconfig lo 127.0.0.1 +ifconfig eth0 $CLIENT txqueuelen 1000 + +echo "0" > /proc/sys/net/ipv4/tcp_timestamps +echo "0" > /proc/sys/net/ipv4/tcp_sack +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_rmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_wmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_mem +echo "262143" > /proc/sys/net/core/rmem_max +echo "262143" > /proc/sys/net/core/wmem_max +echo "262143" > /proc/sys/net/core/rmem_default +echo "262143" > /proc/sys/net/core/wmem_default +echo "262143" > /proc/sys/net/core/optmem_max +echo "100000" > /proc/sys/net/core/netdev_max_backlog + +echo "modifying route table" +route add default gw 10.0.0.1 + +echo -n "waiting for server..." +/usr/bin/netcat -c -l -p 8000 + +BINARY=/benchmarks/netperf/netperf +TEST="TCP_STREAM" +SHORT_ARGS="-l -100k" +LONG_ARGS="-k16384,0 -K16384,0 -- -m 65536 -M 65536 -s 262144 -S 262144" + + +SHORT="$BINARY -H $SERVER -t $TEST $SHORT_ARGS" +LONG="$BINARY -H $SERVER -t $TEST $LONG_ARGS" + +echo "starting test..." +echo "netperf warmup" +echo $SHORT +eval $SHORT + +echo "netperf benchmark" +echo $LONG +/sbin/m5 ivlb 1 +/sbin/m5 resetstats +/sbin/m5 dumpresetstats 2000000000 2000000000 +/sbin/m5 checkpoint 2000000000 2000000000 +eval $LONG +/sbin/m5 exit diff --git a/configs/boot/nat-spec-surge-client.rcS b/configs/boot/nat-spec-surge-client.rcS new file mode 100644 index 000000000..39e3e5070 --- /dev/null +++ b/configs/boot/nat-spec-surge-client.rcS @@ -0,0 +1,51 @@ +#!/bin/sh +# +# /etc/init.d/rcS +# +CLIENT=10.0.0.2 +SERVER=192.168.0.1 + +echo -n "mounting swap..." +/sbin/swapon /dev/hdc1 +echo "done." + +echo -n "setting up network..." +/sbin/ifconfig eth0 $CLIENT txqueuelen 1000 +/sbin/ifconfig lo 127.0.0.1 + +echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle +echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse +echo "1" > /proc/sys/net/ipv4/tcp_window_scaling +echo "0" > /proc/sys/net/ipv4/tcp_timestamps +echo "0" > /proc/sys/net/ipv4/tcp_sack +echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout +echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog + +echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range +echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem +echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem +echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem + +echo "524287" > /proc/sys/net/core/rmem_max +echo "524287" > /proc/sys/net/core/wmem_max +echo "524287" > /proc/sys/net/core/optmem_max +echo "300000" > /proc/sys/net/core/netdev_max_backlog + +echo "131072" > /proc/sys/fs/file-max +echo "done." + +echo "changing route table..." +route add default gw 10.0.0.1 + +echo "waiting for server..." +/usr/bin/netcat -c -l -p 8000 + +echo -n "running surge client..." +/bin/bash -c "cd /benchmarks/surge && ./spec-m5 1 20 1 $SERVER 5 40000 1000000000 1000" +echo "done." + +echo -n "halting machine" +m5 exit + +echo -n "starting bash shell..." +/bin/bash diff --git a/configs/boot/nat-spec-surge-server.rcS b/configs/boot/nat-spec-surge-server.rcS new file mode 100755 index 000000000..39eb5bee0 --- /dev/null +++ b/configs/boot/nat-spec-surge-server.rcS @@ -0,0 +1,56 @@ +#!/bin/sh +# +# /etc/init.d/rcS +# +NATBOX=192.168.0.7 + +echo -n "mounting swap..." +/sbin/swapon /dev/hdc1 +echo "done." + +echo -n "setting up network..." +/sbin/ifconfig eth0 192.168.0.1 txqueuelen 1000 +/sbin/ifconfig eth0:1 192.168.0.2 txqueuelen 1000 +/sbin/ifconfig eth0:2 192.168.0.3 txqueuelen 1000 +/sbin/ifconfig eth0:3 192.168.0.4 txqueuelen 1000 +/sbin/ifconfig eth0:4 192.168.0.5 txqueuelen 1000 +/sbin/ifconfig lo 127.0.0.1 + +echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle +echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse +echo "1" > /proc/sys/net/ipv4/tcp_window_scaling +echo "0" > /proc/sys/net/ipv4/tcp_timestamps +echo "0" > /proc/sys/net/ipv4/tcp_sack +echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout +echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog + +echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range +echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem +echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem +echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem + +echo "524287" > /proc/sys/net/core/rmem_max +echo "524287" > /proc/sys/net/core/wmem_max +echo "524287" > /proc/sys/net/core/optmem_max +echo "300000" > /proc/sys/net/core/netdev_max_backlog + +echo "131072" > /proc/sys/fs/file-max +echo "done." + +echo -n "mounting file set..." +mkdir -p /z/htdocs +mount /dev/hdb1 /z/htdocs +echo "done." + +echo -n "starting httpd..." +/benchmarks/apache2/bin/apachectl start +sleep 2 +cat /benchmarks/apache2/logs/error_log +echo "done." + +echo "notifying natbox..." +echo "server ready" | /usr/bin/netcat -c $NATBOX 8000 +echo "done" + +echo -n "starting bash shell..." +/bin/bash diff --git a/configs/boot/natbox-netperf.rcS b/configs/boot/natbox-netperf.rcS new file mode 100644 index 000000000..d665670fe --- /dev/null +++ b/configs/boot/natbox-netperf.rcS @@ -0,0 +1,51 @@ +#!/bin/sh +EXTIF=192.168.0.2 +INTIF=10.0.0.1 +CLIENT=10.0.0.2 + +echo "setting up network..." +ifconfig lo 127.0.0.1 +ifconfig eth0 $EXTIF txqueuelen 1000 +ifconfig eth1 $INTIF txqueuelen 1000 + +echo "0" > /proc/sys/net/ipv4/tcp_timestamps +echo "0" > /proc/sys/net/ipv4/tcp_sack +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_rmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_wmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_mem +echo "262143" > /proc/sys/net/core/rmem_max +echo "262143" > /proc/sys/net/core/wmem_max +echo "262143" > /proc/sys/net/core/rmem_default +echo "262143" > /proc/sys/net/core/wmem_default +echo "262143" > /proc/sys/net/core/optmem_max +echo "100000" > /proc/sys/net/core/netdev_max_backlog + +echo "1" > /proc/sys/net/ipv4/ip_forward + +echo "waiting for netserver..." +/usr/bin/netcat -c -l -p 8000 + +echo "setting up iptables..." +IPTABLES=/sbin/iptables +EXTIF=eth0 +INTIF=eth1 + +$IPTABLES -P INPUT ACCEPT +$IPTABLES -F INPUT +$IPTABLES -P OUTPUT ACCEPT +$IPTABLES -F OUTPUT +$IPTABLES -P FORWARD DROP +$IPTABLES -F FORWARD +$IPTABLES -t nat -F + +$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT +$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT +$IPTABLES -A FORWARD -j LOG + +$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE + +echo "informing client..." +echo "server ready" | /usr/bin/netcat -c $CLIENT 8000 + +echo "starting bash..." +exec /bin/bash diff --git a/configs/boot/natbox-spec-surge.rcS b/configs/boot/natbox-spec-surge.rcS new file mode 100644 index 000000000..ed74b71bd --- /dev/null +++ b/configs/boot/natbox-spec-surge.rcS @@ -0,0 +1,51 @@ +#!/bin/sh +EXTIF=192.168.0.7 +INTIF=10.0.0.1 +CLIENT=10.0.0.2 + +echo "setting up network..." +ifconfig lo 127.0.0.1 +ifconfig eth0 $EXTIF txqueuelen 1000 +ifconfig eth1 $INTIF txqueuelen 1000 + +echo "0" > /proc/sys/net/ipv4/tcp_timestamps +echo "0" > /proc/sys/net/ipv4/tcp_sack +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_rmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_wmem +echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_mem +echo "262143" > /proc/sys/net/core/rmem_max +echo "262143" > /proc/sys/net/core/wmem_max +echo "262143" > /proc/sys/net/core/rmem_default +echo "262143" > /proc/sys/net/core/wmem_default +echo "262143" > /proc/sys/net/core/optmem_max +echo "100000" > /proc/sys/net/core/netdev_max_backlog + +echo "1" > /proc/sys/net/ipv4/ip_forward + +echo "waiting for netserver..." +/usr/bin/netcat -c -l -p 8000 + +echo "setting up iptables..." +IPTABLES=/sbin/iptables +EXTIF=eth0 +INTIF=eth1 + +$IPTABLES -P INPUT ACCEPT +$IPTABLES -F INPUT +$IPTABLES -P OUTPUT ACCEPT +$IPTABLES -F OUTPUT +$IPTABLES -P FORWARD DROP +$IPTABLES -F FORWARD +$IPTABLES -t nat -F + +$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT +$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT +$IPTABLES -A FORWARD -j LOG + +$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE + +echo "informing client..." +echo "server ready" | /usr/bin/netcat -c $CLIENT 8000 + +echo "starting bash..." +exec /bin/bash diff --git a/configs/boot/nfs-client-smallb.rcS b/configs/boot/nfs-client-smallb.rcS new file mode 100755 index 000000000..22e2107eb --- /dev/null +++ b/configs/boot/nfs-client-smallb.rcS @@ -0,0 +1,50 @@ +#!/bin/sh +# +# /etc/init.d/rcS +# + +echo -n "mounting swap..." +/sbin/swapon /dev/hdc +echo "done." + +echo -n "setting up network..." +/sbin/ifconfig eth0 10.0.0.2 txqueuelen 1000 +/sbin/ifconfig lo 127.0.0.1 + +echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle +echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse +echo "1" > /proc/sys/net/ipv4/tcp_window_scaling +echo "0" > /proc/sys/net/ipv4/tcp_timestamps +echo "0" > /proc/sys/net/ipv4/tcp_sack +echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout +echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog + +echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range +echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem +echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem +echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem + +echo "524287" > /proc/sys/net/core/rmem_max +echo "524287" > /proc/sys/net/core/wmem_max +echo "524287" > /proc/sys/net/core/optmem_max +echo "300000" > /proc/sys/net/core/netdev_max_backlog + +echo "131072" > /proc/sys/fs/file-max +echo "done." + +echo -n "starting nfs client..." +/sbin/portmap & +/sbin/lockd & +echo "done." + +echo -n "waiting for server..." +/usr/bin/netcat -c -l -p 8000 + +echo -n "mounting remote share..." +mkdir /nfs +mount -o rsize=1460,wsize=1460 10.0.0.1:/nfs /nfs +echo "done." + +/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -f -F -d /nfs + +/sbin/m5 exit diff --git a/configs/boot/nfs-client.rcS b/configs/boot/nfs-client.rcS index b0763b77f..a999fb72c 100755 --- a/configs/boot/nfs-client.rcS +++ b/configs/boot/nfs-client.rcS @@ -4,7 +4,7 @@ # echo -n "mounting swap..." -/sbin/swapon /dev/hdc1 +/sbin/swapon /dev/hdc echo "done." echo -n "setting up network..." @@ -18,17 +18,17 @@ echo "0" > /proc/sys/net/ipv4/tcp_timestamps echo "0" > /proc/sys/net/ipv4/tcp_sack echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog - + echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem - + echo "524287" > /proc/sys/net/core/rmem_max echo "524287" > /proc/sys/net/core/wmem_max echo "524287" > /proc/sys/net/core/optmem_max echo "300000" > /proc/sys/net/core/netdev_max_backlog - + echo "131072" > /proc/sys/fs/file-max echo "done." @@ -45,6 +45,6 @@ mkdir /nfs mount 10.0.0.1:/nfs /nfs echo "done." -/bin/bonnie++ -u 99 -s 100 -r 0 -n 0 -d /nfs +/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -f -F -d /nfs /sbin/m5 exit diff --git a/configs/boot/nfs-server.rcS b/configs/boot/nfs-server.rcS index feefc057f..21b7ab83c 100755 --- a/configs/boot/nfs-server.rcS +++ b/configs/boot/nfs-server.rcS @@ -4,17 +4,13 @@ # echo -n "mounting swap..." -/sbin/swapon /dev/hdc1 +/sbin/swapon /dev/hdc echo "done." echo -n "setting up network..." /sbin/ifconfig eth0 10.0.0.1 txqueuelen 1000 -/sbin/ifconfig eth0:1 192.168.0.2 txqueuelen 1000 -/sbin/ifconfig eth0:2 192.168.0.3 txqueuelen 1000 -/sbin/ifconfig eth0:3 192.168.0.4 txqueuelen 1000 -/sbin/ifconfig eth0:4 192.168.0.5 txqueuelen 1000 /sbin/ifconfig lo 127.0.0.1 - + echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse echo "1" > /proc/sys/net/ipv4/tcp_window_scaling @@ -22,46 +18,45 @@ echo "0" > /proc/sys/net/ipv4/tcp_timestamps echo "0" > /proc/sys/net/ipv4/tcp_sack echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog - + echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem - + echo "524287" > /proc/sys/net/core/rmem_max echo "524287" > /proc/sys/net/core/wmem_max echo "524287" > /proc/sys/net/core/optmem_max echo "300000" > /proc/sys/net/core/netdev_max_backlog - + echo "131072" > /proc/sys/fs/file-max echo "done." -echo "/nfs 10.0.0.0/255.0.0.0(rw,sync,no_root_squash)" > /etc/exports - #if [ ! -x /dev/sda ] #then # mknod /dev/sda b 8 0 # mknod /dev/sda1 b 8 1 #fi -/sbin/insmod /modules/scsi_debug.ko dev_size_mb=128 +/sbin/insmod /modules/scsi_debug.ko dev_size_mb=768 echo -n "creating partition and formatting..." -echo "1,120,L" > /tmp/sfdisk.run -/usr/sbin/sfdisk -uM --force /dev/sda < /tmp/sfdisk.run -/sbin/mke2fs /dev/sda1 +#echo "1,767,L" > /tmp/sfdisk.run +#/usr/sbin/sfdisk -uM --force /dev/sda < /tmp/sfdisk.run +/sbin/mke2fs -F /dev/sda mkdir /nfs -/bin/mount /dev/sda1 /nfs +/bin/mount /dev/sda /nfs chmod a+rwx /nfs -/usr/sbin/sfdisk -uM -l /dev/sda +#/usr/sbin/sfdisk -uM -l /dev/sda echo "done." +echo "/nfs 10.0.0.0/255.0.0.0(rw,sync,no_root_squash)" > /etc/exports echo -n "starting nfs kernel server..." -/sbin/nfsd 8 & -/sbin/statd & -/sbin/portmap & -/sbin/lockd & -/sbin/mountd & +/sbin/portmap +/sbin/lockd +/sbin/statd +/sbin/nfsd 8 +/sbin/mountd echo "done." echo "Exporting shares..." @@ -71,6 +66,5 @@ echo -n "signal client to mount..." echo "server ready" | /usr/bin/netcat -c 10.0.0.2 8000 echo "done." - echo -n "starting bash shell..." /bin/bash diff --git a/configs/boot/spec-surge-client.rcS b/configs/boot/spec-surge-client.rcS index 969c8c2ca..b7a2a12e4 100644 --- a/configs/boot/spec-surge-client.rcS +++ b/configs/boot/spec-surge-client.rcS @@ -18,26 +18,25 @@ echo "0" > /proc/sys/net/ipv4/tcp_timestamps echo "0" > /proc/sys/net/ipv4/tcp_sack echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog - + echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem - + echo "524287" > /proc/sys/net/core/rmem_max echo "524287" > /proc/sys/net/core/wmem_max echo "524287" > /proc/sys/net/core/optmem_max echo "300000" > /proc/sys/net/core/netdev_max_backlog - + echo "131072" > /proc/sys/fs/file-max echo "done." -echo -n "sleeping until server is running..." -sleep 3 -echo "done." +echo "waiting for server..." +/usr/bin/netcat -c -l -p 8000 echo -n "running surge client..." -/bin/bash -c "cd /benchmarks/surge && ./spec-m5 2 100 1 192.168.0.1 5" +/bin/bash -c "cd /benchmarks/surge && ./spec-m5 1 20 1 192.168.0.1 5 40000 1000000000 1000" echo "done." echo -n "halting machine" diff --git a/configs/boot/spec-surge-server.rcS b/configs/boot/spec-surge-server.rcS index 28e626120..61afd78bf 100755 --- a/configs/boot/spec-surge-server.rcS +++ b/configs/boot/spec-surge-server.rcS @@ -14,7 +14,7 @@ echo -n "setting up network..." /sbin/ifconfig eth0:3 192.168.0.4 txqueuelen 1000 /sbin/ifconfig eth0:4 192.168.0.5 txqueuelen 1000 /sbin/ifconfig lo 127.0.0.1 - + echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse echo "1" > /proc/sys/net/ipv4/tcp_window_scaling @@ -22,17 +22,17 @@ echo "0" > /proc/sys/net/ipv4/tcp_timestamps echo "0" > /proc/sys/net/ipv4/tcp_sack echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog - + echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem - + echo "524287" > /proc/sys/net/core/rmem_max echo "524287" > /proc/sys/net/core/wmem_max echo "524287" > /proc/sys/net/core/optmem_max echo "300000" > /proc/sys/net/core/netdev_max_backlog - + echo "131072" > /proc/sys/fs/file-max echo "done." @@ -47,5 +47,9 @@ sleep 2 cat /benchmarks/apache2/logs/error_log echo "done." +echo "notifying client..." +echo "server ready" | /usr/bin/netcat -c 192.168.0.10 8000 +echo "done" + echo -n "starting bash shell..." /bin/bash diff --git a/configs/boot/surge-client.rcS b/configs/boot/surge-client.rcS index 1213082f3..f41c13882 100755 --- a/configs/boot/surge-client.rcS +++ b/configs/boot/surge-client.rcS @@ -32,9 +32,8 @@ echo "300000" > /proc/sys/net/core/netdev_max_backlog echo "131072" > /proc/sys/fs/file-max echo "done." -echo -n "sleeping until server is running..." -sleep 3 -echo "done." +echo "waiting for server..." +/usr/bin/netcat -c -l -p 8000 echo -n "running surge client..." /bin/bash -c "cd /benchmarks/surge && ./Surge 2 100 1 192.168.0.1 5" diff --git a/configs/boot/surge-server.rcS b/configs/boot/surge-server.rcS index 28e626120..75642c259 100755 --- a/configs/boot/surge-server.rcS +++ b/configs/boot/surge-server.rcS @@ -3,6 +3,7 @@ # /etc/init.d/rcS # + echo -n "mounting swap..." /sbin/swapon /dev/hdc1 echo "done." @@ -47,5 +48,7 @@ sleep 2 cat /benchmarks/apache2/logs/error_log echo "done." +echo "server ready" | /usr/bin/netcat -c 192.168.10 8000 + echo -n "starting bash shell..." /bin/bash diff --git a/cpu/base_cpu.cc b/cpu/base_cpu.cc index e4dd744a6..7605ff3c3 100644 --- a/cpu/base_cpu.cc +++ b/cpu/base_cpu.cc @@ -30,10 +30,11 @@ #include <sstream> #include <iostream> -#include "cpu/base_cpu.hh" #include "base/cprintf.hh" -#include "cpu/exec_context.hh" +#include "base/loader/symtab.hh" #include "base/misc.hh" +#include "cpu/base_cpu.hh" +#include "cpu/exec_context.hh" #include "sim/param.hh" #include "sim/sim_events.hh" @@ -52,7 +53,8 @@ BaseCPU::BaseCPU(const string &_name, int _number_of_threads, bool _def_reg, Counter max_insts_all_threads, Counter max_loads_any_thread, Counter max_loads_all_threads, - System *_system, Tick freq) + System *_system, Tick freq, + bool _function_trace, Tick _function_trace_start) : SimObject(_name), frequency(freq), checkInterrupts(true), deferRegistration(_def_reg), number_of_threads(_number_of_threads), system(_system) @@ -61,7 +63,8 @@ BaseCPU::BaseCPU(const string &_name, int _number_of_threads, bool _def_reg, Counter max_insts_any_thread, Counter max_insts_all_threads, Counter max_loads_any_thread, - Counter max_loads_all_threads) + Counter max_loads_all_threads, + bool _function_trace, Tick _function_trace_start) : SimObject(_name), deferRegistration(_def_reg), number_of_threads(_number_of_threads) #endif @@ -126,8 +129,39 @@ BaseCPU::BaseCPU(const string &_name, int _number_of_threads, bool _def_reg, memset(interrupts, 0, sizeof(interrupts)); intstatus = 0; #endif + + functionTracingEnabled = false; + if (_function_trace) { + std::string filename = csprintf("ftrace.%s", name()); + functionTraceStream = makeOutputStream(filename); + currentFunctionStart = currentFunctionEnd = 0; + functionEntryTick = _function_trace_start; + + if (_function_trace_start == 0) { + functionTracingEnabled = true; + } else { + Event *e = + new EventWrapper<BaseCPU, &BaseCPU::enableFunctionTrace>(this, + true); + e->schedule(_function_trace_start); + } + } } + +void +BaseCPU::enableFunctionTrace() +{ + functionTracingEnabled = true; +} + +BaseCPU::~BaseCPU() +{ + if (functionTracingEnabled) + closeOutputStream(functionTraceStream); +} + + void BaseCPU::init() { @@ -267,4 +301,32 @@ BaseCPU::unserialize(Checkpoint *cp, const std::string §ion) #endif // FULL_SYSTEM +void +BaseCPU::traceFunctionsInternal(Addr pc) +{ + if (!debugSymbolTable) + return; + + // if pc enters different function, print new function symbol and + // update saved range. Otherwise do nothing. + if (pc < currentFunctionStart || pc >= currentFunctionEnd) { + string sym_str; + bool found = debugSymbolTable->findNearestSymbol(pc, sym_str, + currentFunctionStart, + currentFunctionEnd); + + if (!found) { + // no symbol found: use addr as label + sym_str = csprintf("0x%x", pc); + currentFunctionStart = pc; + currentFunctionEnd = pc + 1; + } + + ccprintf(*functionTraceStream, " (%d)\n%d: %s", + curTick - functionEntryTick, curTick, sym_str); + functionEntryTick = curTick; + } +} + + DEFINE_SIM_OBJECT_CLASS_NAME("BaseCPU", BaseCPU) diff --git a/cpu/base_cpu.hh b/cpu/base_cpu.hh index 8668c3216..baa956aa8 100644 --- a/cpu/base_cpu.hh +++ b/cpu/base_cpu.hh @@ -95,16 +95,18 @@ class BaseCPU : public SimObject BaseCPU(const std::string &_name, int _number_of_threads, bool _def_reg, Counter max_insts_any_thread, Counter max_insts_all_threads, Counter max_loads_any_thread, Counter max_loads_all_threads, - System *_system, Tick freq); + System *_system, Tick freq, + bool _function_trace = false, Tick _function_trace_start = 0); #else BaseCPU(const std::string &_name, int _number_of_threads, bool _def_reg, Counter max_insts_any_thread = 0, Counter max_insts_all_threads = 0, Counter max_loads_any_thread = 0, - Counter max_loads_all_threads = 0); + Counter max_loads_all_threads = 0, + bool _function_trace = false, Tick _function_trace_start = 0); #endif - virtual ~BaseCPU() {} + virtual ~BaseCPU(); virtual void init(); virtual void regStats(); @@ -166,6 +168,23 @@ class BaseCPU : public SimObject virtual Counter totalInstructions() const { return 0; } + // Function tracing + private: + bool functionTracingEnabled; + std::ostream *functionTraceStream; + Addr currentFunctionStart; + Addr currentFunctionEnd; + Tick functionEntryTick; + void enableFunctionTrace(); + void traceFunctionsInternal(Addr pc); + + protected: + void traceFunctions(Addr pc) + { + if (functionTracingEnabled) + traceFunctionsInternal(pc); + } + private: static std::vector<BaseCPU *> cpuList; //!< Static global cpu list diff --git a/cpu/exetrace.cc b/cpu/exetrace.cc index e31c3590c..ff7e90c9e 100644 --- a/cpu/exetrace.cc +++ b/cpu/exetrace.cc @@ -48,8 +48,6 @@ using namespace std; // -SymbolTable *debugSymbolTable = NULL; - void Trace::InstRecord::dump(ostream &outs) { @@ -66,11 +64,17 @@ Trace::InstRecord::dump(ostream &outs) outs << "T" << thread << " : "; - std::string str; - if ((debugSymbolTable) && (debugSymbolTable->findNearestSymbol(PC, str))) - outs << "@" << setw(17) << str << " : "; - else + std::string sym_str; + Addr sym_addr; + if (debugSymbolTable + && debugSymbolTable->findNearestSymbol(PC, sym_str, sym_addr)) { + if (PC != sym_addr) + sym_str += csprintf("+%d", PC - sym_addr); + outs << "@" << sym_str << " : "; + } + else { outs << "0x" << hex << PC << " : "; + } // // Print decoded instruction diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index 04783574f..d48f93663 100644 --- a/cpu/simple_cpu/simple_cpu.cc +++ b/cpu/simple_cpu/simple_cpu.cc @@ -123,11 +123,12 @@ SimpleCPU::SimpleCPU(const string &_name, FunctionalMemory *mem, MemInterface *icache_interface, MemInterface *dcache_interface, - bool _def_reg, Tick freq) + bool _def_reg, Tick freq, + bool _function_trace, Tick _function_trace_start) : BaseCPU(_name, /* number_of_threads */ 1, _def_reg, max_insts_any_thread, max_insts_all_threads, max_loads_any_thread, max_loads_all_threads, - _system, freq), + _system, freq, _function_trace, _function_trace_start), #else SimpleCPU::SimpleCPU(const string &_name, Process *_process, Counter max_insts_any_thread, @@ -136,10 +137,12 @@ SimpleCPU::SimpleCPU(const string &_name, Process *_process, Counter max_loads_all_threads, MemInterface *icache_interface, MemInterface *dcache_interface, - bool _def_reg) + bool _def_reg, + bool _function_trace, Tick _function_trace_start) : BaseCPU(_name, /* number_of_threads */ 1, _def_reg, max_insts_any_thread, max_insts_all_threads, - max_loads_any_thread, max_loads_all_threads), + max_loads_any_thread, max_loads_all_threads, + _function_trace, _function_trace_start), #endif tickEvent(this), xc(NULL), cacheCompletionEvent(this) { @@ -778,6 +781,8 @@ SimpleCPU::tick() if (traceData) traceData->finalize(); + traceFunctions(xc->regs.pc); + } // if (fault == No_Fault) if (fault != No_Fault) { @@ -836,6 +841,8 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(SimpleCPU) Param<bool> defer_registration; Param<int> multiplier; + Param<bool> function_trace; + Param<Tick> function_trace_start; END_DECLARE_SIM_OBJECT_PARAMS(SimpleCPU) @@ -869,7 +876,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(SimpleCPU) INIT_PARAM_DFLT(defer_registration, "defer registration with system " "(for sampling)", false), - INIT_PARAM_DFLT(multiplier, "clock multiplier", 1) + INIT_PARAM_DFLT(multiplier, "clock multiplier", 1), + INIT_PARAM_DFLT(function_trace, "Enable function trace", false), + INIT_PARAM_DFLT(function_trace_start, "Cycle to start function trace", 0) END_INIT_SIM_OBJECT_PARAMS(SimpleCPU) @@ -888,7 +897,8 @@ CREATE_SIM_OBJECT(SimpleCPU) (icache) ? icache->getInterface() : NULL, (dcache) ? dcache->getInterface() : NULL, defer_registration, - ticksPerSecond * mult); + ticksPerSecond * mult, + function_trace, function_trace_start); #else cpu = new SimpleCPU(getInstanceName(), workload, @@ -896,7 +906,8 @@ CREATE_SIM_OBJECT(SimpleCPU) max_loads_any_thread, max_loads_all_threads, (icache) ? icache->getInterface() : NULL, (dcache) ? dcache->getInterface() : NULL, - defer_registration); + defer_registration, + function_trace, function_trace_start); #endif // FULL_SYSTEM diff --git a/cpu/simple_cpu/simple_cpu.hh b/cpu/simple_cpu/simple_cpu.hh index 1610d6060..341a0da23 100644 --- a/cpu/simple_cpu/simple_cpu.hh +++ b/cpu/simple_cpu/simple_cpu.hh @@ -31,7 +31,6 @@ #include "cpu/base_cpu.hh" #include "sim/eventq.hh" -#include "base/loader/symtab.hh" #include "cpu/pc_event.hh" #include "base/statistics.hh" #include "cpu/exec_context.hh" @@ -143,7 +142,8 @@ class SimpleCPU : public BaseCPU Counter max_loads_any_thread, Counter max_loads_all_threads, AlphaITB *itb, AlphaDTB *dtb, FunctionalMemory *mem, MemInterface *icache_interface, MemInterface *dcache_interface, - bool _def_reg, Tick freq); + bool _def_reg, Tick freq, + bool _function_trace, Tick _function_trace_start); #else @@ -153,7 +153,8 @@ class SimpleCPU : public BaseCPU Counter max_loads_any_thread, Counter max_loads_all_threads, MemInterface *icache_interface, MemInterface *dcache_interface, - bool _def_reg); + bool _def_reg, + bool _function_trace, Tick _function_trace_start); #endif diff --git a/dev/ns_gige.cc b/dev/ns_gige.cc index 401599126..e51e14f1d 100644 --- a/dev/ns_gige.cc +++ b/dev/ns_gige.cc @@ -1341,9 +1341,6 @@ NSGigE::rxKick() // sanity check - i think the driver behaves like this assert(rxDescCnt >= rxPktBytes); - - // Must clear the value before popping to decrement the - // reference count rxFifo.pop(); } @@ -1564,9 +1561,6 @@ NSGigE::transmit() * besides, it's functionally the same. */ devIntrPost(ISR_TXOK); - } else { - DPRINTF(Ethernet, - "May need to rethink always sending the descriptors back?\n"); } if (!txFifo.empty() && !txEvent.scheduled()) { @@ -1822,7 +1816,11 @@ NSGigE::txKick() // this is just because the receive can't handle a // packet bigger want to make sure assert(txPacket->length <= 1514); - txFifo.push(txPacket); +#ifndef NDEBUG + bool success = +#endif + txFifo.push(txPacket); + assert(success); /* * this following section is not tqo spec, but @@ -1903,6 +1901,7 @@ NSGigE::txKick() txPacketBufPtr += txXferLen; txFragPtr += txXferLen; txDescCnt -= txXferLen; + txFifo.reserve(txXferLen); txState = txFifoBlock; break; diff --git a/dev/pktfifo.cc b/dev/pktfifo.cc index cf09ae910..00c12ce68 100644 --- a/dev/pktfifo.cc +++ b/dev/pktfifo.cc @@ -36,6 +36,7 @@ PacketFifo::serialize(const string &base, ostream &os) { paramOut(os, base + ".size", _size); paramOut(os, base + ".maxsize", _maxsize); + paramOut(os, base + ".reserved", _reserved); paramOut(os, base + ".packets", fifo.size()); int i = 0; @@ -54,6 +55,7 @@ PacketFifo::unserialize(const string &base, Checkpoint *cp, { paramIn(cp, section, base + ".size", _size); paramIn(cp, section, base + ".maxsize", _maxsize); + paramIn(cp, section, base + ".reserved", _reserved); int fifosize; paramIn(cp, section, base + ".packets", fifosize); diff --git a/dev/pktfifo.hh b/dev/pktfifo.hh index a54a49996..0c237949c 100644 --- a/dev/pktfifo.hh +++ b/dev/pktfifo.hh @@ -43,25 +43,36 @@ class PacketFifo std::list<PacketPtr> fifo; int _maxsize; int _size; + int _reserved; public: - explicit PacketFifo(int max) : _maxsize(max), _size(0) {} + explicit PacketFifo(int max) : _maxsize(max), _size(0), _reserved(0) {} virtual ~PacketFifo() {} - int maxsize() const { return _maxsize; } int packets() const { return fifo.size(); } + int maxsize() const { return _maxsize; } int size() const { return _size; } - int avail() const { return _maxsize - _size; } - bool empty() const { return _size == 0; } - bool full() const { return _size >= _maxsize; } + int reserved() const { return _reserved; } + int avail() const { return _maxsize - _size - _reserved; } + bool empty() const { return size() <= 0; } + bool full() const { return avail() <= 0; } + + int reserve(int len = 0) + { + _reserved += len; + assert(avail() >= 0); + return _reserved; + } bool push(PacketPtr ptr) { - if (avail() < ptr->length) + assert(_reserved <= ptr->length); + if (avail() < ptr->length - _reserved) return false; _size += ptr->length; fifo.push_back(ptr); + _reserved = 0; return true; } @@ -81,6 +92,7 @@ class PacketFifo { fifo.clear(); _size = 0; + _reserved = 0; } /** diff --git a/kern/linux/linux_system.cc b/kern/linux/linux_system.cc index 29bd39857..4342463c3 100644 --- a/kern/linux/linux_system.cc +++ b/kern/linux/linux_system.cc @@ -35,6 +35,7 @@ * up boot time. */ +#include "base/loader/symtab.hh" #include "base/trace.hh" #include "cpu/exec_context.hh" #include "cpu/base_cpu.hh" @@ -49,8 +50,6 @@ #include "targetarch/vtophys.hh" #include "sim/debug.hh" -extern SymbolTable *debugSymbolTable; - using namespace std; LinuxSystem::LinuxSystem(Params *p) diff --git a/kern/tru64/tru64_system.cc b/kern/tru64/tru64_system.cc index 0380c9478..c6435cb18 100644 --- a/kern/tru64/tru64_system.cc +++ b/kern/tru64/tru64_system.cc @@ -26,6 +26,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "base/loader/symtab.hh" #include "base/trace.hh" #include "cpu/exec_context.hh" #include "kern/tru64/tru64_events.hh" diff --git a/sim/process.cc b/sim/process.cc index 98db1f2e0..bd1a2d8fd 100644 --- a/sim/process.cc +++ b/sim/process.cc @@ -34,6 +34,7 @@ #include "base/intmath.hh" #include "base/loader/object_file.hh" +#include "base/loader/symtab.hh" #include "base/statistics.hh" #include "cpu/exec_context.hh" #include "cpu/full_cpu/smt.hh" @@ -263,6 +264,18 @@ LiveProcess::LiveProcess(const string &name, ObjectFile *objFile, // load object file into target memory objFile->loadSections(memory); + // load up symbols, if any... these may be used for debugging or + // profiling. + if (!debugSymbolTable) { + debugSymbolTable = new SymbolTable(); + if (!objFile->loadGlobalSymbols(debugSymbolTable) || + !objFile->loadLocalSymbols(debugSymbolTable)) { + // didn't load any symbols + delete debugSymbolTable; + debugSymbolTable = NULL; + } + } + // Set up stack. On Alpha, stack goes below text section. This // code should get moved to some architecture-specific spot. stack_base = text_base - (409600+4096); diff --git a/sim/system.cc b/sim/system.cc index 1b1a145c6..c6a65f9d9 100644 --- a/sim/system.cc +++ b/sim/system.cc @@ -44,8 +44,6 @@ vector<System *> System::systemList; int System::numSystemsRunning = 0; -extern SymbolTable *debugSymbolTable; - System::System(Params *p) : SimObject(p->name), memctrl(p->memctrl), physmem(p->physmem), init_param(p->init_param), params(p) diff --git a/sim/system.hh b/sim/system.hh index 61784b044..07881ff01 100644 --- a/sim/system.hh +++ b/sim/system.hh @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "base/loader/symtab.hh" #include "base/statistics.hh" #include "cpu/pc_event.hh" #include "kern/system_events.hh" @@ -43,6 +42,7 @@ class PhysicalMemory; class Platform; class RemoteGDB; class GDBListener; +class SymbolTable; class ObjectFile; class ExecContext; namespace Kernel { class Binning; } diff --git a/util/stats/info.py b/util/stats/info.py index a94563cf9..15a4a7d73 100644 --- a/util/stats/info.py +++ b/util/stats/info.py @@ -152,9 +152,8 @@ class Statistic(object): def __setattr__(self, attr, value): if attr == 'bins' or attr == 'ticks': if attr == 'bins': - global db if value is not None: - value = db.getBin(value) + value = source.getBin(value) elif attr == 'samples' and type(value) is str: value = [ int(x) for x in value.split() ] diff --git a/util/stats/stats.py b/util/stats/stats.py index 37bb1d70b..8ec889f09 100755 --- a/util/stats/stats.py +++ b/util/stats/stats.py @@ -43,7 +43,7 @@ def graphdata(runs, tag, label, value): import info configs = ['stx', 'ste', 'hte', 'htd', 'ocm', 'occ', 'ocp' ] benchmarks = [ 'm', 's' ] - dmas = [ 'X', 'D' ] + dmas = [ 'x', 'd', 'b' ] caches = [ '2', '4' ] checkpoints = [ '1' ] @@ -56,7 +56,7 @@ def graphdata(runs, tag, label, value): for bench,dma,cache,cpt in names: base = '%s.%s.%s.%s' % (bench, dma, cache, cpt) - fname = '/n/ziff/z/binkertn/graph/test2/data/%s.%s.dat' % (tag, base) + fname = 'data/%s.%s.dat' % (tag, base) f = open(fname, 'w') print >>f, '#set TITLE = %s' % base print >>f, '#set xlbl = Configuration' @@ -132,8 +132,6 @@ def commands(options, command, args): info.source.connect() info.source.update_dict(globals()) - system = info.source.__dict__[options.system] - if type(options.get) is str: info.source.get = options.get @@ -178,6 +176,26 @@ def commands(options, command, args): if options.graph: graphdata(runs, stat.name, stat.name, stat) else: + if options.binned: + print 'kernel ticks' + stat.bins = 'kernel' + printdata(runs, stat) + + print 'idle ticks' + stat.bins = 'idle' + printdata(runs, stat) + + print 'user ticks' + stat.bins = 'user' + printdata(runs, stat) + + print 'interrupt ticks' + stat.bins = 'user' + printdata(runs, stat) + + print 'total ticks' + + stat.bins = None print stat.name printdata(runs, stat) return @@ -212,6 +230,8 @@ def commands(options, command, args): if len(args): raise CommandException + system = info.source.__dict__[options.system] + if command == 'usertime': import copy kernel = copy.copy(system.full_cpu.numCycles) |