Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2070902ybt; Thu, 2 Jul 2020 23:24:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl6JiuFvXIXPnWxM7RzcQ81mlnQ3MQdKPaE+RpSRt3VvjvIBudCbn/yf3PvRlcBlmh5vAT X-Received: by 2002:a05:6402:21c2:: with SMTP id bi2mr38464655edb.296.1593757462873; Thu, 02 Jul 2020 23:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593757462; cv=none; d=google.com; s=arc-20160816; b=Dw5FoPxCtNxgY1vbqYyY0o6O/8vsfbwMbv4pYKGCxUzPwxCi8LmKkdzYlbyUi2z+kA ZS4ZCA2CeMb38H3kEd+n6F/mey+B45HkL3cRc9BiJ8Fe/D5U31oqe9y1xsx40yMXUh/F wKk3Hy5EEfdWNOoCzK/ezLboeEOW9ZwcNMR/6Jp7f9B+KrxIO/3pSraKTxFwdNHbDuua nnzwSY4ZvQfPwrOufvCl7IYYQw8rBamc6a/JhJJhzzLRqW/m3bJAad7W/rbTK0A6Dr8u KFai7EV5CbQOAf7jdlzvIC9cG7Y02m2wV/mE6FqxWzpm1zU0KOZ1jICMR1SCefHE+NFN iiIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=TKEHFmW5PoKwUEizfUZ1NRPfkPR7fHNgTYGl98X6WEs=; b=FxG+nbZ0F8gzM40haDIHXp3YTCy72FNagqCebydyNzzQDThXFw0jNNve0n0/alT8NQ PcHgwiYLldMY3r1GpNVNX4iLy3vOoiO0hdLIASvwKKpl3wfC5jEbAeZG5t7LwzlB3+g7 Iz3jcKXkHEm2QoICksS6xfUN9i9zvTdHHMp7jtHiWH+3zSnuDMJ9AnvtLqLYlkNDjLxw mo7bFtFYYX5agBdYPp6oTNB/nDEgsSBnTG7w4+s8B4BZzi2WOgjZoG2rdqI7+1puvqxJ 7qxqrK9uM9Qe3f9d6nRpiegGU/Of/ztVjVjPpqDPh/aJFSeS2dHmdkbooy7cRKnHGZ0f QUHQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qw23si7189778ejb.231.2020.07.02.23.23.59; Thu, 02 Jul 2020 23:24:22 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726504AbgGCGU2 (ORCPT + 99 others); Fri, 3 Jul 2020 02:20:28 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37631 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbgGCGU2 (ORCPT ); Fri, 3 Jul 2020 02:20:28 -0400 Received: by mail-wm1-f65.google.com with SMTP id o2so32552035wmh.2 for ; Thu, 02 Jul 2020 23:20:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TKEHFmW5PoKwUEizfUZ1NRPfkPR7fHNgTYGl98X6WEs=; b=R9S3TO1Ji+XPB5uFGukX8Tly5LAOReSNIQNRAvFLjoGaDNiFDDTi8vM/re78aj1mLf BwBwxAUgxVyh9wDcn7dqdrGy0E8UvEMVhQvpEpkg2zhnLGiKy7z2MR3ImKb9rzFBNaNt FtHU4pZAyWZnEsM8i4ndGZkBK6QsDn27H2NVBgiRLqJQ+lXduNBHwyuWmwdRwasohCV7 Tyhx3Hq9R2gWT4soVH4HGRKH6qYDYbirU1IJZnqBOUUDHpgL0rMYEKWX5dLCbZOaTjbU Xq3ku1ElXISYQL2QmL9xVNv8CtYpS3I4NWydxy3EIN7AyIVAfyc4AdgKxRYrTiXcKMEi IqCA== X-Gm-Message-State: AOAM532GP2ogq9xuA2ZdkVTqzQfvfn+hp3UReikugvd6/RuILnpir3+l PY9zWakN/bL6EftFJVmzC+c6NZG4A9aIAP9iG08= X-Received: by 2002:a1c:6308:: with SMTP id x8mr36575458wmb.92.1593757226326; Thu, 02 Jul 2020 23:20:26 -0700 (PDT) MIME-Version: 1.0 References: <20200627133654.64863-1-changbin.du@gmail.com> <20200627133654.64863-8-changbin.du@gmail.com> In-Reply-To: <20200627133654.64863-8-changbin.du@gmail.com> From: Namhyung Kim Date: Fri, 3 Jul 2020 15:20:15 +0900 Message-ID: Subject: Re: [PATCH v2 07/15] perf ftrace: show trace column header To: Changbin Du Cc: Jiri Olsa , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Steven Rostedt , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 27, 2020 at 10:38 PM Changbin Du wrote: > > 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 You'd better indent the example output by 2 spaces to prevent the # signs commented out. Thanks Namhyung > > 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 e45496012611..686d744d5025 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -430,6 +430,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 >