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 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..233eab521 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 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 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 /** - * 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 f6abf7e3d..c018ae4f8 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 48230c7a2..df3783991 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 e31c3590c..58fb7d668 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 12bfafd6b..c5d35a4fc 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 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::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 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 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; } 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 feefc057f..024b42f76 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 b0763b77f..e843069ef 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 024b42f76..f09b547bd 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 969c8c2ca..617be6420 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 28e626120..b7e5d73c0 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 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 617be6420..d02241a3e 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 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 58fb7d668..ff7e90c9e 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 c018ae4f8..2a29a8575 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 df3783991..5ae29b057 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 1610d6060..8ea100b22 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 a8ab12f98..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" 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/system.hh b/sim/system.hh index 61784b044..07881ff01 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 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 e843069ef..005743bfb 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 f09b547bd..21b7ab83c 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 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 e4dd744a6..7605ff3c3 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 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 cpuList; //!< Static global cpu list 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 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 8ea100b22..341a0da23 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 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 005743bfb..a999fb72c 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 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 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/spec-surge-client.rcS b/configs/boot/spec-surge-client.rcS index d02241a3e..b7a2a12e4 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 b7e5d73c0..61afd78bf 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 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 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 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.hh b/dev/pktfifo.hh index a54a49996..0b2e95e2a 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 233eab521..8ec889f09 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 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 0b2e95e2a..56e72947a 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 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 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 56e72947a..0c237949c 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 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