LTTng control library C API
Loading...
Searching...
No Matches
Collaboration diagram for Linux kprobe location API:

Data Structures

struct  lttng_kernel_probe_location
 Linux kprobe location (opaque type). More...
 

Enumerations

enum  lttng_kernel_probe_location_status { LTTNG_KERNEL_PROBE_LOCATION_STATUS_OK , LTTNG_KERNEL_PROBE_LOCATION_STATUS_INVALID }
 Return type of Linux kprobe location API functions. More...
 
enum  lttng_kernel_probe_location_type { LTTNG_KERNEL_PROBE_LOCATION_TYPE_SYMBOL_OFFSET , LTTNG_KERNEL_PROBE_LOCATION_TYPE_ADDRESS , LTTNG_KERNEL_PROBE_LOCATION_TYPE_UNKNOWN }
 Linux kprobe location type. More...
 

Functions

struct lttng_kernel_probe_locationlttng_kernel_probe_location_address_create (uint64_t address)
 Creates a Linux kprobe location at the address address bytes within the kernel.
 
enum lttng_kernel_probe_location_status lttng_kernel_probe_location_address_get_address (const struct lttng_kernel_probe_location *location, uint64_t *address)
 Sets *address to the address within the kernel of the Linux kprobe location location.
 
void lttng_kernel_probe_location_destroy (struct lttng_kernel_probe_location *location)
 Destroys the Linux kprobe location location.
 
enum lttng_kernel_probe_location_type lttng_kernel_probe_location_get_type (const struct lttng_kernel_probe_location *location)
 Returns the type of the Linux kprobe location location.
 
struct lttng_kernel_probe_locationlttng_kernel_probe_location_symbol_create (const char *symbol_name, uint64_t offset)
 Creates a Linux kprobe location at the offset offset bytes from the kernel symbol named symbol.
 
const char * lttng_kernel_probe_location_symbol_get_name (const struct lttng_kernel_probe_location *location)
 Returns the symbol name of the Linux kprobe location location.
 
enum lttng_kernel_probe_location_status lttng_kernel_probe_location_symbol_get_offset (const struct lttng_kernel_probe_location *location, uint64_t *offset)
 Sets *offset to the offset from symbol of the Linux kprobe location location.
 

Detailed Description

A Linux kprobe location is an object which locates a Linux kprobe.

The purpose of such an object is to provide the location of the target Linux kprobe when you create a Linux kprobe event rule.

The two ways to locate a Linux kprobe are:

Location type Location enumerator Creation function
By offset from a named symbol LTTNG_KERNEL_PROBE_LOCATION_TYPE_SYMBOL_OFFSET lttng_kernel_probe_location_symbol_create()
By address within the kernel LTTNG_KERNEL_PROBE_LOCATION_TYPE_ADDRESS lttng_kernel_probe_location_address_create()

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

Destroy a Linux kprobe location with lttng_kernel_probe_location_destroy().

Enumeration Type Documentation

◆ lttng_kernel_probe_location_status

Return type of Linux kprobe location API functions.

Enumerator
LTTNG_KERNEL_PROBE_LOCATION_STATUS_OK 

Success.

LTTNG_KERNEL_PROBE_LOCATION_STATUS_INVALID 

Unsatisfied precondition.

◆ lttng_kernel_probe_location_type

Linux kprobe location type.

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

Enumerator
LTTNG_KERNEL_PROBE_LOCATION_TYPE_SYMBOL_OFFSET 

Offset from a named symbol.

LTTNG_KERNEL_PROBE_LOCATION_TYPE_ADDRESS 

Address within the kernel.

LTTNG_KERNEL_PROBE_LOCATION_TYPE_UNKNOWN 

Unknown (error).

Function Documentation

◆ lttng_kernel_probe_location_address_create()

struct lttng_kernel_probe_location * lttng_kernel_probe_location_address_create ( uint64_t  address)
extern

Creates a Linux kprobe location at the address address bytes within the kernel.

Parameters
[in]addressAddress (bytes) within the kernel of the Linux kprobe location to create.
Returns

Linux kprobe location with the type LTTNG_KERNEL_PROBE_LOCATION_TYPE_ADDRESS on success, or NULL on error.

Destroy the returned location with lttng_kernel_probe_location_destroy().

◆ lttng_kernel_probe_location_address_get_address()

enum lttng_kernel_probe_location_status lttng_kernel_probe_location_address_get_address ( const struct lttng_kernel_probe_location location,
uint64_t *  address 
)
extern

Sets *address to the address within the kernel of the Linux kprobe location location.

Parameters
[in]locationLinux kprobe location of which to get the address within the kernel.
[out]addressOn success, this function sets *address to the address (bytes) within the kernel of location.
Return values
LTTNG_KERNEL_PROBE_LOCATION_STATUS_OKSuccess.
LTTNG_KERNEL_PROBE_LOCATION_STATUS_INVALIDUnsatisfied precondition.
Precondition

◆ lttng_kernel_probe_location_destroy()

void lttng_kernel_probe_location_destroy ( struct lttng_kernel_probe_location location)
extern

Destroys the Linux kprobe location location.

Parameters
[in]location

Linux kprobe location to destroy.

May be NULL.

◆ lttng_kernel_probe_location_get_type()

enum lttng_kernel_probe_location_type lttng_kernel_probe_location_get_type ( const struct lttng_kernel_probe_location location)
extern

Returns the type of the Linux kprobe location location.

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

◆ lttng_kernel_probe_location_symbol_create()

struct lttng_kernel_probe_location * lttng_kernel_probe_location_symbol_create ( const char *  symbol_name,
uint64_t  offset 
)
extern

Creates a Linux kprobe location at the offset offset bytes from the kernel symbol named symbol.

Parameters
[in]symbol_nameSymbol name of the Linux kprobe location to create (copied).
[in]offsetOffset (bytes) from symbol of the Linux kprobe location to create.
Returns

Linux kprobe location with the type LTTNG_KERNEL_PROBE_LOCATION_TYPE_SYMBOL_OFFSET on success, or NULL on error.

Destroy the returned location with lttng_kernel_probe_location_destroy().

Precondition
  • symbol_name is not NULL.

◆ lttng_kernel_probe_location_symbol_get_name()

const char * lttng_kernel_probe_location_symbol_get_name ( const struct lttng_kernel_probe_location location)
extern

Returns the symbol name of the Linux kprobe location location.

Parameters
[in]locationLinux kprobe location of which to get the symbol name.
Returns

Symbol name of location, or NULL on error.

location owns the returned string.

The returned string remains valid as long as location exists.

Precondition
See also
lttng_kernel_probe_location_symbol_get_offset() – Get the offset from symbol of a Linux kprobe location.

◆ lttng_kernel_probe_location_symbol_get_offset()

enum lttng_kernel_probe_location_status lttng_kernel_probe_location_symbol_get_offset ( const struct lttng_kernel_probe_location location,
uint64_t *  offset 
)
extern

Sets *offset to the offset from symbol of the Linux kprobe location location.

Parameters
[in]locationLinux kprobe location of which to get the offset from symbol.
[out]offsetOn success, this function sets *offset to the offset (bytes) from symbol of location.
Return values
LTTNG_KERNEL_PROBE_LOCATION_STATUS_OKSuccess.
LTTNG_KERNEL_PROBE_LOCATION_STATUS_INVALIDUnsatisfied precondition.
Precondition
See also
lttng_kernel_probe_location_symbol_get_name() – Get the symbol name of a Linux kprobe location.