rpm  5.4.10
Functions | Variables
rpmsw.c File Reference
#include "system.h"
#include <rpmiotypes.h>
#include <rpmsw.h>
#include "debug.h"
Include dependency graph for rpmsw.c:

Go to the source code of this file.

Functions

rpmsw rpmswNow (rpmsw sw)
 Return benchmark time stamp. More...
 
static rpmtime_t tvsub (const struct timeval *etv, const struct timeval *btv)
 Return difference of 2 timeval stamps in micro-seconds. More...
 
rpmtime_t rpmswDiff (rpmsw end, rpmsw begin)
 Return benchmark time stamp difference. More...
 
rpmtime_t rpmswInit (void)
 Return benchmark time stamp overhead. More...
 
int rpmswEnter (rpmop op, ssize_t rc)
 Enter timed operation. More...
 
rpmtime_t rpmswExit (rpmop op, ssize_t rc)
 Exit timed operation. More...
 
rpmtime_t rpmswAdd (rpmop to, rpmop from)
 Sum statistic counters. More...
 
rpmtime_t rpmswSub (rpmop to, rpmop from)
 Subtract statistic counters. More...
 
void rpmswPrint (const char *name, rpmop op, FILE *fp)
 Print operation statistics. More...
 

Variables

int _rpmsw_stats = 0
 
static rpmtime_t rpmsw_overhead = 0
 
static rpmtime_t rpmsw_cycles = 1
 
static int rpmsw_type = 0
 
static int rpmsw_initialized = 0
 

Function Documentation

§ rpmswAdd()

rpmtime_t rpmswAdd ( rpmop  to,
rpmop  from 
)

Sum statistic counters.

Parameters
toresult statistics
fromoperation statistics
Returns
cumulative usecs for operation

Definition at line 280 of file rpmsw.c.

References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.

Referenced by compare(), fsmTeardown(), grep_or_recurse(), headerScrub(), iosmStage(), iosmTeardown(), mireLoadPatternFiles(), mtreeVisitF(), psmWait(), rpmdcFiniFile(), rpmpsmStage(), rpmReadPackageFile(), rpmrepoFclose(), rpmtsCleanDig(), rpmtsCloseDB(), rpmtsCloseSDB(), and rpmtsPrintStats().

§ rpmswDiff()

rpmtime_t rpmswDiff ( rpmsw  end,
rpmsw  begin 
)

Return benchmark time stamp difference.

Parameters
*endend time stamp
*beginbegin time stamp
Returns
difference in micro-seconds

Definition at line 123 of file rpmsw.c.

References rpmsw_cycles, rpmsw_overhead, rpmsw_type, rpmswDiff(), rpmswNow(), rpmsw_s::ticks, rpmsw_s::tv, tvsub(), and rpmsw_s::u.

Referenced by rpmswDiff(), rpmswExit(), and rpmswInit().

§ rpmswEnter()

int rpmswEnter ( rpmop  op,
ssize_t  rc 
)

§ rpmswExit()

rpmtime_t rpmswExit ( rpmop  op,
ssize_t  rc 
)

Exit timed operation.

Parameters
opoperation statistics
rcper-operation data (e.g. bytes transferred)
Returns
cumulative usecs for operation

Definition at line 264 of file rpmsw.c.

References rpmop_s::begin, rpmop_s::bytes, rpmswDiff(), rpmswNow(), and rpmop_s::usecs.

Referenced by _rpmtsCheck(), build(), fdstat_exit(), headerCheck(), headerGet(), headerLoad(), headerNext(), headerUnload(), main(), rpmpsmStage(), rpmReadPackageFile(), rpmrepoRfileDigest(), rpmsqWaitUnregister(), rpmtsAddFingerprints(), rpmtsPrepare(), rpmtsPrintStats(), rpmtsProcess(), rpmtsRepackage(), runScript(), verifyDSA(), verifyMD5(), verifyRSA(), and verifySHA1().

§ rpmswInit()

rpmtime_t rpmswInit ( void  )

Return benchmark time stamp overhead.

Returns
overhead in micro-seconds

Definition at line 180 of file rpmsw.c.

References rpmsw_cycles, rpmsw_initialized, rpmsw_overhead, rpmsw_type, rpmswDiff(), and rpmswNow().

Referenced by rpmswNow().

§ rpmswNow()

rpmsw rpmswNow ( rpmsw  sw)

Return benchmark time stamp.

Parameters
*swtime stamp
Returns
0 on success

Definition at line 84 of file rpmsw.c.

References rpmsw_initialized, rpmsw_type, rpmswInit(), rpmsw_s::ticks, rpmsw_s::tv, and rpmsw_s::u.

Referenced by rpmswDiff(), rpmswEnter(), rpmswExit(), and rpmswInit().

§ rpmswPrint()

void rpmswPrint ( const char *  name,
rpmop  op,
FILE *  fp 
)

Print operation statistics.

Parameters
nameoperation name
opoperation statistics
fpfile handle (NULL uses stderr)

Definition at line 304 of file rpmsw.c.

References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.

Referenced by main().

§ rpmswSub()

rpmtime_t rpmswSub ( rpmop  to,
rpmop  from 
)

Subtract statistic counters.

Parameters
toresult statistics
fromoperation statistics
Returns
cumulative usecs for operation

Definition at line 292 of file rpmsw.c.

References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.

Referenced by rpmReadPackageFile().

§ tvsub()

static rpmtime_t tvsub ( const struct timeval *  etv,
const struct timeval *  btv 
)
inlinestatic

Return difference of 2 timeval stamps in micro-seconds.

Parameters
*etvend timeval
*btvbegin timeval
Returns
difference in milli-seconds

Definition at line 111 of file rpmsw.c.

Referenced by rpmswDiff().

Variable Documentation

§ _rpmsw_stats

int _rpmsw_stats = 0

Definition at line 20 of file rpmsw.c.

Referenced by main().

§ rpmsw_cycles

rpmtime_t rpmsw_cycles = 1
static

Definition at line 26 of file rpmsw.c.

Referenced by rpmswDiff(), and rpmswInit().

§ rpmsw_initialized

int rpmsw_initialized = 0
static

Definition at line 32 of file rpmsw.c.

Referenced by rpmswInit(), and rpmswNow().

§ rpmsw_overhead

rpmtime_t rpmsw_overhead = 0
static

Definition at line 23 of file rpmsw.c.

Referenced by rpmswDiff(), and rpmswInit().

§ rpmsw_type

int rpmsw_type = 0
static

Definition at line 29 of file rpmsw.c.

Referenced by rpmswDiff(), rpmswInit(), and rpmswNow().