Support USDT wildcard provider descriptions
PATCH v2 11/19 Support USDT wildcard provider descriptions
From: Eugene Loh <[email protected]>
To look for pid probes, whose pid values must be specified explicitly, we can require that the provider description should end in a digit.
For USDT probes, however, there can be wildcard descriptions. This includes a blank provider description as well as a description that ends in an '*'.
So, in dt_setcontext(), expand the criteria appropriately. And modify dt_pid_create_probes() accordingly.
This is rudimentary support. We still need to:
- handle globs in dt_pid_create_probes_module()
- add process monitoring / inotify
- deal with FIXMEs
Signed-off-by Eugene Loh <[email protected]>
--- libdtrace/dt_cc.c | 5 +- libdtrace/dt_pid.c | 76 +++++++++++++++---- .../dtrace-util/tst.ListProbesFuncUSDT.sh | 1 - .../dtrace-util/tst.ListProbesModuleUSDT.sh | 1 - .../dtrace-util/tst.ListProbesNameUSDT.sh | 1 - .../dtrace-util/tst.ListProbesProviderUSDT.sh | 1 - test/unittest/usdt/tst.forker.sh | 1 - 7 files changed, 63 insertions(+), 23 deletions(-)
libdtrace/dt_cc.c +3 -2
@@ -270,8 +270,9 @@ dt_setcontext(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp)* On an error, dt_pid_create_probes() will set the error message * and tag -- we just have to longjmp() out of here. */ -if (pdp->prv && pdp->prv[0 ] && -isdigit (pdp->prv[strlen (pdp->prv) -1 ]) && +if (pdp->prv && + (pdp->prv[0 ] =='\0' ||isdigit (pdp->prv[strlen (pdp->prv) -1 ]) || + pdp->prv[strlen (pdp->prv) -1 ] =='*' ) && ((pvp =dt_provider_lookup (dtp, pdp->prv)) ==NULL || pvp->pv_flags &DT_PROVIDER_PID ) &&dt_pid_create_probes ((dtrace_probedesc_t *)pdp, dtp, yypcb,0 ) !=0 ) {
libdtrace/dt_pid.c +60 -16
136 lines not on this page · raw message
test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh +0 -1
@@ -5,7 +5,6 @@ # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. # -# @@xfail: dtv2 ## #
test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh +0 -1
@@ -5,7 +5,6 @@ # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. # -# @@xfail: dtv2 ## #
test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh +0 -1
@@ -5,7 +5,6 @@ # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. # -# @@xfail: dtv2 ## #
test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh +0 -1
@@ -5,7 +5,6 @@ # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. # -# @@xfail: dtv2 ## #
test/unittest/usdt/tst.forker.sh +0 -1
@@ -7,7 +7,6 @@ # # # @@timeout: 120 -# @@xfail: dtv2 USDT wildcard if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>'
Signature · 1 line
2.43.5