diff options
author | Marius <mariausol@gmail.com> | 2011-02-08 12:00:13 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-02-08 12:00:13 +0200 |
commit | 9c6992a3436a0db6a01790b29d7c0c3c65460f94 (patch) | |
tree | c384372b23cfb6a5379641b4857bae07057bb3be /scripts/context/lua/mtx-profile.lua | |
parent | 801c806a2489c5c96578fe95945bef589329c4e0 (diff) | |
download | context-9c6992a3436a0db6a01790b29d7c0c3c65460f94.tar.gz |
beta 2011.02.08 10:06
Diffstat (limited to 'scripts/context/lua/mtx-profile.lua')
-rw-r--r-- | scripts/context/lua/mtx-profile.lua | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/scripts/context/lua/mtx-profile.lua b/scripts/context/lua/mtx-profile.lua index d78e3457a..74e1d1538 100644 --- a/scripts/context/lua/mtx-profile.lua +++ b/scripts/context/lua/mtx-profile.lua @@ -11,6 +11,19 @@ if not modules then modules = { } end modules ['mtx-profile'] = { local match, format, find = string.match, string.format, string.find +local helpinfo = [[ +--analyze analyze lua calls +--trace analyze tex calls +]] + +local application = logs.application { + name = "mtx-cache", + banner = "ConTeXt MkIV LuaTeX Profiler 1.00", + helpinfo = helpinfo, +} + +local report = application.report + scripts = scripts or { } scripts.profiler = scripts.profiler or { } @@ -54,7 +67,7 @@ function scripts.profiler.analyze(filename) f:close() print("") local loaded = { } - local sortedtable.sortedkeys(times) + sortedtable.sortedkeys(times) for i=1,#sorted do local filename = sorted[i] local functions = times[filename] @@ -154,17 +167,10 @@ end --~ scripts.profiler.analyze("t:/manuals/mk/mk-fonts-profile.lua") --~ scripts.profiler.analyze("t:/manuals/mk/mk-introduction-profile.lua") -logs.extendbanner("ConTeXt MkIV LuaTeX Profiler 1.00") - -messages.help = [[ ---analyze analyze lua calls ---trace analyze tex calls -]] - if environment.argument("analyze") then scripts.profiler.analyze(environment.files[1] or "luatex-profile.log") elseif environment.argument("trace") then scripts.profiler.analyze(environment.files[1] or "temp.log") else - logs.help(messages.help) + application.help() end |