NAME

PAPI_get_executable_info - get the executable’s address space info

CONTENTS

Synopsis
Description
Arguments
Return Values
Errors
Example
Author
Bugs
See Also

SYNOPSIS

C Interface

#include <papi.h> 

const PAPI_exe_info_t *PAPI_get_executable_info(void); 

Fortran Interface

#include fpapi.h 

PAPIF_get_exe_info(C_STRING fullname, C_STRING name,  
           C_INT  text_start,  C_INT  text_end, 
           C_INT  data_start,  C_INT  data_end, 
           C_INT  bss_start,  C_INT  bss_end, 
           C_STRING  lib_preload_env, C_INT  check)

DESCRIPTION

In C, this function returns a pointer to a structure containing information about the current program. In Fortran, the fields of the structure are returned explicitly.

ARGUMENTS

The following arguments are implicit in the structure returned by the C function, or explicitly returned by Fortran.

fullname -- fully qualified path + filename of the executable

name -- filename of the executable with no path information

text_start, text_end -- Start and End addresses of program text segment

data_start, data_end -- Start and End addresses of program data segment

bss_start, bss_end -- Start and End addresses of program bss segment

lib_preload_env -- environment variable for preloading libraries

RETURN VALUES

On success, the C function returns a non-NULL pointer, and the Fortran function returns PAPI_OK.
On error, NULL is returned by the C function, and a non-zero error code is returned by the Fortran function.

ERRORS

PAPI_EINVAL
  One or more of the arguments is invalid.

EXAMPLE


const PAPI_exe_info_t *prginfo = NULL;
        
if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT)
  exit(1);

if ((prginfo = PAPI_get_executable_info()) == NULL) exit(1);

printf("Start of user program is at %p\n",prginfo->text_start); printf("End of user program is at %p\n",prginfo->text_end);

AUTHOR

Philip J. Mucci <mucci@cs.utk.edu>

BUGS

Only the text_start and text_end fields are filled on every architecture.

SEE ALSO

PAPI_library_init (3), PAPI_get_opt (3),
The PAPI Web Site: http://icl.cs.utk.edu/projects/papi


PAPI Function Reference PAPI_get_executable_info (3) December, 2001

  Innovative Computing Laboratory
2001 R&D Winner  
Contact PAPI: papi@cs.utk.edu Computer Science Department
  University of Tennessee