extern struct list trace_sources;
extern THREAD_LOCAL struct buffer trace_buf;
-void __trace(uint64_t mask, struct trace_source *src, const struct ist where, const struct ist msg);
+void __trace(enum trace_level level, uint64_t mask, struct trace_source *src, const struct ist where, const struct ist msg);
/* return a single char to describe a trace state */
static inline char trace_state_char(enum trace_state st)
}
/* sends a trace for the given source */
-static inline void trace(uint64_t mask, struct trace_source *src, const struct ist where, const struct ist msg)
+static inline void trace(enum trace_level level, uint64_t mask, struct trace_source *src, const struct ist where, const struct ist msg)
{
if (unlikely(src->state != TRACE_STATE_STOPPED))
- __trace(mask, src, where, msg);
+ __trace(level, mask, src, where, msg);
}
#endif /* _PROTO_TRACE_H */
REGISTER_PER_THREAD_FREE(free_trace_buffers_per_thread);
/* write a message for the given trace source */
-void __trace(uint64_t mask, struct trace_source *src, const struct ist where, const struct ist msg)
+void __trace(enum trace_level level, uint64_t mask, struct trace_source *src, const struct ist where, const struct ist msg)
{
struct ist line[8];
/* TODO: add check of lockon+lockon_ptr here, return if no match */
/* here the trace is running and is tracking a desired item */
- if ((src->report_events & mask) == 0)
+ if ((src->report_events & mask) == 0 || level > src->level)
goto end;
/* log the logging location truncated to 10 chars from the right so that