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 */
rpmsw
struct rpmsw_s * rpmsw
Definition: rpmsw.h:21
rpmop_s::usecs
rpmtime_t usecs
Definition: rpmsw.h:44
rpmswEnter
int rpmswEnter(rpmop op, ssize_t rc)
Enter timed operation.
rpmswAdd
rpmtime_t rpmswAdd(rpmop to, rpmop from)
Sum statistic counters.
rpmsw_s::u
union rpmsw_s::@0 u
rpmsw_s::tv
struct timeval tv
Definition: rpmsw.h:31
rpmop_s::count
int count
Definition: rpmsw.h:42
rpmswSub
rpmtime_t rpmswSub(rpmop to, rpmop from)
Subtract statistic counters.
rpmop
struct rpmop_s * rpmop
Definition: rpmsw.h:25
rpmswInit
rpmtime_t rpmswInit(void)
Return benchmark time stamp overhead.
rpmop_s
Cumulative statistics for an operation.
Definition: rpmsw.h:40
rpmop_s::bytes
size_t bytes
Definition: rpmsw.h:43
rpmswDiff
rpmtime_t rpmswDiff(rpmsw end, rpmsw begin)
Return benchmark time stamp difference.
rpmsw_s
Definition: rpmsw.h:29
rpmsw_s::ticks
unsigned long long int ticks
Definition: rpmsw.h:32
rpmswExit
rpmtime_t rpmswExit(rpmop op, ssize_t rc)
Exit timed operation.
rpmswNow
rpmsw rpmswNow(rpmsw sw)
Return benchmark time stamp.
rpmsw_s::tocks
unsigned long int tocks[2]
Definition: rpmsw.h:33
rpmtime_t
unsigned long int rpmtime_t
Definition: rpmsw.h:17