Add callgrind client requests
This commit is contained in:
17
Internal.h
17
Internal.h
@@ -18,6 +18,11 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#if __has_include(<valgrind/callgrind.h>)
|
||||||
|
#define CALLGRIND
|
||||||
|
#include <valgrind/callgrind.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DEBUG_VERBOSE 0
|
#define DEBUG_VERBOSE 0
|
||||||
|
|
||||||
[[nodiscard]] inline auto
|
[[nodiscard]] inline auto
|
||||||
@@ -556,7 +561,13 @@ template <class ConflictSetImpl> struct TestDriver {
|
|||||||
assert(iter == keys.end());
|
assert(iter == keys.end());
|
||||||
assert(i == numPointWrites + numRangeWrites);
|
assert(i == numPointWrites + numRangeWrites);
|
||||||
|
|
||||||
|
#ifdef CALLGRIND
|
||||||
|
CALLGRIND_START_INSTRUMENTATION;
|
||||||
|
#endif
|
||||||
cs.addWrites(writes, numPointWrites + numRangeWrites);
|
cs.addWrites(writes, numPointWrites + numRangeWrites);
|
||||||
|
#ifdef CALLGRIND
|
||||||
|
CALLGRIND_STOP_INSTRUMENTATION;
|
||||||
|
#endif
|
||||||
refImpl.addWrites(writes, numPointWrites + numRangeWrites);
|
refImpl.addWrites(writes, numPointWrites + numRangeWrites);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -618,7 +629,13 @@ template <class ConflictSetImpl> struct TestDriver {
|
|||||||
new (arena) ConflictSet::Result[numPointReads + numRangeReads];
|
new (arena) ConflictSet::Result[numPointReads + numRangeReads];
|
||||||
auto *results2 =
|
auto *results2 =
|
||||||
new (arena) ConflictSet::Result[numPointReads + numRangeReads];
|
new (arena) ConflictSet::Result[numPointReads + numRangeReads];
|
||||||
|
#ifdef CALLGRIND
|
||||||
|
CALLGRIND_START_INSTRUMENTATION;
|
||||||
|
#endif
|
||||||
cs.check(reads, results1, numPointReads + numRangeReads);
|
cs.check(reads, results1, numPointReads + numRangeReads);
|
||||||
|
#ifdef CALLGRIND
|
||||||
|
CALLGRIND_STOP_INSTRUMENTATION;
|
||||||
|
#endif
|
||||||
refImpl.check(reads, results2, numPointReads + numRangeReads);
|
refImpl.check(reads, results2, numPointReads + numRangeReads);
|
||||||
for (int i = 0; i < numPointReads + numRangeReads; ++i) {
|
for (int i = 0; i < numPointReads + numRangeReads; ++i) {
|
||||||
if (results1[i] != results2[i]) {
|
if (results1[i] != results2[i]) {
|
||||||
|
Reference in New Issue
Block a user