-
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.
The -xctfpath option was (along with all other options) being processed after dtrace_open(). But the implementation of dtrace_open() included the instantiation of providers and probes that triggers the loading of the CTF archive. As such, this option had no effect. Instantiation of providers and probes has been moved to a new function: dtrace_init(). This function is called after all command line options have been processed, ensuring that -xctfpath sets the pathname to the CTF archive before it is loaded. If the CTF rchive specified with -xctfpath (or the default one) is not valid, a core dump would result. Nick Alcock submitted a patch that solved 70% of that problen by properly checking the return value of ctf_lookup_by_name() during program linking and flagging EDT_NOCTF if there is an issue. This has been incorporated into this patch. In addition, link failure resulted in the constructed DIFO to be free'd but upon termination, dtrace was walking the identifier hash and freeing all DIFO and we ended up freeing the same DIFO twice. This is fixed here also. Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com> Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
- Loading branch information
Showing
9 changed files
with
102 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Oracle Linux DTrace. | ||
* Copyright (c) 2022, 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: The -xctfpath option overrides the default vmlinux CTF archive. | ||
* | ||
* SECTION: Options and Tunables/Consumer Options | ||
*/ | ||
|
||
/* @@runtest-opts: -xctfpath=/dev/null */ | ||
|
||
BEGIN | ||
{ | ||
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,3 @@ | ||
-- @@stderr -- | ||
dtrace: script 'test/unittest/options/err.ctfpath.d' matched 1 probe | ||
dtrace: could not enable tracing: Module does not contain any CTF data |
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,5 @@ | ||
FUNCTION:NAME | ||
:BEGIN | ||
|
||
-- @@stderr -- | ||
dtrace: description 'BEGIN ' matched 1 probe |
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,19 @@ | ||
#!/bin/bash | ||
# | ||
# Oracle Linux DTrace. | ||
# Copyright (c) 2022, 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 | ||
|
||
# | ||
# First determine the location of the vmlinux CTF archive. | ||
# | ||
ctf=`$dtrace $dt_flags -xdebug |& | ||
awk '/Loaded shared CTF from/ { $0 = $NF; sub(/\.$/, ""); print; }'` | ||
|
||
$dtrace $dt_flags -xctfpath=$ctf -n 'BEGIN { exit(0); }' | ||
|
||
exit $? |