Index: trunk/tools/czartool/CzarDb.pm
===================================================================
--- trunk/tools/czartool/CzarDb.pm	(revision 30397)
+++ trunk/tools/czartool/CzarDb.pm	(revision 30913)
@@ -629,5 +629,6 @@
     my ($derivProcessed, $derivPending, $derivFaults);
     my $timestamp = undef;
-    
+    my $positiveJump = 0;
+
     $linearProcessed = 0;
     my $someData = 0;
@@ -635,15 +636,4 @@
         my ($thisTimestamp, $thisPending, $thisFaults, $thisProcessed) = @row;
 
-        # get linear values
-        if ($showCleanup) {
-        
-            $linearProcessed = $thisProcessed - $minProcessed;
-        }
-        elsif($lastProcessed != -1 && $thisProcessed > $lastProcessed) {
-            
-            $linearProcessed = $linearProcessed + ($thisProcessed - $lastProcessed);
-        }
-        $linearPending = $thisPending;
-        $linearFaults = $thisFaults;
 
         # get first derivative values
@@ -660,4 +650,14 @@
         #    $derivPending = abs($thisPending - $lastPending)/$timeDiff;    
         #    $derivFaults = abs($thisFaults - $lastFaults)/$timeDiff;    
+
+            # look for large positive jumps in processed, most likely a label added, and store value to subtract from linear value below
+            if ($derivProcessed > 0.3) {
+
+                $positiveJump = $thisProcessed - $lastProcessed;
+                #print "$derivProcessed at $thisTimestamp   $positiveJump\n";
+        }
+            else {
+            $positiveJump = 0;
+            }
         }
         else {
@@ -667,4 +667,16 @@
             $derivFaults = 0;
         }
+
+        # get linear values
+        if ($showCleanup) {
+        
+            $linearProcessed = $thisProcessed - $minProcessed;
+        }
+        elsif($lastProcessed != -1 && $thisProcessed > $lastProcessed) {
+            
+            $linearProcessed = $linearProcessed + ($thisProcessed - $lastProcessed) - $positiveJump;
+        }
+        $linearPending = $thisPending;
+        $linearFaults = $thisFaults;
 
         # get log values
