LTTng control library C API
Loading...
Searching...
No Matches
Linux user space probe location API

Data Structures

struct  lttng_userspace_probe_location
 Linux user space probe location (opaque type). More...
 
struct  lttng_userspace_probe_location_lookup_method
 Lookup method of a Linux user space probe location (opaque type). More...
 

Enumerations

enum  lttng_userspace_probe_location_lookup_method_type { LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_DEFAULT , LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF , LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT , LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_UNKNOWN }
 Linux user space probe location lookup method type. More...
 
enum  lttng_userspace_probe_location_status { LTTNG_USERSPACE_PROBE_LOCATION_STATUS_OK , LTTNG_USERSPACE_PROBE_LOCATION_STATUS_INVALID }
 Return type of Linux user space probe location API functions. More...
 
enum  lttng_userspace_probe_location_type { LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION , LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT , LTTNG_USERSPACE_PROBE_LOCATION_TYPE_UNKNOWN }
 Linux user space probe location type. More...
 

Functions

void lttng_userspace_probe_location_destroy (struct lttng_userspace_probe_location *location)
 Destroys the Linux user space probe location location.
 
struct lttng_userspace_probe_locationlttng_userspace_probe_location_function_create (const char *binary_path, const char *function_name, struct lttng_userspace_probe_location_lookup_method *lookup_method)
 Creates a Linux user space probe location at the entry of the function named function_name within the binary binary_path using the lookup method lookup_method.
 
int lttng_userspace_probe_location_function_get_binary_fd (const struct lttng_userspace_probe_location *location)
 Returns the file descriptor of the target binary of the function Linux user space probe location location.
 
const char * lttng_userspace_probe_location_function_get_binary_path (const struct lttng_userspace_probe_location *location)
 Returns the binary path of the function Linux user space probe location location.
 
const char * lttng_userspace_probe_location_function_get_function_name (const struct lttng_userspace_probe_location *location)
 Returns the function name of the function Linux user space probe location location.
 
const struct lttng_userspace_probe_location_lookup_methodlttng_userspace_probe_location_get_lookup_method (const struct lttng_userspace_probe_location *location)
 Returns the lookup method of the Linux user space probe location location.
 
enum lttng_userspace_probe_location_type lttng_userspace_probe_location_get_type (const struct lttng_userspace_probe_location *location)
 Returns the type of the Linux user space probe location location.
 
void lttng_userspace_probe_location_lookup_method_destroy (struct lttng_userspace_probe_location_lookup_method *lookup_method)
 Destroys the Linux user space probe location lookup method lookup_method.
 
struct lttng_userspace_probe_location_lookup_methodlttng_userspace_probe_location_lookup_method_function_elf_create (void)
 Creates an Executable and Linkable Format (ELF) Linux user space probe location lookup method.
 
enum lttng_userspace_probe_location_lookup_method_type lttng_userspace_probe_location_lookup_method_get_type (const struct lttng_userspace_probe_location_lookup_method *lookup_method)
 Returns the type of the Linux user space probe location lookup method lookup_method.
 
struct lttng_userspace_probe_location_lookup_methodlttng_userspace_probe_location_lookup_method_tracepoint_sdt_create (void)
 Creates an USDT probe Linux user space probe location lookup method.
 
struct lttng_userspace_probe_locationlttng_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)
 Creates a Linux user space probe location at the USDT probe named probe_name, for the provider named provider_name, within the binary binary_path using the lookup method lookup_method.
 
int lttng_userspace_probe_location_tracepoint_get_binary_fd (const struct lttng_userspace_probe_location *location)
 Returns the file descriptor of the target binary of the USDT Linux user space probe location location.
 
const char * lttng_userspace_probe_location_tracepoint_get_binary_path (const struct lttng_userspace_probe_location *location)
 Returns the binary path of the USDT Linux user space probe location location.
 
const char * lttng_userspace_probe_location_tracepoint_get_probe_name (const struct lttng_userspace_probe_location *location)
 Returns the probe name of the USDT Linux user space probe location location.
 
const char * lttng_userspace_probe_location_tracepoint_get_provider_name (const struct lttng_userspace_probe_location *location)
 Returns the provider name of the USDT Linux user space probe location location.
 

Detailed Description

A Linux user space probe location is an object which locates a Linux user space probe.

The purpose of such an object is to provide the location of the target Linux user space probe when you create:

The two ways to locate a Linux user space probe are:

Location type Location enumerator Creation function
By the entry of a user space function within some binary LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION lttng_userspace_probe_location_function_create()
By a SystemTap Userland Statically Defined Tracing (USDT) probe within some binary LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT lttng_userspace_probe_location_tracepoint_create()

Get the type of a Linux kprobe location with lttng_userspace_probe_location_get_type().

Destroy a Linux kprobe location with lttng_userspace_probe_location_destroy().

Enumeration Type Documentation

◆ lttng_userspace_probe_location_lookup_method_type

Linux user space probe location lookup method type.

Get the type of a Linux user space probe location lookup method with lttng_userspace_probe_location_lookup_method_get_type().

Enumerator
LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_DEFAULT 

Default.

LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF 

Executable and Linkable Format (ELF) function.

LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT 

SystemTap Userland Statically Defined Tracing (USDT; a DTrace-style marker) probe.

LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_UNKNOWN 

Unknown (error).

◆ lttng_userspace_probe_location_status

Return type of Linux user space probe location API functions.

Enumerator
LTTNG_USERSPACE_PROBE_LOCATION_STATUS_OK 

Success.

LTTNG_USERSPACE_PROBE_LOCATION_STATUS_INVALID 

Unsatisfied precondition.

◆ lttng_userspace_probe_location_type

Linux user space probe location type.

Get the type of a Linux user space probe location with lttng_userspace_probe_location_get_type().

Enumerator
LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION 

Function.

LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT 

USDT probe.

LTTNG_USERSPACE_PROBE_LOCATION_TYPE_UNKNOWN 

Unknown (error).

Function Documentation

◆ lttng_userspace_probe_location_destroy()

void lttng_userspace_probe_location_destroy ( struct lttng_userspace_probe_location location)
extern

Destroys the Linux user space probe location location.

Parameters
[in]location

Linux user space probe location to destroy.

May be NULL.

◆ lttng_userspace_probe_location_function_create()

struct lttng_userspace_probe_location * lttng_userspace_probe_location_function_create ( const char *  binary_path,
const char *  function_name,
struct lttng_userspace_probe_location_lookup_method lookup_method 
)
extern

Creates a Linux user space probe location at the entry of the function named function_name within the binary binary_path using the lookup method lookup_method.

This function opens binary_path and keeps the file open. Get the resulting file descriptor with lttng_userspace_probe_location_function_get_binary_fd().

Parameters
[in]binary_pathPath to the binary containing the function named function_name to locate (copied).
[in]function_nameName of the function within binary_path to locate (copied).
[in]lookup_methodLookup method (ownership moved to the returned location on success).
Returns

Linux user space probe location with the type LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION on success, or NULL on error.

Destroy the returned location with lttng_userspace_probe_location_destroy().

Precondition

◆ lttng_userspace_probe_location_function_get_binary_fd()

int lttng_userspace_probe_location_function_get_binary_fd ( const struct lttng_userspace_probe_location location)
extern

Returns the file descriptor of the target binary of the function Linux user space probe location location.

Parameters
[in]locationFunction Linux user space probe location of which to get the binary file descriptor.
Returns
Binary file descriptor of location, or -1 on error.
Precondition

◆ lttng_userspace_probe_location_function_get_binary_path()

const char * lttng_userspace_probe_location_function_get_binary_path ( const struct lttng_userspace_probe_location location)
extern

Returns the binary path of the function Linux user space probe location location.

Parameters
[in]locationFunction Linux user space probe location of which to get the binary path.
Returns

Binary path of location, or NULL on error.

location owns the returned string.

The returned string remains valid as long as location exists.

Precondition

◆ lttng_userspace_probe_location_function_get_function_name()

const char * lttng_userspace_probe_location_function_get_function_name ( const struct lttng_userspace_probe_location location)
extern

Returns the function name of the function Linux user space probe location location.

Parameters
[in]locationFunction Linux user space probe location of which to get the function name.
Returns

Function name of location, or NULL on error.

location owns the returned string.

The returned string remains valid as long as location exists.

Precondition

◆ lttng_userspace_probe_location_get_lookup_method()

const struct lttng_userspace_probe_location_lookup_method * lttng_userspace_probe_location_get_lookup_method ( const struct lttng_userspace_probe_location location)
extern

Returns the lookup method of the Linux user space probe location location.

Parameters
[in]locationLinux user space probe location of which to get the lookup method.
Returns

Lookup method of location, or NULL on error.

location owns the returned object.

The returned object remains valid as long as location exists.

Precondition
  • location is not NULL.

◆ lttng_userspace_probe_location_get_type()

enum lttng_userspace_probe_location_type lttng_userspace_probe_location_get_type ( const struct lttng_userspace_probe_location location)
extern

Returns the type of the Linux user space probe location location.

Parameters
[in]locationLinux user space probe location of which to get the type.
Returns
Type of location.
Precondition
  • location is not NULL.

◆ lttng_userspace_probe_location_lookup_method_destroy()

void lttng_userspace_probe_location_lookup_method_destroy ( struct lttng_userspace_probe_location_lookup_method lookup_method)
extern

Destroys the Linux user space probe location lookup method lookup_method.

Parameters
[in]lookup_method

Linux user space probe location lookup method to destroy.

May be NULL.

◆ lttng_userspace_probe_location_lookup_method_function_elf_create()

struct lttng_userspace_probe_location_lookup_method * lttng_userspace_probe_location_lookup_method_function_elf_create ( void  )
extern

Creates an Executable and Linkable Format (ELF) Linux user space probe location lookup method.

Returns

ELF Linux user space probe location lookup method with the type LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF on success, or NULL on error.

Destroy the returned lookup method with lttng_userspace_probe_location_lookup_method_destroy().

◆ lttng_userspace_probe_location_lookup_method_get_type()

enum lttng_userspace_probe_location_lookup_method_type lttng_userspace_probe_location_lookup_method_get_type ( const struct lttng_userspace_probe_location_lookup_method lookup_method)
extern

Returns the type of the Linux user space probe location lookup method lookup_method.

Parameters
[in]lookup_methodLinux user space probe location lookup method of which to get the type.
Returns
Type of lookup_method.
Precondition
  • lookup_method is not NULL.

◆ lttng_userspace_probe_location_lookup_method_tracepoint_sdt_create()

struct lttng_userspace_probe_location_lookup_method * lttng_userspace_probe_location_lookup_method_tracepoint_sdt_create ( void  )
extern

Creates an USDT probe Linux user space probe location lookup method.

Returns

USDT Linux user space probe location lookup method with the type LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT on success, or NULL on error.

Destroy the returned lookup method with lttng_userspace_probe_location_lookup_method_destroy().

◆ lttng_userspace_probe_location_tracepoint_create()

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 
)
extern

Creates a Linux user space probe location at the USDT probe named probe_name, for the provider named provider_name, within the binary binary_path using the lookup method lookup_method.

This function opens binary_path and keeps the file open. Get the resulting file descriptor with lttng_userspace_probe_location_tracepoint_get_binary_fd().

Parameters
[in]binary_pathPath to the binary containing the USDT probe to locate (copied).
[in]probe_nameName of the USDT probe to locate within binary_path (copied).
[in]provider_nameName of the provider of the USDT probe to locate within binary_path (copied).
[in]lookup_methodLookup method (ownership moved to the returned location on success).
Returns

Linux user space probe location with the type LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT on success, or NULL on error.

Destroy the returned location with lttng_userspace_probe_location_destroy().

Precondition

◆ lttng_userspace_probe_location_tracepoint_get_binary_fd()

int lttng_userspace_probe_location_tracepoint_get_binary_fd ( const struct lttng_userspace_probe_location location)
extern

Returns the file descriptor of the target binary of the USDT Linux user space probe location location.

Parameters
[in]locationUSDT Linux user space probe location of which to get the binary file descriptor.
Returns
Binary file descriptor of location, or -1 on error.
Precondition

◆ lttng_userspace_probe_location_tracepoint_get_binary_path()

const char * lttng_userspace_probe_location_tracepoint_get_binary_path ( const struct lttng_userspace_probe_location location)
extern

Returns the binary path of the USDT Linux user space probe location location.

Parameters
[in]locationUSDT Linux user space probe location of which to get the binary path.
Returns

Binary path of location, or NULL on error.

location owns the returned string.

The returned string remains valid as long as location exists.

Precondition

◆ lttng_userspace_probe_location_tracepoint_get_probe_name()

const char * lttng_userspace_probe_location_tracepoint_get_probe_name ( const struct lttng_userspace_probe_location location)
extern

Returns the probe name of the USDT Linux user space probe location location.

Parameters
[in]locationUSDT Linux user space probe location of which to get the probe name.
Returns

Probe name of location, or NULL on error.

location owns the returned string.

The returned string remains valid as long as location exists.

Precondition

◆ lttng_userspace_probe_location_tracepoint_get_provider_name()

const char * lttng_userspace_probe_location_tracepoint_get_provider_name ( const struct lttng_userspace_probe_location location)
extern

Returns the provider name of the USDT Linux user space probe location location.

Parameters
[in]locationUSDT Linux user space probe location of which to get the provider name.
Returns

Probe name of location, or NULL on error.

location owns the returned string.

The returned string remains valid as long as location exists.

Precondition