Commit 7cf5e9c21a8773b07c6c99ab6219ffc5cac6b83d

Stefan Sperling 2018-09-15T20:44:10

show process name in cache stats debug output

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/lib/object_cache.c b/lib/object_cache.c
index ed74d0d..3de45cd 100644
--- a/lib/object_cache.c
+++ b/lib/object_cache.c
@@ -142,9 +142,9 @@ got_object_cache_get(struct got_object_cache *cache, struct got_object_id *id)
 static void
 print_cache_stats(struct got_object_cache *cache, const char *name)
 {
-	fprintf(stderr, "%s cache: %d elements, %d hits, %d missed, "
-	    "%d evicted\n",
-	    name, got_object_idcache_num_elements(cache->idcache),
+	fprintf(stderr, "%s: %s cache: %d elements, %d hits, %d missed, "
+	    "%d evicted\n", getprogname(), name,
+	    got_object_idcache_num_elements(cache->idcache),
 	    cache->cache_hit, cache->cache_miss, cache->cache_evict);
 }