From patchwork Mon Jun 27 22:34:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rebecca Mckeever X-Patchwork-Id: 12897269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40EF1C43334 for ; Mon, 27 Jun 2022 22:35:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68A4C8E0002; Mon, 27 Jun 2022 18:35:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 63B1B8E0001; Mon, 27 Jun 2022 18:35:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DB178E0002; Mon, 27 Jun 2022 18:35:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3C16E8E0001 for ; Mon, 27 Jun 2022 18:35:12 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 0B9AE60553 for ; Mon, 27 Jun 2022 22:35:12 +0000 (UTC) X-FDA: 79625472864.29.B7C00CB Received: from mail-oa1-f68.google.com (mail-oa1-f68.google.com [209.85.160.68]) by imf30.hostedemail.com (Postfix) with ESMTP id 9FECD80018 for ; Mon, 27 Jun 2022 22:35:11 +0000 (UTC) Received: by mail-oa1-f68.google.com with SMTP id 586e51a60fabf-fb6b4da1dfso14797805fac.4 for ; Mon, 27 Jun 2022 15:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4rTe9Lp6uNO/11riV57zI1Iev/mCoij/+CofdNi1ykc=; b=muu8c+uUErYAR/stI1SOwr1j/KbCbcO5d5P3LGAPp5X/4eErLkz8nQynNO4PoGZxdM JpuSun50kim+AtH5RqLcQBKRSYdlYEcm7idd23H59oUJmxd816R/d/7V/9b2iz8b+fZg iGuS4EToo6dVLZKJv1bJKyDkU5O7GolIyfe3ytrGC3+R8POQqU+Zmn1eiEgB6YSm5mvv lJxTxuGrKVANWXkZ9aew4KY0YNi8ipgq8PQ2HTq/zvRUabEQNFvK6ZXcJupXh8i5j0Yz o0MRa6fIa6UMTZJxQ9GdG7636+4KA2eiwgwkO0lFzW7beRHAgoLPtipWTZJbbCk/FIvc OyeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4rTe9Lp6uNO/11riV57zI1Iev/mCoij/+CofdNi1ykc=; b=q6VXXfyRsRdEnq8oIzB1MwL6ezH5Efz6dfwsw6EzC/EoASEoiVlwz9azB18X1NSNSP Xw04kS98cfH23oG8PTgYPwiGLHA9N4Qf3EK1qyxWanjT/BK/fNjtQfOFHmOI8QqQjlIg 51wZqBGWKJGwwzVr6GNhOiSQBfrYx70Y9LCciY1ypMxIty8o49Lz97qE0VhcBdWdtdwM FU7GMGkTKbawTGgMddC4KV2IRvb3lI5r6uDDg/dCa0i0dDvZWZDy1FkMmaWhoJyQwNIH jmwatw8Mhr4cNlAy9ktKVp4X2KtV1PfFRJOjAeaJKubyN5TNYz9SYH97Lfop6skn+wwj XiRQ== X-Gm-Message-State: AJIora+br7SwndwlOo4OQUt+I5MEjxzlNBXy2OnF5bXzy5ViLTCGOiMl xV6bHpIXFlAo6wmZMeMNdh0= X-Google-Smtp-Source: AGRyM1t7CQ5J4dec99S5QZJMxBl9D2w+61Il7aqYy0mmGQ/s4PqYH0KX39AcZYURLOWTfoUmGaky3A== X-Received: by 2002:a05:6870:6c15:b0:106:919c:80df with SMTP id na21-20020a0568706c1500b00106919c80dfmr8710493oab.111.1656369310743; Mon, 27 Jun 2022 15:35:10 -0700 (PDT) Received: from bertie (072-190-140-117.res.spectrum.com. [72.190.140.117]) by smtp.gmail.com with ESMTPSA id e3-20020a4ac3c3000000b0035eb4e5a6d6sm6579747ooq.44.2022.06.27.15.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 15:35:10 -0700 (PDT) From: Rebecca Mckeever To: Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: David Hildenbrand , Rebecca Mckeever Subject: [PATCH v4 0/4] memblock tests: add VERBOSE and MEMBLOCK_DEBUG Makefile options Date: Mon, 27 Jun 2022 17:34:26 -0500 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=muu8c+uU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of remckee0@gmail.com designates 209.85.160.68 as permitted sender) smtp.mailfrom=remckee0@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656369311; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=4rTe9Lp6uNO/11riV57zI1Iev/mCoij/+CofdNi1ykc=; b=R2pMDsd5MfhiRLVBTIx0iLvZb/qtNUDOE3BDpNUXqhncD1Jn6fzyD7tbO2bKZsz9F7jsdK 1aCZt3xBztJnRQqKV8sgw6z0o4KnjYJEkSRS9s8zcNvhCpVmm9N8fK0Xb60P95GKSTrNOQ QXSLdR+WgwwfC5rdRxOVMC3zT/AhmmU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656369311; a=rsa-sha256; cv=none; b=jBgauelO6jHM+aUzqekAI8TOH1v8Jl0+AJFA32NTraqGAkPflecQ8yqmhVxazBgQe31dZk axiHdX0PNfZUYg6lXXaNr6Hgbub2jSsJ/mUyDF/VOQZQHfNVk4arSXL6YparRhH/cwVQ/z M0FqjsGoqU2fqyulT1L3rui8E2rIRmo= X-Stat-Signature: nszo6z93tygikst8x9hwjigbwqry9w5i X-Rspamd-Queue-Id: 9FECD80018 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=muu8c+uU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of remckee0@gmail.com designates 209.85.160.68 as permitted sender) smtp.mailfrom=remckee0@gmail.com X-Rspamd-Server: rspam12 X-HE-Tag: 1656369311-935740 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: These patches add options VERBOSE and MEMBLOCK_DEBUG to Memblock simulator, which can be specified when running make. These patches also implement the functionality for these options. VERBOSE Usage: $ make VERBOSE=1 Passing VERBOSE=1 will enable verbose output from Memblock simulator. For each test, the verbose output includes the name of the memblock function being tested, the name of the test, and whether the test passed or failed. Since all the tests in Memblock simulator run as one monolithic test, this output is a quick way to get a summary of test results. MEMBLOCK_DEBUG Usage: $ make MEMBLOCK_DEBUG=1 Passing MEMBLOCK_DEBUG=1 will enable memblock_dbg() messages. These are debug messages built into several functions in memblock that include information such as the name of the function and the size and start and end addresses of the memblock region. --- Changes v3 -> v4 PATCH 1: - Update subject line to specifically mention verbosity, which encompasses both Makefile arguments PATCH 2: - tests/common.h, tests/*_api.c: - Define and use macro PREFIX_PUSH(), which runs prefix_push(__func__) - Define and use function test_pass_pop(), which runs test_pass(), then prefix_pop() - tests/alloc_*api.c: - Remove static on constant func_testing - tests/basic_api.c: - Display "memblock_add" instead of "memblock_add_node" in verbose output for memblock_add_node_simple_check() - tests/alloc_helpers_api.c: - Add missing prefix_pop() in memblock_alloc_helpers_checks() - Commit message: - Format function/macro descriptions, reword prefix_push() description, and update as needed to reflect the above changes v2 -> v3 PATCH 1: - Add Reviewed-by tag v1 -> v2 PATCH 2: - tests/common.c: - Remove #ifdef VERBOSE around prefixes and related constants - Add __maybe_unused to prefixes - Move PREFIXES_LEN_MAX, DELIM, and DELIM_LEN so that they are immediately after the other constants - Add #ifdef VERBOSE around definitions for test_*() and prefix_*() --- Rebecca Mckeever (4): memblock tests: Makefile: add arguments to control verbosity memblock tests: add verbose output to memblock tests memblock tests: set memblock_debug to enable memblock_dbg() messages memblock tests: remove completed TODO items tools/testing/memblock/Makefile | 4 + tools/testing/memblock/README | 10 +- tools/testing/memblock/TODO | 14 +- tools/testing/memblock/internal.h | 7 + .../testing/memblock/scripts/Makefile.include | 10 + tools/testing/memblock/tests/alloc_api.c | 225 +++++++---- .../memblock/tests/alloc_helpers_api.c | 129 ++++--- tools/testing/memblock/tests/alloc_nid_api.c | 351 +++++++++++------- tools/testing/memblock/tests/basic_api.c | 337 +++++++++++------ tools/testing/memblock/tests/common.c | 58 +++ tools/testing/memblock/tests/common.h | 62 ++++ 11 files changed, 851 insertions(+), 356 deletions(-)