Class Kprobe

Class Documentation

class Kprobe

Class representing a Kprobe in the kernel.

Public Functions

Kprobe(const char *function_name, uint8_t arg_count = 0, enum kprobe_log_mode log_mode = (kprobe_log_mode)(ENTRY_WITH_CALLSTACK | RETURN), const char *log_call_stack_filter = nullptr)

Constructor for the Kprobe class.

Parameters:
  • function_name – The name of the function to probe.

  • arg_count – The number of arguments to log (default is 0).

  • log_mode – The logging mode (default is ENTRY_WITH_CALLSTACK | RETURN).

  • log_call_stack_filter – An optional filter for the call stack (default is nullptr).

std::vector<CallLog> GetCallLogs(bool clear_log = false)

Retrieves the call logs for this Kprobe.

Parameters:

clear_log – Whether to clear the log after retrieving (default is false).

Returns:

A vector of CallLog structures.

void PrintCallLog(bool clear_log = false)

Prints the call logs for this Kprobe to the console.

Parameters:

clear_log – Whether to clear the log after printing (default is false).

~Kprobe()

Destructor for the Kprobe class.

Friends

friend class XdkDevice