char *error = NULL;
char *fire_once_after_str = NULL;
char *fire_every_str = NULL;
- struct lttng_firing_policy *policy = NULL;
+ struct lttng_rate_policy *policy = NULL;
state = argpar_state_create(*argc, *argv, notify_action_opt_descrs);
if (!state) {
goto error;
}
- policy = lttng_firing_policy_once_after_n_create(threshold);
+ policy = lttng_rate_policy_once_after_n_create(threshold);
if (!policy) {
ERR("Failed to create policy once after `%s`.",
fire_once_after_str);
goto error;
}
- policy = lttng_firing_policy_every_n_create(interval);
+ policy = lttng_rate_policy_every_n_create(interval);
if (!policy) {
ERR("Failed to create policy every `%s`.",
fire_every_str);
if (policy) {
enum lttng_action_status status;
- status = lttng_action_notify_set_firing_policy(action, policy);
+ status = lttng_action_notify_set_rate_policy(action, policy);
if (status != LTTNG_ACTION_STATUS_OK) {
- ERR("Failed to set firing policy");
+ ERR("Failed to set rate policy");
goto error;
}
}
end:
free(fire_once_after_str);
free(fire_every_str);
- lttng_firing_policy_destroy(policy);
+ lttng_rate_policy_destroy(policy);
argpar_state_destroy(state);
argpar_item_destroy(item);
return action;
/*
* Generic handler for a kind of action that takes a session name and an
- * optional firing policy.
+ * optional rate policy.
*/
static struct lttng_action *handle_action_simple_session_with_policy(int *argc,
struct lttng_action *(*create_action_cb)(void),
enum lttng_action_status (*set_session_name_cb)(
struct lttng_action *, const char *),
- enum lttng_action_status (*set_firing_policy_cb)(
+ enum lttng_action_status (*set_rate_policy_cb)(
struct lttng_action *,
- const struct lttng_firing_policy *),
+ const struct lttng_rate_policy *),
const char *action_name)
{
struct lttng_action *action = NULL;
char *fire_every_str = NULL;
char *error = NULL;
enum lttng_action_status action_status;
- struct lttng_firing_policy *policy = NULL;
+ struct lttng_rate_policy *policy = NULL;
assert(set_session_name_cb);
- assert(set_firing_policy_cb);
+ assert(set_rate_policy_cb);
- const struct argpar_opt_descr firing_policy_opt_descrs[] = {
+ const struct argpar_opt_descr rate_policy_opt_descrs[] = {
{ OPT_FIRE_ONCE_AFTER, '\0', "fire-once-after", true },
{ OPT_FIRE_EVERY, '\0', "fire-every", true },
ARGPAR_OPT_DESCR_SENTINEL
};
- state = argpar_state_create(*argc, *argv, firing_policy_opt_descrs);
+ state = argpar_state_create(*argc, *argv, rate_policy_opt_descrs);
if (!state) {
ERR("Failed to allocate an argpar state.");
goto error;
goto error;
}
- policy = lttng_firing_policy_once_after_n_create(threshold);
+ policy = lttng_rate_policy_once_after_n_create(threshold);
if (!policy) {
ERR("Failed to create policy once after `%s`.",
fire_once_after_str);
goto error;
}
- policy = lttng_firing_policy_every_n_create(interval);
+ policy = lttng_rate_policy_every_n_create(interval);
if (!policy) {
ERR("Failed to create policy every `%s`.",
fire_every_str);
}
if (policy) {
- action_status = set_firing_policy_cb(action, policy);
+ action_status = set_rate_policy_cb(action, policy);
if (action_status != LTTNG_ACTION_STATUS_OK) {
- ERR("Failed to set firing policy");
+ ERR("Failed to set rate policy");
goto error;
}
}
action = NULL;
argpar_item_destroy(item);
end:
- lttng_firing_policy_destroy(policy);
+ lttng_rate_policy_destroy(policy);
free(error);
argpar_state_destroy(state);
return action;
return handle_action_simple_session_with_policy(argc, argv,
lttng_action_start_session_create,
lttng_action_start_session_set_session_name,
- lttng_action_start_session_set_firing_policy, "start");
+ lttng_action_start_session_set_rate_policy, "start");
}
static
return handle_action_simple_session_with_policy(argc, argv,
lttng_action_stop_session_create,
lttng_action_stop_session_set_session_name,
- lttng_action_stop_session_set_firing_policy, "stop");
+ lttng_action_stop_session_set_rate_policy, "stop");
}
static
return handle_action_simple_session_with_policy(argc, argv,
lttng_action_rotate_session_create,
lttng_action_rotate_session_set_session_name,
- lttng_action_rotate_session_set_firing_policy,
+ lttng_action_rotate_session_set_rate_policy,
"rotate");
}
char *fire_every_str = NULL;
enum lttng_action_status action_status;
struct lttng_snapshot_output *snapshot_output = NULL;
- struct lttng_firing_policy *policy = NULL;
+ struct lttng_rate_policy *policy = NULL;
int ret;
unsigned int locations_specified = 0;
}
}
- /* Any firing policy ? */
+ /* Any rate policy ? */
if (fire_once_after_str && fire_every_str) {
ERR("--fire-once and --fire-every are mutually exclusive.");
goto error;
goto error;
}
- policy = lttng_firing_policy_once_after_n_create(threshold);
+ policy = lttng_rate_policy_once_after_n_create(threshold);
if (!policy) {
ERR("Failed to create policy once after `%s`.",
fire_once_after_str);
goto error;
}
- policy = lttng_firing_policy_every_n_create(interval);
+ policy = lttng_rate_policy_every_n_create(interval);
if (!policy) {
ERR("Failed to create policy every `%s`.",
fire_every_str);
if (policy) {
enum lttng_action_status status;
- status = lttng_action_snapshot_session_set_firing_policy(
+ status = lttng_action_snapshot_session_set_rate_policy(
action, policy);
if (status != LTTNG_ACTION_STATUS_OK) {
- ERR("Failed to set firing policy");
+ ERR("Failed to set rate policy");
goto error;
}
}
free(data_url_arg);
free(snapshot_output);
free(max_size_arg);
- lttng_firing_policy_destroy(policy);
+ lttng_rate_policy_destroy(policy);
argpar_state_destroy(state);
argpar_item_destroy(item);
return action;