gem5  v22.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 #include "base/stats/text.hh"
46 
47 #include <cassert>
48 #include <cmath>
49 #include <fstream>
50 #include <iostream>
51 #include <limits>
52 #include <sstream>
53 #include <string>
54 
55 #include "base/cast.hh"
56 #include "base/logging.hh"
57 #include "base/stats/info.hh"
58 #include "base/str.hh"
59 
60 namespace gem5
61 {
62 
63 namespace
64 {
65 
66 constexpr auto Nan = std::numeric_limits<float>::quiet_NaN();
67 
68 } // anonymous namespace
69 
70 GEM5_DEPRECATED_NAMESPACE(Stats, statistics);
71 namespace statistics
72 {
73 
75 
77  : mystream(false), stream(NULL), descriptions(false), spaces(false)
78 {
79 }
80 
81 Text::Text(std::ostream &stream) : Text()
82 {
83  open(stream);
84 }
85 
86 Text::Text(const std::string &file) : Text()
87 {
88  open(file);
89 }
90 
91 
93 {
94  if (mystream) {
95  assert(stream);
96  delete stream;
97  }
98 }
99 
100 void
101 Text::open(std::ostream &_stream)
102 {
103  if (stream)
104  panic("stream already set!");
105 
106  mystream = false;
107  stream = &_stream;
108  if (!valid())
109  fatal("Unable to open output stream for writing\n");
110 }
111 
112 void
113 Text::open(const std::string &file)
114 {
115  if (stream)
116  panic("stream already set!");
117 
118  mystream = true;
119  stream = new std::ofstream(file.c_str(), std::ios::trunc);
120  if (!valid())
121  fatal("Unable to open statistics file for writing\n");
122 }
123 
124 bool
125 Text::valid() const
126 {
127  return stream != NULL && stream->good();
128 }
129 
130 void
132 {
133  ccprintf(*stream, "\n---------- Begin Simulation Statistics ----------\n");
134 }
135 
136 void
138 {
139  ccprintf(*stream, "\n---------- End Simulation Statistics ----------\n");
140  stream->flush();
141 }
142 
143 std::string
144 Text::statName(const std::string &name) const
145 {
146  if (path.empty())
147  return name;
148  else
149  return csprintf("%s.%s", path.top(), name);
150 }
151 
152 void
153 Text::beginGroup(const char *name)
154 {
155  if (path.empty()) {
156  path.push(name);
157  } else {
158  path.push(csprintf("%s.%s", path.top(), name));
159  }
160 }
161 
162 void
164 {
165  assert(!path.empty());
166  path.pop();
167 }
168 
169 bool
170 Text::noOutput(const Info &info)
171 {
172  if (!info.flags.isSet(display))
173  return true;
174 
175  if (info.prereq && info.prereq->zero())
176  return true;
177 
178  return false;
179 }
180 
181 std::string
182 ValueToString(Result value, int precision)
183 {
184  std::stringstream val;
185 
186  if (!std::isnan(value)) {
187  if (precision != -1)
188  val.precision(precision);
189  else if (value == rint(value))
190  val.precision(0);
191 
192  val.unsetf(std::ios::showpoint);
193  val.setf(std::ios::fixed);
194  val << value;
195  } else {
196  val << "nan";
197  }
198 
199  return val.str();
200 }
201 
202 struct BasePrint
203 {
204  std::string name;
208  std::string desc;
210  std::string unitStr;
211  bool spaces;
212 
213  BasePrint(bool _spaces=false) : spaces(_spaces) {}
214 
215  void
216  setup(std::string _name, Flags _flags, int _precision,
217  bool enable_descriptions, std::string _desc,
218  bool enable_units, std::string unit_str,
219  bool enable_spaces)
220  {
221  name = _name;
222  flags = _flags;
223  precision = _precision;
224  descriptions = enable_descriptions;
225  desc = _desc;
226  enableUnits = enable_units;
227  unitStr = unit_str;
228  spaces = enable_spaces;
229  }
230 
231  void
232  printUnits(std::ostream &stream) const
233  {
234  if (enableUnits && !unitStr.empty()) {
235  ccprintf(stream, " (%s)", unitStr);
236  }
237  }
238 };
239 
240 struct ScalarPrint : public BasePrint
241 {
249 
251  : BasePrint(spaces)
252  {
253  if (spaces) {
254  nameSpaces = 40;
255  valueSpaces = 12;
256  pdfstrSpaces = 10;
257  cdfstrSpaces = 10;
258  } else {
259  nameSpaces = 0;
260  valueSpaces = 0;
261  pdfstrSpaces = 0;
262  cdfstrSpaces = 0;
263  }
264  }
265  void update(Result val, Result total);
266  void operator()(std::ostream &stream, bool oneLine = false) const;
267 };
268 
269 void
271 {
272  value = val;
273  if (total) {
274  pdf = val / total;
275  cdf += pdf;
276  }
277 }
278 
279 void
280 ScalarPrint::operator()(std::ostream &stream, bool oneLine) const
281 {
282  if ((flags.isSet(nozero) && (!oneLine) && value == 0.0) ||
283  (flags.isSet(nonan) && std::isnan(value)))
284  return;
285 
286  std::stringstream pdfstr, cdfstr;
287 
288  if (!std::isnan(pdf))
289  ccprintf(pdfstr, "%.2f%%", pdf * 100.0);
290 
291  if (!std::isnan(cdf))
292  ccprintf(cdfstr, "%.2f%%", cdf * 100.0);
293 
294  if (oneLine) {
295  ccprintf(stream, " |");
296  } else {
297  ccprintf(stream, "%-*s ", nameSpaces, name);
298  }
299  ccprintf(stream, "%*s", valueSpaces, ValueToString(value, precision));
300  if (spaces || pdfstr.rdbuf()->in_avail())
301  ccprintf(stream, " %*s", pdfstrSpaces, pdfstr.str());
302  if (spaces || cdfstr.rdbuf()->in_avail())
303  ccprintf(stream, " %*s", cdfstrSpaces, cdfstr.str());
304  if (!oneLine) {
305  if (descriptions) {
306  if (!desc.empty())
307  ccprintf(stream, " # %s", desc);
308  }
309  printUnits(stream);
310  stream << std::endl;
311  }
312 }
313 
314 struct VectorPrint : public BasePrint
315 {
316  std::string separatorString;
323 
324  VectorPrint() = delete;
326  : BasePrint(spaces)
327  {
328  if (spaces) {
329  nameSpaces = 40;
330  } else {
331  nameSpaces = 0;
332  }
333  }
334  void operator()(std::ostream &stream) const;
335 };
336 
337 void
338 VectorPrint::operator()(std::ostream &stream) const
339 {
340  size_type _size = vec.size();
341  Result _total = 0.0;
342 
343  if (flags.isSet(pdf | cdf)) {
344  for (off_type i = 0; i < _size; ++i) {
345  _total += vec[i];
346  }
347  }
348 
349  std::string base = name + separatorString;
350 
351  ScalarPrint print(spaces);
353  unitStr, spaces);
354  print.pdf = _total ? 0.0 : Nan;
355  print.cdf = _total ? 0.0 : Nan;
356 
357  bool havesub = !subnames.empty();
358 
359  if (_size == 1) {
360  // If forceSubnames is set, get the first subname (or index in
361  // the case where there are no subnames) and append it to the
362  // base name.
363  if (forceSubnames)
364  print.name = base + (havesub ? subnames[0] : std::to_string(0));
365  print.value = vec[0];
366  print(stream);
367  return;
368  }
369 
370  if ((!flags.isSet(nozero)) || (total != 0)) {
371  if (flags.isSet(oneline)) {
372  ccprintf(stream, "%-*s", nameSpaces, name);
373  print.flags = print.flags & (~nozero);
374  }
375 
376  for (off_type i = 0; i < _size; ++i) {
377  if (havesub && (i >= subnames.size() || subnames[i].empty()))
378  continue;
379 
380  print.name = base + (havesub ? subnames[i] : std::to_string(i));
381  print.desc = subdescs.empty() ? desc : subdescs[i];
382  print.unitStr = unitStr;
383 
384  print.update(vec[i], _total);
385  print(stream, flags.isSet(oneline));
386  }
387 
388  if (flags.isSet(oneline)) {
389  if (descriptions) {
390  if (!desc.empty())
391  ccprintf(stream, " # %s", desc);
392  }
393  printUnits(stream);
394  stream << std::endl;
395  }
396  }
397 
399  print.pdf = Nan;
400  print.cdf = Nan;
401  print.name = base + "total";
402  print.desc = desc;
403  print.unitStr = unitStr;
404  print.value = total;
405  print(stream);
406  }
407 }
408 
409 struct DistPrint : public BasePrint
410 {
411  std::string separatorString;
413 
414  const DistData &data;
415 
416  DistPrint(const Text *text, const DistInfo &info);
417  DistPrint(const Text *text, const VectorDistInfo &info, int i);
418  void init(const Text *text, const Info &info);
419  void operator()(std::ostream &stream) const;
420 };
421 
422 DistPrint::DistPrint(const Text *text, const DistInfo &info)
423  : data(info.data)
424 {
425  init(text, info);
426 }
427 
428 DistPrint::DistPrint(const Text *text, const VectorDistInfo &info,
429  int i) : data(info.data[i])
430 {
431  init(text, info);
432 
433  name = text->statName(
434  info.name + "_" +
435  (info.subnames[i].empty() ? (std::to_string(i)) : info.subnames[i]));
436 
437  if (!info.subdescs[i].empty())
438  desc = info.subdescs[i];
439 
440  unitStr = info.unit->getUnitString();
441 }
442 
443 void
444 DistPrint::init(const Text *text, const Info &info)
445 {
446  setup(text->statName(info.name), info.flags, info.precision,
447  text->descriptions, info.desc, text->enableUnits,
448  info.unit->getUnitString(), text->spaces);
450  if (spaces) {
451  nameSpaces = 40;
452  } else {
453  nameSpaces = 0;
454  }
455 }
456 
457 void
458 DistPrint::operator()(std::ostream &stream) const
459 {
460  if (flags.isSet(nozero) && data.samples == 0) return;
461  std::string base = name + separatorString;
462 
463  ScalarPrint print(spaces);
464  print.precision = precision;
465  print.flags = flags;
466  print.descriptions = descriptions;
467  print.desc = desc;
468  print.enableUnits = enableUnits;
469  print.unitStr = unitStr;
470  print.pdf = Nan;
471  print.cdf = Nan;
472 
473  if (flags.isSet(oneline)) {
474  print.name = base + "bucket_size";
475  print.value = data.bucket_size;
476  print(stream);
477 
478  print.name = base + "min_bucket";
479  print.value = data.min;
480  print(stream);
481 
482  print.name = base + "max_bucket";
483  print.value = data.max;
484  print(stream);
485  }
486 
487  print.name = base + "samples";
488  print.value = data.samples;
489  print(stream);
490 
491  print.name = base + "mean";
492  print.value = data.samples ? data.sum / data.samples : Nan;
493  print(stream);
494 
495  if (data.type == Hist) {
496  print.name = base + "gmean";
497  print.value = data.samples ? exp(data.logs / data.samples) : Nan;
498  print(stream);
499  }
500 
501  Result stdev = Nan;
502  if (data.samples)
503  stdev = sqrt((data.samples * data.squares - data.sum * data.sum) /
504  (data.samples * (data.samples - 1.0)));
505  print.name = base + "stdev";
506  print.value = stdev;
507  print(stream);
508 
509  if (data.type == Deviation)
510  return;
511 
512  size_t size = data.cvec.size();
513 
514  Result total = 0.0;
515  if (data.type == Dist && data.underflow != Nan)
516  total += data.underflow;
517  for (off_type i = 0; i < size; ++i)
518  total += data.cvec[i];
519  if (data.type == Dist && data.overflow != Nan)
520  total += data.overflow;
521 
522  if (total) {
523  print.pdf = 0.0;
524  print.cdf = 0.0;
525  }
526 
527  if (data.type == Dist && data.underflow != Nan) {
528  print.name = base + "underflows";
529  print.update(data.underflow, total);
530  print(stream);
531  }
532 
533  if (flags.isSet(oneline)) {
534  ccprintf(stream, "%-*s", nameSpaces, name);
535  }
536 
537  for (off_type i = 0; i < size; ++i) {
538  std::stringstream namestr;
539  namestr << base;
540 
541  Counter low = i * data.bucket_size + data.min;
542  Counter high = std::min(low + data.bucket_size - 1.0, data.max);
543  namestr << low;
544  if (low < high)
545  namestr << "-" << high;
546 
547  print.name = namestr.str();
548  print.update(data.cvec[i], total);
549  print(stream, flags.isSet(oneline));
550  }
551 
552  if (flags.isSet(oneline)) {
553  if (descriptions) {
554  if (!desc.empty())
555  ccprintf(stream, " # %s", desc);
556  }
557  printUnits(stream);
558  stream << std::endl;
559  }
560 
561  if (data.type == Dist && data.overflow != Nan) {
562  print.name = base + "overflows";
563  print.update(data.overflow, total);
564  print(stream);
565  }
566 
567  print.pdf = Nan;
568  print.cdf = Nan;
569 
570  if (data.type == Dist && data.min_val != Nan) {
571  print.name = base + "min_value";
572  print.value = data.min_val;
573  print(stream);
574  }
575 
576  if (data.type == Dist && data.max_val != Nan) {
577  print.name = base + "max_value";
578  print.value = data.max_val;
579  print(stream);
580  }
581 
582  print.name = base + "total";
583  print.value = total;
584  print(stream);
585 }
586 
587 void
589 {
590  if (noOutput(info))
591  return;
592 
593  ScalarPrint print(spaces);
594  print.setup(statName(info.name), info.flags, info.precision, descriptions,
595  info.desc, enableUnits, info.unit->getUnitString(), spaces);
596  print.value = info.result();
597  print.pdf = Nan;
598  print.cdf = Nan;
599 
600  print(*stream);
601 }
602 
603 void
605 {
606  if (noOutput(info))
607  return;
608 
609  size_type size = info.size();
610  VectorPrint print(spaces);
611  print.setup(statName(info.name), info.flags, info.precision, descriptions,
612  info.desc, enableUnits, info.unit->getUnitString(), spaces);
613  print.separatorString = info.separatorString;
614  print.vec = info.result();
615  print.total = info.total();
616  print.forceSubnames = false;
617 
618  if (!info.subnames.empty()) {
619  for (off_type i = 0; i < size; ++i) {
620  if (!info.subnames[i].empty()) {
621  print.subnames = info.subnames;
622  print.subnames.resize(size);
623  for (off_type i = 0; i < size; ++i) {
624  if (!info.subnames[i].empty() &&
625  !info.subdescs[i].empty()) {
626  print.subdescs = info.subdescs;
627  print.subdescs.resize(size);
628  break;
629  }
630  }
631  break;
632  }
633  }
634  }
635 
636  print(*stream);
637 }
638 
639 void
641 {
642  if (noOutput(info))
643  return;
644 
645  bool havesub = false;
646  VectorPrint print(spaces);
647  if (!info.y_subnames.empty()) {
648  for (off_type i = 0; i < info.y; ++i) {
649  if (!info.y_subnames[i].empty()) {
650  print.subnames = info.y_subnames;
651  break;
652  }
653  }
654  }
655  print.flags = info.flags;
656  print.separatorString = info.separatorString;
657  print.descriptions = descriptions;
658  print.enableUnits = enableUnits;
659  print.precision = info.precision;
660  print.forceSubnames = true;
661 
662  if (!info.subnames.empty()) {
663  for (off_type i = 0; i < info.x; ++i)
664  if (!info.subnames[i].empty())
665  havesub = true;
666  }
667 
668  VResult tot_vec(info.y);
669  for (off_type i = 0; i < info.x; ++i) {
670  if (havesub && (i >= info.subnames.size() || info.subnames[i].empty()))
671  continue;
672 
673  off_type iy = i * info.y;
674  VResult yvec(info.y);
675 
676  Result total = 0.0;
677  for (off_type j = 0; j < info.y; ++j) {
678  yvec[j] = info.cvec[iy + j];
679  tot_vec[j] += yvec[j];
680  total += yvec[j];
681  }
682 
683  print.name = statName(
684  info.name + "_" +
685  (havesub ? info.subnames[i] : std::to_string(i)));
686  print.desc = info.desc;
687  print.unitStr = info.unit->getUnitString();
688  print.vec = yvec;
689  print.total = total;
690  print(*stream);
691  }
692 
693  // Create a subname for printing the total
694  std::vector<std::string> total_subname;
695  total_subname.push_back("total");
696 
697  if (info.flags.isSet(statistics::total) && (info.x > 1)) {
698  print.name = statName(info.name);
699  print.subnames = total_subname;
700  print.desc = info.desc;
701  print.unitStr = info.unit->getUnitString();
702  print.vec = VResult(1, info.total());
703  print.flags = print.flags & ~total;
704  print(*stream);
705  }
706 }
707 
708 void
709 Text::visit(const DistInfo &info)
710 {
711  if (noOutput(info))
712  return;
713 
714  DistPrint print(this, info);
715  print(*stream);
716 }
717 
718 void
720 {
721  if (noOutput(info))
722  return;
723 
724  for (off_type i = 0; i < info.size(); ++i) {
725  DistPrint print(this, info, i);
726  print(*stream);
727  }
728 }
729 
730 void
732 {
733  visit((const VectorInfo &)info);
734 }
735 
736 /*
737  This struct implements the output methods for the sparse
738  histogram stat
739 */
740 struct SparseHistPrint : public BasePrint
741 {
742  std::string separatorString;
743 
745 
746  SparseHistPrint(const Text *text, const SparseHistInfo &info);
747  void init(const Text *text, const Info &info);
748  void operator()(std::ostream &stream) const;
749 };
750 
751 /* Call initialization function */
753  : data(info.data)
754 {
755  init(text, info);
756 }
757 
758 /* Initialization function */
759 void
760 SparseHistPrint::init(const Text *text, const Info &info)
761 {
762  setup(text->statName(info.name), info.flags, info.precision,
763  text->descriptions, info.desc, text->enableUnits,
764  info.unit->getUnitString(), text->spaces);
766 }
767 
768 /* Grab data from map and write to output stream */
769 void
770 SparseHistPrint::operator()(std::ostream &stream) const
771 {
772  std::string base = name + separatorString;
773 
774  ScalarPrint print(spaces);
775  print.setup(base + "samples", flags, precision, descriptions, desc,
777  print.pdf = Nan;
778  print.cdf = Nan;
779  print.value = data.samples;
780  print(stream);
781 
782  MCounter::const_iterator it;
783  for (it = data.cmap.begin(); it != data.cmap.end(); it++) {
784  std::stringstream namestr;
785  namestr << base;
786 
787  namestr <<(*it).first;
788  print.name = namestr.str();
789  print.value = (*it).second;
790  print(stream);
791  }
792 }
793 
794 void
796 {
797  if (noOutput(info))
798  return;
799 
800  SparseHistPrint print(this, info);
801  print(*stream);
802 }
803 
804 Output *
805 initText(const std::string &filename, bool desc, bool spaces)
806 {
807  static Text text;
808  static bool connected = false;
809 
810  if (!connected) {
811  text.open(*simout.findOrCreate(filename)->stream());
812  text.descriptions = desc;
813  text.enableUnits = desc; // the units are printed if descs are
814  text.spaces = spaces;
815  connected = true;
816  }
817 
818  return &text;
819 }
820 
821 } // namespace statistics
822 } // namespace gem5
const char data[]
OutputStream * findOrCreate(const std::string &name, bool binary=false)
Definition: output.cc:262
std::ostream * stream() const
Get the output underlying output stream.
Definition: output.hh:62
Flags flags
The formatting flags.
Definition: info.hh:92
const units::Base * unit
The unit of the stat.
Definition: info.hh:88
std::string name
The name of the stat.
Definition: info.hh:84
std::string desc
The description of the stat.
Definition: info.hh:90
virtual bool zero() const =0
static std::string separatorString
The separator string used for vectors, dist, etc.
Definition: info.hh:86
int precision
The display precision.
Definition: info.hh:94
const Info * prereq
A pointer to a prerequisite Stat.
Definition: info.hh:96
virtual Result result() const =0
bool noOutput(const Info &info)
Definition: text.cc:170
std::string statName(const std::string &name) const
Definition: text.cc:144
void beginGroup(const char *name) override
Definition: text.cc:153
std::ostream * stream
Definition: text.hh:64
std::stack< std::string > path
Definition: text.hh:67
bool valid() const override
Definition: text.cc:125
void end() override
Definition: text.cc:137
void open(std::ostream &stream)
Definition: text.cc:101
void begin() override
Definition: text.cc:131
void endGroup() override
Definition: text.cc:163
void visit(const ScalarInfo &info) override
Definition: text.cc:588
std::vector< std::string > y_subnames
Definition: info.hh:232
std::vector< std::string > subnames
Names and descriptions of subfields.
Definition: info.hh:230
VCounter cvec
Local storage for the entry values, used for printing.
Definition: info.hh:238
virtual Result total() const =0
virtual size_type size() const =0
std::vector< std::string > subdescs
Definition: info.hh:215
std::vector< std::string > subnames
Names and descriptions of subfields.
Definition: info.hh:214
virtual Result total() const =0
virtual size_type size() const =0
virtual const VResult & result() const =0
std::vector< std::string > subdescs
Definition: info.hh:189
std::vector< std::string > subnames
Names and descriptions of subfields.
Definition: info.hh:188
virtual std::string getUnitString() const =0
STL list class.
Definition: stl.hh:51
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
Definition: flags.hh:83
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:178
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:190
Bitfield< 7 > i
Definition: misc_types.hh:67
Bitfield< 24 > j
Definition: misc_types.hh:57
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
Bitfield< 63 > val
Definition: misc.hh:776
unsigned int size_type
Definition: types.hh:60
std::vector< Result > VResult
vector of results.
Definition: types.hh:58
const FlagsType pdf
Print the percent of the total that this entry represents.
Definition: info.hh:62
const FlagsType nonan
Don't print if this is NAN.
Definition: info.hh:70
std::string ValueToString(Result value, int precision)
Definition: text.cc:182
const FlagsType oneline
Print all values on a single line.
Definition: info.hh:72
const FlagsType nozero
Don't print if this is zero.
Definition: info.hh:68
const FlagsType total
Print the total.
Definition: info.hh:60
double Counter
All counters are of 64-bit values.
Definition: types.hh:47
unsigned int off_type
Definition: types.hh:61
const FlagsType display
Print this stat.
Definition: info.hh:58
const FlagsType cdf
Print the cumulative percentage of total upto this entry.
Definition: info.hh:64
std::list< Info * > & statsList()
Definition: statistics.cc:62
double Result
All results are doubles.
Definition: types.hh:56
Output * initText(const std::string &filename, bool desc, bool spaces)
Definition: text.cc:805
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
high
Definition: intmath.hh:176
OutputDirectory simout
Definition: output.cc:62
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:161
void ccprintf(cp::Print &print)
Definition: cprintf.hh:130
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
const std::string to_string(sc_enc enc)
Definition: sc_fxdefs.cc:60
BasePrint(bool _spaces=false)
Definition: text.cc:213
void printUnits(std::ostream &stream) const
Definition: text.cc:232
void setup(std::string _name, Flags _flags, int _precision, bool enable_descriptions, std::string _desc, bool enable_units, std::string unit_str, bool enable_spaces)
Definition: text.cc:216
General container for distribution data.
Definition: types.hh:67
void operator()(std::ostream &stream) const
Definition: text.cc:458
std::string separatorString
Definition: text.cc:411
const DistData & data
Definition: text.cc:414
void init(const Text *text, const Info &info)
Definition: text.cc:444
DistPrint(const Text *text, const DistInfo &info)
Definition: text.cc:422
void operator()(std::ostream &stream, bool oneLine=false) const
Definition: text.cc:280
void update(Result val, Result total)
Definition: text.cc:270
ScalarPrint(bool spaces)
Definition: text.cc:250
Data structure of sparse histogram.
Definition: types.hh:86
const SparseHistData & data
Definition: text.cc:744
void init(const Text *text, const Info &info)
Definition: text.cc:760
void operator()(std::ostream &stream) const
Definition: text.cc:770
SparseHistPrint(const Text *text, const SparseHistInfo &info)
Definition: text.cc:752
void operator()(std::ostream &stream) const
Definition: text.cc:338
std::string separatorString
Definition: text.cc:316
std::vector< std::string > subdescs
Definition: text.cc:318
VectorPrint(bool spaces)
Definition: text.cc:325
std::vector< std::string > subnames
Definition: text.cc:317
const std::string & name()
Definition: trace.cc:49

Generated on Wed Dec 21 2022 10:22:29 for gem5 by doxygen 1.9.1