//===----------------------------------------------------------------------===//
#include "llvm/ExecutionEngine/OProfileWrapper.h"
-
-#define DEBUG_TYPE "oprofile-wrapper"
+#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/MutexGuard.h"
-#include "llvm/ADT/SmallString.h"
-
-#include <sstream>
+#include "llvm/Support/raw_ostream.h"
#include <cstring>
-#include <stddef.h>
#include <dirent.h>
-#include <sys/stat.h>
#include <fcntl.h>
+#include <sstream>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#define DEBUG_TYPE "oprofile-wrapper"
namespace {
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++;
}
// 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;