summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/poptALL.c5
-rw-r--r--lib/psm.c7
-rw-r--r--lib/rpmts.c25
-rw-r--r--lib/rpmts.h5
-rw-r--r--lib/transaction.c2
-rw-r--r--rpmio/rpmio_internal.h1
-rw-r--r--rpmio/rpmsw.c2
7 files changed, 42 insertions, 5 deletions
diff --git a/lib/poptALL.c b/lib/poptALL.c
index 2bee3b853..de4c52735 100644
--- a/lib/poptALL.c
+++ b/lib/poptALL.c
@@ -71,6 +71,9 @@ extern int _rpmte_debug;
extern int _rpmts_debug;
/*@unchecked@*/
+extern int _rpmts_stats;
+
+/*@unchecked@*/
extern int noLibio;
/*@=exportheadervar@*/
@@ -309,6 +312,8 @@ struct poptOption rpmcliAllPoptTable[] = {
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},
diff --git a/lib/psm.c b/lib/psm.c
index d637443e7..5a2a1cf96 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -54,8 +54,7 @@ int rpmVersionCompare(Header first, Header second)
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)
@@ -1518,6 +1517,8 @@ psm->te->h = headerLink(fi->h);
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 */
@@ -1597,6 +1598,8 @@ psm->te->h = headerLink(fi->h);
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 */
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 13710a5c2..529c5552d 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -63,6 +63,9 @@ extern int statvfs (const char * file, /*@out@*/ struct statvfs * buf)
/*@unchecked@*/
int _rpmts_debug = 0;
+/*@unchecked@*/
+int _rpmts_stats = 0;
+
char * hGetNEVR(Header h, const char ** np)
{
const char * n, * v, * r;
@@ -627,6 +630,24 @@ void rpmtsEmpty(rpmts ts)
/*@=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)
@@ -669,6 +690,9 @@ rpmts rpmtsFree(rpmts ts)
(void) rpmtsUnlink(ts, "tsCreate");
+ if (_rpmts_stats)
+ rpmtsPrintStats(ts);
+
/*@-refcounttrans -usereleased @*/
ts = _free(ts);
/*@=refcounttrans =usereleased @*/
@@ -1222,6 +1246,7 @@ rpmts rpmtsCreate(void)
rpmts ts;
ts = xcalloc(1, sizeof(*ts));
+ rpmswEnter(&ts->create, -1);
ts->goal = TSM_UNKNOWN;
ts->filesystemCount = 0;
ts->filesystems = NULL;
diff --git a/lib/rpmts.h b/lib/rpmts.h
index 9e7ab76d3..fbdc88b0c 100644
--- a/lib/rpmts.h
+++ b/lib/rpmts.h
@@ -13,6 +13,8 @@
/*@unchecked@*/
extern int _rpmts_debug;
/*@unchecked@*/
+extern int _rpmts_stats;
+/*@unchecked@*/
extern int _fps_debug;
/*@=exportlocal@*/
@@ -194,6 +196,7 @@ struct rpmts_s {
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;
@@ -203,6 +206,8 @@ struct rpmts_s {
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. */
diff --git a/lib/transaction.c b/lib/transaction.c
index fc2b6ac7b..0e24d5d38 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -1367,7 +1367,7 @@ rpmMessage(RPMMESS_DEBUG, _("computing file dispositions\n"));
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.
diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h
index ec895af44..26014d9cc 100644
--- a/rpmio/rpmio_internal.h
+++ b/rpmio/rpmio_internal.h
@@ -115,7 +115,6 @@ enum FDSTAT_e {
* Cumulative statistics for a descriptor.
*/
typedef /*@abstract@*/ struct {
- struct rpmsw_s begin; /*!< Operation start time. */
struct rpmop_s ops[4]; /*!< Cumulative statistics. */
} * FDSTAT_t;
diff --git a/rpmio/rpmsw.c b/rpmio/rpmsw.c
index 89333b0f2..d96954abf 100644
--- a/rpmio/rpmsw.c
+++ b/rpmio/rpmsw.c
@@ -27,7 +27,7 @@ static int rpmsw_type = 0;
/*@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)