From a9f18c8073c0770df0192a99f9e6ced23f25ca32 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Tue, 4 Nov 2008 13:32:05 +0000 Subject: [PATCH] - log more statistics --- src/pool.c | 1 + src/repo_solv.c | 7 +++++++ src/solver.c | 1 + tools/repo_rpmdb.c | 14 +++++++++----- tools/repo_rpmmd.c | 5 +++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/pool.c b/src/pool.c index cbe67ba..dddb46d 100644 --- a/src/pool.c +++ b/src/pool.c @@ -356,6 +356,7 @@ pool_createwhatprovides(Pool *pool) pool->whatprovidesdataoff = off; pool->whatprovidesdataleft = extra; pool_shrink_whatprovides(pool); + POOL_DEBUG(SAT_DEBUG_STATS, "whatprovides memory used: %d K id array, %d K data\n", (pool->ss.nstrings + pool->nrels + WHATPROVIDES_BLOCK) / (1024/sizeof(Id)), (pool->whatprovidesdataoff + pool->whatprovidesdataleft) / (1024/sizeof(Id))); POOL_DEBUG(SAT_DEBUG_STATS, "createwhatprovides took %d ms\n", sat_timems(now)); } diff --git a/src/repo_solv.c b/src/repo_solv.c index 8b1f517..7d0117d 100644 --- a/src/repo_solv.c +++ b/src/repo_solv.c @@ -537,11 +537,14 @@ repo_add_solv_parent(Repo *repo, FILE *fp, Repodata *parent) Id stack[3 * 5]; int keydepth; int needchunk; /* need a new chunk of data */ + unsigned int now; struct _Stringpool *spool; Repodata data; + now = sat_timems(0); + memset(&data, 0, sizeof(data)); data.repo = repo; data.fp = fp; @@ -1363,6 +1366,10 @@ printf("=> %s %s %p\n", id2str(pool, keys[key].name), id2str(pool, keys[key].typ memset(&stubdata, 0, sizeof(stubdata)); repodata_search(&data, SOLVID_META, REPOSITORY_EXTERNAL, SEARCH_ARRAYSENTINEL, create_stub_cb, &stubdata); } + + POOL_DEBUG(SAT_DEBUG_STATS, "repo_add_solv took %d ms\n", sat_timems(now)); + POOL_DEBUG(SAT_DEBUG_STATS, "repo size: %d solvables\n", repo->nsolvables); + POOL_DEBUG(SAT_DEBUG_STATS, "repo memory used: %d K incore, %d K idarray\n", data.incoredatalen/1024, repo->idarraysize / (1024/sizeof(Id))); return 0; } diff --git a/src/solver.c b/src/solver.c index 9dd4609..6b593d1 100644 --- a/src/solver.c +++ b/src/solver.c @@ -4078,6 +4078,7 @@ solver_solve(Solver *solv, Queue *job) solv->rpmrules_end = solv->nrules; /* mark end of rpm rules */ solv->directdecisions = solv->decisionq.count; + POOL_DEBUG(SAT_DEBUG_STATS, "rpm rule memory usage: %d K\n", solv->nrules * sizeof(Rule) / 1024); POOL_DEBUG(SAT_DEBUG_STATS, "decisions so far: %d\n", solv->decisionq.count); POOL_DEBUG(SAT_DEBUG_STATS, "rpm rule creation took %d ms\n", sat_timems(now)); diff --git a/tools/repo_rpmdb.c b/tools/repo_rpmdb.c index 9636980..d109570 100644 --- a/tools/repo_rpmdb.c +++ b/tools/repo_rpmdb.c @@ -1251,13 +1251,14 @@ repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags) Id oldcookietype = 0; Repodata *data; int count = 0, done = 0; + unsigned int now; + now = sat_timems(0); memset(&dbkey, 0, sizeof(dbkey)); memset(&dbdata, 0, sizeof(dbdata)); if (!rootdir) rootdir = ""; - if (!(flags & REPO_REUSE_REPODATA)) data = repo_add_repodata(repo, 0); @@ -1611,15 +1612,18 @@ repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags) sat_free(rpmids); } } - if (!(flags & REPO_NO_INTERNALIZE)) - repodata_internalize(data); - if (rpmhead) - sat_free(rpmhead); if (db) db->close(db, 0); dbenv->close(dbenv, 0); + if (rpmhead) + sat_free(rpmhead); + if (!(flags & REPO_NO_INTERNALIZE)) + repodata_internalize(data); if ((flags & RPMDB_REPORT_PROGRESS) != 0) pool_debug(pool, SAT_ERROR, "%%%% 100\n"); + POOL_DEBUG(SAT_DEBUG_STATS, "repo_add_rpmdb took %d ms\n", sat_timems(now)); + POOL_DEBUG(SAT_DEBUG_STATS, "repo size: %d solvables\n", repo->nsolvables); + POOL_DEBUG(SAT_DEBUG_STATS, "repo memory used: %d K incore, %d K idarray\n", data->incoredatalen/1024, repo->idarraysize / (1024/sizeof(Id))); } diff --git a/tools/repo_rpmmd.c b/tools/repo_rpmmd.c index e0378c5..0309ada 100644 --- a/tools/repo_rpmmd.c +++ b/tools/repo_rpmmd.c @@ -1092,7 +1092,9 @@ repo_add_rpmmd(Repo *repo, FILE *fp, const char *language, int flags) int i, l; struct stateswitch *sw; Repodata *data; + unsigned int now; + now = sat_timems(0); if (!(flags & REPO_REUSE_REPODATA)) data = repo_add_repodata(repo, 0); else @@ -1146,4 +1148,7 @@ repo_add_rpmmd(Repo *repo, FILE *fp, const char *language, int flags) sat_free(pd.cscache); if (!(flags & REPO_NO_INTERNALIZE)) repodata_internalize(data); + POOL_DEBUG(SAT_DEBUG_STATS, "repo_add_rpmmd took %d ms\n", sat_timems(now)); + POOL_DEBUG(SAT_DEBUG_STATS, "repo size: %d solvables\n", repo->nsolvables); + POOL_DEBUG(SAT_DEBUG_STATS, "repo memory used: %d K incore, %d K idarray\n", data->incoredatalen/1024, repo->idarraysize / (1024/sizeof(Id))); } -- 2.7.4