From patchwork Sat May 13 07:40:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changbin Du X-Patchwork-Id: 93482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5626006vqo; Sat, 13 May 2023 00:44:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hUxNVYbbkYKMQmYO9FOrZ7E557kvelZW0ad0pzZTdEWb776+UEkveagHiicxs3rBrUMCU X-Received: by 2002:a17:90b:1296:b0:24e:596:624f with SMTP id fw22-20020a17090b129600b0024e0596624fmr27428493pjb.22.1683963876025; Sat, 13 May 2023 00:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683963876; cv=none; d=google.com; s=arc-20160816; b=kTtX6Vow1hLw5Vea3TBr1nWXQGvjRsWrR9ypq2pBoEMoblhKFMlRmYe+oHXTZgUBXH 23TaSElzWYu60NHQ6NQ5nSaSFI55SJQHjAkXtl75z8xtIF5CC285fDIQZe3FLWfJbMat Y45Hj13TM6KcI5urPsLG7Z0I0zWqWk6RVYF/utGPfS+KrO75+4pxROz9WmRdKLNzr5js kRMk3Q+G5uUg07SB+EAoLTtRV77xCWW5RJ+1/l6f4KW/2fYV0tF3dIWjx3f05Jx3JgeY 0E5z0j3Wcahzuk1/amGl4EMsdu1qOSurPHGTmzXbuJRFHAF/lwG/PwQObSLFwF+kDvxj Sjbw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot18-20020a17090b3b5200b00250acbb4d02si12462744pjb.153.2023.05.13.00.44.16; Sat, 13 May 2023 00:44:36 -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 S230102AbjEMHkY (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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765764105307547175?= X-GMAIL-MSGID: =?utf-8?q?1765764105307547175?= 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); } }