summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2022-11-22 20:38:26 +0100
committerAlejandro Colomar <alx@kernel.org>2022-11-22 20:38:30 +0100
commitc3752af0549c4de1bbd76fd7707692ce17e51511 (patch)
tree834c7946e73ee73f28e3bbd27510014a22fc16ae /scripts
parentbb108fd06fc3d2365e59c581a726d64d5cec4dc3 (diff)
bash_aliases: Remove grep_syscall(), grep_syscall_def(), and grep_glibc_prototype()
The functionality of those shell functions is covered by the grepc(1) program: <http://www.alejandro-colomar.es/src/alx/alx/grepc.git/>. The program has several bug fixes that these shell functions didn't receive. It also has more useful features. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bash_aliases80
1 files changed, 0 insertions, 80 deletions
diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index f325542f8..9f7d10409 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -35,60 +35,6 @@ sed_rm_ccomments()
}
########################################################################
-# Linux kernel
-
-# grep_syscall() finds the prototype of a syscall in the kernel sources,
-# printing the filename, line number, and the prototype.
-# It should be run from the root of the linux kernel source tree.
-# Usage example: .../linux$ grep_syscall openat2;
-#
-# See also: grepc(1)
-
-grep_syscall()
-{
- if [ $# -ne 1 ]; then
- >&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
- return $EX_USAGE;
- fi
-
- find ./* -type f \
- |grep '\.c$' \
- |xargs grep -l "$1" \
- |sort \
- |xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\($1\b.*?\)" \
- |sed -E 's/^[^:]+:[0-9]+:/&\n/';
-
- find ./* -type f \
- |grep '\.[ch]$' \
- |xargs grep -l "$1" \
- |sort \
- |xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_$1\s*\(.*?\)" \
- |sed -E 's/^[^:]+:[0-9]+:/&\n/';
-}
-
-# grep_syscall_def() finds the definition of a syscall in the kernel sources,
-# printing the filename, line number, and the function definition.
-# It should be run from the root of the linux kernel source tree.
-# Usage example: .../linux$ grep_syscall_def openat2;
-#
-# See also: grepc(1)
-
-grep_syscall_def()
-{
- if [ $# -ne 1 ]; then
- >&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
- return $EX_USAGE;
- fi
-
- find ./* -type f \
- |grep '\.c$' \
- |xargs grep -l "$1" \
- |sort \
- |xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\($1\b.*?^}" \
- |sed -E 's/^[^:]+:[0-9]+:/&\n/';
-}
-
-########################################################################
# Linux man-pages
# man_section() prints specific manual page sections (DESCRIPTION, SYNOPSIS,
@@ -203,29 +149,3 @@ man_gitstaged()
|tr -d '\n' \
|sed 's/, $//'
}
-
-########################################################################
-# Glibc
-
-# grep_glibc_prototype() finds a function prototype in the glibc sources,
-# printing the filename, line number, and the prototype.
-# It should be run from the root of the glibc source tree.
-# Usage example: .../glibc$ grep_glibc_prototype printf;
-#
-# See also: grepc(1)
-
-grep_glibc_prototype()
-{
- if [ $# -ne 1 ]; then
- >&2 echo "Usage: ${FUNCNAME[0]} <func>";
- return $EX_USAGE;
- fi
-
- find ./* -type f \
- |grep '\.h$' \
- |xargs grep -l "$1" \
- |sort \
- |xargs pcregrep -Mn \
- "(?s)^[\w[][\w\s(,)[:\]]+\s+\**$1\s*\([\w\s(,)[\]*]+?(...)?\)[\w\s(,)[:\]]*;" \
- |sed -E 's/^[^:]+:[0-9]+:/&\n/';
-}