The past few days I've been trying figure out how dt_sugar.c in
libdtrace applies transformations to D scripts. I intend on extending
dt_sugar to use parts of the code I've written about in my last
development report [1] to detect inline calls.

For any kinst probe of the forms:

        kinst::func:entry
        kinst::func:return

If <func> isn't an inline call, the probe will be transformed to an FBT
one. For example, `kinst::func:entry` will become `fbt::func:entry`.
This will be done to avoid porting FBT code to kinst.

If <func> is an inline call, the D syntax will be transformed to create
separate kinst probes for each inline call. For example:

        kinst::foo:entry

If foo() is called from functions bar() and baz() at offsets 10 and 20
respectively, dt_sugar will transform `kinst::foo:entry` to:

        kinst::bar:10
        kinst::baz:20

Christos

[1] https://git.sr.ht/~crm/inlinecall

Reply via email to