-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinterProcMode.cpp
52 lines (36 loc) · 1.06 KB
/
interProcMode.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "config.h"
#include "debug.h"
#include "ihpp.h"
#include "benchmark.h"
#include "tracingFuncs.h"
void interModeBlockTrace(BasicBlock *bb)
{
ThreadContext *ctx = globalSharedContext->getThreadCtx(PIN_ThreadUid());
#if EMPTY_ANALYSIS
return;
#endif
if (bb->functionAddr() == ctx->startFuncAddr)
ctx->haveToTrace=true;
if (!ctx->haveToTrace)
return;
if (bb->functionAddr() == ctx->stopFuncAddr)
ctx->haveToTrace=false;
bb->incSimpleCounter();
if (!globalSharedContext->options.rollLoops) {
traceObject(bb, ctx, ctx->treeTop, ctx->treeBottom);
return;
}
//rollLoops ON
ihppNode *parent = ctx->treeTop ? ctx->treeTop->getParentRef() : nullptr;
while (parent) {
if (parent->getKey() == bb->getKey()) {
ctx->treeTop = parent;
ctx->treeBottom = nullptr;
ctx->treeTop->incCounter();
return;
}
parent = parent->getParentRef();
}
//parent NOT found
traceObject(bb, ctx, ctx->treeTop, ctx->treeBottom);
}