aboutsummaryrefslogtreecommitdiff
path: root/src/libventi/cache.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-11-02 19:08:43 +0000
committerrsc <devnull@localhost>2005-11-02 19:08:43 +0000
commit7252036fe876f522b5549f1d97c79528ca1be7ff (patch)
tree49ce2530906aa937b711ba37cb42d0364243113f /src/libventi/cache.c
parentf51bf048784abd642dea4f033bc95acbd4468b6a (diff)
downloadplan9port-7252036fe876f522b5549f1d97c79528ca1be7ff.tar.gz
plan9port-7252036fe876f522b5549f1d97c79528ca1be7ff.tar.bz2
plan9port-7252036fe876f522b5549f1d97c79528ca1be7ff.zip
Better logging in vtrpc, publish cache statistics.
Diffstat (limited to 'src/libventi/cache.c')
-rw-r--r--src/libventi/cache.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libventi/cache.c b/src/libventi/cache.c
index 71bdb62c..8dcb52f5 100644
--- a/src/libventi/cache.c
+++ b/src/libventi/cache.c
@@ -12,7 +12,9 @@
#include <libc.h>
#include <venti.h>
-int nread, ncopy, nwrite;
+int vtcachenread;
+int vtcachencopy;
+int vtcachenwrite;
enum {
BioLocal = 1,
@@ -419,6 +421,7 @@ vtcacheglobal(VtCache *c, uchar score[VtScoreSize], int type)
b->nlock = 1;
qunlock(&c->lk);
+ vtcachenread++;
n = vtread(c->z, score, type, b->data, c->blocksize);
if(n < 0){
werrstr("vtread %V: %r", score);
@@ -512,6 +515,7 @@ vtblockwrite(VtBlock *b)
c = b->c;
n = vtzerotruncate(b->type, b->data, c->blocksize);
+ vtcachenwrite++;
if(c->write(c->z, score, b->type, b->data, n) < 0)
return -1;
@@ -540,7 +544,7 @@ vtblockcopy(VtBlock *b)
{
VtBlock *bb;
-ncopy++;
+ vtcachencopy++;
bb = vtcacheallocblock(b->c, b->type);
if(bb == nil){
vtblockput(b);