From patchwork Wed Nov 1 05:53:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 117682 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp469775qgn; Tue, 31 Oct 2017 22:54:41 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SW2twxHFQYNQIjYJBgXHusJdUABbAOkK2b6IKjNQlKBaOPLG3RpCTeWQHh/kMuWy+cGONU X-Received: by 10.101.77.202 with SMTP id q10mr4713937pgt.306.1509515681502; Tue, 31 Oct 2017 22:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509515681; cv=none; d=google.com; s=arc-20160816; b=uuyPyazs1e8THGxH98QUfeLeok0mvkq232tS7qXrwjqWaBlFfCDxIqPborHUcj5pao R9sZNs9pSewBHQ3EX84Zf5wRaeRFp+Mw8ZVpQHnjgO3LBo1cs9ENcJV3+E7JHHNECR98 tkc4lrPan9B9/UsgVas5f/NXmWqP1xTB7bTyQmx/q4cWV7v+4UznGABteHm3BoOA5Vn/ OZIdbPiCRLeQs6pAjmwgqgAjgkGQw9lWvKTRvG0jvE4vpPcUFFzI7VVMLvd64y73s1zl uw69j7u1A48qisU80SCnuuuZkX86nLCEPT96Kaz/66OX1SDrZLDI8QxVSWvc+QrvTsD/ N8EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=UstU/Yd9Nh5RM7XHsvlazB8FouamZiMfE/9rp8NF9y8=; b=p4PLKknTyk8hQfX/hpCnTGTGFlpnj1xHJU1bPMp7veg+m8XyHqbnsaEjTbGGvOE8Rb kBCau87TxD8TfZn+UCf7dP62H90bVyqe7R7eCXP6gH4mE4DHSaqo/GI77UsObocibtMM MSiqW8M7yN9aV5XTThZ5he1+XoZseOlKsxuKkIx21T7MptfHx6QCoofRU5ht8FETZmj/ IrhVQ3w/Ojmmja9paNe01huavZsMtBWBb+iDb5a+FPwmwVAflIEp0uozq/WAArnA5Xan bO7oVU4nlm5rUSa0k4Jcyhx4zrwk9OOORsFxaf0VoaHaoS8zwivE7sQv42Gl2iv3c7fn 4o1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si3638414pgs.442.2017.10.31.22.54.41; Tue, 31 Oct 2017 22:54:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754073AbdKAFyj (ORCPT + 27 others); Wed, 1 Nov 2017 01:54:39 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9922 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbdKAFy1 (ORCPT ); Wed, 1 Nov 2017 01:54:27 -0400 Received: from 172.30.72.59 (EHLO DGGEMS412-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKC46199; Wed, 01 Nov 2017 13:54:14 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.361.1; Wed, 1 Nov 2017 13:54:01 +0800 From: Wang Nan To: , , , , CC: Wang Nan Subject: [PATCH 1/2] perf mmap: Fix perf backward recording Date: Wed, 1 Nov 2017 05:53:26 +0000 Message-ID: <20171101055327.141281-2-wangnan0@huawei.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20171101055327.141281-1-wangnan0@huawei.com> References: <20171101055327.141281-1-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.59F96187.0067, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0e76426a0b5de28effbcb35d0705f778 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org perf record backward recording doesn't work as we expected: it never overwrite when ring buffer full. Test: (Run a busy printing python task background like this: while True: print 123 send SIGUSR2 to perf to capture snapshot.) # ./perf record --overwrite -e raw_syscalls:sys_enter -e raw_syscalls:sys_exit --exclude-perf -a --switch-output [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2017110101520743 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2017110101521251 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2017110101521692 ] ^C[ perf record: Woken up 1 times to write data ] [ perf record: Dump perf.data.2017110101521936 ] [ perf record: Captured and wrote 0.826 MB perf.data. ] # ./perf script -i ./perf.data.2017110101520743 | head -n3 perf 2717 [000] 12449.310785: raw_syscalls:sys_enter: NR 16 (5, 2400, 0, 59, 100, 0) perf 2717 [000] 12449.310790: raw_syscalls:sys_enter: NR 7 (4112340, 2, ffffffff, 3df, 100, 0) python 2545 [000] 12449.310800: raw_syscalls:sys_exit: NR 1 = 4 # ./perf script -i ./perf.data.2017110101521251 | head -n3 perf 2717 [000] 12449.310785: raw_syscalls:sys_enter: NR 16 (5, 2400, 0, 59, 100, 0) perf 2717 [000] 12449.310790: raw_syscalls:sys_enter: NR 7 (4112340, 2, ffffffff, 3df, 100, 0) python 2545 [000] 12449.310800: raw_syscalls:sys_exit: NR 1 = 4 # ./perf script -i ./perf.data.2017110101521692 | head -n3 perf 2717 [000] 12449.310785: raw_syscalls:sys_enter: NR 16 (5, 2400, 0, 59, 100, 0) perf 2717 [000] 12449.310790: raw_syscalls:sys_enter: NR 7 (4112340, 2, ffffffff, 3df, 100, 0) python 2545 [000] 12449.310800: raw_syscalls:sys_exit: NR 1 = 4 Timestamps are never change, but my background task is a dead loop, can easily overwhelme the ring buffer. This patch fix it by force unsetting PROT_WRITE for backward ring buffer, so all backward ring buffer become overwrite ring buffer. Test result: # ./perf record --overwrite -e raw_syscalls:sys_enter -e raw_syscalls:sys_exit --exclude-perf -a --switch-output [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2017110101285323 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2017110101290053 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2017110101290446 ] ^C[ perf record: Woken up 1 times to write data ] [ perf record: Dump perf.data.2017110101290837 ] [ perf record: Captured and wrote 0.826 MB perf.data. ] # ./perf script -i ./perf.data.2017110101285323 | head -n3 python 2545 [000] 11064.268083: raw_syscalls:sys_exit: NR 1 = 4 python 2545 [000] 11064.268084: raw_syscalls:sys_enter: NR 1 (1, 12cc330, 4, 7fc237280370, 7fc2373d0700, 2c7b0) python 2545 [000] 11064.268086: raw_syscalls:sys_exit: NR 1 = 4 # ./perf script -i ./perf.data.2017110101290 | head -n3 failed to open ./perf.data.2017110101290: No such file or directory # ./perf script -i ./perf.data.2017110101290053 | head -n3 python 2545 [000] 11071.564062: raw_syscalls:sys_enter: NR 1 (1, 12cc330, 4, 7fc237280370, 7fc2373d0700, 2c7b0) python 2545 [000] 11071.564064: raw_syscalls:sys_exit: NR 1 = 4 python 2545 [000] 11071.564066: raw_syscalls:sys_enter: NR 1 (1, 12cc330, 4, 7fc237280370, 7fc2373d0700, 2c7b0) # ./perf script -i ./perf.data.2017110101290 | head -n3 perf.data.2017110101290053 perf.data.2017110101290446 perf.data.2017110101290837 # ./perf script -i ./perf.data.2017110101290446 | head -n3 sshd 1321 [000] 11075.499473: raw_syscalls:sys_exit: NR 14 = 0 sshd 1321 [000] 11075.499474: raw_syscalls:sys_enter: NR 14 (2, 7ffe98899490, 0, 8, 0, 3000) sshd 1321 [000] 11075.499474: raw_syscalls:sys_exit: NR 14 = 0 # ./perf script -i ./perf.data.2017110101290837 | head -n3 python 2545 [000] 11079.280844: raw_syscalls:sys_exit: NR 1 = 4 python 2545 [000] 11079.280847: raw_syscalls:sys_enter: NR 1 (1, 12cc330, 4, 7fc237280370, 7fc2373d0700, 2c7b0) python 2545 [000] 11079.280850: raw_syscalls:sys_exit: NR 1 = 4 Signed-off-by: Wang Nan --- tools/perf/util/evlist.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.10.1 diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index c6c891e..4c5daba 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -799,22 +799,28 @@ perf_evlist__should_poll(struct perf_evlist *evlist __maybe_unused, } static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx, - struct mmap_params *mp, int cpu_idx, + struct mmap_params *_mp, int cpu_idx, int thread, int *_output, int *_output_backward) { struct perf_evsel *evsel; int revent; int evlist_cpu = cpu_map__cpu(evlist->cpus, cpu_idx); + struct mmap_params *mp; evlist__for_each_entry(evlist, evsel) { struct perf_mmap *maps = evlist->mmap; + struct mmap_params rdonly_mp; int *output = _output; int fd; int cpu; + mp = _mp; if (evsel->attr.write_backward) { output = _output_backward; maps = evlist->backward_mmap; + rdonly_mp = *_mp; + rdonly_mp.prot &= ~PROT_WRITE; + mp = &rdonly_mp; if (!maps) { maps = perf_evlist__alloc_mmap(evlist); From patchwork Wed Nov 1 05:53:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 117683 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp469827qgn; Tue, 31 Oct 2017 22:54:45 -0700 (PDT) X-Google-Smtp-Source: ABhQp+R+FDoF0XnjvbmmkILeXbrGNyXabjjLGYmQQTwC4Vbb+kRuvJuGRjAX41/RMvvv147lsCSg X-Received: by 10.98.13.157 with SMTP id 29mr5186335pfn.160.1509515685722; Tue, 31 Oct 2017 22:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509515685; cv=none; d=google.com; s=arc-20160816; b=Wn5ETSNAbiuoxji6GzSuKGp340bNXt9RDpln4czfeE9gd88jtmqUHIxOZmWqOkiKWI ro6DnOYdYkEqE7zQjEcQw7WPKQUl6APp6cWFGxDou3LZ9V15HoTb4N2nrUOj6Ydvgr8F bRs7KdNf2nnL3WCKBBo5VHQplL++OkOLxrHOq3XrSi6+pYjBAzktG9V/V5u/Cl6esrAZ m7nva77R1tVEAAeHsnny5st7aVcfqVPoYUNdr70I47WfXad67Na7Vao3D0NMXFJV2FQq OUjG2Em0NGZUuTqyDZn4etDB+8bB1oP1iGTVWaARCIrBv4Mzd2qhBiXirf6U4ZdEJWMJ dAsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=X6dm/duOhDyac1f9/FBOYPnRxA7TNxZn7HHaRc1Y9Y4=; b=o93xTsJJ76DW6IR3QSr/XtKNha+sILellPzYXN1+kXZHiFZf3u3WMrRiaPI0nUblVl jxnKUzRdc8QbwA3wi+fH1vWbIHUr+obO1hYWBmAdVv8YnWUL6wX2TMilF5o7vDfL+lZN aDH0uY90eAt2DSdZhS1RObLZ0V70nGuPNWihPiJTq1tul25W3udAMJozHfskmfjE1S+u ge7FBZ75ZRgnyCdXX33Rnl3uI8fg+J4xNrMxwKnbhN6o5ES0YxzDJV6rtG7wcd8PG9Yq dbDc7DUlsCBD3e74XIWuNaTldJrDVYbn4072GSBVRAkUCR9V0Uac0j36EUp9/FOBvx2O Kuaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f86si3877762pfe.565.2017.10.31.22.54.45; Tue, 31 Oct 2017 22:54:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754177AbdKAFyo (ORCPT + 27 others); Wed, 1 Nov 2017 01:54:44 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9923 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbdKAFyl (ORCPT ); Wed, 1 Nov 2017 01:54:41 -0400 Received: from 172.30.72.59 (EHLO DGGEMS412-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKC46201; Wed, 01 Nov 2017 13:54:14 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.361.1; Wed, 1 Nov 2017 13:54:01 +0800 From: Wang Nan To: , , , , CC: Wang Nan Subject: [PATCH 2/2] perf record: Replace 'overwrite' by 'flightrecorder' for better naming Date: Wed, 1 Nov 2017 05:53:27 +0000 Message-ID: <20171101055327.141281-3-wangnan0@huawei.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20171101055327.141281-1-wangnan0@huawei.com> References: <20171101055327.141281-1-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.59F96187.0006, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a5d4b6fe28620c9f652b8dd93a92ad0b Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The meaning of perf record's "overwrite" option and many "overwrite" in source code are not clear. In perf's code, the 'overwrite' has 2 meanings: 1. Make ringbuffer readonly (perf_evlist__mmap_ex's argument). 2. Set evsel's "backward" attribute (in apply_config_terms). perf record doesn't use meaning 1 at all, but have a overwrite option, its real meaning is setting backward. This patch separates these two concepts, introduce 'flightrecorder' mode which is what we really want. It combines these 2 concept together, wraps them into a record mode. In flight recorder mode, perf only dumps data before something happen. Signed-off-by: Wang Nan --- tools/perf/Documentation/perf-record.txt | 8 ++++---- tools/perf/builtin-record.c | 4 ++-- tools/perf/perf.h | 2 +- tools/perf/util/evsel.c | 6 +++--- tools/perf/util/evsel.h | 4 ++-- tools/perf/util/parse-events.c | 20 ++++++++++---------- tools/perf/util/parse-events.h | 4 ++-- tools/perf/util/parse-events.l | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) -- 2.10.1 diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 5a626ef..463c2d3 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -467,19 +467,19 @@ the beginning of record, collect them during finalizing an output file. The collected non-sample events reflects the status of the system when record is finished. ---overwrite:: +--flight-recorder:: Makes all events use an overwritable ring buffer. An overwritable ring buffer works like a flight recorder: when it gets full, the kernel will overwrite the oldest records, that thus will never make it to the perf.data file. -When '--overwrite' and '--switch-output' are used perf records and drops +When '--flight-recorder' and '--switch-output' are used perf records and drops events until it receives a signal, meaning that something unusual was detected that warrants taking a snapshot of the most current events, those fitting in the ring buffer at that moment. -'overwrite' attribute can also be set or canceled for an event using -config terms. For example: 'cycles/overwrite/' and 'instructions/no-overwrite/'. +'flightrecorder' attribute can also be set or canceled separately for an event using +config terms. For example: 'cycles/flightrecorder/' and 'instructions/no-flightrecorder/'. Implies --tail-synthesize. diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index f4d9fc5..315ea09 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1489,7 +1489,7 @@ static struct option __record_options[] = { "child tasks do not inherit counters"), OPT_BOOLEAN(0, "tail-synthesize", &record.opts.tail_synthesize, "synthesize non-sample events at the end of output"), - OPT_BOOLEAN(0, "overwrite", &record.opts.overwrite, "use overwrite mode"), + OPT_BOOLEAN(0, "flight-recoder", &record.opts.flight_recorder, "use flight recoder mode"), OPT_UINTEGER('F', "freq", &record.opts.user_freq, "profile at this frequency"), OPT_CALLBACK('m', "mmap-pages", &record.opts, "pages[,pages]", "number of mmap data pages and AUX area tracing mmap pages", @@ -1733,7 +1733,7 @@ int cmd_record(int argc, const char **argv) } } - if (record.opts.overwrite) + if (record.opts.flight_recorder) record.opts.tail_synthesize = true; if (rec->evlist->nr_entries == 0 && diff --git a/tools/perf/perf.h b/tools/perf/perf.h index fbb0a9c..a7f7618 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -57,7 +57,7 @@ struct record_opts { bool all_kernel; bool all_user; bool tail_synthesize; - bool overwrite; + bool flight_recorder; bool ignore_missing_thread; unsigned int freq; unsigned int mmap_pages; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f894893..0e1e8e8 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -772,8 +772,8 @@ static void apply_config_terms(struct perf_evsel *evsel, */ attr->inherit = term->val.inherit ? 1 : 0; break; - case PERF_EVSEL__CONFIG_TERM_OVERWRITE: - attr->write_backward = term->val.overwrite ? 1 : 0; + case PERF_EVSEL__CONFIG_TERM_FLIGHTRECORDER: + attr->write_backward = term->val.flightrecorder ? 1 : 0; break; default: break; @@ -856,7 +856,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, attr->sample_id_all = perf_missing_features.sample_id_all ? 0 : 1; attr->inherit = !opts->no_inherit; - attr->write_backward = opts->overwrite ? 1 : 0; + attr->write_backward = opts->flight_recorder ? 1 : 0; perf_evsel__set_sample_bit(evsel, IP); perf_evsel__set_sample_bit(evsel, TID); diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 64782b1..115b637 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -45,7 +45,7 @@ enum { PERF_EVSEL__CONFIG_TERM_STACK_USER, PERF_EVSEL__CONFIG_TERM_INHERIT, PERF_EVSEL__CONFIG_TERM_MAX_STACK, - PERF_EVSEL__CONFIG_TERM_OVERWRITE, + PERF_EVSEL__CONFIG_TERM_FLIGHTRECORDER, PERF_EVSEL__CONFIG_TERM_DRV_CFG, PERF_EVSEL__CONFIG_TERM_BRANCH, PERF_EVSEL__CONFIG_TERM_MAX, @@ -63,7 +63,7 @@ struct perf_evsel_config_term { u64 stack_user; int max_stack; bool inherit; - bool overwrite; + bool flightrecorder; char *branch; } val; }; diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 04f35db..61ae3d3 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -914,8 +914,8 @@ static const char *config_term_names[__PARSE_EVENTS__TERM_TYPE_NR] = { [PARSE_EVENTS__TERM_TYPE_NOINHERIT] = "no-inherit", [PARSE_EVENTS__TERM_TYPE_INHERIT] = "inherit", [PARSE_EVENTS__TERM_TYPE_MAX_STACK] = "max-stack", - [PARSE_EVENTS__TERM_TYPE_OVERWRITE] = "overwrite", - [PARSE_EVENTS__TERM_TYPE_NOOVERWRITE] = "no-overwrite", + [PARSE_EVENTS__TERM_TYPE_FLIGHTRECORDER] = "flightrecorder", + [PARSE_EVENTS__TERM_TYPE_NOFLIGHTRECORDER] = "no-flightrecorder", [PARSE_EVENTS__TERM_TYPE_DRV_CFG] = "driver-config", }; @@ -1013,10 +1013,10 @@ do { \ case PARSE_EVENTS__TERM_TYPE_NOINHERIT: CHECK_TYPE_VAL(NUM); break; - case PARSE_EVENTS__TERM_TYPE_OVERWRITE: + case PARSE_EVENTS__TERM_TYPE_FLIGHTRECORDER: CHECK_TYPE_VAL(NUM); break; - case PARSE_EVENTS__TERM_TYPE_NOOVERWRITE: + case PARSE_EVENTS__TERM_TYPE_NOFLIGHTRECORDER: CHECK_TYPE_VAL(NUM); break; case PARSE_EVENTS__TERM_TYPE_NAME: @@ -1072,8 +1072,8 @@ static int config_term_tracepoint(struct perf_event_attr *attr, case PARSE_EVENTS__TERM_TYPE_INHERIT: case PARSE_EVENTS__TERM_TYPE_NOINHERIT: case PARSE_EVENTS__TERM_TYPE_MAX_STACK: - case PARSE_EVENTS__TERM_TYPE_OVERWRITE: - case PARSE_EVENTS__TERM_TYPE_NOOVERWRITE: + case PARSE_EVENTS__TERM_TYPE_FLIGHTRECORDER: + case PARSE_EVENTS__TERM_TYPE_NOFLIGHTRECORDER: return config_term_common(attr, term, err); default: if (err) { @@ -1149,11 +1149,11 @@ do { \ case PARSE_EVENTS__TERM_TYPE_MAX_STACK: ADD_CONFIG_TERM(MAX_STACK, max_stack, term->val.num); break; - case PARSE_EVENTS__TERM_TYPE_OVERWRITE: - ADD_CONFIG_TERM(OVERWRITE, overwrite, term->val.num ? 1 : 0); + case PARSE_EVENTS__TERM_TYPE_FLIGHTRECORDER: + ADD_CONFIG_TERM(FLIGHTRECORDER, flightrecorder, term->val.num ? 1 : 0); break; - case PARSE_EVENTS__TERM_TYPE_NOOVERWRITE: - ADD_CONFIG_TERM(OVERWRITE, overwrite, term->val.num ? 0 : 1); + case PARSE_EVENTS__TERM_TYPE_NOFLIGHTRECORDER: + ADD_CONFIG_TERM(FLIGHTRECORDER, flightrecorder, term->val.num ? 0 : 1); break; case PARSE_EVENTS__TERM_TYPE_DRV_CFG: ADD_CONFIG_TERM(DRV_CFG, drv_cfg, term->val.str); diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index 3909ca0..cd0b4eae 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -70,8 +70,8 @@ enum { PARSE_EVENTS__TERM_TYPE_NOINHERIT, PARSE_EVENTS__TERM_TYPE_INHERIT, PARSE_EVENTS__TERM_TYPE_MAX_STACK, - PARSE_EVENTS__TERM_TYPE_NOOVERWRITE, - PARSE_EVENTS__TERM_TYPE_OVERWRITE, + PARSE_EVENTS__TERM_TYPE_NOFLIGHTRECORDER, + PARSE_EVENTS__TERM_TYPE_FLIGHTRECORDER, PARSE_EVENTS__TERM_TYPE_DRV_CFG, __PARSE_EVENTS__TERM_TYPE_NR, }; diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index 38a42bd..7710d6d 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -251,8 +251,8 @@ stack-size { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_STACKSIZE); } max-stack { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_MAX_STACK); } inherit { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_INHERIT); } no-inherit { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_NOINHERIT); } -overwrite { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_OVERWRITE); } -no-overwrite { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_NOOVERWRITE); } +flightrecorder { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_FLIGHTRECORDER); } +no-flightrecorder { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_NOFLIGHTRECORDER); } , { return ','; } "/" { BEGIN(INITIAL); return '/'; } {name_minus} { return str(yyscanner, PE_NAME); }