From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaldo Carvalho de Melo Subject: [PATCH 12/41] perf beauty: Add generator for fsconfig's 'cmd' arg values Date: Wed, 29 May 2019 10:35:36 -0300 Message-ID: <20190529133605.21118-13-acme@kernel.org> References: <20190529133605.21118-1-acme@kernel.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20190529133605.21118-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Ingo Molnar , Thomas Gleixner Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , Al Viro , Brendan Gregg , David Howells List-Id: linux-perf-users.vger.kernel.org From: Arnaldo Carvalho de Melo $ tools/perf/trace/beauty/fsconfig.sh static const char *fsconfig_cmds[] = { [0] = "SET_FLAG", [1] = "SET_STRING", [2] = "SET_BINARY", [3] = "SET_PATH", [4] = "SET_PATH_EMPTY", [5] = "SET_FD", [6] = "CMD_CREATE", [7] = "CMD_RECONFIGURE", }; $ Cc: Adrian Hunter Cc: Al Viro Cc: Brendan Gregg Cc: David Howells Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-u721396rkqmawmt91dwwsntu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/trace/beauty/fsconfig.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 tools/perf/trace/beauty/fsconfig.sh diff --git a/tools/perf/trace/beauty/fsconfig.sh b/tools/perf/trace/beauty/fsconfig.sh new file mode 100755 index 000000000000..83fb24df05c9 --- /dev/null +++ b/tools/perf/trace/beauty/fsconfig.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_mount=${linux_header_dir}/mount.h + +printf "static const char *fsconfig_cmds[] = {\n" +regex='^[[:space:]]*+FSCONFIG_([[:alnum:]_]+)[[:space:]]*=[[:space:]]*([[:digit:]]+)[[:space:]]*,[[:space:]]*.*' +egrep $regex ${linux_mount} | \ + sed -r "s/$regex/\2 \1/g" | \ + xargs printf "\t[%s] = \"%s\",\n" +printf "};\n" -- 2.20.1