Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun <skaplun@tarantool.org>
To: Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v4 2/2] misc: add C and Lua API for platform metrics
Date: Wed, 7 Oct 2020 23:09:30 +0300	[thread overview]
Message-ID: <20201007200930.GA11972@root> (raw)
In-Reply-To: <20201007182335.GQ18920@tarantool.org>

Thanks, again! Great comments as always!

On 07.10.20, Igor Munkin wrote:
> Sergey,
> 
> Thanks for the fixes! The patch LGTM, except two nits below.
> 
> On 07.10.20, Sergey Kaplun wrote:
> > Hi Igor! Thanks for the review!
> > 
> > On 07.10.20, Igor Munkin wrote:
> > > Sergey,
> > > 
> > > Thanks for the patch! Please consider my comments below.
> > > 

<snipped>

> > diff --git a/test/misclib-getmetrics-capi.test.lua b/test/misclib-getmetrics-capi.test.lua
> > index 34adaba..f133274 100755
> > --- a/test/misclib-getmetrics-capi.test.lua
> > +++ b/test/misclib-getmetrics-capi.test.lua
> > @@ -1,15 +1,15 @@
> >  #!/usr/bin/env tarantool
> >  
> > -local file = debug.getinfo(1, "S").source:sub(2)
> > -local filepath = file:match("(.*/)")
> > -local soext = jit.os == "OSX" and "dylib" or "so"
> > -package.cpath = filepath..'clib-misclib-getmetrics/?.'..soext..";"
> > -                ..package.cpath
> > +local path = arg[0]:gsub('%.test%.lua', '')
> > +local suffix = package.cpath:match('?.(%a+);')
> > +package.cpath = ('%s/?.%s'):format(path, suffix)
> 
> This line overrides the current <package.cpath>.

Sure! 10x!

> 
> >  
> 
> <snipped>
> 
> > diff --git a/test/misclib-getmetrics-capi/testgetmetrics.c b/test/misclib-getmetrics-capi/testgetmetrics.c
> > index 32802d2..4a7355a 100644
> > --- a/test/misclib-getmetrics-capi/testgetmetrics.c
> > +++ b/test/misclib-getmetrics-capi/testgetmetrics.c
> 
> <snipped>
> 
> > @@ -203,7 +207,6 @@ static int tracenum_base(lua_State *L)
> >  	luaM_metrics(L, &metrics);
> >  	assert(metrics.jit_trace_num == 0);
> >  
> > -	luaJIT_setmode(L, 0, LUAJIT_MODE_ON);
> 
> There is one more excess call at the end of this function.

Thanks! Nice catch!

> 
> >  	/* Generate traces. */
> >  	lua_call(L, 0, 1);
> >  	n = lua_gettop(L);
> 
> <snipped>
> 
> > ===================================================================
> > 
> > -- 
> > Best regards,
> > Sergey Kaplun
> 
> -- 
> Best regards,
> IM

See iterative patch in the bottom. Branch force-pushed.

===================================================================
diff --git a/test/misclib-getmetrics-capi.test.lua b/test/misclib-getmetrics-capi.test.lua
index f133274..1ad6958 100755
--- a/test/misclib-getmetrics-capi.test.lua
+++ b/test/misclib-getmetrics-capi.test.lua
@@ -2,7 +2,7 @@
 
 local path = arg[0]:gsub('%.test%.lua', '')
 local suffix = package.cpath:match('?.(%a+);')
-package.cpath = ('%s/?.%s'):format(path, suffix)
+package.cpath = ('%s/?.%s;'):format(path, suffix)..package.cpath
 
 local jit_opt_default = {
     3, -- level
diff --git a/test/misclib-getmetrics-capi/testgetmetrics.c b/test/misclib-getmetrics-capi/testgetmetrics.c
index 4a7355a..8844b17 100644
--- a/test/misclib-getmetrics-capi/testgetmetrics.c
+++ b/test/misclib-getmetrics-capi/testgetmetrics.c
@@ -222,7 +222,6 @@ static int tracenum_base(lua_State *L)
         luaM_metrics(L, &metrics);
         assert(metrics.jit_trace_num == 0);
 
-        luaJIT_setmode(L, 0, LUAJIT_MODE_ON);
         lua_pushboolean(L, 1);
         return 1;
 }
===================================================================

-- 
Best regards,
Sergey Kaplun

  reply	other threads:[~2020-10-07 20:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05  6:30 [Tarantool-patches] [PATCH v4 0/2] Implement LuaJIT " Sergey Kaplun
2020-10-05  6:30 ` [Tarantool-patches] [PATCH v4 1/2] core: introduce various " Sergey Kaplun
2020-10-07 14:11   ` Igor Munkin
2020-10-07 19:55     ` Sergey Kaplun
2020-10-07 20:16       ` Igor Munkin
2020-10-08  9:28         ` Igor Munkin
2020-10-08 10:11         ` Sergey Kaplun
2020-10-08 12:44           ` Igor Munkin
2020-10-09 14:39             ` Sergey Ostanevich
2020-10-05  6:30 ` [Tarantool-patches] [PATCH v4 2/2] misc: add C and Lua API for " Sergey Kaplun
2020-10-06 22:17   ` Igor Munkin
2020-10-07  5:57     ` Igor Munkin
2020-10-07 14:35     ` Sergey Kaplun
2020-10-07 18:23       ` Igor Munkin
2020-10-07 20:09         ` Sergey Kaplun [this message]
2020-10-09 14:45   ` Sergey Ostanevich
2020-10-13  6:01     ` Sergey Kaplun
2020-10-05  6:30 ` [Tarantool-patches] [RFC v4] rfc: luajit metrics Sergey Kaplun
2020-10-07 14:46   ` Sergey Kaplun
2020-10-08 17:25   ` Igor Munkin
2020-10-08 19:29     ` Sergey Kaplun
2020-10-08 20:26       ` Igor Munkin
2020-10-09  6:06         ` Sergey Kaplun
2020-12-22  9:07   ` Kirill Yukhin
2020-10-08 17:33 ` [Tarantool-patches] [PATCH v4 0/2] Implement LuaJIT platform metrics Igor Munkin
2020-10-13 13:17 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201007200930.GA11972@root \
    --to=skaplun@tarantool.org \
    --cc=imun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v4 2/2] misc: add C and Lua API for platform metrics' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox