diff options
Diffstat (limited to 'base')
68 files changed, 465 insertions, 282 deletions
diff --git a/base/circlebuf.cc b/base/circlebuf.cc index 7bd488ef8..2d77c9482 100644 --- a/base/circlebuf.cc +++ b/base/circlebuf.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/circlebuf.hh b/base/circlebuf.hh index 168158bb7..7549672ab 100644 --- a/base/circlebuf.hh +++ b/base/circlebuf.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/compression/lzss_compression.cc b/base/compression/lzss_compression.cc index 2f6c5d338..46f1b0266 100644 --- a/base/compression/lzss_compression.cc +++ b/base/compression/lzss_compression.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/compression/lzss_compression.hh b/base/compression/lzss_compression.hh index 9707a8aca..e5e8c8da4 100644 --- a/base/compression/lzss_compression.hh +++ b/base/compression/lzss_compression.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/compression/null_compression.hh b/base/compression/null_compression.hh index 6a630b113..195498f1b 100644 --- a/base/compression/null_compression.hh +++ b/base/compression/null_compression.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/cprintf.cc b/base/cprintf.cc index 5cbf0c057..2c8402c9b 100644 --- a/base/cprintf.cc +++ b/base/cprintf.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/cprintf.hh b/base/cprintf.hh index ca5c08b16..a3a621785 100644 --- a/base/cprintf.hh +++ b/base/cprintf.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/cprintf_formats.hh b/base/cprintf_formats.hh index 120dd94b1..b9131310a 100644 --- a/base/cprintf_formats.hh +++ b/base/cprintf_formats.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/dbl_list.hh b/base/dbl_list.hh index 4f6d61a45..1b0478d55 100644 --- a/base/dbl_list.hh +++ b/base/dbl_list.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2000-2001, 2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/fast_alloc.cc b/base/fast_alloc.cc index abb50aa0c..d1e6cfdf1 100644 --- a/base/fast_alloc.cc +++ b/base/fast_alloc.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2000-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/fast_alloc.hh b/base/fast_alloc.hh index 81f2f1359..4536284df 100644 --- a/base/fast_alloc.hh +++ b/base/fast_alloc.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2000-2001, 2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/fifo_buffer.cc b/base/fifo_buffer.cc index d103d2e60..0fb8458d7 100644 --- a/base/fifo_buffer.cc +++ b/base/fifo_buffer.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/fifo_buffer.hh b/base/fifo_buffer.hh index 767db03a4..c51b0394e 100644 --- a/base/fifo_buffer.hh +++ b/base/fifo_buffer.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/hashmap.hh b/base/hashmap.hh index 59c1fe3aa..4584813dd 100644 --- a/base/hashmap.hh +++ b/base/hashmap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/hybrid_pred.cc b/base/hybrid_pred.cc index 12bab975b..d20bf6e51 100644 --- a/base/hybrid_pred.cc +++ b/base/hybrid_pred.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,7 +63,7 @@ HybridPredictor::HybridPredictor(const char *_p_name, const char *_z_name, void HybridPredictor::regStats() { - using namespace Statistics; + using namespace Stats; string p_name; stringstream description; @@ -148,7 +148,7 @@ void HybridPredictor::regStats() void HybridPredictor::regFormulas() { - using namespace Statistics; + using namespace Stats; string p_name; stringstream description; diff --git a/base/hybrid_pred.hh b/base/hybrid_pred.hh index 9063f3084..f81faf865 100644 --- a/base/hybrid_pred.hh +++ b/base/hybrid_pred.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,22 +59,22 @@ class HybridPredictor : public GenericPredictor // // Stats // - Statistics::Scalar<> pred_one; //num_one_preds - Statistics::Scalar<> pred_zero; //num_zero_preds - Statistics::Scalar<> correct_pred_one; //num_one_correct - Statistics::Scalar<> correct_pred_zero; //num_zero_correct - Statistics::Scalar<> record_one; //num_one_updates - Statistics::Scalar<> record_zero; //num_zero_updates - - Statistics::Formula total_preds; - Statistics::Formula frac_preds_zero; - Statistics::Formula frac_preds_one; - Statistics::Formula total_correct; - Statistics::Formula total_accuracy; - Statistics::Formula zero_accuracy; - Statistics::Formula one_accuracy; - Statistics::Formula zero_coverage; - Statistics::Formula one_coverage; + Stats::Scalar<> pred_one; //num_one_preds + Stats::Scalar<> pred_zero; //num_zero_preds + Stats::Scalar<> correct_pred_one; //num_one_correct + Stats::Scalar<> correct_pred_zero; //num_zero_correct + Stats::Scalar<> record_one; //num_one_updates + Stats::Scalar<> record_zero; //num_zero_updates + + Stats::Formula total_preds; + Stats::Formula frac_preds_zero; + Stats::Formula frac_preds_one; + Stats::Formula total_correct; + Stats::Formula total_accuracy; + Stats::Formula zero_accuracy; + Stats::Formula one_accuracy; + Stats::Formula zero_coverage; + Stats::Formula one_coverage; public: HybridPredictor(const char *_p_name, const char *_z_name, diff --git a/base/inet.cc b/base/inet.cc index 46aa027fc..e2bdd19ff 100644 --- a/base/inet.cc +++ b/base/inet.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/inet.hh b/base/inet.hh index 1ae2e8542..67ac5a504 100644 --- a/base/inet.hh +++ b/base/inet.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/inifile.cc b/base/inifile.cc index 001e0a6f8..7f6a42dd6 100644 --- a/base/inifile.cc +++ b/base/inifile.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/inifile.hh b/base/inifile.hh index f7229f2f2..01e4e6c17 100644 --- a/base/inifile.hh +++ b/base/inifile.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/intmath.cc b/base/intmath.cc index 2e220aa3b..f84e124fb 100644 --- a/base/intmath.cc +++ b/base/intmath.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001, 2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/intmath.hh b/base/intmath.hh index 28e9d5c68..fc28eecef 100644 --- a/base/intmath.hh +++ b/base/intmath.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001, 2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/loader/elf_object.cc b/base/loader/elf_object.cc index 5a8f937cc..b8f46449a 100644 --- a/base/loader/elf_object.cc +++ b/base/loader/elf_object.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/loader/elf_object.hh b/base/loader/elf_object.hh index 35a6c6d6e..9ae587e9c 100644 --- a/base/loader/elf_object.hh +++ b/base/loader/elf_object.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/loader/object_file.cc b/base/loader/object_file.cc index 25e9b2d19..2eeace36d 100644 --- a/base/loader/object_file.cc +++ b/base/loader/object_file.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/loader/object_file.hh b/base/loader/object_file.hh index a29bdc153..740cd1b40 100644 --- a/base/loader/object_file.hh +++ b/base/loader/object_file.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/loader/symtab.cc b/base/loader/symtab.cc index cb18d499c..f6abf7e3d 100644 --- a/base/loader/symtab.cc +++ b/base/loader/symtab.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/loader/symtab.hh b/base/loader/symtab.hh index 1502e4250..48230c7a2 100644 --- a/base/loader/symtab.hh +++ b/base/loader/symtab.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/misc.cc b/base/misc.cc index 5caf96d40..075ed2af8 100644 --- a/base/misc.cc +++ b/base/misc.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/misc.hh b/base/misc.hh index 45e6db35c..a4f9a99c5 100644 --- a/base/misc.hh +++ b/base/misc.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/mod_num.hh b/base/mod_num.hh index 3b4ef9bb8..831be6b03 100644 --- a/base/mod_num.hh +++ b/base/mod_num.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/pollevent.cc b/base/pollevent.cc index 60a20bd2e..127bf57f5 100644 --- a/base/pollevent.cc +++ b/base/pollevent.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/pollevent.hh b/base/pollevent.hh index 7ea5b83f4..3c9404c08 100644 --- a/base/pollevent.hh +++ b/base/pollevent.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/predictor.hh b/base/predictor.hh index 3b7bd686e..7492273ca 100644 --- a/base/predictor.hh +++ b/base/predictor.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/range.cc b/base/range.cc index 0a4876e89..4453ecc9f 100644 --- a/base/range.cc +++ b/base/range.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/range.hh b/base/range.hh index 2c4a43f48..2197e2f86 100644 --- a/base/range.hh +++ b/base/range.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/refcnt.hh b/base/refcnt.hh index f3e0e4114..d308dd0cf 100644 --- a/base/refcnt.hh +++ b/base/refcnt.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/remote_gdb.cc b/base/remote_gdb.cc index 7b73d60e9..41f11005d 100644 --- a/base/remote_gdb.cc +++ b/base/remote_gdb.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -344,6 +344,13 @@ RemoteGDB::acc(Addr va, size_t len) } } + /** + * This code says that all accesses to palcode (instruction and data) + * are valid since there isn't a va->pa mapping because palcode is + * accessed physically. At some point this should probably be cleaned up + * but there is no easy way to do it. + */ + if (PC_PAL(va) || va < 0x10000) return true; diff --git a/base/remote_gdb.hh b/base/remote_gdb.hh index fcc1ee2a9..2ed368719 100644 --- a/base/remote_gdb.hh +++ b/base/remote_gdb.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/res_list.hh b/base/res_list.hh index 04c3b7cfa..7080a3ba7 100644 --- a/base/res_list.hh +++ b/base/res_list.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/sat_counter.cc b/base/sat_counter.cc index a8367d8a0..32b5a9f3e 100644 --- a/base/sat_counter.cc +++ b/base/sat_counter.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,7 +69,7 @@ SaturatingCounterPred::SaturatingCounterPred(string p_name, void SaturatingCounterPred::regStats() { - using namespace Statistics; + using namespace Stats; stringstream name, description; // @@ -138,7 +138,7 @@ void SaturatingCounterPred::regStats() void SaturatingCounterPred::regFormulas() { - using namespace Statistics; + using namespace Stats; stringstream name, description; // diff --git a/base/sat_counter.hh b/base/sat_counter.hh index a5d9c7e8a..b5054bed7 100644 --- a/base/sat_counter.hh +++ b/base/sat_counter.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,24 +61,24 @@ class SaturatingCounterPred : public GenericPredictor unsigned *table; // Statistics - Statistics::Scalar<> predicted_one; // Total predictions of one, preds_one - Statistics::Scalar<> predicted_zero; // Total predictions of zero, preds_zero - Statistics::Scalar<> correct_pred_one; // Total correct predictions of one, correct_one - Statistics::Scalar<> correct_pred_zero; // Total correct predictions of zero, correct_zero - - Statistics::Scalar<> record_zero; //updates_zero - Statistics::Scalar<> record_one; //updates_one - - Statistics::Formula preds_total; - Statistics::Formula pred_frac_zero; - Statistics::Formula pred_frac_one; - Statistics::Formula correct_total; - Statistics::Formula updates_total; - Statistics::Formula pred_rate; - Statistics::Formula frac_correct_zero; - Statistics::Formula frac_correct_one; - Statistics::Formula coverage_zero; - Statistics::Formula coverage_one; + Stats::Scalar<> predicted_one; // Total predictions of one, preds_one + Stats::Scalar<> predicted_zero; // Total predictions of zero, preds_zero + Stats::Scalar<> correct_pred_one; // Total correct predictions of one, correct_one + Stats::Scalar<> correct_pred_zero; // Total correct predictions of zero, correct_zero + + Stats::Scalar<> record_zero; //updates_zero + Stats::Scalar<> record_one; //updates_one + + Stats::Formula preds_total; + Stats::Formula pred_frac_zero; + Stats::Formula pred_frac_one; + Stats::Formula correct_total; + Stats::Formula updates_total; + Stats::Formula pred_rate; + Stats::Formula frac_correct_zero; + Stats::Formula frac_correct_one; + Stats::Formula coverage_zero; + Stats::Formula coverage_one; private: bool pred_one(unsigned &counter) { return counter > thresh; } diff --git a/base/sched_list.hh b/base/sched_list.hh index 0f922d63c..86e342ae1 100644 --- a/base/sched_list.hh +++ b/base/sched_list.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/socket.cc b/base/socket.cc index 63b693d94..aa6a183a9 100644 --- a/base/socket.cc +++ b/base/socket.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/socket.hh b/base/socket.hh index 39bacba94..361658720 100644 --- a/base/socket.hh +++ b/base/socket.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2002-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/statistics.cc b/base/statistics.cc index 1a44cd342..78012bff7 100644 --- a/base/statistics.cc +++ b/base/statistics.cc @@ -46,7 +46,7 @@ using namespace std; -namespace Statistics { +namespace Stats { StatData * DataAccess::find() const @@ -346,4 +346,4 @@ registerResetCallback(Callback *cb) resetQueue.add(cb); } -/* namespace Statistics */ } +/* namespace Stats */ } diff --git a/base/statistics.hh b/base/statistics.hh index ee09cc622..bd1698ae7 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -70,7 +70,7 @@ class Callback; extern Tick curTick; /* A namespace for all of the Statistics */ -namespace Statistics { +namespace Stats { /* Contains the statistic implementation details */ ////////////////////////////////////////////////////////////////////// @@ -2897,6 +2897,6 @@ sum(Temp val) return NodePtr(new SumNode<std::plus<Result> >(val)); } -/* namespace Statistics */ } +/* namespace Stats */ } #endif // __BASE_STATISTICS_HH__ diff --git a/base/stats/events.cc b/base/stats/events.cc new file mode 100644 index 000000000..b579981e9 --- /dev/null +++ b/base/stats/events.cc @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2004 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef USE_MYSQL +#include "base/cprintf.hh" +#include "base/misc.hh" +#include "base/mysql.hh" +#include "base/stats/events.hh" +#include "base/stats/mysql.hh" +#include "base/stats/mysql_run.hh" +#include "base/str.hh" +#endif + +#include "sim/host.hh" +#include "sim/universe.hh" + +using namespace std; + +namespace Stats { + +Tick EventStart = ULL(0xffffffffffffffff); + +#ifdef USE_MYSQL +typedef map<string, uint32_t> event_map_t; +event_map_t event_map; + +void +__event(const string &stat) +{ + MySQL::Connection &mysql = MySqlDB.conn(); + uint16_t run = MySqlDB.run(); + assert(mysql.connected()); + + event_map_t::iterator i = event_map.find(stat); + uint32_t event; + if (i == event_map.end()) { + mysql.query( + csprintf("SELECT en_id " + "from event_names " + "where en_name=\"%s\"", + stat)); + + MySQL::Result result = mysql.store_result(); + if (!result) + panic("could not get a run\n%s\n", mysql.error); + + assert(result.num_fields() == 1); + MySQL::Row row = result.fetch_row(); + if (row) { + if (!to_number(row[0], event)) + panic("invalid event id: %s\n", row[0]); + } else { + mysql.query( + csprintf("INSERT INTO " + "event_names(en_name)" + "values(\"%s\")", + stat)); + + if (mysql.error) + panic("could not get a run\n%s\n", mysql.error); + + event = mysql.insert_id(); + } + } else { + event = (*i).second; + } + + mysql.query( + csprintf("INSERT INTO " + "events(ev_event, ev_run, ev_tick)" + "values(%d, %d, %d)", + event, run, curTick)); + + if (mysql.error) + panic("could not get a run\n%s\n", mysql.error); + +} +#endif + +/* namespace Stats */ } diff --git a/base/stats/events.hh b/base/stats/events.hh new file mode 100644 index 000000000..49c060645 --- /dev/null +++ b/base/stats/events.hh @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2004 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __BASE_STATS_EVENTS_HH__ +#define __BASE_STATS_EVENTS_HH__ + +#include <string> + +#include "base/trace.hh" + +namespace Stats { + +extern Tick EventStart; + +#ifdef USE_MYSQL +void __event(const std::string &stat); +bool MySqlConnected(); +#endif + +inline void +recordEvent(const std::string &stat) +{ + if (EventStart > curTick) + return; + + DPRINTF(StatEvents, "Statistics Event: %s\n", stat); + +#ifdef USE_MYSQL + if (!MySqlConnected()) + return; + + __event(stat); +#endif +} + +/* namespace Stats */ } + +#endif // __BASE_STATS_EVENTS_HH__ diff --git a/base/stats/flags.hh b/base/stats/flags.hh index 2303de172..b86f87d25 100644 --- a/base/stats/flags.hh +++ b/base/stats/flags.hh @@ -28,7 +28,7 @@ #ifndef __BASE_STATS_FLAGS_HH__ #define __BASE_STATS_FLAGS_HH__ -namespace Statistics { +namespace Stats { /** * Define the storage for format flags. @@ -68,6 +68,6 @@ enum DisplayMode extern DisplayMode DefaultMode; -/* namespace Statistics */ } +/* namespace Stats */ } #endif // __BASE_STATS_FLAGS_HH__ diff --git a/base/stats/mysql.cc b/base/stats/mysql.cc index 676bc555c..42f68811b 100644 --- a/base/stats/mysql.cc +++ b/base/stats/mysql.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ #include "base/statistics.hh" #include "base/stats/flags.hh" #include "base/stats/mysql.hh" +#include "base/stats/mysql_run.hh" #include "base/stats/statdb.hh" #include "base/stats/types.hh" #include "base/str.hh" @@ -44,19 +45,35 @@ using namespace std; -namespace Statistics { +namespace Stats { -struct MySqlData +MySqlRun MySqlDB; + +bool +MySqlConnected() { - map<int, int> idmap; - MySQL::Connection conn; -}; + return MySqlDB.connected(); +} + +void +MySqlRun::connect(const string &host, const string &user, const string &passwd, + const string &db, const string &name, const string &project) +{ + if (connected()) + panic("can only get one database connection at this time!"); -int -SetupRun(MySqlData *data, const string &name, const string &user, - const string &project) + mysql.connect(host, user, passwd, db); + if (mysql.error) + panic("could not connect to database server\n%s\n", mysql.error); + + remove(name); + cleanup(); + setup(name, user, project); +} + +void +MySqlRun::setup(const string &name, const string &user, const string &project) { - MySQL::Connection &mysql = data->conn; assert(mysql.connected()); stringstream insert; @@ -71,13 +88,12 @@ SetupRun(MySqlData *data, const string &name, const string &user, if (mysql.error) panic("could not get a run\n%s\n", mysql.error); - return mysql.insert_id(); + run_id = mysql.insert_id(); } void -DeleteRun(MySqlData *data, const string &name) +MySqlRun::remove(const string &name) { - MySQL::Connection &mysql = data->conn; assert(mysql.connected()); stringstream sql; ccprintf(sql, "DELETE FROM runs WHERE rn_name=\"%s\"", name); @@ -85,9 +101,8 @@ DeleteRun(MySqlData *data, const string &name) } void -Cleanup(MySqlData *data) +MySqlRun::cleanup() { - MySQL::Connection &mysql = data->conn; assert(mysql.connected()); mysql.query("DELETE data " @@ -119,6 +134,16 @@ Cleanup(MySqlData *data) "FROM bins " "LEFT JOIN data ON bn_id=dt_bin " "WHERE dt_bin IS NULL"); + + mysql.query("DELETE events" + "FROM events" + "LEFT JOIN runs ON ev_run=rn_id" + "WHERE rn_id IS NULL"); + + mysql.query("DELETE event_names" + "FROM event_names" + "LEFT JOIN events ON en_id=ev_event" + "WHERE ev_event IS NULL"); } void @@ -142,9 +167,9 @@ SetupStat::init() } unsigned -SetupStat::operator()(MySqlData *data) +SetupStat::setup() { - MySQL::Connection &mysql = data->conn; + MySQL::Connection &mysql = MySqlDB.conn(); stringstream insert; ccprintf(insert, @@ -245,9 +270,9 @@ SetupStat::operator()(MySqlData *data) } unsigned -SetupBin(MySqlData *data, const string &bin) +SetupBin(const string &bin) { - MySQL::Connection &mysql = data->conn; + MySQL::Connection &mysql = MySqlDB.conn(); assert(mysql.connected()); using namespace MySQL; @@ -292,8 +317,9 @@ void InsertData::flush() { if (size) { - assert(mysql && mysql->connected()); - mysql->query(query); + MySQL::Connection &mysql = MySqlDB.conn(); + assert(mysql.connected()); + mysql.query(query); } query[0] = '\0'; @@ -319,7 +345,8 @@ InsertData::insert() first = false; size += sprintf(query + size, "(%u,%d,%d,%u,%llu,%u,\"%f\")", - stat, x, y, run, (unsigned long long)sample, bin, data); + stat, x, y, MySqlDB.run(), (unsigned long long)sample, + bin, data); } struct InsertSubData @@ -330,13 +357,13 @@ struct InsertSubData string name; string descr; - void operator()(MySqlData *data); + void setup(); }; void -InsertSubData::operator()(MySqlData *data) +InsertSubData::setup() { - MySQL::Connection &mysql = data->conn; + MySQL::Connection &mysql = MySqlDB.conn(); assert(mysql.connected()); stringstream insert; ccprintf(insert, @@ -348,10 +375,9 @@ InsertSubData::operator()(MySqlData *data) } void -InsertFormula(MySqlData *data, uint16_t stat, uint16_t run, - const string &formula) +InsertFormula(uint16_t stat, const string &formula) { - MySQL::Connection &mysql = data->conn; + MySQL::Connection &mysql = MySqlDB.conn(); assert(mysql.connected()); stringstream insert_formula; ccprintf(insert_formula, @@ -363,15 +389,15 @@ InsertFormula(MySqlData *data, uint16_t stat, uint16_t run, stringstream insert_ref; ccprintf(insert_ref, "INSERT INTO formula_ref(fr_stat,fr_run) values(%d, %d)", - stat, run); + stat, MySqlDB.run()); mysql.query(insert_ref); } void -UpdatePrereq(MySqlData *data, uint16_t stat, uint16_t prereq) +UpdatePrereq(uint16_t stat, uint16_t prereq) { - MySQL::Connection &mysql = data->conn; + MySQL::Connection &mysql = MySqlDB.conn(); assert(mysql.connected()); stringstream update; ccprintf(update, "UPDATE stats SET st_prereq=%d WHERE st_id=%d", @@ -379,98 +405,6 @@ UpdatePrereq(MySqlData *data, uint16_t stat, uint16_t prereq) mysql.query(update); } -#if 0 -class InsertData -{ - private: - MySQL::Connection &mysql; - MySQL::Statement stmt; - - public: - InsertData(MySqlData *data) - : mysql(data->conn) - { - stmt.prepare("INSERT INTO " - "data(dt_stat,dt_x,dt_y,dt_run,dt_sample,dt_bin,dt_data) " - "values(?,?,?,?,?,?,?)"); - assert(stmt.count() == 7 && "param count invalid"); - - stmt[0].buffer = stat; - stmt[1].buffer = x; - stmt[2].buffer = y; - stmt[3].buffer = run; - stmt[4].buffer = sample; - stmt[5].buffer = bin; - stmt[6].buffer = data; - - stmt.bind(bind); - if (stmt.error) - panic("bind param failed\n%s\n", stmt.error); - } - - public: - uint64_t sample; - uint64_t data; - uint16_t stat; - uint16_t bin; - int16_t x; - int16_t y; - - void operator()(MySQL::Connection &mysql) - { - assert(mysql.connected()) - stmt(); - } -}; -#endif - - -MySql::MySql() - : mysql(NULL), configured(false) -{ -} - -MySql::~MySql() -{ - if (mysql) - delete mysql; -} - -void -MySql::insert(int sim_id, int db_id) -{ - mysql->idmap.insert(make_pair(sim_id, db_id)); -} - -int -MySql::find(int sim_id) -{ - map<int,int>::const_iterator i = mysql->idmap.find(sim_id); - assert(i != mysql->idmap.end()); - return (*i).second; -} - -bool -MySql::valid() const -{ - return mysql && mysql->conn.connected(); -} - -void -MySql::connect(const string &host, const string &user, const string &passwd, - const string &db, const string &name, const string &project) -{ - mysql = new MySqlData; - newdata.mysql = &mysql->conn; - mysql->conn.connect(host, user, passwd, db); - if (mysql->conn.error) - panic("could not connect to database server\n%s\n", mysql->conn.error); - - DeleteRun(mysql, name); - Cleanup(mysql); - run_id = SetupRun(mysql, name, user, project); -} - void MySql::configure() { @@ -489,7 +423,7 @@ MySql::configure() uint16_t prereq_id = find(data->prereq->id); assert(stat_id && prereq_id); - UpdatePrereq(mysql, stat_id, prereq_id); + UpdatePrereq(stat_id, prereq_id); } } @@ -517,14 +451,14 @@ void MySql::configure(const ScalarData &data) { configure(data, "SCALAR"); - insert(data.id, stat(mysql)); + insert(data.id, stat.setup()); } void MySql::configure(const VectorData &data) { configure(data, "VECTOR"); - uint16_t statid = stat(mysql); + uint16_t statid = stat.setup(); if (!data.subnames.empty()) { InsertSubData subdata; @@ -536,7 +470,7 @@ MySql::configure(const VectorData &data) subdata.descr = data.subdescs.empty() ? "" : data.subdescs[i]; if (!subdata.name.empty() || !subdata.descr.empty()) - subdata(mysql); + subdata.setup(); } } @@ -553,7 +487,7 @@ MySql::configure(const DistData &data) stat.max = data.data.max; stat.bktsize = data.data.bucket_size; } - insert(data.id, stat(mysql)); + insert(data.id, stat.setup()); } void @@ -568,7 +502,7 @@ MySql::configure(const VectorDistData &data) stat.bktsize = data.data[0].bucket_size; } - uint16_t statid = stat(mysql); + uint16_t statid = stat.setup(); if (!data.subnames.empty()) { InsertSubData subdata; @@ -579,7 +513,7 @@ MySql::configure(const VectorDistData &data) subdata.name = data.subnames[i]; subdata.descr = data.subdescs.empty() ? "" : data.subdescs[i]; if (!subdata.name.empty() || !subdata.descr.empty()) - subdata(mysql); + subdata.setup(); } } @@ -590,7 +524,7 @@ void MySql::configure(const Vector2dData &data) { configure(data, "VECTOR2D"); - uint16_t statid = stat(mysql); + uint16_t statid = stat.setup(); if (!data.subnames.empty()) { InsertSubData subdata; @@ -601,7 +535,7 @@ MySql::configure(const Vector2dData &data) subdata.name = data.subnames[i]; subdata.descr = data.subdescs.empty() ? "" : data.subdescs[i]; if (!subdata.name.empty() || !subdata.descr.empty()) - subdata(mysql); + subdata.setup(); } } @@ -614,7 +548,7 @@ MySql::configure(const Vector2dData &data) subdata.y = i; subdata.name = data.y_subnames[i]; if (!subdata.name.empty()) - subdata(mysql); + subdata.setup(); } } @@ -625,20 +559,26 @@ void MySql::configure(const FormulaData &data) { configure(data, "FORMULA"); - insert(data.id, stat(mysql)); + insert(data.id, stat.setup()); } void MySql::output(const string &bin) { // set up new bin in database if there is a bin name - newdata.bin = bin.empty() ? 0 : SetupBin(mysql, bin); + newdata.bin = bin.empty() ? 0 : SetupBin(bin); Database::stat_list_t::const_iterator i, end = Database::stats().end(); for (i = Database::stats().begin(); i != end; ++i) (*i)->visit(*this); } +bool +MySql::valid() const +{ + return MySqlDB.connected(); +} + void MySql::output() { @@ -649,7 +589,6 @@ MySql::output() configure(); // store sample # - newdata.run = run_id; newdata.sample = curTick; if (bins().empty()) { @@ -781,7 +720,7 @@ MySql::output(const Vector2dData &data) void MySql::output(const FormulaData &data) { - InsertFormula(mysql, find(data.id), run_id, data.str()); + InsertFormula(find(data.id), data.str()); } /* @@ -841,4 +780,4 @@ MySql::visit(const FormulaData &data) output(data); } -/* namespace Statistics */ } +/* namespace Stats */ } diff --git a/base/stats/mysql.hh b/base/stats/mysql.hh index 4ff474752..5780009d7 100644 --- a/base/stats/mysql.hh +++ b/base/stats/mysql.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,15 +29,18 @@ #ifndef __BASE_STATS_MYSQL_HH__ #define __BASE_STATS_MYSQL_HH__ +#include <map> #include <string> #include "base/stats/output.hh" namespace MySQL { class Connection; } -namespace Statistics { +namespace Stats { class DistDataData; -class MySqlData; +class MySqlRun; +bool MySqlConnected(); +extern MySqlRun MySqlDB; struct SetupStat { @@ -58,7 +61,7 @@ struct SetupStat uint16_t size; void init(); - unsigned operator()(MySqlData *data); + unsigned setup(); }; class InsertData @@ -70,14 +73,13 @@ class InsertData static const int maxsize = 1024*1024; public: - MySQL::Connection *mysql; + MySqlRun *run; public: uint64_t sample; double data; uint16_t stat; uint16_t bin; - uint16_t run; int16_t x; int16_t y; @@ -92,25 +94,28 @@ class InsertData class MySql : public Output { protected: - std::list<FormulaData *> formulas; - MySqlData *mysql; - bool configured; - uint16_t run_id; - SetupStat stat; InsertData newdata; + std::list<FormulaData *> formulas; + bool configured; - void insert(int sim_id, int db_id); - int find(int sim_id); - + protected: + std::map<int, int> idmap; + + void insert(int sim_id, int db_id) + { + using namespace std; + idmap.insert(make_pair(sim_id, db_id)); + } + + int find(int sim_id) + { + using namespace std; + map<int,int>::const_iterator i = idmap.find(sim_id); + assert(i != idmap.end()); + return (*i).second; + } public: - MySql(); - ~MySql(); - - void connect(const std::string &host, const std::string &user, - const std::string &passwd, const std::string &db, - const std::string &name, const std::string &project); - // Implement Visit virtual void visit(const ScalarData &data); virtual void visit(const VectorData &data); @@ -144,6 +149,6 @@ class MySql : public Output void configure(const FormulaData &data); }; -/* namespace Statistics */ } +/* namespace Stats */ } #endif // __BASE_STATS_MYSQL_HH__ diff --git a/base/stats/mysql_run.hh b/base/stats/mysql_run.hh new file mode 100644 index 000000000..0f8d84297 --- /dev/null +++ b/base/stats/mysql_run.hh @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2004 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __BASE_STATS_MYSQL_RUN_HH__ +#define __BASE_STATS_MYSQL_RUN_HH__ + +#include <string> + +#include "base/mysql.hh" +#include "sim/host.hh" + +namespace Stats { + +struct MySqlRun +{ + private: + MySQL::Connection mysql; + uint16_t run_id; + + public: + bool connected() const { return mysql.connected(); } + void connect(const std::string &host, const std::string &user, + const std::string &passwd, const std::string &db, + const std::string &name, const std::string &project); + + void setup(const std::string &name, const std::string &user, + const std::string &project); + + void remove(const std::string &name); + void cleanup(); + + MySQL::Connection &conn() { return mysql; } + uint16_t run() const { return run_id; } +}; + +/* namespace Stats */ } + +#endif // __BASE_STATS_MYSQL_RUN_HH__ diff --git a/base/stats/output.hh b/base/stats/output.hh index 9f1fbf415..a575fdf2e 100644 --- a/base/stats/output.hh +++ b/base/stats/output.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ #include "base/stats/visit.hh" -namespace Statistics { +namespace Stats { struct Output : public Visit { @@ -42,6 +42,6 @@ struct Output : public Visit virtual bool valid() const = 0; }; -/* namespace Statistics */ } +/* namespace Stats */ } #endif // __BASE_STATS_OUTPUT_HH__ diff --git a/base/stats/statdb.cc b/base/stats/statdb.cc index f54272a50..eed3d6296 100644 --- a/base/stats/statdb.cc +++ b/base/stats/statdb.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,7 +34,7 @@ using namespace std; -namespace Statistics { +namespace Stats { namespace Database { StatData * @@ -86,4 +86,4 @@ TheDatabase &db() } /* namespace Database */ } -/* namespace Statistics */ } +/* namespace Stats */ } diff --git a/base/stats/statdb.hh b/base/stats/statdb.hh index fb672e1dc..bd7fabf32 100644 --- a/base/stats/statdb.hh +++ b/base/stats/statdb.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ class Python; -namespace Statistics { +namespace Stats { class MainBin; class StatData; @@ -69,6 +69,6 @@ void regPrint(void *stat); inline std::string name() { return "Statistics Database"; } /* namespace Database */ } -/* namespace Statistics */ } +/* namespace Stats */ } #endif // __BASE_STATS_STATDB_HH__ diff --git a/base/stats/text.cc b/base/stats/text.cc index ddd428646..f7e82a30f 100644 --- a/base/stats/text.cc +++ b/base/stats/text.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,7 +64,7 @@ __nan() } #endif -namespace Statistics { +namespace Stats { Text::Text() : mystream(false), stream(NULL), compat(false), descriptions(false) @@ -286,14 +286,14 @@ VectorPrint::operator()(std::ostream &stream) const print(stream); } - if (flags & ::Statistics::total) { + if (flags & ::Stats::total) { print.name = base + "total"; print.desc = desc; print.value = total; print(stream); } } else { - if (flags & ::Statistics::total) { + if (flags & ::Stats::total) { print.value = total; print(stream); } @@ -644,7 +644,7 @@ Text::visit(const Vector2dData &data) print(*stream); } - if ((data.flags & ::Statistics::total) && (data.x > 1)) { + if ((data.flags & ::Stats::total) && (data.x > 1)) { print.name = data.name; print.desc = data.desc; print.vec = tot_vec; @@ -732,4 +732,4 @@ Text::visit(const FormulaData &data) visit((const VectorData &)data); } -/* namespace Statistics */ } +/* namespace Stats */ } diff --git a/base/stats/text.hh b/base/stats/text.hh index 89bddf0cb..9dd036f86 100644 --- a/base/stats/text.hh +++ b/base/stats/text.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,7 +34,7 @@ #include "base/stats/output.hh" -namespace Statistics { +namespace Stats { class Text : public Output { @@ -72,6 +72,6 @@ class Text : public Output virtual void output(); }; -/* namespace Statistics */ } +/* namespace Stats */ } #endif // __BASE_STATS_TEXT_HH__ diff --git a/base/stats/types.hh b/base/stats/types.hh index 4451c4e6e..fbabfb118 100644 --- a/base/stats/types.hh +++ b/base/stats/types.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ #include <vector> #include <inttypes.h> -namespace Statistics { +namespace Stats { /** All counters are of 64-bit values. */ typedef double Counter; @@ -44,6 +44,6 @@ typedef double Result; /** vector of results. */ typedef std::vector<Result> VResult; -/* namespace Statistics */ } +/* namespace Stats */ } #endif // __BASE_STATS_TYPES_HH__ diff --git a/base/stats/visit.cc b/base/stats/visit.cc index fec11b262..a270d94f4 100644 --- a/base/stats/visit.cc +++ b/base/stats/visit.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ #include "base/stats/visit.hh" -namespace Statistics { +namespace Stats { namespace Detail { Visit::Visit() @@ -38,4 +38,4 @@ Visit::~Visit() {} /* namespace Detail */ } -/* namespace Statistics */ } +/* namespace Stats */ } diff --git a/base/stats/visit.hh b/base/stats/visit.hh index a03842c52..0b6cc5f22 100644 --- a/base/stats/visit.hh +++ b/base/stats/visit.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,7 +34,7 @@ #include "base/time.hh" #include "sim/host.hh" -namespace Statistics { +namespace Stats { class StatData; class ScalarData; @@ -58,6 +58,6 @@ struct Visit virtual void visit(const FormulaData &data) = 0; }; -/* namespace Statistics */ } +/* namespace Stats */ } #endif // __BASE_STATS_VISIT_HH__ diff --git a/base/str.cc b/base/str.cc index 5ba23b55f..dd8d80043 100644 --- a/base/str.cc +++ b/base/str.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/str.hh b/base/str.hh index 8fee21a10..812f4d41a 100644 --- a/base/str.hh +++ b/base/str.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/time.cc b/base/time.cc index 9a484a883..e33aac406 100644 --- a/base/time.cc +++ b/base/time.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/time.hh b/base/time.hh index 1f8c7e747..bee8781a9 100644 --- a/base/time.hh +++ b/base/time.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/trace.cc b/base/trace.cc index e56bdb11b..aa82ee403 100644 --- a/base/trace.cc +++ b/base/trace.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/trace.hh b/base/trace.hh index 948bff548..60ea015ea 100644 --- a/base/trace.hh +++ b/base/trace.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/base/traceflags.py b/base/traceflags.py index a378ae722..3d7623965 100644 --- a/base/traceflags.py +++ b/base/traceflags.py @@ -101,6 +101,7 @@ baseFlags = [ 'Chains', 'Dispatch', 'Stats', + 'StatEvents', 'Context', 'Config', 'Sampler', |