rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Functions | Variables
rpmsw.c File Reference
RPMIO.
`#include "system.h"`
`#include <rpmiotypes.h>`
`#include <rpmsw.h>`
`#include "debug.h"`
Include dependency graph for rpmsw.c:

Go to the source code of this file.

## Functions
rpmsw | rpmswNow (rpmsw sw)
| Return benchmark time stamp. More...
static rpmtime_t | tvsub (const struct timeval *etv, const struct timeval *btv)
| Return difference of 2 timeval stamps in micro-seconds. More...
rpmtime_t | rpmswDiff (rpmsw end, rpmsw begin)
| Return benchmark time stamp difference. More...
rpmtime_t | rpmswInit (void)
| Return benchmark time stamp overhead. More...
int | rpmswEnter (rpmop op, ssize_t rc)
| Enter timed operation. More...
rpmtime_t | rpmswExit (rpmop op, ssize_t rc)
| Exit timed operation. More...
rpmtime_t | rpmswAdd (rpmop to, rpmop from)
| Sum statistic counters. More...
rpmtime_t | rpmswSub (rpmop to, rpmop from)
| Subtract statistic counters. More...
void | rpmswPrint (const char *name, rpmop op)
| Print operation statistics. More...

## Variables
int | _rpmsw_stats = 0
static rpmtime_t | rpmsw_overhead = 0
static rpmtime_t | rpmsw_cycles = 1
static int | rpmsw_type = 0
static int | rpmsw_initialized = 0

## Function Documentation

rpmtime_t rpmswDiff | ( | rpmsw | end,
|  | rpmsw | begin
| ) |  |

Return benchmark time stamp difference.

Parameters

  *end | end time stamp
  *begin | begin time stamp

Returns
  difference in micro-seconds

Definition at line 123 of file rpmsw.c.

References rpmsw_cycles, rpmsw_overhead, rpmsw_type, rpmsw_s::ticks, rpmsw_s::tv, tvsub(), and rpmsw_s::u.

Referenced by rpmswExit(), and rpmswInit().

rpmtime_t rpmswInit | ( | void |  | ) |

Return benchmark time stamp overhead.

Returns
  overhead in micro-seconds

Definition at line 180 of file rpmsw.c.

References rpmsw_cycles, rpmsw_initialized, rpmsw_overhead, rpmsw_type, rpmswDiff(), and rpmswNow().

Referenced by rpmswNow().

rpmsw rpmswNow | ( | rpmsw | sw | ) |

Return benchmark time stamp.

Parameters

  *sw | time stamp

Returns
  0 on success

Definition at line 84 of file rpmsw.c.

References rpmsw_initialized, rpmsw_type, rpmswInit(), rpmsw_s::ticks, rpmsw_s::tv, and rpmsw_s::u.

Referenced by rpmswEnter(), rpmswExit(), and rpmswInit().

## Variable Documentation

int _rpmsw_stats = 0

Definition at line 20 of file rpmsw.c.

Referenced by main().

rpmtime_t rpmsw_cycles = 1
| static

Definition at line 26 of file rpmsw.c.

Referenced by rpmswDiff(), and rpmswInit().

int rpmsw_initialized = 0
| static

Definition at line 32 of file rpmsw.c.

Referenced by rpmswInit(), and rpmswNow().

rpmtime_t rpmsw_overhead = 0
| static

Definition at line 23 of file rpmsw.c.

Referenced by rpmswDiff(), and rpmswInit().

int rpmsw_type = 0
| static

Definition at line 29 of file rpmsw.c.

Referenced by rpmswDiff(), rpmswInit(), and rpmswNow().