X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng%2Fuserspace-probe.h;h=9378eda8a0a149cfb9509b0b1f1256ed88f4f015;hp=4c92c36b2d0abc9956cf7f97b41acc9d86cdc760;hb=a94797228bb9f0752e012d67d45f49af0c76d9c3;hpb=394357fe3de7a15a81b5a25bddf3d82a64c1f65a diff --git a/include/lttng/userspace-probe.h b/include/lttng/userspace-probe.h index 4c92c36b2..9378eda8a 100644 --- a/include/lttng/userspace-probe.h +++ b/include/lttng/userspace-probe.h @@ -32,6 +32,7 @@ enum lttng_userspace_probe_location_lookup_method_type { LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_UNKNOWN = -1, LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_DEFAULT = 0, LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF = 1, + LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT = 2, }; /* @@ -54,6 +55,13 @@ extern void lttng_userspace_probe_location_lookup_method_destroy( extern struct lttng_userspace_probe_location_lookup_method * lttng_userspace_probe_location_lookup_method_function_elf_create(void); +/* + * Create a tracepoint SDT tracepoint lookup method struct. + * Return NULL on failure. + */ +extern struct lttng_userspace_probe_location_lookup_method * +lttng_userspace_probe_location_lookup_method_tracepoint_sdt_create(void); + /* * Contains all the information needed to compute the instrumentation point in @@ -63,7 +71,10 @@ struct lttng_userspace_probe_location; enum lttng_userspace_probe_location_type { LTTNG_USERSPACE_PROBE_LOCATION_TYPE_UNKNOWN = -1, + /* Traces a function's entry and exit. */ LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION = 0, + /* Trace a single point. */ + LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT = 1, }; /* @@ -117,10 +128,50 @@ extern int lttng_userspace_probe_location_function_get_binary_fd( * * 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); +/* + * Create a probe location of the tracepoint type. + * Receives the target binary file path, probename and probe provider to + * instrument. + * On failure, NULL is returned. + * + * The ownership of the lookup method is transferred to the created probe + * location. + */ +extern struct lttng_userspace_probe_location * +lttng_userspace_probe_location_tracepoint_create(const char *binary_path, + const char *probe_name, const char *provider_name, + struct lttng_userspace_probe_location_lookup_method *lookup_method); + +/* + * Get the target binary path of the probe location of the tracepoint type. + */ +extern const char *lttng_userspace_probe_location_tracepoint_get_binary_path( + const struct lttng_userspace_probe_location *location); + +/* + * Get the target probe name of the probe location of the tracepoint type. + */ +extern const char *lttng_userspace_probe_location_tracepoint_get_probe_name( + const struct lttng_userspace_probe_location *location); + +/* + * Get the target probe provider name of the probe location of the tracepoint + * type. + */ +extern const char *lttng_userspace_probe_location_tracepoint_get_provider_name( + const struct lttng_userspace_probe_location *location); + +/* + * Get the FD to the target binary file to the probe location of the tracepoint + * type. + */ +extern int lttng_userspace_probe_location_tracepoint_get_binary_fd( + const struct lttng_userspace_probe_location *location); + #ifdef __cplusplus } #endif