Skip to content

Commit

Permalink
disable pintool for children of forks
Browse files Browse the repository at this point in the history
plavin committed Apr 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 86cf031 commit 40c140f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sst/elements/ariel/frontend/pin3/fesimple.cc
Original file line number Diff line number Diff line change
@@ -1836,6 +1836,11 @@ VOID InstrumentRoutine(RTN rtn, VOID* args)
}
}

void fork_disable_child_output(THREADID threadid, const CONTEXT *ctx, VOID *v) {
fprintf(stderr, "Warning: fesimple cannot trace forked processes. Disabling Pin for pid %d\n", getpid());
PIN_Detach();
}

void loadFastMemLocations()
{
std::ifstream infile(UseMallocMap.Value().c_str());
@@ -1998,6 +2003,9 @@ int main(int argc, char *argv[])
}
}

// Fork callback
PIN_AddForkFunction(FPOINT_AFTER_IN_CHILD, (FORK_CALLBACK) fork_disable_child_output, NULL);

fprintf(stderr, "ARIEL: Starting program.\n");
fflush(stdout);
PIN_StartProgram();

0 comments on commit 40c140f

Please sign in to comment.