- log more statistics
authorMichael Schroeder <mls@suse.de>
Tue, 4 Nov 2008 13:32:05 +0000 (13:32 +0000)
committerMichael Schroeder <mls@suse.de>
Tue, 4 Nov 2008 13:32:05 +0000 (13:32 +0000)
src/pool.c
src/repo_solv.c
src/solver.c
tools/repo_rpmdb.c
tools/repo_rpmmd.c

index cbe67ba..dddb46d 100644 (file)
@@ -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));
 }
 
index 8b1f517..7d0117d 100644 (file)
@@ -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;
 }
 
index 9dd4609..6b593d1 100644 (file)
@@ -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));
 
index 9636980..d109570 100644 (file)
@@ -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)));
 }
 
 
index e0378c5..0309ada 100644 (file)
@@ -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)));
 }