rpm  4.12.0.1
rpmsw.h
Go to the documentation of this file.
1 #ifndef H_RPMSW
2 #define H_RPMSW
3 
8 #include <unistd.h>
9 #include <sys/time.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
17 typedef unsigned long int rpmtime_t;
18 
21 typedef struct rpmsw_s * rpmsw;
22 
25 typedef struct rpmop_s * rpmop;
26 
29 struct rpmsw_s {
30  union {
31  struct timeval tv;
32  unsigned long long int ticks;
33  unsigned long int tocks[2];
34  } u;
35 };
36 
40 struct rpmop_s {
41  struct rpmsw_s begin;
42  int count;
43  size_t bytes;
44  rpmtime_t usecs;
45 };
46 
52 rpmsw rpmswNow(rpmsw sw);
53 
60 rpmtime_t rpmswDiff(rpmsw end, rpmsw begin);
61 
66 rpmtime_t rpmswInit(void);
67 
74 int rpmswEnter(rpmop op, ssize_t rc);
75 
82 rpmtime_t rpmswExit(rpmop op, ssize_t rc);
83 
90 rpmtime_t rpmswAdd(rpmop to, rpmop from);
91 
98 rpmtime_t rpmswSub(rpmop to, rpmop from);
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif /* H_RPMSW */
struct rpmop_s * rpmop
Definition: rpmsw.h:25
rpmtime_t usecs
Definition: rpmsw.h:44
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:31
int count
Definition: rpmsw.h:42
struct rpmsw_s begin
Definition: rpmsw.h:41
int rpmswEnter(rpmop op, ssize_t rc)
Enter timed operation.
Cumulative statistics for an operation.
Definition: rpmsw.h:40
size_t bytes
Definition: rpmsw.h:43
Definition: rpmsw.h:29
unsigned long long int ticks
Definition: rpmsw.h:32
struct rpmsw_s * rpmsw
Definition: rpmsw.h:21
unsigned long int tocks[2]
Definition: rpmsw.h:33
unsigned long int rpmtime_t
Definition: rpmsw.h:17
rpmsw rpmswNow(rpmsw sw)
Return benchmark time stamp.
rpmtime_t rpmswSub(rpmop to, rpmop from)
Subtract statistic counters.