Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5597942iog; Thu, 23 Jun 2022 01:07:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sUYAQGUe3HBZVC+moVJokjiY47zyROpeitUqI+skeSirOuVDMLqfzt55aT0vHS0HZBDJSS X-Received: by 2002:a05:6402:2987:b0:434:ef34:6617 with SMTP id eq7-20020a056402298700b00434ef346617mr9114726edb.176.1655971628202; Thu, 23 Jun 2022 01:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655971628; cv=none; d=google.com; s=arc-20160816; b=XaYTh7QKznhwYGb5SfrIUHMEf1Sbsz45OVeL7MxeraE0WW+m/6G5CO3DqqC/WoHzEX w3F3mD0/0wdwOXHXAuLGr2hLq0SwS3WBxX9Hk39Koo4ykP4nnRRQ8FbWU0l5Dugm8Tbj fNONt/cr9m5B7uwU6rW0rVdD105jxhnkoi93zJksnSvHEYmfRhytRjG6CFcDdvDITSyJ ToDc3wj/OP63UUQX3ycNqvp9DtEt/wywEyLdd3Rg0QJN0lGI5TiBVDwCJkdaSKSXpNeP ECCCEXGx0QaEUZxqbRJBljhbzMcYcDHwZBw9sNct+7OOuFkJSCpo0d3f9gbMHYaQEkm1 pl1w== 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=DdiVvT5LEZWM3p/GkJXqZ5Fwws2OCqyXJjXQPVvZIhA=; b=TDyKeUdSq2tCnq+n+JAEjh0vIZdk5ny2WQaC7DKpdAPLkytPO9EjNi/ziDHGxFMIgo vN4IvctPdZkizemog5w4260oI5RuLMEXCBziUnR2e0TvInRjaEePXMD0AASZlUeDC7oL hAL7aS7NI75+gUaVxEyjmVrOOoVMsTjYT8NsDpQzyGpw+1rdsVP6q39smtNcDKa7MOma bY6TzvOa7yf6ygLBXOC1GNVwysjopAErGUk6JanUpcvTrzSZvo2r/IBp76XPFVdubY2J MzriS5UgRfARigKqpS254/ycGuQYWNhPI1GN9UsKMjPqSt3u/00pAcn27R+V4SfKYoIZ GQ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VVVgIPkc; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eq13-20020a056402298d00b004357a678cfcsi5598226edb.393.2022.06.23.01.06.39; Thu, 23 Jun 2022 01:07:08 -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=@gmail.com header.s=20210112 header.b=VVVgIPkc; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230503AbiFWH5i (ORCPT + 99 others); Thu, 23 Jun 2022 03:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230506AbiFWH5d (ORCPT ); Thu, 23 Jun 2022 03:57:33 -0400 Received: from mail-oa1-x42.google.com (mail-oa1-x42.google.com [IPv6:2001:4860:4864:20::42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA80947383 for ; Thu, 23 Jun 2022 00:57:32 -0700 (PDT) Received: by mail-oa1-x42.google.com with SMTP id 586e51a60fabf-fe023ab520so25597254fac.10 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=OmvcWTuLfBateTZHW+yZb+zqF7Lr/fnnq95WduMMZxh9ExYs87E56nyOOEzKcDX9tD j+vwK7YUMjHFIwswHCAbPUEg8KwRoDqJbQmSUzWPrBo17Iu2c7lEzcBK4CLvny4WbK8Y bKBM92rU3ck8IZBfu3DAVNf6jhgPQQHY/LtShLs/ZTQcMVJLPDInqV3KekceNxREkVsK CZB0oH1m//043qKM7xRhhGL9ASKh7pVSfXeSq/8k85hyQkeL2PA8TtLzIfV5l/sXAZCn 10QExWgL33k29UwViVxHy8lqgo+HVcAKgsFuywTmQt5GiqvHoh4/SYRCb+VsXdS1UIaO BGmw== X-Gm-Message-State: AJIora95V1r85fMMNvmN7ANklQNyterDC4JabcwiVmrUoICPOb0tzyre MNfuqEI+s/rhzYthnpZ2xUW2sOk65o8= 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: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 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