From 53b606683b5151641298d722dd3640c1e039098f Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sun, 14 Nov 2004 17:41:56 -0500 Subject: [PATCH 01/45] New system configurations that work around the bus bridge memory system bug --HG-- extra : convert_revision : 29aa265126691eee386bc73a86e5d382e12b59a9 From ed1ff7fca9b3bb390eb35748b6baa329690747cb Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Sun, 14 Nov 2004 18:52:04 -0500 Subject: [PATCH 02/45] updated to make memory a touch slower in the HT case and the make sure the interrupt controller is on cpu die --HG-- extra : convert_revision : 07b7eadbec7694859957279c81b9bdb4ebd044a3 From e462e9627af3af5af0c5eb3c597fdf7810fa45de Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 15 Nov 2004 00:43:34 -0500 Subject: [PATCH 03/45] commit ploticus code to repository --HG-- extra : convert_revision : 861423a859d05e7915d9f83ef40c188fe21bcb31 From 10e88b43fd8e7f504d3db0eb59fcf596eb16a985 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 01:36:27 -0500 Subject: [PATCH 04/45] Fix more of the stats python stuff util/stats/info.py: Make the binnings stuff work again. util/stats/stats.py: small patch for graphing make it so we can print out bins for the stat command --HG-- extra : convert_revision : c0279ac7030fd5146dd00801baa41e7baf97d1f4 --- util/stats/info.py | 3 +-- util/stats/stats.py | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/util/stats/info.py b/util/stats/info.py index a94563cf96..15a4a7d737 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 37bb1d70bb..233eab521a 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' @@ -178,6 +178,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 From 928656aecb1215d293dfeef2dee030ee571abf97 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 01:55:24 -0500 Subject: [PATCH 05/45] make it so we can individually use the sampling cpu on either the client or the server. Make an ini file that makes our benchmarks easier to run. --HG-- extra : convert_revision : c270cd1c027cb40d5c5bcfc2ed63f9db4b155116 From fed64a3b3634315bce420b2bc63312c1fa62bb8f Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Mon, 15 Nov 2004 01:56:40 -0500 Subject: [PATCH 06/45] Add support for sampled PC profiling to FullCPU. Simple text list of symbol (or address) and count will be dumped to m5prof. if the cpu's pc_sample_interval param is set. SConscript: Add cpu/full_cpu/pc_sample_profile.cc base/callback.hh: Add a comment about MakeCallback. Fix type in another comment. base/loader/symtab.cc: Revamp findNearestSymbol() to provide addresses of both nearest symbols (preceding and following) as well as string for former. Move global definition of debugSymbolTable here too. base/loader/symtab.hh: Revamp findNearestSymbol() to provide addresses of both nearest symbols (preceding and following) as well as string for former. Move global declaration of debugSymbolTable here too. cpu/exetrace.cc: Use new findNearestSymbol() interface for trace symbols. kern/linux/linux_system.cc: sim/system.cc: Remove extern of debugSymbolTable (now in symtab.hh) sim/process.cc: Initialize debugSymbolTable if binary has a symbol table. --HG-- extra : convert_revision : 0b5393dc39c40ac88c953684708f1125da550671 --- SConscript | 1 + base/callback.hh | 7 +++++-- base/loader/symtab.cc | 28 ++++++++++++---------------- base/loader/symtab.hh | 28 +++++++++++++++++++++++++++- cpu/exetrace.cc | 16 ++++++++++------ kern/linux/linux_system.cc | 2 -- sim/process.cc | 13 +++++++++++++ sim/system.cc | 2 -- 8 files changed, 68 insertions(+), 29 deletions(-) diff --git a/SConscript b/SConscript index 7769d07083..3938f792fe 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 342ab7e0fe..cc2a2f4295 100644 --- a/base/callback.hh +++ b/base/callback.hh @@ -32,7 +32,7 @@ #include /** - * 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 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/loader/symtab.cc b/base/loader/symtab.cc index f6abf7e3dd..c018ae4f86 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); + // find first key *larger* than desired address + ATable::const_iterator i = addrTable.upper_bound(address); - // check for PALCode - if (address & 0x1) + // if very first key is larger, we're out of luck + if (i == addrTable.begin()) return false; - // first check for the end - if (i == addrTable.end()) - i--; - else if (i == addrTable.begin() && (*i).first != address) - 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; } diff --git a/base/loader/symtab.hh b/base/loader/symtab.hh index 48230c7a23..df3783991a 100644 --- a/base/loader/symtab.hh +++ b/base/loader/symtab.hh @@ -49,7 +49,27 @@ 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; @@ -57,4 +77,10 @@ class SymbolTable 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/cpu/exetrace.cc b/cpu/exetrace.cc index e31c3590cd..58fb7d6688 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", addr - sym_addr); + outs << "@" << setw(17) << sym_str << " : "; + } + else { outs << "0x" << hex << PC << " : "; + } // // Print decoded instruction diff --git a/kern/linux/linux_system.cc b/kern/linux/linux_system.cc index 12bfafd6b8..c5d35a4fc5 100644 --- a/kern/linux/linux_system.cc +++ b/kern/linux/linux_system.cc @@ -49,8 +49,6 @@ #include "targetarch/vtophys.hh" #include "sim/debug.hh" -extern SymbolTable *debugSymbolTable; - using namespace std; LinuxSystem::LinuxSystem(Params *p) diff --git a/sim/process.cc b/sim/process.cc index 98db1f2e06..bd1a2d8fd1 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 1b1a145c6d..c6a65f9d9a 100644 --- a/sim/system.cc +++ b/sim/system.cc @@ -44,8 +44,6 @@ vector 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) From bd4f5f843d1b5f4f4255e0d53df73de353a5a2de Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 02:44:22 -0500 Subject: [PATCH 07/45] mount surge image read-only --HG-- extra : convert_revision : b91a93f9dc004c587d3ec763ecde98e5bd241159 From f7323aebe846d1e46ad95dec5d17917538136949 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 15:40:35 -0500 Subject: [PATCH 08/45] fix udp checksums base/inet.hh: tcp/udp/ip checksums are calculated/manipulated in NBO always, so there's no need to convert to host endian. --HG-- extra : convert_revision : 13d6aff025a6c072d9d829c2e9fad4f13399b1f7 --- base/inet.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/inet.hh b/base/inet.hh index 10b782a6c8..4f3857a155 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; } From 49d470a3b58d1cd6105e8f52a6c31cdaace0381a Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 15:42:15 -0500 Subject: [PATCH 09/45] cleanup the nfs server script configs/boot/nfs-server.rcS: don't need extra IP aliases re-order the nfs daemons so they happen in the right order and don't have the shell put them in the background since they will auto detach anyway. --HG-- extra : convert_revision : a6b13ac91d1649878d346663f6ddff56d9a8a8ec --- configs/boot/nfs-server.rcS | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/configs/boot/nfs-server.rcS b/configs/boot/nfs-server.rcS index feefc057f6..024b42f763 100755 --- a/configs/boot/nfs-server.rcS +++ b/configs/boot/nfs-server.rcS @@ -9,10 +9,6 @@ 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 @@ -36,8 +32,6 @@ 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 @@ -56,12 +50,13 @@ chmod a+rwx /nfs /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 From 2cc34a34df700b74907a24f8c0edbd9f3f1f17dd Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 15:44:25 -0500 Subject: [PATCH 10/45] formatting configs/boot/nfs-client.rcS: fix whitespace --HG-- extra : convert_revision : dc384870de9431fe30b13a2c8c69d97b2d06dca9 --- configs/boot/nfs-client.rcS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/boot/nfs-client.rcS b/configs/boot/nfs-client.rcS index b0763b77fc..e843069ef9 100755 --- a/configs/boot/nfs-client.rcS +++ b/configs/boot/nfs-client.rcS @@ -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." From abbbea57a7df658953d66bc8bafadbbd23fd3fe7 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 15:45:55 -0500 Subject: [PATCH 11/45] more formatting configs/boot/nfs-server.rcS: fix whitespace --HG-- extra : convert_revision : d421d5fa1e041b041d7c47d36abe55a2dd3e7487 --- configs/boot/nfs-server.rcS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/boot/nfs-server.rcS b/configs/boot/nfs-server.rcS index 024b42f763..f09b547bd9 100755 --- a/configs/boot/nfs-server.rcS +++ b/configs/boot/nfs-server.rcS @@ -10,7 +10,7 @@ echo "done." echo -n "setting up network..." /sbin/ifconfig eth0 10.0.0.1 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 @@ -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." From 63dbaccdc48e01b9afda5f469e0f5bcbce887d62 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 16:07:28 -0500 Subject: [PATCH 12/45] more whitespace fixes configs/boot/spec-surge-client.rcS: configs/boot/spec-surge-server.rcS: whitespace fixes --HG-- extra : convert_revision : 90eb2a325a3cf4436081c992d6f3e0f903980ff7 --- configs/boot/spec-surge-client.rcS | 6 +++--- configs/boot/spec-surge-server.rcS | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configs/boot/spec-surge-client.rcS b/configs/boot/spec-surge-client.rcS index 969c8c2ca8..617be6420f 100644 --- a/configs/boot/spec-surge-client.rcS +++ b/configs/boot/spec-surge-client.rcS @@ -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." diff --git a/configs/boot/spec-surge-server.rcS b/configs/boot/spec-surge-server.rcS index 28e6261204..b7e5d73c03 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." From f08cb657038f48ce7d780c4508a43c6869f90890 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 16:11:30 -0500 Subject: [PATCH 13/45] clean up benchmarks differentiate the two surge benchmarks --HG-- extra : convert_revision : 8fd9717b34a5cdfa9e36a421e3df7cd957becb9c From eb7b873b05f176934937eb291b6f46a96265b079 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 18:20:43 -0500 Subject: [PATCH 14/45] Fix up the spec-surge benchmark configs/boot/spec-surge-client.rcS: change the number of connections and add stuff for the file set size and checkpointing --HG-- extra : convert_revision : 9e0fe74f44300893c6050e3eb1ae302f71c02767 --- configs/boot/spec-surge-client.rcS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/boot/spec-surge-client.rcS b/configs/boot/spec-surge-client.rcS index 617be6420f..d02241a3ed 100644 --- a/configs/boot/spec-surge-client.rcS +++ b/configs/boot/spec-surge-client.rcS @@ -37,7 +37,7 @@ sleep 3 echo "done." 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" From e904ef37636ec7381cba003a3c9451a088a38190 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 18:21:36 -0500 Subject: [PATCH 15/45] make benchmarks.ini a bit less confusing --HG-- extra : convert_revision : 047ff4f84677d5b132b4d1fe80fbbf91a213a833 From 26c666b4f3e8a96503d3742632b278fe781263d9 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Mon, 15 Nov 2004 19:57:11 -0500 Subject: [PATCH 16/45] Minor fixes for pc sampling profile. cpu/exetrace.cc: Fix dumb mistake. --HG-- extra : convert_revision : 9d5d0d09775133d1a60cf459f1bd47afa8480663 --- cpu/exetrace.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/exetrace.cc b/cpu/exetrace.cc index 58fb7d6688..ff7e90c9ec 100644 --- a/cpu/exetrace.cc +++ b/cpu/exetrace.cc @@ -69,8 +69,8 @@ Trace::InstRecord::dump(ostream &outs) if (debugSymbolTable && debugSymbolTable->findNearestSymbol(PC, sym_str, sym_addr)) { if (PC != sym_addr) - sym_str += csprintf("+%d", addr - sym_addr); - outs << "@" << setw(17) << sym_str << " : "; + sym_str += csprintf("+%d", PC - sym_addr); + outs << "@" << sym_str << " : "; } else { outs << "0x" << hex << PC << " : "; From b1816cb83716bf96557a2a36f25f6ca65f20dd8c Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Mon, 15 Nov 2004 20:30:51 -0500 Subject: [PATCH 17/45] Minor cleanup of symtab code/includes. base/loader/symtab.cc: base/loader/symtab.hh: Get rid of old unused calls. cpu/simple_cpu/simple_cpu.hh: No need to include base/loader/symtab.hh kern/linux/linux_system.cc: kern/tru64/tru64_system.cc: Include base/loader/symtab.hh (since it's no longer included in system.hh) sim/system.hh: Replace include of base/loader/symtab.hh with forward class decl. --HG-- extra : convert_revision : 3a778c2f409ec94e3b00eaa9b3859943cb39918c --- base/loader/symtab.cc | 16 ---------------- base/loader/symtab.hh | 3 --- cpu/simple_cpu/simple_cpu.hh | 1 - kern/linux/linux_system.cc | 1 + kern/tru64/tru64_system.cc | 1 + sim/system.hh | 2 +- 6 files changed, 3 insertions(+), 21 deletions(-) diff --git a/base/loader/symtab.cc b/base/loader/symtab.cc index c018ae4f86..2a29a85752 100644 --- a/base/loader/symtab.cc +++ b/base/loader/symtab.cc @@ -136,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 df3783991a..5ae29b0578 100644 --- a/base/loader/symtab.hh +++ b/base/loader/symtab.hh @@ -72,9 +72,6 @@ class SymbolTable 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 diff --git a/cpu/simple_cpu/simple_cpu.hh b/cpu/simple_cpu/simple_cpu.hh index 1610d60606..8ea100b223 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" diff --git a/kern/linux/linux_system.cc b/kern/linux/linux_system.cc index a8ab12f98e..4342463c37 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" diff --git a/kern/tru64/tru64_system.cc b/kern/tru64/tru64_system.cc index 0380c9478a..c6435cb187 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/system.hh b/sim/system.hh index 61784b0442..07881ff01c 100644 --- a/sim/system.hh +++ b/sim/system.hh @@ -32,7 +32,6 @@ #include #include -#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; } From 605961fa1a3390dbcac86ff5e489dfba43b16d22 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 23:23:04 -0500 Subject: [PATCH 18/45] setup memory sizes for the various benchmarks --HG-- extra : convert_revision : a5861aaa53cc71c67e32bf633ce7bbe2d9c892ca From e0c2ef317b113483e3063c8fabe0e3ddb96f90d3 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 23:26:10 -0500 Subject: [PATCH 19/45] All of these benchmarks use two systems --HG-- extra : convert_revision : d3482d77b08b5ef040d0d933b3320c5db4781bb5 From 1da2738d9bccf31fb0baba17bc2f8028e3ef4a52 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 16 Nov 2004 00:03:03 -0500 Subject: [PATCH 20/45] improve configs --HG-- extra : convert_revision : 981568baeaa7ab78cccc9e3ac5112b2426a440ff From a5b3a0199ff40788341cba51669c3bfcc9c88081 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 16 Nov 2004 00:15:14 -0500 Subject: [PATCH 21/45] fix benchmark.ini ordering --HG-- extra : convert_revision : 55580e2aa602479ff804bd27857d0b10250ce376 From 0ef1cac5c3f61a5d4e38cd139c53352f8c9cec31 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 16 Nov 2004 00:28:35 -0500 Subject: [PATCH 22/45] Dual core configuration for detailed simulation --HG-- extra : convert_revision : 8f2e27631365a3ffe4aa7a9a1d29081ef786801b From 8f362c7621de77836ddfc36d7d84732d10398c00 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 16 Nov 2004 00:30:35 -0500 Subject: [PATCH 23/45] Fix default sampling periods --HG-- extra : convert_revision : bc1f5c36fb6f7bb56e4a403f4ae0d87fee044459 From 82235799d35461b13f6841f16aa590e27bcaef42 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 16 Nov 2004 00:34:45 -0500 Subject: [PATCH 24/45] fixed for 768MB runs --HG-- extra : convert_revision : c86b282788919d414470aaf551094fee1bebbbab --- configs/boot/nfs-client.rcS | 4 ++-- configs/boot/nfs-server.rcS | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/configs/boot/nfs-client.rcS b/configs/boot/nfs-client.rcS index e843069ef9..005743bfb4 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..." @@ -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 -d /nfs /sbin/m5 exit diff --git a/configs/boot/nfs-server.rcS b/configs/boot/nfs-server.rcS index f09b547bd9..21b7ab83c8 100755 --- a/configs/boot/nfs-server.rcS +++ b/configs/boot/nfs-server.rcS @@ -4,7 +4,7 @@ # echo -n "mounting swap..." -/sbin/swapon /dev/hdc1 +/sbin/swapon /dev/hdc echo "done." echo -n "setting up network..." @@ -38,16 +38,16 @@ echo "done." # 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 From 44759118ac9450fa46491fc564c3b891e6bcceb4 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 16 Nov 2004 00:46:17 -0500 Subject: [PATCH 25/45] use the big swap disk --HG-- extra : convert_revision : 87bae6fc4746e7b5b029ea45ab2b71e0d8cd58ae From 34b20144639a75926ec87fcb5be83bcb5aeffb07 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 16 Nov 2004 02:22:07 -0500 Subject: [PATCH 26/45] add asymmetric dual configurations --HG-- extra : convert_revision : e1479f7033350982d729c0b7228f570d4302fe6b From b6f2e3f96d2d2d05cbeb41b415bfb9fa06b02bbc Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 16 Nov 2004 16:05:53 -0500 Subject: [PATCH 27/45] more ordering for .ini file. --HG-- extra : convert_revision : 0b20009bd1688e7ccc52d4a5afd384180ada2e72 From c9b0204e2891d2004d33aff196833fa009e00892 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Tue, 16 Nov 2004 17:20:38 -0500 Subject: [PATCH 28/45] Add simple function-tracing support. Prints a message every time the committed PC changes from one symbol scope to another. Set function_trace=y on target CPU to enable. To defer start, use function_trace_start= (in addition to setting function_trace=y). cpu/base_cpu.cc: cpu/base_cpu.hh: Add simple function-tracing support. cpu/simple_cpu/simple_cpu.cc: Add function_trace, function_trace_start params Call traceFunctions() on instruction completion cpu/simple_cpu/simple_cpu.hh: Add function_trace, function_trace_start params --HG-- extra : convert_revision : 8a7f84028ccbaee585253629007f32fc8eae35e1 --- cpu/base_cpu.cc | 70 +++++++++++++++++++++++++++++++++--- cpu/base_cpu.hh | 25 +++++++++++-- cpu/simple_cpu/simple_cpu.cc | 25 +++++++++---- cpu/simple_cpu/simple_cpu.hh | 6 ++-- 4 files changed, 110 insertions(+), 16 deletions(-) diff --git a/cpu/base_cpu.cc b/cpu/base_cpu.cc index e4dd744a6d..7605ff3c3f 100644 --- a/cpu/base_cpu.cc +++ b/cpu/base_cpu.cc @@ -30,10 +30,11 @@ #include #include -#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(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 8668c3216a..baa956aa8a 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 cpuList; //!< Static global cpu list diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index 04783574f7..d48f936638 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 defer_registration; Param multiplier; + Param function_trace; + Param 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 8ea100b223..341a0da236 100644 --- a/cpu/simple_cpu/simple_cpu.hh +++ b/cpu/simple_cpu/simple_cpu.hh @@ -142,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 @@ -152,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 From 5c06abd58c5533856f1593b6c386a13f798f2258 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Tue, 16 Nov 2004 17:23:54 -0500 Subject: [PATCH 29/45] Add simple python utility for parsing function profile output. --HG-- extra : convert_revision : 99e227830088a8db96e0e8fbe04cae49005bd43f From 9f2df2d621829d5698121fa526878b1b3f92e45e Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 16 Nov 2004 21:59:12 -0500 Subject: [PATCH 30/45] skip the nfs charecter by charecter and re-write stuff configs/boot/nfs-client.rcS: skip the charecter and rewrite test --HG-- extra : convert_revision : 2630e1f1a2a52a4e96a45e12769a94de28ad5c93 --- configs/boot/nfs-client.rcS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/boot/nfs-client.rcS b/configs/boot/nfs-client.rcS index 005743bfb4..a999fb72c1 100755 --- a/configs/boot/nfs-client.rcS +++ b/configs/boot/nfs-client.rcS @@ -45,6 +45,6 @@ mkdir /nfs mount 10.0.0.1:/nfs /nfs echo "done." -/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -d /nfs +/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -f -F -d /nfs /sbin/m5 exit From 33135a051abcaad29bd04118e9d7028f7529b4a5 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 16 Nov 2004 22:09:27 -0500 Subject: [PATCH 31/45] more ini fixing --HG-- extra : convert_revision : 27e946a3e620e045ef6d6b001dd9b3daccfa147e From 2c5b0c544cf27ccc9020bc7dbe4735462e887fec Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Tue, 16 Nov 2004 22:42:33 -0500 Subject: [PATCH 32/45] Modest enhancement to profile-top script --HG-- extra : convert_revision : 19986c011852577a6b5bb6bca59b35e07dc083c3 From 182425da82976a7bddcd259e8b56fed348c52eab Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Tue, 16 Nov 2004 22:43:12 -0500 Subject: [PATCH 33/45] add support for NAT under netperf stream, maerts, and spec-surge. configs/boot/spec-surge-client.rcS: configs/boot/surge-client.rcS: fix this rcS - don't sleep, instead wait for the server to tell you it's done. configs/boot/spec-surge-server.rcS: configs/boot/surge-server.rcS: notify the client you're done starting the server. --HG-- extra : convert_revision : b708bd0a9147e248eed7c27e7078668fbd98b95e --- configs/boot/nat-netperf-maerts-client.rcS | 48 +++++++++++++++++++ configs/boot/nat-netperf-server.rcS | 30 ++++++++++++ configs/boot/nat-netperf-stream-client.rcS | 48 +++++++++++++++++++ configs/boot/nat-spec-surge-client.rcS | 51 ++++++++++++++++++++ configs/boot/nat-spec-surge-server.rcS | 56 ++++++++++++++++++++++ configs/boot/natbox-netperf.rcS | 51 ++++++++++++++++++++ configs/boot/natbox-spec-surge.rcS | 51 ++++++++++++++++++++ configs/boot/spec-surge-client.rcS | 5 +- configs/boot/spec-surge-server.rcS | 4 ++ configs/boot/surge-client.rcS | 5 +- configs/boot/surge-server.rcS | 3 ++ 11 files changed, 346 insertions(+), 6 deletions(-) create mode 100644 configs/boot/nat-netperf-maerts-client.rcS create mode 100644 configs/boot/nat-netperf-server.rcS create mode 100644 configs/boot/nat-netperf-stream-client.rcS create mode 100644 configs/boot/nat-spec-surge-client.rcS create mode 100755 configs/boot/nat-spec-surge-server.rcS create mode 100644 configs/boot/natbox-netperf.rcS create mode 100644 configs/boot/natbox-spec-surge.rcS diff --git a/configs/boot/nat-netperf-maerts-client.rcS b/configs/boot/nat-netperf-maerts-client.rcS new file mode 100644 index 0000000000..24d7c2ca1c --- /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 0000000000..c0646b61ca --- /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 0000000000..9e29378c8e --- /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 0000000000..39e3e5070a --- /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 0000000000..39eb5bee08 --- /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 0000000000..d665670fe9 --- /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 0000000000..ed74b71bd9 --- /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/spec-surge-client.rcS b/configs/boot/spec-surge-client.rcS index d02241a3ed..b7a2a12e46 100644 --- a/configs/boot/spec-surge-client.rcS +++ b/configs/boot/spec-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 && ./spec-m5 1 20 1 192.168.0.1 5 40000 1000000000 1000" diff --git a/configs/boot/spec-surge-server.rcS b/configs/boot/spec-surge-server.rcS index b7e5d73c03..61afd78bf0 100755 --- a/configs/boot/spec-surge-server.rcS +++ b/configs/boot/spec-surge-server.rcS @@ -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 1213082f38..f41c13882d 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 28e6261204..75642c259b 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 From 8a2975074f737d95233acbb70259e862f8244b36 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 16 Nov 2004 22:46:56 -0500 Subject: [PATCH 34/45] Add nfs small block benchmark --HG-- extra : convert_revision : 488fa56c49b97ea46fa85c5f820565debb324e39 From 87612a032c0a8ddc1a4af51608f5800d252683f7 Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Tue, 16 Nov 2004 23:00:19 -0500 Subject: [PATCH 35/45] make spec-surge use the specweb fileset. --HG-- extra : convert_revision : cc955b1c7a28cdcebc0b084b41f8fc52713e8d45 From 95ce45ade93856d3f3dce6536e297f3b6247b481 Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Tue, 16 Nov 2004 23:07:27 -0500 Subject: [PATCH 36/45] nest the 2Int references inside #ifdefs so that the parser doesn't fart. --HG-- extra : convert_revision : 0dbcefc327128674952782440639bac7b0b9e96e From a109296bdeaf43c76c2384c67b05d4b5bd484ff4 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 16 Nov 2004 23:59:51 -0500 Subject: [PATCH 37/45] Fix a bug where we would improperly calculate if the FIFO was full by adding a reserve feature to the packet fifo which allows us to reserve space in the fifo if only part of a packet was copied into the fifo. dev/ns_gige.cc: use the new reserve feature in the fifo to properly determine when we're full. assert that adding a packet to the fifo suceeds. dev/pktfifo.hh: add the ability to reserve space in the fifo. This is useful for partial writing of packets into the fifo. --HG-- extra : convert_revision : 83f871f34fac237bb464c9513cf6490b5c62420e --- dev/ns_gige.cc | 13 ++++++------- dev/pktfifo.hh | 20 +++++++++++++++----- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/dev/ns_gige.cc b/dev/ns_gige.cc index 401599126a..e51e14f1d0 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.hh b/dev/pktfifo.hh index a54a499966..0b2e95e2ab 100644 --- a/dev/pktfifo.hh +++ b/dev/pktfifo.hh @@ -43,6 +43,7 @@ class PacketFifo std::list fifo; int _maxsize; int _size; + int _reserved; public: explicit PacketFifo(int max) : _maxsize(max), _size(0) {} @@ -50,18 +51,27 @@ class PacketFifo int maxsize() const { return _maxsize; } int packets() const { return fifo.size(); } - int size() const { return _size; } - int avail() const { return _maxsize - _size; } - bool empty() const { return _size == 0; } - bool full() const { return _size >= _maxsize; } + int size() const { return _size + _reserved; } + int avail() const { return maxsize() - size(); } + bool empty() const { return size() == 0; } + bool full() const { return size() >= maxsize(); } + + 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; } From ee962a6b0bf71b9ca8ce0b3cadc17938266fa162 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 17 Nov 2004 00:03:59 -0500 Subject: [PATCH 38/45] Fix some commands. util/stats/stats.py: we only need the system if we're issuing one of the commands that uses a stored formula. --HG-- extra : convert_revision : d129a00eeba46a03f7d600922d679aa0f43636be --- util/stats/stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/stats/stats.py b/util/stats/stats.py index 233eab521a..8ec889f09b 100755 --- a/util/stats/stats.py +++ b/util/stats/stats.py @@ -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 @@ -232,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) From 82e2fc3994d536396810616ae494c70d89a486f2 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Wed, 17 Nov 2004 00:04:01 -0500 Subject: [PATCH 39/45] Add categorization support to profile-top script. --HG-- extra : convert_revision : eaee8e5ee12b7cfcd77a65fa96d17c7019c94089 From c43c3f2af3d328e040b1e8f8149879b1cdb74c5f Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 17 Nov 2004 00:28:42 -0500 Subject: [PATCH 40/45] initialize _reserved --HG-- extra : convert_revision : a0f98c135734602b1d4b0890d8ff8cecc0e42f88 --- dev/pktfifo.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/pktfifo.hh b/dev/pktfifo.hh index 0b2e95e2ab..56e72947a3 100644 --- a/dev/pktfifo.hh +++ b/dev/pktfifo.hh @@ -46,7 +46,7 @@ class PacketFifo 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; } From 0c056556b1ec992689a15750083b4fb95edaf3e5 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Wed, 17 Nov 2004 00:52:55 -0500 Subject: [PATCH 41/45] Add chart data output option to profile-top. --HG-- extra : convert_revision : 1aa2435eb0771c1d46100700364b2d4dbff27a05 From 5f6328d9c63e44dd16be54a6fbab4fbdb3b78d7e Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 17 Nov 2004 01:27:08 -0500 Subject: [PATCH 42/45] properly implement the fifo _reserved stuff. dev/pktfifo.cc: need to checkpoint _reserved dev/pktfifo.hh: When clearing, clear _reserved size() is used for determining how many bytes are in the fifo ready to be pulled, so we don't want to add _reserved avail() on the other hand is used for determining how much free space is in the fifo for adding packets. adjust the implementation of empty() and full() to reflect this. --HG-- extra : convert_revision : 3281972b4b70ea5833d39ae7ce1e73648b3573b0 --- dev/pktfifo.cc | 2 ++ dev/pktfifo.hh | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dev/pktfifo.cc b/dev/pktfifo.cc index cf09ae910f..00c12ce681 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 56e72947a3..0c237949c7 100644 --- a/dev/pktfifo.hh +++ b/dev/pktfifo.hh @@ -49,12 +49,13 @@ class PacketFifo explicit PacketFifo(int max) : _maxsize(max), _size(0), _reserved(0) {} virtual ~PacketFifo() {} - int maxsize() const { return _maxsize; } int packets() const { return fifo.size(); } - int size() const { return _size + _reserved; } - int avail() const { return maxsize() - size(); } - bool empty() const { return size() == 0; } - bool full() const { return size() >= maxsize(); } + int maxsize() const { return _maxsize; } + int size() const { return _size; } + 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) { @@ -91,6 +92,7 @@ class PacketFifo { fifo.clear(); _size = 0; + _reserved = 0; } /** From 95fdc9e47bf67cbb0b7ca733c2c9e0aa1d05eb17 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Wed, 17 Nov 2004 02:08:27 -0500 Subject: [PATCH 43/45] added small block nfs script --HG-- extra : convert_revision : 1fab69c3ccda27cab2cec1375bc1bd02b2b8f156 --- configs/boot/nfs-client-smallb.rcS | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 configs/boot/nfs-client-smallb.rcS diff --git a/configs/boot/nfs-client-smallb.rcS b/configs/boot/nfs-client-smallb.rcS new file mode 100755 index 0000000000..22e2107eb6 --- /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 From 4e8bc3f125fed5c742c9de2c977af87d16cc5b05 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 17 Nov 2004 02:25:09 -0500 Subject: [PATCH 44/45] tweak ini files --HG-- extra : convert_revision : 6fb96ad5ad83c2bc5f55838ea9be4c67a821c896 From 091bded6cd658142374c142ebf3247b4dbf73133 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Wed, 17 Nov 2004 04:05:22 -0500 Subject: [PATCH 45/45] added categories for all symbols nate made the matching a much much much faster --HG-- extra : convert_revision : e3da92ead971628b0acf133cedf601c0d71b8f0d