Skip to content

Commit

Permalink
crash reporter: Fix process running time and memory usage stats under…
Browse files Browse the repository at this point in the history
… linux. (bug #162)
  • Loading branch information
dscharrer committed Mar 13, 2012
1 parent 4e54df0 commit b522cd1
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 140 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Expand Up @@ -280,11 +280,12 @@ else(MSVC)
check_symbol_exists(kill "signal.h" HAVE_KILL)

check_symbol_exists(backtrace "execinfo.h" HAVE_BACKTRACE)
check_symbol_exists(backtrace_symbols "execinfo.h" HAVE_BACKTRACE_SYMBOLS)

check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
check_symbol_exists(getpid "unistd.h" HAVE_GETPID)

check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF)

if(USE_NATIVE_FS)

check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
Expand Down
2 changes: 1 addition & 1 deletion src/Configure.h.cmake
Expand Up @@ -39,7 +39,6 @@
#cmakedefine HAVE_EXECLP
#cmakedefine HAVE_WAITPID
#cmakedefine HAVE_BACKTRACE
#cmakedefine HAVE_BACKTRACE_SYMBOLS
#cmakedefine HAVE_ISATTY
#cmakedefine HAVE_WORDEXP_H
#cmakedefine HAVE_FPATHCONF
Expand All @@ -51,6 +50,7 @@
#cmakedefine HAVE_GETRUSAGE
#cmakedefine HAVE_POPEN
#cmakedefine HAVE_PCLOSE
#cmakedefine HAVE_SYSCONF

// Mac OS X features
#cmakedefine HAVE_MACH_CLOCK
Expand Down
6 changes: 0 additions & 6 deletions src/platform/crashhandler/CrashHandlerPOSIX.cpp
Expand Up @@ -233,12 +233,6 @@ void CrashHandlerPOSIX::handleCrash(int crashType, int FPECode) {

// Get current thread id
m_pCrashInfo->threadId = Thread::getCurrentThreadId();

#ifdef HAVE_GETRUSAGE
m_pCrashInfo->have_rusage = (getrusage(RUSAGE_SELF, &m_pCrashInfo->rusage) == 0);
#else
m_pCrashInfo->have_rusage = false;
#endif

if(fork()) {
while(true) {
Expand Down
10 changes: 1 addition & 9 deletions src/platform/crashhandler/CrashInfo.h
Expand Up @@ -37,10 +37,6 @@
#include "platform/Platform.h"
#include "platform/Thread.h"

#ifdef HAVE_GETRUSAGE
#include "sys/resource.h"
#endif

struct CrashInfoBase {

CrashInfoBase() : exitLock(0) { }
Expand Down Expand Up @@ -91,11 +87,7 @@ struct CrashInfoBase {

struct CrashInfo : public CrashInfoBase {
char execFullName[512];
void* backtrace[100];
bool have_rusage;
#ifdef HAVE_GETRUSAGE
struct ::rusage rusage;
#endif
void * backtrace[100];
};

#else
Expand Down

0 comments on commit b522cd1

Please sign in to comment.