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 4F51A12292D3; Thu, 13 Feb 2025 14:11:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4F51A12292D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1739445092; bh=M+u9l01KklMSO4fGSXeXbi+7OClZNmRGfV1+YnrFYUc=; 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=UbynSZUs0p6lzd9HzBwBaz0/VXIbvIv+JGf9ociyQDbyDjas3EiXuwoQGQsT3KAQO 3sjnsA2y//tQgyag+YuzzQD6RNidQ3kZJk5ByELivuSDJtJXWVun980PJcl+Ss5cwD txjAlTRGXN67DbHX4WNgYFUs8KyoSPtChYUBX8XY= Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 C72BD12292CE for ; Thu, 13 Feb 2025 14:11:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C72BD12292CE Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-ab7c07e8b9bso136586266b.1 for ; Thu, 13 Feb 2025 03:11:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739445070; x=1740049870; 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=6kNMSsEoRKmY7eKwwWD2YLkXfwslc2VizEOojctKiYU=; b=TkltzgpkYm1B2kXsLHfo9znkMlX7VhSGrI3fIwDW80wWEm8n/gRLCtP+r7O1sdyXXN yqQZiUbBG1LMSwL4wTndBVeHZXNHbMMHkIjb4vG0SwC+q+OwMs71WQYHPAAjeNy8IDLA 50kGGxnzFrSuxnXSpNnitypH/cjVLEOGV2jKBG3D2E1vCRPwk4Vs6HC5ga1WSkJxzVXw lT5LjjcFvru3kZkYqeHIy6Q7LfN8S8Zcmj6wBIheTuxEMAHQ2uhiW+QP4MOoq0z4FACo yGPx+vJkNMC388FknbK6yZ8kZdwZ0PhPvtOV49PkdIsPLsCbUJ2Xf2hsXiU8JZ99pPbn JKbg== X-Gm-Message-State: AOJu0Yz32XcQh7NBmZC5msOTQkPzrGlwdqzeyKU4ZXC6j8RVkd24Lc1f OTEmv71nG1SfBdwL/oDZ0VDmSsZBfy1bTbAAYtu9lx6Gp59TexWtixEsId1Y X-Gm-Gg: ASbGncszqUfimQhDjDr6VEdhMW7hzKxRtdth9b2wsYkmh+2kfoEGuOXDDguSg4N6y3M UyI7f8gO3GdGG9G6rODu8gDJ0Yj0go2p2N3ZnU6hJKLTwy2RXbhf0NVQKr3lklyEnBRxGd3rLmq a9caituhb+uSDLZStcYY4JWtwsFH18tzPyo9Ue/wrPODSCPjIVJkIMxHK+KTT/+ZYRmI0yRr8RZ aLnq0RslfA+y0wXPbvDdFF83rFmK4iW/QZEcRZGzHSkdk0MFWIv4r8qIV8LdaYW0rThj3H47LYO Fdeb X-Google-Smtp-Source: AGHT+IGvulHF6Xle3hGxDEMf/wBgf5ppzZLdSbdeixbK+apoBEhlOVvehx9JnCfhmnrSQnXjF5OzcA== X-Received: by 2002:a17:907:2d91:b0:ab7:bfb1:99c3 with SMTP id a640c23a62f3a-ab7f34e713fmr696294066b.53.1739445069389; Thu, 13 Feb 2025 03:11:09 -0800 (PST) Received: from localhost ([5.181.62.98]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aba5327fc9bsm110584266b.75.2025.02.13.03.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2025 03:11:08 -0800 (PST) X-Google-Original-From: Sergey Bronnikov To: tarantool-patches@dev.tarantool.org, Sergey Kaplun Date: Thu, 13 Feb 2025 14:10:39 +0300 Message-Id: <862a06df6475998daf503f137905796bad2e7618.1739444510.git.sergeyb@tarantool.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit 1/7][v2] 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.34.1