linux_dsm_epyc7002/tools/perf/trace/beauty
Vitaly Chikunov 486642baea perf beauty: Fix fsconfig generator
[ Upstream commit 2e1daee14e67fbf9b27280b974e2c680a22cabea ]

After gnulib update sed stopped matching `[[:space:]]*+' as before,
causing the following compilation error:

  In file included from builtin-trace.c:719:
  trace/beauty/generated/fsconfig_arrays.c:2:3: error: expected expression before ']' token
      2 |  [] = "",
	|   ^
  trace/beauty/generated/fsconfig_arrays.c:2:3: error: array index in initializer not of integer type
  trace/beauty/generated/fsconfig_arrays.c:2:3: note: (near initialization for 'fsconfig_cmds')

Fix this by correcting the regular expression used in the generator.
Also, clean up the script by removing redundant egrep, xargs, and printf
invocations.

Committer testing:

Continues to work:

  $ cat tools/perf/trace/beauty/fsconfig.sh
  #!/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"
  ms='[[:space:]]*'
  sed -nr "s/^${ms}FSCONFIG_([[:alnum:]_]+)${ms}=${ms}([[:digit:]]+)${ms},.*/\t[\2] = \"\1\",/p" \
  	${linux_mount}
  printf "};\n"
  $ 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",
  };
  $

Fixes: d35293004a ("perf beauty: Add generator for fsconfig's 'cmd' arg values")
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lore.kernel.org/lkml/20210414182723.1670663-1-vt@altlinux.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-14 09:50:38 +02:00
..
include/linux perf trace beauty: Add script to autogenerate socket families table 2020-08-12 08:38:36 -03:00
tracepoints perf trace beauty: Add the glue for the autogenerated x86 IRQ vector array 2019-10-15 16:13:27 -03:00
arch_errno_names.c perf util: Introduce architecture specific errno/name mapping 2018-01-23 09:51:37 -03:00
arch_errno_names.sh perf beauty: Allow the CC used in the arch errno names script to acccept CFLAGS 2020-05-28 10:03:26 -03:00
arch_prctl.c perf trace beauty: Beautify arch_prctl()'s arguments 2018-12-18 16:15:19 -03:00
beauty.h perf beauty prctl: Export the 'options' strarray 2020-02-11 16:41:50 -03:00
Build perf trace beauty: Add the glue for the autogenerated MSR arrays 2019-10-09 11:23:52 -03:00
clone.c tools headers UAPI: Sync sched.h with the kernel 2020-04-14 09:01:08 -03:00
drm_ioctl.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
eventfd.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
fadvise.sh perf beauty: Add generator for fadvise64's 'advice' arg constants 2018-12-18 16:17:41 -03:00
fcntl.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
flock.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
fsconfig.sh perf beauty: Fix fsconfig generator 2021-05-14 09:50:38 +02:00
fsmount.c perf trace: Beautify 'fsmount' arguments 2019-05-28 18:37:43 -03:00
fsmount.sh perf beauty: Add generator for fsmount's 'attr_flags' arg values 2019-05-28 18:37:43 -03:00
fspick.c perf trace: Beautify 'fspick' arguments 2019-05-28 18:37:42 -03:00
fspick.sh perf beauty: Add generator for fspick's 'flags' arg values 2019-05-28 18:37:42 -03:00
futex_op.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
futex_val3.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
ioctl.c perf trace beauty ioctl: Fix off-by-one error in cmd->string table 2019-08-26 11:58:29 -03:00
kcmp_type.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
kcmp.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
kvm_ioctl.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
madvise_behavior.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
mmap_flags.sh perf beauty mmap_flags: Conditionaly define the mmap flags 2020-09-30 09:34:20 -03:00
mmap_prot.sh tools beauty: Add script to generate table of mmap's 'prot' argument 2020-10-01 11:14:22 -03:00
mmap.c perf trace: Use the autogenerated mmap 'prot' string/id table 2020-10-01 11:35:01 -03:00
mode_t.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
mount_flags.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
mount_flags.sh perf beauty: Switch from using uapi/linux/fs.h to uapi/linux/mount.h 2019-01-08 14:09:33 -03:00
move_mount_flags.sh perf beauty: Add generator for 'move_mount' flags argument 2019-05-28 18:37:42 -03:00
move_mount.c perf trace: Beautify 'move_mount' arguments 2019-05-28 18:37:42 -03:00
mremap_flags.sh perf trace beauty: Add script to autogenerate mremap's flags args string/id table 2020-09-29 18:07:27 -03:00
msg_flags.c perf beauty msg_flags: Add missing %s lost when adding prefix suppression logic 2019-03-01 15:45:35 -03:00
open_flags.c perf trace beauty: Print O_RDONLY when (flags & O_ACCMODE) == 0 2018-12-18 16:07:42 -03:00
perf_event_open.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
perf_ioctl.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
pid.c perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
pkey_alloc_access_rights.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
pkey_alloc.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
prctl_option.sh tools beauty: Make the prctl option table generator catch all PR_ options 2019-01-03 15:16:04 -03:00
prctl.c perf beauty prctl: Export the 'options' strarray 2020-02-11 16:41:50 -03:00
rename_flags.sh perf beauty: Add a string table generator for renameat2's flags constants 2018-12-18 12:23:55 -03:00
renameat.c perf trace beauty renameat: No need to include linux/fs.h 2019-04-01 14:49:24 -03:00
sched_policy.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
seccomp.c perf trace: Use correct SECCOMP prefix spelling, "SECOMP_*" -> "SECCOMP_*" 2018-12-28 16:32:54 -03:00
signum.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
sndrv_ctl_ioctl.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
sndrv_pcm_ioctl.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
sockaddr.c perf trace beauty: Use the autogenerated protocol family table 2020-08-12 08:43:51 -03:00
socket_ipproto.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
socket_type.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
socket.c perf trace: Allow asking for not suppressing common string prefixes 2018-12-18 16:07:42 -03:00
socket.sh perf trace beauty: Add script to autogenerate socket families table 2020-08-12 08:38:36 -03:00
statx.c perf beauty: Add support to STATX_MNT_ID in the 'statx' syscall 'mask' argument 2020-06-09 12:40:03 -03:00
sync_file_range.c perf trace: Beautify 'sync_file_range' arguments 2019-05-28 18:37:43 -03:00
sync_file_range.sh perf beauty: Add generator for sync_file_range's 'flags' arg values 2019-05-28 18:37:43 -03:00
usbdevfs_ioctl.sh tools perf beauty: Fix usbdevfs_ioctl table generator to handle _IOC() 2019-07-29 09:03:42 -03:00
vhost_virtio_ioctl.sh perf beauty: Switch from GPL v2.0 to LGPL v2.1 2018-10-30 11:46:23 -03:00
waitid_options.c perf beauty waitid options: Fix up prefix showing logic 2019-02-14 13:31:12 -03:00
x86_arch_prctl.sh perf beauty: Add a string table generator for x86's 'arch_prctl' codes 2018-12-18 16:15:18 -03:00