<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/cddl/dev/dtrace/i386, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>dtrace: Deduplicate dtrace_sync() and dtrace_xcall() implementations</title>
<updated>2025-09-18T22:09:49+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-09-17T15:29:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bf115203bb8a61bd03ba23931ff0b5bf931b7d1b'/>
<id>bf115203bb8a61bd03ba23931ff0b5bf931b7d1b</id>
<content type='text'>
dtrace_xcall() is just a thin wrapper around smp_rendezvous_cpus().
There's no need for six identical implementations to live in MD layers.

No functional change intended.

MFC after:	2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dtrace_xcall() is just a thin wrapper around smp_rendezvous_cpus().
There's no need for six identical implementations to live in MD layers.

No functional change intended.

MFC after:	2 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>dtrace: Avoid including dtrace_isa.c directly into dtrace.c</title>
<updated>2024-07-24T21:24:46+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-07-24T20:10:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=82283cad12a417abfb1469d899b2d7cfb1d38f77'/>
<id>82283cad12a417abfb1469d899b2d7cfb1d38f77</id>
<content type='text'>
This was done in the original DTrace import, presumably because that
made it a bit easier to handle includes.  However, this can cause
dtrace_getpcstack() to be inlined into dtrace_probe(), resulting in a
missing frame in stack traces since dtrace_getpcstack() takes care to
bump "aframes" to account for its own stack frame.

To avoid this, compile dtrace_isa.c separately on all platforms.  Add
requisite includes.

MFC after:	2 weeks
Sponsored by:	Innovate UK
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was done in the original DTrace import, presumably because that
made it a bit easier to handle includes.  However, this can cause
dtrace_getpcstack() to be inlined into dtrace_probe(), resulting in a
missing frame in stack traces since dtrace_getpcstack() takes care to
bump "aframes" to account for its own stack frame.

To avoid this, compile dtrace_isa.c separately on all platforms.  Add
requisite includes.

MFC after:	2 weeks
Sponsored by:	Innovate UK
</pre>
</div>
</content>
</entry>
<entry>
<title>dtrace: remove x86 non-EARLY_AP_STARTUP support</title>
<updated>2023-10-10T15:03:27+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2023-10-09T20:13:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e49c7cd677df0b8691c828b55919ef37d8aad219'/>
<id>e49c7cd677df0b8691c828b55919ef37d8aad219</id>
<content type='text'>
After 792655abd64c EARLY_AP_STARTUP is mandatory for x86.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42139
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After 792655abd64c EARLY_AP_STARTUP is mandatory for x86.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42139
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-16T17:54:11+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=95ee2897e98f5d444f26ed2334cc7c439f9c16c6'/>
<id>95ee2897e98f5d444f26ed2334cc7c439f9c16c6</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>dtrace: rename rp to frame in dtrace_getreg()</title>
<updated>2023-05-23T14:44:47+00:00</updated>
<author>
<name>Christos Margiolis</name>
<email>christos@FreeBSD.org</email>
</author>
<published>2023-05-23T14:40:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=98ab9802affed1bf7c2009569eac468c86c159e8'/>
<id>98ab9802affed1bf7c2009569eac468c86c159e8</id>
<content type='text'>
Reviewed by:	mhorne, markj
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40231
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by:	mhorne, markj
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40231
</pre>
</div>
</content>
</entry>
<entry>
<title>dtrace: get rid of uchar_t types</title>
<updated>2023-04-20T17:35:56+00:00</updated>
<author>
<name>Christos Margiolis</name>
<email>christos@FreeBSD.org</email>
</author>
<published>2023-04-20T16:19:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1a149d65baed31b90a0b8abe2d6c5a568122a5ec'/>
<id>1a149d65baed31b90a0b8abe2d6c5a568122a5ec</id>
<content type='text'>
Callers are specifying uint8_t anyway and this slightly reduces
dependencies on compatibility typedefs.  No functional change intended.

Reviewed by:	markj, mhorne
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39490
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Callers are specifying uint8_t anyway and this slightly reduces
dependencies on compatibility typedefs.  No functional change intended.

Reviewed by:	markj, mhorne
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39490
</pre>
</div>
</content>
</entry>
<entry>
<title>dtrace: Add a "regs" variable</title>
<updated>2022-10-04T17:05:54+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2022-10-04T16:54:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bdd101c4d4aeab6c9e76250c310c16f5704b8b8c'/>
<id>bdd101c4d4aeab6c9e76250c310c16f5704b8b8c</id>
<content type='text'>
This allows invop-based providers (i.e., fbt and kinst) to expose the
register file of the CPU at the point where the probe fired.  It does
not work for SDT providers because their probes are implemented as plain
function calls and so don't save registers.  It's not clear what
semantics "regs" should have for them anyway.

This is akin to "uregs", which nominally provides access to the
userspace registers.  In fact, DIF already had a DIF_VAR_REGS variable
defined, it was simply unimplemented.

Usage example: print the contents of %rdi upon each call to
amd64_syscall():

    fbt::amd64_syscall:entry {printf("%x", regs[R_RDI]);}

Note that the R_* constants are defined in /usr/lib/dtrace/regs_x86.d.
Currently there are no similar definitions for non-x86 platforms.

Reviewed by:	christos
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36799
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows invop-based providers (i.e., fbt and kinst) to expose the
register file of the CPU at the point where the probe fired.  It does
not work for SDT providers because their probes are implemented as plain
function calls and so don't save registers.  It's not clear what
semantics "regs" should have for them anyway.

This is akin to "uregs", which nominally provides access to the
userspace registers.  In fact, DIF already had a DIF_VAR_REGS variable
defined, it was simply unimplemented.

Usage example: print the contents of %rdi upon each call to
amd64_syscall():

    fbt::amd64_syscall:entry {printf("%x", regs[R_RDI]);}

Note that the R_* constants are defined in /usr/lib/dtrace/regs_x86.d.
Currently there are no similar definitions for non-x86 platforms.

Reviewed by:	christos
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36799
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix syntax</title>
<updated>2020-12-01T23:51:48+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2020-12-01T23:51:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=013a1ae66e1fc13cdc3277a008fc499f9fc10970'/>
<id>013a1ae66e1fc13cdc3277a008fc499f9fc10970</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a kstack_contains() helper function.</title>
<updated>2020-12-01T17:04:46+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2020-12-01T17:04:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5941edfcdc17ed51b65125c25d3fac632bf4cd81'/>
<id>5941edfcdc17ed51b65125c25d3fac632bf4cd81</id>
<content type='text'>
This is useful for stack unwinders which need to avoid out-of-bounds
reads of a kernel stack which can trigger kernel faults.

Reviewed by:	kib, markj
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D27356
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is useful for stack unwinders which need to avoid out-of-bounds
reads of a kernel stack which can trigger kernel faults.

Reviewed by:	kib, markj
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D27356
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement x86 dtrace_invop_(un)init() in C.</title>
<updated>2019-09-23T15:08:17+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2019-09-23T15:08:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9093dd9a66113e7ab2abf2557319a4acc40651f0'/>
<id>9093dd9a66113e7ab2abf2557319a4acc40651f0</id>
<content type='text'>
There is no reason for these routines to be written in assembly.  In
the ports of DTrace to other platforms, they are already written in C.
No functional change intended.

MFC after:	1 week
Sponsored by:	Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no reason for these routines to be written in assembly.  In
the ports of DTrace to other platforms, they are already written in C.
No functional change intended.

MFC after:	1 week
Sponsored by:	Netflix
</pre>
</div>
</content>
</entry>
</feed>
