[Tarantool-patches] [PATCH luajit v1 3/5] test: allow `jit.parse` to return aborted traces

Sergey Bronnikov sergeyb at tarantool.org
Thu Jun 13 17:38:41 MSK 2024


Hi, Sergey

thanks for the fix and the answer. LGTM

On 13.06.2024 13:00, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
>
> On 06.06.24, Sergey Bronnikov wrote:
>> Sergey,
>>
>>
>> thanks for the patch! Please see my comments below.
>>
>> On 22.04.2024 11:49, Sergey Kaplun wrote:
>>> Now information about the abort of the trace is saved in the
>>> `abort_reason` field of the corresponding structure. The
>>> `jit.parse.finish()` returns now the second table containing aborted
>>> traces. Each table key is a trace number containing an array of
>>> potentially traces with this number, which was aborted.
>>>
>>> Needed for tarantool/tarantool#9924
>>> ---
>>>    .../unit-jit-parse-abort.test.lua             | 38 +++++++++++++++++++
>>>    test/tarantool-tests/utils/jit/parse.lua      | 22 ++++++++---
>>>    2 files changed, 55 insertions(+), 5 deletions(-)
>>>    create mode 100644 test/tarantool-tests/unit-jit-parse-abort.test.lua
>>>
>>> diff --git a/test/tarantool-tests/unit-jit-parse-abort.test.lua b/test/tarantool-tests/unit-jit-parse-abort.test.lua
>>> new file mode 100644
>>> index 00000000..91af5a56
>>> --- /dev/null
>>> +++ b/test/tarantool-tests/unit-jit-parse-abort.test.lua
>>> @@ -0,0 +1,38 @@
>>> +local tap = require('tap')
>>> +local test = tap.test('unit-jit-parse'):skipcond({
>> Usually a name passed to `tap.test` matches to test file name,
>>
>> but here it is not matched.
> My bad, thanks!
> Fixed, see the iterative patch below.
>
> ===================================================================
> diff --git a/test/tarantool-tests/unit-jit-parse-abort.test.lua b/test/tarantool-tests/unit-jit-parse-abort.test.lua
> index 91af5a56..f09e696c 100644
> --- a/test/tarantool-tests/unit-jit-parse-abort.test.lua
> +++ b/test/tarantool-tests/unit-jit-parse-abort.test.lua
> @@ -1,5 +1,5 @@
>   local tap = require('tap')
> -local test = tap.test('unit-jit-parse'):skipcond({
> +local test = tap.test('unit-jit-parse-abort'):skipcond({
>     ['Test requires JIT enabled'] = not jit.status(),
>     ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>   })
> ===================================================================
Thanks!
>>> +  ['Test requires JIT enabled'] = not jit.status(),
>>> +  ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>>> +})
>>> +
>>> +local jparse = require('utils').jit.parse
>>> +
>>> +-- XXX: Avoid other traces compilation due to hotcount collisions
>>> +-- for predictable results.
>>> +jit.off()
>>> +jit.flush()
>>> +
>>> +test:plan(1)
>>> +
>>> +jit.on()
>>> +-- We only need the abort reason in the test.
>>> +jparse.start('t')
>> I would add a comment with explanation what does 't' flag mean.
>>
>> Feel free to ignore.
> I suppose that readers who use `jit.dump` from time to time already
> know all flags. If not, it can be easily found in <jit/dump.lua>.
okay, let's keep it as is
>>> +
> <snipped>
>
>>>    -- Turn off compilation for the module to avoid side effects.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20240613/4b4002ae/attachment.htm>


More information about the Tarantool-patches mailing list