From nobody Mon Apr 15 14:05:25 2024 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 4VJ8855HQmz5Gfgr; Mon, 15 Apr 2024 14:05:25 +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 4VJ8854j1lz4W0q; Mon, 15 Apr 2024 14:05:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713189925; 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=c4fzJPhJARFEXOD6IuOgKN8QnE8v0N+F8+Oy5CnWgb4=; b=fOKDWml/DjoUSBCAyB66U1Mo+OY0dIZRecS0/lm9WJGNsBb9Db1GcshLZSGx2sF0iH/VQQ g8Ip6jdUD9taJjkZaYnnrFrPSNAdBVQa1sZeQU7M1ppfRi/RdxIyhvAAlgEyYBfBtqLvQ5 Eb/t7hd9DbatQsKooTQt6CoZt9g9WqYk0QlDvlnMMMyoMqPP3G9DgV8dbEwWMlYWTZp7N5 dpnT9tHpLO0sdYN9t7MK/6wVsj4FU8p05xpavQMZ8o+bolSJjzNV254bGADmuXQmpITIOE GX19aO762cH65Zq8WdtOCnDB9jNVVdvih8zra1pjyy55ObMcPdScB085zXfQwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713189925; a=rsa-sha256; cv=none; b=RTivs4Qo9GYU6jf8qvLFGLJ1ziW2GXEgRsqB49pTgqxH9ZgpjSxtGGfr/OZTHN100UIVp2 FGUHVvPHjk8jhOXxQ6A6xC6rDypsXhwQq0XNqmSu+v8QxKeljn97r6UYDQ9By48cCaE/WX Q+5P6DhBEaN2MOZkSAVijEuF377xfcLszCaOr1R2MNIRgXjqaJttKmddpRb39KJ25FGriH Eri9lXNgzoVUpu4kCTb8oBQe5PlnwrCJbCc8DfvJqhNPWJISVl1NU6BKJE4N4wbEj2Vr2T Gqv5lwbPyafPQWyMWtfbJtfkBCxPMhrfkQ2I1NXyfXhGtvrapeA7tyE6Zxc+gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713189925; 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=c4fzJPhJARFEXOD6IuOgKN8QnE8v0N+F8+Oy5CnWgb4=; b=riHlr8LXTXiomouNKm/LLUmJPH1i1C6Mzre8hT6ruoCDd2iN3UD0uoSXGBHDiPWxSZMhiT U8nv6v8f1r7nKsRb1UiOYerYEamYH55z7twI94a3AglDoKoLU+4/01DZNURAFYRiSkl5e2 87o1pGJMTjnhMeQrVBU1Q1d5IvA7KsOaAkG5RpFGneaV03xnQLPx65MkLXn2CRESN+iqaz DqM4ZyRPFQGU/E1f3UyfW67GH5BpK3gGXY5ecsk9HJIcQIcEVnSs+WNQYkJXYkE5RE/W+V ZkPB5e2GOC+QV2cwOvFi5NKoyyZKHWsvtvdYv4163fF31jvkDnvjwM4q5keMnQ== 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 4VJ8854JqBz12qR; Mon, 15 Apr 2024 14:05:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43FE5PVE069758; Mon, 15 Apr 2024 14:05:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43FE5Pix069755; Mon, 15 Apr 2024 14:05:25 GMT (envelope-from git) Date: Mon, 15 Apr 2024 14:05:25 GMT Message-Id: <202404151405.43FE5Pix069755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 21aa4bf198da - stable/14 - sdt: Use designated initializers for various definitions 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 21aa4bf198da60abf584210c5cbca2bcb3621147 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=21aa4bf198da60abf584210c5cbca2bcb3621147 commit 21aa4bf198da60abf584210c5cbca2bcb3621147 Author: Mark Johnston AuthorDate: 2024-04-03 18:41:29 +0000 Commit: Mark Johnston CommitDate: 2024-04-15 14:05:13 +0000 sdt: Use designated initializers for various definitions No functional change intended. MFC after: 1 week (cherry picked from commit 3b795e641db7c1759d72aab9a77db8f87c8fbc45) --- sys/sys/sdt.h | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h index e059921b0e9e..ba3dcfa15762 100644 --- a/sys/sys/sdt.h +++ b/sys/sys/sdt.h @@ -147,22 +147,26 @@ SET_DECLARE(sdt_providers_set, struct sdt_provider); SET_DECLARE(sdt_probes_set, struct sdt_probe); SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); -#define SDT_PROVIDER_DEFINE(prov) \ - struct sdt_provider sdt_provider_##prov[1] = { \ - { #prov, { NULL, NULL }, 0, 0 } \ - }; \ - DATA_SET(sdt_providers_set, sdt_provider_##prov); +#define SDT_PROVIDER_DEFINE(_prov) \ + struct sdt_provider sdt_provider_##_prov[1] = { \ + [0] = { .name = #_prov }, \ + }; \ + DATA_SET(sdt_providers_set, sdt_provider_##_prov); #define SDT_PROVIDER_DECLARE(prov) \ extern struct sdt_provider sdt_provider_##prov[1] -#define SDT_PROBE_DEFINE(prov, mod, func, name) \ - struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] = { \ - { sizeof(struct sdt_probe), sdt_provider_##prov, \ - { NULL, NULL }, { NULL, NULL }, #mod, #func, #name, 0, 0, \ - NULL } \ - }; \ - DATA_SET(sdt_probes_set, sdt_##prov##_##mod##_##func##_##name); +#define SDT_PROBE_DEFINE(_prov, _mod, _func, _name) \ + struct sdt_probe sdt_##_prov##_##_mod##_##_func##_##_name[1] = {\ + [0] = { \ + .version = sizeof(struct sdt_probe), \ + .prov = sdt_provider_##_prov, \ + .mod = #_mod, \ + .func = #_func, \ + .name = #_name, \ + }, \ + }; \ + DATA_SET(sdt_probes_set, sdt_##_prov##_##_mod##_##_func##_##_name) #define SDT_PROBE_DECLARE(prov, mod, func, name) \ extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] @@ -178,12 +182,18 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); } \ } while (0) -#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) \ - static struct sdt_argtype sdta_##prov##_##mod##_##func##_##name##num[1] \ - = { { num, type, xtype, { NULL, NULL }, \ - sdt_##prov##_##mod##_##func##_##name } \ - }; \ - DATA_SET(sdt_argtypes_set, sdta_##prov##_##mod##_##func##_##name##num); +#define SDT_PROBE_ARGTYPE(_prov, _mod, _func, _name, _num, _type, _xtype) \ + static struct sdt_argtype \ + sdta_##_prov##_##_mod##_##_func##_##_name##_num[1] = { \ + [0] = { \ + .ndx = _num, \ + .type = _type, \ + .xtype = _xtype, \ + .probe = sdt_##_prov##_##_mod##_##_func##_##_name, \ + }, \ + }; \ + DATA_SET(sdt_argtypes_set, \ + sdta_##_prov##_##_mod##_##_func##_##_name##_num); #define SDT_PROBE_DEFINE0(prov, mod, func, name) \ SDT_PROBE_DEFINE(prov, mod, func, name)