git: 58ec2d0d4a3c - main - loader: Add TSLOG to interpreter built-ins

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Sun, 22 Sep 2024 07:36:40 UTC
The branch main has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=58ec2d0d4a3c3bcf741d9694dc7696c7b4e753b9

commit 58ec2d0d4a3c3bcf741d9694dc7696c7b4e753b9
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2024-09-18 11:01:41 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2024-09-22 07:35:47 +0000

    loader: Add TSLOG to interpreter built-ins
    
    Wrap each call to a built-in command with TSENTER/TSEXIT to make
    it easier to see where time is going in the loader.
    
    MFC after:      1 week
    Sponsored by:   Amazon
    Differential Revision:  https://reviews.freebsd.org/D46630
---
 stand/common/interp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/stand/common/interp.c b/stand/common/interp.c
index 5d20822e037d..e1fa4f9582ac 100644
--- a/stand/common/interp.c
+++ b/stand/common/interp.c
@@ -190,7 +190,9 @@ interp_builtin_cmd(int argc, char *argv[])
 
 	cmd = interp_lookup_cmd(argv[0]);
 	if (cmd != NULL && cmd->c_fn) {
+		TSENTER2(argv[0]);
 		result = cmd->c_fn(argc, argv);
+		TSEXIT();
 	} else {
 		command_errmsg = "unknown command";
 	}