[DTrace-devel] [PATCH] test: Clean up tst.coverage.d
Kris Van Hees
kvanhees at kvh-deb-bpf.us.oracle.com
Tue Jan 23 16:55:58 UTC 2024
On Thu, Nov 02, 2023 at 06:36:44PM -0400, eugene.loh at oracle.com wrote:
>
> The .t file was not executable and therefore not being used.
> Further, the .d test specifies another @@trigger explicitly.
> So remove the unused .t file.
>
> Clean the .d file up a little, mostly to use aggregations and
> thereby reduce the volume of output.
This patch has an issue in the sense that it will actually PASS without the
support for offset-based pid providers being present even. In fact, if the
only probe that ever fires is the tick probe, this test will report PASS.
That's an issue.
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
> ---
> test/unittest/pid/tst.coverage.d | 16 ++++------------
> test/unittest/pid/tst.coverage.t | 8 --------
> 2 files changed, 4 insertions(+), 20 deletions(-)
> delete mode 100644 test/unittest/pid/tst.coverage.t
>
> diff --git a/test/unittest/pid/tst.coverage.d b/test/unittest/pid/tst.coverage.d
> index 9670665a..3313d7b5 100644
> --- a/test/unittest/pid/tst.coverage.d
> +++ b/test/unittest/pid/tst.coverage.d
> @@ -1,6 +1,6 @@
> /*
> * Oracle Linux DTrace.
> - * Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
> + * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved.
> * Licensed under the Universal Permissive License v 1.0 as shown at
> * http://oss.oracle.com/licenses/upl.
> */
> @@ -13,22 +13,14 @@
> * ASSERTION: test that we can trace every instruction safely
> *
> * SECTION: pid provider
> - *
> */
>
> -BEGIN
> +pid$1:a.out::
> {
> - /*
> - * Let's just do this for 2 seconds.
> - */
> - timeout = timestamp + 2000000000;
> + @[probename] = count();
> }
>
> -pid$1:a.out::
> -{}
> -
> -profile:::tick-4
> -/timestamp > timeout/
> +profile:::tick-2sec
> {
> exit(0);
> }
> diff --git a/test/unittest/pid/tst.coverage.t b/test/unittest/pid/tst.coverage.t
> deleted file mode 100644
> index ac05014b..00000000
> --- a/test/unittest/pid/tst.coverage.t
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -#!/bin/bash
> -#
> -# Oracle Linux DTrace.
> -# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
> -# Licensed under the Universal Permissive License v 1.0 as shown at
> -# http://oss.oracle.com/licenses/upl.
> -#
> -while true; do env > /dev/null; done
> --
> 2.18.4
>
>
More information about the DTrace-devel
mailing list