[DTrace-devel] issues flagged in the USDT patch series

Eugene Loh eugene.loh at oracle.com
Fri Aug 30 18:13:37 UTC 2024


I posted a 19-patch series to add more USDT support.  The patches flag a 
few issues.  Some are being deferred intentionally, while we wait for 
consensus to develop around the basic implementation approach.  Later, 
we can deal with, e.g., extending past 64 clauses, making dtrace more 
responsive to changes in the DOF stash, deferred attach (-Z), etc.

Meanwhile, here is a roll up of some issues mentioned in the patches.  
In some cases, I just haven't looked carefully at the issues yet, 
preferring instead to get the patches out for feedback.

==  Scalability:

     #07 Create the BPF usdt_prids map
     How do we size (and grow?) BPF maps?  (string table, USDT prid entries)

     #12 Increase size of BPF probes map
     libdtrace/dt_bpf.c gmap_create_probes()
     How do we size (and grow?) BPF probes map?

==  Optimization:

     #07 Create the BPF usdt_prids map
     libdtrace/dt_prov_uprobe.c purge_BPFmap()
     When iterating over BPF map keys,
     deleting an elem forces a restart of the iteration?

     #07 Create the BPF usdt_prids map
     libdtrace/dt_prov_uprobe.c purge_BPFmap()
     Should we purge USDT entries that have disappeared,
     even if the process is still running (with other active USDT probes)?

     #08 Support multiple overlying probes in the uprobe trampoline
     libdtrace/dt_prov_uprobe.c trampoline()
     Confirm that calls are not excessive (and yet sufficient to be 
correct) to:
     - dt_cg_tramp_prologue()
     - dt_cg_tramp_copy_regs()
     - dt_cg_tramp_copy_rval_from_regs()

     #09 Use usdt_prids map to call clauses conditionally for USDT probes
     libdtrace/dt_prov_uprobe.c trampoline()
     Are there more cases when we know there are no USDT probes to consider?

==  Better error handling:

     #07 Create the BPF usdt_prids map
     libdtrace/dt_prov_uprobe.c grow_strtab()
     Handle if ((strtab=dt_zalloc()) == NULL).
     Handle if BPF update fails.

     #07 Create the BPF usdt_prids map
     libdtrace/dt_prov_uprobe.c update_uprobe()
     Handle if BPF probes map update fails.
     Handle if strtab grows too big.
     Handle reporting for dt_pid_get_pid().
     Handle if BPF USDT prid map update fails.

     #11 Support USDT wildcard provider descriptions
     libdtrace/dt_pid.c dt_pid_create_probes()
     Handle when looping over probes and one encounters a problem with:
     - dt_pid_create_pid_probes()
     - dt_pid_create_usdt_probes()

==  Better resource cleanup:

     #01 Change probes from having lists of clauses to lists of stmts
     libdtrace/dt_probe.c dt_probe_destroy()
     Is the free sufficiently thorough?

     #03 Widen the EPID to include the PRID
     libdtrace/dt_map.c dt_epid_lookup()
     Is the dt_datadesc_hold() appropriately released somewhere?

==  Heritage issues (predating this patch series):

     #13 Get rid of relocatable EPID, dt_nextepid, and dt_ddesc[]
     libdtrace/dt_cc.c dt_link_construct()
     Shall we get rid of clid?

     #17 test: Add a pid-USDT test
     PCs for pid return probes are apparently in the caller,
     presumably due to using uretprobe.  It isn't what Solaris did.

     #19 test: Add another USDT open/close test
     test/unittest/usdt/tst.dlclose4.sh
     Can similar USDT tests be simplified by using the same trigger?




More information about the DTrace-devel mailing list