rpmsw.h
Go to the documentation of this file.
#ifndef H_RPMSW
#define H_RPMSW
#include <unistd.h>
#include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned long int rpmtime_t;
typedef struct rpmsw_s * rpmsw;
typedef struct rpmop_s * rpmop;
struct rpmsw_s {
union {
struct timeval tv;
unsigned long long int ticks;
unsigned long int tocks[2];
} u;
};
struct rpmop_s {
struct rpmsw_s begin;
int count;
size_t bytes;
rpmtime_t usecs;
};
rpmsw rpmswNow(rpmsw sw);
rpmtime_t rpmswDiff(rpmsw end, rpmsw begin);
rpmtime_t rpmswInit(void);
int rpmswEnter(rpmop op, ssize_t rc);
rpmtime_t rpmswExit(rpmop op, ssize_t rc);
rpmtime_t rpmswAdd(rpmop to, rpmop from);
rpmtime_t rpmswSub(rpmop to, rpmop from);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMSW */
rpmop
struct rpmop_s * rpmop
Definition: rpmsw.h:27
rpmop_s::usecs
rpmtime_t usecs
Definition: rpmsw.h:46
rpmswDiff
rpmtime_t rpmswDiff(rpmsw end, rpmsw begin)
Return benchmark time stamp difference.
rpmsw_s::u
union rpmsw_s::@0 u
rpmswExit
rpmtime_t rpmswExit(rpmop op, ssize_t rc)
Exit timed operation.
rpmswAdd
rpmtime_t rpmswAdd(rpmop to, rpmop from)
Sum statistic counters.
rpmswInit
rpmtime_t rpmswInit(void)
Return benchmark time stamp overhead.
rpmsw_s::tv
struct timeval tv
Definition: rpmsw.h:33
rpmop_s::count
int count
Definition: rpmsw.h:44
rpmop_s::begin
struct rpmsw_s begin
Definition: rpmsw.h:43
rpmswEnter
int rpmswEnter(rpmop op, ssize_t rc)
Enter timed operation.
rpmop_s
Cumulative statistics for an operation.
Definition: rpmsw.h:42
rpmop_s::bytes
size_t bytes
Definition: rpmsw.h:45
rpmsw_s
Definition: rpmsw.h:31
rpmsw_s::ticks
unsigned long long int ticks
Definition: rpmsw.h:34
rpmsw
struct rpmsw_s * rpmsw
Definition: rpmsw.h:23
rpmsw_s::tocks
unsigned long int tocks[2]
Definition: rpmsw.h:35
rpmtime_t
unsigned long int rpmtime_t
Definition: rpmsw.h:19
rpmswNow
rpmsw rpmswNow(rpmsw sw)
Return benchmark time stamp.
rpmswSub
rpmtime_t rpmswSub(rpmop to, rpmop from)
Subtract statistic counters.