Code: Select all
local Profiler = require('profiler')
function love.load()
Profiler.start('profile.txt')
love.math.random()
Profiler.stop()
end
function love.update(dt)
print('here')
end
Contents of profile.txt:
Code: Select all
stack_level file_defined function_name line_defined current_line local_time total_time
8 (string) gsub -1 1410 0.000035 0.000035
With a small patch to get it to compile:
Code: Select all
diff --git a/config.linux b/config.linux
index 5dd041d..4dbbb46 100755
--- a/config.linux
+++ b/config.linux
@@ -1,5 +1,5 @@
-LUA_INCLUDE= /usr/local/include/lua51
+LUA_INCLUDE= /usr/include/lua5.1
PROFILER_OUTPUT= bin/profiler.so
@@ -7,4 +7,4 @@ INCS= -I$(LUA_INCLUDE)
CC= gcc
WARN= -ansi -W -Wall
EXTRA_LIBS=
-CFLAGS= -O2 -DTESTS $(WARN) $(INCS) -I./src
+CFLAGS= -O2 -DTESTS $(WARN) $(INCS) -I./src -fPIC
Code: Select all
$ uname -a
Linux carlo-arch 3.17.6-1-ARCH #1 SMP PREEMPT Sun Dec 7 23:43:32 UTC 2014 x86_64 GNU/Linux
$ pacman -Q love lua51
love 0.9.1-1
lua51 5.1.5-4
Edit: Also tried with LUA_INCLUDE= /usr/include/luajit-2.0 (luajit 2.0.3-3) with the same results.
Edit 2: Oops, I'm an idiot, ignore me. I forgot that I fixed this bug in a fork of luaprofiler: https://github.com/clofresh/luaprofiler ... 39e14268f2