[DTrace-devel] [PATCH] Ensure that sdt/tst.args.d filters on pid correctly

Eugene Loh eugene.loh at oracle.com
Tue Dec 14 19:08:42 UTC 2021


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>

On 12/13/21 9:39 PM, Kris Van Hees via DTrace-devel wrote:
> The logic in this test was flawed, and would occasionally allow kernel
> threads to be reported, causing test failures.  We now explicitly use
> a predicate on the data generating clause to ensure that arg0 matches
> pid.
>
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
>   test/unittest/sdt/tst.args.d | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/test/unittest/sdt/tst.args.d b/test/unittest/sdt/tst.args.d
> index f2823a26..5b054628 100644
> --- a/test/unittest/sdt/tst.args.d
> +++ b/test/unittest/sdt/tst.args.d
> @@ -50,12 +50,7 @@ this char v;
>   this bool done;
>   
>   sdt:task::task_rename
> -/(int)arg0 != pid/
> -{
> -	exit(1);
> -}
> -
> -sdt:task::task_rename
> +/(int)arg0 == pid/
>   {
>   #define putchar(c)	this->v = (c); \
>   			this->v = this->done ? 0 : this->v; \



More information about the DTrace-devel mailing list