osprey/ir_tools/ir_prof.c File Reference

#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <libgen.h>
#include <sys/stat.h>
#include "ir_prof.h"

Include dependency graph for ir_prof.c:

Go to the source code of this file.

Data Types

type  HASH_STRUCT

Defines

#define FALSE   0
#define TRUE   1
#define NUM_COUNTS_ENTRY   4097
#define SAMPLE_SIZE   15
#define DEF_STRSIZE   3
#define DEF_NBUCKETS   (NUM_COUNTS_ENTRY-1)
#define DEF_NSYM   (NUM_COUNTS_ENTRY-1)
#define UNDEF   -1
#define PR_ASSERT(EX, p)   if (!(EX)) ir_prof_error(ER_FATAL, p, "Ir_pr")
#define MALLOC(nbytes)   malloc((size_t)(nbytes))
#define REALLOC(ptr, size)   realloc((void *)(ptr), (size_t)(size))

Functions/Subroutines

void hashinit (void)
voidatexit ()
int file_exists (char *path)
static void usage (char *progname)
void ir_prof_dump (void)
void ir_prof_error (int type, char *fmt, char *fname)
void ir_prof_start (void)
void ir_prof_dump_counts (int fd_counts)
void cgt_fini (void)
void ir_prof_init (void)
void expand_htab ()
void expand_strtab (int i)
int enter_str (char *name)
static void hash_entry (ADDR caller, ADDR callee, char *caller_name, char *callee_name)
void __profile_call (ADDR caller, ADDR callee, char *caller_name, char *callee_name)

Variables

static char * thisfile = __FILE__
static int fd_counts
static counts_entrycounts_array
static long num_counts
static long sizeof_counts_array = NUM_COUNTS_ENTRY
static HASH_STRUCT h_tab


Define Documentation

#define DEF_NBUCKETS   (NUM_COUNTS_ENTRY-1)

Definition at line 72 of file ir_prof.c.

Referenced by hashinit().

#define DEF_NSYM   (NUM_COUNTS_ENTRY-1)

Definition at line 73 of file ir_prof.c.

Referenced by hashinit().

#define DEF_STRSIZE   3

Definition at line 71 of file ir_prof.c.

Referenced by hashinit().

#define FALSE   0

Definition at line 51 of file ir_prof.c.

#define MALLOC ( nbytes   )     malloc((size_t)(nbytes))

Definition at line 107 of file ir_prof.c.

#define NUM_COUNTS_ENTRY   4097

Definition at line 53 of file ir_prof.c.

Referenced by ir_prof_start().

#define PR_ASSERT ( EX,
p   )     if (!(EX)) ir_prof_error(ER_FATAL, p, "Ir_pr")

Definition at line 106 of file ir_prof.c.

Referenced by __profile_call(), ir_prof_dump_counts(), and ir_prof_start().

#define REALLOC ( ptr,
size   )     realloc((void *)(ptr), (size_t)(size))

Definition at line 108 of file ir_prof.c.

#define SAMPLE_SIZE   15

Definition at line 54 of file ir_prof.c.

Referenced by ir_prof_dump().

#define TRUE   1

Definition at line 52 of file ir_prof.c.

#define UNDEF   -1

Definition at line 74 of file ir_prof.c.


Function Documentation

void __profile_call ( ADDR  caller,
ADDR  callee,
char *  caller_name,
char *  callee_name 
)

Definition at line 375 of file ir_prof.c.

References hash_entry(), ir_prof_start(), num_counts, PR_ASSERT, REALLOC, and sizeof_counts_array.

void* atexit (  ) 

void cgt_fini ( void   ) 

int enter_str ( char *  name  ) 

Definition at line 291 of file ir_prof.c.

References expand_strtab(), i, memcpy, HASH_STRUCT::nchars, p, ret, strlen(), HASH_STRUCT::strsize, and HASH_STRUCT::strtab.

Referenced by hash_entry().

void expand_htab (  ) 

Definition at line 265 of file ir_prof.c.

References bzero(), HASH_STRUCT::chain, ER_FATAL, ir_prof_error(), HASH_STRUCT::nsym, and realloc.

Referenced by hash_entry().

void expand_strtab ( int  i  ) 

Definition at line 279 of file ir_prof.c.

References ER_FATAL, ir_prof_error(), realloc, HASH_STRUCT::strsize, and HASH_STRUCT::strtab.

Referenced by enter_str().

int file_exists ( char *  path  ) 

Definition at line 84 of file ir_prof.c.

References ENOENT, ENOTDIR, errno, FALSE, stat, and TRUE.

static void hash_entry ( ADDR  caller,
ADDR  callee,
char *  caller_name,
char *  callee_name 
) [static]

void hashinit ( void   ) 

void ir_prof_dump ( void   ) 

void ir_prof_dump_counts ( int  fd_counts  ) 

void ir_prof_error ( int  type,
char *  fmt,
char *  fname 
)

void ir_prof_init ( void   ) 

Definition at line 228 of file ir_prof.c.

References atexit(), cgt_fini(), num_counts, and void.

void ir_prof_start ( void   ) 

Definition at line 146 of file ir_prof.c.

References hashinit(), MALLOC, num_counts, NUM_COUNTS_ENTRY, and PR_ASSERT.

Referenced by __profile_call().

static void usage ( char *  progname  )  [static]

Definition at line 97 of file ir_prof.c.

References exit(), and fprintf().


Variable Documentation

Definition at line 56 of file ir_prof.c.

int fd_counts [static]

Definition at line 49 of file ir_prof.c.

Referenced by cgt_fini(), close_counts_file(), and open_counts_file().

HASH_STRUCT h_tab [static]

Definition at line 75 of file ir_prof.c.

long num_counts [static]

long sizeof_counts_array = NUM_COUNTS_ENTRY [static]

Definition at line 58 of file ir_prof.c.

Referenced by __profile_call().

char* thisfile = __FILE__ [static]

Definition at line 46 of file ir_prof.c.


Generated on Wed Apr 8 15:10:56 2009 for Open64 by  doxygen 1.5.6