*
*/
-#include <common/credentials.h>
-#include <common/error.h>
-#include <common/hashtable/hashtable.h>
-#include <common/hashtable/utils.h>
-#include <common/macros.h>
-#include <common/mi-lttng.h>
-#include <common/optional.h>
-#include <common/payload-view.h>
-#include <common/payload.h>
-#include <common/runas.h>
-#include <common/string-utils/string-utils.h>
-#include <lttng/event-rule/event-rule-internal.h>
-#include <lttng/event-rule/log4j-logging-internal.h>
+#include <common/credentials.hpp>
+#include <common/error.hpp>
+#include <common/hashtable/hashtable.hpp>
+#include <common/hashtable/utils.hpp>
+#include <common/macros.hpp>
+#include <common/mi-lttng.hpp>
+#include <common/optional.hpp>
+#include <common/payload-view.hpp>
+#include <common/payload.hpp>
+#include <common/runas.hpp>
+#include <common/string-utils/string-utils.hpp>
+#include <lttng/event-rule/event-rule-internal.hpp>
+#include <lttng/event-rule/log4j-logging-internal.hpp>
#include <lttng/event.h>
#include <lttng/log-level-rule.h>
return;
}
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
lttng_log_level_rule_destroy(log4j_logging->log_level_rule);
free(log4j_logging->pattern);
goto end;
}
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
/* Required field. */
if (!log4j_logging->pattern) {
header_offset = payload->buffer.size;
DBG("Serializing log4j_logging event rule.");
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
pattern_len = strlen(log4j_logging->pattern) + 1;
bool is_equal = false;
struct lttng_event_rule_log4j_logging *a, *b;
- a = container_of(_a, struct lttng_event_rule_log4j_logging, parent);
- b = container_of(_b, struct lttng_event_rule_log4j_logging, parent);
+ a = lttng::utils::container_of(_a, <tng_event_rule_log4j_logging::parent);
+ b = lttng::utils::container_of(_b, <tng_event_rule_log4j_logging::parent);
/* Quick checks. */
LTTNG_ASSERT(rule);
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
status = lttng_event_rule_log4j_logging_get_filter(rule, &filter);
if (status == LTTNG_EVENT_RULE_STATUS_UNSET) {
struct lttng_event_rule_log4j_logging *log4j_logging;
LTTNG_ASSERT(rule);
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
return log4j_logging->internal_filter.filter;
}
struct lttng_event_rule_log4j_logging *log4j_logging;
LTTNG_ASSERT(rule);
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
return log4j_logging->internal_filter.bytecode;
}
static enum lttng_event_rule_generate_exclusions_status
lttng_event_rule_log4j_logging_generate_exclusions(
- const struct lttng_event_rule *rule,
+ const struct lttng_event_rule *rule __attribute__((unused)),
struct lttng_event_exclusion **_exclusions)
{
/* Unsupported. */
{
unsigned long hash;
struct lttng_event_rule_log4j_logging *tp_rule =
- container_of(rule, typeof(*tp_rule), parent);
+ lttng::utils::container_of(rule, <tng_event_rule_log4j_logging::parent);
hash = hash_key_ulong((void *) LTTNG_EVENT_RULE_TYPE_LOG4J_LOGGING,
lttng_ht_seed);
enum lttng_event_rule_status status;
const struct lttng_log_level_rule *log_level_rule;
- log4j_logging = container_of(
- rule, const struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
- local_event = (lttng_event *) zmalloc(sizeof(*local_event));
+ local_event = zmalloc<lttng_event>();
if (!local_event) {
goto error;
}
struct lttng_event_rule_log4j_logging *tp_rule;
enum lttng_event_rule_status status;
- tp_rule = (lttng_event_rule_log4j_logging *) zmalloc(sizeof(struct lttng_event_rule_log4j_logging));
+ tp_rule = zmalloc<lttng_event_rule_log4j_logging>();
if (!tp_rule) {
goto end;
}
goto end;
}
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
pattern_copy = strdup(pattern);
if (!pattern_copy) {
status = LTTNG_EVENT_RULE_STATUS_ERROR;
goto end;
}
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
if (!log4j_logging->pattern) {
status = LTTNG_EVENT_RULE_STATUS_UNSET;
goto end;
goto end;
}
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
expression_copy = strdup(expression);
if (!expression_copy) {
PERROR("Failed to copy filter expression");
goto end;
}
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
if (!log4j_logging->filter_expression) {
status = LTTNG_EVENT_RULE_STATUS_UNSET;
goto end;
return status;
}
-static bool log_level_rule_valid(const struct lttng_log_level_rule *rule)
+static bool log_level_rule_valid(
+ const struct lttng_log_level_rule *rule __attribute__((unused)))
{
/*
* For both LOG4J custom log level are possible and can
goto end;
}
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
if (!log_level_rule_valid(log_level_rule)) {
status = LTTNG_EVENT_RULE_STATUS_INVALID;
goto end;
}
- log4j_logging = container_of(
- rule, struct lttng_event_rule_log4j_logging, parent);
+ log4j_logging = lttng::utils::container_of(
+ rule, <tng_event_rule_log4j_logging::parent);
if (log4j_logging->log_level_rule == NULL) {
status = LTTNG_EVENT_RULE_STATUS_UNSET;
goto end;