/*
- * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
- * Copyright (C) 2016 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _LTT_TRACE_UST_H
#include <common/defaults.h>
#include "consumer.h"
-#include "ust-ctl.h"
+#include "lttng-ust-ctl.h"
struct agent;
struct cds_list_head registry_buffer_uid_list;
};
-struct ust_pid_tracker_node {
+struct ust_id_tracker_node {
struct lttng_ht_node_ulong node;
};
-struct ust_pid_tracker {
+struct ust_id_tracker {
struct lttng_ht *ht;
};
char root_shm_path[PATH_MAX];
char shm_path[PATH_MAX];
- struct ust_pid_tracker pid_tracker;
-
/* Current trace chunk of the ltt_session. */
struct lttng_trace_chunk *current_trace_chunk;
+
+ /* Trackers used for actual lookup on app registration. */
+ struct ust_id_tracker vpid_tracker;
+ struct ust_id_tracker vuid_tracker;
+ struct ust_id_tracker vgid_tracker;
+
+ /* Tracker list of keys requested by users. */
+ struct lttng_tracker_list *tracker_list_vpid;
+ struct lttng_tracker_list *tracker_list_vuid;
+ struct lttng_tracker_list *tracker_list_vgid;
};
/*
enum lttng_ust_loglevel_type loglevel_type, int loglevel_value,
struct lttng_event_exclusion *exclusion);
struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht,
- char *name);
+ const char *name);
struct agent *trace_ust_find_agent(struct ltt_ust_session *session,
enum lttng_domain_type domain_type);
struct lttng_event_exclusion *exclusion,
bool internal_event, struct ltt_ust_event **ust_event);
struct ltt_ust_context *trace_ust_create_context(
- struct lttng_event_context *ctx);
-int trace_ust_match_context(struct ltt_ust_context *uctx,
- struct lttng_event_context *ctx);
+ const struct lttng_event_context *ctx);
+int trace_ust_match_context(const struct ltt_ust_context *uctx,
+ const struct lttng_event_context *ctx);
void trace_ust_delete_channel(struct lttng_ht *ht,
struct ltt_ust_channel *channel);
void trace_ust_destroy_channel(struct ltt_ust_channel *channel);
void trace_ust_destroy_event(struct ltt_ust_event *event);
void trace_ust_destroy_context(struct ltt_ust_context *ctx);
+void trace_ust_free_session(struct ltt_ust_session *session);
-int trace_ust_track_pid(struct ltt_ust_session *session, int pid);
-int trace_ust_untrack_pid(struct ltt_ust_session *session, int pid);
+int trace_ust_track_id(enum lttng_tracker_type tracker_type,
+ struct ltt_ust_session *session,
+ const struct lttng_tracker_id *id);
+int trace_ust_untrack_id(enum lttng_tracker_type tracker_type,
+ struct ltt_ust_session *session,
+ const struct lttng_tracker_id *id);
-int trace_ust_pid_tracker_lookup(struct ltt_ust_session *session, int pid);
+int trace_ust_id_tracker_lookup(enum lttng_tracker_type tracker_type,
+ struct ltt_ust_session *session,
+ int id);
-ssize_t trace_ust_list_tracker_pids(struct ltt_ust_session *session,
- int32_t **_pids);
+int trace_ust_list_tracker_ids(enum lttng_tracker_type tracker_type,
+ struct ltt_ust_session *session,
+ struct lttng_tracker_ids **_ids);
#else /* HAVE_LIBLTTNG_UST_CTL */
}
static inline
struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht,
- char *name)
+ const char *name)
{
return NULL;
}
void trace_ust_destroy_event(struct ltt_ust_event *event)
{
}
+
+static inline
+void trace_ust_free_session(struct ltt_ust_session *session)
+{
+}
+
static inline
struct ltt_ust_context *trace_ust_create_context(
- struct lttng_event_context *ctx)
+ const struct lttng_event_context *ctx)
{
return NULL;
}
static inline
-int trace_ust_match_context(struct ltt_ust_context *uctx,
- struct lttng_event_context *ctx)
+int trace_ust_match_context(const struct ltt_ust_context *uctx,
+ const struct lttng_event_context *ctx)
{
return 0;
}
{
return NULL;
}
-static inline
-int trace_ust_track_pid(struct ltt_ust_session *session, int pid)
+static inline int trace_ust_track_id(enum lttng_tracker_type tracker_type,
+ struct ltt_ust_session *session,
+ const struct lttng_tracker_id *id)
{
return 0;
}
-static inline
-int trace_ust_untrack_pid(struct ltt_ust_session *session, int pid)
+static inline int trace_ust_untrack_id(enum lttng_tracker_type tracker_type,
+ struct ltt_ust_session *session,
+ const struct lttng_tracker_id *id)
{
return 0;
}
-static inline
-int trace_ust_pid_tracker_lookup(struct ltt_ust_session *session, int pid)
+static inline int trace_ust_id_tracker_lookup(
+ enum lttng_tracker_type tracker_type,
+ struct ltt_ust_session *session,
+ int pid)
{
return 0;
}
-static inline
-ssize_t trace_ust_list_tracker_pids(struct ltt_ust_session *session,
- int32_t **_pids)
+static inline int trace_ust_list_tracker_ids(
+ enum lttng_tracker_type tracker_type,
+ struct ltt_ust_session *session,
+ struct lttng_tracker_ids **_ids)
{
return -1;
}