Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Jun 20, 2024
1 parent ee30702 commit a5abe67
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 72 deletions.
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style = "blue"
14 changes: 8 additions & 6 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function version()

FFI.Extrae_get_version(major, minor, rev)

VersionNumber(major[], minor[], rev[])
return VersionNumber(major[], minor[], rev[])
end

"""
Expand All @@ -29,7 +29,6 @@ No major problems should occur if the library is initialized twice, only a warni
"""
init() = FFI.Extrae_init()


"""
isinit()
Expand All @@ -44,7 +43,7 @@ Finalize the tracing library and dumps the intermediate tracing buffers onto dis
"""
function finish()
FFI.Extrae_fini()
Libc.flush_cstdio()
return Libc.flush_cstdio()
end

"""
Expand Down Expand Up @@ -87,7 +86,9 @@ function emit(::Event{T,V}; counters::Bool=false) where {T,V}
end
end

emit(events::Vector{Event}; counters::Bool=false) = foreach(e -> event(e; counters=counters), events)
function emit(events::Vector{Event}; counters::Bool=false)
return foreach(e -> event(e; counters=counters), events)
end

"""
previous_hwc_set()
Expand All @@ -108,7 +109,8 @@ next_hwc_set() = FFI.Extrae_next_hwc_set()
Select the range of tasks (not threads!) to store information from in the tracefile.
"""
set_tracing_tasks(interval::UnitRange{UInt32}) = FFI.Extrae_set_tracing_tasks(interval.start::UInt32, interval.stop::UInt32)
set_tracing_tasks(interval::UnitRange{UInt32}) =
FFI.Extrae_set_tracing_tasks(interval.start::UInt32, interval.stop::UInt32)

"""
setoption(options)
Expand Down Expand Up @@ -164,4 +166,4 @@ In order to gather performance counters during the execution of these calls, the
Note that you need to compile your application binary with debugging information (typically the `-g` compiler flag) in order to translate the captured addresses into valuable information such as function name, file name and line number.
"""
user_function(enter) = FFI.Extrae_user_function(enter)
user_function(enter) = FFI.Extrae_user_function(enter)
17 changes: 16 additions & 1 deletion src/Extrae.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@ include("API.jl")
include("Macros.jl")

export Event, typecode, valuecode, description
export version, init, isinit, finish, flush, instrumentation, emit, register, previous_hwc_set, next_hwc_set, set_tracing_tasks, setoption, network_counters, network_routes, user_function
export version,
init,
isinit,
finish,
flush,
instrumentation,
emit,
register,
previous_hwc_set,
next_hwc_set,
set_tracing_tasks,
setoption,
network_counters,
network_routes,
user_function

function __init__()
get!(ENV, "EXTRAE_HOME", Extrae_jll.artifact_dir)
get!(ENV, "EXTRAE_DISABLE_OMP", true)
get!(ENV, "EXTRAE_DISABLE_PTHREAD", false)
return nothing
end

end
Loading

0 comments on commit a5abe67

Please sign in to comment.