X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng%2Fevent-rule%2Fjul-logging-internal.hpp;fp=include%2Flttng%2Fevent-rule%2Fjul-logging-internal.hpp;h=b769f0f8094215e3d309fd6b26765c28eab96ecc;hp=0000000000000000000000000000000000000000;hb=c9e313bc594f40a86eed237dce222c0fc99c957f;hpb=4878de5c7deb512bbdac4fdfc498907efa06fb7c diff --git a/include/lttng/event-rule/jul-logging-internal.hpp b/include/lttng/event-rule/jul-logging-internal.hpp new file mode 100644 index 000000000..b769f0f80 --- /dev/null +++ b/include/lttng/event-rule/jul-logging-internal.hpp @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2021 Jonathan Rajotte + * + * SPDX-License-Identifier: LGPL-2.1-only + * + */ + +#ifndef LTTNG_EVENT_RULE_JUL_LOGGING_INTERNAL_H +#define LTTNG_EVENT_RULE_JUL_LOGGING_INTERNAL_H + +#include +#include +#include +#include +#include +#include +#include + +struct lttng_event_rule_jul_logging { + struct lttng_event_rule parent; + + /* Name pattern. */ + char *pattern; + + /* Filter. */ + char *filter_expression; + + /* Log level. */ + struct lttng_log_level_rule *log_level_rule; + + /* internal use only. */ + struct { + char *filter; + struct lttng_bytecode *bytecode; + } internal_filter; +}; + +struct lttng_event_rule_jul_logging_comm { + /* Includes terminator `\0`. */ + uint32_t pattern_len; + /* Includes terminator `\0`. */ + uint32_t filter_expression_len; + /* enum lttng_log_level_rule_comm + payload if any */ + uint32_t log_level_rule_len; + /* + * Payload is composed of, in that order: + * - pattern (null terminated), + * - filter expression (null terminated), + * - log level rule serialized object, + */ + char payload[]; +} LTTNG_PACKED; + +ssize_t lttng_event_rule_jul_logging_create_from_payload( + struct lttng_payload_view *view, + struct lttng_event_rule **rule); + +#endif /* LTTNG_EVENT_RULE_JUL_LOGGING_INTERNAL_H */