32#ifndef INTERNAL_FUNCLEVEL_H
33#define INTERNAL_FUNCLEVEL_H
35class ProfileFuncLevelTracer
41 ProfileFuncLevelTracer& operator=(
const ProfileFuncLevelTracer&);
54 UnsignedMap& operator=(
const UnsignedMap&);
72 Entry *hash[HASH_SIZE];
75 void _Insert(
unsigned at,
unsigned val,
int countAdd);
82 void Insert(
unsigned val,
int countAdd);
85 void Copy(
const UnsignedMap &src);
86 void MixIn(
const UnsignedMap &src);
128 ProfileMap& operator=(
const ProfileMap&);
195 void Enter(
unsigned addr,
unsigned esp,
unsigned ret);
249 return func.Find(addr);
254 return func.Enumerate(index);
280 FunctionMap(
const FunctionMap&);
281 FunctionMap& operator=(
const FunctionMap&);
296 Entry *hash[HASH_SIZE];
302 Function *Find(
unsigned addr);
303 void Insert(Function *
funcPtr);
304 Function *Enumerate(
int index);
308 static ProfileFuncLevelTracer *head;
311 ProfileFuncLevelTracer *next;
314 static bool shuttingDown;
335 static unsigned frameRecordMask;
338 static bool recordCaller;
344 unsigned at=(val/16)%HASH_SIZE;
345 for (Entry *e=hash[at];e;e=e->next)
351 _Insert(at,val,countAdd);
356 for (Entry *e=hash[(addr/16)%HASH_SIZE];e;e=e->next)
357 if (e->funcPtr->addr==addr)
void Append(int frame, const Profile &p)
Profile * Find(int frame)
void MixIn(int frame, const Profile &p)
simple unique unsigned/unsigned map
void Insert(unsigned val, int countAdd)
void Copy(const UnsignedMap &src)
unsigned GetCount(int index)
unsigned Enumerate(int index)
void MixIn(const UnsignedMap &src)
static ProfileFuncLevelTracer * GetFirst(void)
static int FrameStart(void)
ProfileFuncLevelTracer * GetNext(void)
unsigned Leave(unsigned esp)
~ProfileFuncLevelTracer()
static void FrameEnd(int which, int mixIndex)
Function * FindFunction(unsigned addr)
void Enter(unsigned addr, unsigned esp, unsigned ret)
static void ClearTotals(void)
Function * EnumFunction(unsigned index)
friend class ProfileCmdInterface
static void Shutdown(void)
ProfileFuncLevelTracer(void)
function entry (map address -> Function)
Function(ProfileFuncLevelTracer *tr)
ProfileMap frame
frame based profiles
unsigned funcLine
function source line
char * funcName
function name
int depth
current call depth (for recursion)
Profile glob
global profile
Profile cur[MAX_FRAME_RECORDS]
profile for current frame(s)
unsigned addr
address of this function
char * funcSource
function source
__int64 tickTotal
total time
void Copy(const Profile &src)
__int64 callCount
call count
__int64 tickPure
pure time
UnsignedMap caller
caller list
ProfileFuncLevelTracer * tracer
tracer for this profile
void MixIn(const Profile &src)