[DTrace-devel] [PATCH 08/13] Fix test/unittest/providers/tst.dtrace_cleanup.sh

Kris Van Hees kris.van.hees at oracle.com
Mon Jul 6 09:15:24 PDT 2020


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

On Wed, Jul 01, 2020 at 10:41:13PM -0400, eugene.loh at oracle.com wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
> 
> The test would launch DTrace with two probes, BEGIN and
> END, and watch for "matched [1-9] probe" in its output
> to detect completion of job launch.  The problem is that
> we used "dtrace -n BEGIN -n END", which emits the messages:
>     dtrace: description 'BEGIN' matched 1 probe
>     dtrace: description 'END' matched 1 probe
> That means it's possible for us to believe both probes had
> been created when only one had.  The test would occasionally
> fail.
> 
> Change the test to use "dtrace -n BEGIN,END".  That way, there
> would be only one message:
>     dtrace: description 'BEGIN,END' matched 2 probes
> and detection of the message would be a better indicator.
> 
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
> ---
>  test/unittest/providers/tst.dtrace_cleanup.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/unittest/providers/tst.dtrace_cleanup.sh b/test/unittest/providers/tst.dtrace_cleanup.sh
> index 47348f22..a2bb22dc 100755
> --- a/test/unittest/providers/tst.dtrace_cleanup.sh
> +++ b/test/unittest/providers/tst.dtrace_cleanup.sh
> @@ -17,7 +17,7 @@ dtrace=$1
>  UPROBE_EVENTS=/sys/kernel/debug/tracing/uprobe_events
>  
>  out=/tmp/output.$$
> -$dtrace $dt_flags -n BEGIN -n END &>> $out &
> +$dtrace $dt_flags -n BEGIN,END &>> $out &
>  pid=$!
>  
>  tail -F $out | awk '/matched [1-9] probe/ { exit; }'
> -- 
> 2.18.2
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list