![]() |
MySQL
8.0.12
Source Code Documentation
|
Classes | |
struct | stack_t |
struct | module_t |
struct | bnode |
Macros | |
#define | PRO_FILE "dbugmon.out" /* Default output file name */ |
#define | STACKSIZ 100 /* Maximum function nesting */ |
#define | MAXPROCS 10000 /* Maximum number of function calls */ |
#define | EX_SOFTWARE 1 |
#define | EX_DATAERR 1 |
#define | EX_USAGE 1 |
#define | EX_OSERR 1 |
#define | EX_IOERR 1 |
#define | EX_OK 0 |
#define | __MERF_OO_ "%s: Malloc Failed in %s: %d\n" |
#define | MALLOC(Ptr, Num, Typ) |
#define | Malloc(Ptr, Num, Typ) |
#define | FILEOPEN(Fp, Fn, Mod) |
#define | Fileopen(Fp, Fn, Mod) |
#define | top() &fn_stack[stacktop] |
#define | usage() fprintf(DBUG_FILE, "Usage: %s [-v] [prof-file]\n", my_name) |
Functions | |
void | push (name_pos, time_entered) unsigned int name_pos |
DBUG_ENTER ("push") | |
if (++stacktop > STACKSIZ) | |
DBUG_PRINT ("push",("%d %ld", name_pos, time_entered)) | |
unsigned int | pop (name_pos, time_entered, child_time) unsigned int *name_pos |
DBUG_ENTER ("pop") | |
if (stacktop< 1) | |
DBUG_PRINT ("pop",("%d %lu %lu", *name_pos, *time_entered, *child_time)) | |
DBUG_RETURN (rtnval) | |
char * | strsave (s) char *s |
DBUG_ENTER ("strsave") | |
DBUG_PRINT ("strsave",("%s", s)) | |
if (!s||(len=strlen(s))==0) | |
MALLOC (retval,++len, char) | |
strcpy (retval, s) | |
DBUG_RETURN (retval) | |
unsigned int | add (m_name) char *m_name |
DBUG_ENTER ("add") | |
if (n_items==0) | |
while ((cmp=strcmp(m_name, modules[ind].name))) | |
DBUG_RETURN (ind) | |
void | process (inf) FILE *inf |
DBUG_ENTER ("process") | |
while (fgets(buf, BUFSIZ, inf) !=NULL) | |
while (pop(&oldpos, &oldtime, &oldchild)) | |
void | out_header (outf) FILE *outf |
if (verbose) | |
fprintf (outf, " %%time sec #call ms/call %%calls weight stack name\) | |
void | out_trailer (outf, sum_calls, sum_time) FILE *outf |
void | out_item (outf, m, called, timed) FILE *outf |
DBUG_ENTER ("out_item") | |
if (tot_time > 0) | |
if (tot_calls > 0) | |
fprintf (outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8lu %-s\, per_time, local_ftime, calls, ms_per_call, per_calls, import, stkuse, name) | |
void | out_body (outf, root, s_calls, s_time) FILE *outf |
DBUG_ENTER ("out_body") | |
DBUG_PRINT ("out_body",("%lu,%lu", *s_calls, *s_time)) | |
if (root==MAXPROCS) | |
void | output (outf) FILE *outf |
DBUG_ENTER ("output") | |
out_body (outf, 0, &sum_calls, &sum_time) | |
int | main (int argc, char **argv) |
Variables | |
static char * | my_name |
static int | verbose |
static struct stack_t | fn_stack [STACKSIZ+1] |
static unsigned int | stacktop = 0 |
static unsigned long | tot_time = 0 |
static unsigned long | tot_calls = 0 |
static unsigned long | highstack = 0 |
static unsigned long | lowstack = (ulong)~0 |
unsigned long | time_entered = temp->time |
t = &fn_stack[stacktop] | |
t | pos = name_pos |
t | time = time_entered |
t | children = 0 |
DBUG_VOID_RETURN | |
unsigned long * | child_time = temp->children |
unsigned int | rtnval |
else | |
* | name_pos = temp->pos |
static struct module_t | modules [MAXPROCS] |
static struct bnode | s_table [MAXPROCS] |
static unsigned int | n_items = 0 |
unsigned int | len |
int | cmp |
char | fn_name [64] |
unsigned long | fn_time |
unsigned long | fn_sbot |
unsigned long | fn_ssz |
unsigned long | lastuse |
unsigned long | local_time = m->m_time |
unsigned int | oldpos |
unsigned long | oldtime |
unsigned long | oldchild |
unsigned long int | sum_calls |
unsigned long int | sum_time = 0 |
struct module_t * | m |
unsigned long int * | called = calls |
unsigned long int * | timed = local_time |
unsigned int | calls = m->m_calls |
unsigned long | stkuse = m->m_stkuse |
unsigned int | import = (unsigned int)(per_time * per_calls) |
double | per_time = 0.0 |
double | per_calls = 0.0 |
double | ms_per_call = calls |
double | local_ftime = local_time |
unsigned int | root |
unsigned long int * | s_calls |
unsigned long int * | s_time |
int | optind |
char * | optarg |
#define __MERF_OO_ "%s: Malloc Failed in %s: %d\n" |
#define EX_DATAERR 1 |
#define EX_IOERR 1 |
#define EX_OK 0 |
#define EX_OSERR 1 |
#define EX_SOFTWARE 1 |
#define EX_USAGE 1 |
#define FILEOPEN | ( | Fp, | |
Fn, | |||
Mod | |||
) |
#define Fileopen | ( | Fp, | |
Fn, | |||
Mod | |||
) |
#define MALLOC | ( | Ptr, | |
Num, | |||
Typ | |||
) |
#define Malloc | ( | Ptr, | |
Num, | |||
Typ | |||
) |
#define MAXPROCS 10000 /* Maximum number of function calls */ |
#define STACKSIZ 100 /* Maximum function nesting */ |
unsigned int add | ( | m_name | ) |
DBUG_ENTER | ( | "push" | ) |
DBUG_ENTER | ( | "pop" | ) |
DBUG_ENTER | ( | "strsave" | ) |
DBUG_ENTER | ( | "add" | ) |
DBUG_ENTER | ( | "process" | ) |
DBUG_ENTER | ( | "out_item" | ) |
DBUG_ENTER | ( | "out_body" | ) |
DBUG_ENTER | ( | "output" | ) |
DBUG_PRINT | ( | "push" | , |
("%d %ld", name_pos, time_entered) | |||
) |
DBUG_PRINT | ( | "pop" | , |
("%d %lu %lu", *name_pos, *time_entered, *child_time) | |||
) |
DBUG_PRINT | ( | "strsave" | , |
("%s", s) | |||
) |
DBUG_PRINT | ( | "out_body" | , |
("%lu,%lu", *s_calls, *s_time) | |||
) |
DBUG_RETURN | ( | rtnval | ) |
DBUG_RETURN | ( | retval | ) |
DBUG_RETURN | ( | ind | ) |
fprintf | ( | outf | , |
"%8.2f%8.3f%8u%8.3f%8.2f%8u%8lu %-s\ | , | ||
per_time | , | ||
local_ftime | , | ||
calls | , | ||
ms_per_call | , | ||
per_calls | , | ||
import | , | ||
stkuse | , | ||
name | |||
) |
if | ( | ++ | stacktop, |
STACKSIZ | |||
) |
if | ( | ) |
if | ( | !s|| | len=strlen(s) = = 0 | ) |
if | ( | n_items | = = 0 | ) |
if | ( | verbose | ) |
if | ( | tot_time | , |
0 | |||
) |
if | ( | tot_calls | , |
0 | |||
) |
int main | ( | int | argc, |
char ** | argv | ||
) |
MALLOC | ( | retval | , |
++ | len, | ||
char | |||
) |
out_body | ( | outf | , |
0 | , | ||
& | sum_calls, | ||
& | sum_time | ||
) |
out_header | ( | outf | ) |
void output | ( | outf | ) |
unsigned int pop | ( | name_pos | , |
time_entered | , | ||
child_time | |||
) |
void process | ( | inf | ) |
void push | ( | name_pos | , |
time_entered | |||
) |
strcpy | ( | retval | , |
s | |||
) |
char* strsave | ( | s | ) |
while | ( | fgets(buf, BUFSIZ, inf) ! | = NULL | ) |
while | ( | pop &, &, & | oldchild | ) |
* called = calls |
unsigned int calls = m->m_calls |
* child_time = temp->children |
t children = 0 |
int cmp |
DBUG_VOID_RETURN |
else |
char fn_name[64] |
unsigned long fn_sbot |
unsigned long fn_ssz |
unsigned long fn_time |
|
static |
unsigned long lastuse |
unsigned int len |
local_ftime = local_time |
unsigned long local_time = m->m_time |
|
static |
struct module_t* m |
ms_per_call = calls |
|
static |
|
static |
* name_pos = temp->pos |
unsigned long oldchild |
unsigned int oldpos |
unsigned long oldtime |
char* optarg |
int optind |
double per_calls = 0.0 |
double per_time = 0.0 |
unsigned int pos = name_pos |
unsigned int root |
unsigned long int* s_calls |
unsigned long int * s_time |
|
static |
unsigned long stkuse = m->m_stkuse |
unsigned long int sum_calls |
unsigned long int sum_time = 0 |
t time = time_entered |
* time_entered = temp->time |
* timed = local_time |
|
static |
|
static |
|
static |