Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3592742pxb; Mon, 24 Jan 2022 13:03:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyO7clC5p+mQa/diG0STMbjaWd26ybsyrTVwZ3EiggIC03KbNDNUdQaqDL9grtGQ4EZAvgU X-Received: by 2002:a17:903:182:b0:14b:47b8:92e7 with SMTP id z2-20020a170903018200b0014b47b892e7mr7573241plg.49.1643058195803; Mon, 24 Jan 2022 13:03:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058195; cv=none; d=google.com; s=arc-20160816; b=iJq/clxvd4gfslYevy73vXL/0z0paJjSbat+B0GOd6l1ewMg7Y/gQYiP/ylr8jfB5w 2tg8kJjS4slhsaCGmTSBP7AP4Au9TXdMj6r9HtkuARjXYwB0KPb78JQHwrk6XuzAbqN6 LHqKsWJJcERTEa7ivGfi/kHoxIn+RrPWHragYbUMrYd93PyK9q3mrRssn/tSxw2dXLmc y4MbDkvZAlhjK1xVaRA/+rPTPCE+cumTUElBzCSZT6c/5S6E9brrBpRg1gW/pU46i+I5 0dAOSEfQgtRkN443J2rylhxVPuT7miF/ogphGuCApQXGcwMyVBxMW77kOQU2XckySfoJ mzEw== 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=BwZgYf69axjOCYWdWGhQk/eTrx7fOf31AntmOVwKHlg=; b=MSwb6COIw2phzlFeTGGtxqGBM7Om0NjomBKC6eoxgCPvGDi0W4MUDOfEvs8XQI3WhU PLkXKyeFmMrxGhoYD+UMqEbH/1d7dv0uC6HtUX+rp8jzKO3jinig0xdADm76pWol2dC/ 8ri2kTagDH839lcAYlig+Qg2wTShhZZHR2FJ81cR1de8zSXugtO9m+4gcljcZtv50F+W EalcsUWzhCGkF/CITs0wbKSAbC+Ig9D8j8VEtzDxTGPNwPI8hC568hpbBc3bj/xF3/9J fakKpVTd6Y0R26w4L5VFADwKkDVFV8fvls7eZUYSP/RZn7QlcsMgvKE2asHEa8nW4+l2 Wiqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jCe0lorc; 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 k7si14568050pff.339.2022.01.24.13.03.03; Mon, 24 Jan 2022 13:03:15 -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=jCe0lorc; 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 S1382441AbiAXUZo (ORCPT + 99 others); Mon, 24 Jan 2022 15:25:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376681AbiAXUDd (ORCPT ); Mon, 24 Jan 2022 15:03:33 -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 F41AEC0619D2; Mon, 24 Jan 2022 11:30:02 -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 91C2B614BE; Mon, 24 Jan 2022 19:30:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9390FC340E5; Mon, 24 Jan 2022 19:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052602; bh=tZrs0Jt+SIkesNUNBAwCsJLLP2xGRVcbKR9NellZksk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jCe0lorceJvyg1mu7IGsBu+evQQ9TOpSQesfxk1od7oUO+TaUSqrywAUs5s1ti6zO DCH1Ns3dbBKaypQtk7WIETIRSvt4uqvKyZTw/M5SGCIJI6mFNWt13ZLjwirlxei2k3 eOqjQU4jVov8R7vXkh/C/Iiep9WJS2Y3LmNZpao0= 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.4 096/320] bpftool: Enable line buffering for stdout Date: Mon, 24 Jan 2022 19:41:20 +0100 Message-Id: <20220124183956.994730693@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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 7d3cfb0ccbe61..4b03983acbefe 100644 --- a/tools/bpf/bpftool/main.c +++ b/tools/bpf/bpftool/main.c @@ -362,6 +362,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