[LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10

Petr Vorel pvorel@suse.cz
Mon Jan 2 10:37:08 CET 2023


Hi Xu,

...
> +++ b/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
> @@ -21,8 +21,7 @@ DEBUGFS_WAS_MOUNTED=0
>  DEBUGFS_PATH=""
>  DEBUGFS_CONTROL=""
>  DYNDEBUG_STATEMENTS="./debug_statements"
> -EMPTY_FLAG="-"
> -NEW_INTERFACE=0
> +EMPTY_FLAG="=_"

>  mount_debugfs()
>  {
> @@ -55,11 +54,6 @@ setup()
>  		tst_brk TBROK "Unable to find $DEBUGFS_CONTROL"
>  	fi

> -	if tst_kvcmp -ge 3.4 ; then
> -		NEW_INTERFACE=1
> -		EMPTY_FLAG="=_"
> -	fi
> -
>  	grep -v "^#" "$DEBUGFS_CONTROL" > "$DYNDEBUG_STATEMENTS"
>  }

> @@ -83,10 +77,8 @@ do_all_flags()

>  	for INPUT_LINE in $ALL_INPUTS; do
>  		do_flag "+p" "$OPTION" "$INPUT_LINE"
> -		if tst_kvcmp -ge 3.2 || [ $NEW_INTERFACE -eq 1 ] ; then
> -			do_flag "+flmt" "$OPTION" "$INPUT_LINE"
> -			do_flag "-flmt" "$OPTION" "$INPUT_LINE"
> -		fi
> +		do_flag "+flmt" "$OPTION" "$INPUT_LINE"
> +		do_flag "-flmt" "$OPTION" "$INPUT_LINE"
>  		do_flag "-p" "$OPTION" "$INPUT_LINE"
>  	done

> @@ -131,7 +123,7 @@ cleanup()
>  		FLAGS_SET=$(awk -v emp="$EMPTY_FLAG" '$3 != emp' $DYNDEBUG_STATEMENTS)
>  	fi
>  	if [ "$FLAGS_SET" ] ; then
> -		FLAG_PREFIX=$([ $NEW_INTERFACE -eq 1 ] && echo "" || echo "+")
FYI Original code was ugly, it should have been
[ $NEW_INTERFACE -eq 1 ] || NEW_INTERFACE="+"
(Now ignoring that local variables should use local keyword and be lowercase.)

> +		FLAG_PREFIX=$(echo "")
This evaluates to FLAG_PREFIX=
=> please remove the variable as it's always empty

>  		/bin/echo "$FLAGS_SET" | while read -r FLAG_LINE ; do
>  			/bin/echo -n "$FLAG_LINE" \
>  				| awk -v prf="$FLAG_PREFIX" -F " |:" \
change to:
  				| awk -v prf= -F " |:" \

NOTE: I'm going to cleanup the test after you merge (/bin/echo + variables).

With these changes:
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr


More information about the ltp mailing list