From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: "Jiri Olsa" <jolsa@kernel.org>,
"Namhyung Kim" <namhyung@kernel.org>,
"Clark Williams" <williams@redhat.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
"Arnaldo Carvalho de Melo" <acme@redhat.com>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"Amir Goldstein" <amir73il@gmail.com>,
"Brendan Gregg" <brendan.d.gregg@gmail.com>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Luis Cláudio Gonçalves" <lclaudio@redhat.com>
Subject: [PATCH 18/41] perf beauty: Add generator for sync_file_range's 'flags' arg values
Date: Wed, 29 May 2019 10:35:42 -0300 [thread overview]
Message-ID: <20190529133605.21118-19-acme@kernel.org> (raw)
In-Reply-To: <20190529133605.21118-1-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
$ tools/perf/trace/beauty/sync_file_range.sh
static const char *sync_file_range_flags[] = {
[ilog2(1) + 1] = "WAIT_BEFORE",
[ilog2(2) + 1] = "WRITE",
[ilog2(4) + 1] = "WAIT_AFTER",
};
$
When all are the above are present, then we have something called
SYNC_FILE_RANGE_WRITE_AND_WAIT, that will be special cased in the
upcoming scnprintf beautifier for this flags arg.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-uf2vd7bc8fkz65j7yit8dh84@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/trace/beauty/sync_file_range.sh | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100755 tools/perf/trace/beauty/sync_file_range.sh
diff --git a/tools/perf/trace/beauty/sync_file_range.sh b/tools/perf/trace/beauty/sync_file_range.sh
new file mode 100755
index 000000000000..7a9282d04e44
--- /dev/null
+++ b/tools/perf/trace/beauty/sync_file_range.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1
+
+if [ $# -ne 1 ] ; then
+ linux_header_dir=tools/include/uapi/linux
+else
+ linux_header_dir=$1
+fi
+
+linux_fs=${linux_header_dir}/fs.h
+
+printf "static const char *sync_file_range_flags[] = {\n"
+regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+SYNC_FILE_RANGE_([[:alnum:]_]+)[[:space:]]+([[:xdigit:]]+)[[:space:]]*.*'
+egrep $regex ${linux_fs} | \
+ sed -r "s/$regex/\2 \1/g" | \
+ xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
+printf "};\n"
--
2.20.1
next prev parent reply other threads:[~2019-05-29 13:35 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-29 13:35 [GIT PULL] perf/core improvements and fixes for 5.3 Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 01/41] perf-with-kcore.sh: Always allow fix_buildid_cache_permissions Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 02/41] perf intel-pt: Fix itrace defaults for perf script Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 03/41] perf auxtrace: " Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 04/41] perf intel-pt: Fix itrace defaults for perf script intel-pt documentation Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 05/41] perf machine: Keep zero in pgoff BPF map Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 06/41] perf tools: Preserve eBPF maps when loading kcore Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 07/41] perf augmented_raw_syscalls: Fix up comment Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 08/41] perf beauty: Add generator for 'move_mount' flags argument Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 09/41] perf trace: Beautify 'move_mount' arguments Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 10/41] perf beauty: Add generator for fspick's 'flags' arg values Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 11/41] perf trace: Beautify 'fspick' arguments Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 12/41] perf beauty: Add generator for fsconfig's 'cmd' arg values Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 13/41] perf trace: Beautify 'fsconfig' arguments Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 14/41] perf beauty: Add generator for fsmount's 'attr_flags' arg values Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 15/41] perf trace: Introduce syscall_arg__scnprintf_strarray_flags Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 16/41] perf trace: Beautify 'fsmount' arguments Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 17/41] perf trace beauty clone: Handle CLONE_PIDFD Arnaldo Carvalho de Melo
2019-05-29 14:49 ` Christian Brauner
2019-05-29 13:35 ` Arnaldo Carvalho de Melo [this message]
2019-05-29 13:35 ` [PATCH 19/41] perf trace: Beautify 'sync_file_range' arguments Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 20/41] perf top: Add --namespaces option Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 21/41] perf tools: Remove const from thread read accessors Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 22/41] perf dso: Separate generic code in dso__data_file_size() Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 23/41] perf dso: Separate generic code in dso_cache__read Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 24/41] perf dso: Simplify dso_cache__read function Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 25/41] perf dso: Add BPF DSO read and size hooks Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 26/41] perf script: Pad DSO name for --call-trace Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 27/41] perf tests: Add map_groups__merge_in test Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 28/41] perf script: Add --show-bpf-events to show eBPF related events Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 29/41] perf script: Remove superfluous BPF event titles Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 30/41] perf version: Append 12 git SHA chars to the version string Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 31/41] perf machine: Return NULL instead of null-terminating /proc/version array Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 32/41] perf annotate TUI browser: Do not use member from variable within its own initialization Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 33/41] perf python: Remove -fstack-protector-strong if clang doesn't have it Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 34/41] perf top: Lower message level for failure on synthesizing events for pre-existing BPF programs Arnaldo Carvalho de Melo
2019-05-29 13:35 ` [PATCH 35/41] perf scripts python: exported-sql-viewer.py: Change python2 to python Arnaldo Carvalho de Melo
2019-05-29 13:36 ` [PATCH 36/41] perf scripts python: exported-sql-viewer.py: Use argparse module for argument parsing Arnaldo Carvalho de Melo
2019-05-29 13:36 ` [PATCH 37/41] perf scripts python: exported-sql-viewer.py: Add support for pyside2 Arnaldo Carvalho de Melo
2019-05-29 13:36 ` [PATCH 38/41] perf scripts python: export-to-sqlite.py: " Arnaldo Carvalho de Melo
2019-05-29 13:36 ` [PATCH 39/41] perf scripts python: export-to-postgresql.py: " Arnaldo Carvalho de Melo
2019-05-29 13:36 ` [PATCH 40/41] perf intel-pt: Improve sync_switch by processing PERF_RECORD_SWITCH* in events Arnaldo Carvalho de Melo
2019-05-29 13:36 ` [PATCH 41/41] perf intel-pt: Rationalize intel_pt_sync_switch()'s use of next_tid Arnaldo Carvalho de Melo
2019-05-30 7:50 ` [GIT PULL] perf/core improvements and fixes for 5.3 Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190529133605.21118-19-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=amir73il@gmail.com \
--cc=brendan.d.gregg@gmail.com \
--cc=jolsa@kernel.org \
--cc=lclaudio@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).