Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Feb 2023 19:19:08 +0200
From:      Christos Margiolis <christos@freebsd.org>
To:        status-updates@freebsdfoundation.org
Cc:        freebsd-dtrace@freebsd.org, markj@freebsd.org
Subject:   [Development report #2] Improve the kinst DTrace provider
Message-ID:  <20230223171908.aiuuckj5uq4na23o@tpad>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230223171908.aiuuckj5uq4na23o>