summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-04 00:38:18 +0800
committerruki <[email protected]>2021-05-04 00:38:18 +0800
commit3399a6881cad68ef8aa49a1817e96830cc854a6e (patch)
tree16c78d900f891a38aa6e4dbcfbe4d19e4ae43e7b
parentcfb8bf67018d7df4bd76c768025b476e7582b24d (diff)
improve trace
-rw-r--r--xmake/core/base/profiler.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/xmake/core/base/profiler.lua b/xmake/core/base/profiler.lua
index a53452113..41911c5db 100644
--- a/xmake/core/base/profiler.lua
+++ b/xmake/core/base/profiler.lua
@@ -88,10 +88,9 @@ function profiler._tracing_handler(hooktype)
local funcinfo = debug.getinfo(2, 'nS')
if hooktype == "call" then
local name = funcinfo.name
- local source = funcinfo.short_src or 'C_FUNC'
- if name and os.isfile(source) then
+ local source = funcinfo.short_src
+ if name and source and source:endswith(".lua") then
local line = string.format("%d", funcinfo.linedefined or 0)
- source = path.relative(source, xmake._PROGRAM_DIR)
utils.print("%-30s: %s: %s", name, source, line)
end
end