ATLAS Offline Software
Loading...
Searching...
No Matches
athena Namespace Reference

Functions

const void * page_address (const void *addr)
void * page_address (void *addr)
void * next_page_address (void *addr)
int page_protect (void *addr, int prot)
template<typename T>
size_t page_protect (T *addr, int prot)
 protect page containing addr, from page boundary to addr+sizeof(T).

Variables

str __author__ = 'Wim Lavrijsen (WLavrijsen@lbl.gov)'
str __doc__ = 'For details about athena.py, run "less `which athena.py`"'
 opts = aop.parse(legacy_args=True)
list path_list = ['./'] + os.environ.get('PYTHONPATH', '').split(os.pathsep)
 file_path
 CA
 acc = pickle.load(f)
 value
 path
 python interpreter configuration --------------------------------------—
 ps1
 rename ourselfs to athena, both the prompt and the process (for top & ps)
 ps2
 libc = ctypes.cdll.LoadLibrary( ctypes_find_library('c') )
int exitcode = 0
 run_name
 _msg = log
 _athena_python_profiler
const size_t PAGESIZE = sysconf(_SC_PAGE_SIZE)

Detailed Description

date"

# defaults
export USETCMALLOC=0
export USEIMF=0
export USEEXCTRACE=0
export USEEXCABORT=1
otherargs=()
# but use tcmalloc by default if TCMALLOCDIR is defined
if [ -n "$TCMALLOCDIR" ]; then
    export USETCMALLOC=1
fi

# parse LD_PRELOAD related command line arguments
for a in "$@"
do
    case "$a" in
        --leak-check*)   USETCMALLOC=0;;
        --delete-check*) USETCMALLOC=0;;
        --stdcmalloc)    USETCMALLOC=0;;
        --tcmalloc)      USETCMALLOC=1;;
        --stdcmath)      USEIMF=0;;
        --imf)           USEIMF=1;;
        --exctrace)      USEEXCTRACE=1;;
        --no-excabort)   USEEXCABORT=0;;
        --preloadlib*)     export ATHENA_ADD_PRELOAD=${a#*=};;
        --drop-and-reload) ATHENA_DROP_RELOAD=1;;
        *)               otherargs+=("$a");;
    esac
done


# Do the actual preloading via LD_PRELOAD and save the original value
export LD_PRELOAD_ORIG=${LD_PRELOAD}
source `which athena_preload.sh `

# Now resurrect ourselves as python script
python_path=`which python`
"exec" "$python_path" "-tt" "$0" "$@";

Function Documentation

◆ next_page_address()

void * athena::next_page_address ( void * addr)

Definition at line 17 of file page_access.cxx.

17 {
18 return (void*)(((long)addr & ~(PAGESIZE-1)) + PAGESIZE);
19 }
const size_t PAGESIZE

◆ page_address() [1/2]

const void * athena::page_address ( const void * addr)

Definition at line 11 of file page_access.cxx.

11 {
12 return (const void*)((long)addr & ~(PAGESIZE-1));
13 }

◆ page_address() [2/2]

void * athena::page_address ( void * addr)

Definition at line 14 of file page_access.cxx.

14 {
15 return (void*)((long)addr & ~(PAGESIZE-1));
16 }

◆ page_protect() [1/2]

template<typename T>
size_t athena::page_protect ( T * addr,
int prot )

protect page containing addr, from page boundary to addr+sizeof(T).

Returns
amount of mem protected (0 flags an error)

Definition at line 20 of file page_access.h.

20 {
21 void* pageAddr(page_address((void*)addr));
22 size_t lProtected((long)addr-(long)pageAddr+sizeof(T));
23 int rc=mprotect(pageAddr, lProtected, prot);
24 if (rc) printf("page_protect WARNING: mprotect heap failed for address %p\n", (void*)addr);
25#ifdef DEBUG
26 else printf("page_protect DEBUG: set protection @%i for range @%lx - @%zx containing addr=%p\n",
27 prot,(long unsigned int)page_address(addr),(long unsigned int)addr+sizeof(T), (void*)addr);
28#endif
29 return (rc == 0 ? lProtected : 0);
30}
static Double_t rc
const void * page_address(const void *addr)

◆ page_protect() [2/2]

int athena::page_protect ( void * addr,
int prot )

Definition at line 21 of file page_access.cxx.

21 {
22 int rc=mprotect(page_address(addr), PAGESIZE, prot);
23 if (rc) printf("page_protect WARNING: mprotect heap failed for void *address %p\n", addr);
24#ifdef DEBUG
25 else printf("page_protect DEBUG: set protection @%i for range @%zx - @%zx containing void* addr=%p\n",
26 prot,(size_t)page_address(addr),
27 (size_t)page_address(addr) + PAGESIZE, addr);
28#endif
29 return rc;
30 }

Variable Documentation

◆ __author__

str athena.__author__ = 'Wim Lavrijsen (WLavrijsen@lbl.gov)'
private

Definition at line 80 of file athena.py.

◆ __doc__

str athena.__doc__ = 'For details about athena.py, run "less `which athena.py`"'
private

Definition at line 81 of file athena.py.

◆ _athena_python_profiler

athena._athena_python_profiler
protected

Definition at line 203 of file athena.py.

◆ _msg

athena._msg = log
protected

Definition at line 189 of file athena.py.

◆ acc

athena.acc = pickle.load(f)

Definition at line 110 of file athena.py.

◆ CA

athena.CA

Definition at line 100 of file athena.py.

◆ exitcode

int athena.exitcode = 0

Definition at line 161 of file athena.py.

◆ file_path

athena.file_path
Initial value:
1= FindFile( os.path.expanduser( os.path.expandvars(opts.scripts[0]) ),
2 path_list, os.R_OK )

Definition at line 94 of file athena.py.

◆ libc

athena.libc = ctypes.cdll.LoadLibrary( ctypes_find_library('c') )

Definition at line 141 of file athena.py.

◆ opts

athena.opts = aop.parse(legacy_args=True)

Definition at line 88 of file athena.py.

◆ PAGESIZE

const size_t athena.PAGESIZE = sysconf(_SC_PAGE_SIZE)

Definition at line 9 of file page_access.cxx.

◆ path

athena.path

python interpreter configuration --------------------------------------—

Definition at line 128 of file athena.py.

◆ path_list

list athena.path_list = ['./'] + os.environ.get('PYTHONPATH', '').split(os.pathsep)

Definition at line 93 of file athena.py.

◆ ps1

athena.ps1

rename ourselfs to athena, both the prompt and the process (for top & ps)

Definition at line 135 of file athena.py.

◆ ps2

athena.ps2

Definition at line 136 of file athena.py.

◆ run_name

athena.run_name

Definition at line 166 of file athena.py.

◆ value

athena.value

Definition at line 124 of file athena.py.