-
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, replace tst.three_arg.sh with tst.tracemem.d: - to avoid the problematic profile probe (fires irregularly) - for cleaner post processing - to check both 2-arg and 3-arg results Signed-off-by: Eugene Loh <eugene.loh@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information
Showing
11 changed files
with
167 additions
and
150 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
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
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* ASSERTION: Results for tracemem() are correct. | ||
* | ||
* SECTION: Actions and Subroutines/tracemem() | ||
*/ | ||
|
||
#pragma D option quiet | ||
|
||
long long *p; | ||
|
||
BEGIN { | ||
/* pick some pointer to kernel memory */ | ||
p = (long long *) curthread; | ||
|
||
/* dump memory at this pointer */ | ||
printf("%16.16x %16.16x\n", p[ 0], p[ 1]); | ||
printf("%16.16x %16.16x\n", p[ 2], p[ 3]); | ||
printf("%16.16x %16.16x\n", p[ 4], p[ 5]); | ||
printf("%16.16x %16.16x\n", p[ 6], p[ 7]); | ||
printf("%16.16x %16.16x\n", p[ 8], p[ 9]); | ||
printf("%16.16x %16.16x\n", p[10], p[11]); | ||
printf("%16.16x %16.16x\n", p[12], p[13]); | ||
printf("%16.16x %16.16x\n", p[14], p[15]); | ||
printf("%16.16x %16.16x\n", p[16], p[17]); | ||
printf("%16.16x %16.16x\n", p[18], p[19]); | ||
printf("%16.16x %16.16x\n", p[20], p[21]); | ||
printf("%16.16x %16.16x\n", p[22], p[23]); | ||
printf("%16.16x %16.16x\n", p[24], p[25]); | ||
printf("%16.16x %16.16x\n", p[26], p[27]); | ||
printf("%16.16x %16.16x\n", p[28], p[29]); | ||
printf("%16.16x %16.16x\n", p[30], p[31]); | ||
|
||
/* try tracemem() with this same pointer but various sizes */ | ||
|
||
tracemem(p, 256); /* 256 bytes */ | ||
|
||
tracemem(p, 256, -1); /* 256 bytes (arg2 < 0) */ | ||
|
||
tracemem(p, 256, 0); /* 0 bytes */ | ||
|
||
tracemem(p, 256, 32); /* 32 bytes */ | ||
|
||
tracemem(p, 256, 64); /* 64 bytes */ | ||
|
||
tracemem(p, 256, 128); /* 128 bytes */ | ||
|
||
tracemem(p, 256, 256); /* 256 bytes */ | ||
|
||
tracemem(p, 256, 320); /* 256 bytes (arg1 <= arg2) */ | ||
|
||
tracemem(p, 256, (unsigned char) 0x80); | ||
/* 128 bytes */ | ||
|
||
tracemem(p, 256, (signed char) 0x80); | ||
/* 256 bytes (arg2 < 0) */ | ||
|
||
exit(0); | ||
} |
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,9 @@ | ||
256 bytes | ||
256 bytes | ||
32 bytes | ||
64 bytes | ||
128 bytes | ||
256 bytes | ||
256 bytes | ||
128 bytes | ||
256 bytes |
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,30 @@ | ||
#!/usr/bin/gawk -f | ||
|
||
# read data against which we will check tracemem() results | ||
BEGIN { | ||
n = 0; # count check results | ||
m = 0; # count tracemem() results | ||
} | ||
NF == 2 { | ||
check[n] = $1; n++; | ||
check[n] = $2; n++; | ||
next; | ||
} | ||
|
||
# if we have a blank line, report number of bytes compared, if any | ||
NF == 0 && m > 0 { print 8 * m, "bytes" } | ||
|
||
# restart counting tracemem() output | ||
NF == 0 { m = 0; next; } | ||
|
||
# comparison function | ||
function mycomp(expect, actual) { | ||
if ( expect != actual ) | ||
print "ERROR: expect", expect, "actual", actual; | ||
} | ||
|
||
# tracemem output has two sets of 8 bytes each; reverse bytes for comparison | ||
/:/ { | ||
mycomp( check[m++], $9$8$7$6$5$4$3$2); | ||
mycomp( check[m++], $17$16$15$14$13$12$11$10); | ||
} |
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