commit 0a599c3106c28ba2a68aa534b1e46e40b2b7bd89 Author: Emil Velikov Date: Mon Feb 6 10:26:34 2017 +0000 HACK: some sha1/disk cache debug printfs diff --git a/src/compiler/glsl/tests/cache_test.c b/src/compiler/glsl/tests/cache_test.c index 8547141051..24de914f73 100644 --- a/src/compiler/glsl/tests/cache_test.c +++ b/src/compiler/glsl/tests/cache_test.c @@ -259,6 +259,10 @@ test_put_and_get(void) _mesa_sha1_compute(one_KB, 1024, one_KB_key); one_KB_key[0] = blob_key_byte_zero; + fprintf(stderr, "%s: Adjusting the first byte of one_KB_key[] the to 0xca.\n" + "This is to ensure that the correct folder is picked \"ca/\" " + "for the eviction that follows.\n", __func__); + disk_cache_put(cache, one_KB_key, one_KB, 1024); free(one_KB); diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c index 551ceebd3b..fae65fa9cd 100644 --- a/src/util/disk_cache.c +++ b/src/util/disk_cache.c @@ -552,6 +552,8 @@ disk_cache_put(struct disk_cache *cache, if (filename == NULL) goto done; + fprintf(stderr, "%s: get_cache_file() returned \"%s\".\n", __func__, filename); + fprintf(stderr, "NOTE the directory name wrt sha1[0].\n\n"); /* Write to a temporary file to allow for an atomic rename to the * final destination filename, (to prevent any readers from seeing * a partially written file). diff --git a/src/util/mesa-sha1.c b/src/util/mesa-sha1.c index e8f1bad22f..df7ca9a484 100644 --- a/src/util/mesa-sha1.c +++ b/src/util/mesa-sha1.c @@ -24,6 +24,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include "sha1/sha1.h" #include "mesa-sha1.h" @@ -66,6 +67,10 @@ _mesa_sha1_compute(const void *data, size_t size, unsigned char result[20]) ctx = _mesa_sha1_init(); _mesa_sha1_update(ctx, data, size); _mesa_sha1_final(ctx, result); + fprintf(stderr, "%s", __func__); + for (unsigned i = 0; i < 20; i++) + fprintf(stderr, " %x", result[i]); + fprintf(stderr, "\n"); } char *