[DTrace-devel] [PATCH 06/16] cpc: Put in a temporary safeguard against some mystery bug

Kris Van Hees kris.van.hees at oracle.com
Fri Feb 24 00:51:54 UTC 2023


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

On Thu, Jan 26, 2023 at 09:23:19PM -0500, eugene.loh--- via DTrace-devel wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
> 
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
> ---
>  test/unittest/cpc/tst.branches.x     |  3 ++-
>  test/unittest/cpc/tst.instructions.x |  3 ++-
>  test/utils/cpc_get_events.sh         | 14 +++++++++-----
>  test/utils/cpc_temp_skip_bug.sh      | 25 +++++++++++++++++++++++++
>  4 files changed, 38 insertions(+), 7 deletions(-)
>  create mode 100755 test/utils/cpc_temp_skip_bug.sh
> 
> diff --git a/test/unittest/cpc/tst.branches.x b/test/unittest/cpc/tst.branches.x
> index a8e07af1..4b235055 100755
> --- a/test/unittest/cpc/tst.branches.x
> +++ b/test/unittest/cpc/tst.branches.x
> @@ -10,4 +10,5 @@ if ! perf list hw | grep -qw branches; then
>  	exit 2
>  fi
>  
> -exit 0
> +test/utils/cpc_temp_skip_bug.sh
> +exit $?
> diff --git a/test/unittest/cpc/tst.instructions.x b/test/unittest/cpc/tst.instructions.x
> index d47b7d99..c3a2ede3 100755
> --- a/test/unittest/cpc/tst.instructions.x
> +++ b/test/unittest/cpc/tst.instructions.x
> @@ -10,4 +10,5 @@ if ! perf list hw | grep -qw instructions; then
>  	exit 2
>  fi
>  
> -exit 0
> +test/utils/cpc_temp_skip_bug.sh
> +exit $?
> diff --git a/test/utils/cpc_get_events.sh b/test/utils/cpc_get_events.sh
> index 4303c826..80d3584b 100755
> --- a/test/utils/cpc_get_events.sh
> +++ b/test/utils/cpc_get_events.sh
> @@ -9,10 +9,14 @@
>  # Use at least cpu-clock but also try "perf list" for some others.
>  
>  eventnamelist="cpu-clock"
> -for eventname in branches instructions; do
> -	if perf list hw | grep -qw $eventname; then
> -		eventnamelist="$eventnamelist $eventname"
> -	fi
> -done
> +
> +$(dirname $0)/cpc_temp_skip_bug.sh > /dev/null
> +if [ $? -eq 0 ]; then
> +	for eventname in branches instructions; do
> +		if perf list hw | grep -qw $eventname; then
> +			eventnamelist="$eventnamelist $eventname"
> +		fi
> +	done
> +fi
>  
>  echo $eventnamelist
> diff --git a/test/utils/cpc_temp_skip_bug.sh b/test/utils/cpc_temp_skip_bug.sh
> new file mode 100755
> index 00000000..2e63bb52
> --- /dev/null
> +++ b/test/utils/cpc_temp_skip_bug.sh
> @@ -0,0 +1,25 @@
> +#!/bin/bash
> +#
> +# Oracle Linux DTrace.
> +# Copyright (c) 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.
> +
> +# Temporarily skip due to some bug we do not yet understand.  It seems cpc
> +# probes fire only once per process on x86/UEKR6 when using hardware counters.
> +
> +if [[ `uname -m` != "x86_64" ]]; then
> +        exit 0
> +fi
> +
> +read MAJOR MINOR <<< `uname -r | grep -Eo '^[0-9]+\.[0-9]+' | tr '.' ' '`
> +
> +if [ $MAJOR -gt 5 ]; then
> +        exit 0
> +fi
> +if [ $MAJOR -eq 5 -a $MINOR -ge 15 ]; then
> +        exit 0
> +fi
> +
> +echo mystery bug with hardware counters on x86 and UEKR6
> +exit 2
> -- 
> 2.18.4
> 
> 
> _______________________________________________
> 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