From nobody Wed Apr 03 19:21:48 2024 X-Original-To: dev-commits-src-main@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 4V8vkh6JWgz5FhX6; Wed, 3 Apr 2024 19:21:48 +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 4V8vkh3SS9z4JZy; Wed, 3 Apr 2024 19:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712172108; 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=AFoPs5uA1tmSh1yXfr7awKfbyzpFq8kHqVjOd6n5dqc=; b=pRyzlRmxXZz1FGY+osWc7C2eQiELcCQMlkEqorncrPBjRd6WUJIcl4hE0sYdrCwxPN+YbN 3kYOC9QriQw3ryPkG5CCkB7WuADwGxnep0u6am6rmNueqng77to1OUiCkYxRt67dpCbvSG q7vhTy5MMtlIJAQcjSGjaQ0/KxejuZ4TAOJagEOHQZP0aUDbB/ytJ8UkCqaRke1o7VKhCO mk5WGxPEJTepb8e7ADkGC7J5njbJEbxW0QPnaImGyagIxQjBu4RVJbBdwsQH0safTUkG3+ +0TZpwe9p8rQatoFQDFOZODrgbm4vY+MKPaWNPZdRvhW3P0W6wZQB+gTW0XEiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712172108; a=rsa-sha256; cv=none; b=Fp+jXDLB04saC7PcSL+Oqeht25QCXZIzbIBHUHueBRxGuEkfyQISoY01yanbxbGTsGOnGX qGOyG+jmtbav5rGY0XtpAqgoDQiY2iBdcXHfFAPN2KyL58Wx3w6uAkvzCQuWG8X+rG15Za 7seusy6umZAavwYXMzF+sZPuwyUMmBFndNZSJhBx3w7skZesNpQXuBxtmSFstt9SJmjXwC iWiydhIC/mGKSusa5o/x6+HfpplErB/6kNWswg6NiYP+QsZc6sAlpK9MNmSsCrVftFiID3 1milsn1T7yHADiw7+B8uvE4n6W0l794OFq1G6/dZDJ4IUWIBx5dFrc8w9nIIIA== 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=1712172108; 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=AFoPs5uA1tmSh1yXfr7awKfbyzpFq8kHqVjOd6n5dqc=; b=o4YtqSuP/2M7YmyOoOf51xwRTIYpOb5kkVoB2ei/0/aBBa0jBtK5wao8wIepw4fXFj4uSU EWCVnqvFDQKKlGncuggKwzft8Z5LesR/W94+KJLMtkVb1wGYdlT5n84pxcUfj6wf5pu7tc JzyGxcfBkmZAAHNtra2EHxeEJ46KgzuSpkklyj9jL0++W0Wfd1RzirxYbmrpWfYlgwxnyJ 9NEReAH7sMwYF2c6q7O3ApbfwIIOioYZ7GVl7o28sQqPZoig2TsQ4hSnkDxWKC8QBkG8n8 aPEkH0ZZomFZz3Fg0N9htHmlfuhEp01A23lrdh0J1QKXBXl7/g22JjMJmHGWpA== 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 4V8vkh33dSzlcR; Wed, 3 Apr 2024 19:21:48 +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 433JLmq3016390; Wed, 3 Apr 2024 19:21:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 433JLm3m016387; Wed, 3 Apr 2024 19:21:48 GMT (envelope-from git) Date: Wed, 3 Apr 2024 19:21:48 GMT Message-Id: <202404031921.433JLm3m016387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 3b795e641db7 - main - sdt: Use designated initializers for various definitions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 3b795e641db7c1759d72aab9a77db8f87c8fbc45 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3b795e641db7c1759d72aab9a77db8f87c8fbc45 commit 3b795e641db7c1759d72aab9a77db8f87c8fbc45 Author: Mark Johnston AuthorDate: 2024-04-03 18:41:29 +0000 Commit: Mark Johnston CommitDate: 2024-04-03 19:21:38 +0000 sdt: Use designated initializers for various definitions No functional change intended. MFC after: 1 week --- 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)