From owner-dev-commits-doc-all@freebsd.org Mon May 31 23:23:57 2021 Return-Path: Delivered-To: dev-commits-doc-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 243C8632E6A for ; Mon, 31 May 2021 23:23:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvBF90GGlz3QR6; Mon, 31 May 2021 23:23:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D35F219210; Mon, 31 May 2021 23:23:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14VNNu03066415; Mon, 31 May 2021 23:23:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14VNNue9066414; Mon, 31 May 2021 23:23:56 GMT (envelope-from git) Date: Mon, 31 May 2021 23:23:56 GMT Message-Id: <202105312323.14VNNue9066414@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Warner Losh Subject: git: 293f155765 - main - arch-handbook: Document PROLOG and EPILOG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 293f155765ee12c857f818b9e9d9e94cc61323a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-doc-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the doc repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 23:23:57 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/doc/commit/?id=293f155765ee12c857f818b9e9d9e94cc61323a4 commit 293f155765ee12c857f818b9e9d9e94cc61323a4 Author: Warner Losh AuthorDate: 2021-04-27 21:07:35 +0000 Commit: Warner Losh CommitDate: 2021-05-31 23:23:35 +0000 arch-handbook: Document PROLOG and EPILOG PROLOG and EPILOG modifiers are used to set code to insert before or after the method is called. It's use cases are limited. It is intended to only be used only for tracing or other profling. Sponsored by: Netflix --- documentation/content/en/books/arch-handbook/kobj/_index.adoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/documentation/content/en/books/arch-handbook/kobj/_index.adoc b/documentation/content/en/books/arch-handbook/kobj/_index.adoc index 32b64e3bbd..0b81112792 100644 --- a/documentation/content/en/books/arch-handbook/kobj/_index.adoc +++ b/documentation/content/en/books/arch-handbook/kobj/_index.adoc @@ -118,7 +118,7 @@ KOBJMETHOD(NAME, FUNC) The first step in using Kobj is to create an Interface. Creating the interface involves creating a template that the script [.filename]#src/sys/kern/makeobjops.pl# can use to generate the header and code for the method declarations and method lookup functions. -Within this template the following keywords are used: `#include`, `INTERFACE`, `CODE`, `HEADER`, `METHOD`, `STATICMETHOD`, and `DEFAULT`. +Within this template the following keywords are used: `#include`, `INTERFACE`, `CODE`, `EPILOG`, `HEADER`, `METHOD`, `PROLOG`, `STATICMETHOD`, and `DEFAULT`. The `#include` statement and what follows it is copied verbatim to the head of the generated code file. @@ -202,6 +202,9 @@ The `STATICMETHOD` keyword is used like the `METHOD` keyword except the kobj dat Instead `STATICMETHOD` relies on the Kobj data being referenced as 'ops'. This is also useful for calling methods directly out of a class's method table. +The `PROLOG` and `EPILOG` keywords sets inserts code immediately before or directly after the `METHOD` they are attached to. +This feature is used primarily for profiling situations where it's difficult to obtain the information in another way. + Other complete examples: [.programlisting]