Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp711752ybt; Wed, 8 Jul 2020 09:48:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL7Jk5EhNdizGtHPikKzmlZb2ZojUelN8JD47rw+wAce3x9Pct668eLZyLmDC1ktxVQpTX X-Received: by 2002:a17:907:7245:: with SMTP id ds5mr55581653ejc.67.1594226924472; Wed, 08 Jul 2020 09:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594226924; cv=none; d=google.com; s=arc-20160816; b=zwC25PFzTcUmo2FDZ27ZjMlLINK+S0zg2Qzpxc9G0fO58oD9Wa1BUSOmFC2wjgOr6J DSeRjrBk/OVV3LRdVRBDPL9DUf368a7zTLrBoHl1Oz+eWvtYt8EHSSQ0egFkhc09re7P I+zQnmNAR/FjmIeV2LVNhrwHE8Tgs5afLXImO867+mGypVkMrPw+WbRhdoj/AXccKRZm zmcS0kWO8aT8x/4uDPo2sSqV4vw5/Ktb8K19jslV5vXQWqmaoqvyjOwHYG88YNHE3LXD 81jsZA0S9o2ojFMW29FPKlq04rZKzmfeFrOBvk53qsRcyYVTffP1oIgbaCAttTrD4awz xRDA== 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=s45sz+Z8KdGsC2ioG3kBV+tM8Qtg7G2jwvxo8x0+od0=; b=sltSQVoQsTZqMbz0grzWygzIMkD/UKKNEF1Dz7A1uC9AGvz7P0FEce8e1u+39+TFWZ 6LyFTU/0qTVvVF0mjeAfvInKWP04eZyXHbxz2sOtkMw5YK833jVf60ig7juL4beXgWJS X9h4V3vsmn5FlgZ3a2HOQ/jnHlvsUpPDrUCwnixd64z9MbgDFbbNtZUSETLOmjz7Jy5M 8HSF7kwbgt0xGE1gaEyFQ49an7gimKsLYGtb+P9CBpH6AoLYLP0N+/wVq0v/ixBfveZS IqexZ3fZWYALE7saTzSZ+GQRK+A10wUh3pnlwYnCeZi4nszUk7i/9VEGj7TzQGWA7IG5 IRZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g9adpdB2; 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 w24si216632ejk.712.2020.07.08.09.48.20; Wed, 08 Jul 2020 09:48:44 -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=g9adpdB2; 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 S1730784AbgGHQrh (ORCPT + 99 others); Wed, 8 Jul 2020 12:47:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730349AbgGHQrh (ORCPT ); Wed, 8 Jul 2020 12:47:37 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43D81C061A0B for ; Wed, 8 Jul 2020 09:47:37 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id gc9so1465246pjb.2 for ; Wed, 08 Jul 2020 09:47:37 -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=s45sz+Z8KdGsC2ioG3kBV+tM8Qtg7G2jwvxo8x0+od0=; b=g9adpdB2KUE0/2J/XBeus8WExt+IJ3lERYY9+yyJm7DSo5z0n6sj/hSJRQRC2oE4DT YfjeUeUmmycRmXbM/SXsMJ++n7eEV3vrxds3rChIVw3Xb50vINZWwI6SzrHLG/Mw9J+M FNhVRTKEN8UWuSExoM7HDqDxwCLiIYR6HHcCekKamvpOGcHWpy5YKvMzDIdguH6koD2X fR0KXLOOrJ/+E02GKoA2FjV28OZpbDLDEmJvT49/OSFHtQm3hlISqZgYw1J0AQ3oZ7Qu 2O3PZajRDR2kHhjT2hMtLlVSdjXSBmK6/9UhyxW85XFaqTn/vazbhbRaJrJDx6K71pCt IaEw== 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=s45sz+Z8KdGsC2ioG3kBV+tM8Qtg7G2jwvxo8x0+od0=; b=dpMuFrk0bUTzNPwsvezJhq4NUl7fDlVHE+7ZuQnp+uGpZrQPBZrmxEaGa/bBbx3sLO +6VrnRp04ANxf19/InHMizWQG23kdHh287rQdAOcvI6PvHaiwq6WRoBcxzl3XOd4Kjvw 48nrkbwQTthN+YjmuLbAVulIKGG3XtZD6/8DP1ujGgnRPkkRR5kLrbNRnhMMXYzaeJY+ QHnsUqUo4z/Wifpbgco2D8rfDxK6Dj+PV6mF1d08GkZe5469NJzVcVVzwTGTJi7X1t0b 3qiAivQ70RtsCA/u5A0IoGAfBoQqUA/hXwu57hkEYXBPZx5L68Zg4y8O21ZHYsk6CaH9 jR9A== X-Gm-Message-State: AOAM530n02R/7noA5ej6ZRQtz4sIQWLdI1LxwUKIoDdmD4yNDBqRTjUQ kHOg9JTuTxVe+MFjaQevRIM= X-Received: by 2002:a17:90a:b901:: with SMTP id p1mr9665049pjr.134.1594226856858; Wed, 08 Jul 2020 09:47:36 -0700 (PDT) Received: from vultr.guest ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id r8sm310803pfg.147.2020.07.08.09.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 09:47:36 -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 v3 07/17] perf ftrace: show trace column header Date: Thu, 9 Jul 2020 00:45:55 +0800 Message-Id: <20200708164605.31245-8-changbin.du@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200708164605.31245-1-changbin.du@gmail.com> References: <20200708164605.31245-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 66cdfe42b1fe..885d11f369fc 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -431,6 +431,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 (!ftrace->initial_delay) { if (write_tracing_file("tracing_on", "1") < 0) { pr_err("can't enable tracing\n"); -- 2.25.1