[DTrace-devel] [PATCH 10/10] Revert "test: Have manyprobes clean up uprobes"

Kris Van Hees kris.van.hees at oracle.com
Tue Aug 22 20:28:02 UTC 2023


On Wed, Aug 02, 2023 at 02:27:00PM +0100, Nick Alcock via DTrace-devel wrote:
> This reverts commit 8dedee6fc6ef58c3818a32d84d2acc4bf87b1dce, and
> also drops the pre-existing ugly echo kludge.
> 
> We have proper cleanup now.
> 
> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>

Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>

> ---
>  test/unittest/usdt/tst.manyprobes.sh | 20 +-------------------
>  1 file changed, 1 insertion(+), 19 deletions(-)
> 
> diff --git a/test/unittest/usdt/tst.manyprobes.sh b/test/unittest/usdt/tst.manyprobes.sh
> index 9acf251f707e..dd97250e5d8a 100755
> --- a/test/unittest/usdt/tst.manyprobes.sh
> +++ b/test/unittest/usdt/tst.manyprobes.sh
> @@ -60,12 +60,7 @@ fi
>  
>  script()
>  {
> -	$dtrace -o D.output -c ./test -qs /dev/stdin <<EOF
> -	BEGIN
> -	{
> -		/* Dump pid for the clean-up hack we use. */
> -		printf("pid is %d\n", \$target);
> -	}
> +	$dtrace -c ./test -qs /dev/stdin <<EOF
>  	manyprobes\$target:::test1, manyprobes\$target:::test750, manyprobes\$target:::test1999
>  	{
>  		printf("%s:%s:%s\n", probemod, probefunc, probename);
> @@ -76,17 +71,4 @@ EOF
>  script
>  status=$?
>  
> -# D.output has the pid we need for the clean-up hack.  Display the output minus
> -# that pid information for checking with the .r results file.  Once uprobe cleanup
> -# has been automated, the pid info and D.output will not be needed.
> -grep -v "pid is " D.output
> -
> -# Here is the clean-up hack for uprobe_events until dtprobed does clean up.
> -# Find the events for the specified pid and eliminate them.
> -pid=`awk '/pid is / {print $3}' D.output`
> -uprobes=/sys/kernel/debug/tracing/uprobe_events
> -for x in `awk '/^p:dt_pid\/.* \/proc\/'$pid'\/map_files\// { sub("^p:", "-:"); print $1 }' $uprobes`; do
> -	echo $x >> $uprobes
> -done
> -
>  exit $status
> -- 
> 2.41.0.270.g68fa1d84b5
> 
> 



More information about the DTrace-devel mailing list