]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: trace: do not declare trace_registre_source() inline
authorWilly Tarreau <w@1wt.eu>
Wed, 2 Mar 2022 13:53:00 +0000 (14:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Mar 2022 13:53:00 +0000 (14:53 +0100)
This one is referenced in initcalls by its pointer, it makes no sense
to declare it inline. At best it causes function duplication, at worst
it doesn't build on older compilers.

include/haproxy/trace.h
src/trace.c

index 50857a0716b45e06ca2e7af943b198e9fd2c74e9..caf82a66413d1b72f2730c1fb54e3beaa4a22fb4 100644 (file)
@@ -130,6 +130,8 @@ void __trace(enum trace_level level, uint64_t mask, struct trace_source *src,
                         const void *a1, const void *a2, const void *a3, const void *a4),
              const struct ist msg);
 
+void trace_register_source(struct trace_source *source);
+
 /* return a single char to describe a trace state */
 static inline char trace_state_char(enum trace_state st)
 {
@@ -144,21 +146,6 @@ static inline char trace_event_char(uint64_t conf, uint64_t ev)
        return (conf & ev) ? '+' : '-';
 }
 
-/* registers trace source <source>. Modifies the list element!
- * The {start,pause,stop,report} events are not changed so the source may
- * preset them.
- */
-static inline void trace_register_source(struct trace_source *source)
-{
-       source->lockon = TRACE_LOCKON_NOTHING;
-       source->level = TRACE_LEVEL_USER;
-       source->verbosity = 1;
-       source->sink = NULL;
-       source->state = TRACE_STATE_STOPPED;
-       source->lockon_ptr = NULL;
-       LIST_APPEND(&trace_sources, &source->source_link);
-}
-
 #endif /* _HAPROXY_TRACE_H */
 
 /*
index 15e01487fd6f21931993e9da6a9c35ff8dfa5608..8a39854066885e6d08f629b05215a81f9a0b640a 100644 (file)
@@ -265,6 +265,21 @@ void __trace(enum trace_level level, uint64_t mask, struct trace_source *src,
        }
 }
 
+/* registers trace source <source>. Modifies the list element!
+ * The {start,pause,stop,report} events are not changed so the source may
+ * preset them.
+ */
+void trace_register_source(struct trace_source *source)
+{
+       source->lockon = TRACE_LOCKON_NOTHING;
+       source->level = TRACE_LEVEL_USER;
+       source->verbosity = 1;
+       source->sink = NULL;
+       source->state = TRACE_STATE_STOPPED;
+       source->lockon_ptr = NULL;
+       LIST_APPEND(&trace_sources, &source->source_link);
+}
+
 struct trace_source *trace_find_source(const char *name)
 {
        struct trace_source *src;