extern int _rpmts_debug;
/*@unchecked@*/
+extern int _rpmts_stats;
+
+/*@unchecked@*/
extern int noLibio;
/*@=exportheadervar@*/
NULL, NULL},
{ "rpmtsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmts_debug, -1,
NULL, NULL},
+ { "stats", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmts_stats, -1,
+ NULL, NULL},
{ "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
N_("debug URL cache handling"), NULL},
if (!headerGetEntry(first, RPMTAG_EPOCH, NULL, (void **) &epochOne, NULL))
epochOne = NULL;
- if (!headerGetEntry(second, RPMTAG_EPOCH, NULL, (void **) &epochTwo,
- NULL))
+ if (!headerGetEntry(second, RPMTAG_EPOCH, NULL, (void **) &epochTwo, NULL))
epochTwo = NULL;
if (epochOne != NULL && epochTwo == NULL)
rc = fsmSetup(fi->fsm, FSM_PKGINSTALL, ts, fi,
psm->cfd, NULL, &psm->failedFile);
+ if (psm->cfd->stats != NULL)
+ ts->ms_uncompress += psm->cfd->stats->ops[FDSTAT_READ].usecs/1000;
xx = fsmTeardown(fi->fsm);
saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
rc = fsmSetup(fi->fsm, FSM_PKGBUILD, ts, fi, psm->cfd,
NULL, &psm->failedFile);
+ if (psm->cfd->stats != NULL)
+ ts->ms_compress += psm->cfd->stats->ops[FDSTAT_WRITE].usecs/1000;
xx = fsmTeardown(fi->fsm);
saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
/*@unchecked@*/
int _rpmts_debug = 0;
+/*@unchecked@*/
+int _rpmts_stats = 0;
+
char * hGetNEVR(Header h, const char ** np)
{
const char * n, * v, * r;
/*@=nullstate@*/
}
+static void rpmtsPrintStats(rpmts ts)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/
+{
+ rpmtime_t msecs = rpmswExit(&ts->create, -1)/1000;
+
+ fprintf(stderr, " total: %4lu.%03lu sec\n", msecs/1000, msecs%1000);
+ fprintf(stderr, " check: %4lu.%03lu sec\n", ts->ms_check/1000, ts->ms_check%1000);
+ fprintf(stderr, " order: %4lu.%03lu sec\n", ts->ms_order/1000, ts->ms_order%1000);
+ fprintf(stderr, " fingerprint: %4lu.%03lu sec\n", ts->ms_fingerprint/1000, ts->ms_fingerprint%1000);
+ fprintf(stderr, " repackage: %4lu.%03lu sec\n", ts->ms_repackage/1000, ts->ms_repackage%1000);
+ fprintf(stderr, " install: %4lu.%03lu sec\n", ts->ms_install/1000, ts->ms_install%1000);
+ fprintf(stderr, " erase: %4lu.%03lu sec\n", ts->ms_erase/1000, ts->ms_erase%1000);
+ fprintf(stderr, " scriptlets: %4lu.%03lu sec\n", ts->ms_scriptlets/1000, ts->ms_scriptlets%1000);
+ fprintf(stderr, " compress: %4lu.%03lu sec\n", ts->ms_compress/1000, ts->ms_compress%1000);
+ fprintf(stderr, " uncompress: %4lu.%03lu sec\n", ts->ms_uncompress/1000, ts->ms_uncompress%1000);
+}
+
rpmts rpmtsFree(rpmts ts)
{
if (ts == NULL)
(void) rpmtsUnlink(ts, "tsCreate");
+ if (_rpmts_stats)
+ rpmtsPrintStats(ts);
+
/*@-refcounttrans -usereleased @*/
ts = _free(ts);
/*@=refcounttrans =usereleased @*/
rpmts ts;
ts = xcalloc(1, sizeof(*ts));
+ rpmswEnter(&ts->create, -1);
ts->goal = TSM_UNKNOWN;
ts->filesystemCount = 0;
ts->filesystems = NULL;
/*@unchecked@*/
extern int _rpmts_debug;
/*@unchecked@*/
+extern int _rpmts_stats;
+/*@unchecked@*/
extern int _fps_debug;
/*@=exportlocal@*/
size_t pkpktlen; /*!< Current pubkey packet length. */
unsigned char pksignid[8]; /*!< Current pubkey fingerprint. */
+ struct rpmop_s create;
struct rpmop_s op; /*!< Transaction operation time stamp. */
rpmtime_t ms_check;
rpmtime_t ms_install;
rpmtime_t ms_erase;
rpmtime_t ms_scriptlets;
+ rpmtime_t ms_compress;
+ rpmtime_t ms_uncompress;
/*@null@*/
pgpDig dig; /*!< Current signature/pubkey parameters. */
NOTIFY(ts, (NULL, RPMCALLBACK_TRANS_STOP, 6, ts->orderCount,
NULL, ts->notifyData));
- ts->ms_fingerprint += rpmswExit(&ts->op, -1)/1000;
+ ts->ms_fingerprint += rpmswExit(&ts->op, totalFileCount)/1000;
/* ===============================================
* Free unused memory as soon as possible.
* Cumulative statistics for a descriptor.
*/
typedef /*@abstract@*/ struct {
- struct rpmsw_s begin; /*!< Operation start time. */
struct rpmop_s ops[4]; /*!< Cumulative statistics. */
} * FDSTAT_t;
/*@unchecked@*/
static int rpmsw_initialized = 0;
-#if 1 /* XXX defined(__i386__) */
+#if 0 /* XXX defined(__i386__) */
/* Swiped from glibc-2.3.2 sysdeps/i386/i686/hp-timing.h */
#define HP_TIMING_ZERO(Var) (Var) = (0)