From mboxrd@z Thu Jan 1 00:00:00 1970 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 15B83C43334 for ; Thu, 23 Jun 2022 07:57:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 63B398E013A; Thu, 23 Jun 2022 03:57:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EBC18E0115; Thu, 23 Jun 2022 03:57:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DAAF8E013A; Thu, 23 Jun 2022 03:57:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3E2348E0115 for ; Thu, 23 Jun 2022 03:57:33 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 1A2F41213E6 for ; Thu, 23 Jun 2022 07:57:33 +0000 (UTC) X-FDA: 79608745986.07.1F389AB Received: from mail-oa1-f68.google.com (mail-oa1-f68.google.com [209.85.160.68]) by imf27.hostedemail.com (Postfix) with ESMTP id BD9B740015 for ; Thu, 23 Jun 2022 07:57:32 +0000 (UTC) Received: by mail-oa1-f68.google.com with SMTP id 586e51a60fabf-1048b8a38bbso8942359fac.12 for ; Thu, 23 Jun 2022 00:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=DdiVvT5LEZWM3p/GkJXqZ5Fwws2OCqyXJjXQPVvZIhA=; b=VVVgIPkcIUN6epQHOGYeK4s3ZT1GWvMoRfiTVUnKKmGawQgBhPW0QZ3mfRnVXhrLjU WZrj9A7MYPOEYh4qW0OyltSjadtEuVJxnvpYxyn2NqfWLTwtozGzgH2uf8PnbEJI9Jz9 +o9Szae9yxyFzHd6o+UMSchclo4+GDgk2fNS+Uf/ZtZXRtsQUiIxQN7AOIJNilC9aSDz 3ZmvH79HapETDCX31eiEIs5W7BTuor6s/9ksnnbkyZ7wYkIRUSWO9xL1CS+b9TvHtXl8 YtPkepYmv0hWYeelqy275L79jQ119+bkJ84thLybMJ+O+7d9zSGGxY8mIIoZLkTGf0Px EsKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DdiVvT5LEZWM3p/GkJXqZ5Fwws2OCqyXJjXQPVvZIhA=; b=uYRtFeBiev+DhiS1ZjxbFoVIa32JCSuJo/l9B8K78aLt7IZExiK2Te/KPu6/pU6Qmt uvCHyCLhscLWHLx0D4E5Mk7KL6WgSNzVXJlmwt9rufwYtABCAqLjMqxLvahUrpuG2SH/ UPYsdmCOYCgDrzTS88uM5lXMgl/aXqxJQAbUXBx6RMg55kLm3yjs5pjWzSwtVvjJed/h 8ZYE5lLeAd1tN1RxOSX8fBXKVkCJjMrS46C3IhJcF1DmZVr8j0FBlND6F9wXkkXxcZHX Z6H5Usgg1aWp1P2Fi2pEG9JnsVsGml1smtGoEIAf+90T2yzW0CM5xS+eIFUR0xh+l+fa zU9g== X-Gm-Message-State: AJIora98xl6SfS17mwfyR+SP0nBMYtlx59RvcE6rqZDSmMNlKWpZSjuM oVYcbA0LdBsbq5wKz8pSIuE= X-Google-Smtp-Source: AGRyM1vzb5Ug0C5+qaDMtia5rDOiS/NbHsSE/fmei84BqRf2iQQVh8xaDabe5W7IhwYv1YdblUBDdg== X-Received: by 2002:a05:6870:339e:b0:f3:cd8:6156 with SMTP id w30-20020a056870339e00b000f30cd86156mr1671150oae.292.1655971051997; Thu, 23 Jun 2022 00:57:31 -0700 (PDT) Received: from bertie (072-190-140-117.res.spectrum.com. [72.190.140.117]) by smtp.gmail.com with ESMTPSA id eh40-20020a056870f5a800b000e90544b79fsm12194057oab.41.2022.06.23.00.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jun 2022 00:57:31 -0700 (PDT) Date: Thu, 23 Jun 2022 02:57:30 -0500 From: Rebecca Mckeever To: Mike Rapoport Cc: "Huang, Shaoqin" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Hildenbrand Subject: Re: [PATCH v3 2/4] memblock tests: add verbose output to memblock tests Message-ID: References: <004e021cc3cb7be8749361b3b1cb324459b9cb9f.1655889641.git.remckee0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655971052; a=rsa-sha256; cv=none; b=Vu3BDGSq1n72FzYZLeVYzWJbYUnJHkQK2g0gkiER1t8OGyWRDffFvUw4CP6C7m5D35yuon 2xjQUHUpTTx5i9uKLKxpJ7i2E+RwoNSlcQzNT2US+4gMpRg3sz4mGo3skfgw+Ms1gM8UQM TGatGZy5jAhHd66fLLySdrMbPVjNe4k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655971052; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DdiVvT5LEZWM3p/GkJXqZ5Fwws2OCqyXJjXQPVvZIhA=; b=bnsrE8ZjfFeKKFNRd+HYuYLvVWwZ0L9GoINTiyUptr4fH5tKYa8NlECZayOmnRF/D+JhA5 vG3gH5MrdrFmSQGq41FsXmcsqDJVbQTIyWe7sVV9JmoGQtAkd/Qs2q4bBuRIu/a4rlrUVx 8RUoI74hWXVrFdimoS079PPHoNOayso= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=VVVgIPkc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of remckee0@gmail.com designates 209.85.160.68 as permitted sender) smtp.mailfrom=remckee0@gmail.com X-Rspam-User: X-Rspamd-Queue-Id: BD9B740015 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=VVVgIPkc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of remckee0@gmail.com designates 209.85.160.68 as permitted sender) smtp.mailfrom=remckee0@gmail.com X-Stat-Signature: drhenxho1sanj53nrkhjit17np47i195 X-Rspamd-Server: rspam09 X-HE-Tag: 1655971052-186042 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: On Thu, Jun 23, 2022 at 12:04:33AM -0500, Mike Rapoport wrote: > On Wed, Jun 22, 2022 at 11:56:30PM -0500, Rebecca Mckeever wrote: > > On Wed, Jun 22, 2022 at 11:05:27PM -0500, Mike Rapoport wrote: > > > On Thu, Jun 23, 2022 at 09:29:05AM +0800, Huang, Shaoqin wrote: > > > > > > > > > > > > On 6/23/2022 8:45 AM, Rebecca Mckeever wrote: > > > > > On Wed, Jun 22, 2022 at 06:32:04PM +0800, Huang, Shaoqin wrote: > > > > > > Just test it and everything works fine. And I think there are some thing can > > > > > > improve: > > > > > > > > > > > > The prefix_push() and prefix_pop() are used in so many functions and > > > > > > almost of them just put the prefix_push(__func__) begin in the head and the > > > > > > prefix_pop() in the end. > > > > > > May be you can define some macro that when you output something and > > > > > > automatically push the __func__ as prefix. And when leave the function, > > > > > > automatically pop it. And only in some special place, you call it manually. > > > > > > > > > > > Thank you for your review. I'm not sure how you would automatically push > > > > > __func__ since you have to be inside the function to access that > > > > > variable. Let me know if you have any suggestions. I am thinking about > > > > > adding another function in common.c that just calls test_pass() followed > > > > > by prefix_pop() since those are called together so often. > > > > > > > > Just like: > > > > #define test_pass_macro() \ > > > > do { \ > > > > prefix_push(__func__); \ > > > > test_pass(); \ > > > > prefix_pop(); \ > > > > } while (0) > > > > > > This will not print the name of the failing test, e.g. instead of > > > > > > not ok 28 : memblock_alloc: alloc_bottom_up_disjoint_check: failed > > > > > > with Rebecca's implementation it'll print > > > > > > not ok 28 : memblock_alloc: failed > > > > > Oh yeah, prefix_push() needs to be called before the asserts. > > > > > How about > > > > > > #define PREFIX_PUSH() prefix_push(__func__)? > > > > > Good idea. What about > > > > #define TEST_PASS() do { \ > > test_pass(); \ > > prefix_pop(); \ > > } while (0) > > > > ? Or would it be better to make a function? > > static inline function would be better. > Would there be any advantage to defining a different version for each side of #ifdef VERBOSE? > > Thanks, > > Rebecca > > -- > Sincerely yours, > Mike. Thanks, Rebecca