mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
EvalState: Make the counters atomic
This commit is contained in:
parent
f3416913d4
commit
8d257f5510
2 changed files with 28 additions and 28 deletions
|
|
@ -892,7 +892,7 @@ Value * EvalState::getBool(bool b)
|
|||
return b ? &Value::vTrue : &Value::vFalse;
|
||||
}
|
||||
|
||||
unsigned long nrThunks = 0;
|
||||
static std::atomic<uint64_t> nrThunks = 0;
|
||||
|
||||
static inline void mkThunk(Value & v, Env & env, Expr * expr)
|
||||
{
|
||||
|
|
@ -2940,18 +2940,18 @@ void EvalState::printStatistics()
|
|||
#endif
|
||||
};
|
||||
topObj["envs"] = {
|
||||
{"number", nrEnvs},
|
||||
{"elements", nrValuesInEnvs},
|
||||
{"number", nrEnvs.load()},
|
||||
{"elements", nrValuesInEnvs.load()},
|
||||
{"bytes", bEnvs},
|
||||
};
|
||||
topObj["nrExprs"] = Expr::nrExprs;
|
||||
topObj["list"] = {
|
||||
{"elements", nrListElems},
|
||||
{"elements", nrListElems.load()},
|
||||
{"bytes", bLists},
|
||||
{"concats", nrListConcats},
|
||||
{"concats", nrListConcats.load()},
|
||||
};
|
||||
topObj["values"] = {
|
||||
{"number", nrValues},
|
||||
{"number", nrValues.load()},
|
||||
{"bytes", bValues},
|
||||
};
|
||||
topObj["symbols"] = {
|
||||
|
|
@ -2959,9 +2959,9 @@ void EvalState::printStatistics()
|
|||
{"bytes", symbols.totalSize()},
|
||||
};
|
||||
topObj["sets"] = {
|
||||
{"number", nrAttrsets},
|
||||
{"number", nrAttrsets.load()},
|
||||
{"bytes", bAttrsets},
|
||||
{"elements", nrAttrsInAttrsets},
|
||||
{"elements", nrAttrsInAttrsets.load()},
|
||||
};
|
||||
topObj["sizes"] = {
|
||||
{"Env", sizeof(Env)},
|
||||
|
|
@ -2969,13 +2969,13 @@ void EvalState::printStatistics()
|
|||
{"Bindings", sizeof(Bindings)},
|
||||
{"Attr", sizeof(Attr)},
|
||||
};
|
||||
topObj["nrOpUpdates"] = nrOpUpdates;
|
||||
topObj["nrOpUpdateValuesCopied"] = nrOpUpdateValuesCopied;
|
||||
topObj["nrThunks"] = nrThunks;
|
||||
topObj["nrAvoided"] = nrAvoided;
|
||||
topObj["nrLookups"] = nrLookups;
|
||||
topObj["nrPrimOpCalls"] = nrPrimOpCalls;
|
||||
topObj["nrFunctionCalls"] = nrFunctionCalls;
|
||||
topObj["nrOpUpdates"] = nrOpUpdates.load();
|
||||
topObj["nrOpUpdateValuesCopied"] = nrOpUpdateValuesCopied.load();
|
||||
topObj["nrThunks"] = nrThunks.load();
|
||||
topObj["nrAvoided"] = nrAvoided.load();
|
||||
topObj["nrLookups"] = nrLookups.load();
|
||||
topObj["nrPrimOpCalls"] = nrPrimOpCalls.load();
|
||||
topObj["nrFunctionCalls"] = nrFunctionCalls.load();
|
||||
#if NIX_USE_BOEHMGC
|
||||
topObj["gc"] = {
|
||||
{"heapSize", heapSize},
|
||||
|
|
|
|||
|
|
@ -961,19 +961,19 @@ private:
|
|||
*/
|
||||
std::string mkSingleDerivedPathStringRaw(const SingleDerivedPath & p);
|
||||
|
||||
unsigned long nrEnvs = 0;
|
||||
unsigned long nrValuesInEnvs = 0;
|
||||
unsigned long nrValues = 0;
|
||||
unsigned long nrListElems = 0;
|
||||
unsigned long nrLookups = 0;
|
||||
unsigned long nrAttrsets = 0;
|
||||
unsigned long nrAttrsInAttrsets = 0;
|
||||
unsigned long nrAvoided = 0;
|
||||
unsigned long nrOpUpdates = 0;
|
||||
unsigned long nrOpUpdateValuesCopied = 0;
|
||||
unsigned long nrListConcats = 0;
|
||||
unsigned long nrPrimOpCalls = 0;
|
||||
unsigned long nrFunctionCalls = 0;
|
||||
std::atomic<uint64_t> nrEnvs = 0;
|
||||
std::atomic<uint64_t> nrValuesInEnvs = 0;
|
||||
std::atomic<uint64_t> nrValues = 0;
|
||||
std::atomic<uint64_t> nrListElems = 0;
|
||||
std::atomic<uint64_t> nrLookups = 0;
|
||||
std::atomic<uint64_t> nrAttrsets = 0;
|
||||
std::atomic<uint64_t> nrAttrsInAttrsets = 0;
|
||||
std::atomic<uint64_t> nrAvoided = 0;
|
||||
std::atomic<uint64_t> nrOpUpdates = 0;
|
||||
std::atomic<uint64_t> nrOpUpdateValuesCopied = 0;
|
||||
std::atomic<uint64_t> nrListConcats = 0;
|
||||
std::atomic<uint64_t> nrPrimOpCalls = 0;
|
||||
std::atomic<uint64_t> nrFunctionCalls = 0;
|
||||
|
||||
bool countCalls;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue