ARGPAR_OPT_DESCR_SENTINEL,
};
+static void print_condition_session_consumed_size(
+ const struct lttng_condition *condition)
+{
+ enum lttng_condition_status condition_status;
+ const char *session_name;
+ uint64_t threshold;
+
+ condition_status =
+ lttng_condition_session_consumed_size_get_session_name(
+ condition, &session_name);
+ assert(condition_status == LTTNG_CONDITION_STATUS_OK);
+
+ lttng_condition_session_consumed_size_get_threshold(
+ condition, &threshold);
+ assert(condition_status == LTTNG_CONDITION_STATUS_OK);
+
+ MSG(" session name: %s", session_name);
+ MSG(" threshold: %" PRIu64 " bytes", threshold);
+}
+
+static void print_condition_buffer_usage(
+ const struct lttng_condition *condition)
+{
+ enum lttng_condition_status condition_status;
+ const char *session_name, *channel_name;
+ enum lttng_domain_type domain_type;
+ uint64_t threshold;
+
+ condition_status = lttng_condition_buffer_usage_get_session_name(
+ condition, &session_name);
+ assert(condition_status == LTTNG_CONDITION_STATUS_OK);
+
+ condition_status = lttng_condition_buffer_usage_get_channel_name(
+ condition, &channel_name);
+ assert(condition_status == LTTNG_CONDITION_STATUS_OK);
+
+ condition_status = lttng_condition_buffer_usage_get_domain_type(
+ condition, &domain_type);
+ assert(condition_status == LTTNG_CONDITION_STATUS_OK);
+
+ MSG(" session name: %s", session_name);
+ MSG(" channel name: %s", channel_name);
+ MSG(" domain: %s", lttng_domain_type_str(domain_type));
+
+ condition_status = lttng_condition_buffer_usage_get_threshold(
+ condition, &threshold);
+ if (condition_status == LTTNG_CONDITION_STATUS_OK) {
+ MSG(" threshold (bytes): %" PRIu64, threshold);
+ } else {
+ double threshold_ratio;
+
+ assert(condition_status == LTTNG_CONDITION_STATUS_UNSET);
+
+ condition_status =
+ lttng_condition_buffer_usage_get_threshold_ratio(
+ condition, &threshold_ratio);
+ assert(condition_status == LTTNG_CONDITION_STATUS_OK);
+
+ MSG(" threshold (ratio): %.2f", threshold_ratio);
+ }
+}
+
+static void print_condition_session_rotation(
+ const struct lttng_condition *condition)
+{
+ enum lttng_condition_status condition_status;
+ const char *session_name;
+
+ condition_status = lttng_condition_session_rotation_get_session_name(
+ condition, &session_name);
+ assert(condition_status == LTTNG_CONDITION_STATUS_OK);
+
+ MSG(" session name: %s", session_name);
+}
+
/*
* Returns the human-readable log level name associated with a numerical value
* if there is one. The Log4j and JUL domains have discontinuous log level
goto end;
}
- _MSG(" rule: %s (type: userspace probe, location: ", name);
+ _MSG(" rule: %s (type: userspace probe, ", name);
userspace_probe_location_type =
lttng_userspace_probe_location_get_type(location);
function_name = lttng_userspace_probe_location_function_get_function_name(
location);
- _MSG("%s:%s", binary_path, function_name);
+ _MSG("location type: ELF, location: %s:%s", binary_path, function_name);
break;
}
case LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT:
- _MSG("SDT not implemented yet");
+ {
+ const char *binary_path, *provider_name, *probe_name;
+
+ binary_path = lttng_userspace_probe_location_tracepoint_get_binary_path(
+ location);
+ provider_name = lttng_userspace_probe_location_tracepoint_get_provider_name(
+ location);
+ probe_name = lttng_userspace_probe_location_tracepoint_get_probe_name(
+ location);
+ _MSG("location type: SDT, location: %s:%s:%s", binary_path, provider_name, probe_name);
break;
+ }
default:
abort();
}
trigger_status = lttng_trigger_get_owner_uid(trigger, &trigger_uid);
assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
- MSG("- id: %s", name);
- MSG(" user id: %d", trigger_uid);
+ MSG("- name: %s", name);
+ MSG(" owner uid: %d", trigger_uid);
condition = lttng_trigger_get_const_condition(trigger);
condition_type = lttng_condition_get_type(condition);
MSG(" condition: %s", lttng_condition_type_str(condition_type));
switch (condition_type) {
+ case LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE:
+ print_condition_session_consumed_size(condition);
+ break;
+ case LTTNG_CONDITION_TYPE_BUFFER_USAGE_HIGH:
+ case LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW:
+ print_condition_buffer_usage(condition);
+ break;
+ case LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING:
+ case LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED:
+ print_condition_session_rotation(condition);
+ break;
case LTTNG_CONDITION_TYPE_ON_EVENT:
print_condition_on_event(condition);
break;
default:
- MSG(" (condition type not handled in %s)", __func__);
- break;
+ abort();
}
action = lttng_trigger_get_const_action(trigger);