[DTrace-devel] restoring how DTrace adds probes

Eugene Loh eugene.loh at oracle.com
Thu Jun 11 14:26:52 PDT 2020


On Mon, Jun 08, 2020 at 05:56:18PM -0700, Eugene Loh wrote:

>> I'll try drafting something from scratch that is shorter (no background
>> discussion) and takes your feedback into account.

Actually, since we had had a fair amount of discussion, I think I 
understand which way we're talking about doing things.  So, I'll just 
send a patch set out momentarily.  There will be a patch to deal with 
the change in dt_probe_iter() -- that is, using it for probe iteration 
within libdtrace rather than the exported symbol dtrace_probe_iter().  
There is some minor provider clean up.  There is the addition of a 
provide() function, to allow providers to supply extra probes on demand.

Finally, there is initial work on a profile provider.  It is missing 
probe arguments and profile-n probes (only does tick-n probes), but the 
basics are working, as illustrated here.  (And, yes, the test at the end 
shows the probes firing at the right periods and interleaving correctly.)

# dtrace -l | awk '$2 == "profile"'
87894    profile profile-97
87895    profile profile-199
87896    profile profile-499
87897    profile profile-997
87898    profile profile-1999
87899    profile profile-4001
87900    profile profile-4999
87901    profile tick-1
87902    profile tick-10
87903    profile tick-100
87904    profile tick-500
87905    profile tick-1000
87906    profile tick-5000
# dtrace -ln tick-1
    ID   PROVIDER            MODULE                          FUNCTION NAME
87901    profile tick-1
# dtrace -ln tick-2
    ID   PROVIDER            MODULE                          FUNCTION NAME
89835    profile tick-2
# dtrace -ln tick-1 -n tick-2 -n tick-3
    ID   PROVIDER            MODULE                          FUNCTION NAME
87901    profile tick-1
89835    profile tick-2
89836    profile tick-3
# dtrace -n '
tick-2 {trace(timestamp)}
tick-3 {trace(timestamp)}
tick-5 {trace(timestamp)}
tick-7 {trace(timestamp)}
tick-1 /n++ > 5/ {exit(0)}
'
dtrace: description 'tick-2 ' matched 5 probes
CPU     ID                    FUNCTION:NAME
   0  89838                          :tick-7       805732655613443
   0  89837                          :tick-5       805732712661118
   0  89838                          :tick-7       805732798476067
   0  89836                          :tick-3       805732845897804
   0  89837                          :tick-5       805732912659254
   0  89838                          :tick-7       805732941330557
   0  89835                          :tick-2       805733012450626
   0  89838                          :tick-7       805733084188873
   0  89837                          :tick-5       805733112659438
   0  89836                          :tick-3       805733179229076
   0  89838                          :tick-7       805733227042543
   0  89837                          :tick-5       805733312663354
   0  89838                          :tick-7       805733369902508
   0  89835                          :tick-2       805733512459251
   0  89836                          :tick-3       805733512578453
   0  89837                          :tick-5       805733512695438
   0  89838                          :tick-7       805733512812436
   0  89838                          :tick-7       805733655622776
   0  89837                          :tick-5       805733712663374
   0  89838                          :tick-7       805733798472005
   0  89836                          :tick-3       805733845898287
   0  89837                          :tick-5       805733912673593
   0  89838                          :tick-7       805733941335579
   0  89835                          :tick-2       805734012447317
   0  89838                          :tick-7       805734084185900
   0  89837                          :tick-5       805734112662136
   0  89836                          :tick-3       805734179233316
   0  89838                          :tick-7       805734227048213
   0  89837                          :tick-5       805734312670627
   0  89838                          :tick-7       805734369905395
   0  89835                          :tick-2       805734512450195
   0  89836                          :tick-3       805734512570339
   0  89837                          :tick-5       805734512688788
   0  89838                          :tick-7       805734512806675
   0  89838                          :tick-7       805734655620371
   0  89837                          :tick-5       805734712661289
   0  89838                          :tick-7       805734798476682
   0  89836                          :tick-3       805734845898573
   0  89837                          :tick-5       805734912667468
   0  89838                          :tick-7       805734941330807
   0  89835                          :tick-2       805735012444209
   0  89838                          :tick-7       805735084186116
   0  89837                          :tick-5       805735112661260
   0  89836                          :tick-3       805735179234423
   0  89838                          :tick-7       805735227044599
   0  89837                          :tick-5       805735312664914
   0  89838                          :tick-7       805735369905342
   0  89835                          :tick-2       805735512456897
   0  89836                          :tick-3       805735512575866
   0  89837                          :tick-5       805735512692654
   0  89838                          :tick-7       805735512809244
   0  89838                          :tick-7       805735655627783
   0  89837                          :tick-5       805735712669410
   0  89838                          :tick-7       805735798476525
   0  89836                          :tick-3       805735845896460
   0  89837                          :tick-5       805735912667112
   0  89838                          :tick-7       805735941332121
   0  89835                          :tick-2       805736012450068
   0  89838                          :tick-7       805736084182377
   0  89837                          :tick-5       805736112663942
   0  89836                          :tick-3       805736179234708
   0  89838                          :tick-7       805736227045871
   0  89837                          :tick-5       805736312662619
   0  89838                          :tick-7       805736369899965
   0  89835                          :tick-2       805736512456780
   0  89836                          :tick-3       805736512577290
   0  89837                          :tick-5       805736512694718
   0  89838                          :tick-7       805736512811803
   0  89838                          :tick-7       805736655619453
   0  89837                          :tick-5       805736712663415
   0  89838                          :tick-7       805736798476855
   0  89836                          :tick-3       805736845891038
   0  89837                          :tick-5       805736912668191
   0  89838                          :tick-7       805736941332167
   0  89835                          :tick-2       805737012450298
   0  89838                          :tick-7       805737084196743
   0  89837                          :tick-5       805737112661015
   0  89836                          :tick-3       805737179236462
   0  89838                          :tick-7       805737227050171
   0  89837                          :tick-5       805737312662413
   0  89838                          :tick-7       805737369904846
   0  89835                          :tick-2       805737512462871
   0  89836                          :tick-3       805737512581566
   0  89837                          :tick-5       805737512698684
   0  89838                          :tick-7       805737512815800
   0  89838                          :tick-7       805737655621014
   0  89837                          :tick-5       805737712666686
   0  89838                          :tick-7       805737798473998
   0  89836                          :tick-3       805737845898235
   0  89837                          :tick-5       805737912672275
   0  89838                          :tick-7       805737941329980
   0  89835                          :tick-2       805738012450733
   0  89838                          :tick-7       805738084184729
   0  89837                          :tick-5       805738112663867
   0  89836                          :tick-3       805738179230732
   0  89838                          :tick-7       805738227047612
   0  89837                          :tick-5       805738312663032
   0  89838                          :tick-7       805738369904641
   0  89835                          :tick-2       805738512461415
   0  89836                          :tick-3       805738512578660
   0  89837                          :tick-5       805738512695564
   0  89838                          :tick-7       805738512812355
   0  89838                          :tick-7       805738655616358
   0  89837                          :tick-5       805738712664694
   0  89838                          :tick-7       805738798475436
   0  89836                          :tick-3       805738845898519
   0  89837                          :tick-5       805738912664628
   0  89838                          :tick-7       805738941330217
   0  89835                          :tick-2       805739012457702
   0  89838                          :tick-7       805739084184180
   0  89837                          :tick-5       805739112664532
   0  89836                          :tick-3       805739179238570
   0  89838                          :tick-7       805739227049115
   0  89837                          :tick-5       805739312669752
   0  89838                          :tick-7       805739369903509
   0  89835                          :tick-2       805739512462198
   0  89836                          :tick-3       805739512580663
   0  89837                          :tick-5       805739512697838
   0  89838                          :tick-7       805739512814909
   0  87901                          :tick-1



More information about the DTrace-devel mailing list