$extrastylesheet
#include <perf_log.h>
Public Member Functions | |
| PerfData () | |
| void | start () |
| void | restart () |
| double | pause () |
| double | stopit () |
Public Attributes | |
| double | tot_time |
| double | tot_time_incl_sub |
| struct timeval | tstart |
| struct timeval | tstart_incl_sub |
| unsigned int | count |
| bool | open |
| int | called_recursively |
Protected Member Functions | |
| double | stop_or_pause (const bool do_stop) |
The PerfData class simply contains the performance data that is recorded for individual events.
Definition at line 45 of file perf_log.h.
| libMesh::PerfData::PerfData | ( | ) | [inline] |
Constructor. Initializes data to be empty.
Definition at line 52 of file perf_log.h.
:
tot_time(0.),
tot_time_incl_sub(0.),
tstart(),
tstart_incl_sub(),
count(0),
open(false),
called_recursively(0)
{}
| double libMesh::PerfData::pause | ( | ) | [inline] |
Definition at line 326 of file perf_log.h.
References stop_or_pause().
{
return this->stop_or_pause(false);
}
| void libMesh::PerfData::restart | ( | ) | [inline] |
Definition at line 318 of file perf_log.h.
References tstart.
{
gettimeofday (&(this->tstart), NULL);
}
| void libMesh::PerfData::start | ( | ) | [inline] |
Definition at line 307 of file perf_log.h.
References called_recursively, count, tstart, and tstart_incl_sub.
Referenced by libMesh::PerfLog::push().
{
this->count++;
this->called_recursively++;
gettimeofday (&(this->tstart), NULL);
this->tstart_incl_sub = this->tstart;
}
| double libMesh::PerfData::stop_or_pause | ( | const bool | do_stop | ) | [inline, protected] |
Definition at line 333 of file perf_log.h.
References tot_time, tot_time_incl_sub, tstart, and tstart_incl_sub.
Referenced by pause(), and stopit().
{
// save the start times, reuse the structure we have rather than create
// a new one.
const time_t
tstart_tv_sec = this->tstart.tv_sec,
tstart_tv_usec = this->tstart.tv_usec;
gettimeofday (&(this->tstart), NULL);
const double elapsed_time = (static_cast<double>(this->tstart.tv_sec - tstart_tv_sec) +
static_cast<double>(this->tstart.tv_usec - tstart_tv_usec)*1.e-6);
this->tot_time += elapsed_time;
if(do_stop)
{
const double elapsed_time_incl_sub = (static_cast<double>(this->tstart.tv_sec - this->tstart_incl_sub.tv_sec) +
static_cast<double>(this->tstart.tv_usec - this->tstart_incl_sub.tv_usec)*1.e-6);
this->tot_time_incl_sub += elapsed_time_incl_sub;
}
return elapsed_time;
}
| double libMesh::PerfData::stopit | ( | ) | [inline] |
Definition at line 362 of file perf_log.h.
References called_recursively, and stop_or_pause().
{
// stopit is just similar to pause except that it decrements the
// recursive call counter
this->called_recursively--;
return this->stop_or_pause(true);
}
Definition at line 103 of file perf_log.h.
| unsigned int libMesh::PerfData::count |
The number of times this event has been executed
Definition at line 89 of file perf_log.h.
Referenced by libMesh::PerfLog::get_perf_info(), and start().
Flag indicating if we are currently monitoring this event. Should only be true while the event is executing.
Definition at line 96 of file perf_log.h.
| double libMesh::PerfData::tot_time |
Total time spent in this event.
Definition at line 66 of file perf_log.h.
Referenced by libMesh::PerfLog::get_perf_info(), and stop_or_pause().
Total time spent in this event, including sub-events.
Definition at line 71 of file perf_log.h.
Referenced by libMesh::PerfLog::get_perf_info(), and stop_or_pause().
| struct timeval libMesh::PerfData::tstart |
Structure defining when the event was last started.
Definition at line 77 of file perf_log.h.
Referenced by restart(), start(), and stop_or_pause().
| struct timeval libMesh::PerfData::tstart_incl_sub |
Structure defining when the event was last started, including sub-events.
Definition at line 83 of file perf_log.h.
Referenced by start(), and stop_or_pause().