Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Lua 5.2 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.o
/bin/
/src/TAGS
2 changes: 1 addition & 1 deletion Makefile.darwin
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ clean:
rm -f $(PROFILER_OUTPUT) src/*.o

install:
install -m 0755 $(PROFILER_OUTPUT) /usr/local/lib/lua/5.1
install -m 0755 $(PROFILER_OUTPUT) /usr/local/lib/lua/5.2

2 changes: 1 addition & 1 deletion Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ clean:
rm -f $(PROFILER_OUTPUT) src/*.o

install:
install -m 0755 $(PROFILER_OUTPUT) /usr/local/lib/lua/5.1
install -m 0755 $(PROFILER_OUTPUT) /usr/local/lib/lua/5.2

2 changes: 1 addition & 1 deletion Makefile.win
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $Id: Makefile.win,v 1.8 2007-08-22 17:45:56 carregal Exp $

T= profiler
V= 2.0.1
V= 2.1.0

include config.win

Expand Down
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ and their respective running times. You can use this log to generate a summary o
functions your program uses, along with how long it stayed in each of them, or you can
import the log into a spreadsheet for further analysis.

LuaProfiler is free software and uses the same license as Lua 5.1.
LuaProfiler is free software and uses the same license as Lua 5.2.

Current version is 2.0.2. It was developed for Lua 5.1.
Current version is 2.1.0. It was developed for Lua 5.2.

LuaProfiler can be downloaded from the LuaForge page, or from LuaRocks ("luarocks install
luaprofiler").
Expand All @@ -19,6 +19,6 @@ Installation

LuaProfiler source is distributed as a group of C files and some makefile templates.

LuaProfiler follows the package model for Lua 5.1, therefore it should be "installed" in your package.path.
LuaProfiler follows the package model for Lua 5.2, therefore it should be "installed" in your package.path.

Windows users can use the pre-compiled version of LuaProfiler (profiler.dll) available at LuaForge.
2 changes: 1 addition & 1 deletion config.darwin
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

LUA_INCLUDE= /usr/local/include/lua51
LUA_INCLUDE= /usr/local/include/lua52

PROFILER_OUTPUT= bin/profiler.so

Expand Down
2 changes: 1 addition & 1 deletion config.linux
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

LUA_INCLUDE= /usr/local/include/lua51
LUA_INCLUDE= /usr/include/lua5.2

PROFILER_OUTPUT= bin/profiler.so

Expand Down
8 changes: 4 additions & 4 deletions config.win
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Installation directories
# System's libraries directory (where binary libraries are installed)
LUA_LIBDIR= c:\lua5.1
LUA_LIBDIR= c:\lua5.2
# Lua includes directory
LUA_INC= c:\lua5.1\include
LUA_INC= c:\lua5.2\include
# Lua library
LUA_LIB= c:\lua5.1\lua5.1.lib
LUA_LIB= c:\lua5.2\lua5.2.lib

LIBNAME= $T.dll

Expand All @@ -14,4 +14,4 @@ INCS= /I$(LUA_INC)
CFLAGS= $(WARN) $(INCS)
CC= cl

# $Id: config.win,v 1.8 2007-08-22 17:45:56 carregal Exp $
# $Id: config.win,v 1.8 2007-08-22 17:45:56 carregal Exp $
4 changes: 2 additions & 2 deletions src/analyzer/summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function CreateSummary(lines, summary)
local global_time = 0

-- Note: ignore first line
for i = 2, table.getn(lines) do
for i = 2, #lines do
local word = string.match(lines[i], "[^\t]+\t[^\t]+\t([^\t]+)")
local local_time, total_time = string.match(lines[i], "[^\t]+\t[^\t]+\t[^\t]+\t[^\t]+\t[^\t]+\t([^\t]+)\t([^\t]+)")
local_time = string.gsub(local_time, ",", ".")
Expand Down Expand Up @@ -138,4 +138,4 @@ for k, v in pairs(sorted) do
print(v["info"]["func"] .. "\t" .. v["info"]["total"])
end
end
end
end
1 change: 1 addition & 0 deletions src/core_profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ int lprofP_callhookOUT(lprofP_STATE* S);
/* returns true if the file could be opened */
lprofP_STATE* lprofP_init_core_profiler(const char *_out_filename, int isto_printheader, float _function_call_time);

void lprofP_close_core_profiler(lprofP_STATE* S);
4 changes: 2 additions & 2 deletions src/lua50_profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static float calcCallTime(lua_State *L) {
return lprofC_get_seconds(timer) / (float) 100000;
}

static const luaL_reg prof_funcs[] = {
static const luaL_Reg prof_funcs[] = {
{ "pause", profiler_pause },
{ "resume", profiler_resume },
{ "start", profiler_init },
Expand All @@ -223,7 +223,7 @@ static const luaL_reg prof_funcs[] = {
};

int luaopen_profiler(lua_State *L) {
luaL_openlib(L, "profiler", prof_funcs, 0);
luaL_newlib(L, prof_funcs);
lua_pushliteral (L, "_COPYRIGHT");
lua_pushliteral (L, "Copyright (C) 2003-2007 Kepler Project");
lua_settable (L, -3);
Expand Down