]> git.e2factory.org Git - e2factory.git/commitdiff
trace: reduce overhead in enable(), ignore more modules
authorTobias Ulmer <tu@emlix.com>
Tue, 30 Aug 2016 16:15:49 +0000 (18:15 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/trace.lua

index 9d55333cc1bb1858aea8ac2f8643144423da9d37..496bf8886348258fca84c142af8193194340ba9c 100644 (file)
@@ -24,6 +24,7 @@ local strict = require("strict")
 
 local module_blacklist = {}
 local function_blacklist = {}
+local trace_flags = "c"
 
 --- Function call tracer. Logs all function calls at debug level while active.
 -- @param event string: type of event
@@ -104,9 +105,7 @@ end
 
 --- Enable function call tracer.
 function trace.enable()
-    e2lib.log(4, "trace.enable()")
-    local flags = os.getenv("E2_TRACE") or "c"
-    debug.sethook(tracer, flags)
+    debug.sethook(tracer, trace_flags)
 end
 
 --- Disable function call tracer.
@@ -137,9 +136,12 @@ end
 
 --- Default filter setup.
 function trace.default_filter()
-    trace.filter_module("C")
+    trace_flags = os.getenv("E2_TRACE") or "c"
     trace.filter_module("<unknown module>")
+    trace.filter_module("C")
+    trace.filter_module("assrt")
     trace.filter_module("err")
+    trace.filter_module("trace")
     trace.filter_function("e2lib", "log")
     trace.filter_function("e2lib", "logf")
     trace.filter_function("e2lib", "getlog")