From nobody Sat Oct 01 17:34:45 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MfvP75s15z4d6Vy for ; Sat, 1 Oct 2022 17:34:51 +0000 (UTC) (envelope-from phascolarctos@protonmail.ch) Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "protonmail.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MfvP56nfnz49TT; Sat, 1 Oct 2022 17:34:49 +0000 (UTC) (envelope-from phascolarctos@protonmail.ch) Date: Sat, 01 Oct 2022 17:34:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.ch; s=protonmail3; t=1664645687; x=1664904887; bh=eSCM3Pz9mr1ooRhH0E92GgObNMZOWGEfebFgLhCSI5Y=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=iQifSaZQH6GC7k3Bk3rWOyqZkbQSOaks8QBXbJasOGlGBODqQ4GJqEd05CtJuq2kM LfwL0FoChIOJUJks/2w6PFh5kGUgW6FPzoz7Tup8CcDgMdnH4fNNoncq0ccWVTDOgM qtZXlRYcnc9RkCSPzTiTgsRC5h2wOKhG+lhAqEGT7kSWYbUnXPatL1vOSXcHN7/jYX qPVXlmHRJZK4CbjkFHngedRyhVogvjN5je6GfZ7MpB1vJkr5eGc432s3Kzovy9hH8Q 6TIWnIx17sQX1d8TTeAOnKsf4+df8O9jDPD8tQFh2KoqO1P4l5gLMan7mu+353vQ7Z D6PWevzrzPyYg== To: Christos Margiolis From: Lorenzo Salvadore 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> Feedback-ID: 8540510:user:proton List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4MfvP56nfnz49TT X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=protonmail.ch header.s=protonmail3 header.b=iQifSaZQ; dmarc=pass (policy=quarantine) header.from=protonmail.ch; spf=pass (mx1.freebsd.org: domain of phascolarctos@protonmail.ch designates 185.70.43.16 as permitted sender) smtp.mailfrom=phascolarctos@protonmail.ch X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.99)[-0.991]; DMARC_POLICY_ALLOW(-0.50)[protonmail.ch,quarantine]; R_SPF_ALLOW(-0.20)[+ip4:185.70.43.0/24]; R_DKIM_ALLOW(-0.20)[protonmail.ch:s=protonmail3]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:62371, ipnet:185.70.43.0/24, country:CH]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[protonmail.ch:+]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[185.70.43.16:from] X-ThisMailContainsUnwantedMimeParts: N ------- Original Message ------- On Saturday, October 1st, 2022 at 18:00, Christos Margiolis 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::: >=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