Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1016600pxb; Wed, 6 Apr 2022 06:48:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2P5IfTPOJl3b+RRp33ZcDhehdgSXwd6JSRmpNCKRpUHtslmwOQeYnqrrWSa0+F6gbfaK7 X-Received: by 2002:a17:902:e805:b0:154:5c2f:e3c2 with SMTP id u5-20020a170902e80500b001545c2fe3c2mr8606331plg.141.1649252916006; Wed, 06 Apr 2022 06:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252916; cv=none; d=google.com; s=arc-20160816; b=pdd0vtBJ1hdOQw3aK7+nbnlAdpb1KZqOc5lIm3TeUCUM2EPCFwp3DL6Rf9xkHTJgWl rW3dflE3PZznGwWWAcviK+vdAQTsLXgswOa20cGOorwfNWYJpOdzaTA1bqe5vfqq6Z+a ogu6pRX/EQSsCJDyE4yEBD1cRCMIS0++4XFemFtO/sfadmUnsKJVqK+9sO4rCK1enMug lpc/j/sNQXD7Dp2p2pKs553XvGwWhypAJ90KmG1k/sliBD5GbXo5178oEaePKfZVg28A 4eYUPn08cj07fkCgMN5ezHlMpjrBZGsAKyEgg1cABu84tZuiXdcyU1jQ4kuBhB/iU7rD kSKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pHXomKH7znoD3NKtjCedrAePGvj1PU34oOzV9waUrWE=; b=r1yOVNUSa0dq7H2FdzlyeAh+4/CQbji7kQPc5je+9T3ZnLS3xThNUNr+2DzC6K5XxH 0ei01D8gEcrKJuioihuEEYoquXsmI7Amp3TOrBXvREQIWfQ3K61XHXOn2ZtHGbMBXrNg oykWHnT9Vk4Vj/M5v2RBlRYm64LcPMkNFZOfyHOiC/1LmUY6z3hJlyD/qs7jLQzjznA1 LTKdvg7HzSO7Wurm41C4OhtszytY+kGY1apE3uHxqOxuv3Nq4oViiVZFKvoDg3QPiWnw gV3lz2qcz0px8rBJfYpFuZSvGXVsw8864d1WKN5/dqHsPpRRqe0h7jADxQkK+KLL373s Y+cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qP2Je91c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nu16-20020a17090b1b1000b001ca84546104si5490657pjb.27.2022.04.06.06.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:48:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qP2Je91c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 76A3158D36B; Wed, 6 Apr 2022 04:43:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2360496AbiDFDbr (ORCPT + 99 others); Tue, 5 Apr 2022 23:31:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1850378AbiDFCwO (ORCPT ); Tue, 5 Apr 2022 22:52:14 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66054181149; Tue, 5 Apr 2022 16:52:16 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id e22so1074856ioe.11; Tue, 05 Apr 2022 16:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pHXomKH7znoD3NKtjCedrAePGvj1PU34oOzV9waUrWE=; b=qP2Je91cC5X9wuYLjZp8TH9PNetiSDkDUC4K9LVY0XsP70Z0P360X7QBCcp544wpWn uj80MoZx+E/whCCVsJBl7bHFLs4zX9YT1v0DtGIo2TXQVILm6wSdrAYbxEVLaPSpMPRG SIKIBtv9TFPsCcXbNOHKCqINnfCryFkkOuEUG17CZIPI7EC5N++bXiQLtbGUwI3G1ktC B4WGJJrB9L4fEuvWaEKUmpTr1MxaOMVrexGTVXwlaRX188e8xQqjFFpGQ/W7Qw+DtTJ8 44qAfRFH+M9VBi0NFgLYpeT8wWfgUW7inCLoeNUEeDAjzmUxiUZdp/P9BBnkLKTi4zUx rLGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pHXomKH7znoD3NKtjCedrAePGvj1PU34oOzV9waUrWE=; b=jdmo3pXGSLArTYozWH56R61Sa9Vm8CKn635zT3jwKfS6G9VwiGq4bMj1JGW9CWrIOC zgZE0A9nu4gni9LSjQ04SWMPAmBsI/0DMPKKQASMPPCisp5MjyHQ3OVKnXvS+lqqBhS+ IrIYLQVlyQjkeQ4lU7+8XZ69SKvya7elwuXCydLM6ftV8DChQHldjiNBt0U9hOzzTghu zgzsrQ11B6JFK79XWsA7ObyiiZ9KImBdGY/V8b5H7bePn8uc3LvbObG+OH182xmkd5GF x+uP2goSxS/RGteWy1y61OHLobZTJLr6OzQySzcsXDJkaS7ybD0Hb2RqDeoxLXNZRB9T nwPA== X-Gm-Message-State: AOAM533CEvHxR5iN4a6VcaGJ1GLQ7vWPtbG4Rz4rjPUfl+VRlZB4EMAP bG9KOKVZeuBjyzxtK3lQd+zE4KQgH8bLN7SuFRw= X-Received: by 2002:a05:6638:772:b0:319:e4eb:adb with SMTP id y18-20020a056638077200b00319e4eb0adbmr3287706jad.237.1649202733374; Tue, 05 Apr 2022 16:52:13 -0700 (PDT) MIME-Version: 1.0 References: <20220405163728.56471-1-ytcoode@gmail.com> In-Reply-To: <20220405163728.56471-1-ytcoode@gmail.com> From: Andrii Nakryiko Date: Tue, 5 Apr 2022 16:52:02 -0700 Message-ID: Subject: Re: [PATCH bpf-next] selftests/bpf: Remove redundant checks in get_stack_print_output() To: Yuntao Wang Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , Networking , bpf , open list , "open list:KERNEL SELFTEST FRAMEWORK" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, Apr 5, 2022 at 9:39 AM Yuntao Wang wrote: > > The checks preceding CHECK macro are redundant, remove them. > > Signed-off-by: Yuntao Wang > --- > tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c > index 16048978a1ef..5f2ab720dabd 100644 > --- a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c > +++ b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c > @@ -76,10 +76,8 @@ static void get_stack_print_output(void *ctx, int cpu, void *data, __u32 size) > good_user_stack = true; > } > > - if (!good_kern_stack) > - CHECK(!good_kern_stack, "kern_stack", "corrupted kernel stack\n"); > - if (!good_user_stack) > - CHECK(!good_user_stack, "user_stack", "corrupted user stack\n"); > + CHECK(!good_kern_stack, "kern_stack", "corrupted kernel stack\n"); > + CHECK(!good_user_stack, "user_stack", "corrupted user stack\n"); I suspect it was to avoid super long verbose logs, as each CHECK() emits one line into output and here we might be getting a lot of samples. So let's keep it as is. But for the future let's try getting rid of CHECK()s as much as possible in favor of ASSERT_xxx(). Thanks. > } > > void test_get_stack_raw_tp(void) > -- > 2.35.1 >