Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp11309914rwr; Sat, 13 May 2023 00:44:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Sc/kz1rNdBRHINBusT5EGFzJPUi8LprmJ4QZw1gPmkvbFVCvDtkXxNPqYfWS3OXoe479/ X-Received: by 2002:a05:6a21:32a8:b0:100:60f3:2975 with SMTP id yt40-20020a056a2132a800b0010060f32975mr26558629pzb.4.1683963860577; Sat, 13 May 2023 00:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683963860; cv=none; d=google.com; s=arc-20160816; b=PfQfusd7A3kxCTkTUmpGiJkvdT/TbQPTbn1M11vSMstBGqMF/aXGN6TCx4meqpx7Gg aPdJSrqfhQYJpcE0l/CyB18WW1iSKKNzT7K9SAeW5fzA+yXooGwSHLru22MUD0F7ykcR xPyXhJx7Frw8wsGP1pM5hoJxERQLNFxGWU5R6gD8QfNX8arAaLCwRQFW2AWuGwJXT9TA AlpRNh21zJ1xNenjfHjY8l8shCp81hrgYNndVJrGUjA8VdqUrNvCtnaqzUW3Mho6Uo8r mqix8ynfgrmds4K8kvLr3r+cdIknI1Hme+QcWIBTBchLOFcu8PrhPH5AbB1iK+DQvj2r BXXg== 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 :message-id:date:subject:cc:to:from; bh=bkL3uLkZsv4F24Xse9Bv92pWiPJg/nYXdxp2H+RwqE4=; b=RhSe9jkI9bXvePn8+LltX2i4Fom0E5ivF61JJ5Av2/qHkSf1MMGy57MxiRYmzfwBX4 speDFtRWVgaJUpkG5apd0jRNleoF1wy1yuOJu2WGhvfJdE8swfpOCRDVNx54qImdYawB 8TmldIre8z5485If9A/OUy/QCGMB7mEeSYRUl0TXOaI42edXk8flu81b2XbON1M/Zcgu Q5O9m0zstRcc3FTgCYoB+Ewwx6k7Q0Ex7kkfwuwvf31B6lGyeFDt4qbl48bh66mQeF2n aF9kQkRINN1RZsEvFnl+9wB2IX6l1y57KicbVgNfECN0+GSQxVil2HwCEv4fPZ4xbdUX 8ydA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v7-20020aa799c7000000b006434e20d023si11717424pfi.399.2023.05.13.00.44.01; Sat, 13 May 2023 00:44:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230084AbjEMHkY (ORCPT + 99 others); Sat, 13 May 2023 03:40:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbjEMHkV (ORCPT ); Sat, 13 May 2023 03:40:21 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A70135B5; Sat, 13 May 2023 00:40:17 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QJHVl3wxQz18LQJ; Sat, 13 May 2023 15:35:59 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemi500013.china.huawei.com (7.221.188.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 13 May 2023 15:40:13 +0800 From: Changbin Du To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo CC: Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , , , Changbin Du Subject: [PATCH] perf: ftrace: flush output after each writing Date: Sat, 13 May 2023 15:40:00 +0800 Message-ID: <20230513074000.733550-1-changbin.du@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.110.54.157] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500013.china.huawei.com (7.221.188.120) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 The pager will result stdout in full buffering mode instead of line buffering. We need to make the trace visible timely. Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 810e3376c7d6..ad2a9ae041f6 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -650,6 +650,8 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace) break; if (fwrite(buf, n, 1, stdout) != 1) break; + /* flush output since stdout is in full buffering mode due to pager */ + fflush(stdout); } } -- 2.25.1