![]() |
![]() |
#include <pthread.h>
#include <unistd.h>
#include <dlfcn.h>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/resource.h>
#include <fcntl.h>
#include <ucontext.h>
#include <execinfo.h>
#include "SimpleProfiler.h"
#include "ProfParse.h"
#include <fstream>
Go to the source code of this file.
Namespaces | |
INSTR | |
Macros | |
#define | _POSIX_C_SOURCE 199309 |
#define | DODEBUG if(0) std::cerr |
#define | getBP(X) asm ( "movl %%ebp,%0" : "=m" (X) ) |
#define | getSP(X) asm ( "movl %%esp,%0" : "=m" (X) ) |
#define | MUST_BE_ZERO(fun) if((fun)!=0) { perror("function failed"); abort(); } |
Typedefs | |
typedef unsigned char | INSTR::byte |
Functions | |
void | sigFunc (int sig, siginfo_t *info, void *context) |
int | stacktrace (void *addresses[], int nmax) |
Variables | |
const int | REG_EBP = 6 |
const int | REG_EIP = 14 |
const int | REG_ESP = 7 |
const byte | INSTR::RET = 0xc3 |
#define _POSIX_C_SOURCE 199309 |
Definition at line 3 of file SimpleProfiler.cc.
#define DODEBUG if(0) std::cerr |
Definition at line 75 of file SimpleProfiler.cc.
Definition at line 69 of file SimpleProfiler.cc.
Referenced by stacktrace().
Definition at line 70 of file SimpleProfiler.cc.
Referenced by stacktrace().
#define MUST_BE_ZERO | ( | fun | ) | if((fun)!=0) { perror("function failed"); abort(); } |
Definition at line 68 of file SimpleProfiler.cc.
void sigFunc | ( | int | sig, |
siginfo_t * | info, | ||
void * | context | ||
) |
Definition at line 350 of file SimpleProfiler.cc.
References SimpleProfiler::commitFrame(), SimpleProfiler::instance(), stacktrace(), SimpleProfiler::tempStack(), and SimpleProfiler::tempStackSize().
int stacktrace | ( | void * | addresses[], |
int | nmax | ||
) |
Definition at line 224 of file SimpleProfiler.cc.
References evf::utils::eip, evf::utils::esp, getBP, getSP, if(), info, REG_EBP, and REG_EIP.
Referenced by sigFunc().
const int REG_EBP = 6 |
Definition at line 82 of file SimpleProfiler.cc.
Referenced by stacktrace().
const int REG_EIP = 14 |
Definition at line 81 of file SimpleProfiler.cc.
Referenced by stacktrace().
const int REG_ESP = 7 |
Definition at line 83 of file SimpleProfiler.cc.