* If the event has no probe location a NULL pointer is returned. The caller
* does not own the returned probe location.
*/
-extern struct lttng_userspace_probe_location *
-lttng_event_get_userspace_probe_location(struct lttng_event *event);
+extern const struct lttng_userspace_probe_location *
+lttng_event_get_userspace_probe_location(const struct lttng_event *event);
/*
* Set an LTTng event's userspace probe location.
*
* 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);
*/
static
int extract_userspace_probe_offset_function_elf(
- struct lttng_userspace_probe_location *probe_location,
+ const struct lttng_userspace_probe_location *probe_location,
struct ltt_kernel_session *session, uint64_t *offset)
{
int fd;
int ret = 0;
const char *symbol = NULL;
- struct lttng_userspace_probe_location_lookup_method *lookup = NULL;
+ const struct lttng_userspace_probe_location_lookup_method *lookup = NULL;
enum lttng_userspace_probe_location_lookup_method_type lookup_method_type;
-
assert(lttng_userspace_probe_location_get_type(probe_location) ==
LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION);
*/
static
int extract_userspace_probe_offset_tracepoint_sdt(
- struct lttng_userspace_probe_location *probe_location,
+ const struct lttng_userspace_probe_location *probe_location,
struct ltt_kernel_session *session, uint64_t **offsets,
uint32_t *offsets_count)
{
enum lttng_userspace_probe_location_lookup_method_type lookup_method_type;
- struct lttng_userspace_probe_location_lookup_method *lookup = NULL;
+ const struct lttng_userspace_probe_location_lookup_method *lookup = NULL;
const char *probe_name = NULL, *provider_name = NULL;
int ret = 0;
int fd, i;
int userspace_probe_add_callsites(struct lttng_event *ev,
struct ltt_kernel_session *session, int fd)
{
- struct lttng_userspace_probe_location_lookup_method *lookup_method = NULL;
+ const struct lttng_userspace_probe_location_lookup_method *lookup_method = NULL;
enum lttng_userspace_probe_location_lookup_method_type type;
- struct lttng_userspace_probe_location *location = NULL;
+ const struct lttng_userspace_probe_location *location = NULL;
int ret;
assert(ev);
{
int fd, ret;
struct lttng_userspace_probe_location *probe_location;
- struct lttng_userspace_probe_location_lookup_method *lookup = NULL;
+ const struct lttng_userspace_probe_location_lookup_method *lookup = NULL;
struct lttng_dynamic_buffer probe_location_buffer;
struct lttng_buffer_view buffer_view;
{
int ret = 0;
const char *probe_name, *provider_name, *binary_path;
- struct lttng_userspace_probe_location *userspace_probe_location;
- struct lttng_userspace_probe_location_lookup_method *lookup_method;
+ const struct lttng_userspace_probe_location *userspace_probe_location;
+ const struct lttng_userspace_probe_location_lookup_method *lookup_method;
enum lttng_userspace_probe_location_lookup_method_type lookup_type;
/* Get userspace probe location from the event. */
{
int ret = 0;
const char *function_name, *binary_path;
- struct lttng_userspace_probe_location *userspace_probe_location;
- struct lttng_userspace_probe_location_lookup_method *lookup_method;
+ const struct lttng_userspace_probe_location *userspace_probe_location;
+ const struct lttng_userspace_probe_location_lookup_method *lookup_method;
enum lttng_userspace_probe_location_lookup_method_type lookup_type;
/* Get userspace probe location from the event. */
break;
case LTTNG_EVENT_USERSPACE_PROBE:
{
- struct lttng_userspace_probe_location* location = NULL;
- struct lttng_userspace_probe_location_lookup_method *lookup = NULL;
+ const struct lttng_userspace_probe_location* location = NULL;
+ const struct lttng_userspace_probe_location_lookup_method *lookup = NULL;
location = lttng_event_get_userspace_probe_location(ev);
if (!location) {
static void print_userspace_probe_location(struct lttng_event *event)
{
- struct lttng_userspace_probe_location *location;
- struct lttng_userspace_probe_location_lookup_method *lookup_method;
+ const struct lttng_userspace_probe_location *location;
+ const struct lttng_userspace_probe_location_lookup_method *lookup_method;
enum lttng_userspace_probe_location_lookup_method_type lookup_type;
location = lttng_event_get_userspace_probe_location(event);
struct lttng_event *event)
{
int ret;
- struct lttng_userspace_probe_location *location;
- struct lttng_userspace_probe_location_lookup_method *lookup_method;
+ const struct lttng_userspace_probe_location *location;
+ const struct lttng_userspace_probe_location_lookup_method *lookup_method;
enum lttng_userspace_probe_location_lookup_method_type lookup_type;
location = lttng_event_get_userspace_probe_location(event);
return ret;
}
-struct lttng_userspace_probe_location_lookup_method *
+const struct lttng_userspace_probe_location_lookup_method *
lttng_userspace_probe_location_get_lookup_method(
const struct lttng_userspace_probe_location *location)
{
return ret;
}
-struct lttng_userspace_probe_location *
-lttng_event_get_userspace_probe_location(struct lttng_event *event)
+const struct lttng_userspace_probe_location *
+lttng_event_get_userspace_probe_location(const struct lttng_event *event)
{
struct lttng_userspace_probe_location *probe_location = NULL;
struct lttng_event_extended *event_extended;