From nobody Tue Jan 11 08:14:39 2022 X-Original-To: dev-commits-src-all@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 1BDBA193FC28; Tue, 11 Jan 2022 08:14:40 +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 4JY3Q75sXqz3vpR; Tue, 11 Jan 2022 08:14:39 +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 9ACEF1562B; Tue, 11 Jan 2022 08:14:39 +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 20B8EdXb097765; Tue, 11 Jan 2022 08:14:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20B8Edxq097764; Tue, 11 Jan 2022 08:14:39 GMT (envelope-from git) Date: Tue, 11 Jan 2022 08:14:39 GMT Message-Id: <202201110814.20B8Edxq097764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 01cad731921b - main - loader: tslog: Add more log for module loading List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01cad731921bb60b4f6e04c1cac987eea7af9d08 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641888879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cl84faR3V+5gWDKtgwWh9jZ8aLI3peIKPK0Smt7AhyI=; b=aw56eTQjzLPjEAuPD+kxxYg4swFImiJfNUyd7KAYjLVfeiGBGWBLg7SHwj6WC5Nt1tEppC Sn1PL4oUNmAknej6r8dRjcuQgaKjTBYQPvBOgpLUju1G4SnVxfJYJ9f/Oo5J7OidfRAb3A fr3VjWKsqm61Te/uqvMTztkXKKIzpvu6HKLKdnnn2GP+UYhMM+e9eAs3KcpG9EnzhsVorP Db4Udsj0k1dRrxzh1iBAoNaubXqfY9OmIfctseqpCQBNq227VGgx+uvW9Ut07yQj5TqbGy UvO9+9L57J4fe9+7Z+POISs3XXrv/3GNpD9BYdYSVJDzLCnpSgweIxx1tHKW9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641888879; a=rsa-sha256; cv=none; b=hEuouMy9OPJmWTdilw3eyoyJJbMGflio5M1P26u9Wvzl/Y5jVs/Y+B4dHOyJrnuvy4bLhO xCIUH0rHD0MmmJvzSSe/sTs9yydTqCSS1q5zE7pzLqdQ+5cHLNwHfFZawg9qlAqpCq/Vx6 uTyZf6xsWe5mW2DFG7T5jODPBvj1IGWsM7bqalPWVnqiAYxUgRaTWOPNaWflr4sn3PN/S0 JH9nkpzr4PpNHfYriLn8XFP5HQOmowNViV1xNuAwl2MXi1eJHFwqS4JtgvIODdN1ekYQUD 2ODVtcOOVmI/1ZRXqp6/xTp03Zz8kF5Lx8CE3ONIsmmQTNFdzILVJ2Gqy6RmSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=01cad731921bb60b4f6e04c1cac987eea7af9d08 commit 01cad731921bb60b4f6e04c1cac987eea7af9d08 Author: Emmanuel Vadot AuthorDate: 2021-12-30 14:49:24 +0000 Commit: Emmanuel Vadot CommitDate: 2022-01-11 08:14:10 +0000 loader: tslog: Add more log for module loading This helps mesuring what's happening when we load the kernel/modules/mfsroot. This also adds TSENTER2 which uses the third argument of TSRAW, same as in the kernel. MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33699 --- stand/common/module.c | 22 ++++++++++++++++++++++ stand/libsa/stand.h | 1 + 2 files changed, 23 insertions(+) diff --git a/stand/common/module.c b/stand/common/module.c index 9cb10d0f9f9d..bf95fbc59ea3 100644 --- a/stand/common/module.c +++ b/stand/common/module.c @@ -556,6 +556,7 @@ file_load(char *filename, vm_offset_t dest, struct preloaded_file **result) int error; int i; + TSENTER2(filename); if (archsw.arch_loadaddr != NULL) dest = archsw.arch_loadaddr(LOAD_RAW, filename, dest); @@ -582,6 +583,7 @@ file_load(char *filename, vm_offset_t dest, struct preloaded_file **result) break; } } + TSEXIT(); return (error); } @@ -743,9 +745,11 @@ file_loadraw(const char *fname, char *type, int insert) int verror; #endif + TSENTER2(fname); /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { command_errmsg = "can't load file before kernel"; + TSEXIT(); return(NULL); } @@ -754,6 +758,7 @@ file_loadraw(const char *fname, char *type, int insert) if (name == NULL) { snprintf(command_errbuf, sizeof(command_errbuf), "can't find '%s'", fname); + TSEXIT(); return(NULL); } @@ -761,6 +766,7 @@ file_loadraw(const char *fname, char *type, int insert) snprintf(command_errbuf, sizeof(command_errbuf), "can't open '%s': %s", name, strerror(errno)); free(name); + TSEXIT(); return(NULL); } @@ -772,6 +778,7 @@ file_loadraw(const char *fname, char *type, int insert) free(name); free(vctx); close(fd); + TSEXIT(); return(NULL); } #else @@ -781,6 +788,7 @@ file_loadraw(const char *fname, char *type, int insert) name, ve_error_get()); free(name); close(fd); + TSEXIT(); return(NULL); } #endif @@ -805,6 +813,7 @@ file_loadraw(const char *fname, char *type, int insert) #ifdef LOADER_VERIEXEC_VECTX free(vctx); #endif + TSEXIT(); return(NULL); } laddr += got; @@ -817,6 +826,7 @@ file_loadraw(const char *fname, char *type, int insert) free(name); close(fd); free(vctx); + TSEXIT(); return(NULL); } #endif @@ -828,6 +838,7 @@ file_loadraw(const char *fname, char *type, int insert) "no memory to load %s", name); free(name); close(fd); + TSEXIT(); return (NULL); } fp->f_name = name; @@ -843,6 +854,7 @@ file_loadraw(const char *fname, char *type, int insert) "no memory to load %s", name); free(name); close(fd); + TSEXIT(); return (NULL); } /* recognise space consumption */ @@ -852,6 +864,7 @@ file_loadraw(const char *fname, char *type, int insert) if (insert != 0) file_insert_tail(fp); close(fd); + TSEXIT(); return(fp); } @@ -867,8 +880,10 @@ mod_load(char *modname, struct mod_depend *verinfo, int argc, char *argv[]) int err; char *filename; + TSENTER2(modname); if (file_havepath(modname)) { printf("Warning: mod_load() called instead of mod_loadkld() for module '%s'\n", modname); + TSEXIT(); return (mod_loadkld(modname, argc, argv)); } /* see if module is already loaded */ @@ -880,6 +895,7 @@ mod_load(char *modname, struct mod_depend *verinfo, int argc, char *argv[]) #endif snprintf(command_errbuf, sizeof(command_errbuf), "warning: module '%s' already loaded", mp->m_name); + TSEXIT(); return (0); } /* locate file with the module on the search path */ @@ -887,10 +903,12 @@ mod_load(char *modname, struct mod_depend *verinfo, int argc, char *argv[]) if (filename == NULL) { snprintf(command_errbuf, sizeof(command_errbuf), "can't find '%s'", modname); + TSEXIT(); return (ENOENT); } err = mod_loadkld(filename, argc, argv); free(filename); + TSEXIT(); return (err); } @@ -906,6 +924,7 @@ mod_loadkld(const char *kldname, int argc, char *argv[]) char *filename; vm_offset_t loadaddr_saved; + TSENTER2(kldname); /* * Get fully qualified KLD name */ @@ -913,6 +932,7 @@ mod_loadkld(const char *kldname, int argc, char *argv[]) if (filename == NULL) { snprintf(command_errbuf, sizeof(command_errbuf), "can't find '%s'", kldname); + TSEXIT(); return (ENOENT); } /* @@ -923,6 +943,7 @@ mod_loadkld(const char *kldname, int argc, char *argv[]) snprintf(command_errbuf, sizeof(command_errbuf), "warning: KLD '%s' already loaded", filename); free(filename); + TSEXIT(); return (0); } @@ -949,6 +970,7 @@ mod_loadkld(const char *kldname, int argc, char *argv[]) if (err) file_discard(fp); free(filename); + TSEXIT(); return (err); } diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h index 172b54c33b30..99b55e2282e4 100644 --- a/stand/libsa/stand.h +++ b/stand/libsa/stand.h @@ -486,6 +486,7 @@ void hexdump(caddr_t region, size_t len); /* tslog.c */ #define TSRAW(a, b, c) tslog(a, b, c) #define TSENTER() TSRAW("ENTER", __func__, NULL) +#define TSENTER2(x) TSRAW("ENTER", __func__, x) #define TSEXIT() TSRAW("EXIT", __func__, NULL) #define TSLINE() TSRAW("EVENT", __FILE__, __XSTRING(__LINE__)) void tslog(const char *, const char *, const char *);