Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1169280ybk; Sun, 10 May 2020 08:14:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJd9JodjbECnF8O1bVTbymc+tw1g85YyiFQv5or85azCZ/juZSY6DegCNX1so7zvUctrd/m X-Received: by 2002:a17:907:2711:: with SMTP id w17mr6941545ejk.8.1589123652137; Sun, 10 May 2020 08:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589123652; cv=none; d=google.com; s=arc-20160816; b=qkViLhCnNkVzYChvTizSyCIAv7JmYo0el5MJrI2kMV/kILAk4NVyKlFw5pGbDsv+Pi 4wigLi+hfV+MZBhzJkF6pk83WWk9ahWmUSfSI5X/yMHMO8gWgVRhdf470Ku44SVHUPJp Z2/S6q8cPxtAcovzCv0n0W7EuaM6OpjeVnOSLdZRrw7ZVOliSo+OXANzUdOXvOidE72Q bJg5mBOcaE2Kkwk6QBoNukDqw3QLu+HBG3sp0+PgLohyuUf3g6IUXU6L8tjr6xmZV4B6 usgUAmAcY733YOWN+hO+qNjqVpdwLjERZs/H1S7gv/cKV40N9HYyKV82oyVnytmNr5tT yzAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Mz7kzAVMLVz/EHdToDqGn101jLvr6T6IM36BMJ7mrM4=; b=lZ2F480BX0VgLS2ET/3JcwbHAWK+m6zCilVyTsG4xjWa4Ny80p1w32Ij71XPhneZWi jP/SinTP8MabJdnbCpD9zhBliOw9tGwQrTxqKuCC3E5WzeM9KCMNcscsS1UyY6YxKmJ+ HCDOiI7uBStffHISk15WMfFjNBoaE9wWQTUqG1eZW75EUJ3X41Xv2JJkDqqj/c4okwEd wtpXzp4FoFVjnew0gcXhb6OBYh3Lj4OhAChkoUI8dzbMkMpsQQgxAQiSPUBTMT6Imrel cqDCByLhvPheUBwUqwZHl2LU28VQVcE6WFMrZtXw2wsL3DDgIwYjPR8mtAuQvgIFhf9s z4PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zb8f1kDK; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si4446965edi.440.2020.05.10.08.13.49; Sun, 10 May 2020 08:14:12 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=Zb8f1kDK; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729277AbgEJPKF (ORCPT + 99 others); Sun, 10 May 2020 11:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbgEJPKE (ORCPT ); Sun, 10 May 2020 11:10:04 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3F0FC061A0C for ; Sun, 10 May 2020 08:10:03 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 18so3502547pfv.8 for ; Sun, 10 May 2020 08:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mz7kzAVMLVz/EHdToDqGn101jLvr6T6IM36BMJ7mrM4=; b=Zb8f1kDKF7bcBAUYAk+PVAKw97EUwmqnLbmZdNFAWKjkugw/IA8u7A9E8IVBteIuGa iplbkUNDyYvQfeMqH1eNrd9cgM7LRw0cZu+PGQRifc2V0bM9kGjH5JQk+hEMNkHqJPIP 0z0p9JEr9MCE1tSxi7+MFWmQ/4O14uMlr9Bv/iwlnRwkLLEd0YAR1aR2VlZWOlUHfmCB V/jXtDUxmC3R9mK/8uZT6nL5jOkMIFqMR2kd8e/p+z1l4BfddNFja/FHdWbKu2IBuwgR Jarbdx+2pl2K8K9JJFcf1fKi7/blicFXML06QwgEg7/B6g4+dxZtAkrXtBrTXZnolVNI k2Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mz7kzAVMLVz/EHdToDqGn101jLvr6T6IM36BMJ7mrM4=; b=ZvHoHaT7fHB0rPkRa43uP57ckM0P75P11PCyaD6LzuquF69fsIcbFzmSnPNxl3dxOr id37VfkCLOdtmzE3SDNf8XQ16hJ3gidmbQ76SARTNVfqPUbXEZLa8l0wUfr46rvvi5rL g4vJzb2GeamjaFYGvQ6qLALgrhQWjWX4VirOs0UiL8het+HhnRxI3c8oFRmC0PIP8yDp FgCMaGtgy+c5DomrtuLOoqV6ZhPNdjgaukdDSOnbZ9bunFu5vhBc5fpLWPwpze0rNpCZ dEC4HUKK1Vk/Sx2obLjcpRkGscEaQiyfgh3Mzadt6XcVHYe7dYSC5e+wN7nl5FNIoqOP u60A== X-Gm-Message-State: AGi0PuabgLEWFzPDB8XSXT8xYwy8kWjI7KavYghs+McomZDUE3cy1KS5 D83dYljqgmvGV+pxRl0S008= X-Received: by 2002:a65:5641:: with SMTP id m1mr10371834pgs.18.1589123403495; Sun, 10 May 2020 08:10:03 -0700 (PDT) Received: from vultr.guest ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id v7sm6870909pfm.146.2020.05.10.08.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 08:10:02 -0700 (PDT) From: Changbin Du To: Jiri Olsa , Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Ingo Molnar , Namhyung Kim , Steven Rostedt , linux-kernel@vger.kernel.org, Changbin Du Subject: [PATCH 15/19] perf ftrace: show trace column header Date: Sun, 10 May 2020 23:06:24 +0800 Message-Id: <20200510150628.16610-16-changbin.du@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200510150628.16610-1-changbin.du@gmail.com> References: <20200510150628.16610-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This makes perf-ftrace display column header before printing trace. $ sudo perf ftrace \# tracer: function \# \# entries-in-buffer/entries-written: 0/0 #P:8 \# \# TASK-PID CPU# TIMESTAMP FUNCTION \# | | | | | <...>-9246 [006] 10726.262760: mutex_unlock <-rb_simple_write <...>-9246 [006] 10726.262764: __fsnotify_parent <-vfs_write <...>-9246 [006] 10726.262765: fsnotify <-vfs_write <...>-9246 [006] 10726.262766: __sb_end_write <-vfs_write <...>-9246 [006] 10726.262767: fpregs_assert_state_consistent <-do_syscall_64 Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 64c22f367ba2..0b39b6a88026 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -614,6 +614,9 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) fcntl(trace_fd, F_SETFL, O_NONBLOCK); pollfd.fd = trace_fd; + /* display column headers */ + read_tracing_file_to_stdout("trace"); + if (write_tracing_file("tracing_on", "1") < 0) { pr_err("can't enable tracing\n"); goto out_close_fd; -- 2.25.1