gem5  v20.1.0.0
text.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2020 Arm Limited
3  * All rights reserved.
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2004-2005 The Regents of The University of Michigan
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  */
40 
41 #if defined(__APPLE__)
42 #define _GLIBCPP_USE_C99 1
43 #endif
44 
45 #if defined(__sun)
46 #include <cmath>
47 
48 #endif
49 
50 #include <cassert>
51 
52 #ifdef __SUNPRO_CC
53 #include <cmath>
54 
55 #endif
56 #include "base/stats/text.hh"
57 
58 #include <cmath>
59 #include <fstream>
60 #include <iostream>
61 #include <sstream>
62 #include <string>
63 
64 #include "base/cast.hh"
65 #include "base/logging.hh"
66 #include "base/stats/info.hh"
67 #include "base/str.hh"
68 
69 using namespace std;
70 
71 #ifndef NAN
72 float __nan();
74 #define NAN (__nan())
75 
76 #define __M5_NAN
77 #endif
78 
79 #ifdef __M5_NAN
80 float
82 {
83  union {
84  uint32_t ui;
85  float f;
86  } nan;
87 
88  nan.ui = 0x7fc00000;
89  return nan.f;
90 }
91 #endif
92 
93 namespace Stats {
94 
96 
97 Text::Text()
98  : mystream(false), stream(NULL), descriptions(false), spaces(false)
99 {
100 }
101 
102 Text::Text(std::ostream &stream) : Text()
103 {
104  open(stream);
105 }
106 
107 Text::Text(const std::string &file) : Text()
108 {
109  open(file);
110 }
111 
112 
114 {
115  if (mystream) {
116  assert(stream);
117  delete stream;
118  }
119 }
120 
121 void
122 Text::open(std::ostream &_stream)
123 {
124  if (stream)
125  panic("stream already set!");
126 
127  mystream = false;
128  stream = &_stream;
129  if (!valid())
130  fatal("Unable to open output stream for writing\n");
131 }
132 
133 void
134 Text::open(const std::string &file)
135 {
136  if (stream)
137  panic("stream already set!");
138 
139  mystream = true;
140  stream = new ofstream(file.c_str(), ios::trunc);
141  if (!valid())
142  fatal("Unable to open statistics file for writing\n");
143 }
144 
145 bool
146 Text::valid() const
147 {
148  return stream != NULL && stream->good();
149 }
150 
151 void
153 {
154  ccprintf(*stream, "\n---------- Begin Simulation Statistics ----------\n");
155 }
156 
157 void
159 {
160  ccprintf(*stream, "\n---------- End Simulation Statistics ----------\n");
161  stream->flush();
162 }
163 
164 std::string
165 Text::statName(const std::string &name) const
166 {
167  if (path.empty())
168  return name;
169  else
170  return csprintf("%s.%s", path.top(), name);
171 }
172 
173 void
174 Text::beginGroup(const char *name)
175 {
176  if (path.empty()) {
177  path.push(name);
178  } else {
179  path.push(csprintf("%s.%s", path.top(), name));
180  }
181 }
182 
183 void
185 {
186  assert(!path.empty());
187  path.pop();
188 }
189 
190 bool
191 Text::noOutput(const Info &info)
192 {
193  if (!info.flags.isSet(display))
194  return true;
195 
196  if (info.prereq && info.prereq->zero())
197  return true;
198 
199  return false;
200 }
201 
202 string
203 ValueToString(Result value, int precision)
204 {
205  stringstream val;
206 
207  if (!std::isnan(value)) {
208  if (precision != -1)
209  val.precision(precision);
210  else if (value == rint(value))
211  val.precision(0);
212 
213  val.unsetf(ios::showpoint);
214  val.setf(ios::fixed);
215  val << value;
216  } else {
217  val << "nan";
218  }
219 
220  return val.str();
221 }
222 
224 {
226  string name;
227  string desc;
230  bool spaces;
238 
240  if (spaces) {
241  nameSpaces = 40;
242  valueSpaces = 12;
243  pdfstrSpaces = 10;
244  cdfstrSpaces = 10;
245  } else {
246  nameSpaces = 0;
247  valueSpaces = 0;
248  pdfstrSpaces = 0;
249  cdfstrSpaces = 0;
250  }
251  }
252  void update(Result val, Result total);
253  void operator()(ostream &stream, bool oneLine = false) const;
254 };
255 
256 void
258 {
259  value = val;
260  if (total) {
261  pdf = val / total;
262  cdf += pdf;
263  }
264 }
265 
266 void
267 ScalarPrint::operator()(ostream &stream, bool oneLine) const
268 {
269  if ((flags.isSet(nozero) && (!oneLine) && value == 0.0) ||
270  (flags.isSet(nonan) && std::isnan(value)))
271  return;
272 
273  stringstream pdfstr, cdfstr;
274 
275  if (!std::isnan(pdf))
276  ccprintf(pdfstr, "%.2f%%", pdf * 100.0);
277 
278  if (!std::isnan(cdf))
279  ccprintf(cdfstr, "%.2f%%", cdf * 100.0);
280 
281  if (oneLine) {
282  ccprintf(stream, " |");
283  } else {
284  ccprintf(stream, "%-*s ", nameSpaces, name);
285  }
286  ccprintf(stream, "%*s", valueSpaces, ValueToString(value, precision));
287  if (spaces || pdfstr.rdbuf()->in_avail())
288  ccprintf(stream, " %*s", pdfstrSpaces, pdfstr.str());
289  if (spaces || cdfstr.rdbuf()->in_avail())
290  ccprintf(stream, " %*s", cdfstrSpaces, cdfstr.str());
291  if (!oneLine) {
292  if (descriptions) {
293  if (!desc.empty())
294  ccprintf(stream, " # %s", desc);
295  }
296  stream << endl;
297  }
298 }
299 
301 {
302  string name;
304  string desc;
309  bool spaces;
315 
316  VectorPrint() = delete;
318  if (spaces) {
319  nameSpaces = 40;
320  } else {
321  nameSpaces = 0;
322  }
323  }
324  void operator()(ostream &stream) const;
325 };
326 
327 void
328 VectorPrint::operator()(std::ostream &stream) const
329 {
330  size_type _size = vec.size();
331  Result _total = 0.0;
332 
333  if (flags.isSet(pdf | cdf)) {
334  for (off_type i = 0; i < _size; ++i) {
335  _total += vec[i];
336  }
337  }
338 
339  string base = name + separatorString;
340 
341  ScalarPrint print(spaces);
342  print.name = name;
343  print.desc = desc;
344  print.precision = precision;
345  print.descriptions = descriptions;
346  print.flags = flags;
347  print.pdf = _total ? 0.0 : NAN;
348  print.cdf = _total ? 0.0 : NAN;
349 
350  bool havesub = !subnames.empty();
351 
352  if (_size == 1) {
353  // If forceSubnames is set, get the first subname (or index in
354  // the case where there are no subnames) and append it to the
355  // base name.
356  if (forceSubnames)
357  print.name = base + (havesub ? subnames[0] : std::to_string(0));
358  print.value = vec[0];
359  print(stream);
360  return;
361  }
362 
363  if ((!flags.isSet(nozero)) || (total != 0)) {
364  if (flags.isSet(oneline)) {
365  ccprintf(stream, "%-*s", nameSpaces, name);
366  print.flags = print.flags & (~nozero);
367  }
368 
369  for (off_type i = 0; i < _size; ++i) {
370  if (havesub && (i >= subnames.size() || subnames[i].empty()))
371  continue;
372 
373  print.name = base + (havesub ? subnames[i] : std::to_string(i));
374  print.desc = subdescs.empty() ? desc : subdescs[i];
375 
376  print.update(vec[i], _total);
377  print(stream, flags.isSet(oneline));
378  }
379 
380  if (flags.isSet(oneline)) {
381  if (descriptions) {
382  if (!desc.empty())
383  ccprintf(stream, " # %s", desc);
384  }
385  stream << endl;
386  }
387  }
388 
389  if (flags.isSet(::Stats::total)) {
390  print.pdf = NAN;
391  print.cdf = NAN;
392  print.name = base + "total";
393  print.desc = desc;
394  print.value = total;
395  print(stream);
396  }
397 }
398 
399 struct DistPrint
400 {
401  string name;
403  string desc;
406  bool spaces;
409 
410  const DistData &data;
411 
412  DistPrint(const Text *text, const DistInfo &info);
413  DistPrint(const Text *text, const VectorDistInfo &info, int i);
414  void init(const Text *text, const Info &info);
415  void operator()(ostream &stream) const;
416 };
417 
418 DistPrint::DistPrint(const Text *text, const DistInfo &info)
419  : data(info.data)
420 {
421  init(text, info);
422 }
423 
424 DistPrint::DistPrint(const Text *text, const VectorDistInfo &info,
425  int i) : data(info.data[i])
426 {
427  init(text, info);
428 
429  name = text->statName(
430  info.name + "_" +
431  (info.subnames[i].empty() ? (std::to_string(i)) : info.subnames[i]));
432 
433  if (!info.subdescs[i].empty())
434  desc = info.subdescs[i];
435 }
436 
437 void
438 DistPrint::init(const Text *text, const Info &info)
439 {
440  name = text->statName(info.name);
442  desc = info.desc;
443  flags = info.flags;
444  precision = info.precision;
445  descriptions = text->descriptions;
446  spaces = text->spaces;
447  if (spaces) {
448  nameSpaces = 40;
449  } else {
450  nameSpaces = 0;
451  }
452 }
453 
454 void
455 DistPrint::operator()(ostream &stream) const
456 {
457  if (flags.isSet(nozero) && data.samples == 0) return;
458  string base = name + separatorString;
459 
460  ScalarPrint print(spaces);
461  print.precision = precision;
462  print.flags = flags;
463  print.descriptions = descriptions;
464  print.desc = desc;
465  print.pdf = NAN;
466  print.cdf = NAN;
467 
468  if (flags.isSet(oneline)) {
469  print.name = base + "bucket_size";
470  print.value = data.bucket_size;
471  print(stream);
472 
473  print.name = base + "min_bucket";
474  print.value = data.min;
475  print(stream);
476 
477  print.name = base + "max_bucket";
478  print.value = data.max;
479  print(stream);
480  }
481 
482  print.name = base + "samples";
483  print.value = data.samples;
484  print(stream);
485 
486  print.name = base + "mean";
487  print.value = data.samples ? data.sum / data.samples : NAN;
488  print(stream);
489 
490  if (data.type == Hist) {
491  print.name = base + "gmean";
492  print.value = data.samples ? exp(data.logs / data.samples) : NAN;
493  print(stream);
494  }
495 
496  Result stdev = NAN;
497  if (data.samples)
498  stdev = sqrt((data.samples * data.squares - data.sum * data.sum) /
499  (data.samples * (data.samples - 1.0)));
500  print.name = base + "stdev";
501  print.value = stdev;
502  print(stream);
503 
504  if (data.type == Deviation)
505  return;
506 
507  size_t size = data.cvec.size();
508 
509  Result total = 0.0;
510  if (data.type == Dist && data.underflow != NAN)
511  total += data.underflow;
512  for (off_type i = 0; i < size; ++i)
513  total += data.cvec[i];
514  if (data.type == Dist && data.overflow != NAN)
515  total += data.overflow;
516 
517  if (total) {
518  print.pdf = 0.0;
519  print.cdf = 0.0;
520  }
521 
522  if (data.type == Dist && data.underflow != NAN) {
523  print.name = base + "underflows";
524  print.update(data.underflow, total);
525  print(stream);
526  }
527 
528  if (flags.isSet(oneline)) {
529  ccprintf(stream, "%-*s", nameSpaces, name);
530  }
531 
532  for (off_type i = 0; i < size; ++i) {
533  stringstream namestr;
534  namestr << base;
535 
536  Counter low = i * data.bucket_size + data.min;
537  Counter high = ::min(low + data.bucket_size - 1.0, data.max);
538  namestr << low;
539  if (low < high)
540  namestr << "-" << high;
541 
542  print.name = namestr.str();
543  print.update(data.cvec[i], total);
544  print(stream, flags.isSet(oneline));
545  }
546 
547  if (flags.isSet(oneline)) {
548  if (descriptions) {
549  if (!desc.empty())
550  ccprintf(stream, " # %s", desc);
551  }
552  stream << endl;
553  }
554 
555  if (data.type == Dist && data.overflow != NAN) {
556  print.name = base + "overflows";
557  print.update(data.overflow, total);
558  print(stream);
559  }
560 
561  print.pdf = NAN;
562  print.cdf = NAN;
563 
564  if (data.type == Dist && data.min_val != NAN) {
565  print.name = base + "min_value";
566  print.value = data.min_val;
567  print(stream);
568  }
569 
570  if (data.type == Dist && data.max_val != NAN) {
571  print.name = base + "max_value";
572  print.value = data.max_val;
573  print(stream);
574  }
575 
576  print.name = base + "total";
577  print.value = total;
578  print(stream);
579 }
580 
581 void
583 {
584  if (noOutput(info))
585  return;
586 
587  ScalarPrint print(spaces);
588  print.value = info.result();
589  print.name = statName(info.name);
590  print.desc = info.desc;
591  print.flags = info.flags;
592  print.descriptions = descriptions;
593  print.precision = info.precision;
594  print.pdf = NAN;
595  print.cdf = NAN;
596 
597  print(*stream);
598 }
599 
600 void
602 {
603  if (noOutput(info))
604  return;
605 
606  size_type size = info.size();
607  VectorPrint print(spaces);
608 
609  print.name = statName(info.name);
610  print.separatorString = info.separatorString;
611  print.desc = info.desc;
612  print.flags = info.flags;
613  print.descriptions = descriptions;
614  print.precision = info.precision;
615  print.vec = info.result();
616  print.total = info.total();
617  print.forceSubnames = false;
618 
619  if (!info.subnames.empty()) {
620  for (off_type i = 0; i < size; ++i) {
621  if (!info.subnames[i].empty()) {
622  print.subnames = info.subnames;
623  print.subnames.resize(size);
624  for (off_type i = 0; i < size; ++i) {
625  if (!info.subnames[i].empty() &&
626  !info.subdescs[i].empty()) {
627  print.subdescs = info.subdescs;
628  print.subdescs.resize(size);
629  break;
630  }
631  }
632  break;
633  }
634  }
635  }
636 
637  print(*stream);
638 }
639 
640 void
642 {
643  if (noOutput(info))
644  return;
645 
646  bool havesub = false;
647  VectorPrint print(spaces);
648 
649  if (!info.y_subnames.empty()) {
650  for (off_type i = 0; i < info.y; ++i) {
651  if (!info.y_subnames[i].empty()) {
652  print.subnames = info.y_subnames;
653  break;
654  }
655  }
656  }
657  print.flags = info.flags;
658  print.separatorString = info.separatorString;
659  print.descriptions = descriptions;
660  print.precision = info.precision;
661  print.forceSubnames = true;
662 
663  if (!info.subnames.empty()) {
664  for (off_type i = 0; i < info.x; ++i)
665  if (!info.subnames[i].empty())
666  havesub = true;
667  }
668 
669  VResult tot_vec(info.y);
670  for (off_type i = 0; i < info.x; ++i) {
671  if (havesub && (i >= info.subnames.size() || info.subnames[i].empty()))
672  continue;
673 
674  off_type iy = i * info.y;
675  VResult yvec(info.y);
676 
677  Result total = 0.0;
678  for (off_type j = 0; j < info.y; ++j) {
679  yvec[j] = info.cvec[iy + j];
680  tot_vec[j] += yvec[j];
681  total += yvec[j];
682  }
683 
684  print.name = statName(
685  info.name + "_" +
686  (havesub ? info.subnames[i] : std::to_string(i)));
687  print.desc = info.desc;
688  print.vec = yvec;
689  print.total = total;
690  print(*stream);
691  }
692 
693  // Create a subname for printing the total
694  vector<string> total_subname;
695  total_subname.push_back("total");
696 
697  if (info.flags.isSet(::Stats::total) && (info.x > 1)) {
698  print.name = statName(info.name);
699  print.subnames = total_subname;
700  print.desc = info.desc;
701  print.vec = VResult(1, info.total());
702  print.flags = print.flags & ~total;
703  print(*stream);
704  }
705 }
706 
707 void
708 Text::visit(const DistInfo &info)
709 {
710  if (noOutput(info))
711  return;
712 
713  DistPrint print(this, info);
714  print(*stream);
715 }
716 
717 void
719 {
720  if (noOutput(info))
721  return;
722 
723  for (off_type i = 0; i < info.size(); ++i) {
724  DistPrint print(this, info, i);
725  print(*stream);
726  }
727 }
728 
729 void
731 {
732  visit((const VectorInfo &)info);
733 }
734 
735 /*
736  This struct implements the output methods for the sparse
737  histogram stat
738 */
740 {
741  string name;
743  string desc;
746  bool spaces;
748 
750 
751  SparseHistPrint(const Text *text, const SparseHistInfo &info);
752  void init(const Text *text, const Info &info);
753  void operator()(ostream &stream) const;
754 };
755 
756 /* Call initialization function */
758  : data(info.data)
759 {
760  init(text, info);
761 }
762 
763 /* Initialization function */
764 void
765 SparseHistPrint::init(const Text *text, const Info &info)
766 {
767  name = text->statName(info.name);
769  desc = info.desc;
770  flags = info.flags;
771  precision = info.precision;
772  descriptions = text->descriptions;
773  spaces = text->spaces;
774 }
775 
776 /* Grab data from map and write to output stream */
777 void
778 SparseHistPrint::operator()(ostream &stream) const
779 {
780  string base = name + separatorString;
781 
782  ScalarPrint print(spaces);
783  print.precision = precision;
784  print.flags = flags;
785  print.descriptions = descriptions;
786  print.desc = desc;
787  print.pdf = NAN;
788  print.cdf = NAN;
789 
790  print.name = base + "samples";
791  print.value = data.samples;
792  print(stream);
793 
794  MCounter::const_iterator it;
795  for (it = data.cmap.begin(); it != data.cmap.end(); it++) {
796  stringstream namestr;
797  namestr << base;
798 
799  namestr <<(*it).first;
800  print.name = namestr.str();
801  print.value = (*it).second;
802  print(stream);
803  }
804 }
805 
806 void
808 {
809  if (noOutput(info))
810  return;
811 
812  SparseHistPrint print(this, info);
813  print(*stream);
814 }
815 
816 Output *
817 initText(const string &filename, bool desc, bool spaces)
818 {
819  static Text text;
820  static bool connected = false;
821 
822  if (!connected) {
823  text.open(*simout.findOrCreate(filename)->stream());
824  text.descriptions = desc;
825  text.spaces = spaces;
826  connected = true;
827  }
828 
829  return &text;
830 }
831 
832 } // namespace Stats
Stats::VectorDistInfo::subnames
std::vector< std::string > subnames
Names and descriptions of subfields.
Definition: info.hh:206
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
Stats::ScalarPrint::ScalarPrint
ScalarPrint(bool spaces)
Definition: text.cc:239
Stats::Info::zero
virtual bool zero() const =0
Stats::Deviation
@ Deviation
Definition: info.hh:173
Stats::Text::begin
void begin() override
Definition: text.cc:152
Stats::Text::spaces
bool spaces
Definition: text.hh:68
Stats::DistPrint::desc
string desc
Definition: text.cc:403
data
const char data[]
Definition: circlebuf.test.cc:42
Stats::initText
Output * initText(const string &filename, bool desc, bool spaces)
Definition: text.cc:817
Stats::VectorInfo
Definition: info.hh:156
Stats::SparseHistData
Data structure of sparse histogram.
Definition: info.hh:244
Stats::off_type
unsigned int off_type
Definition: types.hh:55
Stats::VectorPrint::name
string name
Definition: text.cc:302
Stats::SparseHistPrint::desc
string desc
Definition: text.cc:743
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
Stats::SparseHistPrint::spaces
bool spaces
Definition: text.cc:746
Stats::SparseHistPrint::SparseHistPrint
SparseHistPrint(const Text *text, const SparseHistInfo &info)
Definition: text.cc:757
Stats::ScalarPrint::valueSpaces
int valueSpaces
Definition: text.cc:235
Stats::DistData::sum
Counter sum
Definition: info.hh:187
Stats::DistData::type
DistType type
Definition: info.hh:177
Flags< FlagsType >
Stats::DistData::samples
Counter samples
Definition: info.hh:190
Stats::Text::stream
std::ostream * stream
Definition: text.hh:58
Stats::Vector2dInfo
Definition: info.hh:218
sc_dt::to_string
const std::string to_string(sc_enc enc)
Definition: sc_fxdefs.cc:91
Stats::Text::Text
Text()
Definition: text.cc:97
Stats::ScalarPrint::desc
string desc
Definition: text.cc:227
Stats::ScalarPrint::descriptions
bool descriptions
Definition: text.cc:229
Stats::ScalarPrint::operator()
void operator()(ostream &stream, bool oneLine=false) const
Definition: text.cc:267
Stats::VectorPrint::desc
string desc
Definition: text.cc:304
Stats::Text::valid
bool valid() const override
Definition: text.cc:146
Stats::VectorPrint::flags
Flags flags
Definition: text.cc:307
Stats::VectorDistInfo::subdescs
std::vector< std::string > subdescs
Definition: info.hh:207
cast.hh
Stats::Vector2dInfo::cvec
VCounter cvec
Local storage for the entry values, used for printing.
Definition: info.hh:230
X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
Stats::Vector2dInfo::subnames
std::vector< std::string > subnames
Names and descriptions of subfields.
Definition: info.hh:222
Stats::Hist
@ Hist
Definition: info.hh:173
Stats::Vector2dInfo::y_subnames
std::vector< std::string > y_subnames
Definition: info.hh:224
std::vector< string >
Stats::DistData::underflow
Counter underflow
Definition: info.hh:184
Stats::SparseHistPrint::name
string name
Definition: text.cc:741
Stats::VectorPrint::descriptions
bool descriptions
Definition: text.cc:308
Stats::display
const FlagsType display
Print this stat.
Definition: info.hh:47
Stats::DistPrint::name
string name
Definition: text.cc:401
Stats::cdf
const FlagsType cdf
Print the cumulative percentage of total upto this entry.
Definition: info.hh:53
Stats::ScalarInfo::result
virtual Result result() const =0
Stats::ScalarPrint::pdfstrSpaces
int pdfstrSpaces
Definition: text.cc:236
Stats::Dist
@ Dist
Definition: info.hh:173
Stats::VectorPrint::separatorString
string separatorString
Definition: text.cc:303
Stats::Text::open
void open(std::ostream &stream)
Definition: text.cc:122
Stats::DistPrint::init
void init(const Text *text, const Info &info)
Definition: text.cc:438
Stats::VectorPrint::total
Result total
Definition: text.cc:312
Stats::SparseHistPrint::separatorString
string separatorString
Definition: text.cc:742
str.hh
Stats::DistData::logs
Counter logs
Definition: info.hh:189
Stats::DistPrint::flags
Flags flags
Definition: text.cc:404
Stats::VectorDistInfo
Definition: info.hh:200
Stats::VectorDistInfo::size
virtual size_type size() const =0
Stats::DistData::min_val
Counter min_val
Definition: info.hh:182
OutputDirectory::findOrCreate
OutputStream * findOrCreate(const std::string &name, bool binary=false)
Definition: output.cc:261
info.hh
Stats::ScalarPrint::cdfstrSpaces
int cdfstrSpaces
Definition: text.cc:237
Stats::DistData::min
Counter min
Definition: info.hh:178
Stats::DistData::bucket_size
Counter bucket_size
Definition: info.hh:180
ArmISA::j
Bitfield< 24 > j
Definition: miscregs_types.hh:54
Stats::ScalarPrint::spaces
bool spaces
Definition: text.cc:230
Stats::ScalarPrint::value
Result value
Definition: text.cc:225
Stats::DistData
Definition: info.hh:175
Stats::DistInfo
Definition: info.hh:193
Stats::SparseHistPrint::precision
int precision
Definition: text.cc:747
Stats::Text::visit
void visit(const ScalarInfo &info) override
Definition: text.cc:582
Stats::VectorPrint::subdescs
vector< string > subdescs
Definition: text.cc:306
Stats::ScalarPrint::flags
Flags flags
Definition: text.cc:228
Stats::DistPrint::spaces
bool spaces
Definition: text.cc:406
Stats::DistPrint::DistPrint
DistPrint(const Text *text, const DistInfo &info)
Definition: text.cc:418
Stats::oneline
const FlagsType oneline
Print all values on a single line.
Definition: info.hh:61
Stats::ScalarPrint::update
void update(Result val, Result total)
Definition: text.cc:257
Stats::Info::separatorString
static std::string separatorString
The separator string used for vectors, dist, etc.
Definition: info.hh:75
OutputStream::stream
std::ostream * stream() const
Get the output underlying output stream.
Definition: output.hh:59
Stats::DistPrint::separatorString
string separatorString
Definition: text.cc:402
Stats::SparseHistPrint::operator()
void operator()(ostream &stream) const
Definition: text.cc:778
Stats::VectorInfo::total
virtual Result total() const =0
Stats::SparseHistData::cmap
MCounter cmap
Definition: info.hh:246
Stats::SparseHistPrint::data
const SparseHistData & data
Definition: text.cc:749
Stats::DistPrint
Definition: text.cc:399
Stats::Text::~Text
~Text()
Definition: text.cc:113
Stats::Vector2dInfo::total
virtual Result total() const =0
Stats::Text::endGroup
void endGroup() override
Definition: text.cc:184
Stats::VectorInfo::result
virtual const VResult & result() const =0
Stats::Text
Definition: text.hh:54
Stats::DistData::squares
Counter squares
Definition: info.hh:188
Stats::SparseHistPrint::init
void init(const Text *text, const Info &info)
Definition: text.cc:765
Stats::VectorInfo::subdescs
std::vector< std::string > subdescs
Definition: info.hh:161
Stats::Vector2dInfo::x
size_type x
Definition: info.hh:226
Stats::SparseHistInfo
Definition: info.hh:251
Stats::VectorPrint::forceSubnames
bool forceSubnames
Definition: text.cc:313
Stats::statsList
list< Info * > & statsList()
Definition: statistics.cc:67
Stats::Output
Definition: output.hh:58
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
Stats::ScalarPrint::precision
int precision
Definition: text.cc:231
Stats::SparseHistPrint
Definition: text.cc:739
Stats::VectorPrint::spaces
bool spaces
Definition: text.cc:309
Stats::VectorInfo::size
virtual size_type size() const =0
Stats::Text::mystream
bool mystream
Definition: text.hh:57
name
const std::string & name()
Definition: trace.cc:50
Stats::Text::statName
std::string statName(const std::string &name) const
Definition: text.cc:165
Stats::VectorPrint::precision
int precision
Definition: text.cc:310
Stats::nozero
const FlagsType nozero
Don't print if this is zero.
Definition: info.hh:57
Stats::Info
Definition: info.hh:69
Stats::Result
double Result
All results are doubles.
Definition: types.hh:50
Stats::ScalarPrint::pdf
Result pdf
Definition: text.cc:232
text.hh
Stats::Counter
double Counter
All counters are of 64-bit values.
Definition: types.hh:41
Stats::VectorInfo::subnames
std::vector< std::string > subnames
Names and descriptions of subfields.
Definition: info.hh:160
Stats::ValueToString
string ValueToString(Result value, int precision)
Definition: text.cc:203
Stats::VectorPrint::subnames
vector< string > subnames
Definition: text.cc:305
Stats::FormulaInfo
Definition: info.hh:237
Stats::Text::beginGroup
void beginGroup(const char *name) override
Definition: text.cc:174
std
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
Stats::ScalarPrint::name
string name
Definition: text.cc:226
Stats::Vector2dInfo::y
size_type y
Definition: info.hh:227
Stats::pdf
const FlagsType pdf
Print the percent of the total that this entry represents.
Definition: info.hh:51
Stats::Info::flags
Flags flags
The formatting flags.
Definition: info.hh:79
Stats::VResult
std::vector< Result > VResult
vector of results.
Definition: types.hh:52
Stats::Info::name
std::string name
The name of the stat.
Definition: info.hh:73
Stats::VectorPrint::VectorPrint
VectorPrint(bool spaces)
Definition: text.cc:317
Stats::Text::descriptions
bool descriptions
Definition: text.hh:67
Stats::DistData::max
Counter max
Definition: info.hh:179
Stats::SparseHistData::samples
Counter samples
Definition: info.hh:247
ccprintf
void ccprintf(cp::Print &print)
Definition: cprintf.hh:127
logging.hh
Stats::Info::prereq
const Info * prereq
A pointer to a prerequisite Stat.
Definition: info.hh:83
Stats::ScalarInfo
Definition: info.hh:148
Stats::Info::precision
int precision
The display precision.
Definition: info.hh:81
Stats::Info::desc
std::string desc
The description of the stat.
Definition: info.hh:77
Stats::DistData::overflow
Counter overflow
Definition: info.hh:185
Stats
Definition: statistics.cc:61
Stats::size_type
unsigned int size_type
Definition: types.hh:54
Stats::SparseHistPrint::descriptions
bool descriptions
Definition: text.cc:745
Stats::DistPrint::precision
int precision
Definition: text.cc:407
Flags::isSet
bool isSet() const
Definition: flags.hh:79
Stats::DistPrint::operator()
void operator()(ostream &stream) const
Definition: text.cc:455
simout
OutputDirectory simout
Definition: output.cc:61
std::list
STL list class.
Definition: stl.hh:51
NAN
#define NAN
Define Not a number.
Definition: text.cc:74
Stats::DistPrint::data
const DistData & data
Definition: text.cc:410
Stats::ScalarPrint::nameSpaces
int nameSpaces
Definition: text.cc:234
Stats::total
const FlagsType total
Print the total.
Definition: info.hh:49
Stats::ScalarPrint
Definition: text.cc:223
Stats::VectorPrint::vec
VResult vec
Definition: text.cc:311
Stats::Text::noOutput
bool noOutput(const Info &info)
Definition: text.cc:191
Stats::DistPrint::descriptions
bool descriptions
Definition: text.cc:405
Stats::DistPrint::nameSpaces
int nameSpaces
Definition: text.cc:408
Stats::DistData::max_val
Counter max_val
Definition: info.hh:183
Stats::Text::path
std::stack< std::string > path
Definition: text.hh:61
Stats::VectorPrint::nameSpaces
int nameSpaces
Definition: text.cc:314
Stats::Text::end
void end() override
Definition: text.cc:158
csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:158
Stats::VectorPrint
Definition: text.cc:300
Stats::VectorPrint::VectorPrint
VectorPrint()=delete
__nan
float __nan()
Definition: text.cc:81
Stats::SparseHistPrint::flags
Flags flags
Definition: text.cc:744
Stats::nonan
const FlagsType nonan
Don't print if this is NAN.
Definition: info.hh:59
Stats::VectorPrint::operator()
void operator()(ostream &stream) const
Definition: text.cc:328
Stats::DistData::cvec
VCounter cvec
Definition: info.hh:186
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
ArmISA::f
Bitfield< 6 > f
Definition: miscregs_types.hh:64
Stats::ScalarPrint::cdf
Result cdf
Definition: text.cc:233

Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17