bpf.lua: Enable the `--llvm-debug` CLI flag
authorVicent Marti <tanoku@gmail.com>
Fri, 1 Apr 2016 15:40:58 +0000 (17:40 +0200)
committerVicent Marti <tanoku@gmail.com>
Fri, 1 Apr 2016 15:40:58 +0000 (17:40 +0200)
src/lua/bcc/bpf.lua

index 461b1b7..ce1e5eb 100644 (file)
@@ -118,7 +118,7 @@ function Bpf:initialize(args)
   local cflags = table.join(Bpf.DEFAULT_CFLAGS, args.cflags)
   local cflags_ary = ffi.new("const char *[?]", #cflags, cflags)
 
-  local llvm_debug = args.debug or 0
+  local llvm_debug = rawget(_G, "LIBBCC_LLVM_DEBUG") or args.debug or 0
   assert(type(llvm_debug) == "number")
 
   if args.text then