From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 2CA1712EB01A; Thu, 20 Feb 2025 14:22:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2CA1712EB01A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1740050555; bh=W+02RyWQ61mUa67M+PWkt/dSHaF6FW53wtpw13XMb/E=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dV/NNcjQI/nfpcRpUV9MQo/aw4eXeJsVjqTmBRHvvanbt5hdHF3L0+OqD+eY4RWWW mOoIp5xMwI8TZp2Xa4Ir5DqfPv5nFEJxIibYxXJB8Mk4YTo2t2zvB16URa7vWS0MMw v0TjgFfDjI4rWRCUAJeP0c5YpsnxqhZJ96iFAwXk= Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C0EA612EB015 for ; Thu, 20 Feb 2025 14:22:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C0EA612EB015 Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5ded1395213so1413557a12.2 for ; Thu, 20 Feb 2025 03:22:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740050531; x=1740655331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nP0sI2ut1BnVHEFollClnNnNyvSsBBCKZegr0UdJAEU=; b=WWr3nyQalE9+zNQyRB+rbfjfEQfqsQLbcR2QLVoFD91QaDEqibRVZyAhZwGYNEYHRO sLqWR/nsjAcWUo+zSvq9ho4hduaMZmIgiuAmU1pfRxJ/nD4KKrVh2WULgAa3ESERd89w G5XWbML83Rowr3bEISot2MTy7MaYV7+VICNQdJSBcn1Vjk5xxmqZWFfO8F4xHbwoZP8p JhAAsHzt9aqVXcUtNOuUY8pE/yvqih+dnHPXzUuBbaQNLlimgzTR4FWA4bgB4BqKBNSv Ke/dtbBNsX5Yrl/nw+n2vD+WUa52Fokz8vTMWPbXjYA60ck/xtsmsKN8GFur9FjZ98GS Plhw== X-Gm-Message-State: AOJu0Ywqi4uV603e3TtCK8V5KRB1GfQLzXA5eBH64iC1NVOLEXBytNkF 61A45ar33RfGT2SyduWjf+VF4HRreS47lXUG00LjaU37WNqpG7EvsQpfg3UI X-Gm-Gg: ASbGncvHfFsfFWi3FDLQ7xWxr1iAu8T3yEzQvWW0xaYDUSjlYhq0NhJJzH1aTsh+lRK SQWFrJnb9wvFoo+sbXGhhFvWjW/r5gxlHqzGkf7qHsSOsCJQL8GmTzJNc0FVtYMsTKcguc3KDne JCoAc4VvAP7VVaXrh+PgbFM3ltjP/DgrCy31A4ZLAWXI/u7lxY0lPNIHTSJa0QXK3G8WkTbQnVl 43afJDgHy6uDNyFzjRZWmsPN2vsldDnagNcHuPoske5rgBNSSBEbUbhUZZO7ehwuQqe8Wbzd0Qm TfLt X-Google-Smtp-Source: AGHT+IGE+jh15cRXOjqvOuPFyO6al9KelNVrHGDvsDJDtqbZm2E5O7HZtcCcAvXEg9siuEy33ztwTg== X-Received: by 2002:a05:6402:50c8:b0:5dc:7f96:6263 with SMTP id 4fb4d7f45d1cf-5e0360e392emr21321978a12.15.1740050530471; Thu, 20 Feb 2025 03:22:10 -0800 (PST) Received: from localhost ([5.181.62.98]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5e0a0310f66sm1320126a12.81.2025.02.20.03.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2025 03:22:10 -0800 (PST) X-Google-Original-From: Sergey Bronnikov To: tarantool-patches@dev.tarantool.org, Sergey Kaplun , sergos@tarantool.org Date: Thu, 20 Feb 2025 14:21:42 +0300 Message-ID: <885651a4ee8bf4e6e3a8f9f2fda040e168733e2b.1740050074.git.sergeyb@tarantool.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit 1/8][v3] test: add descriptions to sysprof testcases X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" The patch adds descriptions to sysprof testcases to make the TAP report more usable. --- .../profilers/misclib-sysprof-lapi.test.lua | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua index b2c38c49..237143ad 100644 --- a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua +++ b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua @@ -65,34 +65,38 @@ end -- Wrong profiling mode. local res, err, errno = misc.sysprof.start{ mode = "A" } -test:ok(res == nil and err:match("profiler misuse")) -test:ok(type(errno) == "number") +test:ok(res == nil and err:match("profiler misuse"), + "result status with wrong profiling mode") +test:ok(type(errno) == "number", "errno with wrong profiling mode") -- Already running. res, err = misc.sysprof.start{ mode = "D" } assert(res, err) res, err, errno = misc.sysprof.start{ mode = "D" } -test:ok(res == nil and err:match("profiler is running already")) -test:ok(type(errno) == "number") +test:ok(res == nil and err:match("profiler is running already"), + "ok with already running") +test:ok(type(errno) == "number", "errno with already running") res, err = misc.sysprof.stop() assert(res, err) -- Not running. res, err, errno = misc.sysprof.stop() -test:ok(res == nil and err) -test:ok(type(errno) == "number") +test:ok(res == nil and err, "result status and error with not running") +test:ok(type(errno) == "number", "errno with not running") -- Bad path. res, err, errno = misc.sysprof.start({ mode = "C", path = BAD_PATH }) -test:ok(res == nil and err:match("No such file or directory")) -test:ok(type(errno) == "number") +test:ok(res == nil and err:match("No such file or directory"), + "result status and error with bad path") +test:ok(type(errno) == "number", "errno with bad path") -- Bad interval. res, err, errno = misc.sysprof.start{ mode = "C", interval = -1 } -test:ok(res == nil and err:match("profiler misuse")) -test:ok(type(errno) == "number") +test:ok(res == nil and err:match("profiler misuse"), + "result status and error with bad interval") +test:ok(type(errno) == "number", "errno with bad interval") -- DEFAULT MODE @@ -102,20 +106,26 @@ end local report = misc.sysprof.report() --- Check the profile is not empty -test:ok(report.samples > 0) +-- Check the profile is not empty. +test:ok(report.samples > 0, + "number of samples is greater than 0 for the default payload") -- There is a Lua function with FNEW bytecode in it. Hence there -- are only three possible sample types: -- * LFUNC -- Lua payload is sampled. -- * GC -- Lua GC machinery triggered in scope of FNEW bytecode -- is sampled. -- * INTERP -- VM is in a specific state when the sample is taken. -test:ok(report.vmstate.LFUNC + report.vmstate.GC + report.vmstate.INTERP > 0) +test:ok(report.vmstate.LFUNC + report.vmstate.GC + report.vmstate.INTERP > 0, + "total number of LFUNC, GC and INTERP samples is greater than 0 " .. + "for the default payload") -- There is no fast functions and C function in default payload. -test:ok(report.vmstate.FFUNC + report.vmstate.CFUNC == 0) +test:ok(report.vmstate.FFUNC + report.vmstate.CFUNC == 0, + "total number of FFUNC and CFUNC samples is equal to 0 " .. + "for the default payload") -- Check all JIT-related VM states are not sampled. +local msg = "total number of VM state %s is equal to 0 for the default payload" for _, vmstate in pairs({ 'TRACE', 'RECORD', 'OPT', 'ASM', 'EXIT' }) do - test:ok(report.vmstate[vmstate] == 0) + test:ok(report.vmstate[vmstate] == 0, msg:format(vmstate)) end -- With very big interval. @@ -124,7 +134,8 @@ if not pcall(generate_output, { mode = "D", interval = 1000 }) then end report = misc.sysprof.report() -test:ok(report.samples == 0) +test:ok(report.samples == 0, "total number of samples is equal to 0 for " .. + "the too big sampling interval") -- LEAF MODE check_mode("L", 100) -- 2.43.0