MemoryTracker Code
C library, that logs memory changes made by malloc and free.
Status: Alpha
Brought to you by:
fulopp
File | Date | Author | Commit |
---|---|---|---|
memtrack | 2014-05-21 |
![]() |
[ddcc2a] Redesign of output |
README.txt | 2014-05-21 |
![]() |
[ddcc2a] Redesign of output |
makefile | 2014-05-18 |
![]() |
[7b6054] New version, includes fixes in thread support |
README MemoryTrack is library written in C programming language. Main purpose of library is loging memory changes made by malloc and free in time. INSTALATION 1. Library needs to be included via #include "memtrack.h" statement. For using constants, "memtrackCo.h" needs to be included. 2. Initialization of the library is made at the beginning of the code (for instance main function) via function initialize(int type,int logs,char *file,int colors,int alarmtime[,int synchronize]). In case of thread support, every thread should call memtrack_initialize_thread. int type - method for time measurement to be used int logs - how or where should be logs printed out char *file - in case of file logging, name of the file where log should be saved int colors - if the output should be colored int alarmtime - period of logs printing out int synchronize - in case of thread support, options to select if synchronization by library is needed int exitState - for final output, exitstate need to be set to ON to show information at programs exit int frequency - parameter needed for time measurments using RDTSC, details about CPU frequency can be found in /proc/cpuinfo 3. Compilation is made by calling make VAR=name_of_the_file_including_library FLAGS=name_of_flags_if_needed. Compilation can be made without included make file, but MEMTRACK_THREADS should be defined for header file if thread support is required. AVAILABLE CONSTANTS type: #define MEMTRACK_TIMECAPTURE_RDTSC - measuring time using RDTSC #define MEMTRACK_TIMECAPTURE_TMS - measuring time using TMS #define MEMTRACK_TIMECAPTURE_CLOCK - measuring time using TIMESPEC logs: #define MEMTRACK_LOG_FILE #define MEMTRACK_LOG_STDOUT #define MEMTRACK_LOG_STDERR #define MEMTRACK_LOG_OFF #define MEMTRACK_LOG_EVERYTHING - print_all() function is available in this case. This option can't be selected when thread support is required. colors: #define MEMTRACK_LOG_COLORED #define MEMTRACK_LOG_PLAIN synchronize: #define MEMTRACK_THREAD_SYNC #define MEMTRACK_THREAD_ASYNC output at exit: #define MEMTRACK_THREAD_EXITON 1 #define MEMTRACK_THREAD_EXITOFF 0 NOTICE This library was made for purposes of Bachelor's Thesis.