lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Folks

I can't get the 5.1 profiler to work.

Platform is Ubuntu 16.04 LTS x64.

I have installed it from luarocks using:

sudo luarocks install luaprofiler

which reports:

jl@suny:~$ sudo luarocks install luaprofiler
Installing https://rocks.moonscript.org/luaprofiler-2.0.2-2.src.rock...
Using https://rocks.moonscript.org/luaprofiler-2.0.2-2.src.rock...
switching to 'build' mode
Do not use 'module' as a build type. Use 'builtin' instead.
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/clocks.c -o src/clocks.o
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/core_profiler.c -o
src/core_profiler.o
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/function_meter.c -o
src/function_meter.o
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/stack.c -o src/stack.o
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/lua50_profiler.c -o
src/lua50_profiler.o
src/lua50_profiler.c: In function ?profiler_stop?:
src/lua50_profiler.c:175:5: warning: implicit declaration of function
?lprofP_close_core_profiler? [-Wimplicit-function-declaration]
     lprofP_close_core_profiler(S);
     ^
gcc -shared -o profiler.so -L/usr/local/lib src/clocks.o
src/core_profiler.o src/function_meter.o src/stack.o src/lua50_profiler.o
src/core_profiler.o: In function `lprofP_init_core_profiler':
core_profiler.c:(.text+0x25f): warning: the use of `tmpnam' is dangerous,
better use `mkstemp'
Updating manifest for /usr/local/lib/luarocks/rocks
luaprofiler 2.0.2-2 is now built and installed in /usr/local (license:
MIT/X11)

So it would appear to have compiled and installed OK, despite the warning
messages.

I can see it in /usr/local/lib/luarocks/rocks/luaprofiler/2.0.2-2/ dated
today.

There is a luarocks directory under /usr/share/lua/5.1/ but none of the
files there have a current timestamp.

I have added:

require "profiler"
start()

...

stop()

to the program but it can't find the start() function:

lua5.1: procStream1.lua:11: attempt to call global 'start' (a nil value)
stack traceback:
        procStream1.lua:11: in main chunk
        [C]: ?

which sugggests that it hasn't loaded anything at all.

It was installed using sudo but all the files are world-read.

If I put the specific location in the require statement
(/usr/local/lib/lua/5.1/
profiler.so) then I get the usual long list of "no file" locations tried
by require because I already have LUA_PATH and LUA_CPATH exported from
.bashrc.

Any clues?

TIA

John Logsdon
Quantex Research Ltd
+44 161 445 4951/+44 7717758675