Adding oprofile support for MCJIT.

Patch by Dmitry Stogov



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192809 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Kaylor
2013-10-16 16:32:47 +00:00
parent 8225b23c6a
commit 8a75384361
2 changed files with 72 additions and 1 deletions

View File

@@ -141,6 +141,10 @@ bool OProfileWrapper::checkForOProfileProcEntry() {
close(CmdLineFD);
ssize_t Idx = 0;
if (ExeName[0] != '/') {
BaseName = ExeName;
}
// Find the terminator for the first string
while (Idx < NumRead-1 && ExeName[Idx] != 0) {
Idx++;
@@ -159,7 +163,8 @@ bool OProfileWrapper::checkForOProfileProcEntry() {
}
// Test this to see if it is the oprofile daemon
if (BaseName != 0 && !strcmp("oprofiled", BaseName)) {
if (BaseName != 0 && (!strcmp("oprofiled", BaseName) ||
!strcmp("operf", BaseName))) {
// If it is, we're done
closedir(ProcDir);
return true;