Przeglądaj źródła

HPCC-17476 Bad code in jhtree memory tracing

Silly stats not worth collecting.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 lat temu
rodzic
commit
3e03d02684

+ 0 - 1
roxie/ccd/ccdmain.cpp

@@ -745,7 +745,6 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
         linuxYield = topology->getPropBool("@linuxYield", false);
         traceSmartStepping = topology->getPropBool("@traceSmartStepping", false);
         useMemoryMappedIndexes = topology->getPropBool("@useMemoryMappedIndexes", false);
-        traceJHtreeAllocations = topology->getPropBool("@traceJHtreeAllocations", false);
         flushJHtreeCacheOnOOM = topology->getPropBool("@flushJHtreeCacheOnOOM", true);
         fastLaneQueue = topology->getPropBool("@fastLaneQueue", true);
         udpOutQsPriority = topology->getPropInt("@udpOutQsPriority", 0);

+ 0 - 5
roxie/ccd/ccdstate.cpp

@@ -2754,11 +2754,6 @@ private:
                 traceServerSideCache = control->getPropBool("@val", true);
                 topology->setPropInt("@traceServerSideCache", traceServerSideCache);
             }
-            else if (stricmp(queryName, "control:traceJHtreeAllocations")==0)
-            {
-                traceJHtreeAllocations = control->getPropBool("@val", true);
-                topology->setPropInt("@traceJHtreeAllocations", traceJHtreeAllocations);
-            }
             else if (stricmp(queryName, "control:traceSmartStepping")==0)
             {
                 traceSmartStepping = control->getPropBool("@val", true);

+ 0 - 34
system/jhtree/ctfile.cpp

@@ -478,17 +478,6 @@ CJHTreeNode::~CJHTreeNode()
 void CJHTreeNode::releaseMem(void *togo, size32_t len)
 {
     free(togo);
-    unsigned __int64 _totalAllocatedCurrent;
-    unsigned _countAllocationsCurrent;
-    {
-        SpinBlock b(spin);
-        totalAllocatedCurrent -= len;
-        countAllocationsCurrent--;
-        _totalAllocatedCurrent = totalAllocatedCurrent;
-        _countAllocationsCurrent = countAllocationsCurrent;
-    }
-    if (traceJHtreeAllocations)
-        DBGLOG("JHTREE memory usage: Released  %d - %" I64F "d currently allocated in %d allocations", len, _totalAllocatedCurrent, _countAllocationsCurrent);
 }
 
 void *CJHTreeNode::allocMem(size32_t len)
@@ -506,32 +495,9 @@ void *CJHTreeNode::allocMem(size32_t len)
         if (!ret)
             throw E.getClear();
     }
-    unsigned __int64 _totalAllocatedCurrent;
-    unsigned __int64 _totalAllocatedEver;
-    unsigned _countAllocationsCurrent;
-    unsigned _countAllocationsEver;
-    {
-        SpinBlock b(spin);
-        totalAllocatedCurrent += len;
-        totalAllocatedEver += len;
-        countAllocationsCurrent ++;
-        countAllocationsEver ++;
-        _totalAllocatedCurrent = totalAllocatedCurrent;
-        _totalAllocatedEver = totalAllocatedEver;
-        _countAllocationsCurrent = countAllocationsCurrent;
-        _countAllocationsEver = countAllocationsEver;
-    }
-    if (traceJHtreeAllocations)
-        DBGLOG("JHTREE memory usage: Allocated %d - %" I64F "d currently allocated in %d allocations", len, _totalAllocatedCurrent, _countAllocationsCurrent);
     return ret;
 }
 
-unsigned __int64 CJHTreeNode::totalAllocatedCurrent;
-unsigned __int64 CJHTreeNode::totalAllocatedEver;
-unsigned CJHTreeNode::countAllocationsCurrent;
-unsigned CJHTreeNode::countAllocationsEver;
-SpinLock CJHTreeNode::spin; // MORE: Could replace with atomic operations, but since 4 of them it may be less efficient when uncontested
-
 char *CJHTreeNode::expandKeys(void *src,unsigned keylength,size32_t &retsize, bool rowcompression)
 {
     Owned<IExpander> exp = rowcompression?createRDiffExpander():createLZWExpander(true);

+ 0 - 6
system/jhtree/ctfile.hpp

@@ -183,12 +183,6 @@ protected:
     size32_t keyRecLen;
     char *keyBuf;
 
-    static SpinLock spin;
-    static unsigned __int64 totalAllocatedCurrent;
-    static unsigned __int64 totalAllocatedEver;
-    static unsigned countAllocationsCurrent;
-    static unsigned countAllocationsEver;
-
     void unpack(const void *node, bool needCopy);
     unsigned __int64 firstSequence;
     size32_t expandedSize;

+ 0 - 1
system/jhtree/jhtree.cpp

@@ -68,7 +68,6 @@ bool useMemoryMappedIndexes = false;
 bool logExcessiveSeeks = false;
 bool linuxYield = false;
 bool traceSmartStepping = false;
-bool traceJHtreeAllocations = false;
 bool flushJHtreeCacheOnOOM = true;
 
 MODULE_INIT(INIT_PRIORITY_JHTREE_JHTREE)

+ 0 - 1
system/jhtree/jhtree.hpp

@@ -138,7 +138,6 @@ extern jhtree_decl RelaxedAtomic<unsigned> preloadCacheAdds;
 extern jhtree_decl bool logExcessiveSeeks;
 extern jhtree_decl bool linuxYield;
 extern jhtree_decl bool traceSmartStepping;
-extern jhtree_decl bool traceJHtreeAllocations;
 extern jhtree_decl bool flushJHtreeCacheOnOOM;
 extern jhtree_decl bool useMemoryMappedIndexes;
 extern jhtree_decl void clearNodeStats();