summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-04-01 22:27:39 +0000
committerjbj <devnull@localhost>2003-04-01 22:27:39 +0000
commitb0ca58af8e9bca4c1c8d288c71c39d4b484102d8 (patch)
tree0cc47d2646ff6c9bd4e367c95b11bfe647ce7b84 /rpmio
parent4eb5fa7dc583f7c89d3a6118f73f581300a1375e (diff)
downloadrpm-b0ca58af8e9bca4c1c8d288c71c39d4b484102d8.tar.gz
rpm-b0ca58af8e9bca4c1c8d288c71c39d4b484102d8.tar.bz2
rpm-b0ca58af8e9bca4c1c8d288c71c39d4b484102d8.zip
Splint fiddles.
Create struct rpmop_s from OPSTAT_t. CVS patchset: 6726 CVS date: 2003/04/01 22:27:39
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmsw.h39
1 files changed, 36 insertions, 3 deletions
diff --git a/rpmio/rpmsw.h b/rpmio/rpmsw.h
index ced72a5b3..91f9d9cb4 100644
--- a/rpmio/rpmsw.h
+++ b/rpmio/rpmsw.h
@@ -15,6 +15,10 @@ typedef struct rpmsw_s * rpmsw;
/** \ingroup rpmio
*/
+typedef struct rpmop_s * rpmop;
+
+/** \ingroup rpmio
+ */
struct rpmsw_s {
union {
struct timeval tv;
@@ -23,7 +27,15 @@ struct rpmsw_s {
} u;
};
-#define RPMSW_SCALE (1000 * 1000)
+/** \ingroup rpmio
+ * Cumulative statistics for an operation.
+ */
+struct rpmop_s {
+ struct rpmsw_s begin; /*!< Starting time stamp. */
+ int count; /*!< Number of operations. */
+ size_t bytes; /*!< Number of bytes transferred. */
+ rpmtime_t usecs; /*!< Number of ticks. */
+};
#ifdef __cplusplus
extern "C" {
@@ -35,7 +47,8 @@ extern "C" {
*/
/*@null@*/
rpmsw rpmswNow(/*@returned@*/ rpmsw sw)
- /*@modifies sw @*/;
+ /*@globals internalState @*/
+ /*@modifies sw, internalState @*/;
/** Return benchmark time stamp difference.
* @param *end end time stamp
@@ -49,7 +62,27 @@ rpmtime_t rpmswDiff(/*@null@*/ rpmsw end, /*@null@*/ rpmsw begin)
* @return overhead in micro-seconds
*/
rpmtime_t rpmswInit(void)
- /*@*/;
+ /*@globals internalState @*/
+ /*@modifes internalState @*/;
+
+/** \ingroup rpmio
+ * Enter timed operation.
+ * @param op operation statistics
+ * @return 0 always
+ */
+int rpmswEnter(rpmop op)
+ /*@globals internalState @*/
+ /*@modifes op->count, op->begin, internalState @*/;
+
+/** \ingroup rpmio
+ * Exit timed operation.
+ * @param op operation statistics
+ * @param rc per-operation data (e.g. bytes transferred)
+ * @return 0 always
+ */
+int rpmswExit(rpmop op, ssize_t rc)
+ /*@globals internalState @*/
+ /*@modifes op-bytes, op->usecs, internalState @*/;
#ifdef __cplusplus
}