summaryrefslogtreecommitdiff
path: root/src/mem/ruby
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2013-10-15 18:22:49 -0400
committerSteve Reinhardt <steve.reinhardt@amd.com>2013-10-15 18:22:49 -0400
commitb10ff075b102b2a2e4abf5d22735b919a8fda1a9 (patch)
treef4cb14cc72e47b2d681b5f29cc01ae54a00152ae /src/mem/ruby
parentfe61a074a2563e7e5d7d57f0b0ce2158f651e883 (diff)
downloadgem5-b10ff075b102b2a2e4abf5d22735b919a8fda1a9.tar.xz
ruby: eliminate non-determinism from ruby.stats output
Get rid of non-deterministic "stats" in ruby.stats output such as time & date of run, elapsed & CPU time used, and memory usage. These values cause spurious miscomparisons when looking at output diffs (though they don't affect regressions, since the regressions pass/fail status currently ignores ruby.stats entirely). Most of this information is already captured in other places (time & date in stdout, elapsed time & mem usage in stats.txt), where the regression script is smart enough to filter it out. It seems easier to get rid of the redundant output rather than teaching the regression tester to ignore the same information in two different places.
Diffstat (limited to 'src/mem/ruby')
-rw-r--r--src/mem/ruby/profiler/Profiler.cc71
-rw-r--r--src/mem/ruby/system/System.cc6
2 files changed, 0 insertions, 77 deletions
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc
index 11eb9afab..d0ea7921c 100644
--- a/src/mem/ruby/profiler/Profiler.cc
+++ b/src/mem/ruby/profiler/Profiler.cc
@@ -42,9 +42,6 @@
----------------------------------------------------------------------
*/
-// Allows use of times() library call, which determines virtual runtime
-#include <sys/resource.h>
-#include <sys/times.h>
#include <sys/types.h>
#include <unistd.h>
@@ -64,9 +61,6 @@
using namespace std;
using m5::stl_helpers::operator<<;
-static double process_memory_total();
-static double process_memory_resident();
-
Profiler::Profiler(const Params *p)
: SimObject(p)
{
@@ -385,50 +379,14 @@ Profiler::printStats(ostream& out, bool short_stats)
out << "Profiler Stats" << endl;
out << "--------------" << endl;
- time_t real_time_current = time(NULL);
- double seconds = difftime(real_time_current, m_real_time_start_time);
- double minutes = seconds / 60.0;
- double hours = minutes / 60.0;
- double days = hours / 24.0;
Cycles ruby_cycles = g_system_ptr->curCycle()-m_ruby_start;
- if (!short_stats) {
- out << "Elapsed_time_in_seconds: " << seconds << endl;
- out << "Elapsed_time_in_minutes: " << minutes << endl;
- out << "Elapsed_time_in_hours: " << hours << endl;
- out << "Elapsed_time_in_days: " << days << endl;
- out << endl;
- }
-
- // print the virtual runtimes as well
- struct tms vtime;
- times(&vtime);
- seconds = (vtime.tms_utime + vtime.tms_stime) / 100.0;
- minutes = seconds / 60.0;
- hours = minutes / 60.0;
- days = hours / 24.0;
- out << "Virtual_time_in_seconds: " << seconds << endl;
- out << "Virtual_time_in_minutes: " << minutes << endl;
- out << "Virtual_time_in_hours: " << hours << endl;
- out << "Virtual_time_in_days: " << days << endl;
- out << endl;
-
out << "Ruby_current_time: " << g_system_ptr->curCycle() << endl;
out << "Ruby_start_time: " << m_ruby_start << endl;
out << "Ruby_cycles: " << ruby_cycles << endl;
out << endl;
if (!short_stats) {
- out << "mbytes_resident: " << process_memory_resident() << endl;
- out << "mbytes_total: " << process_memory_total() << endl;
- if (process_memory_total() > 0) {
- out << "resident_ratio: "
- << process_memory_resident()/process_memory_total() << endl;
- }
- out << endl;
- }
-
- if (!short_stats) {
out << "Busy Controller Counts:" << endl;
for (uint32_t i = 0; i < MachineType_NUM; i++) {
uint32_t size = MachineType_base_count((MachineType)i);
@@ -571,35 +529,6 @@ Profiler::bankBusy()
m_busyBankCount++;
}
-// Helper function
-static double
-process_memory_total()
-{
- // 4kB page size, 1024*1024 bytes per MB,
- const double MULTIPLIER = 4096.0 / (1024.0 * 1024.0);
- ifstream proc_file;
- proc_file.open("/proc/self/statm");
- int total_size_in_pages = 0;
- int res_size_in_pages = 0;
- proc_file >> total_size_in_pages;
- proc_file >> res_size_in_pages;
- return double(total_size_in_pages) * MULTIPLIER; // size in megabytes
-}
-
-static double
-process_memory_resident()
-{
- // 4kB page size, 1024*1024 bytes per MB,
- const double MULTIPLIER = 4096.0 / (1024.0 * 1024.0);
- ifstream proc_file;
- proc_file.open("/proc/self/statm");
- int total_size_in_pages = 0;
- int res_size_in_pages = 0;
- proc_file >> total_size_in_pages;
- proc_file >> res_size_in_pages;
- return double(res_size_in_pages) * MULTIPLIER; // size in megabytes
-}
-
void
Profiler::rubyWatch(int id)
{
diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc
index 1f209f785..016169bcc 100644
--- a/src/mem/ruby/system/System.cc
+++ b/src/mem/ruby/system/System.cc
@@ -136,12 +136,6 @@ RubySystem::~RubySystem()
void
RubySystem::printStats(ostream& out)
{
- const time_t T = time(NULL);
- tm *localTime = localtime(&T);
- char buf[100];
- strftime(buf, 100, "%b/%d/%Y %H:%M:%S", localTime);
- out << "Real time: " << buf << endl;
-
m_profiler_ptr->printStats(out);
}