Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754471AbbKXN4I (ORCPT ); Tue, 24 Nov 2015 08:56:08 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:16614 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754265AbbKXNz5 (ORCPT ); Tue, 24 Nov 2015 08:55:57 -0500 From: Yunlong Song To: , , , CC: , , , , , , , , , , , , , Subject: [PATCH] perf record: Add snapshot mode support for perf's regular events Date: Tue, 24 Nov 2015 22:00:31 +0800 Message-ID: <1448373632-8806-1-git-send-email-yunlong.song@huawei.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.110.52.30] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.56546C1D.0133,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9cdbb3f6764a1a9cbb1d10640f75389b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1667 Lines: 42 This idea is issued and motivated from: https://lwn.net/Articles/650499/ After the first RFC is sent: http://lkml.iu.edu/hypermail/linux/kernel/1509.2/04347.html Both David Ahern and Borislav Petkov have replied to that RFC: http://lkml.iu.edu/hypermail/linux/kernel/1509.2/04350.html http://lkml.iu.edu/hypermail/linux/kernel/1509.2/03914.html Thanks to David's and Borislav's advice. However, David's perf-based scheduling daemon just makes some count when the signal triggers perf sched, with no sample recording and has nothing to do with perf.data. As for Borislav's persistent events, when perf record runs, it just makes fd to attach to the persistent event to read, and all the persistent event's tracing info will still dump to perf.data during perf's running. As a result, neither David's nor Borislav's patches makes the similar snapshot mode support as what aux trace does. In our patch, we create and maintain a user space ring buffer to store perf's tracing info, instead of directly writing to perf.data file as before. In snapshot mode, only a SIGUSR2 signal can trigger perf to dump the tracing info currently stored in the user space ring buffer to perf.data file. Yunlong Song (1): perf record: Add snapshot mode support for perf's regular events tools/perf/builtin-record.c | 181 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 170 insertions(+), 11 deletions(-) -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/