X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist_triggers.cpp;h=03e567c86d449c317f91df4fd1dd67de04dc014a;hb=HEAD;hp=d3961539083eb1cb908cee896a4ec2f4c2b1d1d4;hpb=cd9adb8b829564212158943a0d279bb35322ab30;p=lttng-tools.git diff --git a/src/bin/lttng/commands/list_triggers.cpp b/src/bin/lttng/commands/list_triggers.cpp index d39615390..58262a9e3 100644 --- a/src/bin/lttng/commands/list_triggers.cpp +++ b/src/bin/lttng/commands/list_triggers.cpp @@ -7,17 +7,19 @@ #include "../command.hpp" #include "common/argpar-utils/argpar-utils.hpp" -#include "common/argpar/argpar.h" #include "common/dynamic-array.hpp" #include "common/mi-lttng.hpp" +#include "lttng/action/list-internal.hpp" +#include "vendor/argpar/argpar.h" -#include /* For lttng_condition_type_str(). */ #include "lttng/condition/condition-internal.hpp" #include "lttng/condition/event-rule-matches-internal.hpp" #include "lttng/condition/event-rule-matches.h" + /* For lttng_domain_type_str(). */ #include "lttng/domain-internal.hpp" + /* For lttng_event_rule_kernel_syscall_emission_site_str() */ #include "../loglevel.hpp" #include "lttng/event-rule/kernel-syscall-internal.hpp" @@ -133,6 +135,9 @@ static const char *get_pretty_loglevel_name(enum lttng_event_rule_type event_rul case LTTNG_EVENT_RULE_TYPE_LOG4J_LOGGING: name = loglevel_log4j_value_to_name(loglevel); break; + case LTTNG_EVENT_RULE_TYPE_LOG4J2_LOGGING: + name = loglevel_log4j2_value_to_name(loglevel); + break; case LTTNG_EVENT_RULE_TYPE_JUL_LOGGING: name = loglevel_jul_value_to_name(loglevel); break; @@ -248,7 +253,7 @@ static void print_event_rule_kernel_tracepoint(const struct lttng_event_rule *ev static void print_event_rule_logging(const struct lttng_event_rule *event_rule) { enum lttng_event_rule_status event_rule_status; - enum lttng_event_rule_type event_rule_type = lttng_event_rule_get_type(event_rule); + const lttng_event_rule_type event_rule_type = lttng_event_rule_get_type(event_rule); const char *pattern; const char *filter; int log_level; @@ -272,6 +277,12 @@ static void print_event_rule_logging(const struct lttng_event_rule *event_rule) logging_get_log_level_rule = lttng_event_rule_log4j_logging_get_log_level_rule; type_str = "log4j"; break; + case LTTNG_EVENT_RULE_TYPE_LOG4J2_LOGGING: + logging_get_name_pattern = lttng_event_rule_log4j2_logging_get_name_pattern; + logging_get_filter = lttng_event_rule_log4j2_logging_get_filter; + logging_get_log_level_rule = lttng_event_rule_log4j2_logging_get_log_level_rule; + type_str = "log4j2"; + break; case LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING: logging_get_name_pattern = lttng_event_rule_python_logging_get_name_pattern; logging_get_filter = lttng_event_rule_python_logging_get_filter; @@ -511,6 +522,7 @@ static void print_event_rule(const struct lttng_event_rule *event_rule) break; case LTTNG_EVENT_RULE_TYPE_JUL_LOGGING: case LTTNG_EVENT_RULE_TYPE_LOG4J_LOGGING: + case LTTNG_EVENT_RULE_TYPE_LOG4J2_LOGGING: case LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING: print_event_rule_logging(event_rule); break; @@ -1022,21 +1034,13 @@ static void print_one_trigger(const struct lttng_trigger *trigger) action = lttng_trigger_get_const_action(trigger); action_type = lttng_action_get_type(action); if (action_type == LTTNG_ACTION_TYPE_LIST) { - unsigned int count, i; - enum lttng_action_status action_status; + uint64_t action_path_index = 0; MSG(" actions:"); - - action_status = lttng_action_list_get_count(action, &count); - LTTNG_ASSERT(action_status == LTTNG_ACTION_STATUS_OK); - - for (i = 0; i < count; i++) { - const uint64_t action_path_index = i; - const struct lttng_action *subaction = - lttng_action_list_get_at_index(action, i); - + for (auto subaction : lttng::ctl::const_action_list_view(action)) { _MSG(" "); print_one_action(trigger, subaction, &action_path_index, 1); + action_path_index++; } } else { _MSG(" action:");