Go to the documentation of this file.
41 #if defined(__APPLE__)
42 #define _GLIBCPP_USE_C99 1
98 : mystream(false), stream(NULL), descriptions(false), spaces(false)
125 panic(
"stream already set!");
130 fatal(
"Unable to open output stream for writing\n");
137 panic(
"stream already set!");
140 stream =
new ofstream(file.c_str(), ios::trunc);
142 fatal(
"Unable to open statistics file for writing\n");
154 ccprintf(*
stream,
"\n---------- Begin Simulation Statistics ----------\n");
160 ccprintf(*
stream,
"\n---------- End Simulation Statistics ----------\n");
186 assert(!
path.empty());
207 if (!std::isnan(value)) {
209 val.precision(precision);
210 else if (value == rint(value))
213 val.unsetf(ios::showpoint);
214 val.setf(ios::fixed);
253 void operator()(ostream &stream,
bool oneLine =
false)
const;
273 stringstream pdfstr, cdfstr;
275 if (!std::isnan(
pdf))
278 if (!std::isnan(
cdf))
287 if (
spaces || pdfstr.rdbuf()->in_avail())
289 if (
spaces || cdfstr.rdbuf()->in_avail())
347 print.
pdf = _total ? 0.0 :
NAN;
348 print.
cdf = _total ? 0.0 :
NAN;
533 stringstream namestr;
540 namestr <<
"-" << high;
542 print.
name = namestr.str();
646 bool havesub =
false;
679 yvec[
j] = info.
cvec[iy +
j];
680 tot_vec[
j] += yvec[
j];
695 total_subname.push_back(
"total");
794 MCounter::const_iterator it;
796 stringstream namestr;
799 namestr <<(*it).first;
800 print.
name = namestr.str();
801 print.
value = (*it).second;
817 initText(
const string &filename,
bool desc,
bool spaces)
820 static bool connected =
false;
std::vector< std::string > subnames
Names and descriptions of subfields.
#define fatal(...)
This implements a cprintf based fatal() function.
virtual bool zero() const =0
Output * initText(const string &filename, bool desc, bool spaces)
Data structure of sparse histogram.
SparseHistPrint(const Text *text, const SparseHistInfo &info)
const std::string to_string(sc_enc enc)
void operator()(ostream &stream, bool oneLine=false) const
bool valid() const override
std::vector< std::string > subdescs
VCounter cvec
Local storage for the entry values, used for printing.
std::vector< std::string > subnames
Names and descriptions of subfields.
std::vector< std::string > y_subnames
const FlagsType display
Print this stat.
const FlagsType cdf
Print the cumulative percentage of total upto this entry.
virtual Result result() const =0
void open(std::ostream &stream)
void init(const Text *text, const Info &info)
virtual size_type size() const =0
OutputStream * findOrCreate(const std::string &name, bool binary=false)
void visit(const ScalarInfo &info) override
vector< string > subdescs
DistPrint(const Text *text, const DistInfo &info)
const FlagsType oneline
Print all values on a single line.
void update(Result val, Result total)
static std::string separatorString
The separator string used for vectors, dist, etc.
std::ostream * stream() const
Get the output underlying output stream.
void operator()(ostream &stream) const
virtual Result total() const =0
const SparseHistData & data
virtual Result total() const =0
virtual const VResult & result() const =0
void init(const Text *text, const Info &info)
std::vector< std::string > subdescs
list< Info * > & statsList()
virtual size_type size() const =0
const std::string & name()
std::string statName(const std::string &name) const
const FlagsType nozero
Don't print if this is zero.
double Result
All results are doubles.
double Counter
All counters are of 64-bit values.
std::vector< std::string > subnames
Names and descriptions of subfields.
string ValueToString(Result value, int precision)
vector< string > subnames
void beginGroup(const char *name) override
Overload hash function for BasicBlockRange type.
const FlagsType pdf
Print the percent of the total that this entry represents.
Flags flags
The formatting flags.
std::vector< Result > VResult
vector of results.
std::string name
The name of the stat.
void ccprintf(cp::Print &print)
const Info * prereq
A pointer to a prerequisite Stat.
int precision
The display precision.
std::string desc
The description of the stat.
void operator()(ostream &stream) const
#define NAN
Define Not a number.
const FlagsType total
Print the total.
bool noOutput(const Info &info)
std::stack< std::string > path
std::string csprintf(const char *format, const Args &...args)
const FlagsType nonan
Don't print if this is NAN.
void operator()(ostream &stream) const
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17