1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 42 unchanged lines hidden (view full) --- 51#include <algorithm> 52#include <cassert> 53#ifdef __SUNPRO_CC 54#include <math.h> 55#endif 56#include <cmath> 57#include <functional> 58#include <iosfwd> |
59#include <limits> |
60#include <string> 61#include <vector> 62 63#include "base/cprintf.hh" 64#include "base/intmath.hh" 65#include "base/refcnt.hh" 66#include "base/str.hh" 67#include "base/stats/flags.hh" --- 4 unchanged lines hidden (view full) --- 72class Callback; 73 74/** The current simulated tick. */ 75extern Tick curTick; 76 77/* A namespace for all of the Statistics */ 78namespace Stats { 79 |
80typedef std::numeric_limits<Counter> CounterLimits; 81 |
82/* Contains the statistic implementation details */ 83////////////////////////////////////////////////////////////////////// 84// 85// Statistics Framework Base classes 86// 87////////////////////////////////////////////////////////////////////// 88struct StatData 89{ --- 1362 unchanged lines hidden (view full) --- 1452 1453 void update(DistDataData *data, const Params ¶ms) 1454 { 1455 data->min = params.min; 1456 data->max = params.max; 1457 data->bucket_size = params.bucket_size; 1458 data->size = params.size; 1459 |
1460 data->min_val = (min_val == CounterLimits::max()) ? 0 : min_val; 1461 data->max_val = (max_val == CounterLimits::min()) ? 0 : max_val; |
1462 data->underflow = underflow; 1463 data->overflow = overflow; 1464 data->cvec.resize(params.size); 1465 for (int i = 0; i < params.size; ++i) 1466 data->cvec[i] = cvec[i]; 1467 1468 data->sum = sum; 1469 data->squares = squares; 1470 data->samples = samples; 1471 } 1472 1473 /** 1474 * Reset stat value to default 1475 */ 1476 void reset() 1477 { |
1478 min_val = CounterLimits::max(); 1479 max_val = CounterLimits::min(); |
1480 underflow = 0; 1481 overflow = 0; 1482 1483 int size = cvec.size(); 1484 for (int i = 0; i < size; ++i) 1485 cvec[i] = Counter(); 1486 1487 sum = Counter(); --- 1455 unchanged lines hidden --- |