1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-01 13:13:53 +00:00

Prettify code

This commit is contained in:
Igor S. Gerasimov 2025-01-03 12:37:42 +01:00
parent 9b14656c8a
commit fb9686fb28

View File

@ -95,7 +95,7 @@ module tracy
interface interface
function impl_tracy_alloc_srcloc(line, source, sourceSz, function_name, functionSz, color) & function impl_tracy_alloc_srcloc(line, source, sourceSz, function_name, functionSz, color) &
bind(C, name="___tracy_alloc_srcloc") bind(C, name="___tracy_alloc_srcloc")
import import
integer(c_int64_t) :: impl_tracy_alloc_srcloc integer(c_int64_t) :: impl_tracy_alloc_srcloc
integer(c_int32_t), intent(in), value :: line integer(c_int32_t), intent(in), value :: line
@ -106,7 +106,7 @@ module tracy
integer(c_int32_t), intent(in), value :: color integer(c_int32_t), intent(in), value :: color
end function impl_tracy_alloc_srcloc end function impl_tracy_alloc_srcloc
function impl_tracy_alloc_srcloc_name(line, source, sourceSz, function_name, functionSz, zone_name, nameSz, color) & function impl_tracy_alloc_srcloc_name(line, source, sourceSz, function_name, functionSz, zone_name, nameSz, color) &
bind(C, name="___tracy_alloc_srcloc_name") bind(C, name="___tracy_alloc_srcloc_name")
import import
integer(c_int64_t) :: impl_tracy_alloc_srcloc_name integer(c_int64_t) :: impl_tracy_alloc_srcloc_name
integer(c_int32_t), intent(in), value :: line integer(c_int32_t), intent(in), value :: line
@ -122,14 +122,14 @@ module tracy
interface interface
type(tracy_zone_context) function impl_tracy_emit_zone_begin_callstack(srcloc, depth, active) & type(tracy_zone_context) function impl_tracy_emit_zone_begin_callstack(srcloc, depth, active) &
bind(C, name="___tracy_emit_zone_begin_callstack") bind(C, name="___tracy_emit_zone_begin_callstack")
import import
type(tracy_source_location_data), intent(in) :: srcloc type(tracy_source_location_data), intent(in) :: srcloc
integer(c_int32_t), intent(in), value :: depth integer(c_int32_t), intent(in), value :: depth
integer(c_int32_t), intent(in), value :: active integer(c_int32_t), intent(in), value :: active
end function impl_tracy_emit_zone_begin_callstack end function impl_tracy_emit_zone_begin_callstack
type(tracy_zone_context) function impl_tracy_emit_zone_begin_alloc_callstack(srcloc, depth, active) & type(tracy_zone_context) function impl_tracy_emit_zone_begin_alloc_callstack(srcloc, depth, active) &
bind(C, name="___tracy_emit_zone_begin_alloc_callstack") bind(C, name="___tracy_emit_zone_begin_alloc_callstack")
import import
integer(c_int64_t), intent(in), value :: srcloc integer(c_int64_t), intent(in), value :: srcloc
integer(c_int32_t), intent(in), value :: depth integer(c_int32_t), intent(in), value :: depth
@ -183,118 +183,118 @@ module tracy
interface interface
subroutine impl_tracy_emit_memory_alloc_callstack(ptr, size, depth, secure) & subroutine impl_tracy_emit_memory_alloc_callstack(ptr, size, depth, secure) &
bind(C, name="___tracy_emit_memory_alloc_callstack") bind(C, name="___tracy_emit_memory_alloc_callstack")
import import
type(c_ptr), intent(in) :: ptr type(c_ptr), intent(in) :: ptr
integer(c_size_t), intent(in), value :: size integer(c_size_t), intent(in), value :: size
integer(c_int32_t), intent(in), value :: depth integer(c_int32_t), intent(in), value :: depth
integer(c_int32_t), intent(in), value :: secure integer(c_int32_t), intent(in), value :: secure
end subroutine impl_tracy_emit_memory_alloc_callstack end subroutine impl_tracy_emit_memory_alloc_callstack
subroutine impl_tracy_emit_memory_alloc_callstack_named(ptr, size, depth, secure, name) & subroutine impl_tracy_emit_memory_alloc_callstack_named(ptr, size, depth, secure, name) &
bind(C, name="___tracy_emit_memory_alloc_callstack_named") bind(C, name="___tracy_emit_memory_alloc_callstack_named")
import import
type(c_ptr), intent(in) :: ptr type(c_ptr), intent(in) :: ptr
integer(c_size_t), intent(in), value :: size integer(c_size_t), intent(in), value :: size
integer(c_int32_t), intent(in), value :: depth integer(c_int32_t), intent(in), value :: depth
integer(c_int32_t), intent(in), value :: secure integer(c_int32_t), intent(in), value :: secure
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
end subroutine impl_tracy_emit_memory_alloc_callstack_named end subroutine impl_tracy_emit_memory_alloc_callstack_named
subroutine impl_tracy_emit_memory_free_callstack(ptr, depth, secure) & subroutine impl_tracy_emit_memory_free_callstack(ptr, depth, secure) &
bind(C, name="___tracy_emit_memory_free_callstack") bind(C, name="___tracy_emit_memory_free_callstack")
import import
type(c_ptr), intent(in) :: ptr type(c_ptr), intent(in) :: ptr
integer(c_int32_t), intent(in), value :: depth integer(c_int32_t), intent(in), value :: depth
integer(c_int32_t), intent(in), value :: secure integer(c_int32_t), intent(in), value :: secure
end subroutine impl_tracy_emit_memory_free_callstack end subroutine impl_tracy_emit_memory_free_callstack
subroutine impl_tracy_emit_memory_free_callstack_named(ptr, depth, secure, name) & subroutine impl_tracy_emit_memory_free_callstack_named(ptr, depth, secure, name) &
bind(C, name="___tracy_emit_memory_free_callstack_named") bind(C, name="___tracy_emit_memory_free_callstack_named")
import import
type(c_ptr), intent(in) :: ptr type(c_ptr), intent(in) :: ptr
integer(c_int32_t), intent(in), value :: depth integer(c_int32_t), intent(in), value :: depth
integer(c_int32_t), intent(in), value :: secure integer(c_int32_t), intent(in), value :: secure
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
end subroutine impl_tracy_emit_memory_free_callstack_named end subroutine impl_tracy_emit_memory_free_callstack_named
subroutine impl_tracy_emit_memory_discard_callstack(name, secure, depth) & subroutine impl_tracy_emit_memory_discard_callstack(name, secure, depth) &
bind(C, name="___tracy_emit_memory_discard_callstack") bind(C, name="___tracy_emit_memory_discard_callstack")
import import
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
integer(c_int32_t), intent(in), value :: secure integer(c_int32_t), intent(in), value :: secure
integer(c_int32_t), intent(in), value :: depth integer(c_int32_t), intent(in), value :: depth
end subroutine impl_tracy_emit_memory_discard_callstack end subroutine impl_tracy_emit_memory_discard_callstack
end interface end interface
interface interface
subroutine impl_tracy_emit_message(txt, size, depth) & subroutine impl_tracy_emit_message(txt, size, depth) &
bind(C, name="___tracy_emit_message") bind(C, name="___tracy_emit_message")
import import
type(c_ptr), intent(in) :: txt type(c_ptr), intent(in) :: txt
integer(c_size_t), value :: size integer(c_size_t), value :: size
integer(c_int32_t), value :: depth integer(c_int32_t), value :: depth
end subroutine impl_tracy_emit_message end subroutine impl_tracy_emit_message
subroutine impl_tracy_emit_messageC(txt, size, color, depth) & subroutine impl_tracy_emit_messageC(txt, size, color, depth) &
bind(C, name="___tracy_emit_messageC") bind(C, name="___tracy_emit_messageC")
import import
type(c_ptr), intent(in) :: txt type(c_ptr), intent(in) :: txt
integer(c_size_t), value :: size integer(c_size_t), value :: size
integer(c_int32_t), value :: color integer(c_int32_t), value :: color
integer(c_int32_t), value :: depth integer(c_int32_t), value :: depth
end subroutine impl_tracy_emit_messageC end subroutine impl_tracy_emit_messageC
subroutine impl_tracy_emit_message_appinfo(txt, size) & subroutine impl_tracy_emit_message_appinfo(txt, size) &
bind(C, name="___tracy_emit_message_appinfo") bind(C, name="___tracy_emit_message_appinfo")
import import
type(c_ptr), intent(in) :: txt type(c_ptr), intent(in) :: txt
integer(c_size_t), value :: size integer(c_size_t), value :: size
end subroutine impl_tracy_emit_message_appinfo end subroutine impl_tracy_emit_message_appinfo
end interface end interface
interface interface
subroutine impl_tracy_emit_frame_mark(name) & subroutine impl_tracy_emit_frame_mark(name) &
bind(C, name="___tracy_emit_frame_mark") bind(C, name="___tracy_emit_frame_mark")
import import
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
end subroutine impl_tracy_emit_frame_mark end subroutine impl_tracy_emit_frame_mark
subroutine impl_tracy_emit_frame_mark_start(name) & subroutine impl_tracy_emit_frame_mark_start(name) &
bind(C, name="___tracy_emit_frame_mark_start") bind(C, name="___tracy_emit_frame_mark_start")
import import
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
end subroutine impl_tracy_emit_frame_mark_start end subroutine impl_tracy_emit_frame_mark_start
subroutine impl_tracy_emit_frame_mark_end(name) & subroutine impl_tracy_emit_frame_mark_end(name) &
bind(C, name="___tracy_emit_frame_mark_end") bind(C, name="___tracy_emit_frame_mark_end")
import import
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
end subroutine impl_tracy_emit_frame_mark_end end subroutine impl_tracy_emit_frame_mark_end
end interface end interface
interface interface
subroutine impl_tracy_emit_frame_image(image, w, h, offset, flip) & subroutine impl_tracy_emit_frame_image(image, w, h, offset, flip) &
bind(C, name="___tracy_emit_frame_image") bind(C, name="___tracy_emit_frame_image")
import import
type(c_ptr), intent(in) :: image type(c_ptr), intent(in) :: image
integer(c_int16_t), intent(in), value :: w integer(c_int16_t), intent(in), value :: w
integer(c_int16_t), intent(in), value :: h integer(c_int16_t), intent(in), value :: h
integer(c_int8_t), intent(in), value :: offset integer(c_int8_t), intent(in), value :: offset
integer(c_int32_t), intent(in), value :: flip integer(c_int32_t), intent(in), value :: flip
end subroutine impl_tracy_emit_frame_image end subroutine impl_tracy_emit_frame_image
end interface end interface
interface interface
subroutine impl_tracy_emit_plot_int8(name, val) & subroutine impl_tracy_emit_plot_int8(name, val) &
bind(C, name="___tracy_emit_plot_int") bind(C, name="___tracy_emit_plot_int")
import import
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
integer(c_int64_t), value :: val integer(c_int64_t), value :: val
end subroutine impl_tracy_emit_plot_int8 end subroutine impl_tracy_emit_plot_int8
subroutine impl_tracy_emit_plot_real4(name, val) & subroutine impl_tracy_emit_plot_real4(name, val) &
bind(C, name="___tracy_emit_plot_float") bind(C, name="___tracy_emit_plot_float")
import import
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
real(c_float), value :: val real(c_float), value :: val
end subroutine impl_tracy_emit_plot_real4 end subroutine impl_tracy_emit_plot_real4
subroutine impl_tracy_emit_plot_real8(name, val) & subroutine impl_tracy_emit_plot_real8(name, val) &
bind(C, name="___tracy_emit_plot") bind(C, name="___tracy_emit_plot")
import import
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
real(c_double), value :: val real(c_double), value :: val
end subroutine impl_tracy_emit_plot_real8 end subroutine impl_tracy_emit_plot_real8
end interface end interface
interface tracy_plot interface tracy_plot
@ -302,25 +302,25 @@ module tracy
end interface tracy_plot end interface tracy_plot
interface interface
subroutine impl_tracy_emit_plot_config(name, type, step, fill, color) & subroutine impl_tracy_emit_plot_config(name, type, step, fill, color) &
bind(C, name="___tracy_emit_plot_config") bind(C, name="___tracy_emit_plot_config")
import import
type(c_ptr), intent(in) :: name type(c_ptr), intent(in) :: name
integer(c_int32_t), intent(in), value :: type integer(c_int32_t), intent(in), value :: type
integer(c_int32_t), intent(in), value :: step integer(c_int32_t), intent(in), value :: step
integer(c_int32_t), intent(in), value :: fill integer(c_int32_t), intent(in), value :: fill
integer(c_int32_t), intent(in), value :: color integer(c_int32_t), intent(in), value :: color
end subroutine impl_tracy_emit_plot_config end subroutine impl_tracy_emit_plot_config
end interface end interface
#ifdef TRACY_FIBERS #ifdef TRACY_FIBERS
interface interface
subroutine impl_tracy_fiber_enter(fiber_name) & subroutine impl_tracy_fiber_enter(fiber_name) &
bind(C, name="___tracy_fiber_enter") bind(C, name="___tracy_fiber_enter")
import import
type(c_ptr), intent(in) :: fiber_name type(c_ptr), intent(in) :: fiber_name
end subroutine impl_tracy_fiber_enter end subroutine impl_tracy_fiber_enter
subroutine tracy_fiber_leave() & subroutine tracy_fiber_leave() &
bind(C, name="___tracy_fiber_leave") & bind(C, name="___tracy_fiber_leave")
end subroutine tracy_fiber_leave end subroutine tracy_fiber_leave
end interface end interface
#endif #endif
@ -346,8 +346,8 @@ contains
subroutine tracy_set_thread_name(name) subroutine tracy_set_thread_name(name)
character(kind=c_char, len=*), intent(in) :: name character(kind=c_char, len=*), intent(in) :: name
character(kind=c_char, len=:), allocatable, target :: alloc_name character(kind=c_char, len=:), allocatable, target :: alloc_name
allocate(character(kind=c_char, len=len(name) + 1) :: alloc_name) allocate (character(kind=c_char, len=len(name) + 1) :: alloc_name)
alloc_name = name // c_null_char alloc_name = name//c_null_char
call impl_tracy_set_thread_name(c_loc(alloc_name)) call impl_tracy_set_thread_name(c_loc(alloc_name))
end subroutine tracy_set_thread_name end subroutine tracy_set_thread_name
@ -367,16 +367,16 @@ contains
if (present(color)) color_ = color if (present(color)) color_ = color
if (present(zone_name)) then if (present(zone_name)) then
tracy_alloc_srcloc = impl_tracy_alloc_srcloc_name(line, & tracy_alloc_srcloc = impl_tracy_alloc_srcloc_name(line, &
c_loc(source), len(source, kind=c_size_t), & c_loc(source), len(source, kind=c_size_t), &
c_loc(function_name), len(function_name, kind=c_size_t), & c_loc(function_name), len(function_name, kind=c_size_t), &
c_loc(zone_name), len(zone_name, kind=c_size_t), & c_loc(zone_name), len(zone_name, kind=c_size_t), &
color_) color_)
else else
tracy_alloc_srcloc = impl_tracy_alloc_srcloc(line, & tracy_alloc_srcloc = impl_tracy_alloc_srcloc(line, &
c_loc(source), len(source, kind=c_size_t), & c_loc(source), len(source, kind=c_size_t), &
c_loc(function_name), len(function_name, kind=c_size_t), & c_loc(function_name), len(function_name, kind=c_size_t), &
color_) color_)
endif end if
end function tracy_alloc_srcloc end function tracy_alloc_srcloc
type(tracy_zone_context) function tracy_emit_zone_begin_id(srcloc, depth, active) type(tracy_zone_context) function tracy_emit_zone_begin_id(srcloc, depth, active)