rpm  4.17.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;
47 };
48 
55 
63 
69 
76 int rpmswEnter(rpmop op, ssize_t rc);
77 
84 rpmtime_t rpmswExit(rpmop op, ssize_t rc);
85 
93 
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif /* H_RPMSW */
unsigned long int rpmtime_t
Definition: rpmsw.h:19
rpmtime_t rpmswAdd(rpmop to, rpmop from)
Sum statistic counters.
rpmtime_t rpmswExit(rpmop op, ssize_t rc)
Exit timed operation.
rpmtime_t rpmswDiff(rpmsw end, rpmsw begin)
Return benchmark time stamp difference.
rpmtime_t rpmswInit(void)
Return benchmark time stamp overhead.
int rpmswEnter(rpmop op, ssize_t rc)
Enter timed operation.
rpmtime_t rpmswSub(rpmop to, rpmop from)
Subtract statistic counters.
struct rpmop_s * rpmop
Definition: rpmsw.h:27
rpmsw rpmswNow(rpmsw sw)
Return benchmark time stamp.
struct rpmsw_s * rpmsw
Definition: rpmsw.h:23
Cumulative statistics for an operation.
Definition: rpmsw.h:42
rpmtime_t usecs
Definition: rpmsw.h:46
int count
Definition: rpmsw.h:44
size_t bytes
Definition: rpmsw.h:45
struct rpmsw_s begin
Definition: rpmsw.h:43
Definition: rpmsw.h:31
union rpmsw_s::@0 u
struct timeval tv
Definition: rpmsw.h:33
unsigned long int tocks[2]
Definition: rpmsw.h:35
unsigned long long int ticks
Definition: rpmsw.h:34