Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752593AbcDNX7U (ORCPT ); Thu, 14 Apr 2016 19:59:20 -0400 Received: from mail.kernel.org ([198.145.29.136]:45961 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752290AbcDNX7T (ORCPT ); Thu, 14 Apr 2016 19:59:19 -0400 Date: Thu, 14 Apr 2016 20:59:13 -0300 From: Arnaldo Carvalho de Melo To: Wang Nan Cc: linux-kernel@vger.kernel.org, pi3orama@163.com, He Kuang , Arnaldo Carvalho de Melo , Adrian Hunter , Jiri Olsa , Masami Hiramatsu , Namhyung Kim , Zefan Li Subject: Re: [PATCH v2 2/6] perf record: Split output into multiple files via '--switch-output' Message-ID: <20160414235913.GK9056@kernel.org> References: <1460643725-167413-1-git-send-email-wangnan0@huawei.com> <1460643725-167413-3-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460643725-167413-3-git-send-email-wangnan0@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1675 Lines: 47 Em Thu, Apr 14, 2016 at 02:22:01PM +0000, Wang Nan escreveu: > Allow 'perf record' splits its output into multiple files. > > For example: > > # ~/perf record -a --timestamp-filename --switch-output & > [1] 10763 > # kill -s SIGUSR2 10763 > [ perf record: dump data: Woken up 1 times ] > # [ perf record: Dump perf.data.2015122622314468 ] > > # kill -s SIGUSR2 10763 > [ perf record: dump data: Woken up 1 times ] > # [ perf record: Dump perf.data.2015122622314762 ] > > # kill -s SIGUSR2 10763 > [ perf record: dump data: Woken up 1 times ] > #[ perf record: Dump perf.data.2015122622315171 ] > > # fg > perf record -a --timestamp-filename --switch-output > ^C[ perf record: Woken up 1 times to write data ] > [ perf record: Dump perf.data.2015122622315513 ] > [ perf record: Captured and wrote 0.014 MB perf.data. (296 samples) ] Added this as an initial man page entry: diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 19aa17532a16..a77a431ca4ef 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -347,6 +347,14 @@ Configure all used events to run in kernel space. --all-user:: Configure all used events to run in user space. +--switch-output:: +Generate multiple perf.data files, timestamp prefixed, switching to a new one +when receiving a SIGUSR2. + +A possible use case is to, given an external event, slice the perf.data file +that gets then processed, possibly via a perf script, to decide if that +particular perf.data snapshot should be kept or not. + SEE ALSO -------- linkperf:perf-stat[1], linkperf:perf-list[1]