+enum lttng_userspace_probe_location_function_instrumentation_type
+lttng_userspace_probe_location_function_get_instrumentation_type(
+ const struct lttng_userspace_probe_location *location)
+{
+ enum lttng_userspace_probe_location_function_instrumentation_type type;
+ struct lttng_userspace_probe_location_function *function_location;
+
+ if (!location || lttng_userspace_probe_location_get_type(location) !=
+ LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION) {
+ ERR("Invalid argument(s) passed to '%s'", __FUNCTION__);
+ type = LTTNG_USERSPACE_PROBE_LOCATION_FUNCTION_INSTRUMENTATION_TYPE_UNKNOWN;
+ goto end;
+ }
+
+ function_location = container_of(location,
+ struct lttng_userspace_probe_location_function, parent);
+ type = function_location->instrumentation_type;
+end:
+ return type;
+}
+
+enum lttng_userspace_probe_location_status
+lttng_userspace_probe_location_function_set_instrumentation_type(
+ const struct lttng_userspace_probe_location *location,
+ enum lttng_userspace_probe_location_function_instrumentation_type instrumentation_type)
+{
+ enum lttng_userspace_probe_location_status status =
+ LTTNG_USERSPACE_PROBE_LOCATION_STATUS_OK;
+ struct lttng_userspace_probe_location_function *function_location;
+
+ if (!location || lttng_userspace_probe_location_get_type(location) !=
+ LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION ||
+ instrumentation_type !=
+ LTTNG_USERSPACE_PROBE_LOCATION_FUNCTION_INSTRUMENTATION_TYPE_ENTRY) {
+ ERR("Invalid argument(s) passed to '%s'", __FUNCTION__);
+ status = LTTNG_USERSPACE_PROBE_LOCATION_STATUS_INVALID;
+ goto end;
+ }
+
+ function_location = container_of(location,
+ struct lttng_userspace_probe_location_function, parent);
+ function_location->instrumentation_type = instrumentation_type;
+end:
+ return status;
+}
+