core/sys/valgrind

sys_valgrind

Types

7

Client_Request

Client_Request :: enum uintptr { Running_On_Valgrind = 4097, Discard_Translations = 4098, Client_Call0 = 4353, Client_Call1 = 4354, Client_Call2 = 4355, Client_Call3 = 4356, Count_Errors = 4609, Gdb_Monitor_Command = 4610, Malloc_Like_Block = 4865, Resize_Inplace_Block = 4875, Free_Like_Block = 4866, Create_Mem_Pool = 4867, Destroy_Mem_Pool = 4868, Mem_Pool_Alloc = 4869, Mem_Pool_Free = 4870, Mem_Pool_Trim = 4871, Move_Mem_Pool = 4872, Mem_Pool_Change = 4873, Mem_Pool_Exists = 4874, Printf = 5121, Printf_Backtrace = 5122, Printf_Valist_By_Ref = 5123, Printf_Backtrace_Valist_By_Ref = 5124, Stack_Register = 5377, Stack_Deregister = 5378, Stack_Change = 5379, Load_Pdb_Debug_Info = 5633, Map_Ip_To_Src_Loc = 5889, Change_Err_Disablement = 6145, Vex_Init_For_Iri = 6401, Inner_Threads = 6402, }Source

Helgrind_Client_Request

Helgrind_Client_Request :: enum uintptr { Clean_Memory = 'H'<<24 | 'G'<<16, Set_My_pthread_t = ('H'<<25 | 'G'<<16)+256, Pthread_Join_Post, Pthread_Mutex_Init_Post, Pthread_Mutex_Destroy_Pre, Pthread_Mutex_Unlock_Pre, Pthread_Mutex_Unlock_Post, Pthread_Mutex_Lock_Pre, Pthread_Mutex_Lock_Post, Pthread_Cond_Signal_Pre, Pthread_Cond_Broadcast_Pre, Pthread_Cond_Wait_Pre, Pthread_Cond_Wait_Post, Pthread_Cond_Destroy_Pre, Pthread_Rwlock_Init_Post, Pthread_Rwlock_Destroy_Pre, Pthread_Rwlock_Lock_Pre, Pthread_Rwlock_Lock_Post, Pthread_Rwlock_Unlock_Pre, Pthread_Rwlock_Unlock_Post, Posix_Sem_Init_Post, Posix_Sem_Destroy_Pre, Posix_Sem_Post_Pre, Posix_Sem_Wait_Post, Pthread_Barrier_Init_Pre, Pthread_Barrier_Wait_Pre, Pthread_Barrier_Destroy_Pre, Pthread_Spin_Init_Or_Unlock_Pre, Pthread_Spin_Init_Or_Unlock_Post, Pthread_Spin_Lock_Pre, Pthread_Spin_Lock_Post, Pthread_Spin_Destroy_Pre, Clientreq_Unimp, Userso_Send_Pre, Userso_Recv_Post, Userso_Forget_All, Reserved2, Reserved3, Reserved4, Arange_Make_Untracked, Arange_Make_Tracked, Pthread_Barrier_Resize_Pre, Clean_Memory_Heapblock, Pthread_Cond_Init_Post, }Source

Mem_Check_Client_Request

Mem_Check_Client_Request :: enum uintptr { Make_Mem_No_Access = 'M'<<24 | 'C'<<16, Make_Mem_Undefined, Make_Mem_Defined, Discard, Check_Mem_Is_Addressable, Check_Mem_Is_Defined, Do_Leak_Check, Count_Leaks, Get_Vbits, Set_Vbits, Create_Block, Make_Mem_Defined_If_Addressable, Count_Leak_Blocks, Enable_Addr_Error_Reporting_In_Range, Disable_Addr_Error_Reporting_In_Range, }Source

Procedures

92

check_mem_is_addressable

check_mem_is_addressable :: proc(qzz: []u8) -> (uintptr)Source

Check that memory at raw_data(qzz) is addressable for len(qzz) bytes. If suitable addressibility is not established, Valgrind prints an error message and returns the address of the first offending byte. Otherwise it returns zero.

check_mem_is_defined

check_mem_is_defined :: proc(qzz: []u8) -> (uintptr)Source

Check that memory at raw_data(qzz) is addressable and defined for len(qzz) bytes. If suitable addressibility and definedness are not established, Valgrind prints an error message and returns the address of the first offending byte. Otherwise it returns zero.

create_block

create_block :: proc(qzz: []u8, desc: cstring) -> (bool)Source

Create a block-description handle. The description is an ascii string which is included in any messages pertaining to addresses within the specified memory range. Has no other effect on the properties of the memory range.

disable_error_reporting

disable_error_reporting :: proc()Source

Disable error reporting for the current thread/ It behaves in a stack-like way, meaning you can safely call this multiple times given that enable_error_reporting() is called the same number of times to re-enable the error reporting. The first call of this macro disables reporting. Subsequent calls have no effect except to increase the number of enable_error_reporting() calls needed to re-enable reporting. Child threads do not inherit this setting from their parents; they are always created with reporting enabled.

discard

discard :: proc(blk_index: uintptr) -> (bool)Source

Discard a block-description-handle. Returns true for an invalid handle, false for a valid handle.

discard_translations

discard_translations :: proc(qzz: []u8)Source

Discard translation of code in the slice qzz. Useful if you are debugging a JIT-er or some such, since it provides a way to make sure valgrind will retranslate the invalidated area.

dump_stats_at

dump_stats_at :: proc(pos_str: rawptr)Source

Dump current state of cost centres, and zero them afterwards. The argument is appended to a string stating the reason which triggered the dump. This string is written as a description field into the profile data dump.

get_vbits

get_vbits :: proc(zza: []u8, zzvbits: []u8) -> (u8)Source

Get the validity data for addresses zza and copy it into the provided zzvbits array. Return values: 0 - if not running on valgrind 1 - success 2 - [previously indicated unaligned arrays; these are now allowed] 3 - if any parts of zzsrc/zzvbits are not addressable. The metadata is not copied in cases 0, 2 or 3 so it should be impossible to segfault your system by using this call.

map_ip_to_src_loc

map_ip_to_src_loc :: proc(addr: rawptr, buf64: ^[64]u8) -> (uintptr)Source

Map a code address to a source file name and line number. buf64 must point to a 64-byte buffer in the caller's address space. The result will be dumped in there and is guaranteed to be zero terminated. If no info is found, the first byte is set to zero.

set_vbits

set_vbits :: proc(zzvbits: []u8, zza: []u8) -> (u8)Source

Set the validity data for addresses zza, copying it from the provided zzvbits array. Return values: 0 - if not running on valgrind 1 - success 2 - [previously indicated unaligned arrays; these are now allowed] 3 - if any parts of zza/zzvbits are not addressable. The metadata is not copied in cases 0, 2 or 3 so it should be impossible to segfault your system by using this call.

start_instrumentation

start_instrumentation :: proc()Source

Start full callgrind instrumentation if not already switched on. When cache simulation is done, it will flush the simulated cache; this will lead to an artificial cache warmup phase afterwards with cache misses which would not have happened in reality.

stop_instrumentation

stop_instrumentation :: proc()Source

Stop full callgrind instrumentation if not already switched off. This flushes Valgrinds translation cache, and does no additional instrumentation afterwards, which effectivly will run at the same speed as the "none" tool (ie. at minimal slowdown). Use this to bypass Callgrind aggregation for uninteresting code parts. To start Callgrind in this mode to ignore the setup phase, use the option "--instr-atstart=no".

toggle_collect

toggle_collect :: proc()Source

Toggles collection state. The collection state specifies whether the happening of events should be noted or if they are to be ignored. Events are noted by increment of counters in a cost centre.

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.