Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Mikhail Shishatskiy <m.shishatskiy@tarantool.org>
Cc: Mikhail Shishatskiy via Tarantool-patches
	<tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH luajit v1] memprof: group allocations on traces by trace number
Date: Tue, 27 Jul 2021 09:07:46 +0300	[thread overview]
Message-ID: <YP+isvyTra1351lw@root> (raw)
In-Reply-To: <1627026889.437497509@f405.i.mail.ru>

Hi, Mikhail!

On 23.07.21, Mikhail Shishatskiy wrote:
> 
> Hi! I have one more question:
> 
> How should we properly test the behavior of profiler recording allocations from traces?
> Now I can write test which roughly estimates number of allocations in loop:
>  
> | local function payload()
> |   -- Preallocate table to avoid table array part reallocations.
> |   local _ = table_new(100, 0)
> |   -- Want too see 100 objects here.
> |   for i = 1, 100 do
> |     -- Try to avoid crossing with "test" module objects.
> |     _[i] = "memprof-str-"..i
> |   end
> |   _ = nil
> |   -- VMSTATE == GC, reported as INTERNAL.
> |   collectgarbage()
> | end
>   | jit.on() 
> | symbols, events = `run_payload_under_memprof_and_parse`()
> | alloc = `get_all_alloc_events`(symbols, events)
> | test:ok(alloc[`line_where_loop_starts`].num > `some_guaranteed_number`)
> 
> But I think it will be great if we could replace > sign with ==. The problem is we cannot guarantee
> constant number of allocations in the loop: on the most of platforms with `jit.opt.start(‘’hotloop=1’’, ‘’-sink’’)`
> I get 97 allocations in 100-iteration loop, as we spend some iterations to compile the trace. But on freebsd,
> for example, I get 24 allocations. ​​​​

It's OK due to [1].

You can add the following skip condition for the test on FreeBSD:

| -- Disabled on *BSD due to #4819.
| utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819')

>  
> --
> Best regards,
> Mikhail Shishatskiy
>  
>   
> >Среда, 21 июля 2021, 14:48 +03:00 от Sergey Kaplun <skaplun@tarantool.org>:
> > 
> >Hi! Thanks for the patch!
> >Please consider my comments below.
>  
> <snipped>
>  
> >--
> >Best regards,
> >Sergey Kaplun
>  

[1]: https://github.com/tarantool/tarantool/issues/4819

-- 
Best regards,
Sergey Kaplun

      reply	other threads:[~2021-07-27  6:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21  9:44 Mikhail Shishatskiy via Tarantool-patches
2021-07-21 11:47 ` Sergey Kaplun via Tarantool-patches
2021-07-21 11:52   ` Sergey Kaplun via Tarantool-patches
2021-07-23  7:54   ` Mikhail Shishatskiy via Tarantool-patches
2021-07-27  6:07     ` Sergey Kaplun via Tarantool-patches [this message]

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=YP+isvyTra1351lw@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=m.shishatskiy@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit v1] memprof: group allocations on traces by trace number' \
    /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