From patchwork Tue Mar 8 13:10:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 12773788 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 18991C433EF for ; Tue, 8 Mar 2022 13:11:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DCCA8D0005; Tue, 8 Mar 2022 08:11:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 78CBE8D0001; Tue, 8 Mar 2022 08:11:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 655028D0005; Tue, 8 Mar 2022 08:11:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id 578B18D0001 for ; Tue, 8 Mar 2022 08:11:16 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0EC46A5A6F for ; Tue, 8 Mar 2022 13:11:16 +0000 (UTC) X-FDA: 79221254952.27.87D7DD0 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf22.hostedemail.com (Postfix) with ESMTP id 98384C000A for ; Tue, 8 Mar 2022 13:11:15 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id mg21-20020a17090b371500b001bef9e4657cso2231306pjb.0 for ; Tue, 08 Mar 2022 05:11:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XZ5/JOgeRQIev0F6iGnllvaw2Xpd0Vkw5vT4hctm9LE=; b=MTzlU8i+d5WWYrMR/nWgGDPhI0Em4aOWdkZfDtdNOw00rdj00RUcnaXU6V2LyUUEZs uytZymJYyJKFq5tGJQgjprgAXFsu5QRkBF6OWo/euJ16VdTVnjZkGDnyqLTR0lyrZSBw h5Arb4qABcrL/BaNajXPaUMfzI0qkN+KfnpEmZf2rvVifTSkWAL04xDLWGsrz8lc8yW8 ObYqT2lgYVecoJi2s3+Ein2cLceICEFBpFBM5B0xC/pXtTx84q823bHG2PZMUn7MZC5s pETcwE5r9uCYDYvA6rwRvvrqxfKH9ePkVqlQ/SyzRW5YaU2C80F/hj29fFRayl00Txkb H72Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=XZ5/JOgeRQIev0F6iGnllvaw2Xpd0Vkw5vT4hctm9LE=; b=wzq6fVxHAWOYKbvQNpJmTcjqjajYhceMiLbj3n6fKS7ti6+upjMR9vfQpigaFd23im 0rD3l/msnAGAFEWilvjAS4d2hVjRxxkz7kCuUHhzlqMv6ZGagratmM5LYsXsCeyquCIe A9HZKh7Rvo0N5r6B/lKHX1x2dTAH8K3vBaCecxh76LDmQXL0fG86q3vQxk7+sVJu8/63 yPO5S3mpHQbx3ZvM41efuahjmN4P9AU+qIh0QY1T0Km3An3oM6nj10Bcmza7mi70ncQz cb7c/ggDrfai+j4ZNXSppy4wkttPFXRs1g1TzzGiQaE0PTgck+k7ykAVVLJW6j9syLBK 7V5g== X-Gm-Message-State: AOAM531W8kgLhv/jhsKN/kE8TQ/Zzz7mYhuiMQ3OZGk/k/sqnB/CI65H sWJtbQd6N8et0+S2nQUI19M= X-Google-Smtp-Source: ABdhPJzP43L1ogB3N4skFJGzR1Jg8A1fcMH9gZ1HrLSlGaD86J9Ijh+wfhfk/iUZ4nBV95hjZmnXAA== X-Received: by 2002:a17:90a:6508:b0:1be:d59c:1f10 with SMTP id i8-20020a17090a650800b001bed59c1f10mr4518554pjj.229.1646745074658; Tue, 08 Mar 2022 05:11:14 -0800 (PST) Received: from vultr.guest ([149.248.19.67]) by smtp.gmail.com with ESMTPSA id s20-20020a056a00179400b004f709998d13sm7378598pfg.10.2022.03.08.05.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 05:11:14 -0800 (PST) From: Yafang Shao To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, akpm@linux-foundation.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, guro@fb.com Cc: linux-mm@kvack.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Yafang Shao , Joanne Koong Subject: [PATCH RFC 1/9] bpftool: fix print error when show bpf man Date: Tue, 8 Mar 2022 13:10:48 +0000 Message-Id: <20220308131056.6732-2-laoar.shao@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220308131056.6732-1-laoar.shao@gmail.com> References: <20220308131056.6732-1-laoar.shao@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 98384C000A X-Stat-Signature: ycd1opz7motrun5dgw816t6aifount1a Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=MTzlU8i+; spf=pass (imf22.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1646745075-693693 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: If there is no btf_id or frozen, it will not show the pids, but the pids doesn't depends on any one of them. Fixes: 9330986c0300 ("bpf: Add bloom filter map implementation") Signed-off-by: Yafang Shao Cc: Joanne Koong --- tools/bpf/bpftool/map.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index e746642..0bba337 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -620,17 +620,14 @@ static int show_map_close_plain(int fd, struct bpf_map_info *info) u32_as_hash_field(info->id)) printf("\n\tpinned %s", (char *)entry->value); } - printf("\n"); if (frozen_str) { frozen = atoi(frozen_str); free(frozen_str); } - if (!info->btf_id && !frozen) - return 0; - - printf("\t"); + if (info->btf_id || frozen) + printf("\n\t"); if (info->btf_id) printf("btf_id %d", info->btf_id);