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