diff options
Diffstat (limited to 'debian/patches/ihash0002-libdiskfs-nodecache-introspection-hack.patch')
-rw-r--r-- | debian/patches/ihash0002-libdiskfs-nodecache-introspection-hack.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/patches/ihash0002-libdiskfs-nodecache-introspection-hack.patch b/debian/patches/ihash0002-libdiskfs-nodecache-introspection-hack.patch new file mode 100644 index 00000000..d9183bf3 --- /dev/null +++ b/debian/patches/ihash0002-libdiskfs-nodecache-introspection-hack.patch @@ -0,0 +1,35 @@ +From bcb0290ae544bcd535451dc4d16b66a5952f17bf Mon Sep 17 00:00:00 2001 +From: Justus Winter <justus@gnupg.org> +Date: Thu, 28 Apr 2016 20:16:30 +0200 +Subject: [PATCH hurd 2/2] libdiskfs: nodecache introspection hack + +--- + libdiskfs/node-cache.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/libdiskfs/node-cache.c b/libdiskfs/node-cache.c +index ee7e6fd..6c65682 100644 +--- a/libdiskfs/node-cache.c ++++ b/libdiskfs/node-cache.c +@@ -60,6 +60,18 @@ static struct hurd_ihash nodecache = + hash, compare); + static pthread_rwlock_t nodecache_lock = PTHREAD_RWLOCK_INITIALIZER; + ++char * ++nodecache_hack (void) ++{ ++ static char *dbg; ++ free (dbg); ++ if (asprintf (&dbg, "(nodehash load: %db%%, effective load: %db%%)", ++ hurd_ihash_get_load (&nodecache), ++ hurd_ihash_get_effective_load (&nodecache)) < 0) ++ dbg = NULL; ++ return dbg; ++} ++ + /* Fetch inode INUM, set *NPP to the node structure; + gain one user reference and lock the node. */ + error_t __attribute__ ((weak)) +-- +2.1.4 + |