statistics.hh (5189:00f8fa0811ea) statistics.hh (5547:747034106af4)
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>
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>
59#include <string>
60#include <vector>
61
62#include "base/cprintf.hh"
63#include "base/intmath.hh"
64#include "base/refcnt.hh"
65#include "base/str.hh"
66#include "base/stats/flags.hh"

--- 4 unchanged lines hidden (view full) ---

71class Callback;
72
73/** The current simulated tick. */
74extern Tick curTick;
75
76/* A namespace for all of the Statistics */
77namespace Stats {
78
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
79/* Contains the statistic implementation details */
80//////////////////////////////////////////////////////////////////////
81//
82// Statistics Framework Base classes
83//
84//////////////////////////////////////////////////////////////////////
85struct StatData
86{

--- 1362 unchanged lines hidden (view full) ---

1449
1450 void update(DistDataData *data, const Params &params)
1451 {
1452 data->min = params.min;
1453 data->max = params.max;
1454 data->bucket_size = params.bucket_size;
1455 data->size = params.size;
1456
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 &params)
1454 {
1455 data->min = params.min;
1456 data->max = params.max;
1457 data->bucket_size = params.bucket_size;
1458 data->size = params.size;
1459
1457 data->min_val = (min_val == INT_MAX) ? 0 : min_val;
1458 data->max_val = (max_val == INT_MIN) ? 0 : max_val;
1460 data->min_val = (min_val == CounterLimits::max()) ? 0 : min_val;
1461 data->max_val = (max_val == CounterLimits::min()) ? 0 : max_val;
1459 data->underflow = underflow;
1460 data->overflow = overflow;
1461 data->cvec.resize(params.size);
1462 for (int i = 0; i < params.size; ++i)
1463 data->cvec[i] = cvec[i];
1464
1465 data->sum = sum;
1466 data->squares = squares;
1467 data->samples = samples;
1468 }
1469
1470 /**
1471 * Reset stat value to default
1472 */
1473 void reset()
1474 {
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 {
1475 min_val = INT_MAX;
1476 max_val = INT_MIN;
1478 min_val = CounterLimits::max();
1479 max_val = CounterLimits::min();
1477 underflow = 0;
1478 overflow = 0;
1479
1480 int size = cvec.size();
1481 for (int i = 0; i < size; ++i)
1482 cvec[i] = Counter();
1483
1484 sum = Counter();

--- 1455 unchanged lines hidden ---
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 ---