[DTrace-devel] [PATCH 6/7] test: Fix tests that expected args[2] for io::: probes
Kris Van Hees
kris.van.hees at oracle.com
Wed Dec 20 15:48:51 UTC 2023
On Tue, Aug 22, 2023 at 05:51:13PM -0400, eugene.loh at oracle.com wrote:
>
> On Linux, there is no fileinfo_t information for these probes.
>
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Not needed because when args[2] it 0 (which it always is), the translator will
provide appropriate default values. So it is OK to print those.
> ---
> test/demo/io/iosnoop.d | 6 ++----
> test/demo/io/iotime.d | 7 +++----
> test/demo/io/whowrite.d | 7 +++----
> 3 files changed, 8 insertions(+), 12 deletions(-)
>
> diff --git a/test/demo/io/iosnoop.d b/test/demo/io/iosnoop.d
> index 78338680..24944991 100644
> --- a/test/demo/io/iosnoop.d
> +++ b/test/demo/io/iosnoop.d
> @@ -1,10 +1,9 @@
> /*
> * Oracle Linux DTrace.
> - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
> + * Copyright (c) 2005, 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.
> */
> -/* @@xfail: dtv2 */
>
> #pragma D option quiet
>
> @@ -15,6 +14,5 @@ BEGIN
>
> io:::start
> {
> - printf("%10s %58s %2s\n", args[1]->dev_statname,
> - args[2]->fi_pathname, args[0]->b_flags & B_READ ? "R" : "W");
> + printf("%10s %2s\n", args[1]->dev_statname, args[0]->b_flags & B_READ ? "R" : "W");
> }
> diff --git a/test/demo/io/iotime.d b/test/demo/io/iotime.d
> index 6436adc3..98135448 100644
> --- a/test/demo/io/iotime.d
> +++ b/test/demo/io/iotime.d
> @@ -1,10 +1,9 @@
> /*
> * Oracle Linux DTrace.
> - * Copyright (c) 2006, 2020, 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.
> */
> -/* @@xfail: dtv2 */
>
> #pragma D option quiet
>
> @@ -22,8 +21,8 @@ io:::done
> /start[args[0]->b_edev, args[0]->b_blkno]/
> {
> this->elapsed = timestamp - start[args[0]->b_edev, args[0]->b_blkno];
> - printf("%10s %58s %2s %3d.%03d\n", args[1]->dev_statname,
> - args[2]->fi_pathname, args[0]->b_flags & B_READ ? "R" : "W",
> + printf("%10s %2s %3d.%03d\n", args[1]->dev_statname,
> + args[0]->b_flags & B_READ ? "R" : "W",
> this->elapsed / 1000000, (this->elapsed / 1000) % 1000);
> start[args[0]->b_edev, args[0]->b_blkno] = 0;
> }
> diff --git a/test/demo/io/whowrite.d b/test/demo/io/whowrite.d
> index 5a5da7ba..5c009fb3 100644
> --- a/test/demo/io/whowrite.d
> +++ b/test/demo/io/whowrite.d
> @@ -1,21 +1,20 @@
> /*
> * Oracle Linux DTrace.
> - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
> + * Copyright (c) 2005, 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.
> */
> -/* @@xfail: dtv2 */
>
> #pragma D option quiet
>
> io:::start
> /args[0]->b_flags & B_WRITE/
> {
> - @[execname, args[2]->fi_dirname] = count();
> + @[execname] = count();
> }
>
> END
> {
> printf("%20s %51s %5s\n", "WHO", "WHERE", "COUNT");
> - printa("%20s %51s %5 at d\n", @);
> + printa("%20s %5 at d\n", @);
> }
> --
> 2.18.4
>
>
More information about the DTrace-devel
mailing list