闭合函数存在return时缺少结束Sample语句
chenquanjun opened this issue · 2 comments
chenquanjun commented
如果闭合函数有return时会少了EndMikuSample
test1缺少了,而test2正常
--test 1
function TestFunc1()
local function Test()
return true
end
end
-- test 2
function TestFunc2()
local function Test()
end
end
生成结果
local BeginMikuSample = MikuLuaProfiler.LuaProfiler.BeginSample local EndMikuSample = MikuLuaProfiler.LuaProfiler.EndSample local miku_unpack_return_value = miku_unpack_return_value BeginMikuSample("[lua]:require Test,Test&line:1")
--test 1
function TestFunc1() BeginMikuSample("[lua]:TestFunc1,Test&line:3")
local function Test() BeginMikuSample("[lua]:Test,Test&line:4")
return miku_unpack_return_value( true)
end
end
-- test 2
function TestFunc2() BeginMikuSample("[lua]:TestFunc2,Test&line:10")
local function Test() BeginMikuSample("[lua]:Test,Test&line:11")
EndMikuSample() end
EndMikuSample() end
EndMikuSample()
leinlin commented
老哥 可以了解一下 miku_unpack_return_value 的 具体实现...这里做了处理
chenquanjun commented
是最后的end少了endSample
function TestFunc1() BeginMikuSample("[lua]:TestFunc1,Test&line:3")
local function Test() BeginMikuSample("[lua]:Test,Test&line:4")
return miku_unpack_return_value( true)
end
end
应该是这样
function TestFunc1() BeginMikuSample("[lua]:TestFunc1,Test&line:3")
local function Test() BeginMikuSample("[lua]:Test,Test&line:4")
return miku_unpack_return_value( true)
end
EndMikuSample() end --这里