Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp313754pxa; Fri, 14 Aug 2020 05:11:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJhz2oWxkI4c65goi8X/ACZxOwBnMlfdeStl4+iPorRwrNiERc6LG/hSsztzRxD4iPXayx X-Received: by 2002:a17:906:3449:: with SMTP id d9mr2162524ejb.460.1597407112416; Fri, 14 Aug 2020 05:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597407112; cv=none; d=google.com; s=arc-20160816; b=eAEB9787DI2qD9/tUI7/LyUxN8pxGxkluXuLvaK48Wwyx01sWsCtBUm8bCSU6Wcvej TtvXl2cqNQzWb/qRkyPtiqi3YT1uOL7izlID8j7fv0cDHAesN1rEA5bQGV/csmrabWST i2CAFO4oySoDmsikJjKDmmHo5Ebrl7dckkW6nhoOOuV7/GdVp2j5d1euBCcmhjvPsOmC a0OHPwnh0/RBK1SxZ8iU7NUrSP3FdA19Quj++Vltt8CYuLndvT1yhoC7ru28pVcunuIK Q93Tx00k9Jf+BSv1yPMSN3HNQTnR1ZMBgWhCp3Zy8Bhh/nzL9r2n4JNjrQX+8QQ/UPDg itiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=R65oJYA9hnEv126KHEkUlhn9Ts0VheMR0+jV8aJ6XPI=; b=RnMfCKfYFWBy0bP3pEHoHTLIFzsQUkFqPTqxaCVQ1l5QIulHigoRUzu5LbiuKnBPQE Z532ZfA+ctiVaRHA+1fcBa4EFoekiV18bikUoIgFvJFg5vGrmtpRW4ubAORJpNdDm8Jz ZT2paUMGLrdxJ99vwdan+Em/Mjeb2+5nAbo5YmAwYYnAOWL1L8ZsiD4tObxU4dW0Dzlc EOUUxJNOCP54WQ0maR9GsYDCE86taBykLyPfhRtUOgTV+WLgb9p3yLZtefPUd/FuDl0+ 9czC4kn9gxXhMFhbirX+C5RWzmSDKiJVRThURexa1bgHWcXIEU8eynIEYweJTUcbYlx0 gfkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MhYFmMmT; 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 h13si5265094edv.463.2020.08.14.05.11.29; Fri, 14 Aug 2020 05:11:52 -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=@kernel.org header.s=default header.b=MhYFmMmT; 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 S1727081AbgHNL46 (ORCPT + 99 others); Fri, 14 Aug 2020 07:56:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:35892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbgHNL45 (ORCPT ); Fri, 14 Aug 2020 07:56:57 -0400 Received: from quaco.ghostprotocols.net (177.207.136.251.dynamic.adsl.gvt.net.br [177.207.136.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1177F2087D; Fri, 14 Aug 2020 11:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597406217; bh=hkpf/361hnS8vR6XPC1zBp4odiSk8ry8EEsr8Lr4bWc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MhYFmMmTIMdh7RUwKBPRYU9OKkFP6e+UC6pobd+PVuasUyc2Q/D9wxuZ/94Xmembz 5GL9DkdtjvTeXQUwepFo/ETQDZhNly4BKWbJV6v5/HXOdsAEsTvu2Ao4mhH3VF+Fxe 2Lb3vuAoquryaLGPghwteznnM02i9qlx41cr8laY= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 199124097F; Fri, 14 Aug 2020 08:56:55 -0300 (-03) Date: Fri, 14 Aug 2020 08:56:55 -0300 From: Arnaldo Carvalho de Melo To: Changbin Du Cc: Jiri Olsa , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 05/18] perf ftrace: show trace column header Message-ID: <20200814115655.GU13995@kernel.org> References: <20200808023141.14227-1-changbin.du@gmail.com> <20200808023141.14227-6-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200808023141.14227-6-changbin.du@gmail.com> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sat, Aug 08, 2020 at 10:31:28AM +0800, Changbin Du escreveu: > 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 We have: # perf report -h header Usage: perf report [] --header Show data header. --header-only Show only data header. # So perhaps we should have those as well, in the 'ftrace' case one would perhaps want to use --no-header, for instance, to do some scripting parsing just the trace lines. - Arnaldo > 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 a3a4f4be9dde..39c694be2b71 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -435,6 +435,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 > -- - Arnaldo