From bc16a30da2af295c9bd3d07e163b24e7c96c40c6 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 11 May 2021 19:19:03 -0400 Subject: [PATCH] Rename *emission_site_type to *emission_site MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I3027affe23de8674a5a813d18643396e3a1474f1 --- include/lttng/event-rule/syscall-internal.h | 6 ++--- include/lttng/event-rule/syscall.h | 14 +++++------ src/bin/lttng-sessiond/trace-kernel.c | 10 ++++---- src/bin/lttng/commands/add_trigger.c | 8 +++---- src/bin/lttng/commands/list_triggers.c | 8 +++---- src/common/event-rule/syscall.c | 26 ++++++++++----------- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/include/lttng/event-rule/syscall-internal.h b/include/lttng/event-rule/syscall-internal.h index bd0c1114a..29f9e3316 100644 --- a/include/lttng/event-rule/syscall-internal.h +++ b/include/lttng/event-rule/syscall-internal.h @@ -15,7 +15,7 @@ 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; @@ -27,7 +27,7 @@ struct lttng_event_rule_syscall { }; 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`. */ @@ -47,5 +47,5 @@ ssize_t lttng_event_rule_syscall_create_from_payload( 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 */ diff --git a/include/lttng/event-rule/syscall.h b/include/lttng/event-rule/syscall.h index bb114778c..f9fd2aba3 100644 --- a/include/lttng/event-rule/syscall.h +++ b/include/lttng/event-rule/syscall.h @@ -14,7 +14,7 @@ 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, @@ -25,13 +25,13 @@ enum lttng_event_rule_syscall_emission_site_type { * 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. @@ -88,12 +88,12 @@ extern enum lttng_event_rule_status lttng_event_rule_syscall_get_filter( 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 diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index e92b76c5d..7ba6a4cd9 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -676,15 +676,15 @@ enum lttng_error_code trace_kernel_init_event_notifier_from_event_rule( 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; diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index 2c9462f93..1cb35adc7 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -189,7 +189,7 @@ end: } 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 || @@ -1134,15 +1134,15 @@ struct parse_event_rule_res parse_event_rule(int *argc, const char ***argv) 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; diff --git a/src/bin/lttng/commands/list_triggers.c b/src/bin/lttng/commands/list_triggers.c index 6f5828ff1..26dc201ec 100644 --- a/src/bin/lttng/commands/list_triggers.c +++ b/src/bin/lttng/commands/list_triggers.c @@ -389,12 +389,12 @@ void print_event_rule_syscall(const struct lttng_event_rule *event_rule) { 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); @@ -402,7 +402,7 @@ void print_event_rule_syscall(const struct lttng_event_rule *event_rule) _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); diff --git a/src/common/event-rule/syscall.c b/src/common/event-rule/syscall.c index 88cfde6b6..4ac6a11af 100644 --- a/src/common/event-rule/syscall.c +++ b/src/common/event-rule/syscall.c @@ -88,7 +88,7 @@ static int lttng_event_rule_syscall_serialize( 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)); @@ -248,15 +248,15 @@ lttng_event_rule_syscall_hash( } 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: @@ -296,7 +296,7 @@ struct lttng_event_rule *lttng_event_rule_syscall_create( } /* Emission site type */ - syscall_rule->emission_site_type = emission_site_type; + syscall_rule->emission_site = emission_site; end: return rule; @@ -334,7 +334,7 @@ ssize_t lttng_event_rule_syscall_create_from_payload( } 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; @@ -517,11 +517,11 @@ enum lttng_event_rule_status lttng_event_rule_syscall_get_filter( 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; @@ -530,17 +530,17 @@ lttng_event_rule_syscall_get_emission_site_type( } 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: -- 2.34.1