]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
updating debug statements again
authorPaul Cruz <paulcruz74@fb.com>
Mon, 24 Jul 2017 21:40:23 +0000 (14:40 -0700)
committerPaul Cruz <paulcruz74@fb.com>
Mon, 24 Jul 2017 21:40:23 +0000 (14:40 -0700)
contrib/adaptive-compression/adapt.c

index 1b546f5811bd8608edacb40b01389a2b0871a53d..09884c470e2d617d7e78ca11e28da0ed0013bab3 100644 (file)
@@ -396,7 +396,7 @@ static void* compressionThread(void* arg)
     for ( ; ; ) {
         unsigned const currJobIndex = currJob % ctx->numJobs;
         jobDescription* job = &ctx->jobs[currJobIndex];
-        DEBUG(3, "compressionThread(): waiting on job ready\n");
+        DEBUG(2, "starting compression for job %u\n", currJob);
 
         {
             /* check if compression thread will have to wait */
@@ -413,7 +413,7 @@ static void* compressionThread(void* arg)
 
 
             if (willWaitForCreate || willWaitForWrite) {
-                DEBUG(2, "compression will wait for create or write\n");
+                DEBUG(2, "compression will wait for create or write on job %u\n", currJob);
 
                 pthread_mutex_lock(&ctx->createCompletion_mutex.pMutex);
                 ctx->compressWaitCreateCompletion = ctx->createCompletion;
@@ -534,7 +534,7 @@ static void* compressionThread(void* arg)
             DEBUG(3, "all jobs finished compressing\n");
             break;
         }
-
+        DEBUG(2, "finished compressing job %u\n", currJob);
         currJob++;
     }
     return arg;
@@ -567,7 +567,7 @@ static void* outputThread(void* arg)
     for ( ; ; ) {
         unsigned const currJobIndex = currJob % ctx->numJobs;
         jobDescription* job = &ctx->jobs[currJobIndex];
-        DEBUG(3, "outputThread(): waiting on job compressed\n");
+        DEBUG(2, "starting write for job %u\n", currJob);
         pthread_mutex_lock(&ctx->jobCompressed_mutex.pMutex);
         while (currJob + 1 > ctx->jobCompressedID && !ctx->threadError) {
             pthread_mutex_lock(&ctx->compressionCompletion_mutex.pMutex);
@@ -638,6 +638,7 @@ static void* outputThread(void* arg)
             pthread_mutex_unlock(&ctx->allJobsCompleted_mutex.pMutex);
             break;
         }
+        DEBUG(2, "finished writing job %u\n", currJob);
         currJob++;
 
     }
@@ -738,6 +739,7 @@ static int performCompression(adaptCCtx* ctx, FILE* const srcFile, outputThreadA
             size_t const readBlockSize = 1 << 15;
             size_t remaining = FILE_CHUNK_SIZE;
 
+            DEBUG(2, "starting creation of job %u\n", currJob);
             while (remaining != 0 && !feof(srcFile)) {
                 size_t const ret = fread(ctx->input.buffer.start + ctx->input.filled + pos, 1, readBlockSize, srcFile);
                 if (ret != readBlockSize && !feof(srcFile)) {
@@ -768,6 +770,7 @@ static int performCompression(adaptCCtx* ctx, FILE* const srcFile, outputThreadA
                     return error;
                 }
             }
+            DEBUG(2, "finished creating job %u\n", currJob);
             currJob++;
             if (feof(srcFile)) {
                 DEBUG(3, "THE STREAM OF DATA ENDED %u\n", ctx->nextJobID);