rpm: rpmsw.h Source File

rpm 4.16.1.3

rpmsw.h
Go to the documentation of this file.
1 #ifndef H_RPMSW
2 #define H_RPMSW
3
10 #include <unistd.h>
11 #include <sys/time.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
19 typedef unsigned long int rpmtime_t;
20
23 typedef struct rpmsw_s * rpmsw;
24
27 typedef struct rpmop_s * rpmop;
28
31 struct rpmsw_s {
32 union {
33 struct timeval tv;
34 unsigned long long int ticks;
35 unsigned long int tocks[2];
36 } u;
37 };
38
42 struct rpmop_s {
43 struct rpmsw_s begin;
44 int count;
45 size_t bytes;
46 rpmtime_t usecs;
47 };
48
54 rpmsw rpmswNow(rpmsw sw);
55
62 rpmtime_t rpmswDiff(rpmsw end, rpmsw begin);
63
68 rpmtime_t rpmswInit(void);
69
76 int rpmswEnter(rpmop op, ssize_t rc);
77
84 rpmtime_t rpmswExit(rpmop op, ssize_t rc);
85
92 rpmtime_t rpmswAdd(rpmop to, rpmop from);
93
100 rpmtime_t rpmswSub(rpmop to, rpmop from);
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif /* H_RPMSW */
rpmsw_s::ticks
unsigned long long int ticks
Definition: rpmsw.h:34
rpmop_s::bytes
size_t bytes
Definition: rpmsw.h:45
rpmswInit
rpmtime_t rpmswInit(void)
Return benchmark time stamp overhead.
rpmsw_s::u
union rpmsw_s::@0 u
rpmop_s::begin
struct rpmsw_s begin
Definition: rpmsw.h:43
rpmsw_s::tv
struct timeval tv
Definition: rpmsw.h:33
rpmsw_s::tocks
unsigned long int tocks[2]
Definition: rpmsw.h:35
rpmswDiff
rpmtime_t rpmswDiff(rpmsw end, rpmsw begin)
Return benchmark time stamp difference.
rpmswSub
rpmtime_t rpmswSub(rpmop to, rpmop from)
Subtract statistic counters.
rpmsw_s
Definition: rpmsw.h:31
rpmop
struct rpmop_s * rpmop
Definition: rpmsw.h:27
rpmop_s::count
int count
Definition: rpmsw.h:44
rpmswAdd
rpmtime_t rpmswAdd(rpmop to, rpmop from)
Sum statistic counters.
rpmop_s
Cumulative statistics for an operation.
Definition: rpmsw.h:42
rpmswEnter
int rpmswEnter(rpmop op, ssize_t rc)
Enter timed operation.
rpmop_s::usecs
rpmtime_t usecs
Definition: rpmsw.h:46
rpmtime_t
unsigned long int rpmtime_t
Definition: rpmsw.h:19
rpmswNow
rpmsw rpmswNow(rpmsw sw)
Return benchmark time stamp.
rpmsw
struct rpmsw_s * rpmsw
Definition: rpmsw.h:23
rpmswExit
rpmtime_t rpmswExit(rpmop op, ssize_t rc)
Exit timed operation.