Add function instrumentation type accessors to function location type
[lttng-tools.git] / include / lttng / userspace-probe.h
index c8c1ae43af4850cd4bc9baa72100561d2edc2b53..cedb7d8b8fc7e260f85350592a0cc3599295ac82 100644 (file)
@@ -69,9 +69,17 @@ lttng_userspace_probe_location_lookup_method_tracepoint_sdt_create(void);
  */
 struct lttng_userspace_probe_location;
 
+enum lttng_userspace_probe_location_status {
+       LTTNG_USERSPACE_PROBE_LOCATION_STATUS_OK        = 0,
+       /* Invalid parameters provided. */
+       LTTNG_USERSPACE_PROBE_LOCATION_STATUS_INVALID   = -1,
+};
+
 enum lttng_userspace_probe_location_type {
        LTTNG_USERSPACE_PROBE_LOCATION_TYPE_UNKNOWN     = -1,
+       /* Function. */
        LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION    = 0,
+       /* SDT probe's callsites. */
        LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT  = 1,
 };
 
@@ -88,6 +96,13 @@ lttng_userspace_probe_location_get_type(
 extern void lttng_userspace_probe_location_destroy(
                struct lttng_userspace_probe_location *location);
 
+
+enum lttng_userspace_probe_location_function_instrumentation_type {
+       LTTNG_USERSPACE_PROBE_LOCATION_FUNCTION_INSTRUMENTATION_TYPE_UNKNOWN = -1,
+       /* Only instrument the function's entry. */
+       LTTNG_USERSPACE_PROBE_LOCATION_FUNCTION_INSTRUMENTATION_TYPE_ENTRY = 0,
+};
+
 /*
  * Create a probe location of the function type.
  * Receives the target binary file path and function to instrument.
@@ -120,13 +135,34 @@ extern const char *lttng_userspace_probe_location_function_get_function_name(
 extern int lttng_userspace_probe_location_function_get_binary_fd(
                const struct lttng_userspace_probe_location *location);
 
+/*
+ * Get the instrumentation type of the function probe location.
+ */
+extern enum lttng_userspace_probe_location_function_instrumentation_type
+lttng_userspace_probe_location_function_get_instrumentation_type(
+               const struct lttng_userspace_probe_location *location);
+
+/*
+ * Get the instrumentation type of the function probe location.
+ * Defaults to
+ * LTTNG_USERSPACE_PROBE_LOCATION_FUNCTION_INSTRUMENTATION_TYPE_ENTRY.
+ *
+ * Returns LTTNG_USERSPACE_PROBE_LOCATION_STATUS_OK on success,
+ * LTTNG_USERSPACE_PROBE_LOCATION_STATUS_INVALID if invalid parameters
+ * are provided.
+ */
+extern 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);
+
 /*
  * Get the lookup method of the given userspace probe location.
  * Returns NULL if the probe location type is unsupported.
  *
  * The ownership of the lookup method is NOT transferred to the caller.
  */
-extern struct lttng_userspace_probe_location_lookup_method *
+extern const struct lttng_userspace_probe_location_lookup_method *
 lttng_userspace_probe_location_get_lookup_method(
                const struct lttng_userspace_probe_location *location);
 
This page took 0.02993 seconds and 5 git commands to generate.