state = &kernel_state;
break;
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
state = &ust_state;
break;
default:
#ifdef HAVE_LIBLTTNG_UST_CTL
switch (lttng_trigger_get_underlying_domain_type_restriction(trigger)) {
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
pthread_mutex_lock(&the_event_notifier_counter.lock);
the_event_notifier_counter.count++;
if (the_event_notifier_counter.count == 1) {
return event_notifier_error_accounting_kernel_get_count(
trigger, count);
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
#ifdef HAVE_LIBLTTNG_UST_CTL
return event_notifier_error_accounting_ust_get_count(trigger,
count);
case LTTNG_DOMAIN_KERNEL:
return event_notifier_error_accounting_kernel_clear(trigger);
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
#ifdef HAVE_LIBLTTNG_UST_CTL
return event_notifier_error_accounting_ust_clear(trigger);
#else
break;
#ifdef HAVE_LIBLTTNG_UST_CTL
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
state = &ust_state;
pthread_mutex_lock(&the_event_notifier_counter.lock);
if [[ -z "$run_test" ]]; then
NUM_TESTS=1
else
- NUM_TESTS=$(((194 * ${#python_versions[@]})+2))
+ NUM_TESTS=$(((199 * ${#python_versions[@]})+2))
fi
source $TESTDIR/utils/utils.sh
fi
}
+function test_python_trigger_notify_action
+{
+ uid=$(id --user)
+ tmp_expected_stdout=$(mktemp -t test_list_triggers_python_cli_expected_stdout.XXXXXX)
+
+ diag "Test Python trigger with notify action"
+
+ lttng_add_trigger_ok "my_python_trigger" \
+ --condition event-rule-matches --domain=python --action notify
+
+ cat > "${tmp_expected_stdout}" <<- EOF
+ - name: my_python_trigger
+ owner uid: ${uid}
+ condition: event rule matches
+ rule: * (type: tracepoint, domain: python)
+ actions:
+ notify
+ errors: none
+ errors: none
+ EOF
+
+ list_triggers_matches_ok "Python trigger listing" "${tmp_expected_stdout}"
+
+ lttng_remove_trigger_ok "my_python_trigger"
+
+ rm -f "${tmp_expected_stdout}"
+}
+
plan_tests $NUM_TESTS
print_test_banner "$TEST_DESC"
test_python_after_start
test_python_multi_session
test_python_filter_loglevel
+ test_python_trigger_notify_action
)