Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys sys/sdt.h: Whitespace cleanup (and internal macro se...



details:   https://anonhg.NetBSD.org/src/rev/a1050d15d93f
branches:  trunk
changeset: 374525:a1050d15d93f
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Apr 30 08:45:39 2023 +0000

description:
sys/sdt.h: Whitespace cleanup (and internal macro semicolon tidying).

No functional change intended.

diffstat:

 sys/sys/sdt.h |  183 +++++++++++++++++++++++++++++++--------------------------
 1 files changed, 99 insertions(+), 84 deletions(-)

diffs (250 lines):

diff -r f7d2113ca1aa -r a1050d15d93f sys/sys/sdt.h
--- a/sys/sys/sdt.h     Sun Apr 30 08:45:30 2023 +0000
+++ b/sys/sys/sdt.h     Sun Apr 30 08:45:39 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdt.h,v 1.18 2023/04/30 08:45:30 riastradh Exp $       */
+/*     $NetBSD: sdt.h,v 1.19 2023/04/30 08:45:39 riastradh Exp $       */
 
 /*-
  * Copyright 2006-2008 John Birrell <jb%FreeBSD.org@localhost>
@@ -137,8 +137,8 @@
     arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4)
 #define        SDT_PROBE_DEFINE6_XLATE(prov, mod, func, name, arg0, xarg0,     \
     arg1,  xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5)
-#define        SDT_PROBE_DEFINE7_XLATE(prov, mod, func, name, arg0, xarg0,     \
-    arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6,     \
+#define        SDT_PROBE_DEFINE7_XLATE(prov, mod, func, name, arg0, xarg0,           \
+    arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6,    \
     xarg6)
 
 #define        SDT_VAR_DECL(decl)                                      __nothing
@@ -148,47 +148,57 @@
 #define        DTRACE_PROBE2(name, type0, arg0, type1, arg1)           __nothing
 #define        DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2)            \
        __nothing
-#define        DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3)\
+#define        DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3,     \
+    arg3)                                                                    \
        __nothing
-#define        DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3,\
-    type4, arg4)                                                             \
+#define        DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3,     \
+    arg3, type4, arg4)                                                       \
        __nothing
 
 #else
 
-#define SDT_PROVIDER_DEFINE(prov)                                              \
-       struct sdt_provider sdt_provider_##prov[1] = {                          \
-               { #prov, { NULL, NULL }, 0, 0 }                                 \
-       };                                                                      \
+#define SDT_PROVIDER_DEFINE(prov)                                            \
+       struct sdt_provider sdt_provider_##prov[1] = {                        \
+               { #prov, { NULL, NULL }, 0, 0 }                               \
+       };                                                                    \
        __link_set_add_data(sdt_providers_set, sdt_provider_##prov);
 
-#define SDT_PROVIDER_DECLARE(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 }                                                      \
-       };                                                                      \
-       __link_set_add_data(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] = {          \
+               {                                                             \
+                       sizeof(struct sdt_probe), sdt_provider_##prov,        \
+                       { NULL, NULL }, { NULL, NULL },                       \
+                       #mod, #func, #name, 0, 0,                             \
+                       NULL,                                                 \
+               }                                                             \
+       };                                                                    \
+       __link_set_add_data(sdt_probes_set,                                   \
+           sdt_##prov##_##mod##_##func##_##name);
 
-#define SDT_PROBE_DECLARE(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(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do {    \
-       if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))          \
-               (*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id,     \
-                   (uintptr_t) (arg0), (uintptr_t) (arg1), (uintptr_t) (arg2), \
-                   (uintptr_t) (arg3), (uintptr_t) (arg4));                    \
+#define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do    \
+{                                                                            \
+       if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))        \
+               (*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id,   \
+                   (uintptr_t)(arg0), (uintptr_t)(arg1), (uintptr_t)(arg2),  \
+                   (uintptr_t)(arg3), (uintptr_t)(arg4));                    \
 } 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 }                              \
-       };                                                                      \
-       __link_set_add_data(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]\
+       = {                                                                   \
+               {                                                             \
+                       num, type, xtype, { NULL, NULL },                     \
+                       sdt_##prov##_##mod##_##func##_##name,                 \
+               }                                                             \
+       };                                                                    \
+       __link_set_add_data(sdt_argtypes_set,                                 \
+               sdta_##prov##_##mod##_##func##_##name##num);
 
 #define        SDT_PROBE_DEFINE0(prov, mod, func, name)                        \
        SDT_PROBE_DEFINE(prov, mod, func, name)
@@ -215,7 +225,8 @@
        SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL);        \
        SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL)
 
-#define        SDT_PROBE_DEFINE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \
+#define        SDT_PROBE_DEFINE5(prov, mod, func, name, arg0, arg1, arg2, arg3,\
+    arg4)                                                              \
        SDT_PROBE_DEFINE(prov, mod, func, name);                        \
        SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL);        \
        SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL);        \
@@ -316,77 +327,81 @@
 #define        SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \
        SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
 /* XXX: void * function casts */
-#define        SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5)  \
-       do {                                                                   \
-               if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id)) \
-                       __FPTRCAST(void (*)(uint32_t, uintptr_t, uintptr_t,    \
-                           uintptr_t, uintptr_t, uintptr_t, uintptr_t),       \
-                           sdt_probe_func)(                                   \
-                           sdt_##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 (__predict_false(sdt_##prov##_##mod##_##func##_##name->id)) \
-                       __FPTRCAST(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,          \
-                           (uintptr_t)(arg0), (uintptr_t)(arg1),              \
-                           (uintptr_t)(arg2), (uintptr_t)(arg3),              \
-                           (uintptr_t)(arg4), (uintptr_t)(arg5),              \
-                           (uintptr_t)(arg6));                                \
-       } while (0)
+#define        SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4,       \
+    arg5)      do                                                            \
+{                                                                            \
+       if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))        \
+               __FPTRCAST(void (*)(uint32_t, uintptr_t, uintptr_t,           \
+                       uintptr_t, uintptr_t, uintptr_t, uintptr_t),          \
+                   sdt_probe_func)(                                          \
+                       sdt_##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 (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))        \
+               __FPTRCAST(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,             \
+                       (uintptr_t)(arg0), (uintptr_t)(arg1),                 \
+                       (uintptr_t)(arg2), (uintptr_t)(arg3),                 \
+                       (uintptr_t)(arg4), (uintptr_t)(arg5),                 \
+                       (uintptr_t)(arg6));                                   \
+} while (0)
 
 #define        SDT_VAR_DECL(decl)      decl ;
 
-#define        DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4)     do { \
-       static SDT_PROBE_DEFINE(sdt, , , name);                              \
-       SDT_PROBE(sdt, , , name, arg0, arg1, arg2, arg3, arg4);
-#define DTRACE_PROBE_IMPL_END  } while (0)
+#define        DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4)     do    \
+{                                                                            \
+       static SDT_PROBE_DEFINE(sdt, , , name);                               \
+       SDT_PROBE(sdt, , , name, arg0, arg1, arg2, arg3, arg4)
+#define DTRACE_PROBE_IMPL_END                                                \
+} while (0)
 
 #define DTRACE_PROBE(name)                                             \
-       DTRACE_PROBE_IMPL_START(name, 0, 0, 0, 0, 0)                    \
-       DTRACE_PROBE_IMPL_END
+       DTRACE_PROBE_IMPL_START(name, 0, 0, 0, 0, 0);                   \
+       DTRACE_PROBE_IMPL_END;
 
 #define DTRACE_PROBE1(name, type0, arg0)                               \
-       DTRACE_PROBE_IMPL_START(name, arg0, 0, 0, 0, 0)                 \
+       DTRACE_PROBE_IMPL_START(name, arg0, 0, 0, 0, 0);                \
        SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL);              \
-       DTRACE_PROBE_IMPL_END
+       DTRACE_PROBE_IMPL_END;
 
 #define DTRACE_PROBE2(name, type0, arg0, type1, arg1)                  \
-       DTRACE_PROBE_IMPL_START(name, arg0, arg1, 0, 0, 0)              \
+       DTRACE_PROBE_IMPL_START(name, arg0, arg1, 0, 0, 0);             \
        SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL);              \
        SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL);              \
-       DTRACE_PROBE_IMPL_END
+       DTRACE_PROBE_IMPL_END;
 
 #define DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2)     \
-       DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, 0, 0)           \
+       DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, 0, 0);          \
        SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL);              \
        SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL);              \
        SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL);              \
-       DTRACE_PROBE_IMPL_END
-
-#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3)        \
-       DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, 0)        \
-       SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL);              \
-       SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL);              \
-       SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL);              \
-       SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL);              \
-       DTRACE_PROBE_IMPL_END
+       DTRACE_PROBE_IMPL_END;
 
-#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3,        \
-    type4, arg4)                                                               \
-       DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4)     \
-       SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL);              \
-       SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL);              \
-       SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL);              \
-       SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL);              \
-       SDT_PROBE_ARGTYPE(sdt, , , name, 4, #type4, NULL);              \
-       DTRACE_PROBE_IMPL_END
+#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3,     \
+    arg3)                                                                    \
+       DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, 0);             \
+       SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL);                    \
+       SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL);                    \
+       SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL);                    \
+       SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL);                    \
+       DTRACE_PROBE_IMPL_END;
+
+#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3,     \
+    arg3, type4, arg4)                                                       \
+       DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4);          \
+       SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL);                    \
+       SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL);                    \
+       SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL);                    \
+       SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL);                    \
+       SDT_PROBE_ARGTYPE(sdt, , , name, 4, #type4, NULL);                    \
+       DTRACE_PROBE_IMPL_END;
 
 #endif /* KDTRACE_HOOKS */
 



Home | Main Index | Thread Index | Old Index