diff options
-rw-r--r-- | arch/alpha/pseudo_inst.hh | 7 | ||||
-rw-r--r-- | base/statistics.cc | 8 | ||||
-rw-r--r-- | kern/tru64/tru64_system.cc | 31 | ||||
-rw-r--r-- | kern/tru64/tru64_system.hh | 4 | ||||
-rwxr-xr-x | util/rundiff | 47 |
5 files changed, 79 insertions, 18 deletions
diff --git a/arch/alpha/pseudo_inst.hh b/arch/alpha/pseudo_inst.hh index 60031f8cd..85f432504 100644 --- a/arch/alpha/pseudo_inst.hh +++ b/arch/alpha/pseudo_inst.hh @@ -30,6 +30,13 @@ class ExecContext; namespace AlphaPseudo { + /** + * @todo these externs are only here for a hack in fullCPU::takeOver... + */ + extern bool doStatisticsInsts; + extern bool doCheckpointInsts; + extern bool doQuiesce; + void quiesce(ExecContext *xc); void m5exit(ExecContext *xc); void m5exit_old(ExecContext *xc); diff --git a/base/statistics.cc b/base/statistics.cc index 3af764609..69b663dbb 100644 --- a/base/statistics.cc +++ b/base/statistics.cc @@ -272,6 +272,8 @@ Database::reset() ++i; } + MainBin *orig = MainBin::current(); + list<GenBin *>::iterator bi = bins.begin(); list<GenBin *>::iterator be = bins.end(); while (bi != be) { @@ -286,6 +288,8 @@ Database::reset() } ++bi; } + + orig->activate(); } void @@ -588,13 +592,13 @@ PrintOne(ostream &stream, result_t value, #ifdef STAT_DISPLAY_COMPAT if (flags & __substat) { - ccprintf(stream, "%32s%12s%10s%10s", name, + ccprintf(stream, "%32s %12s %10s %10s", name, ValueToString(value, precision), pdfstr, cdfstr); } else #endif { - ccprintf(stream, "%-40s%12s%10s%10s", name, + ccprintf(stream, "%-40s %12s %10s %10s", name, ValueToString(value, precision), pdfstr, cdfstr); } diff --git a/kern/tru64/tru64_system.cc b/kern/tru64/tru64_system.cc index f6f147d07..3fa07828b 100644 --- a/kern/tru64/tru64_system.cc +++ b/kern/tru64/tru64_system.cc @@ -164,6 +164,9 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param, sosendBin = new Statistics::MainBin(name() + " sosend"); fnBins.insert(make_pair("sosend", sosendBin)); + tcpSosendBin = new Statistics::MainBin(name() + " tcp_sosend"); + fnBins.insert(make_pair("tcp_sosend", tcpSosendBin)); + tcpOutputBin = new Statistics::MainBin(name() + " tcp_output"); fnBins.insert(make_pair("tcp_output", tcpOutputBin)); @@ -182,6 +185,9 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param, esTxeofBin = new Statistics::MainBin(name() + " es_txeof"); fnBins.insert(make_pair("es_txeof", esTxeofBin)); + idleThreadBin = new Statistics::MainBin(name() + " idle_thread"); + fnBins.insert(make_pair("idle_thread", idleThreadBin)); + } //INSTRUMENTATION CODEGEN END #endif //FS_MEASURE @@ -226,12 +232,14 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param, sooWriteEvent = new FnEvent(&pcEventQueue, "soo_write", this); senditEvent = new FnEvent(&pcEventQueue, "sendit", this); sosendEvent = new FnEvent(&pcEventQueue, "sosend", this); + tcpSosendEvent = new FnEvent(&pcEventQueue, "tcp_sosend", this); tcpOutputEvent = new FnEvent(&pcEventQueue, "tcp_output", this); ipOutputEvent = new FnEvent(&pcEventQueue, "ip_output", this); etherOutputEvent = new FnEvent(&pcEventQueue, "ether_output", this); esStartEvent = new FnEvent(&pcEventQueue, "es_start", this); esTransmitEvent = new FnEvent(&pcEventQueue, "es_transmit", this); esTxeofEvent = new FnEvent(&pcEventQueue, "es_txeof", this); + idleThreadEvent = new FnEvent(&pcEventQueue, "idle_thread", this); } //INSTRUMENTATION CODEGEN END #endif //FS_MEASURE @@ -405,6 +413,11 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param, else panic("could not find kernel symbol \'sosend\'"); + if (kernelSymtab->findAddress("tcp_sosend", addr)) + tcpSosendEvent->schedule(addr); + else + panic("could not find kernel symbol \'tcp_sosend\'"); + if (kernelSymtab->findAddress("tcp_output", addr)) tcpOutputEvent->schedule(addr); else @@ -435,6 +448,11 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param, else panic("could not find kernel symbol \'es_txeof\'"); + if (kernelSymtab->findAddress("idle_thread", addr)) + idleThreadEvent->schedule(addr); + else + panic("could not find kernel symbol \'idle_thread\'"); + } //INSTRUMENTATION CODEGEN END if (bin == true) { @@ -466,16 +484,21 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param, populateMap("soreceive", "soo_read"); populateMap("write", ""); - populateMap("sendit", "write"); + populateMap("osend", ""); + populateMap("soo_write", "write"); + populateMap("sendit", "osend"); populateMap("sosend", "sendit"); - - populateMap("tcp_output", ""); + populateMap("sosend", "soo_write"); + populateMap("tcp_sosend", "sosend"); + populateMap("tcp_output", "tcp_sosend"); populateMap("ip_output", "tcp_output"); populateMap("ether_output", "ip_output"); populateMap("es_start", "ether_output"); populateMap("es_transmit", "es_start"); populateMap("es_txeof", "es_intr"); + + populateMap("idle_thread", ""); } #endif //FS_MEASURE } @@ -524,12 +547,14 @@ Tru64System::~Tru64System() delete sooWriteEvent; delete senditEvent; delete sosendEvent; + delete tcpSosendEvent; delete tcpOutputEvent; delete ipOutputEvent; delete etherOutputEvent; delete esStartEvent; delete esTransmitEvent; delete esTxeofEvent; + delete idleThreadEvent; } //INSTRUMENTATION CODEGEN END #endif //FS_MEASURE diff --git a/kern/tru64/tru64_system.hh b/kern/tru64/tru64_system.hh index 42107494f..93cc908e3 100644 --- a/kern/tru64/tru64_system.hh +++ b/kern/tru64/tru64_system.hh @@ -87,12 +87,14 @@ class Tru64System : public System Statistics::MainBin *sooWriteBin; Statistics::MainBin *senditBin; Statistics::MainBin *sosendBin; + Statistics::MainBin *tcpSosendBin; Statistics::MainBin *tcpOutputBin; Statistics::MainBin *ipOutputBin; Statistics::MainBin *etherOutputBin; Statistics::MainBin *esStartBin; Statistics::MainBin *esTransmitBin; Statistics::MainBin *esTxeofBin; + Statistics::MainBin *idleThreadBin; //INSTRUMENTATION CODEGEN END #endif //FS_MEASURE @@ -130,12 +132,14 @@ class Tru64System : public System FnEvent *sooWriteEvent; FnEvent *senditEvent; FnEvent *sosendEvent; + FnEvent *tcpSosendEvent; FnEvent *tcpOutputEvent; FnEvent *ipOutputEvent; FnEvent *etherOutputEvent; FnEvent *esStartEvent; FnEvent *esTransmitEvent; FnEvent *esTxeofEvent; + FnEvent *idleThreadEvent; //INSTRUMENTATION CODEGEN END #endif //FS_MEASURE diff --git a/util/rundiff b/util/rundiff index 732b84d21..05beba84b 100755 --- a/util/rundiff +++ b/util/rundiff @@ -41,21 +41,42 @@ use strict; +use Getopt::Std; + +# +# Options: +# -c <n> : print n lines of context before & after changes +# -l <n> : use n lines of lookahead +# -x : use "complex" diff from Algorithm::Diff (see below) +# +our ($opt_c, $opt_l, $opt_x); +getopts('c:l:x'); + # # For the highest-quality (minimal) diffs, we can use the -# Algorithm::Diff package. If you don't have this installed, or want -# the script to run faster (like 3-4x faster, based on informal -# observation), set $use_complexdiff to 0; then a built-in, simple, -# and generally quite adequate algorithm will be used instead. -my $use_complexdiff = 0; - -#if ($use_complexdiff) { -# use Algorithm::Diff qw(traverse_sequences); -#}; - -my $lookahead_lines = 200; -my $precontext_lines = 3; -my $postcontext_lines = 3; +# Algorithm::Diff package. By default, a built-in, simple, and +# generally quite adequate algorithm will be used. If you have +# Algorithm::Diff installed on your system, and don't mind having the +# script go slower (like 3-4x slower, based on informal observation), +# then specify '-x' on the command line to use it. +my $use_complexdiff = defined($opt_x); + +if ($use_complexdiff) { + # Don't use 'use', as that's a compile-time option and will fail + # on systems that don't have Algorithm::Diff installed even if + # $use_complexdiff is false. 'require' is evaluated at runtime, + # so it's OK. + require Algorithm::Diff; + import Algorithm::Diff qw(traverse_sequences); +}; + +my $lookahead_lines = $opt_l || 200; + +# in theory you could have different amounts of context before and +# after a diff, but until someone needs that there's only one arg to +# set both. +my $precontext_lines = $opt_c || 3; +my $postcontext_lines = $precontext_lines; my $file1 = $ARGV[0]; my $file2 = $ARGV[1]; |