Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756009AbbLGNaB (ORCPT ); Mon, 7 Dec 2015 08:30:01 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:60871 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755980AbbLGN37 (ORCPT ); Mon, 7 Dec 2015 08:29:59 -0500 From: Wang Nan To: , CC: , , , , , , , , Wang Nan Subject: [RFC PATCH v2 0/3] perf core/perf tools: Utilizing overwrite ring buffer Date: Mon, 7 Dec 2015 13:28:34 +0000 Message-ID: <1449494917-62970-1-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1449063499-236703-1-git-send-email-wangnan0@huawei.com> References: <1449063499-236703-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.56658995.008C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: dea443d2de5670af6f08b1738b5c2388 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1620 Lines: 42 This patch set explores the idea shown in [1], which puts size of every events at the end of them in ring buffer so user space tool like perf can parse the ring buffer backward and find the oldest event in it. In this version: - Kernel side, rename PERF_SAMPLE_SIZE to PERF_SAMPLE_SIZE_AT_END, output 8 bytes to meet the alignment requirement. - Perf side, provide a prototype utilize this feature. With this prototype users are allowed to capture the last events in an overwrite ring buffer using: # ./perf record -e dummy -e syscalls:*/overwrite/ ... [1] http://lkml.kernel.org/g/1449063499-236703-1-git-send-email-wangnan0@huawei.com Wang Nan (3): perf/core: Put size of a sample at the end of it perf tools: Enable overwrite settings perf record: Find tail pointer through size at end of event include/uapi/linux/perf_event.h | 3 +- kernel/events/core.c | 9 +++++ tools/perf/builtin-record.c | 76 +++++++++++++++++++++++++++++++++++++++-- tools/perf/perf.h | 2 ++ tools/perf/util/evlist.c | 42 +++++++++++++++++------ tools/perf/util/evsel.c | 7 ++++ tools/perf/util/evsel.h | 3 ++ tools/perf/util/parse-events.c | 14 ++++++++ tools/perf/util/parse-events.h | 4 ++- tools/perf/util/parse-events.l | 2 ++ 10 files changed, 147 insertions(+), 15 deletions(-) -- 1.8.3.4 -- 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/