Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Oct 2022 17:34:45 +0000
From:      Lorenzo Salvadore <phascolarctos@protonmail.ch>
To:        Christos Margiolis <christos@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, markj@freebsd.org
Subject:   Re: Instruction-level dynamic tracing
Message-ID:  <3vrXrpXrJquSyYmJEymJHUGSK5ikqCH_dQrIx37b4Il0U5e3aELEikYxQYe0foStcE3ZI29Z7zu-ij63Mfy6mOuqyFGWPilgGsmgVCUJok0=@protonmail.ch>
In-Reply-To: <20221001160015.sce47pwwtqu62vcr@pleb>
References:  <20221001160015.sce47pwwtqu62vcr@pleb>

next in thread | previous in thread | raw e-mail | index | archive | help
------- Original Message -------
On Saturday, October 1st, 2022 at 18:00, Christos Margiolis <christos@freeb=
sd.org> wrote:


>=20
>=20
> Hello,
>=20
> Me and markj@ implemented a new DTrace provider (kinst) that allows for
> arbitrary kernel instruction tracing. The provider is currently
> implemented only for amd64, but we plan to port it to other
> architectures in the future as well.
>=20
> kinst probes take the form of:
>=20
> kinst:<module>:<function>:<offset>
>=20
>=20
> where "function" is the kernel function to be traced, and "offset" is
> the offset to a specific instruction. This offset can be obtained from
> the function's disassembly using kgdb.
>=20
> For example, if I want to trace the second instruction in
> amd64_syscall(), I first need to figure out the offset to the
> second instruction:
>=20
> # kgdb
> (kgdb) disas /r amd64_syscall
> Dump of assembler code for function amd64_syscall:
> 0xffffffff809256c0 <+0>: 55 push %rbp
>=20
> 0xffffffff809256c1 <+1>: 48 89 e5 mov %rsp,%rbp
>=20
> 0xffffffff809256c4 <+4>: 41 57 push %r15
>=20
>=20
> The offset is 1. To trace it:
>=20
> # dtrace -n 'kinst::amd64_syscall:1'
>=20
> Final code review: https://reviews.freebsd.org/D36851
> Any review of the code would be appreciated.

The project seems very interesting. Have you considered sharing it through
quarterly status reports? Quarterly status reports can help increasing the
visibility of your work and thus you might get more reviewing for your code=
.

Technically the deadline for submitting 2022q3 reports was yesterday, but
as a member of the quarterly team I can tell you that we can wait for you
if you want to submit a report: just tell us that it is coming and we will
wait.

Here you can find details on how to submit a report:
https://github.com/freebsd/freebsd-quarterly

As for the text of your report, I think the text of your mail is already
good as a first draft for starting the report reviewing process.

Cheers,

Lorenzo Salvadore



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3vrXrpXrJquSyYmJEymJHUGSK5ikqCH_dQrIx37b4Il0U5e3aELEikYxQYe0foStcE3ZI29Z7zu-ij63Mfy6mOuqyFGWPilgGsmgVCUJok0=>