From 405f9e7db1cd7c023614ae249f0705fbb3da514c Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Thu, 5 Nov 2020 14:04:33 -0500 Subject: [PATCH] event-rule: userspace probe: rename get/set_name to get/set_event_name 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: I4a7fbd26b4dfe352100a6fa78b828c1da0fa9928 --- include/lttng/event-rule/userspace-probe.h | 4 ++-- src/bin/lttng-sessiond/trace-kernel.c | 3 ++- src/bin/lttng/commands/add_trigger.c | 5 +++-- src/bin/lttng/commands/list_triggers.c | 3 ++- src/common/event-rule/userspace-probe.c | 6 +++--- tests/regression/tools/notification/notification.c | 2 +- tests/unit/test_event_rule.c | 4 ++-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/lttng/event-rule/userspace-probe.h b/include/lttng/event-rule/userspace-probe.h index f4020a16a..dd90966cf 100644 --- a/include/lttng/event-rule/userspace-probe.h +++ b/include/lttng/event-rule/userspace-probe.h @@ -59,7 +59,7 @@ extern enum lttng_event_rule_status lttng_event_rule_userspace_probe_get_locatio * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID * if invalid parameters are passed. */ -extern enum lttng_event_rule_status lttng_event_rule_userspace_probe_set_name( +extern enum lttng_event_rule_status lttng_event_rule_userspace_probe_set_event_name( struct lttng_event_rule *rule, const char *name); /* @@ -73,7 +73,7 @@ extern enum lttng_event_rule_status lttng_event_rule_userspace_probe_set_name( * success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed, * or LTTNG_EVENT_RULE_STATUS_UNSET if a name was not set prior to this call. */ -extern enum lttng_event_rule_status lttng_event_rule_userspace_probe_get_name( +extern enum lttng_event_rule_status lttng_event_rule_userspace_probe_get_event_name( const struct lttng_event_rule *rule, const char **name); #ifdef __cplusplus diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index d420fb4df..9c2f61ad7 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -647,7 +647,8 @@ enum lttng_error_code trace_kernel_init_event_notifier_from_event_rule( abort(); } - status = lttng_event_rule_userspace_probe_get_name(rule, &name); + status = lttng_event_rule_userspace_probe_get_event_name( + rule, &name); assert(status == LTTNG_EVENT_RULE_STATUS_OK); ret_code = LTTNG_OK; break; diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index ec629cb30..092f3c8e2 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -1007,8 +1007,9 @@ struct parse_event_rule_res parse_event_rule(int *argc, const char ***argv) goto error; } - event_rule_status = lttng_event_rule_userspace_probe_set_name( - res.er, tracepoint_name); + event_rule_status = + lttng_event_rule_userspace_probe_set_event_name( + res.er, tracepoint_name); if (event_rule_status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to set user space probe event rule's name to '%s'.", tracepoint_name); diff --git a/src/bin/lttng/commands/list_triggers.c b/src/bin/lttng/commands/list_triggers.c index 666f8f077..054b3fb72 100644 --- a/src/bin/lttng/commands/list_triggers.c +++ b/src/bin/lttng/commands/list_triggers.c @@ -201,7 +201,8 @@ void print_event_rule_userspace_probe(const struct lttng_event_rule *event_rule) assert(lttng_event_rule_get_type(event_rule) == LTTNG_EVENT_RULE_TYPE_USERSPACE_PROBE); - event_rule_status = lttng_event_rule_userspace_probe_get_name(event_rule, &name); + event_rule_status = lttng_event_rule_userspace_probe_get_event_name( + event_rule, &name); if (event_rule_status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to get uprobe event rule's name."); goto end; diff --git a/src/common/event-rule/userspace-probe.c b/src/common/event-rule/userspace-probe.c index 66db5a6e4..44a7a8043 100644 --- a/src/common/event-rule/userspace-probe.c +++ b/src/common/event-rule/userspace-probe.c @@ -300,7 +300,7 @@ ssize_t lttng_event_rule_userspace_probe_create_from_payload( uprobe = container_of(rule, struct lttng_event_rule_userspace_probe, parent); uprobe->location = location; - status = lttng_event_rule_userspace_probe_set_name(rule, name); + status = lttng_event_rule_userspace_probe_set_event_name(rule, name); if (status != LTTNG_EVENT_RULE_STATUS_OK) { ret = -1; goto end; @@ -384,7 +384,7 @@ lttng_event_rule_userspace_probe_get_location_mutable( return uprobe->location; } -enum lttng_event_rule_status lttng_event_rule_userspace_probe_set_name( +enum lttng_event_rule_status lttng_event_rule_userspace_probe_set_event_name( struct lttng_event_rule *rule, const char *name) { char *name_copy = NULL; @@ -414,7 +414,7 @@ end: return status; } -enum lttng_event_rule_status lttng_event_rule_userspace_probe_get_name( +enum lttng_event_rule_status lttng_event_rule_userspace_probe_get_event_name( const struct lttng_event_rule *rule, const char **name) { struct lttng_event_rule_userspace_probe *uprobe; diff --git a/tests/regression/tools/notification/notification.c b/tests/regression/tools/notification/notification.c index e1d57f963..5f7533453 100644 --- a/tests/regression/tools/notification/notification.c +++ b/tests/regression/tools/notification/notification.c @@ -1981,7 +1981,7 @@ static void test_uprobe_event_rule_notification( ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK, "Setting uprobe event rule location"); - event_rule_status = lttng_event_rule_userspace_probe_set_name( + event_rule_status = lttng_event_rule_userspace_probe_set_event_name( event_rule, trigger_name); ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK, "Setting uprobe event rule name: '%s'", trigger_name); diff --git a/tests/unit/test_event_rule.c b/tests/unit/test_event_rule.c index 49aade24d..b92a10aac 100644 --- a/tests/unit/test_event_rule.c +++ b/tests/unit/test_event_rule.c @@ -276,10 +276,10 @@ static void test_event_rule_userspace_probe(void) probe_location, probe_location_tmp), "Location is equal."); - status = lttng_event_rule_userspace_probe_set_name(uprobe, probe_name); + status = lttng_event_rule_userspace_probe_set_event_name(uprobe, probe_name); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Setting uprobe event rule name: %s.", probe_name); - status = lttng_event_rule_userspace_probe_get_name(uprobe, &tmp); + status = lttng_event_rule_userspace_probe_get_event_name(uprobe, &tmp); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Getting uprobe name."); ok(!strcmp(probe_name, tmp), "Uprobe name are equal."); -- 2.34.1