From noreply at github.com Thu May 1 14:56:34 2025 From: noreply at github.com (Kris Van Hees) Date: Thu, 01 May 2025 07:56:34 -0700 Subject: [DTrace-devel] [oracle/dtrace-utils] ace34e: test: Allow duplicate usym/umod/uaddr if for diffe... Message-ID: Branch: refs/heads/devel Home: https://github.com/oracle/dtrace-utils Commit: ace34e708e409d28e9b6ff7fe22fe7a2043632be https://github.com/oracle/dtrace-utils/commit/ace34e708e409d28e9b6ff7fe22fe7a2043632be Author: Eugene Loh Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: M test/unittest/profile-n/tst.ufunc.sh M test/unittest/profile-n/tst.umod.sh M test/unittest/profile-n/tst.usym.sh Log Message: ----------- test: Allow duplicate usym/umod/uaddr if for different pids In 83da884cbdc5 ("Preface usym/umod/uaddr with pid"), a bug was fixed in which addresses in the same module (or function) might be mapped to multiple agg entries. This fix helped the associated tests run much more successfully. Nonetheless, tests would sometimes still fail. Another problem is that the tests themselves were overly narrow. It is fine for a module (or function) to appear multiple times in the aggregation output... if those entries correspond to different pids. Further, odd behaviors can result for some of the processes running on a system. Change the tests to add a "pid" agg key. Filter on only a few, select pids. Distinguish agg entries by pid. There are still occasional time outs observed with these tests, presumably because the tick-2s probe is not firing (when profile-1234hz is running). Signed-off-by: Eugene Loh Reviewed-by: Kris Van Hees Commit: 0f9a7221de5990013c63e936802e6f7e568b7300 https://github.com/oracle/dtrace-utils/commit/0f9a7221de5990013c63e936802e6f7e568b7300 Author: Eugene Loh Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: A test/unittest/usdt/skip_arm_uek6.x A test/unittest/usdt/tst.argmap-typed-partial.aarch64.x A test/unittest/usdt/tst.argmap-typed.aarch64.x A test/unittest/usdt/tst.multiprov-dupprobe-fire.aarch64.x A test/unittest/usdt/tst.multiprov-dupprobe-shlibs.aarch64.x A test/unittest/usdt/tst.multiprovider-fire.aarch64.x Log Message: ----------- test: Expect USDT argmap to fail on ARM on older kernels Signed-off-by: Eugene Loh Reviewed-by: Kris Van Hees Commit: 5b442e6989b7b28ab5884295011504f2d1242079 https://github.com/oracle/dtrace-utils/commit/5b442e6989b7b28ab5884295011504f2d1242079 Author: Eugene Loh Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: M include/dtrace/metadesc.h Log Message: ----------- Remove orphaned dtrace_recdesc_t component dtrd_uarg Signed-off-by: Eugene Loh Reviewed-by: Kris Van Hees Commit: 49740f58e997afddb693798eaed53c3545dec63a https://github.com/oracle/dtrace-utils/commit/49740f58e997afddb693798eaed53c3545dec63a Author: Eugene Loh Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: M libdtrace/dt_prov_sched.c M test/unittest/sched/tst.lv-dequeue.r M test/unittest/sched/tst.lv-enqueue.r Log Message: ----------- Fix arg3 for sched enqueue and dequeue probes For sched enqueue and dequeue probes, arg3 should be an int for enqueue and not exist for dequeue. In the code it was the other way around. Fix this and the associated tests. The trampoline was already set up to get this argument correct. Signed-off-by: Eugene Loh Reviewed-by: Kris Van Hees Commit: 824f4788d58cb5f131d24da236967200030ff357 https://github.com/oracle/dtrace-utils/commit/824f4788d58cb5f131d24da236967200030ff357 Author: Eugene Loh Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: M bpf/get_agg.c M bpf/get_bvar.c M libdtrace/dt_bpf.c M libdtrace/dt_cg.c M libdtrace/dt_prov_lockstat.c M libdtrace/dt_prov_sched.c M libdtrace/dt_work.c M test/unittest/sched/tst.enqueue.d Log Message: ----------- Clean up sched provider trampoline FIXMEs The sched provider trampoline for enqueue and dequeue probes had pending FIXMEs for providing a cpuinfo_t* for the cpu associated with the run queue. Implement the missing code. Since the cpu associated with the run queue might be different from the cpu where we are running, it becomes necessary to access the cpuinfo for some random cpu. With Linux 5.18, there is a BPF helper function map_lookup_percpu_elem() that allows such lookups on per-cpu arrays. To support older kernels, however, we change the cpuinfo BPF map from per-cpu to global. Also, it is a hash table rather than an array in case cpus are not numbered consecutively. Signed-off-by: Eugene Loh Reviewed-by: Kris Van Hees Commit: bef8fcab7f11db014abc767a7c76008ad1eedc0c https://github.com/oracle/dtrace-utils/commit/bef8fcab7f11db014abc767a7c76008ad1eedc0c Author: Eugene Loh Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: M test/unittest/cpc/tst.branches.sh M test/unittest/cpc/tst.instructions.sh Log Message: ----------- test: Get cpc expected branches and instructions counts from perf For a number of the cpc tests, we get expected counts from perf. For branches and instructions, however, we can determine the expected counts more directly since there is one branch and a fixed number of instructions per iteration. Thus, we can derive an expected cpc counts simply by knowing the number of iterations. For some compilers, however, there is apparently some loop unrolling even at low, default levels of optimization. So, revert to the perf count to estimate the expected cpc count even for the branches and instructions tests. Signed-off-by: Eugene Loh Reviewed-by: Kris Van Hees Commit: ff3eae5aa8337dcf38c79cbfb2b437da27163831 https://github.com/oracle/dtrace-utils/commit/ff3eae5aa8337dcf38c79cbfb2b437da27163831 Author: Eugene Loh Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: R test/unittest/lockstat/tst.lockstat.r Log Message: ----------- test: Remove orphaned tst.lockstat.r In commit ded09d05a ("test: rework main lockstat test"), a lockstat test was renamed. Its .r results file was thereby orphaned. Remove the orphaned copy. Signed-off-by: Eugene Loh Reviewed-by: Kris Van Hees Commit: 486647d6db1fba16dd1b78ac06c1e960d43eae37 https://github.com/oracle/dtrace-utils/commit/486647d6db1fba16dd1b78ac06c1e960d43eae37 Author: Eugene Loh Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: A test/unittest/ustack/skip_pid0_if_oversubscribed.x M test/unittest/ustack/tst.kthread.d A test/unittest/ustack/tst.kthread.x M test/unittest/ustack/tst.uaddr-pid0.d M test/unittest/ustack/tst.uaddr-pid0.r.p A test/unittest/ustack/tst.uaddr-pid0.x M test/unittest/ustack/tst.ufunc-pid0.d M test/unittest/ustack/tst.ufunc-pid0.r.p A test/unittest/ustack/tst.ufunc-pid0.x M test/unittest/ustack/tst.usym-pid0.d M test/unittest/ustack/tst.usym-pid0.r.p A test/unittest/ustack/tst.usym-pid0.x Log Message: ----------- test: Skip pid-0 tests on oversubscribed systems A number of tests check "tick-n /pid==0/" probes. The problem with this is that a tick-n probe runs on a specific CPU. If that CPU is fully subscribed, then pid 0 (swapper) will not run. Thus, the test will take a long time, only to time out. Change these tests to use profile-n instead of tick-n probes, improving chances that the test probe will fire on a less subscribed CPU. Therefore, also change the .r.p post-processing file so that it uses only one output line (in case two CPUs manage to write output). Finally, add skip files in case pid 0 does not fire on any CPU. Signed-off-by: Eugene Loh Reviewed-by: Kris Van Hees Commit: 75ca49feadfcd76a9e039537314c3ca59d3f925d https://github.com/oracle/dtrace-utils/commit/75ca49feadfcd76a9e039537314c3ca59d3f925d Author: Eugene Loh Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: M test/unittest/io/tst.fds.aarch64.r M test/unittest/io/tst.fds.d M test/unittest/io/tst.fds.r M test/unittest/io/tst.fds.sparc64.r M test/unittest/io/tst.fds.x86_64.r Log Message: ----------- test: Test fds[] member fi_fs Signed-off-by: Eugene Loh Reviewed-by: Kris Van Hees Commit: 38c9ea5126d86d514247cc31d010a26647a07c47 https://github.com/oracle/dtrace-utils/commit/38c9ea5126d86d514247cc31d010a26647a07c47 Author: Kris Van Hees Date: 2025-04-24 (Thu, 24 Apr 2025) Changed paths: M dtrace.spec Log Message: ----------- spec: add support for building on OL10 Building on OL10 requires a few adjustments. This patch also removes some dead portions of the spec file concerning the former translator generation mechanism. LTO is also disabled for building DTrace. Signed-off-by: Kris Van Hees Reviewed-by: Eugene Loh Compare: https://github.com/oracle/dtrace-utils/compare/2335340016e4...38c9ea5126d8 To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications From kris.van.hees at oracle.com Thu May 1 15:08:16 2025 From: kris.van.hees at oracle.com (Kris Van Hees) Date: Thu, 01 May 2025 11:08:16 -0400 Subject: [DTrace-devel] [PATCH 1/4] provider: fix registering fbt and rawfbt twice Message-ID: Now that rawfbt has been integrated into the fbt provider, it no longer needs to be in the list of providers to call populate() in. Signed-off-by: Kris Van Hees --- libdtrace/dt_provider.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libdtrace/dt_provider.c b/libdtrace/dt_provider.c index 0c621197..1e2e844e 100644 --- a/libdtrace/dt_provider.c +++ b/libdtrace/dt_provider.c @@ -36,7 +36,6 @@ const dt_provimpl_t *dt_providers[] = { &dt_lockstat, &dt_proc, &dt_profile, - &dt_rawfbt, &dt_rawtp, &dt_sched, &dt_sdt, -- 2.42.0 From kris.van.hees at oracle.com Thu May 1 15:08:18 2025 From: kris.van.hees at oracle.com (Kris Van Hees) Date: Thu, 01 May 2025 11:08:18 -0400 Subject: [DTrace-devel] [PATCH 2/4] providers: loop through all providers for discovery Message-ID: The discovery of probes was tied to the static list of providers that are called on init. It should iterate over all providers that are in fact registered, i.e. the dt_provs hash. Signed-off-by: Kris Van Hees --- libdtrace/dt_provider.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libdtrace/dt_provider.c b/libdtrace/dt_provider.c index 1e2e844e..06f0b039 100644 --- a/libdtrace/dt_provider.c +++ b/libdtrace/dt_provider.c @@ -176,11 +176,13 @@ dt_provider_xref(dtrace_hdl_t *dtp, dt_provider_t *pvp, id_t id) int dt_provider_discover(dtrace_hdl_t *dtp) { - int i, prid = dtp->dt_probe_id; + int prid = dtp->dt_probe_id; + dt_htab_next_t *it = NULL; + dt_provider_t *pvp; /* Discover new probes. */ - for (i = 0; dt_providers[i]; i++) { - if (dt_providers[i]->discover && dt_providers[i]->discover(dtp) < 0) + while ((pvp = dt_htab_next(dtp->dt_provs, &it)) != NULL) { + if (pvp->impl->discover && pvp->impl->discover(dtp) < 0) return -1; /* errno is already set */ } -- 2.42.0 From kris.van.hees at oracle.com Thu May 1 15:08:19 2025 From: kris.van.hees at oracle.com (Kris Van Hees) Date: Thu, 01 May 2025 11:08:19 -0400 Subject: [DTrace-devel] [PATCH 3/4] Only include dt_git_version.h where needed Message-ID: Signed-off-by: Kris Van Hees --- libdtrace/dt_open.c | 2 ++ libdtrace/dt_version.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libdtrace/dt_open.c b/libdtrace/dt_open.c index 51c056b2..0bda3504 100644 --- a/libdtrace/dt_open.c +++ b/libdtrace/dt_open.c @@ -42,6 +42,8 @@ #include #include +#include + const dt_version_t _dtrace_versions[] = { DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ DT_VERS_1_1, /* D API 1.1.0 Solaris Express 6/05 */ diff --git a/libdtrace/dt_version.h b/libdtrace/dt_version.h index 3fd1b3d1..beef9a6f 100644 --- a/libdtrace/dt_version.h +++ b/libdtrace/dt_version.h @@ -13,7 +13,6 @@ extern "C" { #endif #include -#include /* * Stability definitions -- 2.42.0 From kris.van.hees at oracle.com Thu May 1 15:08:21 2025 From: kris.van.hees at oracle.com (Kris Van Hees) Date: Thu, 01 May 2025 11:08:21 -0400 Subject: [DTrace-devel] [PATCH 4/4] dof_parser: remove pointless comment Message-ID: Signed-off-by: Kris Van Hees --- libcommon/dof_parser.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libcommon/dof_parser.c b/libcommon/dof_parser.c index 5b3dde36..58bbd604 100644 --- a/libcommon/dof_parser.c +++ b/libcommon/dof_parser.c @@ -89,9 +89,6 @@ dof_copyin_helper(int in, int out, int *ok) dof_helper_t *dh; size_t i; - /* - * First get the header, which gives the size of everything else. - */ dh = malloc(sizeof(dof_helper_t)); if (!dh) abort(); -- 2.42.0 From eugene.loh at oracle.com Thu May 1 15:36:54 2025 From: eugene.loh at oracle.com (Eugene Loh) Date: Thu, 1 May 2025 11:36:54 -0400 Subject: [DTrace-devel] [PATCH 1/4] provider: fix registering fbt and rawfbt twice In-Reply-To: References: Message-ID: Reviewed-by: Eugene Loh but the commit msg should perhaps also say that rawfbt is not needed for discovery either since that's the other reason we want to be in the list.? Also, how about removing libdtrace/dt_provider.h:extern dt_provimpl_t dt_rawfbt; On 5/1/25 11:08, Kris Van Hees via DTrace-devel wrote: > Now that rawfbt has been integrated into the fbt provider, it no longer > needs to be in the list of providers to call populate() in. > > Signed-off-by: Kris Van Hees > --- > libdtrace/dt_provider.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/libdtrace/dt_provider.c b/libdtrace/dt_provider.c > index 0c621197..1e2e844e 100644 > --- a/libdtrace/dt_provider.c > +++ b/libdtrace/dt_provider.c > @@ -36,7 +36,6 @@ const dt_provimpl_t *dt_providers[] = { > &dt_lockstat, > &dt_proc, > &dt_profile, > - &dt_rawfbt, > &dt_rawtp, > &dt_sched, > &dt_sdt, From eugene.loh at oracle.com Thu May 1 15:38:55 2025 From: eugene.loh at oracle.com (Eugene Loh) Date: Thu, 1 May 2025 11:38:55 -0400 Subject: [DTrace-devel] [PATCH 2/4] providers: loop through all providers for discovery In-Reply-To: References: Message-ID: <7432c20d-bde2-86fc-2b8a-0706154c9048@oracle.com> Reviewed-by: Eugene Loh On 5/1/25 11:08, Kris Van Hees wrote: > The discovery of probes was tied to the static list of providers that > are called on init. It should iterate over all providers that are in > fact registered, i.e. the dt_provs hash. > > Signed-off-by: Kris Van Hees > --- > libdtrace/dt_provider.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/libdtrace/dt_provider.c b/libdtrace/dt_provider.c > index 1e2e844e..06f0b039 100644 > --- a/libdtrace/dt_provider.c > +++ b/libdtrace/dt_provider.c > @@ -176,11 +176,13 @@ dt_provider_xref(dtrace_hdl_t *dtp, dt_provider_t *pvp, id_t id) > int > dt_provider_discover(dtrace_hdl_t *dtp) > { > - int i, prid = dtp->dt_probe_id; > + int prid = dtp->dt_probe_id; > + dt_htab_next_t *it = NULL; > + dt_provider_t *pvp; > > /* Discover new probes. */ > - for (i = 0; dt_providers[i]; i++) { > - if (dt_providers[i]->discover && dt_providers[i]->discover(dtp) < 0) > + while ((pvp = dt_htab_next(dtp->dt_provs, &it)) != NULL) { > + if (pvp->impl->discover && pvp->impl->discover(dtp) < 0) > return -1; /* errno is already set */ > } > From eugene.loh at oracle.com Thu May 1 15:46:32 2025 From: eugene.loh at oracle.com (Eugene Loh) Date: Thu, 1 May 2025 11:46:32 -0400 Subject: [DTrace-devel] [PATCH 1/4] provider: fix registering fbt and rawfbt twice In-Reply-To: References: Message-ID: <17a41964-85fc-a79f-3404-5d06583ccef9@oracle.com> On 5/1/25 11:36, Eugene Loh wrote: > Reviewed-by: Eugene Loh > > but the commit msg should perhaps also say that rawfbt is not needed > for discovery either since that's the other reason we want to be in > the list. Ah.? Okay, looked at patch 2/4.? I guess another thing to do might just be switch the order of patches 1 and 2. > Also, how about removing > > libdtrace/dt_provider.h:extern dt_provimpl_t dt_rawfbt; > > On 5/1/25 11:08, Kris Van Hees via DTrace-devel wrote: >> Now that rawfbt has been integrated into the fbt provider, it no longer >> needs to be in the list of providers to call populate() in. >> >> Signed-off-by: Kris Van Hees >> --- >> ? libdtrace/dt_provider.c | 1 - >> ? 1 file changed, 1 deletion(-) >> >> diff --git a/libdtrace/dt_provider.c b/libdtrace/dt_provider.c >> index 0c621197..1e2e844e 100644 >> --- a/libdtrace/dt_provider.c >> +++ b/libdtrace/dt_provider.c >> @@ -36,7 +36,6 @@ const dt_provimpl_t *dt_providers[] = { >> ????? &dt_lockstat, >> ????? &dt_proc, >> ????? &dt_profile, >> -??? &dt_rawfbt, >> ????? &dt_rawtp, >> ????? &dt_sched, >> ????? &dt_sdt, From eugene.loh at oracle.com Thu May 1 15:48:12 2025 From: eugene.loh at oracle.com (Eugene Loh) Date: Thu, 1 May 2025 11:48:12 -0400 Subject: [DTrace-devel] [PATCH 4/4] dof_parser: remove pointless comment In-Reply-To: References: Message-ID: <2e8dc2b8-6b06-c341-282c-d643b06e2b21@oracle.com> Reviewed-by: Eugene Loh On 5/1/25 11:08, Kris Van Hees via DTrace-devel wrote: > Signed-off-by: Kris Van Hees > --- > libcommon/dof_parser.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/libcommon/dof_parser.c b/libcommon/dof_parser.c > index 5b3dde36..58bbd604 100644 > --- a/libcommon/dof_parser.c > +++ b/libcommon/dof_parser.c > @@ -89,9 +89,6 @@ dof_copyin_helper(int in, int out, int *ok) > dof_helper_t *dh; > size_t i; > > - /* > - * First get the header, which gives the size of everything else. > - */ > dh = malloc(sizeof(dof_helper_t)); > if (!dh) > abort(); From eugene.loh at oracle.com Thu May 1 15:55:30 2025 From: eugene.loh at oracle.com (Eugene Loh) Date: Thu, 1 May 2025 11:55:30 -0400 Subject: [DTrace-devel] [PATCH 3/4] Only include dt_git_version.h where needed In-Reply-To: References: Message-ID: Reviewed-by: Eugene Loh On 5/1/25 11:08, Kris Van Hees via DTrace-devel wrote: > Signed-off-by: Kris Van Hees > --- > libdtrace/dt_open.c | 2 ++ > libdtrace/dt_version.h | 1 - > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/libdtrace/dt_open.c b/libdtrace/dt_open.c > index 51c056b2..0bda3504 100644 > --- a/libdtrace/dt_open.c > +++ b/libdtrace/dt_open.c > @@ -42,6 +42,8 @@ > #include > #include > > +#include > + > const dt_version_t _dtrace_versions[] = { > DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ > DT_VERS_1_1, /* D API 1.1.0 Solaris Express 6/05 */ > diff --git a/libdtrace/dt_version.h b/libdtrace/dt_version.h > index 3fd1b3d1..beef9a6f 100644 > --- a/libdtrace/dt_version.h > +++ b/libdtrace/dt_version.h > @@ -13,7 +13,6 @@ extern "C" { > #endif > > #include > -#include > > /* > * Stability definitions From eugene.loh at oracle.com Thu May 1 18:22:50 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 1 May 2025 14:22:50 -0400 Subject: [DTrace-devel] [PATCH 1/3] Cache per-CPU agg map IDs Message-ID: <20250501182252.27772-1-eugene.loh@oracle.com> From: Eugene Loh The dt_bpf_map_lookup_fd(dtp->dt_aggmap_fd, &cpu) call that is used to snap or truncate aggregations takes a few milliseconds, which seems all right. For large systems (e.g., 100 CPUs) and many truncations (e.g., tst.trunc.d, etc.), however, a trunc() might end up costing a minute on the consumer side, which is unreasonable and causes such tests to time out. The run time is due almost exclusively to looking up the per-CPU agg map ID. Cache the per-CPU agg map IDs. Signed-off-by: Eugene Loh --- libdtrace/dt_aggregate.c | 5 ++--- libdtrace/dt_bpf.c | 6 ++++++ libdtrace/dt_impl.h | 1 + libdtrace/dt_open.c | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libdtrace/dt_aggregate.c b/libdtrace/dt_aggregate.c index 9e47fcab7..86f9d4d5b 100644 --- a/libdtrace/dt_aggregate.c +++ b/libdtrace/dt_aggregate.c @@ -800,7 +800,7 @@ dtrace_aggregate_snap(dtrace_hdl_t *dtp) for (i = 0; i < dtp->dt_conf.num_online_cpus; i++) { int cpu = dtp->dt_conf.cpus[i].cpu_id; - int fd = dt_bpf_map_lookup_fd(dtp->dt_aggmap_fd, &cpu); + int fd = dt_bpf_map_get_fd_by_id(dtp->dt_aggmap_ids[i]); if (fd < 0) return DTRACE_WORKSTATUS_ERROR; @@ -1232,8 +1232,7 @@ dt_aggwalk_remove(dtrace_hdl_t *dtp, dt_ahashent_t *h) memcpy(key, agd->dtada_key, agd->dtada_desc->dtagd_ksize); for (i = 0; i < ncpus; i++) { - int cpu = dtp->dt_conf.cpus[i].cpu_id; - int fd = dt_bpf_map_lookup_fd(dtp->dt_aggmap_fd, &cpu); + int fd = dt_bpf_map_get_fd_by_id(dtp->dt_aggmap_ids[i]); if (fd < 0) return DTRACE_WORKSTATUS_ERROR; diff --git a/libdtrace/dt_bpf.c b/libdtrace/dt_bpf.c index d6722cbd1..635780738 100644 --- a/libdtrace/dt_bpf.c +++ b/libdtrace/dt_bpf.c @@ -689,6 +689,10 @@ gmap_create_aggs(dtrace_hdl_t *dtp) if (dtp->dt_aggmap_fd == -1) return -1; + dtp->dt_aggmap_ids = dt_calloc(dtp, dtp->dt_conf.num_online_cpus, sizeof(int)); + if (dtp->dt_aggmap_ids == NULL) + return dt_set_errno(dtp, EDT_NOMEM); + for (i = 0; i < dtp->dt_conf.num_online_cpus; i++) { int cpu = dtp->dt_conf.cpus[i].cpu_id; char name[16]; @@ -702,6 +706,8 @@ gmap_create_aggs(dtrace_hdl_t *dtp) return map_create_error(dtp, name, errno); dt_bpf_map_update(dtp->dt_aggmap_fd, &cpu, &fd); + if (dt_bpf_map_lookup(dtp->dt_aggmap_fd, &cpu, &dtp->dt_aggmap_ids[i]) < 0) + return -1; } /* Create the agg generation value array. */ diff --git a/libdtrace/dt_impl.h b/libdtrace/dt_impl.h index 68fb8ec53..1033154d9 100644 --- a/libdtrace/dt_impl.h +++ b/libdtrace/dt_impl.h @@ -388,6 +388,7 @@ struct dtrace_hdl { int dt_proc_fd; /* file descriptor for proc eventfd */ int dt_stmap_fd; /* file descriptor for the 'state' BPF map */ int dt_aggmap_fd; /* file descriptor for the 'aggs' BPF map */ + int *dt_aggmap_ids; /* ids for the 'aggN' BPF maps */ int dt_genmap_fd; /* file descriptor for the 'agggen' BPF map */ int dt_cpumap_fd; /* file descriptor for the 'cpuinfo' BPF map */ int dt_usdt_pridsmap_fd; /* file descriptor for the 'usdt_prids' BPF map */ diff --git a/libdtrace/dt_open.c b/libdtrace/dt_open.c index 71ee21467..7da4c82cc 100644 --- a/libdtrace/dt_open.c +++ b/libdtrace/dt_open.c @@ -1233,6 +1233,7 @@ dtrace_close(dtrace_hdl_t *dtp) dt_probe_detach_all(dtp); dt_free(dtp, dtp->dt_conf.cpus); + dt_free(dtp, dtp->dt_aggmap_ids); if (dtp->dt_procs != NULL) dt_proc_hash_destroy(dtp); -- 2.43.5 From eugene.loh at oracle.com Thu May 1 18:22:51 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 1 May 2025 14:22:51 -0400 Subject: [DTrace-devel] [PATCH 2/3] test: Convert tick-* probes to ioctl:entry for tst.trunc[quant].d In-Reply-To: <20250501182252.27772-1-eugene.loh@oracle.com> References: <20250501182252.27772-1-eugene.loh@oracle.com> Message-ID: <20250501182252.27772-2-eugene.loh@oracle.com> From: Eugene Loh Historically, many tests have used tick-* probes to get multiple probe firings, but those probes can be unreliable, depending on how a kernel is configured. Tests that required very many probe firings have been converted to ioctl:entry. Tests that required very few have been left alone. Convert more of these tests. They normally pass, but with erratic execution time and sometimes time out. Signed-off-by: Eugene Loh --- test/unittest/aggs/tst.trunc.d | 12 +++++++----- test/unittest/aggs/tst.truncquant.d | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/test/unittest/aggs/tst.trunc.d b/test/unittest/aggs/tst.trunc.d index dbaeb09a8..044afb3a6 100644 --- a/test/unittest/aggs/tst.trunc.d +++ b/test/unittest/aggs/tst.trunc.d @@ -1,23 +1,25 @@ /* * Oracle Linux DTrace. - * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2025, 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. */ +/* @@trigger: bogus-ioctl */ +/* @@nosort */ #pragma D option quiet int i; -tick-10ms -/i < 100/ +syscall::ioctl:entry +/pid == $target/ { @[i] = sum(i); i++; } -tick-10ms -/i == 100/ +syscall::ioctl:entry +/pid == $target && i == 100/ { exit(0); } diff --git a/test/unittest/aggs/tst.truncquant.d b/test/unittest/aggs/tst.truncquant.d index 9a8b707e5..9b9794e40 100644 --- a/test/unittest/aggs/tst.truncquant.d +++ b/test/unittest/aggs/tst.truncquant.d @@ -1,16 +1,18 @@ /* * Oracle Linux DTrace. - * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2025, 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. */ +/* @@trigger: bogus-ioctl */ +/* @@nosort */ #pragma D option quiet int i; -tick-10ms -/i < 100/ +syscall::ioctl:entry +/pid == $target/ { @[i] = lquantize(i, 0, 150); @[i] = lquantize(i + 1, 0, 150); @@ -19,8 +21,8 @@ tick-10ms i++; } -tick-10ms -/i == 100/ +syscall::ioctl:entry +/pid == $target && i == 100/ { exit(0); } -- 2.43.5 From eugene.loh at oracle.com Thu May 1 18:22:52 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 1 May 2025 14:22:52 -0400 Subject: [DTrace-devel] [PATCH 3/3] test: Mimic dtrace arithmetic more closely for avg/stddev In-Reply-To: <20250501182252.27772-1-eugene.loh@oracle.com> References: <20250501182252.27772-1-eugene.loh@oracle.com> Message-ID: <20250501182252.27772-3-eugene.loh@oracle.com> From: Eugene Loh The multicpus test checks that data from multiple CPUs is aggregated properly. Operations like avg() and stddev() require division. DTrace uses integer division, while awk does not. Change the awk check to truncate intermediate results after division. In practice, intermediate results are typically integer values anyhow. So the test has generally passed. Non-integer values could arise if, for example, CPUs are not numbered consecutively. More typically, there may be a problem that the profile probe is not firing on every expected CPU. So a test failure probably was a sign of a problem, but that's a different problem, one beyond the scope of this test. Signed-off-by: Eugene Loh --- test/unittest/aggs/tst.multicpus.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unittest/aggs/tst.multicpus.sh b/test/unittest/aggs/tst.multicpus.sh index 50eeaae44..46c668867 100755 --- a/test/unittest/aggs/tst.multicpus.sh +++ b/test/unittest/aggs/tst.multicpus.sh @@ -79,10 +79,10 @@ gawk ' # first we finish computing our estimates for avg and stddev # (the other results require no further action) - xavg /= xcnt; + xavg /= xcnt; xavg = int(xavg); - xstm /= xcnt; - xstd /= xcnt; + xstm /= xcnt; xstm = int(xstm); + xstd /= xcnt; xstd = int(xstd); xstd -= xstm * xstm; xstd = int(sqrt(xstd)); -- 2.43.5 From eugene.loh at oracle.com Thu May 1 18:37:59 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 1 May 2025 14:37:59 -0400 Subject: [DTrace-devel] [PATCH 1.5/3] Remove unused map-of-maps functions Message-ID: <20250501183759.27917-1-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- libdtrace/dt_bpf.c | 57 ---------------------------------------------- libdtrace/dt_bpf.h | 5 ---- 2 files changed, 62 deletions(-) diff --git a/libdtrace/dt_bpf.c b/libdtrace/dt_bpf.c index 635780738..4e4b6eb87 100644 --- a/libdtrace/dt_bpf.c +++ b/libdtrace/dt_bpf.c @@ -341,63 +341,6 @@ dt_bpf_map_update(int fd, const void *key, const void *val) return dt_bpf(BPF_MAP_UPDATE_ELEM, &attr); } -/* - * Retrieve the fd for a map-in-map, i.e. map[okey] which is the fd of a map. - * - * Note: the caller is responsible for closing the fd. - */ -int -dt_bpf_map_lookup_fd(int fd, const void *okey) -{ - uint32_t id; - - if (dt_bpf_map_lookup(fd, okey, &id) < 0) - return -1; - - return dt_bpf_map_get_fd_by_id(id); -} - -/* - * Retrieve the value in a map-of-maps, i.e. map[okey][ikey]. - */ -int -dt_bpf_map_lookup_inner(int fd, const void *okey, const void *ikey, void *val) -{ - int rc; - - fd = dt_bpf_map_lookup_fd(fd, okey); - if (fd < 0) - return -1; - - rc = dt_bpf_map_lookup(fd, ikey, val); - close(fd); - - return rc; -} - -/* - * Store the value in a map-of-maps, i.e. map[okey][ikey] = value. - */ -int -dt_bpf_map_update_inner(int fd, const void *okey, const void *ikey, - const void *val) -{ - uint32_t id; - int rc; - - if (dt_bpf_map_lookup(fd, okey, &id) < 0) - return -1; - - fd = dt_bpf_map_get_fd_by_id(id); - if (fd < 0) - return -1; - - rc = dt_bpf_map_update(fd, ikey, val); - close(fd); - - return rc; -} - /* * Associate a BPF program (by fd) with a raw tracepoint. */ diff --git a/libdtrace/dt_bpf.h b/libdtrace/dt_bpf.h index e03c5c6d9..43fb2233e 100644 --- a/libdtrace/dt_bpf.h +++ b/libdtrace/dt_bpf.h @@ -80,11 +80,6 @@ extern int dt_bpf_map_next_key(int fd, const void *key, void *nxt); extern int dt_bpf_map_update(int fd, const void *key, const void *val); extern int dt_bpf_map_delete(int fd, const void *key); extern int dt_bpf_map_get_fd_by_id(uint32_t id); -extern int dt_bpf_map_lookup_fd(int fd, const void *okey); -extern int dt_bpf_map_lookup_inner(int fd, const void *okey, const void *ikey, - void *val); -extern int dt_bpf_map_update_inner(int fd, const void *okey, const void *ikey, - const void *val); extern int dt_bpf_prog_attach(enum bpf_prog_type ptype, enum bpf_attach_type atype, int btf_fd, uint32_t btf_id, const dtrace_difo_t *dp, -- 2.43.5 From eugene.loh at oracle.com Fri May 9 04:59:24 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Fri, 9 May 2025 00:59:24 -0400 Subject: [DTrace-devel] [PATCH v2 4/4] test: allow overriding CC, OBJCOPY, OBJDUMP, NM, ... Message-ID: <20250509045924.25004-1-eugene.loh@oracle.com> From: Eugene Loh Bug: https://github.com/oracle/dtrace-utils/issues/75 Signed-off-by: Sam James Signed-off-by: Eugene Loh --- runtest.sh | 5 +++++ .../expensive/locking/tst.DestructionDoubleUnlock.sh | 3 +-- test/internals/headers/tst.header-endianness.sh | 3 +-- test/stress/options/tst.cpu-syscall.sh | 4 ++-- test/unittest/aggs/tst.aggmod_full2.sh | 3 +-- test/unittest/arrays/tst.uregsarray-check.sh | 3 +-- test/unittest/bitfields/tst.bitfield-offset.x | 8 ++++---- test/unittest/builtinvar/tst.errno3.sh | 3 +-- test/unittest/builtinvar/tst.tid_pid.sh | 1 - test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh | 3 +-- test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh | 3 +-- .../unittest/dtrace-util/tst.ListProbesModuleUSDT.sh | 3 +-- test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh | 3 +-- .../dtrace-util/tst.ListProbesProviderUSDT.sh | 3 +-- test/unittest/fbtprovider/tst.entryargs2.sh | 1 - test/unittest/funcs/copyout/tst.copyout.sh | 4 ++-- test/unittest/funcs/copyoutstr/tst.copyoutstr.sh | 4 ++-- test/unittest/misc/tst.include.sh | 3 +-- test/unittest/options/tst.cpu-syscall.sh | 4 ++-- test/unittest/options/tst.ctypes.sh | 8 ++++---- test/unittest/options/tst.dtypes.sh | 8 ++++---- test/unittest/options/tst.linktype.sh | 5 ++--- test/unittest/options/tst.strip.sh | 5 ++--- test/unittest/pid/tst.dash.sh | 4 ++-- test/unittest/pid/tst.offsets.sh | 6 +++--- test/unittest/pid/tst.provregex1.sh | 6 +++--- test/unittest/pid/tst.provregex2.sh | 10 +++++----- test/unittest/pid/tst.provregex3.sh | 6 +++--- test/unittest/pid/tst.provregex4.sh | 10 +++++----- test/unittest/usdt/tst.allargs.sh | 3 +-- test/unittest/usdt/tst.badguess.sh | 3 +-- test/unittest/usdt/tst.badguess.x | 2 +- test/unittest/usdt/tst.dlclose1.sh | 3 +-- test/unittest/usdt/tst.dlclose2.sh | 3 +-- test/unittest/usdt/tst.dlclose3.sh | 3 +-- test/unittest/usdt/tst.dlclose4.sh | 3 +-- test/unittest/usdt/tst.eliminate.sh | 7 +++---- test/unittest/usdt/tst.enable_pid.sh | 7 +++---- test/unittest/usdt/tst.enabled.sh | 3 +-- test/unittest/usdt/tst.enabled2.sh | 3 +-- test/unittest/usdt/tst.entryreturn.sh | 3 +-- test/unittest/usdt/tst.exec-dof-replacement.sh | 3 +-- test/unittest/usdt/tst.execstack.sh | 5 +---- test/unittest/usdt/tst.fork.sh | 3 +-- test/unittest/usdt/tst.guess32.sh | 3 +-- test/unittest/usdt/tst.guess64.sh | 3 +-- test/unittest/usdt/tst.header.sh | 3 +-- test/unittest/usdt/tst.lingering.sh | 3 +-- test/unittest/usdt/tst.link-idempotence.sh | 3 +-- test/unittest/usdt/tst.linkpriv.sh | 3 +-- test/unittest/usdt/tst.linkunpriv.sh | 3 +-- test/unittest/usdt/tst.manyprobes.sh | 3 +-- test/unittest/usdt/tst.manyprocs.sh | 3 +-- test/unittest/usdt/tst.multiple.sh | 3 +-- test/unittest/usdt/tst.multiprov-dupprobe-shlibs.sh | 3 +-- test/unittest/usdt/tst.multitrace.sh | 3 +-- test/unittest/usdt/tst.nusdtprobes.sh | 6 +++--- test/unittest/usdt/tst.onlyenabled.sh | 3 +-- test/unittest/usdt/tst.pidprobes.sh | 12 ++++++------ test/unittest/usdt/tst.pie.sh | 3 +-- test/unittest/usdt/tst.reeval.sh | 3 +-- test/unittest/usdt/tst.static.sh | 3 +-- test/unittest/usdt/tst.static2.sh | 3 +-- test/unittest/usdt/tst.user.sh | 3 +-- test/utils/workload_analyze_loop.sh | 4 ++-- 65 files changed, 109 insertions(+), 153 deletions(-) diff --git a/runtest.sh b/runtest.sh index 15bd78fb6..156e7dec8 100755 --- a/runtest.sh +++ b/runtest.sh @@ -653,6 +653,11 @@ load_modules # Export some variables so triggers and .sh scripts can get at them. export _test _pid dt_flags +export CC=${CC:-/usr/bin/gcc} +export NM=${NM:-/usr/bin/nm} +export OBJCOPY=${OBJCOPY:-/usr/bin/objcopy} +export OBJDUMP=${OBJDUMP:-/usr/bin/objdump} +export READELF=${READELF:-/usr/bin/readelf} # Arrange to do (relatively expensive) mutex debugging. export DTRACE_OPT_DEBUGASSERT="mutexes" diff --git a/test/expensive/locking/tst.DestructionDoubleUnlock.sh b/test/expensive/locking/tst.DestructionDoubleUnlock.sh index c9b9eadcd..b7118642b 100755 --- a/test/expensive/locking/tst.DestructionDoubleUnlock.sh +++ b/test/expensive/locking/tst.DestructionDoubleUnlock.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2025, 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. # @@ -28,7 +28,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/destruction-double-unlock.$$.$RANDOM" diff --git a/test/internals/headers/tst.header-endianness.sh b/test/internals/headers/tst.header-endianness.sh index e45cc5970..227da854e 100755 --- a/test/internals/headers/tst.header-endianness.sh +++ b/test/internals/headers/tst.header-endianness.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2022, 2025, 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. # @@ -10,7 +10,6 @@ set -e dtrace=$1 -CC=/usr/bin/gcc OLDDIRNAME=${PWD} CFLAGS="-I${OLDDIRNAME}/include -I${OLDDIRNAME}/uts/common" diff --git a/test/stress/options/tst.cpu-syscall.sh b/test/stress/options/tst.cpu-syscall.sh index 6fb09d48b..3f6f2f481 100755 --- a/test/stress/options/tst.cpu-syscall.sh +++ b/test/stress/options/tst.cpu-syscall.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024, 2025, 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. # @@ -91,7 +91,7 @@ int main(int c, char **v) { } EOF -gcc main.c +$CC main.c if [ $? -ne 0 ]; then echo ERROR compilation failed exit 1 diff --git a/test/unittest/aggs/tst.aggmod_full2.sh b/test/unittest/aggs/tst.aggmod_full2.sh index 66cfc002b..b87d6ba68 100755 --- a/test/unittest/aggs/tst.aggmod_full2.sh +++ b/test/unittest/aggs/tst.aggmod_full2.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2025, 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. # @@ -17,7 +17,6 @@ ## dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/aggs-aggmod_full2.$$.$RANDOM" diff --git a/test/unittest/arrays/tst.uregsarray-check.sh b/test/unittest/arrays/tst.uregsarray-check.sh index f55d36d0d..4f1aabaa8 100755 --- a/test/unittest/arrays/tst.uregsarray-check.sh +++ b/test/unittest/arrays/tst.uregsarray-check.sh @@ -1,13 +1,12 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2023, 2025, 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 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/arrays-uregsarray-check.$$.$RANDOM" diff --git a/test/unittest/bitfields/tst.bitfield-offset.x b/test/unittest/bitfields/tst.bitfield-offset.x index ae57c2b56..1f328c23c 100755 --- a/test/unittest/bitfields/tst.bitfield-offset.x +++ b/test/unittest/bitfields/tst.bitfield-offset.x @@ -12,8 +12,8 @@ # skip the test, since we can't possibly tell what it was # generated by. -if ! objdump --ctf=.ctf --ctf-parent=shared_ctf /bin/true > /dev/null 2>&1 && \ - LANG=C objdump --ctf=.ctf --ctf-parent=shared_ctf /bin/true 2>&1 | \ +if ! ${OBJDUMP} --ctf=.ctf --ctf-parent=shared_ctf /bin/true > /dev/null 2>&1 && \ + LANG=C ${OBJDUMP} --ctf=.ctf --ctf-parent=shared_ctf /bin/true 2>&1 | \ grep 'unrecognized option' > /dev/null 2>&1; then exit 2 fi @@ -21,7 +21,7 @@ fi ctfa=$tmpdir/vmlinux.ctfa trap "rm -f $ctfa" EXIT ERR -objcopy --add-section=.ctf=/lib/modules/$(uname -r)/kernel/vmlinux.ctfa /bin/true $ctfa +${OBJCOPY} --add-section=.ctf=/lib/modules/$(uname -r)/kernel/vmlinux.ctfa /bin/true $ctfa -objdump --ctf=.ctf --ctf-parent=shared_ctf $ctfa |\ +${OBJDUMP} --ctf=.ctf --ctf-parent=shared_ctf $ctfa |\ gawk '/Version: 3/ { exit 1; } /Version: / { exit 0; }' diff --git a/test/unittest/builtinvar/tst.errno3.sh b/test/unittest/builtinvar/tst.errno3.sh index 7546152f6..d1bcde391 100755 --- a/test/unittest/builtinvar/tst.errno3.sh +++ b/test/unittest/builtinvar/tst.errno3.sh @@ -1,13 +1,12 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2021, 2025, 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 -CC=/usr/bin/gcc DIRNAME="$tmpdir/builtinvar-errno3.$$.$RANDOM" mkdir -p $DIRNAME diff --git a/test/unittest/builtinvar/tst.tid_pid.sh b/test/unittest/builtinvar/tst.tid_pid.sh index 7ff0227fe..e367411dc 100755 --- a/test/unittest/builtinvar/tst.tid_pid.sh +++ b/test/unittest/builtinvar/tst.tid_pid.sh @@ -7,7 +7,6 @@ # dtrace=$1 -CC=/usr/bin/gcc DIRNAME="$tmpdir/builtinvar-tid_pid.$$.$RANDOM" mkdir -p $DIRNAME diff --git a/test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh b/test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh index 737f2cc88..945d21882 100755 --- a/test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh +++ b/test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2025, 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. @@ -20,7 +20,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/list-probes-args-usdt.$$.$RANDOM" diff --git a/test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh b/test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh index f8083f2c9..e7af9da9d 100755 --- a/test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh +++ b/test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2025, 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. # @@ -22,7 +22,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/list-probes-func-usdt.$$.$RANDOM" diff --git a/test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh b/test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh index dc6cb1008..f66d6cbdd 100755 --- a/test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh +++ b/test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2025, 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. # @@ -22,7 +22,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/list-probes-module-usdt.$$.$RANDOM" diff --git a/test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh b/test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh index 59b8dca56..9f6ca8bab 100755 --- a/test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh +++ b/test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2025, 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. # @@ -22,7 +22,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/list-probes-name-usdt.$$.$RANDOM" diff --git a/test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh b/test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh index 64fc185da..be6d87be2 100755 --- a/test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh +++ b/test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2025, 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. # @@ -22,7 +22,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/list-probes-provider-usdt.$$.$RANDOM" diff --git a/test/unittest/fbtprovider/tst.entryargs2.sh b/test/unittest/fbtprovider/tst.entryargs2.sh index f5b435f56..4485d33a8 100755 --- a/test/unittest/fbtprovider/tst.entryargs2.sh +++ b/test/unittest/fbtprovider/tst.entryargs2.sh @@ -9,7 +9,6 @@ # dtrace=$1 -CC=${CC:-/usr/bin/gcc} # Set up test directory. diff --git a/test/unittest/funcs/copyout/tst.copyout.sh b/test/unittest/funcs/copyout/tst.copyout.sh index 748b138b8..9553938bc 100755 --- a/test/unittest/funcs/copyout/tst.copyout.sh +++ b/test/unittest/funcs/copyout/tst.copyout.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2023, 2025, 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. @@ -31,7 +31,7 @@ int main(int c, char **v) { } EOF -gcc main.c +$CC main.c if [ $? -ne 0 ]; then echo "compilation error" exit 1 diff --git a/test/unittest/funcs/copyoutstr/tst.copyoutstr.sh b/test/unittest/funcs/copyoutstr/tst.copyoutstr.sh index d98897fcc..284478b06 100755 --- a/test/unittest/funcs/copyoutstr/tst.copyoutstr.sh +++ b/test/unittest/funcs/copyoutstr/tst.copyoutstr.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2023, 2025, 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. @@ -42,7 +42,7 @@ int main(int c, char **v) { } EOF -gcc main.c +$CC main.c if [ $? -ne 0 ]; then echo "compilation error" exit 1 diff --git a/test/unittest/misc/tst.include.sh b/test/unittest/misc/tst.include.sh index 9d9989a3e..4cdacfe91 100755 --- a/test/unittest/misc/tst.include.sh +++ b/test/unittest/misc/tst.include.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2025, 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. # @@ -13,7 +13,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIR="$tmpdir/misc-include.$$.$RANDOM" diff --git a/test/unittest/options/tst.cpu-syscall.sh b/test/unittest/options/tst.cpu-syscall.sh index 401839d56..4fb58c35f 100755 --- a/test/unittest/options/tst.cpu-syscall.sh +++ b/test/unittest/options/tst.cpu-syscall.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024, 2025, 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. # @@ -91,7 +91,7 @@ int main(int c, char **v) { } EOF -gcc main.c +$CC main.c if [ $? -ne 0 ]; then echo ERROR compilation failed exit 1 diff --git a/test/unittest/options/tst.ctypes.sh b/test/unittest/options/tst.ctypes.sh index 30a6c9b16..767de0db0 100755 --- a/test/unittest/options/tst.ctypes.sh +++ b/test/unittest/options/tst.ctypes.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2022, 2025, 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. # @@ -14,14 +14,14 @@ if [ ! -r $tmpdir/ctypes.ctf ]; then exit 1 fi -if objdump --help | grep ctf >/dev/null; then - objcopy --add-section=.ctf=$tmpdir/ctypes.ctf /bin/true $tmpdir/ctypes.o +if ${OBJDUMP} --help | grep ctf >/dev/null; then + ${OBJCOPY} --add-section=.ctf=$tmpdir/ctypes.ctf /bin/true $tmpdir/ctypes.o if [ $? -ne 0 ]; then echo "ERROR: Failed to create ELF object from ctypes.ctf" exit 1 fi - objdump --ctf=.ctf $tmpdir/ctypes.o | \ + ${OBJDUMP} --ctf=.ctf $tmpdir/ctypes.o | \ gawk '/CTF_VERSION/ { found = 1; next; } found && $1 ~ /0x[0-9A-Fa-f]+:/ { cnt++; next; } END { print "C CTF data" (found ? " " : " NOT ") "found"; diff --git a/test/unittest/options/tst.dtypes.sh b/test/unittest/options/tst.dtypes.sh index 441de098a..ac6a8036d 100755 --- a/test/unittest/options/tst.dtypes.sh +++ b/test/unittest/options/tst.dtypes.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2022, 2025, 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. # @@ -14,14 +14,14 @@ if [ ! -r $tmpdir/dtypes.ctf ]; then exit 1 fi -if objdump --help | grep ctf >/dev/null; then - objcopy --add-section=.ctf=$tmpdir/dtypes.ctf /bin/true $tmpdir/dtypes.o +if ${OBJDUMP} --help | grep ctf >/dev/null; then + ${OBJCOPY} --add-section=.ctf=$tmpdir/dtypes.ctf /bin/true $tmpdir/dtypes.o if [ $? -ne 0 ]; then echo "ERROR: Failed to create ELF object from dtypes.ctf" exit 1 fi - objdump --ctf=.ctf $tmpdir/dtypes.o | \ + ${OBJDUMP} --ctf=.ctf $tmpdir/dtypes.o | \ gawk '/CTF_VERSION/ { found = 1; next; } found && $1 ~ /0x[0-9A-Fa-f]+:/ { cnt++; next; } END { print "D CTF data" (found ? " " : " NOT ") "found"; diff --git a/test/unittest/options/tst.linktype.sh b/test/unittest/options/tst.linktype.sh index 564d9b0f6..7298d67a7 100755 --- a/test/unittest/options/tst.linktype.sh +++ b/test/unittest/options/tst.linktype.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2023, 2025, 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. # @@ -9,7 +9,6 @@ # @@nosort dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/linktype.$$.$RANDOM" @@ -61,7 +60,7 @@ function mytest() { fi # report whether the file format is recognized - objdump --file-headers prov.o |& gawk ' + ${OBJDUMP} --file-headers prov.o |& gawk ' /format not recognized/ { print "objdump does NOT recognize file format"; exit(0); diff --git a/test/unittest/options/tst.strip.sh b/test/unittest/options/tst.strip.sh index 054955fb3..f7960d7a6 100755 --- a/test/unittest/options/tst.strip.sh +++ b/test/unittest/options/tst.strip.sh @@ -1,13 +1,12 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2023, 2025, 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 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/strip.$$.$RANDOM" @@ -48,7 +47,7 @@ fi # link with and without -xstrip, dumping the DOF section -objdump="objdump --full-contents --section=.SUNW_dof prov.o" +objdump="${OBJDUMP} --full-contents --section=.SUNW_dof prov.o" $dtrace $dt_flags -G -xstrip -s prov.d test.o if [ $? -ne 0 ]; then diff --git a/test/unittest/pid/tst.dash.sh b/test/unittest/pid/tst.dash.sh index f364e3e3c..0289b6093 100755 --- a/test/unittest/pid/tst.dash.sh +++ b/test/unittest/pid/tst.dash.sh @@ -54,7 +54,7 @@ int main(int c, char **v) { } EOF -gcc main.c +$CC main.c if [ $? -ne 0 ]; then echo ERROR compile exit 1 @@ -66,7 +66,7 @@ for func in foo0 foo1 foo2 main; do # For each function, get the absolute and relative # (to the function) address of some instruction in # the function. - read ABS REL <<< `objdump -d a.out | awk ' + read ABS REL <<< `$OBJDUMP -d a.out | awk ' # Look for the function. /^[0-9a-f]* <'$func'>:$/ { diff --git a/test/unittest/pid/tst.offsets.sh b/test/unittest/pid/tst.offsets.sh index cc1a440d5..23aad6202 100755 --- a/test/unittest/pid/tst.offsets.sh +++ b/test/unittest/pid/tst.offsets.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024, 2025, 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. # @@ -54,7 +54,7 @@ main(int c, char **v) } EOF -gcc main.c +$CC main.c if [ $? -ne 0 ]; then echo ERROR in compiling exit 1 @@ -85,7 +85,7 @@ fi # hot and cold instructions in the function. # -objdump -d a.out | gawk ' +${OBJDUMP} -d a.out | gawk ' BEGIN { pc0 = 0; # First PC of loopfunc() pcjump = 0; # PC of the jump diff --git a/test/unittest/pid/tst.provregex1.sh b/test/unittest/pid/tst.provregex1.sh index c672b23fa..5bc0bd510 100755 --- a/test/unittest/pid/tst.provregex1.sh +++ b/test/unittest/pid/tst.provregex1.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2025, 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. # @@ -23,10 +23,10 @@ cat > $DIR/Makefile < $DIR/main.c < $DIR/Makefile < $DIR/altlib.c < $DIR/Makefile < $DIR/Makefile </dev/null +echo 'int main (void) { }' | $CC -x c -c -o /dev/null -m32 - 2>/dev/null diff --git a/test/unittest/usdt/tst.dlclose1.sh b/test/unittest/usdt/tst.dlclose1.sh index a6bad02b7..6e2c0da7d 100755 --- a/test/unittest/usdt/tst.dlclose1.sh +++ b/test/unittest/usdt/tst.dlclose1.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2025, 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. # @@ -29,7 +29,6 @@ # The second should not. dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/usdt-dlclose1.$$.$RANDOM" diff --git a/test/unittest/usdt/tst.dlclose2.sh b/test/unittest/usdt/tst.dlclose2.sh index 907685a68..88779fc52 100755 --- a/test/unittest/usdt/tst.dlclose2.sh +++ b/test/unittest/usdt/tst.dlclose2.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -15,7 +15,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/usdt-dlclose2.$$.$RANDOM" diff --git a/test/unittest/usdt/tst.dlclose3.sh b/test/unittest/usdt/tst.dlclose3.sh index 0b70906fc..bcc1e0ed2 100755 --- a/test/unittest/usdt/tst.dlclose3.sh +++ b/test/unittest/usdt/tst.dlclose3.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2025, 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. # @@ -21,7 +21,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/usdt-dlclose3.$$.$RANDOM" diff --git a/test/unittest/usdt/tst.dlclose4.sh b/test/unittest/usdt/tst.dlclose4.sh index a84e34600..9e1a11c49 100755 --- a/test/unittest/usdt/tst.dlclose4.sh +++ b/test/unittest/usdt/tst.dlclose4.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024, 2025, 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. # @@ -15,7 +15,6 @@ PATH=/usr/bin:/usr/sbin:$PATH # dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/usdt-dlclose4.$$.$RANDOM" diff --git a/test/unittest/usdt/tst.eliminate.sh b/test/unittest/usdt/tst.eliminate.sh index e74896bbe..e9fbf5e99 100755 --- a/test/unittest/usdt/tst.eliminate.sh +++ b/test/unittest/usdt/tst.eliminate.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2025, 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. # @@xfail: Linux ld does not seem to support STV_ELIMINATE @@ -16,7 +16,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" @@ -71,13 +70,13 @@ if [ $? -ne 0 ]; then exit 1 fi -nm test.o | grep \$dtrace > /dev/null +${NM} test.o | grep \$dtrace > /dev/null if [ $? -ne 0 ]; then echo "no temporary symbols in the object file" >& 2 exit 1 fi -nm test | grep \$dtrace > /dev/null +${NM} test | grep \$dtrace > /dev/null if [ $? -eq 0 ]; then echo "failed to eliminate temporary symbols" >& 2 exit 1 diff --git a/test/unittest/usdt/tst.enable_pid.sh b/test/unittest/usdt/tst.enable_pid.sh index 207184d43..7f4f68698 100755 --- a/test/unittest/usdt/tst.enable_pid.sh +++ b/test/unittest/usdt/tst.enable_pid.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024, 2025, 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. # @@ -14,7 +14,6 @@ PATH=/usr/bin:/usr/sbin:$PATH # dtrace=$1 -CC=/usr/bin/gcc CFLAGS= DIRNAME="$tmpdir/usdt-enable_pid.$$.$RANDOM" @@ -120,7 +119,7 @@ if [ $? -ne 0 ]; then echo "failed to generate header file" >&2 exit 1 fi -cc $test_cppflags -c main.c +$CC $test_cppflags -c main.c if [ $? -ne 0 ]; then echo "failed to compile test" >&2 exit 1 @@ -130,7 +129,7 @@ if [ $? -ne 0 ]; then echo "failed to create DOF" >&2 exit 1 fi -cc $test_cppflags -o main main.o prov.o +$CC $test_cppflags -o main main.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >&2 exit 1 diff --git a/test/unittest/usdt/tst.enabled.sh b/test/unittest/usdt/tst.enabled.sh index 4cd1eccdb..a180f9622 100755 --- a/test/unittest/usdt/tst.enabled.sh +++ b/test/unittest/usdt/tst.enabled.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.enabled2.sh b/test/unittest/usdt/tst.enabled2.sh index 1732085e6..b174ef4c3 100755 --- a/test/unittest/usdt/tst.enabled2.sh +++ b/test/unittest/usdt/tst.enabled2.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2025, 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. # @@ -15,7 +15,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.entryreturn.sh b/test/unittest/usdt/tst.entryreturn.sh index 84af96723..03418e7ba 100755 --- a/test/unittest/usdt/tst.entryreturn.sh +++ b/test/unittest/usdt/tst.entryreturn.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2025, 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. # @@ -13,7 +13,6 @@ fi # @@xfail: dtv2, no wildcard usdt probes yet dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.exec-dof-replacement.sh b/test/unittest/usdt/tst.exec-dof-replacement.sh index 6d547cce3..b7ec5f2dc 100755 --- a/test/unittest/usdt/tst.exec-dof-replacement.sh +++ b/test/unittest/usdt/tst.exec-dof-replacement.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -14,7 +14,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.execstack.sh b/test/unittest/usdt/tst.execstack.sh index e7b59105b..42da70350 100755 --- a/test/unittest/usdt/tst.execstack.sh +++ b/test/unittest/usdt/tst.execstack.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -11,11 +11,8 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" -OBJDUMP=/usr/bin/objdump -READELF=/usr/bin/readelf DIRNAME="$tmpdir/usdt-execstack.$$.$RANDOM" mkdir -p $DIRNAME diff --git a/test/unittest/usdt/tst.fork.sh b/test/unittest/usdt/tst.fork.sh index 9b2b372a0..e82463f96 100755 --- a/test/unittest/usdt/tst.fork.sh +++ b/test/unittest/usdt/tst.fork.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -12,7 +12,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.guess32.sh b/test/unittest/usdt/tst.guess32.sh index 7a130e178..219612368 100755 --- a/test/unittest/usdt/tst.guess32.sh +++ b/test/unittest/usdt/tst.guess32.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.guess64.sh b/test/unittest/usdt/tst.guess64.sh index 23b7a241c..417dcec92 100755 --- a/test/unittest/usdt/tst.guess64.sh +++ b/test/unittest/usdt/tst.guess64.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.header.sh b/test/unittest/usdt/tst.header.sh index c5e411be6..521e9fd1f 100755 --- a/test/unittest/usdt/tst.header.sh +++ b/test/unittest/usdt/tst.header.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.lingering.sh b/test/unittest/usdt/tst.lingering.sh index 079acb75d..148345cfc 100755 --- a/test/unittest/usdt/tst.lingering.sh +++ b/test/unittest/usdt/tst.lingering.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -14,7 +14,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.link-idempotence.sh b/test/unittest/usdt/tst.link-idempotence.sh index 643ba10ca..caa495338 100755 --- a/test/unittest/usdt/tst.link-idempotence.sh +++ b/test/unittest/usdt/tst.link-idempotence.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.linkpriv.sh b/test/unittest/usdt/tst.linkpriv.sh index 2c89f5d46..5f637e857 100755 --- a/test/unittest/usdt/tst.linkpriv.sh +++ b/test/unittest/usdt/tst.linkpriv.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="-std=gnu99 $test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.linkunpriv.sh b/test/unittest/usdt/tst.linkunpriv.sh index 9ef386392..b00d532ea 100755 --- a/test/unittest/usdt/tst.linkunpriv.sh +++ b/test/unittest/usdt/tst.linkunpriv.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -13,7 +13,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" DIRNAME="$tmpdir/usdt-linkunpriv.$$.$RANDOM" diff --git a/test/unittest/usdt/tst.manyprobes.sh b/test/unittest/usdt/tst.manyprobes.sh index c0deb8df0..6e894f2cd 100755 --- a/test/unittest/usdt/tst.manyprobes.sh +++ b/test/unittest/usdt/tst.manyprobes.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2023, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-manyprobes.$$.$RANDOM" diff --git a/test/unittest/usdt/tst.manyprocs.sh b/test/unittest/usdt/tst.manyprocs.sh index 585503029..e157d05a4 100755 --- a/test/unittest/usdt/tst.manyprocs.sh +++ b/test/unittest/usdt/tst.manyprocs.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -14,7 +14,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.multiple.sh b/test/unittest/usdt/tst.multiple.sh index 440a7d7ba..8734a1103 100755 --- a/test/unittest/usdt/tst.multiple.sh +++ b/test/unittest/usdt/tst.multiple.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.multiprov-dupprobe-shlibs.sh b/test/unittest/usdt/tst.multiprov-dupprobe-shlibs.sh index 6595737f9..2fc17e586 100755 --- a/test/unittest/usdt/tst.multiprov-dupprobe-shlibs.sh +++ b/test/unittest/usdt/tst.multiprov-dupprobe-shlibs.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024, 2025, 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. # @@ -13,7 +13,6 @@ # @@nosort dtrace=$1 -CC=/usr/bin/gcc DIRNAME="$tmpdir/usdt-multiprov-dupprobe-shlibs.$$.$RANDOM" mkdir -p $DIRNAME diff --git a/test/unittest/usdt/tst.multitrace.sh b/test/unittest/usdt/tst.multitrace.sh index 262c78282..81f43f767 100755 --- a/test/unittest/usdt/tst.multitrace.sh +++ b/test/unittest/usdt/tst.multitrace.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -14,7 +14,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.nusdtprobes.sh b/test/unittest/usdt/tst.nusdtprobes.sh index f275f921f..93c56e382 100755 --- a/test/unittest/usdt/tst.nusdtprobes.sh +++ b/test/unittest/usdt/tst.nusdtprobes.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024, 2025, 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. # @@ -66,7 +66,7 @@ if [ $? -ne 0 ]; then echo "failed to generate header file" >&2 exit 1 fi -gcc $test_cppflags -c main.c +$CC $test_cppflags -c main.c if [ $? -ne 0 ]; then echo "failed to compile test" >&2 exit 1 @@ -76,7 +76,7 @@ if [ $? -ne 0 ]; then echo "failed to create DOF" >&2 exit 1 fi -gcc $test_ldflags -o main main.o prov.o +$CC $test_ldflags -o main main.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >&2 exit 1 diff --git a/test/unittest/usdt/tst.onlyenabled.sh b/test/unittest/usdt/tst.onlyenabled.sh index d3487834e..9db5dc462 100755 --- a/test/unittest/usdt/tst.onlyenabled.sh +++ b/test/unittest/usdt/tst.onlyenabled.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.pidprobes.sh b/test/unittest/usdt/tst.pidprobes.sh index 0c75d7967..72434eb96 100755 --- a/test/unittest/usdt/tst.pidprobes.sh +++ b/test/unittest/usdt/tst.pidprobes.sh @@ -69,20 +69,20 @@ if [ $? -ne 0 ]; then echo "failed to generate header file" >&2 exit 1 fi -cc $test_cppflags -c main.c +$CC $test_cppflags -c main.c if [ $? -ne 0 ]; then echo "failed to compile test" >&2 exit 1 fi if [[ `uname -m` = "aarch64" ]]; then - objdump -d main.o > disasm_foo.txt.before + $OBJDUMP -d main.o > disasm_foo.txt.before fi $dtrace $dt_flags -G -64 -s prov.d main.o if [ $? -ne 0 ]; then echo "failed to create DOF" >&2 exit 1 fi -cc $test_ldflags -o main main.o prov.o +$CC $test_ldflags -o main main.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >&2 exit 1 @@ -104,7 +104,7 @@ fi # Disassemble foo(). (simplify with --disassemble=foo) -objdump -d main | awk ' +$OBJDUMP -d main | awk ' BEGIN { use = 0 } # start by not printing lines use == 1 && NF == 0 { exit } # if printing lines but hit a blank, then exit use == 1 { print } # print lines @@ -112,7 +112,7 @@ use == 1 { print } # print lines ' > disasm_foo.txt if [ $? -ne 0 ]; then echo cannot objdump main - objdump -d main + $OBJDUMP -d main exit 1 fi @@ -277,7 +277,7 @@ done pc_return=`awk '/'$pid' pid'$pid':main:foo:return/ { print $NF }' dtrace.out` -objdump -d main | awk ' +$OBJDUMP -d main | awk ' /^[0-9a-f]* <.*>:$/ { myfunc = $NF } # enter a new function /^ *'$pc_return'/ { print myfunc; exit(0) } # report the function $pc_return is in ' > return_func.out diff --git a/test/unittest/usdt/tst.pie.sh b/test/unittest/usdt/tst.pie.sh index 0d62c3762..a2c12a262 100755 --- a/test/unittest/usdt/tst.pie.sh +++ b/test/unittest/usdt/tst.pie.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2023, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="-fno-inline -pie $test_cppflags" LDFLAGS="-pie $test_ldflags" diff --git a/test/unittest/usdt/tst.reeval.sh b/test/unittest/usdt/tst.reeval.sh index 371eee3db..069248f55 100755 --- a/test/unittest/usdt/tst.reeval.sh +++ b/test/unittest/usdt/tst.reeval.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2025, 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. # @@ -12,7 +12,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.static.sh b/test/unittest/usdt/tst.static.sh index 81b3ba041..dd96b0fff 100755 --- a/test/unittest/usdt/tst.static.sh +++ b/test/unittest/usdt/tst.static.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -11,7 +11,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.static2.sh b/test/unittest/usdt/tst.static2.sh index 115a95511..2606ecf33 100755 --- a/test/unittest/usdt/tst.static2.sh +++ b/test/unittest/usdt/tst.static2.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -15,7 +15,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/unittest/usdt/tst.user.sh b/test/unittest/usdt/tst.user.sh index 30513acca..624897053 100755 --- a/test/unittest/usdt/tst.user.sh +++ b/test/unittest/usdt/tst.user.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2025, 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. # @@ -13,7 +13,6 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" diff --git a/test/utils/workload_analyze_loop.sh b/test/utils/workload_analyze_loop.sh index 3bbadf78b..7edce7b02 100755 --- a/test/utils/workload_analyze_loop.sh +++ b/test/utils/workload_analyze_loop.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2023, 2025, 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. @@ -13,7 +13,7 @@ if [ ! -e $prog ]; then exit 1 fi -objdump -d $prog | gawk -v myarch=$(uname -m) ' +${OBJDUMP} -d $prog | gawk -v myarch=$(uname -m) ' # decide whether to track instructions (which we number n = 1, 2, 3, ...) or not (n < 0) # specifically, do not track instructions until we find the disassembly for
BEGIN { n = -1; } -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:06 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:06 -0400 Subject: [DTrace-devel] [PATCH 02/14] Add stack-skip frame count for rawtp provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-2-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- libdtrace/dt_prov_rawtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libdtrace/dt_prov_rawtp.c b/libdtrace/dt_prov_rawtp.c index f1d3b6bc4..a36bb51f4 100644 --- a/libdtrace/dt_prov_rawtp.c +++ b/libdtrace/dt_prov_rawtp.c @@ -296,6 +296,7 @@ use_alt: dt_provimpl_t dt_rawtp = { .name = prvname, .prog_type = BPF_PROG_TYPE_RAW_TRACEPOINT, + .stack_skip = 4, .populate = &populate, .load_prog = &dt_bpf_prog_load, .trampoline = &trampoline, -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:07 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:07 -0400 Subject: [DTrace-devel] [PATCH 03/14] Test: remove unnecessary "unstable" tag In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-3-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- test/unittest/sched/tst.stackdepth.d | 1 - 1 file changed, 1 deletion(-) diff --git a/test/unittest/sched/tst.stackdepth.d b/test/unittest/sched/tst.stackdepth.d index 02a878bea..e6ffca01c 100644 --- a/test/unittest/sched/tst.stackdepth.d +++ b/test/unittest/sched/tst.stackdepth.d @@ -4,7 +4,6 @@ * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ -/* @@tags: unstable */ #pragma D option switchrate=100hz -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:08 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:08 -0400 Subject: [DTrace-devel] [PATCH 04/14] Test: caller and stackdepth tests for fbt provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-4-eugene.loh@oracle.com> From: Eugene Loh We will introduce a set of tests for the caller and stackdepth built-in variables for a wide selection of providers. For the caller test, we will essentially call stack(2); sym(caller); and then compare the caller to the second stack frame using the new script check_caller_to_stack2.awk. For the stackdepth test, we will essentially call printf("%d\n", stackdepth); stack(); and then compare the stackdepth to the reported frames using the new script check_stackdepth_to_stack.awk. In this patch, introduce tests for the fbt provider, along with the support scripts they need. Subsequent patches will handle other providers. The old tst.caller2.d and tst.stackdepth2.d, which tested fbt, become obsolete. Remove them. Signed-off-by: Eugene Loh --- .../variables/bvar/check_caller_to_stack2.awk | 32 +++++++++++++++++ ...pth2.r.p => check_stackdepth_to_stack.awk} | 16 ++++++--- test/unittest/variables/bvar/tst.caller-fbt.d | 25 +++++++++++++ test/unittest/variables/bvar/tst.caller-fbt.r | 1 + .../variables/bvar/tst.caller-fbt.r.p | 1 + test/unittest/variables/bvar/tst.caller2.d | 31 ---------------- test/unittest/variables/bvar/tst.caller2.r | 1 - test/unittest/variables/bvar/tst.caller2.r.p | 11 ------ .../variables/bvar/tst.stackdepth-fbt.d | 27 ++++++++++++++ ...tst.stackdepth2.r => tst.stackdepth-fbt.r} | 0 .../variables/bvar/tst.stackdepth-fbt.r.p | 1 + .../unittest/variables/bvar/tst.stackdepth2.d | 36 ------------------- 12 files changed, 99 insertions(+), 83 deletions(-) create mode 100755 test/unittest/variables/bvar/check_caller_to_stack2.awk rename test/unittest/variables/bvar/{tst.stackdepth2.r.p => check_stackdepth_to_stack.awk} (63%) create mode 100644 test/unittest/variables/bvar/tst.caller-fbt.d create mode 100644 test/unittest/variables/bvar/tst.caller-fbt.r create mode 120000 test/unittest/variables/bvar/tst.caller-fbt.r.p delete mode 100644 test/unittest/variables/bvar/tst.caller2.d delete mode 100644 test/unittest/variables/bvar/tst.caller2.r delete mode 100755 test/unittest/variables/bvar/tst.caller2.r.p create mode 100644 test/unittest/variables/bvar/tst.stackdepth-fbt.d rename test/unittest/variables/bvar/{tst.stackdepth2.r => tst.stackdepth-fbt.r} (100%) create mode 120000 test/unittest/variables/bvar/tst.stackdepth-fbt.r.p delete mode 100644 test/unittest/variables/bvar/tst.stackdepth2.d diff --git a/test/unittest/variables/bvar/check_caller_to_stack2.awk b/test/unittest/variables/bvar/check_caller_to_stack2.awk new file mode 100755 index 000000000..8499852a7 --- /dev/null +++ b/test/unittest/variables/bvar/check_caller_to_stack2.awk @@ -0,0 +1,32 @@ +#!/usr/bin/gawk -f + +# Check output of tst.caller-$provider.d tests of the form +# +# { +# stack(2); +# sym(caller); +# } +# +# Confirm that the caller information matches the stack information. + +# Look for the first nonblank line. +NF != 0 { + # It is the current frame. Skip it. + if (getline != 1) { print "ERROR: missing expected output"; exit(1); } + + # Now we have the caller frame. Strip off the offset. + expect=$1 + sub("+0x[0-9a-f]*$", "", expect); + + # Finally, get the sym(caller) output. + if (getline != 1) { print "ERROR: missing expected output"; exit(1); } + + # Compare. + if (expect == $1) { + print "success"; + exit(0); + } else { + print "ERROR: expect", expect, "but got", $1; + exit(1); + } +} diff --git a/test/unittest/variables/bvar/tst.stackdepth2.r.p b/test/unittest/variables/bvar/check_stackdepth_to_stack.awk similarity index 63% rename from test/unittest/variables/bvar/tst.stackdepth2.r.p rename to test/unittest/variables/bvar/check_stackdepth_to_stack.awk index 9b071181f..fba1f4242 100755 --- a/test/unittest/variables/bvar/tst.stackdepth2.r.p +++ b/test/unittest/variables/bvar/check_stackdepth_to_stack.awk @@ -1,8 +1,16 @@ #!/usr/bin/gawk -f -# Oracle Linux DTrace. -# Copyright (c) 2016, 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. +# +# Check output of tst.stackdepth-$provider.d tests of the form +# +# { +# printf("DEPTH %d\n", stackdepth); +# printf("TRACE BEGIN\n"); +# stack(); +# printf("TRACE END\n"); +# exit(0); +# } +# +# Confirm that the stackdepth information matches the stack information. /^DEPTH/ { depth = int($2); diff --git a/test/unittest/variables/bvar/tst.caller-fbt.d b/test/unittest/variables/bvar/tst.caller-fbt.d new file mode 100644 index 000000000..695104134 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-fbt.d @@ -0,0 +1,25 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + +fbt::ksys_write:entry +/pid == $target/ +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-fbt.r b/test/unittest/variables/bvar/tst.caller-fbt.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-fbt.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-fbt.r.p b/test/unittest/variables/bvar/tst.caller-fbt.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-fbt.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.caller2.d b/test/unittest/variables/bvar/tst.caller2.d deleted file mode 100644 index ca6dbfd22..000000000 --- a/test/unittest/variables/bvar/tst.caller2.d +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -/* - * ASSERTION: The 'caller' should be consistent with stack(). - * - * SECTION: Variables/Built-in Variables/caller - */ - -#pragma D option quiet -#pragma D option destructive - -BEGIN -{ - system("echo write something > /dev/null"); -} - -fbt::ksys_write:entry -{ - stack(2); - sym(caller); - exit(0); -} - -ERROR { - exit(1); -} diff --git a/test/unittest/variables/bvar/tst.caller2.r b/test/unittest/variables/bvar/tst.caller2.r deleted file mode 100644 index 0cfbf0888..000000000 --- a/test/unittest/variables/bvar/tst.caller2.r +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/test/unittest/variables/bvar/tst.caller2.r.p b/test/unittest/variables/bvar/tst.caller2.r.p deleted file mode 100755 index 1a26a4df2..000000000 --- a/test/unittest/variables/bvar/tst.caller2.r.p +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# sed: remove +0x{ptr} offsets -# awk: look for the ksys_write frame, then write the next two lines -# uniq: count unique lines -# awk: report the counts - -sed 's/+0x.*$//' \ -| /usr/bin/gawk '/ksys_write/ {getline; print $1; getline; print $1; exit(0)}' \ -| uniq -c \ -| /usr/bin/gawk '{print $1}' diff --git a/test/unittest/variables/bvar/tst.stackdepth-fbt.d b/test/unittest/variables/bvar/tst.stackdepth-fbt.d new file mode 100644 index 000000000..10b05399e --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-fbt.d @@ -0,0 +1,27 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + +fbt::ksys_write:entry +/pid == $target/ +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth2.r b/test/unittest/variables/bvar/tst.stackdepth-fbt.r similarity index 100% rename from test/unittest/variables/bvar/tst.stackdepth2.r rename to test/unittest/variables/bvar/tst.stackdepth-fbt.r diff --git a/test/unittest/variables/bvar/tst.stackdepth-fbt.r.p b/test/unittest/variables/bvar/tst.stackdepth-fbt.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-fbt.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth2.d b/test/unittest/variables/bvar/tst.stackdepth2.d deleted file mode 100644 index 2b1c0866a..000000000 --- a/test/unittest/variables/bvar/tst.stackdepth2.d +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Oracle Linux DTrace. - * Copyright (c) 2006, 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. - */ - -#pragma D option destructive -#pragma D option quiet - -/* - * ASSERTION: - * Test the stackdepth variable. Verify its value against the stack trace. - * - * SECTION: Variables/Built-in Variables - * - */ - -BEGIN -{ - system("echo write something > /dev/null"); -} - -fbt::ksys_write:entry -{ - printf("DEPTH %d\n", stackdepth); - printf("TRACE BEGIN\n"); - stack(); - printf("TRACE END\n"); - exit(0); -} - -ERROR -{ - exit(1); -} -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:11 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:11 -0400 Subject: [DTrace-devel] [PATCH 07/14] Test: caller and stackdepth tests for cpc provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-7-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- test/unittest/variables/bvar/tst.caller-cpc.d | 22 +++++++++++++++++ test/unittest/variables/bvar/tst.caller-cpc.r | 1 + .../variables/bvar/tst.caller-cpc.r.p | 1 + .../variables/bvar/tst.stackdepth-cpc.d | 24 +++++++++++++++++++ .../variables/bvar/tst.stackdepth-cpc.r | 1 + .../variables/bvar/tst.stackdepth-cpc.r.p | 1 + 6 files changed, 50 insertions(+) create mode 100644 test/unittest/variables/bvar/tst.caller-cpc.d create mode 100644 test/unittest/variables/bvar/tst.caller-cpc.r create mode 120000 test/unittest/variables/bvar/tst.caller-cpc.r.p create mode 100644 test/unittest/variables/bvar/tst.stackdepth-cpc.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-cpc.r create mode 120000 test/unittest/variables/bvar/tst.stackdepth-cpc.r.p diff --git a/test/unittest/variables/bvar/tst.caller-cpc.d b/test/unittest/variables/bvar/tst.caller-cpc.d new file mode 100644 index 000000000..8932185ee --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-cpc.d @@ -0,0 +1,22 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +cpc:::cpu_clock-all-100000000 +/stackdepth > 1/ +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-cpc.r b/test/unittest/variables/bvar/tst.caller-cpc.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-cpc.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-cpc.r.p b/test/unittest/variables/bvar/tst.caller-cpc.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-cpc.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-cpc.d b/test/unittest/variables/bvar/tst.stackdepth-cpc.d new file mode 100644 index 000000000..abefee0b0 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-cpc.d @@ -0,0 +1,24 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +cpc:::cpu_clock-all-100000000 +/stackdepth > 1/ +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth-cpc.r b/test/unittest/variables/bvar/tst.stackdepth-cpc.r new file mode 100644 index 000000000..3bd29b8ed --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-cpc.r @@ -0,0 +1 @@ +Stack depth OK diff --git a/test/unittest/variables/bvar/tst.stackdepth-cpc.r.p b/test/unittest/variables/bvar/tst.stackdepth-cpc.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-cpc.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:12 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:12 -0400 Subject: [DTrace-devel] [PATCH 08/14] Test: caller and stackdepth tests for ip provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-8-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- test/unittest/variables/bvar/perlping.pl | 8 +++++++ test/unittest/variables/bvar/tst.caller-ip.d | 21 ++++++++++++++++ test/unittest/variables/bvar/tst.caller-ip.r | 1 + .../unittest/variables/bvar/tst.caller-ip.r.p | 1 + test/unittest/variables/bvar/tst.caller-ip.t | 6 +++++ .../variables/bvar/tst.stackdepth-ip.d | 24 +++++++++++++++++++ .../variables/bvar/tst.stackdepth-ip.r | 1 + .../variables/bvar/tst.stackdepth-ip.r.p | 1 + .../variables/bvar/tst.stackdepth-ip.t | 6 +++++ 9 files changed, 69 insertions(+) create mode 100755 test/unittest/variables/bvar/perlping.pl create mode 100644 test/unittest/variables/bvar/tst.caller-ip.d create mode 100644 test/unittest/variables/bvar/tst.caller-ip.r create mode 120000 test/unittest/variables/bvar/tst.caller-ip.r.p create mode 100755 test/unittest/variables/bvar/tst.caller-ip.t create mode 100644 test/unittest/variables/bvar/tst.stackdepth-ip.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-ip.r create mode 120000 test/unittest/variables/bvar/tst.stackdepth-ip.r.p create mode 100755 test/unittest/variables/bvar/tst.stackdepth-ip.t diff --git a/test/unittest/variables/bvar/perlping.pl b/test/unittest/variables/bvar/perlping.pl new file mode 100755 index 000000000..97c9b09e9 --- /dev/null +++ b/test/unittest/variables/bvar/perlping.pl @@ -0,0 +1,8 @@ +#!/usr/bin/perl -w +# Oracle Linux DTrace. +# Copyright (c) 2016, 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. +use Net::Ping; +my $p = Net::Ping->new(${ARGV[0]}, 5, 56); +$p->ping(${ARGV[1]}); diff --git a/test/unittest/variables/bvar/tst.caller-ip.d b/test/unittest/variables/bvar/tst.caller-ip.d new file mode 100644 index 000000000..83dbcec5e --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-ip.d @@ -0,0 +1,21 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +ip::: +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-ip.r b/test/unittest/variables/bvar/tst.caller-ip.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-ip.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-ip.r.p b/test/unittest/variables/bvar/tst.caller-ip.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-ip.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.caller-ip.t b/test/unittest/variables/bvar/tst.caller-ip.t new file mode 100755 index 000000000..836d283da --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-ip.t @@ -0,0 +1,6 @@ +#!/bin/sh + +testdir="$(dirname $_test)" +local=127.0.0.1 + +$testdir/perlping.pl icmp $local diff --git a/test/unittest/variables/bvar/tst.stackdepth-ip.d b/test/unittest/variables/bvar/tst.stackdepth-ip.d new file mode 100644 index 000000000..eef942b5b --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-ip.d @@ -0,0 +1,24 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +ip::: +/stackdepth > 0/ +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth-ip.r b/test/unittest/variables/bvar/tst.stackdepth-ip.r new file mode 100644 index 000000000..3bd29b8ed --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-ip.r @@ -0,0 +1 @@ +Stack depth OK diff --git a/test/unittest/variables/bvar/tst.stackdepth-ip.r.p b/test/unittest/variables/bvar/tst.stackdepth-ip.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-ip.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-ip.t b/test/unittest/variables/bvar/tst.stackdepth-ip.t new file mode 100755 index 000000000..836d283da --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-ip.t @@ -0,0 +1,6 @@ +#!/bin/sh + +testdir="$(dirname $_test)" +local=127.0.0.1 + +$testdir/perlping.pl icmp $local -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:13 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:13 -0400 Subject: [DTrace-devel] [PATCH 09/14] Test: caller and stackdepth tests for profile provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-9-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- test/unittest/builtinvar/tst.caller1.d | 29 ------------------- .../variables/bvar/tst.caller-profile.d | 22 ++++++++++++++ .../variables/bvar/tst.caller-profile.r | 1 + .../variables/bvar/tst.caller-profile.r.p | 1 + .../variables/bvar/tst.stackdepth-profile.d | 24 +++++++++++++++ .../variables/bvar/tst.stackdepth-profile.r | 1 + .../variables/bvar/tst.stackdepth-profile.r.p | 1 + 7 files changed, 50 insertions(+), 29 deletions(-) delete mode 100644 test/unittest/builtinvar/tst.caller1.d create mode 100644 test/unittest/variables/bvar/tst.caller-profile.d create mode 100644 test/unittest/variables/bvar/tst.caller-profile.r create mode 120000 test/unittest/variables/bvar/tst.caller-profile.r.p create mode 100644 test/unittest/variables/bvar/tst.stackdepth-profile.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-profile.r create mode 120000 test/unittest/variables/bvar/tst.stackdepth-profile.r.p diff --git a/test/unittest/builtinvar/tst.caller1.d b/test/unittest/builtinvar/tst.caller1.d deleted file mode 100644 index ca0f098f3..000000000 --- a/test/unittest/builtinvar/tst.caller1.d +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Oracle Linux DTrace. - * Copyright (c) 2006, 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. - */ - -/* - * ASSERTION: To print caller from profile and make sure it succeeds. - * - * SECTION: Variables/Built-in Variables - */ - -#pragma D option quiet - -BEGIN -{ -} - -tick-10ms -{ - printf("The caller is %u\n", caller); - exit (0); -} - -ERROR -{ - exit(1); -} diff --git a/test/unittest/variables/bvar/tst.caller-profile.d b/test/unittest/variables/bvar/tst.caller-profile.d new file mode 100644 index 000000000..6e322bb70 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-profile.d @@ -0,0 +1,22 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +profile:::tick-50ms +/stackdepth > 1/ +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-profile.r b/test/unittest/variables/bvar/tst.caller-profile.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-profile.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-profile.r.p b/test/unittest/variables/bvar/tst.caller-profile.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-profile.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-profile.d b/test/unittest/variables/bvar/tst.stackdepth-profile.d new file mode 100644 index 000000000..8b42e9016 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-profile.d @@ -0,0 +1,24 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +profile:::tick-50ms +/stackdepth > 1/ +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth-profile.r b/test/unittest/variables/bvar/tst.stackdepth-profile.r new file mode 100644 index 000000000..3bd29b8ed --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-profile.r @@ -0,0 +1 @@ +Stack depth OK diff --git a/test/unittest/variables/bvar/tst.stackdepth-profile.r.p b/test/unittest/variables/bvar/tst.stackdepth-profile.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-profile.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:05 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:05 -0400 Subject: [DTrace-devel] [PATCH 01/14] Fix stack-skip counts for caller and stackdepth Message-ID: <20250522180118.27343-1-eugene.loh@oracle.com> From: Eugene Loh Apparently, when we call the BPF get_stack() helper function, it generally knows how many frames to skip to get the real kernel stack. For fentry/fexit, however, this is apparently not the case, and commit bc65cb44d ("cg: allow providers to specify a skip count for stack retrieval") added the ability to skip frames for fentry/fexit probes. When this "skip" is needed, however, it must must be even deeper when we descend further frames, such as when we call dt_bpf_*() precompiled functions. Add this support for dt_bpf_caller() and dt_bpf_stackdepth(). That is, if there are stack-skip frames, skip yet one more frame when inside a bpf/get_bvar.c function. Note that we declare the skip count volatile. The compiler might optimize code that uses the STACK_SKIP value, but we will subsequently perform relocations that adjust this value. Signed-off-by: Eugene Loh --- bpf/get_bvar.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/bpf/get_bvar.c b/bpf/get_bvar.c index 9625e764e..99a6503d5 100644 --- a/bpf/get_bvar.c +++ b/bpf/get_bvar.c @@ -53,12 +53,17 @@ noinline uint64_t dt_bvar_args(const dt_dctx_t *dctx, uint32_t idx) noinline uint64_t dt_bvar_caller(const dt_dctx_t *dctx) { - uint64_t buf[2] = { 0, }; + uint64_t buf[3] = { 0, }; + volatile uint64_t + skip = (uint64_t)(&STACK_SKIP); if (bpf_get_stack(dctx->ctx, buf, sizeof(buf), - (uint64_t)(&STACK_SKIP) & BPF_F_SKIP_FIELD_MASK) < 0) + skip & BPF_F_SKIP_FIELD_MASK) < 0) return 0; + /* If we had to skip any frames, account for the dt_bvar_caller() frame. */ + if (skip) + return buf[2]; return buf[1]; } @@ -203,9 +208,11 @@ noinline uint64_t dt_bvar_stackdepth(const dt_dctx_t *dctx) uint32_t bufsiz = (uint32_t) (uint64_t) (&STKSIZ); char *buf = dctx->mem + (uint64_t)(&STACK_OFF); uint64_t retv; + volatile uint64_t + skip = (uint64_t)(&STACK_SKIP); retv = bpf_get_stack(dctx->ctx, buf, bufsiz, - (uint64_t)(&STACK_SKIP) & BPF_F_SKIP_FIELD_MASK); + skip & BPF_F_SKIP_FIELD_MASK); if (retv < 0) return error(dctx, DTRACEFLT_BADSTACK, 0 /* FIXME */); @@ -217,7 +224,11 @@ noinline uint64_t dt_bvar_stackdepth(const dt_dctx_t *dctx) * If retv==bufsiz, presumably the stack is larger than what we * can retrieve. But it's also possible that the buffer was exactly * large enough. So, leave it to the user to interpret the result. + * + * If we had to skip any frames, account for the dt_bvar_stackdepth() frame. */ + if (skip) + return retv / sizeof(uint64_t) - 1; return retv / sizeof(uint64_t); } -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:09 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:09 -0400 Subject: [DTrace-devel] [PATCH 05/14] Test: caller and stackdepth tests for dtrace provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-5-eugene.loh@oracle.com> From: Eugene Loh Also, a few old tests, which tested caller and stackdepth using the dtrace provider, are now superfluous given the new, provider-named tests. The old tests were extremely lenient -- e.g., simply checking that these built-in variables were not -1, even though both variables are unsigned anyhow! Signed-off-by: Eugene Loh --- test/unittest/builtinvar/tst.caller.d | 25 ------------------- .../variables/bvar/tst.caller-dtrace.d | 19 ++++++++++++++ .../variables/bvar/tst.caller-dtrace.r | 1 + test/unittest/variables/bvar/tst.caller.d | 23 ----------------- .../variables/bvar/tst.stackdepth-dtrace.d | 22 ++++++++++++++++ .../variables/bvar/tst.stackdepth-dtrace.r | 5 ++++ test/unittest/variables/bvar/tst.stackdepth.d | 23 ----------------- 7 files changed, 47 insertions(+), 71 deletions(-) delete mode 100644 test/unittest/builtinvar/tst.caller.d create mode 100644 test/unittest/variables/bvar/tst.caller-dtrace.d create mode 100644 test/unittest/variables/bvar/tst.caller-dtrace.r delete mode 100644 test/unittest/variables/bvar/tst.caller.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-dtrace.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-dtrace.r delete mode 100644 test/unittest/variables/bvar/tst.stackdepth.d diff --git a/test/unittest/builtinvar/tst.caller.d b/test/unittest/builtinvar/tst.caller.d deleted file mode 100644 index 19a4bab9e..000000000 --- a/test/unittest/builtinvar/tst.caller.d +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Oracle Linux DTrace. - * Copyright (c) 2006, 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. - */ - -/* - * ASSERTION: print 'caller' and make sure it succeeds. - * - * SECTION: Variables/Built-in Variables - */ - -#pragma D option quiet - -BEGIN -{ - printf("The caller is %u\n", caller); - exit(0); -} - -ERROR -{ - exit(1); -} diff --git a/test/unittest/variables/bvar/tst.caller-dtrace.d b/test/unittest/variables/bvar/tst.caller-dtrace.d new file mode 100644 index 000000000..d69386930 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-dtrace.d @@ -0,0 +1,19 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +BEGIN { + trace(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-dtrace.r b/test/unittest/variables/bvar/tst.caller-dtrace.r new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-dtrace.r @@ -0,0 +1 @@ +0 diff --git a/test/unittest/variables/bvar/tst.caller.d b/test/unittest/variables/bvar/tst.caller.d deleted file mode 100644 index 3d64fa98c..000000000 --- a/test/unittest/variables/bvar/tst.caller.d +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Oracle Linux DTrace. - * Copyright (c) 2020, 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. - */ - -/* - * ASSERTION: The 'caller' variable can be accessed and is not -1. - * - * SECTION: Variables/Built-in Variables/caller - */ - -#pragma D option quiet - -BEGIN { - trace(caller); - exit(caller != -1 ? 0 : 1); -} - -ERROR { - exit(1); -} diff --git a/test/unittest/variables/bvar/tst.stackdepth-dtrace.d b/test/unittest/variables/bvar/tst.stackdepth-dtrace.d new file mode 100644 index 000000000..f0f828f23 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-dtrace.d @@ -0,0 +1,22 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +BEGIN { + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth-dtrace.r b/test/unittest/variables/bvar/tst.stackdepth-dtrace.r new file mode 100644 index 000000000..1afb1f057 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-dtrace.r @@ -0,0 +1,5 @@ +DEPTH 0 +TRACE BEGIN + +TRACE END + diff --git a/test/unittest/variables/bvar/tst.stackdepth.d b/test/unittest/variables/bvar/tst.stackdepth.d deleted file mode 100644 index ad728fd85..000000000 --- a/test/unittest/variables/bvar/tst.stackdepth.d +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Oracle Linux DTrace. - * Copyright (c) 2020, 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. - */ - -/* - * ASSERTION: The 'stackdepth' variable can be accessed and is not -1. - * - * SECTION: Variables/Built-in Variables/stackdepth - */ - -#pragma D option quiet - -BEGIN { - trace(stackdepth); - exit(stackdepth != -1 ? 0 : 1); -} - -ERROR { - exit(1); -} -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:14 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:14 -0400 Subject: [DTrace-devel] [PATCH 10/14] Test: caller and stackdepth tests for sched provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-10-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- .../variables/bvar/tst.caller-sched.d | 31 +++++++++++++++++ .../variables/bvar/tst.caller-sched.r | 1 + .../variables/bvar/tst.caller-sched.r.p | 1 + .../variables/bvar/tst.stackdepth-sched.d | 33 +++++++++++++++++++ .../variables/bvar/tst.stackdepth-sched.r | 1 + .../variables/bvar/tst.stackdepth-sched.r.p | 1 + 6 files changed, 68 insertions(+) create mode 100644 test/unittest/variables/bvar/tst.caller-sched.d create mode 100644 test/unittest/variables/bvar/tst.caller-sched.r create mode 120000 test/unittest/variables/bvar/tst.caller-sched.r.p create mode 100644 test/unittest/variables/bvar/tst.stackdepth-sched.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-sched.r create mode 120000 test/unittest/variables/bvar/tst.stackdepth-sched.r.p diff --git a/test/unittest/variables/bvar/tst.caller-sched.d b/test/unittest/variables/bvar/tst.caller-sched.d new file mode 100644 index 000000000..087571531 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-sched.d @@ -0,0 +1,31 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + + +/* + * Some probes are implemented in terms of rawtp probes. Avoid them + * due to stack-skip issues on older kernels. + */ +sched:::dequeue, +sched:::enqueue, +sched:::tick +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-sched.r b/test/unittest/variables/bvar/tst.caller-sched.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-sched.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-sched.r.p b/test/unittest/variables/bvar/tst.caller-sched.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-sched.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-sched.d b/test/unittest/variables/bvar/tst.stackdepth-sched.d new file mode 100644 index 000000000..d3e9e18d5 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-sched.d @@ -0,0 +1,33 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + + +/* + * Some probes are implemented in terms of rawtp probes. Avoid them + * due to stack-skip issues on older kernels. + */ +sched:::dequeue, +sched:::enqueue, +sched:::tick +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth-sched.r b/test/unittest/variables/bvar/tst.stackdepth-sched.r new file mode 100644 index 000000000..3bd29b8ed --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-sched.r @@ -0,0 +1 @@ +Stack depth OK diff --git a/test/unittest/variables/bvar/tst.stackdepth-sched.r.p b/test/unittest/variables/bvar/tst.stackdepth-sched.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-sched.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:10 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:10 -0400 Subject: [DTrace-devel] [PATCH 06/14] Test: caller and stackdepth tests for rawtp provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-6-eugene.loh@oracle.com> From: Eugene Loh Also, add skip_rawtp_old.x, to skip rawtp testing on older kernels for the reasons described in the file. Signed-off-by: Eugene Loh --- test/unittest/variables/bvar/skip_rawtp_old.x | 31 +++++++++++++++++++ .../variables/bvar/tst.caller-rawtp.d | 24 ++++++++++++++ .../variables/bvar/tst.caller-rawtp.r | 1 + .../variables/bvar/tst.caller-rawtp.r.p | 1 + .../variables/bvar/tst.caller-rawtp.x | 1 + .../variables/bvar/tst.stackdepth-rawtp.d | 26 ++++++++++++++++ .../variables/bvar/tst.stackdepth-rawtp.r | 1 + .../variables/bvar/tst.stackdepth-rawtp.r.p | 1 + .../variables/bvar/tst.stackdepth-rawtp.x | 1 + 9 files changed, 87 insertions(+) create mode 100755 test/unittest/variables/bvar/skip_rawtp_old.x create mode 100644 test/unittest/variables/bvar/tst.caller-rawtp.d create mode 100644 test/unittest/variables/bvar/tst.caller-rawtp.r create mode 120000 test/unittest/variables/bvar/tst.caller-rawtp.r.p create mode 120000 test/unittest/variables/bvar/tst.caller-rawtp.x create mode 100644 test/unittest/variables/bvar/tst.stackdepth-rawtp.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-rawtp.r create mode 120000 test/unittest/variables/bvar/tst.stackdepth-rawtp.r.p create mode 120000 test/unittest/variables/bvar/tst.stackdepth-rawtp.x diff --git a/test/unittest/variables/bvar/skip_rawtp_old.x b/test/unittest/variables/bvar/skip_rawtp_old.x new file mode 100755 index 000000000..bf7970832 --- /dev/null +++ b/test/unittest/variables/bvar/skip_rawtp_old.x @@ -0,0 +1,31 @@ +#!/bin/bash + +# +# In older kernels (e.g., UEK6), the BPF helper function had a bug with +# skipping stack frames. While that many stack frames were correctly +# skipped on the leaf end of the stack, that many frames were also +# incorrectly skipped at the root end of the output buffer. +# +# Only two DTrace providers ask for a nonzero skip count. One is the +# fentry/fexit implementation of fbt, but it was not used on such older +# kernels. +# +# The other is rawtp. Therefore, rawtp stack(), caller, and stackdepth +# results on such older kernels can be incorrect. +# +# A few other providers also have some or most probes implemented in +# terms of rawtp probes. They could have similar problems, depending +# on which probes are used. +# + +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 10 ]; then + exit 0 +fi + +echo "rawtp caller, stack(), and stackdepth problematic in old kernels" +exit 2 diff --git a/test/unittest/variables/bvar/tst.caller-rawtp.d b/test/unittest/variables/bvar/tst.caller-rawtp.d new file mode 100644 index 000000000..9f8475071 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-rawtp.d @@ -0,0 +1,24 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + +rawtp:sched:: +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-rawtp.r b/test/unittest/variables/bvar/tst.caller-rawtp.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-rawtp.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-rawtp.r.p b/test/unittest/variables/bvar/tst.caller-rawtp.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-rawtp.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.caller-rawtp.x b/test/unittest/variables/bvar/tst.caller-rawtp.x new file mode 120000 index 000000000..37b3ef9f8 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-rawtp.x @@ -0,0 +1 @@ +skip_rawtp_old.x \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-rawtp.d b/test/unittest/variables/bvar/tst.stackdepth-rawtp.d new file mode 100644 index 000000000..ddcc0a13f --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-rawtp.d @@ -0,0 +1,26 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + +rawtp:sched:: +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth-rawtp.r b/test/unittest/variables/bvar/tst.stackdepth-rawtp.r new file mode 100644 index 000000000..3bd29b8ed --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-rawtp.r @@ -0,0 +1 @@ +Stack depth OK diff --git a/test/unittest/variables/bvar/tst.stackdepth-rawtp.r.p b/test/unittest/variables/bvar/tst.stackdepth-rawtp.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-rawtp.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-rawtp.x b/test/unittest/variables/bvar/tst.stackdepth-rawtp.x new file mode 120000 index 000000000..37b3ef9f8 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-rawtp.x @@ -0,0 +1 @@ +skip_rawtp_old.x \ No newline at end of file -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:17 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:17 -0400 Subject: [DTrace-devel] [PATCH 13/14] Test: caller and stackdepth tests for io provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-13-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- test/unittest/variables/bvar/tst.caller-io.r | 1 + .../unittest/variables/bvar/tst.caller-io.r.p | 1 + test/unittest/variables/bvar/tst.caller-io.sh | 37 ++++++++++++++++++ test/unittest/variables/bvar/tst.caller-io.x | 1 + .../variables/bvar/tst.stackdepth-io.r | 1 + .../variables/bvar/tst.stackdepth-io.r.p | 1 + .../variables/bvar/tst.stackdepth-io.sh | 39 +++++++++++++++++++ .../variables/bvar/tst.stackdepth-io.x | 1 + 8 files changed, 82 insertions(+) create mode 100644 test/unittest/variables/bvar/tst.caller-io.r create mode 120000 test/unittest/variables/bvar/tst.caller-io.r.p create mode 100755 test/unittest/variables/bvar/tst.caller-io.sh create mode 120000 test/unittest/variables/bvar/tst.caller-io.x create mode 100644 test/unittest/variables/bvar/tst.stackdepth-io.r create mode 120000 test/unittest/variables/bvar/tst.stackdepth-io.r.p create mode 100755 test/unittest/variables/bvar/tst.stackdepth-io.sh create mode 120000 test/unittest/variables/bvar/tst.stackdepth-io.x diff --git a/test/unittest/variables/bvar/tst.caller-io.r b/test/unittest/variables/bvar/tst.caller-io.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-io.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-io.r.p b/test/unittest/variables/bvar/tst.caller-io.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-io.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.caller-io.sh b/test/unittest/variables/bvar/tst.caller-io.sh new file mode 100755 index 000000000..876ea70e3 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-io.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Oracle Linux DTrace. +# Copyright (c) 2025, 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 +nblocks=1024 +filesize=$((1024*$nblocks)) +fsoptions="defaults,atime,diratime,nosuid,nodev" +iodir=$tmpdir/tst-caller-io.$$ +tempfile=`mktemp -u -p $iodir` + +trap "umount $iodir; rmdir $iodir; rm -f $iodir.img" QUIT EXIT + +# create loopback file system +dd if=/dev/zero of=$iodir.img bs=1024 count=$((300*$nblocks)) status=none +mkfs.xfs $iodir.img > /dev/null +mkdir $iodir +test/triggers/io-mount-local.sh $iodir xfs $fsoptions + +$dtrace $dt_flags -c "test/triggers/doio.sh $tempfile $filesize test/triggers/io-mount-local.sh $iodir xfs $fsoptions" -qn ' +io::: +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +}' + +exit $? diff --git a/test/unittest/variables/bvar/tst.caller-io.x b/test/unittest/variables/bvar/tst.caller-io.x new file mode 120000 index 000000000..37b3ef9f8 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-io.x @@ -0,0 +1 @@ +skip_rawtp_old.x \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-io.r b/test/unittest/variables/bvar/tst.stackdepth-io.r new file mode 100644 index 000000000..3bd29b8ed --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-io.r @@ -0,0 +1 @@ +Stack depth OK diff --git a/test/unittest/variables/bvar/tst.stackdepth-io.r.p b/test/unittest/variables/bvar/tst.stackdepth-io.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-io.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-io.sh b/test/unittest/variables/bvar/tst.stackdepth-io.sh new file mode 100755 index 000000000..3bbf38a47 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-io.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# Oracle Linux DTrace. +# Copyright (c) 2025, 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 +nblocks=1024 +filesize=$((1024*$nblocks)) +fsoptions="defaults,atime,diratime,nosuid,nodev" +iodir=$tmpdir/tst-stackdepth-io.$$ +tempfile=`mktemp -u -p $iodir` + +trap "umount $iodir; rmdir $iodir; rm -f $iodir.img" QUIT EXIT + +# create loopback file system +dd if=/dev/zero of=$iodir.img bs=1024 count=$((300*$nblocks)) status=none +mkfs.xfs $iodir.img > /dev/null +mkdir $iodir +test/triggers/io-mount-local.sh $iodir xfs $fsoptions + +$dtrace $dt_flags -c "test/triggers/doio.sh $tempfile $filesize test/triggers/io-mount-local.sh $iodir xfs $fsoptions" -qn ' +io::: +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +}' + +exit $? diff --git a/test/unittest/variables/bvar/tst.stackdepth-io.x b/test/unittest/variables/bvar/tst.stackdepth-io.x new file mode 120000 index 000000000..37b3ef9f8 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-io.x @@ -0,0 +1 @@ +skip_rawtp_old.x \ No newline at end of file -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:16 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:16 -0400 Subject: [DTrace-devel] [PATCH 12/14] Test: caller and stackdepth tests for rawfbt provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-12-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- .../variables/bvar/tst.caller-rawfbt.d | 25 +++++++++++++++++ .../variables/bvar/tst.caller-rawfbt.r | 1 + .../variables/bvar/tst.caller-rawfbt.r.p | 1 + .../variables/bvar/tst.stackdepth-rawfbt.d | 27 +++++++++++++++++++ .../variables/bvar/tst.stackdepth-rawfbt.r | 1 + .../variables/bvar/tst.stackdepth-rawfbt.r.p | 1 + 6 files changed, 56 insertions(+) create mode 100644 test/unittest/variables/bvar/tst.caller-rawfbt.d create mode 100644 test/unittest/variables/bvar/tst.caller-rawfbt.r create mode 120000 test/unittest/variables/bvar/tst.caller-rawfbt.r.p create mode 100644 test/unittest/variables/bvar/tst.stackdepth-rawfbt.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-rawfbt.r create mode 120000 test/unittest/variables/bvar/tst.stackdepth-rawfbt.r.p diff --git a/test/unittest/variables/bvar/tst.caller-rawfbt.d b/test/unittest/variables/bvar/tst.caller-rawfbt.d new file mode 100644 index 000000000..08ab3eba1 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-rawfbt.d @@ -0,0 +1,25 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + +rawfbt::ksys_write:entry +/pid == $target/ +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-rawfbt.r b/test/unittest/variables/bvar/tst.caller-rawfbt.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-rawfbt.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-rawfbt.r.p b/test/unittest/variables/bvar/tst.caller-rawfbt.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-rawfbt.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-rawfbt.d b/test/unittest/variables/bvar/tst.stackdepth-rawfbt.d new file mode 100644 index 000000000..15a9991cb --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-rawfbt.d @@ -0,0 +1,27 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + +rawfbt::ksys_write:entry +/pid == $target/ +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth-rawfbt.r b/test/unittest/variables/bvar/tst.stackdepth-rawfbt.r new file mode 100644 index 000000000..3bd29b8ed --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-rawfbt.r @@ -0,0 +1 @@ +Stack depth OK diff --git a/test/unittest/variables/bvar/tst.stackdepth-rawfbt.r.p b/test/unittest/variables/bvar/tst.stackdepth-rawfbt.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-rawfbt.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:15 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:15 -0400 Subject: [DTrace-devel] [PATCH 11/14] Test: caller and stackdepth tests for proc provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-11-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- .../unittest/variables/bvar/tst.caller-proc.d | 34 ++++++++++++++++++ .../unittest/variables/bvar/tst.caller-proc.r | 1 + .../variables/bvar/tst.caller-proc.r.p | 1 + .../variables/bvar/tst.stackdepth-proc.d | 36 +++++++++++++++++++ .../variables/bvar/tst.stackdepth-proc.r | 1 + .../variables/bvar/tst.stackdepth-proc.r.p | 1 + 6 files changed, 74 insertions(+) create mode 100644 test/unittest/variables/bvar/tst.caller-proc.d create mode 100644 test/unittest/variables/bvar/tst.caller-proc.r create mode 120000 test/unittest/variables/bvar/tst.caller-proc.r.p create mode 100644 test/unittest/variables/bvar/tst.stackdepth-proc.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-proc.r create mode 120000 test/unittest/variables/bvar/tst.stackdepth-proc.r.p diff --git a/test/unittest/variables/bvar/tst.caller-proc.d b/test/unittest/variables/bvar/tst.caller-proc.d new file mode 100644 index 000000000..7c3557e2c --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-proc.d @@ -0,0 +1,34 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + +/* + * Some probes are implemented in terms of rawtp probes. Avoid them + * due to stack-skip issues on older kernels. + */ +proc:::exec, +proc:::exec-failure, +proc:::exec-success, +proc:::lwp-start, +proc:::signal-clear, +proc:::signal-send, +proc:::start +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-proc.r b/test/unittest/variables/bvar/tst.caller-proc.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-proc.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-proc.r.p b/test/unittest/variables/bvar/tst.caller-proc.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-proc.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-proc.d b/test/unittest/variables/bvar/tst.stackdepth-proc.d new file mode 100644 index 000000000..75f720370 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-proc.d @@ -0,0 +1,36 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ +/* + * @@trigger: periodic_output + */ + +#pragma D option quiet + +/* + * Some probes are implemented in terms of rawtp probes. Avoid them + * due to stack-skip issues on older kernels. + */ +proc:::exec, +proc:::exec-failure, +proc:::exec-success, +proc:::lwp-start, +proc:::signal-clear, +proc:::signal-send, +proc:::start +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth-proc.r b/test/unittest/variables/bvar/tst.stackdepth-proc.r new file mode 100644 index 000000000..3bd29b8ed --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-proc.r @@ -0,0 +1 @@ +Stack depth OK diff --git a/test/unittest/variables/bvar/tst.stackdepth-proc.r.p b/test/unittest/variables/bvar/tst.stackdepth-proc.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-proc.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:01:18 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:01:18 -0400 Subject: [DTrace-devel] [PATCH 14/14] Test: caller and stackdepth tests for lockstat provider In-Reply-To: <20250522180118.27343-1-eugene.loh@oracle.com> References: <20250522180118.27343-1-eugene.loh@oracle.com> Message-ID: <20250522180118.27343-14-eugene.loh@oracle.com> From: Eugene Loh Signed-off-by: Eugene Loh --- .../variables/bvar/skip_lockstat_5.10.x | 13 ++++++++++ .../variables/bvar/tst.caller-lockstat.d | 22 +++++++++++++++++ .../variables/bvar/tst.caller-lockstat.r | 1 + .../variables/bvar/tst.caller-lockstat.r.p | 1 + .../variables/bvar/tst.caller-lockstat.t | 3 +++ .../variables/bvar/tst.caller-lockstat.x | 1 + .../variables/bvar/tst.stackdepth-lockstat.d | 24 +++++++++++++++++++ .../variables/bvar/tst.stackdepth-lockstat.r | 1 + .../bvar/tst.stackdepth-lockstat.r.p | 1 + .../variables/bvar/tst.stackdepth-lockstat.t | 3 +++ .../variables/bvar/tst.stackdepth-lockstat.x | 1 + 11 files changed, 71 insertions(+) create mode 100755 test/unittest/variables/bvar/skip_lockstat_5.10.x create mode 100644 test/unittest/variables/bvar/tst.caller-lockstat.d create mode 100644 test/unittest/variables/bvar/tst.caller-lockstat.r create mode 120000 test/unittest/variables/bvar/tst.caller-lockstat.r.p create mode 100755 test/unittest/variables/bvar/tst.caller-lockstat.t create mode 120000 test/unittest/variables/bvar/tst.caller-lockstat.x create mode 100644 test/unittest/variables/bvar/tst.stackdepth-lockstat.d create mode 100644 test/unittest/variables/bvar/tst.stackdepth-lockstat.r create mode 120000 test/unittest/variables/bvar/tst.stackdepth-lockstat.r.p create mode 100755 test/unittest/variables/bvar/tst.stackdepth-lockstat.t create mode 120000 test/unittest/variables/bvar/tst.stackdepth-lockstat.x diff --git a/test/unittest/variables/bvar/skip_lockstat_5.10.x b/test/unittest/variables/bvar/skip_lockstat_5.10.x new file mode 100755 index 000000000..146443fd2 --- /dev/null +++ b/test/unittest/variables/bvar/skip_lockstat_5.10.x @@ -0,0 +1,13 @@ +#!/bin/bash + +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 10 ]; then + exit 0 +fi + +echo "lockstat disabled prior to 5.10" +exit 1 diff --git a/test/unittest/variables/bvar/tst.caller-lockstat.d b/test/unittest/variables/bvar/tst.caller-lockstat.d new file mode 100644 index 000000000..95eb08578 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-lockstat.d @@ -0,0 +1,22 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +lockstat:::*acquire +/pid == $target/ +{ + stack(2); + sym(caller); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.caller-lockstat.r b/test/unittest/variables/bvar/tst.caller-lockstat.r new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-lockstat.r @@ -0,0 +1 @@ +success diff --git a/test/unittest/variables/bvar/tst.caller-lockstat.r.p b/test/unittest/variables/bvar/tst.caller-lockstat.r.p new file mode 120000 index 000000000..954ca96aa --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-lockstat.r.p @@ -0,0 +1 @@ +check_caller_to_stack2.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.caller-lockstat.t b/test/unittest/variables/bvar/tst.caller-lockstat.t new file mode 100755 index 000000000..fec0d2715 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-lockstat.t @@ -0,0 +1,3 @@ +#!/bin/sh + +sleep 10s diff --git a/test/unittest/variables/bvar/tst.caller-lockstat.x b/test/unittest/variables/bvar/tst.caller-lockstat.x new file mode 120000 index 000000000..539f14255 --- /dev/null +++ b/test/unittest/variables/bvar/tst.caller-lockstat.x @@ -0,0 +1 @@ +skip_lockstat_5.10.x \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-lockstat.d b/test/unittest/variables/bvar/tst.stackdepth-lockstat.d new file mode 100644 index 000000000..46f937067 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-lockstat.d @@ -0,0 +1,24 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2025, 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. + */ + +#pragma D option quiet + +lockstat:::*acquire +/pid == $target/ +{ + printf("DEPTH %d\n", stackdepth); + printf("TRACE BEGIN\n"); + stack(100); + printf("TRACE END\n"); + exit(0); +} + +ERROR +{ + printf("error encountered\n"); + exit(1); +} diff --git a/test/unittest/variables/bvar/tst.stackdepth-lockstat.r b/test/unittest/variables/bvar/tst.stackdepth-lockstat.r new file mode 100644 index 000000000..3bd29b8ed --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-lockstat.r @@ -0,0 +1 @@ +Stack depth OK diff --git a/test/unittest/variables/bvar/tst.stackdepth-lockstat.r.p b/test/unittest/variables/bvar/tst.stackdepth-lockstat.r.p new file mode 120000 index 000000000..e50f12822 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-lockstat.r.p @@ -0,0 +1 @@ +check_stackdepth_to_stack.awk \ No newline at end of file diff --git a/test/unittest/variables/bvar/tst.stackdepth-lockstat.t b/test/unittest/variables/bvar/tst.stackdepth-lockstat.t new file mode 100755 index 000000000..fec0d2715 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-lockstat.t @@ -0,0 +1,3 @@ +#!/bin/sh + +sleep 10s diff --git a/test/unittest/variables/bvar/tst.stackdepth-lockstat.x b/test/unittest/variables/bvar/tst.stackdepth-lockstat.x new file mode 120000 index 000000000..539f14255 --- /dev/null +++ b/test/unittest/variables/bvar/tst.stackdepth-lockstat.x @@ -0,0 +1 @@ +skip_lockstat_5.10.x \ No newline at end of file -- 2.43.5 From eugene.loh at oracle.com Thu May 22 18:10:16 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Thu, 22 May 2025 14:10:16 -0400 Subject: [DTrace-devel] [PATCH] Revert "dt_pid: pid grabs should be shortlived" Message-ID: <20250522181016.27661-1-eugene.loh@oracle.com> From: Eugene Loh Commit 4aec5c9931eb ("dt_pid: pid grabs should be shortlived") made grabs short-lived. No test cases show the utility of this patch. Meanwhile, the patch causes roughly a dozen tests to fail on OL9 when the test suite is started remotely using ssh, closing ttys. The problem is that DTrace tries to determine if a process is a "system daemon." There is no robust way of doing so. In particular, the test suite starts trigger processes as root and in many cases closes all file descriptors, making such processes hard to distinguish from system daemons. As long as the patch causes so many test regressions -- and in the absence of any demonstration of any benefit -- revert this patch. Signed-off-by: Eugene Loh --- libdtrace/dt_pid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libdtrace/dt_pid.c b/libdtrace/dt_pid.c index 9abbd474c..e2d4e540d 100644 --- a/libdtrace/dt_pid.c +++ b/libdtrace/dt_pid.c @@ -1257,8 +1257,7 @@ dt_pid_create_pid_probes(dtrace_probedesc_t *pdp, dtrace_hdl_t *dtp, dt_pcb_t *p return 0; /* Grab the process. */ - if (dt_proc_grab_lock(dtp, pid, DTRACE_PROC_WAITING | - DTRACE_PROC_SHORTLIVED) < 0) { + if (dt_proc_grab_lock(dtp, pid, DTRACE_PROC_WAITING) < 0) { dt_pid_error(dtp, pcb, NULL, D_PROC_GRAB, "failed to grab process %d", (int)pid); return -1; -- 2.43.5 From eugene.loh at oracle.com Tue May 27 05:43:12 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Tue, 27 May 2025 01:43:12 -0400 Subject: [DTrace-devel] [PATCH 1/2] Omit an aggregation record if [u][sym|mod] translation fails Message-ID: <20250527054313.4849-1-eugene.loh@oracle.com> From: Eugene Loh An aggregation key can be a sym(), mod(), usym(), or umod() translation of an address. It is passed from producer to user space as an address, and the consumer must translate the address. It is possible for the translation to fail. Omit a record if the translation fails. This addresses failures seen in test/unittest/profile-n/tst.ufunc.sh test/unittest/profile-n/tst.usym.sh The problem was that the kernel's aggregation buffers are snapshot multiple times. If a translation ever fails, the raw address is used instead. Later on, when the aggregation is printed, if the translation is successful, the raw key will report a count of 0. Signed-off-by: Eugene Loh --- libdtrace/dt_aggregate.c | 51 ++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/libdtrace/dt_aggregate.c b/libdtrace/dt_aggregate.c index 86f9d4d5b..40c1ae44f 100644 --- a/libdtrace/dt_aggregate.c +++ b/libdtrace/dt_aggregate.c @@ -317,61 +317,76 @@ dt_aggregate_quantizedcmp(int64_t *lhs, int64_t *rhs) return 0; } -static void +static int dt_aggregate_usym(dtrace_hdl_t *dtp, uint64_t *data) { uint64_t tgid = data[0]; uint64_t *pc = &data[1]; pid_t pid; GElf_Sym sym; + int rc = 0; if (dtp->dt_vector != NULL) - return; + return -1; pid = dt_proc_grab_lock(dtp, tgid, DTRACE_PROC_WAITING | DTRACE_PROC_SHORTLIVED); if (pid < 0) - return; + return -1; if (dt_Plookup_by_addr(dtp, pid, *pc, NULL, &sym) == 0) *pc = sym.st_value; + else + rc = -1; dt_proc_release_unlock(dtp, pid); + + return rc; } -static void +static int dt_aggregate_umod(dtrace_hdl_t *dtp, uint64_t *data) { uint64_t tgid = data[0]; uint64_t *pc = &data[1]; pid_t pid; const prmap_t *map; + int rc = 0; if (dtp->dt_vector != NULL) - return; + return -1; pid = dt_proc_grab_lock(dtp, tgid, DTRACE_PROC_WAITING | DTRACE_PROC_SHORTLIVED); if (pid < 0) - return; + return -1; if ((map = dt_Paddr_to_map(dtp, pid, *pc)) != NULL) *pc = map->pr_vaddr; + else + rc = -1; dt_proc_release_unlock(dtp, pid); + + return rc; } -static void +static int dt_aggregate_sym(dtrace_hdl_t *dtp, uint64_t *data) { GElf_Sym sym; uint64_t *pc = data; + int rc = 0; if (dtrace_lookup_by_addr(dtp, *pc, &sym, NULL) == 0) *pc = sym.st_value; + else + rc = -1; + + return rc; } -static void +static int dt_aggregate_mod(dtrace_hdl_t *dtp, uint64_t *addr) { dt_module_t *dmp; @@ -385,7 +400,7 @@ dt_aggregate_mod(dtrace_hdl_t *dtp, uint64_t *addr) * appear more than once in aggregation output). It seems * unlikely that anyone will ever notice or care... */ - return; + return -1; } for (dmp = dt_list_next(&dtp->dt_modlist); dmp != NULL; @@ -400,7 +415,7 @@ dt_aggregate_mod(dtrace_hdl_t *dtp, uint64_t *addr) dtrace_addr_range_cmp) != NULL) { *addr = dmp->dm_text_addrs[0].dar_va; - return; + return 0; } if (dmp->dm_data_addrs != NULL && @@ -413,9 +428,11 @@ dt_aggregate_mod(dtrace_hdl_t *dtp, uint64_t *addr) else *addr = dmp->dm_data_addrs[0].dar_va; - return; + return 0; } } + + return -1; } static dtrace_aggid_t @@ -606,16 +623,20 @@ dt_aggregate_snap_one(dtrace_hdl_t *dtp, int aggid, int cpu, const char *key, switch(agg->dtagd_krecs[i].dtrd_action) { case DTRACEACT_USYM: - dt_aggregate_usym(dtp, p); + if (dt_aggregate_usym(dtp, p) == -1) + return 0; break; case DTRACEACT_UMOD: - dt_aggregate_umod(dtp, p); + if (dt_aggregate_umod(dtp, p) == -1) + return 0; break; case DTRACEACT_SYM: - dt_aggregate_sym(dtp, p); + if (dt_aggregate_sym(dtp, p) == -1) + return 0; break; case DTRACEACT_MOD: - dt_aggregate_mod(dtp, p); + if (dt_aggregate_mod(dtp, p) == -1) + return 0; break; default: break; -- 2.43.5 From eugene.loh at oracle.com Tue May 27 05:43:13 2025 From: eugene.loh at oracle.com (eugene.loh at oracle.com) Date: Tue, 27 May 2025 01:43:13 -0400 Subject: [DTrace-devel] [PATCH 2/2] Snapshot aggregations just in time In-Reply-To: <20250527054313.4849-1-eugene.loh@oracle.com> References: <20250527054313.4849-1-eugene.loh@oracle.com> Message-ID: <20250527054313.4849-2-eugene.loh@oracle.com> From: Eugene Loh Currently, dtrace periodically calls dtrace_work(), which in turn calls dtrace_consume(), which among other things calls dtrace_aggregate_snap(). But aggregations are kept in entirety in the kernel's BPF maps. There is no need to snapshot the aggregations into user space unless we're actually going to do something with aggregations. Snapshot aggregations just in time -- that is, if there is a clear(), trunc(), or printa() or if aggregations are to be printed at the end of a dtrace session. Skip the aggrate-slow test. Just-in-time snapshots mean the semantics of aggrate have changed. A fast aggrate means nothing. A slow aggrate means we are supposed to use stale aggregation data, which would be baffling. A future patch is advised to deprecate aggrate entirely. Signed-off-by: Eugene Loh --- libdtrace/dt_aggregate.c | 7 +++++++ libdtrace/dt_consume.c | 9 +++++++-- libdtrace/dt_impl.h | 1 + test/unittest/options/tst.aggrate-slow.d | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libdtrace/dt_aggregate.c b/libdtrace/dt_aggregate.c index 40c1ae44f..6c1b642ff 100644 --- a/libdtrace/dt_aggregate.c +++ b/libdtrace/dt_aggregate.c @@ -817,6 +817,10 @@ dtrace_aggregate_snap(dtrace_hdl_t *dtp) dtp->dt_lastagg = now; } + if (dtp->dt_haveagg) + return DTRACE_WORKSTATUS_OKAY; + dtp->dt_haveagg = 1; + dtrace_aggregate_clear(dtp); for (i = 0; i < dtp->dt_conf.num_online_cpus; i++) { @@ -1901,6 +1905,9 @@ dtrace_aggregate_print(dtrace_hdl_t *dtp, FILE *fp, { dtrace_print_aggdata_t pd; + dtp->dt_haveagg = 0; + dtrace_aggregate_snap(dtp); + if (dtp->dt_maxaggdsize == 0) return 0; diff --git a/libdtrace/dt_consume.c b/libdtrace/dt_consume.c index 8f50ebefc..a91413672 100644 --- a/libdtrace/dt_consume.c +++ b/libdtrace/dt_consume.c @@ -2353,11 +2353,15 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, i++; continue; case DT_ACT_CLEAR: + if (dtrace_aggregate_snap(dtp) == DTRACE_WORKSTATUS_ERROR) + return DTRACE_WORKSTATUS_ERROR; if (dt_clear(dtp, data, rec) != 0) return DTRACE_WORKSTATUS_ERROR; continue; case DT_ACT_TRUNC: + if (dtrace_aggregate_snap(dtp) == DTRACE_WORKSTATUS_ERROR) + return DTRACE_WORKSTATUS_ERROR; if (i == epd->dtdd_nrecs - 1) return dt_set_errno(dtp, EDT_BADTRUNC); @@ -2519,6 +2523,8 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, func = dtrace_fprintf; break; case DTRACEACT_PRINTA: + if (dtrace_aggregate_snap(dtp) == DTRACE_WORKSTATUS_ERROR) + return DTRACE_WORKSTATUS_ERROR; if (rec->dtrd_format != NULL) func = dtrace_fprinta; else @@ -3113,8 +3119,7 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, dtrace_consume_probe_f *pf, } } - if (dtrace_aggregate_snap(dtp) == DTRACE_WORKSTATUS_ERROR) - return DTRACE_WORKSTATUS_ERROR; + dtp->dt_haveagg = 0; /* * If dtp->dt_beganon is not -1, we did not process the BEGIN probe diff --git a/libdtrace/dt_impl.h b/libdtrace/dt_impl.h index 1033154d9..2c376f59a 100644 --- a/libdtrace/dt_impl.h +++ b/libdtrace/dt_impl.h @@ -405,6 +405,7 @@ struct dtrace_hdl { dt_percpu_drops_t *dt_drops; /* per-CPU drop counters cache */ uint64_t dt_specdrops; /* consumer-side spec drops counter */ int dt_statusgen; /* current status generation */ + int dt_haveagg; /* FIXME: figure out a good name for this */ hrtime_t dt_laststatus; /* last status */ hrtime_t dt_lastswitch; /* last switch of buffer data */ hrtime_t dt_lastagg; /* last snapshot of aggregation data */ diff --git a/test/unittest/options/tst.aggrate-slow.d b/test/unittest/options/tst.aggrate-slow.d index e2a0f2cb2..cd91c0a6c 100644 --- a/test/unittest/options/tst.aggrate-slow.d +++ b/test/unittest/options/tst.aggrate-slow.d @@ -9,6 +9,7 @@ * When the aggrate is slower than the switchrate and the pace of printa() * actions, multiple printa() should all reflect the same stale count. */ +/* @@skip: aggrate makes no sense */ /* @@trigger: periodic_output */ /* @@nosort */ -- 2.43.5 From noreply at github.com Thu May 29 17:45:25 2025 From: noreply at github.com (Kris Van Hees) Date: Thu, 29 May 2025 10:45:25 -0700 Subject: [DTrace-devel] [oracle/dtrace-utils] 2dbaeb: provider: fix registering fbt and rawfbt twice Message-ID: Branch: refs/heads/kvh/usdt-dev Home: https://github.com/oracle/dtrace-utils Commit: 2dbaebf8d4bbbc289cd0ddb3cfc930f5d3bfc1ed https://github.com/oracle/dtrace-utils/commit/2dbaebf8d4bbbc289cd0ddb3cfc930f5d3bfc1ed Author: Kris Van Hees Date: 2025-05-01 (Thu, 01 May 2025) Changed paths: M libdtrace/dt_provider.c Log Message: ----------- provider: fix registering fbt and rawfbt twice Now that rawfbt has been integrated into the fbt provider, it no longer needs to be in the list of providers to call populate() in. Signed-off-by: Kris Van Hees Commit: 581f34ac3857359cd844b042458b99754b4e1735 https://github.com/oracle/dtrace-utils/commit/581f34ac3857359cd844b042458b99754b4e1735 Author: Kris Van Hees Date: 2025-05-01 (Thu, 01 May 2025) Changed paths: M libdtrace/dt_provider.c Log Message: ----------- providers: loop through all providers for discovery The discovery of probes was tied to the static list of providers that are called on init. It should iterate over all providers that are in fact registered, i.e. the dt_provs hash. Signed-off-by: Kris Van Hees Commit: da6659d1e2216817b11d00aad656011ccea73df5 https://github.com/oracle/dtrace-utils/commit/da6659d1e2216817b11d00aad656011ccea73df5 Author: Kris Van Hees Date: 2025-05-01 (Thu, 01 May 2025) Changed paths: M libdtrace/dt_open.c M libdtrace/dt_version.h Log Message: ----------- Only include dt_git_version.h where needed Signed-off-by: Kris Van Hees Commit: 8be4e80c9176dd3a123bf95ca53686fda35b39a0 https://github.com/oracle/dtrace-utils/commit/8be4e80c9176dd3a123bf95ca53686fda35b39a0 Author: Kris Van Hees Date: 2025-05-01 (Thu, 01 May 2025) Changed paths: M libcommon/dof_parser.c Log Message: ----------- dof_parser: remove pointless comment Signed-off-by: Kris Van Hees Commit: 236bc87d5e6b22b9b8bfc8474336b5e0d7779a6f https://github.com/oracle/dtrace-utils/commit/236bc87d5e6b22b9b8bfc8474336b5e0d7779a6f Author: Kris Van Hees Date: 2025-05-01 (Thu, 01 May 2025) Changed paths: M dtprobed/dtprobed.c M libcommon/dof_parser.c M libcommon/dof_parser.h Log Message: ----------- dof_parser: restructure the dof_copyin*() code All logic for reading data from the DOF parser pipe is now consolidated in dof_copyin(). Signed-off-by: Kris Van Hees Commit: 0e172aeac1034bd233aafc46bf38fe01f3dfe43e https://github.com/oracle/dtrace-utils/commit/0e172aeac1034bd233aafc46bf38fe01f3dfe43e Author: Kris Van Hees Date: 2025-05-27 (Tue, 27 May 2025) Changed paths: M dtprobed/dof_stash.c M dtprobed/dof_stash.h M dtprobed/dtprobed.c M libcommon/Build R libcommon/dof_parser.c R libcommon/dof_parser.h R libcommon/dof_parser_host.c A libcommon/usdt_parser.c A libcommon/usdt_parser.h A libcommon/usdt_parser_dof.c A libcommon/usdt_parser_host.c M libdtrace/dt_pid.c Log Message: ----------- dof_parser: generic parser framework to support multiple parsers To prepare for non-DOF section based USDT probe definitions, the data passed from dtprobed to the USDT data parser is more generic. The dof_helper_t structure is passed first, followed by a block count, and that number of data blocks, passed as a size followed by the content. Signed-off-by: Kris Van Hees Commit: 30fb76b604985f7d70db609dbef4bcff6e53aacf https://github.com/oracle/dtrace-utils/commit/30fb76b604985f7d70db609dbef4bcff6e53aacf Author: Kris Van Hees Date: 2025-05-27 (Tue, 27 May 2025) Changed paths: M dtprobed/dtprobed.c Log Message: ----------- dtprobed: fix probe name debug output Debug output while reading dof_parsed_t structures was printing the probe names as provider->provoder.name and probe->probe.name, but probe.name is a 0-separated concatenation of the probe name elements. It only printed the module name. Corrected to print the full probe name. Also moved it to the proper place (when a new probe is read rather than for every tracepoint). Signed-off-by: Kris Van Hees Commit: f57092dea8202cb3581f4f8e913c29c0043e51db https://github.com/oracle/dtrace-utils/commit/f57092dea8202cb3581f4f8e913c29c0043e51db Author: Kris Van Hees Date: 2025-05-27 (Tue, 27 May 2025) Changed paths: M libcommon/Build A libcommon/dt_htab.c A libcommon/dt_htab.h M libdtrace/Build M libdtrace/dt_consume.c R libdtrace/dt_htab.c R libdtrace/dt_htab.h M libdtrace/dt_kernel_module.c M libdtrace/dt_module.c M libdtrace/dt_open.c M libdtrace/dt_probe.c M libdtrace/dt_provider.c M libdtrace/dt_symtab.c Log Message: ----------- htab: move htab handling to libcommon Signed-off-by: Kris Van Hees Commit: aed7ac155c6ab67445813308b82b955da27d65ab https://github.com/oracle/dtrace-utils/commit/aed7ac155c6ab67445813308b82b955da27d65ab Author: Kris Van Hees Date: 2025-05-27 (Tue, 27 May 2025) Changed paths: M libcommon/dt_htab.c M libcommon/dt_htab.h M libdtrace/dt_string.c M libdtrace/dt_string.h Log Message: ----------- htab: move str2hval() to dt_htab Signed-off-by: Kris Van Hees Commit: f47ac124d9984b98da1b0dc9e16056bbcd2f3727 https://github.com/oracle/dtrace-utils/commit/f47ac124d9984b98da1b0dc9e16056bbcd2f3727 Author: Kris Van Hees Date: 2025-05-27 (Tue, 27 May 2025) Changed paths: M dtprobed/dtprobed.c Log Message: ----------- dtprobed: make sure that retry one time means exactly that Signed-off-by: Kris Van Hees Commit: d48b4e2d6cacefe9cf7f280c8981cab4c042c5f4 https://github.com/oracle/dtrace-utils/commit/d48b4e2d6cacefe9cf7f280c8981cab4c042c5f4 Author: Kris Van Hees Date: 2025-05-27 (Tue, 27 May 2025) Changed paths: M include/dtrace/ioctl.h Log Message: ----------- usdt: add HASUSDT to the helper ioctl interface Signed-off-by: Kris Van Hees Commit: 57f6934ba014bfcc8771f28d465ee79d5cced9c0 https://github.com/oracle/dtrace-utils/commit/57f6934ba014bfcc8771f28d465ee79d5cced9c0 Author: Kris Van Hees Date: 2025-05-29 (Thu, 29 May 2025) Changed paths: M dtprobed/dof_stash.c M dtprobed/dof_stash.h M dtprobed/dtprobed.c M libcommon/Build M libcommon/usdt_parser.c M libcommon/usdt_parser.h M libcommon/usdt_parser_dof.c M libcommon/usdt_parser_host.c A libcommon/usdt_parser_notes.c Log Message: ----------- dtprobed, usdt parser: add support for ELF notes-based USDT Signed-off-by: Kris Van Hees Commit: 78e8ac4461d458fe4b35c642c3004e050923ae3b https://github.com/oracle/dtrace-utils/commit/78e8ac4461d458fe4b35c642c3004e050923ae3b Author: Kris Van Hees Date: 2025-05-29 (Thu, 29 May 2025) Changed paths: M include/dtrace/pid.h M libdtrace/dt_cg.c M libdtrace/dt_cg.h M libdtrace/dt_pid.c M libdtrace/dt_prov_uprobe.c Log Message: ----------- usdt: implement tracing USDT probes specified in ELF notes Commit: 50aa1a271aa57ab0c022c80bf39cceced3758c6c https://github.com/oracle/dtrace-utils/commit/50aa1a271aa57ab0c022c80bf39cceced3758c6c Author: Kris Van Hees Date: 2025-05-29 (Thu, 29 May 2025) Changed paths: M libdtrace/drti.c M libdtrace/dt_dof.c M libdtrace/dt_impl.h M libdtrace/dt_link.c M libdtrace/dt_program.c M libdtrace/dt_prov_uprobe.c M test/triggers/Build A test/triggers/usdt-tst-arg-const-prov.d A test/triggers/usdt-tst-arg-const.c A test/triggers/usdt-tst-arg-reg-prov.d A test/triggers/usdt-tst-arg-reg.c A test/triggers/usdt-tst-deref-decode-prov.d A test/triggers/usdt-tst-deref-decode.c A test/unittest/usdt/err.wrong-probe-argc-cc.sh A test/unittest/usdt/err.wrong-probe-argc-rt.sh A test/unittest/usdt/err.wrong-probe.sh A test/unittest/usdt/err.wrong-prov.sh A test/unittest/usdt/tst.arg-reg.d A test/unittest/usdt/tst.arg-reg.r A test/unittest/usdt/tst.const.d A test/unittest/usdt/tst.const.r A test/unittest/usdt/tst.deref-decode.d M test/utils/Build M test/utils/showUSDT.c M uts/common/sys/sdt.h A uts/common/sys/usdt.h A uts/common/sys/usdt_gennote.h A uts/common/sys/usdt_internal.h Log Message: ----------- link: implement USDT probe definitions in ELF notes Signed-off-by: Kris Van Hees Compare: https://github.com/oracle/dtrace-utils/compare/2dbaebf8d4bb%5E...50aa1a271aa5 To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications From noreply at github.com Thu May 29 22:15:58 2025 From: noreply at github.com (Kris Van Hees) Date: Thu, 29 May 2025 15:15:58 -0700 Subject: [DTrace-devel] [oracle/dtrace-utils] 00ee41: link: implement USDT probe definitions in ELF notes Message-ID: Branch: refs/heads/kvh/usdt-new Home: https://github.com/oracle/dtrace-utils Commit: 00ee41bd0b6856f53b2e0fdd8de7afcbeb41be45 https://github.com/oracle/dtrace-utils/commit/00ee41bd0b6856f53b2e0fdd8de7afcbeb41be45 Author: Kris Van Hees Date: 2025-05-29 (Thu, 29 May 2025) Changed paths: M libdtrace/drti.c M libdtrace/dt_dof.c M libdtrace/dt_impl.h M libdtrace/dt_link.c M libdtrace/dt_program.c M libdtrace/dt_prov_uprobe.c M test/triggers/Build A test/triggers/usdt-tst-arg-const-prov.d A test/triggers/usdt-tst-arg-const.c A test/triggers/usdt-tst-arg-reg-prov.d A test/triggers/usdt-tst-arg-reg.c A test/triggers/usdt-tst-deref-decode-prov.d A test/triggers/usdt-tst-deref-decode.c A test/unittest/usdt/err.wrong-probe-argc-cc.sh A test/unittest/usdt/err.wrong-probe-argc-rt.sh A test/unittest/usdt/err.wrong-probe.sh A test/unittest/usdt/err.wrong-prov.sh A test/unittest/usdt/tst.arg-reg.d A test/unittest/usdt/tst.arg-reg.r A test/unittest/usdt/tst.const.d A test/unittest/usdt/tst.const.r A test/unittest/usdt/tst.deref-decode.d M test/utils/Build M test/utils/showUSDT.c M uts/common/sys/sdt.h A uts/common/sys/usdt.h A uts/common/sys/usdt_gennote.h A uts/common/sys/usdt_internal.h Log Message: ----------- link: implement USDT probe definitions in ELF notes Signed-off-by: Kris Van Hees To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications From noreply at github.com Thu May 29 22:16:24 2025 From: noreply at github.com (Kris Van Hees) Date: Thu, 29 May 2025 15:16:24 -0700 Subject: [DTrace-devel] [oracle/dtrace-utils] 00ee41: link: implement USDT probe definitions in ELF notes Message-ID: Branch: refs/heads/kvh/usdt-dev Home: https://github.com/oracle/dtrace-utils Commit: 00ee41bd0b6856f53b2e0fdd8de7afcbeb41be45 https://github.com/oracle/dtrace-utils/commit/00ee41bd0b6856f53b2e0fdd8de7afcbeb41be45 Author: Kris Van Hees Date: 2025-05-29 (Thu, 29 May 2025) Changed paths: M libdtrace/drti.c M libdtrace/dt_dof.c M libdtrace/dt_impl.h M libdtrace/dt_link.c M libdtrace/dt_program.c M libdtrace/dt_prov_uprobe.c M test/triggers/Build A test/triggers/usdt-tst-arg-const-prov.d A test/triggers/usdt-tst-arg-const.c A test/triggers/usdt-tst-arg-reg-prov.d A test/triggers/usdt-tst-arg-reg.c A test/triggers/usdt-tst-deref-decode-prov.d A test/triggers/usdt-tst-deref-decode.c A test/unittest/usdt/err.wrong-probe-argc-cc.sh A test/unittest/usdt/err.wrong-probe-argc-rt.sh A test/unittest/usdt/err.wrong-probe.sh A test/unittest/usdt/err.wrong-prov.sh A test/unittest/usdt/tst.arg-reg.d A test/unittest/usdt/tst.arg-reg.r A test/unittest/usdt/tst.const.d A test/unittest/usdt/tst.const.r A test/unittest/usdt/tst.deref-decode.d M test/utils/Build M test/utils/showUSDT.c M uts/common/sys/sdt.h A uts/common/sys/usdt.h A uts/common/sys/usdt_gennote.h A uts/common/sys/usdt_internal.h Log Message: ----------- link: implement USDT probe definitions in ELF notes Signed-off-by: Kris Van Hees To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications From noreply at github.com Thu May 29 22:16:25 2025 From: noreply at github.com (Kris Van Hees) Date: Thu, 29 May 2025 15:16:25 -0700 Subject: [DTrace-devel] [oracle/dtrace-utils] Message-ID: Branch: refs/heads/kvh/usdt-new Home: https://github.com/oracle/dtrace-utils To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications From noreply at github.com Fri May 30 16:12:24 2025 From: noreply at github.com (Kris Van Hees) Date: Fri, 30 May 2025 09:12:24 -0700 Subject: [DTrace-devel] [oracle/dtrace-utils] 844e4a: dtprobed, usdt parser: add support for ELF notes-b... Message-ID: Branch: refs/heads/kvh/usdt-dev Home: https://github.com/oracle/dtrace-utils Commit: 844e4ae267552d1075f36493a9135595346c4390 https://github.com/oracle/dtrace-utils/commit/844e4ae267552d1075f36493a9135595346c4390 Author: Kris Van Hees Date: 2025-05-30 (Fri, 30 May 2025) Changed paths: M dtprobed/dof_stash.c M dtprobed/dof_stash.h M dtprobed/dtprobed.c M libcommon/Build M libcommon/usdt_parser.c M libcommon/usdt_parser.h M libcommon/usdt_parser_dof.c M libcommon/usdt_parser_host.c A libcommon/usdt_parser_notes.c Log Message: ----------- dtprobed, usdt parser: add support for ELF notes-based USDT Signed-off-by: Kris Van Hees Commit: 82186a91c206693749082734fcd3f164f27c59c2 https://github.com/oracle/dtrace-utils/commit/82186a91c206693749082734fcd3f164f27c59c2 Author: Kris Van Hees Date: 2025-05-30 (Fri, 30 May 2025) Changed paths: M include/dtrace/pid.h M libdtrace/dt_cg.c M libdtrace/dt_cg.h M libdtrace/dt_pid.c M libdtrace/dt_prov_uprobe.c Log Message: ----------- usdt: implement tracing USDT probes specified in ELF notes Commit: 6cd3aa00f0e56efc431f190afed41bdccc4ef6c9 https://github.com/oracle/dtrace-utils/commit/6cd3aa00f0e56efc431f190afed41bdccc4ef6c9 Author: Kris Van Hees Date: 2025-05-30 (Fri, 30 May 2025) Changed paths: M libdtrace/drti.c M libdtrace/dt_dof.c M libdtrace/dt_impl.h M libdtrace/dt_link.c M libdtrace/dt_program.c M test/triggers/Build A test/triggers/usdt-tst-arg-const-prov.d A test/triggers/usdt-tst-arg-const.c A test/triggers/usdt-tst-arg-reg-prov.d A test/triggers/usdt-tst-arg-reg.c A test/triggers/usdt-tst-deref-decode-prov.d A test/triggers/usdt-tst-deref-decode.c M test/unittest/options/tst.strip.sh A test/unittest/usdt/err.wrong-probe-argc-cc.sh A test/unittest/usdt/err.wrong-probe-argc-rt.sh A test/unittest/usdt/err.wrong-probe.sh A test/unittest/usdt/err.wrong-prov.sh A test/unittest/usdt/tst.arg-reg.d A test/unittest/usdt/tst.arg-reg.r M test/unittest/usdt/tst.badguess.sh A test/unittest/usdt/tst.const.d A test/unittest/usdt/tst.const.r A test/unittest/usdt/tst.deref-decode.d M test/utils/Build M test/utils/showUSDT.c M uts/common/sys/sdt.h A uts/common/sys/usdt.h A uts/common/sys/usdt_gennote.h A uts/common/sys/usdt_internal.h Log Message: ----------- link: implement USDT probe definitions in ELF notes Signed-off-by: Kris Van Hees Commit: 251963b9a5665d72e11548e598abd58d65b6d406 https://github.com/oracle/dtrace-utils/commit/251963b9a5665d72e11548e598abd58d65b6d406 Author: Kris Van Hees Date: 2025-05-30 (Fri, 30 May 2025) Changed paths: M test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh Log Message: ----------- test: fix test for non-installed testing On a system without DTrace installed, cannot be found, causing this test to fail. Use test_cppflags to ensure the correct location is used in all cases. Signed-off-by: Kris Van Hees Compare: https://github.com/oracle/dtrace-utils/compare/00ee41bd0b68...251963b9a566 To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications From noreply at github.com Fri May 30 21:33:52 2025 From: noreply at github.com (Kris Van Hees) Date: Fri, 30 May 2025 14:33:52 -0700 Subject: [DTrace-devel] [oracle/dtrace-utils] 80abc2: link: implement USDT probe definitions in ELF notes Message-ID: Branch: refs/heads/kvh/usdt-dev Home: https://github.com/oracle/dtrace-utils Commit: 80abc2fc640860c7c9769261316ce2941f030e50 https://github.com/oracle/dtrace-utils/commit/80abc2fc640860c7c9769261316ce2941f030e50 Author: Kris Van Hees Date: 2025-05-30 (Fri, 30 May 2025) Changed paths: M libdtrace/drti.c M libdtrace/dt_dof.c M libdtrace/dt_impl.h M libdtrace/dt_link.c M libdtrace/dt_program.c M test/triggers/Build A test/triggers/usdt-tst-arg-const-prov.d A test/triggers/usdt-tst-arg-const.c A test/triggers/usdt-tst-arg-reg-prov.d A test/triggers/usdt-tst-arg-reg.c A test/triggers/usdt-tst-deref-decode-prov.d A test/triggers/usdt-tst-deref-decode.c M test/unittest/options/tst.strip.sh A test/unittest/usdt/err.wrong-probe-argc-cc.sh A test/unittest/usdt/err.wrong-probe-argc-rt.sh A test/unittest/usdt/err.wrong-probe.sh A test/unittest/usdt/err.wrong-prov.sh A test/unittest/usdt/tst.arg-reg.d A test/unittest/usdt/tst.arg-reg.r M test/unittest/usdt/tst.badguess.sh A test/unittest/usdt/tst.const.d A test/unittest/usdt/tst.const.r A test/unittest/usdt/tst.deref-decode.d M test/utils/Build M test/utils/showUSDT.c M uts/common/sys/sdt.h A uts/common/sys/usdt.h A uts/common/sys/usdt_gennote.h A uts/common/sys/usdt_internal.h Log Message: ----------- link: implement USDT probe definitions in ELF notes Signed-off-by: Kris Van Hees Commit: 16bcd319066886cd5b69552e5dbf87300c2866df https://github.com/oracle/dtrace-utils/commit/16bcd319066886cd5b69552e5dbf87300c2866df Author: Kris Van Hees Date: 2025-05-30 (Fri, 30 May 2025) Changed paths: M test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh Log Message: ----------- test: fix test for non-installed testing On a system without DTrace installed, cannot be found, causing this test to fail. Use test_cppflags to ensure the correct location is used in all cases. Signed-off-by: Kris Van Hees Compare: https://github.com/oracle/dtrace-utils/compare/251963b9a566...16bcd3190668 To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications