10 typedef unsigned long int rpmtime_t;
14 typedef struct rpmsw_s * rpmsw;
18 typedef struct rpmop_s * rpmop;
25 unsigned long long int ticks;
26 unsigned long int tocks[2];
31 * Cumulative statistics for an operation.
34 struct rpmsw_s begin; /*!< Starting time stamp. */
35 int count; /*!< Number of operations. */
36 size_t bytes; /*!< Number of bytes transferred. */
37 rpmtime_t usecs; /*!< Number of ticks. */
44 /** Return benchmark time stamp.
45 * @param *sw time stamp
46 * @return 0 on success
50 rpmsw rpmswNow(/*@returned@*/ rpmsw sw)
51 /*@globals internalState @*/
52 /*@modifies sw, internalState @*/;
55 /** Return benchmark time stamp difference.
56 * @param *end end time stamp
57 * @param *begin begin time stamp
58 * @return difference in micro-seconds
61 rpmtime_t rpmswDiff(/*@null@*/ rpmsw end, /*@null@*/ rpmsw begin)
65 /** Return benchmark time stamp overhead.
66 * @return overhead in micro-seconds
69 rpmtime_t rpmswInit(void)
70 /*@globals internalState @*/
71 /*@modifies internalState @*/;
75 * Enter timed operation.
76 * @param op operation statistics
77 * @param rc -1 clears usec counter
80 int rpmswEnter(/*@null@*/ rpmop op, ssize_t rc)
81 /*@globals internalState @*/
82 /*@modifies *op, internalState @*/;
85 * Exit timed operation.
86 * @param op operation statistics
87 * @param rc per-operation data (e.g. bytes transferred)
88 * @return cumulative usecs for operation
90 rpmtime_t rpmswExit(/*@null@*/ rpmop op, ssize_t rc)
91 /*@globals internalState @*/
92 /*@modifies op, internalState @*/;
95 * Sum statistic counters.
96 * @param to result statistics
97 * @param from operation statistics
98 * @return cumulative usecs for operation
100 rpmtime_t rpmswAdd(/*@null@*/ rpmop to, /*@null@*/ rpmop from)
104 * Subtract statistic counters.
105 * @param to result statistics
106 * @param from operation statistics
107 * @return cumulative usecs for operation
109 rpmtime_t rpmswSub(rpmop to, rpmop from)
116 #endif /* H_RPMIO_INTERNAL */