-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also add a new test, since existing tests do not yet work. (They depend on indexed aggregations.) Further, the sym() tests are very weak. Signed-off-by: Eugene Loh <eugene.loh@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# | ||
# Oracle Linux DTrace. | ||
# Copyright (c) 2021, 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. | ||
# | ||
|
||
dtrace=$1 | ||
|
||
# pick a test symbol from /proc/kallmodsyms | ||
read ADD NAM MOD <<< `awk '/ksys_write/ {print $1, $4, $5}' /proc/kallmodsyms` | ||
# a blank module means the module is vmlinux | ||
if [ x$MOD == x ]; then | ||
MOD=vmlinux | ||
fi | ||
# add the module to the name | ||
NAM=$MOD'`'$NAM | ||
# run DTrace to test mod() and sym() | ||
read MYMOD MYNAM <<< `$dtrace -qn 'BEGIN {mod(0x'$ADD'); sym(0x'$ADD'); exit(0) }'` | ||
if [ $? -ne 0 ]; then | ||
exit 1 | ||
fi | ||
|
||
# reporting | ||
echo test $ADD $MOD $NAM | ||
echo expect $MOD $NAM | ||
echo actual $MYMOD $MYNAM | ||
|
||
if [ $MOD != $MYMOD ]; then | ||
echo fail: $MOD does not match $MYMOD | ||
exit 1 | ||
fi | ||
if [ $NAM != $MYNAM ]; then | ||
echo fail: $NAM does not match $MYNAM | ||
exit 1 | ||
fi | ||
|
||
exit 0 |