summaryrefslogtreecommitdiff
path: root/CCache/stats.c
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2008-11-05 12:34:15 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2008-11-05 12:34:15 +0000
commit59988d94745de4e5940ffe9b516224d4a0191530 (patch)
tree49a9e1271a1a3685c48d2af79380075528babaaf /CCache/stats.c
parent27e03f3f866a0e8653006511761ac95323d46301 (diff)
downloadswig-59988d94745de4e5940ffe9b516224d4a0191530.tar.gz
initial modifications for ccache to support SWIG
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10915 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'CCache/stats.c')
-rw-r--r--CCache/stats.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/CCache/stats.c b/CCache/stats.c
index ddaf768db..8be1879d1 100644
--- a/CCache/stats.c
+++ b/CCache/stats.c
@@ -116,7 +116,7 @@ static void stats_read_fd(int fd, unsigned counters[STATS_END])
}
/* update the stats counter for this compile */
-static void stats_update_size(enum stats stat, size_t size)
+static void stats_update_size(enum stats stat, size_t size, size_t numfiles)
{
int fd;
unsigned counters[STATS_END];
@@ -147,7 +147,7 @@ static void stats_update_size(enum stats stat, size_t size)
/* on a cache miss we up the file count and size */
if (stat == STATS_TOCACHE) {
- counters[STATS_NUMFILES] += 2;
+ counters[STATS_NUMFILES] += numfiles;
counters[STATS_TOTALSIZE] += size;
}
@@ -173,18 +173,18 @@ static void stats_update_size(enum stats stat, size_t size)
}
/* record a cache miss */
-void stats_tocache(size_t size)
+void stats_tocache(size_t size, size_t numfiles)
{
/* convert size to kilobytes */
size = size / 1024;
- stats_update_size(STATS_TOCACHE, size);
+ stats_update_size(STATS_TOCACHE, size, numfiles);
}
/* update a normal stat */
void stats_update(enum stats stat)
{
- stats_update_size(stat, 0);
+ stats_update_size(stat, 0, 0);
}
/* read in the stats from one dir and add to the counters */