Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3705500pxb; Mon, 24 Jan 2022 15:54:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7xBRPKxSbIzYLHk2MevGq38ks+7eXeuj8ykDxTxGH8B9fF+qmqzjtp4p4zJGE5lGl9DV+ X-Received: by 2002:a17:90a:a393:: with SMTP id x19mr746298pjp.196.1643068467127; Mon, 24 Jan 2022 15:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068467; cv=none; d=google.com; s=arc-20160816; b=wR3r8EAmizZ8eisew4wNyYzBGgbYZnkgXcTy9bEE5bIVZrEA2EFBEtchZR1GbaZB6L chK9TD5Q5pzXzpjxGyNty2UhI7NjTjX7YTshN/M78YuGW7fvY5KPAb3A5XIIlYJVXemp mN+/YOU4bu3ZgeM+tdVTPejH4QovtQPIN9fgGOTASoKSsnqvpKbbnihkw4+bX9BV58Lu QnJ/wi3/FwBT1QzkujhnBw9yOZWV0roGdypg0OTpHxBKqqm3aHIhCcE6Z/ZCHQjq0uIJ Ukz4FKHnh9inQxD90itdaLiVik+7dmNwt6afbNcIDFGxKhyzf1EPCxllmx8brRARUyjK a4nw== 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=kPBQpxBSTfIA4x+71U25bn3jzpabvvBOYgc+1BqO1co=; b=uuFk1LByRE7ECBbeu2UH+/orp7jAP/xQRyb0WDy6OlI/hRVXL/bwxjXFTsw3ryuXxj KgsjYcphXHDoljWT90Z9BpTRIwGZiJcF8X7ivUhnx2COKYYm0ygnLSrumGOZlJIZq7vR fWInfkWLb811jWXoT/O9k/NcNG5LvhaQjls3OdB64u7Plq4PrnCOYieHWw9rbhV6rkpz 7TmY93UpKQqEEYi04weL81OJtcy/v8U0uFMWLh/XXRoZ44KokfUe9hnyMAK2J9nwDCKi 7/JUynhtj+shu4NDCIjfvyFBqLkyhOD7DJuWSHALxJsxenOTwDnFrrCy0yGFasKJfgOL SQyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i52JiI3T; 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 32si637298pjz.151.2022.01.24.15.54.15; Mon, 24 Jan 2022 15:54:27 -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=i52JiI3T; 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 S2364206AbiAXXrA (ORCPT + 99 others); Mon, 24 Jan 2022 18:47:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356424AbiAXWz7 (ORCPT ); Mon, 24 Jan 2022 17:55:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78006C0680BD; Mon, 24 Jan 2022 13:10:05 -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 ams.source.kernel.org (Postfix) with ESMTPS id 401AAB810BD; Mon, 24 Jan 2022 21:10:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58E52C340E5; Mon, 24 Jan 2022 21:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058603; bh=GenLxtxLRHNWfA86dEZ+thJRET1S9HTGCB7UNjRlrEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i52JiI3TTBbe8kszDIbz5mnNnirjtwDoK5q661/dXpzXlGrqlckxUU639KUh3BgHd /DOSeg+cMPK2iDsPHCRzpUzytbi0mM/eeopgOTx9hSGEzm80Y0roFa3AzD3oNbjexP Mk46JPpXSMczI85bUMwU/fRoh6O2/MXwc6gfpdlg= 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.16 0343/1039] bpftool: Enable line buffering for stdout Date: Mon, 24 Jan 2022 19:35:32 +0100 Message-Id: <20220124184136.830520895@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 28237d7cef67f..8fbcff9d557d9 100644 --- a/tools/bpf/bpftool/main.c +++ b/tools/bpf/bpftool/main.c @@ -400,6 +400,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