From c3752af0549c4de1bbd76fd7707692ce17e51511 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 22 Nov 2022 20:38:26 +0100 Subject: [PATCH] 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: . The program has several bug fixes that these shell functions didn't receive. It also has more useful features. Signed-off-by: Alejandro Colomar --- scripts/bash_aliases | 80 -------------------------------------------- 1 file changed, 80 deletions(-) diff --git a/scripts/bash_aliases b/scripts/bash_aliases index f325542f8d..9f7d104093 100644 --- a/scripts/bash_aliases +++ b/scripts/bash_aliases @@ -34,60 +34,6 @@ sed_rm_ccomments() |sed 's%//.*%%'; } -######################################################################## -# 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]} "; - 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]} "; - 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 @@ -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]} "; - 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/'; -} -- 2.47.3