Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3661255pxb; Mon, 24 Jan 2022 14:44:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMpLqvZA2b4jdv7R3Fqw+azHTMcElXQTj5tGYgqFzP3xo24upvXP8AXXw0ZtfRYtHve89p X-Received: by 2002:a05:6a00:1151:b0:4c4:b2c6:6060 with SMTP id b17-20020a056a00115100b004c4b2c66060mr15999205pfm.11.1643064169752; Mon, 24 Jan 2022 14:42:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643064169; cv=none; d=google.com; s=arc-20160816; b=nn4+ThOu5122Xo02+ziU35VZA0/XHOUb1U2u8PGHzGmD3PUOtBhR85nnMxjWXShjP0 4cNSu6UhS2vRCoU9tIA1WCLs20PIPPgmKbbixjWpRkBOJQHQ++j5KK48kaQNoSxM30tI tIth2mzVnlAXeUxJZ968vozdHibtt9FvQyK/KC/+B4rDuifvIuyJ0O7rhvrqIt9r9OXa I05M2PGwfY3RiVleAbeSM3APUkms7mIfDG4J10ojTPRLljlz9fex6pDQC/PlzmUkqMbF aAxPf0llmxOxUSxveWtqbSzfpN/XuiGdTjhCR/zVUEI7+dxYCIUCPVSK0pjjtEhC2JPD kSeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hUy5+d+rP80qvZ6BEOHMZ9pO7lCJ0YW971VSFEYGHKY=; b=sEGI7zgYo5ilQivRvotlBkTNPJeeCYO7jiF+t9+rlIT5kEkzeUaAB6h4OWKep3MLz5 FH3hEDeOwmbcjXqvUCQlQaTGCt9HONpTLm+KxJRIq2U42WgkgbT8Xp/9k7f+Ot/scWY3 3gIvdg3JQ5KsURDGPWsSPVRLgikdsFb7K6/b9EzxNy5txTIeYTZiR5s1WCD6DGVFD8mj AyEPSoMSIr/FfxfM2JhJ8c62QDa58498dUX2b+wR11rxvON4r66/ETXSZoD7KfzDchNA CdFKtRsDjMOlsJi66LNnwBOxfWcMyZPbyPnhvoHr9cT0btA3FgTFTX8DA1CwDzFPjUPY c0LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MfyUJjQA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si511883pjp.69.2022.01.24.14.42.37; Mon, 24 Jan 2022 14:42:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MfyUJjQA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1835082AbiAXWfj (ORCPT + 99 others); Mon, 24 Jan 2022 17:35:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377494AbiAXVhz (ORCPT ); Mon, 24 Jan 2022 16:37:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DC40C0BD134; Mon, 24 Jan 2022 12:24:11 -0800 (PST) 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 2B4A3614F5; Mon, 24 Jan 2022 20:24:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E47A3C340E5; Mon, 24 Jan 2022 20:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055850; bh=jQGBoTqr9shnkEu4/oGJtKoL0aT8tTQAr2VKPfxz14c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MfyUJjQAJQAWq09BSltEbl8a34HV9OfYaUpyz0ZPvym5n/37AZ0IkoqJuSHQCow04 ogU8DDggK0A3qboFQT+j5MCNeBCqVWIoNAkdegdXojWjsdRn2Opf5FPQUe0GxNrejW wlagtbvG/GOrpWRgQ4ImI5qoRLt37zCt+S7YCJ8M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quentin Monnet , Paul Chaignon , Andrii Nakryiko , Yonghong Song , Sasha Levin Subject: [PATCH 5.15 285/846] bpftool: Enable line buffering for stdout Date: Mon, 24 Jan 2022 19:36:42 +0100 Message-Id: <20220124184110.756508559@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Chaignon [ Upstream commit 1a1a0b0364ad291bd8e509da104ac8b5b1afec5d ] The output of bpftool prog tracelog is currently buffered, which is inconvenient when piping the output into other commands. A simple tracelog | grep will typically not display anything. This patch fixes it by enabling line buffering on stdout for the whole bpftool binary. Fixes: 30da46b5dc3a ("tools: bpftool: add a command to dump the trace pipe") Signed-off-by: Quentin Monnet Signed-off-by: Paul Chaignon Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211220214528.GA11706@Mem Signed-off-by: Sasha Levin --- tools/bpf/bpftool/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c index 02eaaf065f651..d27ec4f852bbb 100644 --- a/tools/bpf/bpftool/main.c +++ b/tools/bpf/bpftool/main.c @@ -402,6 +402,8 @@ int main(int argc, char **argv) }; int opt, ret; + setlinebuf(stdout); + last_do_help = do_help; pretty_output = false; json_output = false; -- 2.34.1