rpm  5.4.10
rpmsw.h
Go to the documentation of this file.
1 #ifndef H_RPMSW
2 #define H_RPMSW
3 
10 typedef unsigned long int rpmtime_t;
11 
14 typedef struct rpmsw_s * rpmsw;
15 
18 typedef struct rpmop_s * rpmop;
19 
22 struct rpmsw_s {
23  union {
24  struct timeval tv;
25  unsigned long long int ticks;
26  unsigned long int tocks[2];
27  } u;
28 };
29 
33 struct rpmop_s {
34  struct rpmsw_s begin;
35  int count;
36  unsigned long long bytes;
38 };
39 
40 /*@unchecked@*/
41 extern int _rpmsw_stats;
42 
46 typedef enum rpmswOpX_e {
69 } rpmswOpX;
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
79 /*@-exportlocal@*/
80 /*@null@*/
81 rpmsw rpmswNow(/*@returned@*/ rpmsw sw)
82  /*@globals internalState @*/
83  /*@modifies sw, internalState @*/;
84 /*@=exportlocal@*/
85 
91 /*@-exportlocal@*/
92 rpmtime_t rpmswDiff(/*@null@*/ rpmsw end, /*@null@*/ rpmsw begin)
93  /*@*/;
94 /*@=exportlocal@*/
95 
99 /*@-exportlocal@*/
100 rpmtime_t rpmswInit(void)
101  /*@globals internalState @*/
102  /*@modifies internalState @*/;
103 /*@=exportlocal@*/
104 
111 int rpmswEnter(/*@null@*/ rpmop op, ssize_t rc)
112  /*@globals internalState @*/
113  /*@modifies *op, internalState @*/;
114 
121 rpmtime_t rpmswExit(/*@null@*/ rpmop op, ssize_t rc)
122  /*@globals internalState @*/
123  /*@modifies op, internalState @*/;
124 
131 rpmtime_t rpmswAdd(/*@null@*/ rpmop to, /*@null@*/ rpmop from)
132  /*@modifies to @*/;
133 
140 rpmtime_t rpmswSub(rpmop to, rpmop from)
141  /*@modifies to @*/;
142 
149 void rpmswPrint(const char * name, /*@null@*/ rpmop op, /*@null@*/ FILE * fp)
150  /*@globals fileSystem @*/
151  /*@modifies fp, fileSystem @*/;
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /* H_RPMSW */
struct rpmsw_s * rpmsw
Definition: rpmsw.h:14
rpmswOpX_e
Indices for timestamps.
Definition: rpmsw.h:46
rpmtime_t usecs
Definition: rpmsw.h:37
void rpmswPrint(const char *name, rpmop op, FILE *fp)
Print operation statistics.
Definition: rpmsw.c:304
int rpmswEnter(rpmop op, ssize_t rc)
Enter timed operation.
Definition: rpmsw.c:248
rpmtime_t rpmswAdd(rpmop to, rpmop from)
Sum statistic counters.
Definition: rpmsw.c:280
struct timeval tv
Definition: rpmsw.h:24
int count
Definition: rpmsw.h:35
enum rpmswOpX_e rpmswOpX
Indices for timestamps.
union rpmsw_s::@7 u
rpmtime_t rpmswSub(rpmop to, rpmop from)
Subtract statistic counters.
Definition: rpmsw.c:292
struct rpmop_s * rpmop
Definition: rpmsw.h:18
rpmtime_t rpmswInit(void)
Return benchmark time stamp overhead.
Definition: rpmsw.c:180
Cumulative statistics for an operation.
Definition: rpmsw.h:33
rpmtime_t rpmswDiff(rpmsw end, rpmsw begin)
Return benchmark time stamp difference.
Definition: rpmsw.c:123
Definition: rpmsw.h:22
unsigned long long int ticks
Definition: rpmsw.h:25
rpmtime_t rpmswExit(rpmop op, ssize_t rc)
Exit timed operation.
Definition: rpmsw.c:264
rpmsw rpmswNow(rpmsw sw)
Return benchmark time stamp.
Definition: rpmsw.c:84
unsigned long long bytes
Definition: rpmsw.h:36
static const char * name
int _rpmsw_stats
Definition: rpmsw.c:20
unsigned long int tocks[2]
Definition: rpmsw.h:26
unsigned long int rpmtime_t
Definition: rpmsw.h:10