LTTng control library C API
Loading...
Searching...
No Matches
Error query API
Collaboration diagram for Error query API:

Modules

 Trigger action path API
 

Variables

struct lttng_endpointlttng_session_daemon_command_endpoint
 LTTng session daemon command endpoint.
 

Detailed Description

Warning

The documentation of the error query API is incomplete.

The text below shows the typical usage of this API, but the types, enumerators, and functions of lttng/error-query.h aren't documented individually.

An error query retrieves error information for a given trigger, its condition, or its action from an LTTng session daemon.

To perform an error query:

  1. Create the error query object with one of:

    Target Creation function
    Trigger lttng_error_query_trigger_create()
    Trigger condition lttng_error_query_condition_create()
    Trigger action lttng_error_query_action_create(), which accepts a trigger action path to locate a specific action within the action tree formed with action lists.
  2. Execute the error query against the LTTng session daemon endpoint with lttng_error_query_execute(), passing an #lttng_error_query_results pointer.

    You need to pass the lttng_session_daemon_command_endpoint endpoint to lttng_error_query_execute().

  3. Retrieve the number of results with lttng_error_query_results_get_count().
  4. Borrow a result by index from the results with lttng_error_query_results_get_result().

    For a given result:

    • Get the result type with lttng_error_query_result_get_type().
    • Borrow the name and description with lttng_error_query_result_get_name() and lttng_error_query_result_get_description().
    • If the result type is #LTTNG_ERROR_QUERY_RESULT_TYPE_COUNTER, retrieve the counter value with lttng_error_query_result_counter_get_value().
  5. When you're done with the results, destroy them with lttng_error_query_results_destroy().
  6. Whe you're done with the error query, destroy it with lttng_error_query_destroy().

Variable Documentation

◆ lttng_session_daemon_command_endpoint

struct lttng_endpoint* lttng_session_daemon_command_endpoint
extern

LTTng session daemon command endpoint.

This endpoint follows the typical session daemon connection procedure.

The purpose of this endpoint is to execute an error query with lttng_error_query_execute().