swh:1:snp:a72e953ecd624a7df6e6196bbdd05851996c5e40
Raw File
Tip revision: c91fe3f7d6ef67cbf878a23540a9639e4df4cd9c authored by Valentin Churavy on 03 October 2016, 20:42:41 UTC
rename MAX_ALIGN to JL_MAX_ALIGN
Tip revision: c91fe3f
profile.jl
# This file is a part of Julia. License is MIT: http://julialang.org/license

function busywait(t, n_tries)
    iter = 0
    while iter < n_tries && Profile.len_data() == 0
        iter += 1
        tend = time() + t
        while time() < tend end
    end
end

Profile.clear()
@profile busywait(1, 20)
let iobuf = IOBuffer()
    Profile.print(iobuf, format=:tree, C=true)
    str = takebuf_string(iobuf)
    @test !isempty(str)
    truncate(iobuf, 0)
    Profile.print(iobuf, format=:tree, maxdepth=2)
    str = takebuf_string(iobuf)
    @test !isempty(str)
    truncate(iobuf, 0)
    Profile.print(iobuf, format=:flat, C=true)
    str = takebuf_string(iobuf)
    @test !isempty(str)
    truncate(iobuf, 0)
    Profile.print(iobuf)
    @test !isempty(takebuf_string(iobuf))
    truncate(iobuf, 0)
    Profile.print(iobuf, format=:flat, sortedby=:count)
    @test !isempty(takebuf_string(iobuf))
    Profile.clear()
    @test isempty(Profile.fetch())
end
back to top