struct lttng_event_rule_syscall {
struct lttng_event_rule parent;
- enum lttng_event_rule_syscall_emission_site_type emission_site_type;
+ enum lttng_event_rule_syscall_emission_site emission_site;
char *pattern;
char *filter_expression;
};
struct lttng_event_rule_syscall_comm {
- uint32_t emission_site_type;
+ uint32_t emission_site;
/* Includes terminator `\0`. */
uint32_t pattern_len;
/* Includes terminator `\0`. */
LTTNG_HIDDEN
const char *lttng_event_rule_syscall_emission_site_str(
- enum lttng_event_rule_syscall_emission_site_type type);
+ enum lttng_event_rule_syscall_emission_site emission_site);
#endif /* LTTNG_EVENT_RULE_SYSCALL_INTERNAL_H */
extern "C" {
#endif
-enum lttng_event_rule_syscall_emission_site_type {
+enum lttng_event_rule_syscall_emission_site {
LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY_EXIT = 0,
LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY = 1,
LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_EXIT = 2,
* Create a newly allocated syscall event rule.
*
* The default pattern is '*'.
- * The default emission site type is LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY_EXIT.
+ * The default emission site is LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY_EXIT.
*
* Returns a new event rule on success, NULL on failure. This event rule must be
* destroyed using lttng_event_rule_destroy().
*/
extern struct lttng_event_rule *lttng_event_rule_syscall_create(enum
- lttng_event_rule_syscall_emission_site_type emission_site_type);
+ lttng_event_rule_syscall_emission_site emission_site);
/*
* Set the name pattern of a syscall event rule.
const struct lttng_event_rule *rule, const char **expression);
/*
- * Get the emission site type of a syscall event rule.
+ * Get the emission site of a syscall event rule.
*
- * Returns a enum lttng_event_rule_syscall_emission_site_type.
+ * Returns a enum lttng_event_rule_syscall_emission_site.
*/
-extern enum lttng_event_rule_syscall_emission_site_type
-lttng_event_rule_syscall_get_emission_site_type(
+extern enum lttng_event_rule_syscall_emission_site
+lttng_event_rule_syscall_get_emission_site(
const struct lttng_event_rule *rule);
#ifdef __cplusplus
const enum lttng_event_rule_status status =
lttng_event_rule_syscall_get_name_pattern(
rule, &name);
- const enum lttng_event_rule_syscall_emission_site_type
- emission_site_type =
- lttng_event_rule_syscall_get_emission_site_type(rule);
+ const enum lttng_event_rule_syscall_emission_site
+ emission_site =
+ lttng_event_rule_syscall_get_emission_site(rule);
enum lttng_kernel_abi_syscall_entryexit entryexit;
assert(status == LTTNG_EVENT_RULE_STATUS_OK);
- assert(emission_site_type != LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_UNKNOWN);
+ assert(emission_site != LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_UNKNOWN);
- switch(emission_site_type) {
+ switch(emission_site) {
case LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY:
entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY;
break;
}
static bool parse_syscall_emission_site_from_type(const char *str,
- enum lttng_event_rule_syscall_emission_site_type *type)
+ enum lttng_event_rule_syscall_emission_site *type)
{
bool ret = false;
if (strcmp(str, "syscall") == 0 ||
case LTTNG_EVENT_RULE_TYPE_SYSCALL:
{
enum lttng_event_rule_status event_rule_status;
- enum lttng_event_rule_syscall_emission_site_type emission_site_type;
+ enum lttng_event_rule_syscall_emission_site emission_site;
if (!parse_syscall_emission_site_from_type(
- event_rule_type_str, &emission_site_type)) {
+ event_rule_type_str, &emission_site)) {
ERR("Failed to parse syscall type '%s'.", event_rule_type_str);
goto error;
}
- res.er = lttng_event_rule_syscall_create(emission_site_type);
+ res.er = lttng_event_rule_syscall_create(emission_site);
if (!res.er) {
ERR("Failed to create syscall event rule.");
goto error;
{
const char *pattern, *filter;
enum lttng_event_rule_status event_rule_status;
- enum lttng_event_rule_syscall_emission_site_type emission_site_type;
+ enum lttng_event_rule_syscall_emission_site emission_site;
assert(lttng_event_rule_get_type(event_rule) == LTTNG_EVENT_RULE_TYPE_SYSCALL);
- emission_site_type =
- lttng_event_rule_syscall_get_emission_site_type(event_rule);
+ emission_site =
+ lttng_event_rule_syscall_get_emission_site(event_rule);
event_rule_status = lttng_event_rule_syscall_get_name_pattern(
event_rule, &pattern);
_MSG(" rule: %s (type: syscall:%s", pattern,
lttng_event_rule_syscall_emission_site_str(
- emission_site_type));
+ emission_site));
event_rule_status = lttng_event_rule_syscall_get_filter(
event_rule, &filter);
syscall_comm.pattern_len = pattern_len;
syscall_comm.filter_expression_len = filter_expression_len;
- syscall_comm.emission_site_type = syscall->emission_site_type;
+ syscall_comm.emission_site = syscall->emission_site;
ret = lttng_dynamic_buffer_append(
&payload->buffer, &syscall_comm, sizeof(syscall_comm));
}
struct lttng_event_rule *lttng_event_rule_syscall_create(
- enum lttng_event_rule_syscall_emission_site_type
- emission_site_type)
+ enum lttng_event_rule_syscall_emission_site
+ emission_site)
{
struct lttng_event_rule *rule = NULL;
struct lttng_event_rule_syscall *syscall_rule;
enum lttng_event_rule_status status;
/* Validate the emission site type */
- switch (emission_site_type) {
+ switch (emission_site) {
case LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY_EXIT:
case LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY:
case LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_EXIT:
}
/* Emission site type */
- syscall_rule->emission_site_type = emission_site_type;
+ syscall_rule->emission_site = emission_site;
end:
return rule;
}
syscall_comm = (typeof(syscall_comm)) current_buffer_view.data;
- rule = lttng_event_rule_syscall_create(syscall_comm->emission_site_type);
+ rule = lttng_event_rule_syscall_create(syscall_comm->emission_site);
if (!rule) {
ERR("Failed to create event rule syscall");
ret = -1;
end:
return status;
}
-extern enum lttng_event_rule_syscall_emission_site_type
-lttng_event_rule_syscall_get_emission_site_type(
+extern enum lttng_event_rule_syscall_emission_site
+lttng_event_rule_syscall_get_emission_site(
const struct lttng_event_rule *rule)
{
- enum lttng_event_rule_syscall_emission_site_type emission_site_type =
+ enum lttng_event_rule_syscall_emission_site emission_site =
LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_UNKNOWN;
struct lttng_event_rule_syscall *syscall;
}
syscall = container_of(rule, struct lttng_event_rule_syscall, parent);
- emission_site_type = syscall->emission_site_type;
+ emission_site = syscall->emission_site;
end:
- return emission_site_type;
+ return emission_site;
}
LTTNG_HIDDEN
const char *lttng_event_rule_syscall_emission_site_str(
- enum lttng_event_rule_syscall_emission_site_type type)
+ enum lttng_event_rule_syscall_emission_site emission_site)
{
- switch (type) {
+ switch (emission_site) {
case LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY:
return "entry";
case LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY_EXIT: