From: Jonathan Rajotte Date: Thu, 5 Nov 2020 16:32:35 +0000 (-0500) Subject: event-rule: kernel probe: rename set/get_name to set/get_event_name X-Git-Tag: v2.13.0-rc1~216 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d891bb526224eeaf1cf688e072c7bf77321c6c2f;p=lttng-tools.git event-rule: kernel probe: rename set/get_name to set/get_event_name Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I14950a663a4db37fe0f120d8f06c01cae241a871 --- diff --git a/include/lttng/event-rule/kernel-probe.h b/include/lttng/event-rule/kernel-probe.h index 2ac173d27..2d5257512 100644 --- a/include/lttng/event-rule/kernel-probe.h +++ b/include/lttng/event-rule/kernel-probe.h @@ -60,7 +60,7 @@ extern enum lttng_event_rule_status lttng_event_rule_kernel_probe_get_location( * Returns 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_kernel_probe_set_name( +extern enum lttng_event_rule_status lttng_event_rule_kernel_probe_set_event_name( struct lttng_event_rule *rule, const char *name); /* @@ -74,7 +74,7 @@ extern enum lttng_event_rule_status lttng_event_rule_kernel_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_kernel_probe_get_name( +extern enum lttng_event_rule_status lttng_event_rule_kernel_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 ba8ceab1d..d420fb4df 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -601,7 +601,7 @@ enum lttng_error_code trace_kernel_init_event_notifier_from_event_rule( kernel_event_notifier->event.u.kprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; - status = lttng_event_rule_kernel_probe_get_name(rule, &name); + status = lttng_event_rule_kernel_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 d88fa0cf9..19d3a6f3a 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -972,7 +972,7 @@ struct parse_event_rule_res parse_event_rule(int *argc, const char ***argv) goto error; } - event_rule_status = lttng_event_rule_kernel_probe_set_name(res.er, tracepoint_name); + event_rule_status = lttng_event_rule_kernel_probe_set_event_name(res.er, tracepoint_name); if (event_rule_status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to set kprobe event rule's name to '%s'.", tracepoint_name); goto error; diff --git a/src/bin/lttng/commands/list_triggers.c b/src/bin/lttng/commands/list_triggers.c index 024dc50bc..666f8f077 100644 --- a/src/bin/lttng/commands/list_triggers.c +++ b/src/bin/lttng/commands/list_triggers.c @@ -168,7 +168,7 @@ void print_event_rule_kernel_probe(const struct lttng_event_rule *event_rule) assert(lttng_event_rule_get_type(event_rule) == LTTNG_EVENT_RULE_TYPE_KERNEL_PROBE); - event_rule_status = lttng_event_rule_kernel_probe_get_name(event_rule, &name); + event_rule_status = lttng_event_rule_kernel_probe_get_event_name(event_rule, &name); if (event_rule_status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to get kprobe event rule's name."); goto end; diff --git a/src/common/event-rule/kernel-probe.c b/src/common/event-rule/kernel-probe.c index 6152a1b50..7506c2f11 100644 --- a/src/common/event-rule/kernel-probe.c +++ b/src/common/event-rule/kernel-probe.c @@ -316,7 +316,7 @@ ssize_t lttng_event_rule_kernel_probe_create_from_payload( /* Skip after the location */ offset += kprobe_comm->location_len; - status = lttng_event_rule_kernel_probe_set_name(rule, name); + status = lttng_event_rule_kernel_probe_set_event_name(rule, name); if (status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to set event rule kprobe name."); ret = -1; @@ -386,7 +386,7 @@ end: return status; } -enum lttng_event_rule_status lttng_event_rule_kernel_probe_set_name( +enum lttng_event_rule_status lttng_event_rule_kernel_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_kernel_probe_get_name( +enum lttng_event_rule_status lttng_event_rule_kernel_probe_get_event_name( const struct lttng_event_rule *rule, const char **name) { struct lttng_event_rule_kernel_probe *kprobe; diff --git a/tests/regression/tools/notification/notification.c b/tests/regression/tools/notification/notification.c index 9356d432e..0f1a41811 100644 --- a/tests/regression/tools/notification/notification.c +++ b/tests/regression/tools/notification/notification.c @@ -1872,7 +1872,7 @@ static void test_kprobe_event_rule_notification( ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK, "Setting kprobe event rule location: '%s'", symbol_name); - event_rule_status = lttng_event_rule_kernel_probe_set_name( + event_rule_status = lttng_event_rule_kernel_probe_set_event_name( event_rule, trigger_name); ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK, "Setting kprobe event rule name: '%s'", trigger_name); diff --git a/tests/unit/test_event_rule.c b/tests/unit/test_event_rule.c index b45dc7ba2..07614f4b8 100644 --- a/tests/unit/test_event_rule.c +++ b/tests/unit/test_event_rule.c @@ -334,10 +334,10 @@ static void test_event_rule_kernel_probe_by_location( "Getting kprobe event rule location."); ok(lttng_kernel_probe_location_is_equal(location, _location), "Locations are equal."); - status = lttng_event_rule_kernel_probe_set_name(kprobe, probe_name); + status = lttng_event_rule_kernel_probe_set_event_name(kprobe, probe_name); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Setting kprobe event rule name: %s.", probe_name); - status = lttng_event_rule_kernel_probe_get_name(kprobe, &tmp); + status = lttng_event_rule_kernel_probe_get_event_name(kprobe, &tmp); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Getting kprobe name."); ok(!strcmp(probe_name, tmp), "kprobe name are equal.");