Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5501527iog; Wed, 22 Jun 2022 22:27:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uHB7d7ib/7JPfyS+TcxrKzJZKljapQPolAsLJ2FyLnCZyw6uT5now9FegFXPPQFoNluGBR X-Received: by 2002:a17:902:c94f:b0:16a:3f98:84e9 with SMTP id i15-20020a170902c94f00b0016a3f9884e9mr9464402pla.36.1655962062626; Wed, 22 Jun 2022 22:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655962062; cv=none; d=google.com; s=arc-20160816; b=qm9ODUAt3sTIyGPq7y9IHIvpLdjK0EWKCFT5CfnhDjOPvH/KQNWNeoIuGwL0BJnOSy +VWkxYIFzRssJGbc06SferyiR7Mj54PKMPicWLAC0E4RJUvNGChAQkpthdUmNm3SEb6l vPZuH1BpVpo7ZsqR37ktw7aWXadGbhSGH/8xz/uYMJVfehoNUEHsxbV8QM2CPu4n0+1d 211yY9Ba48qLKR281ip5XVlmSzDkRhBR3McpHe8O43E4e2U+hp9bG6a0XpmYyKHH3b5A nW7Tiyp0r6AlMHnXPSCCF1LgTZDfsrzK9S3ttQgaQKze3NhzP2dBmIG8SfRKAnvvOwJY 5B0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=37QqA6IMUr7TzQRPGJ6A6j/QicaH8f0ivAcTRXf4T2k=; b=pYNspxFnp33sOZZ7W5U6wwL/GsMsn5o4mz3x687CgJuAiRP6Oa3cOFaHHRc7YxyZ1r nyvvqMdt7D+gsXpGPqpJSOelQN7bEpA9AIxLwUgiVRmy+cXUh/93c3I+hy+9e7CsvBB5 K3WHU6qIsZ0hszkY/EFPXRq3bp8hh0Y3RwZzTHDEU1K8uT2RWPFP0ezYNphOHEEGLBVa HcdKAMCunEDRuNqKSy8mmzf5ue7eaFYX25KI/ALZ3wbdYNUUWouWS4luei6ECB+qHBT1 QL8PeVAy9q+VYrIryp6zwrWoyykIPeA8IevT5gZND3YHoj8V3muJq2eAb7EoNKE48xyj 4Ipw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="bxDTjd/p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls16-20020a17090b351000b001ecc09d84bbsi2201077pjb.102.2022.06.22.22.27.30; Wed, 22 Jun 2022 22:27:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="bxDTjd/p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229457AbiFWFMR (ORCPT + 99 others); Thu, 23 Jun 2022 01:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229802AbiFWFMC (ORCPT ); Thu, 23 Jun 2022 01:12:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ED8A44A1A for ; Wed, 22 Jun 2022 22:04:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 43E5A61E02 for ; Thu, 23 Jun 2022 05:04:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29B9CC3411D; Thu, 23 Jun 2022 05:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655960679; bh=96PXdvtO1VftGh3ILQ2SJTCDvrG7FSTHpe06x8inDuU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bxDTjd/pmo8vLHWatxnVGeIKAfKIMiTmrl+YcQ+tLxfFcEVmqWOqSrLtU4vKA+Zu5 CpatCOptJp6g1ZOWv51zrKwNgTDO9NDvh48glOqqxBiKtOBSpUemsOg4gWKUcl7m6U 0IeQ9lWFECEgfgbfdPDp9USH5OfDvxcyiFoxuzLPaKxuRxiU/fXFj8UecWdgipjvoY NhqaTVb914JLRlIJDlHcvN4GWfqgB+4NlOzUuoo9ebkZQ6ZprIhcKc6Miu9nP/lOnD m9Cv8lutzDSy8f4HslaeDlDC4sL+LDCP9c2LL5m342FQMOEf83n2RUyuz1qZZx7bYv rQQ8A6gsHRsLA== Date: Thu, 23 Jun 2022 00:04:33 -0500 From: Mike Rapoport To: Rebecca Mckeever 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: X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > Thanks, > Rebecca -- Sincerely yours, Mike.