Files
SectrPrototype/code2/grime/profiler.odin

31 lines
1.0 KiB
Odin

package grime
import "core:prof/spall"
/*
This is just a snippet file, do not use directly.
*/
set_profiler_module_context :: #force_inline proc "contextless" (profiler : ^Spall_Context) {
sync_store(& grime_memory.spall_context, profiler, .Release)
}
set_profiler_thread_buffer :: #force_inline proc "contextless" (buffer: ^Spall_Buffer) {
sync_store(& grime_thread.spall_buffer, buffer, .Release)
}
DISABLE_PROFILING :: true
@(deferred_none = profile_end, disabled = DISABLE_PROFILING)
profile :: #force_inline proc "contextless" ( name : string, loc := #caller_location ) {
spall._buffer_begin( grime_memory.spall_context, grime_thread.spall_buffer, name, "", loc )
}
@(disabled = DISABLE_PROFILING)
profile_begin :: #force_inline proc "contextless" ( name : string, loc := #caller_location ) {
spall._buffer_begin( grime_memory.spall_context, grime_thread.spall_buffer, name, "", loc )
}
@(disabled = DISABLE_PROFILING)
profile_end :: #force_inline proc "contextless" () {
spall._buffer_end( grime_memory.spall_context, grime_thread.spall_buffer)
}