mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
indent doc.odin, makes it render nicely on the documentation site
This commit is contained in:
+26
-27
@@ -1,39 +1,38 @@
|
|||||||
/*
|
/*
|
||||||
import "core:prof/spall"
|
import "core:prof/spall"
|
||||||
|
|
||||||
spall_ctx: spall.Context
|
spall_ctx: spall.Context
|
||||||
spall_buffer: spall.Buffer
|
spall_buffer: spall.Buffer
|
||||||
|
|
||||||
foo :: proc() {
|
foo :: proc() {
|
||||||
spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure)
|
spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure)
|
||||||
}
|
}
|
||||||
|
|
||||||
main :: proc() {
|
main :: proc() {
|
||||||
spall_ctx = spall.context_create("trace_test.spall")
|
spall_ctx = spall.context_create("trace_test.spall")
|
||||||
defer spall.context_destroy(&spall_ctx)
|
defer spall.context_destroy(&spall_ctx)
|
||||||
|
|
||||||
buffer_backing := make([]u8, spall.BUFFER_DEFAULT_SIZE)
|
buffer_backing := make([]u8, spall.BUFFER_DEFAULT_SIZE)
|
||||||
spall_buffer = spall.buffer_create(buffer_backing)
|
spall_buffer = spall.buffer_create(buffer_backing)
|
||||||
defer spall.buffer_destroy(&spall_ctx, &spall_buffer)
|
defer spall.buffer_destroy(&spall_ctx, &spall_buffer)
|
||||||
|
|
||||||
spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure)
|
spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure)
|
||||||
|
|
||||||
for i := 0; i < 9001; i += 1 {
|
for i := 0; i < 9001; i += 1 {
|
||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatic profiling of every procedure:
|
// Automatic profiling of every procedure:
|
||||||
|
|
||||||
@(instrumentation_enter)
|
@(instrumentation_enter)
|
||||||
spall_enter :: proc "contextless" (proc_address, call_site_return_address: rawptr, loc: runtime.Source_Code_Location) {
|
spall_enter :: proc "contextless" (proc_address, call_site_return_address: rawptr, loc: runtime.Source_Code_Location) {
|
||||||
spall._buffer_begin(&spall_ctx, &spall_buffer, "", "", loc)
|
spall._buffer_begin(&spall_ctx, &spall_buffer, "", "", loc)
|
||||||
}
|
}
|
||||||
|
|
||||||
@(instrumentation_exit)
|
|
||||||
spall_exit :: proc "contextless" (proc_address, call_site_return_address: rawptr, loc: runtime.Source_Code_Location) {
|
|
||||||
spall._buffer_end(&spall_ctx, &spall_buffer)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@(instrumentation_exit)
|
||||||
|
spall_exit :: proc "contextless" (proc_address, call_site_return_address: rawptr, loc: runtime.Source_Code_Location) {
|
||||||
|
spall._buffer_end(&spall_ctx, &spall_buffer)
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
package spall
|
package spall
|
||||||
|
|||||||
Reference in New Issue
Block a user