diff --git a/include/spdk/trace_parser.h b/include/spdk/trace_parser.h index 3aefd9f55c..b59071b7da 100644 --- a/include/spdk/trace_parser.h +++ b/include/spdk/trace_parser.h @@ -83,6 +83,15 @@ struct spdk_trace_parser *spdk_trace_parser_init(const struct spdk_trace_parser_ */ void spdk_trace_parser_cleanup(struct spdk_trace_parser *parser); +/** + * Return trace flags describing the traces. + * + * \param parser Parser object to be used. + * + * \return Pointer to the trace flags. + */ +const struct spdk_trace_flags *spdk_trace_parser_get_flags(const struct spdk_trace_parser *parser); + #ifdef __cplusplus } #endif diff --git a/lib/trace_parser/spdk_trace_parser.map b/lib/trace_parser/spdk_trace_parser.map index 1f1c1c5696..ae58db77a5 100644 --- a/lib/trace_parser/spdk_trace_parser.map +++ b/lib/trace_parser/spdk_trace_parser.map @@ -4,6 +4,7 @@ # public functions spdk_trace_parser_init; spdk_trace_parser_cleanup; + spdk_trace_parser_get_flags; local: *; }; diff --git a/lib/trace_parser/trace.cpp b/lib/trace_parser/trace.cpp index 8874b4770e..2986ee4255 100644 --- a/lib/trace_parser/trace.cpp +++ b/lib/trace_parser/trace.cpp @@ -34,6 +34,7 @@ #include "spdk/stdinc.h" #include "spdk/log.h" #include "spdk/trace_parser.h" +#include "spdk/util.h" #include #include @@ -43,6 +44,7 @@ struct spdk_trace_parser { ~spdk_trace_parser(); spdk_trace_parser(const spdk_trace_parser &) = delete; spdk_trace_parser &operator=(const spdk_trace_parser &) = delete; + const spdk_trace_flags *flags() const { return &_histories->flags; } private: bool init(const spdk_trace_parser_opts *opts); void cleanup(); @@ -158,3 +160,9 @@ spdk_trace_parser_cleanup(struct spdk_trace_parser *parser) { delete parser; } + +const struct spdk_trace_flags * +spdk_trace_parser_get_flags(const struct spdk_trace_parser *parser) +{ + return parser->flags(); +}