From nobody Wed May 08 13:07:52 2024 X-Original-To: dev-commits-src-branches@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 4VZFn50sNhz5J64G; Wed, 08 May 2024 13:07:53 +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 4VZFn46029z4RQm; Wed, 8 May 2024 13:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715173672; 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=UQ5lcEoMJDWv7M/obx5L3hpbmXvpDWZaltTALlYVFB0=; b=gz+fG/QYRB+iVf/WiIZ5X7q9qcwVmvvKDkz4srecMznUrD9+cs+xLpfzWumNoTtQdRQu9N HnNEIR8Tx0mK3kXdxodGLKBySukv/j70tqQbwFxetzlQl2MkoRskESl6VycAaqfUnZRfqu E4IL8KWo51GTDb3mzRKQIzkX4owsv5N6Nk6u4DdH6D4XYUmp4/tccLoc/KGgyY5HBusoPM 6WadczXoRv6YK9YX+AO2Mt0shl4aC/p2L+THgKVkYKJdW8Xf7LZxDsk2mziXQlauLw+APk 65IEVw2WVPgPqBJNP5UcKz9uu5xF/Csgpb753pnvIBXJ8DOWSc6OAfPYVUg6Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715173672; a=rsa-sha256; cv=none; b=gqeNg7oeAhHkbxO4FywJzK4CSw8IcRTtQpjwvT8huT+UlcHHO+gHIeLUGoOv++doaJrEvU fuRNEoS5e0gcF41QyiF5xAqCnPbnKPKj/J3T9x2GX4jfsGHtspjtd57O7SREDi9zRMta0v TYrI/nTxHiIhJHBoo7wt2v5YdCTGLrcdXAGPqmSXCsafDj3Trzjszcx/g7QEcPg+Jmcc7P /huCYxQD+PFl2ik+W5Kms+F/vHk9F8bdUTNeK3J38AcD/W5TAsNdBSSPN4SorZt24J5d+a Hhjh5GvdhRtS6+Vy7QqCWTPtj0rBNttIB5Vz2d2Iqrw+K3NXx46bCPTrXrfQQw== 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=1715173672; 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=UQ5lcEoMJDWv7M/obx5L3hpbmXvpDWZaltTALlYVFB0=; b=IZXjfRgbzYGc0peBFCEipj1QurJl0kAFJ1b4LqBnrFOQk+kvDXsmlpOpcoI2++FQfFHe84 d2A2KKtrIILzQEldIxv3MJLlOBXJHI3biYWMezzAnQaUpQ1yTPnb8NSr+hTgsgn4N7EYVz +z+kaLOd9FGvZYijv8L0cAu2BKQrmDXHeYb6+4ukCQ2Zq+c4ra8cOrl93biJtultTohk73 XdYsha/zJDkJPRDnUL719BiWUcYHW/jwEpNCHebmMhxHwBiHwS6OsaJZy0yGOEIp5kj++B BmPNHxtcgMiaGBvgq8qUevey47WUL7I9CBGlQhQ91j8Kwoy40Xy7qdgF0A2Evw== 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 4VZFn45RWXzQYP; Wed, 8 May 2024 13:07:52 +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 448D7qZb080644; Wed, 8 May 2024 13:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448D7qBQ080641; Wed, 8 May 2024 13:07:52 GMT (envelope-from git) Date: Wed, 8 May 2024 13:07:52 GMT Message-Id: <202405081307.448D7qBQ080641@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: 7b65987885da - stable/14 - sdt: Add macros which expand to probe and provider structure names List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 7b65987885dad97b92628698562a6f3f139d2580 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7b65987885dad97b92628698562a6f3f139d2580 commit 7b65987885dad97b92628698562a6f3f139d2580 Author: Mark Johnston AuthorDate: 2024-05-01 11:17:29 +0000 Commit: Mark Johnston CommitDate: 2024-05-08 13:06:16 +0000 sdt: Add macros which expand to probe and provider structure names No functional change intended. MFC after: 1 week (cherry picked from commit 4afce4473db4f51acd034333b8506294b4fb61e6) --- sys/sys/sdt.h | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h index ba3dcfa15762..20be685ad081 100644 --- a/sys/sys/sdt.h +++ b/sys/sys/sdt.h @@ -147,36 +147,41 @@ 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_PROBE_NAME(prov, mod, func, name) \ + sdt_##prov##_##mod##_##func##_##name +#define _SDT_PROVIDER_NAME(prov) \ + sdt_provider_##prov + #define SDT_PROVIDER_DEFINE(_prov) \ - struct sdt_provider sdt_provider_##_prov[1] = { \ + struct sdt_provider _SDT_PROVIDER_NAME(_prov)[1] = { \ [0] = { .name = #_prov }, \ }; \ - DATA_SET(sdt_providers_set, sdt_provider_##_prov); + DATA_SET(sdt_providers_set, _SDT_PROVIDER_NAME(_prov)) -#define SDT_PROVIDER_DECLARE(prov) \ - extern struct sdt_provider sdt_provider_##prov[1] +#define SDT_PROVIDER_DECLARE(prov) \ + extern struct sdt_provider _SDT_PROVIDER_NAME(prov)[1] #define SDT_PROBE_DEFINE(_prov, _mod, _func, _name) \ - struct sdt_probe sdt_##_prov##_##_mod##_##_func##_##_name[1] = {\ + struct sdt_probe _SDT_PROBE_NAME(_prov, _mod, _func, _name)[1] = { \ [0] = { \ .version = sizeof(struct sdt_probe), \ - .prov = sdt_provider_##_prov, \ + .prov = _SDT_PROVIDER_NAME(_prov), \ .mod = #_mod, \ .func = #_func, \ .name = #_name, \ }, \ }; \ - DATA_SET(sdt_probes_set, sdt_##_prov##_##_mod##_##_func##_##_name) + DATA_SET(sdt_probes_set, _SDT_PROBE_NAME(_prov, _mod, _func, _name)) -#define SDT_PROBE_DECLARE(prov, mod, func, name) \ - extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] +#define SDT_PROBE_DECLARE(prov, mod, func, name) \ + extern struct sdt_probe _SDT_PROBE_NAME(prov, mod, func, name)[1] #define SDT_PROBES_ENABLED() __predict_false(sdt_probes_enabled) #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do { \ if (SDT_PROBES_ENABLED()) { \ - if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id)) \ - (*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id, \ + if (__predict_false(_SDT_PROBE_NAME(prov, mod, func, name)->id)) \ + (*sdt_probe_func)(_SDT_PROBE_NAME(prov, mod, func, name)->id, \ (uintptr_t) arg0, (uintptr_t) arg1, (uintptr_t) arg2, \ (uintptr_t) arg3, (uintptr_t) arg4); \ } \ @@ -189,7 +194,7 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); .ndx = _num, \ .type = _type, \ .xtype = _xtype, \ - .probe = sdt_##_prov##_##_mod##_##_func##_##_name, \ + .probe = _SDT_PROBE_NAME(_prov, _mod, _func, _name), \ }, \ }; \ DATA_SET(sdt_argtypes_set, \ @@ -322,21 +327,21 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) #define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) \ do { \ - if (sdt_##prov##_##mod##_##func##_##name->id) \ + if (_SDT_PROBE_NAME(prov, mod, func, name)->id) \ (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ uintptr_t, uintptr_t, uintptr_t))sdt_probe_func)( \ - sdt_##prov##_##mod##_##func##_##name->id, \ + _SDT_PROBE_NAME(prov, mod, func, name)->id, \ (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5);\ } while (0) #define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ arg6) \ do { \ - if (sdt_##prov##_##mod##_##func##_##name->id) \ + if (_SDT_PROBE_NAME(prov, mod, func, name)->id) \ (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ uintptr_t, uintptr_t, uintptr_t, uintptr_t)) \ sdt_probe_func)( \ - sdt_##prov##_##mod##_##func##_##name->id, \ + _SDT_PROBE_NAME(prov, mod, func, name)->id, \ (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5, \ (uintptr_t)arg6); \