#include <unistd.h>
#include <inttypes.h>
-#include <common/common.h>
-#include <common/defaults.h>
-#include <common/trace-chunk.h>
-#include <common/utils.h>
+#include <common/common.hpp>
+#include <common/defaults.hpp>
+#include <common/trace-chunk.hpp>
+#include <common/utils.hpp>
-#include "buffer-registry.h"
-#include "trace-ust.h"
-#include "utils.h"
-#include "ust-app.h"
-#include "agent.h"
+#include "buffer-registry.hpp"
+#include "trace-ust.hpp"
+#include "utils.hpp"
+#include "ust-app.hpp"
+#include "agent.hpp"
/*
* Match function for the events hash table lookup.
struct lttng_ht_node_str *node;
struct lttng_ht_iter iter;
+ ASSERT_RCU_READ_LOCKED();
/*
* If we receive an empty string for channel name, it means the
* default channel name is requested.
LTTNG_ASSERT(name);
LTTNG_ASSERT(ht);
+ ASSERT_RCU_READ_LOCKED();
key.name = name;
key.filter = filter;
struct ltt_ust_session *lus;
/* Allocate a new ltt ust session */
- lus = (ltt_ust_session *) zmalloc(sizeof(struct ltt_ust_session));
+ lus = zmalloc<ltt_ust_session>();
if (lus == NULL) {
PERROR("create ust session zmalloc");
goto error_alloc;
process_attr_tracker_destroy(lus->tracker_vpid);
process_attr_tracker_destroy(lus->tracker_vuid);
process_attr_tracker_destroy(lus->tracker_vgid);
- ht_cleanup_push(lus->domain_global.channels);
- ht_cleanup_push(lus->agents);
+ lttng_ht_destroy(lus->domain_global.channels);
+ lttng_ht_destroy(lus->agents);
free(lus);
error_alloc:
return NULL;
LTTNG_ASSERT(chan);
- luc = (ltt_ust_channel *) zmalloc(sizeof(struct ltt_ust_channel));
+ luc = zmalloc<ltt_ust_channel>();
if (luc == NULL) {
PERROR("ltt_ust_channel zmalloc");
goto error;
goto error;
}
- local_ust_event = (ltt_ust_event *) zmalloc(sizeof(struct ltt_ust_event));
+ local_ust_event = zmalloc<ltt_ust_event>();
if (local_ust_event == NULL) {
PERROR("ust event zmalloc");
ret = LTTNG_ERR_NOMEM;
goto end;
}
- uctx = (ltt_ust_context *) zmalloc(sizeof(struct ltt_ust_context));
+ uctx = zmalloc<ltt_ust_context>();
if (!uctx) {
PERROR("zmalloc ltt_ust_context");
goto end;
destroy_id_tracker_node(tracker_node);
}
rcu_read_unlock();
- ht_cleanup_push(id_tracker->ht);
+ lttng_ht_destroy(id_tracker->ht);
id_tracker->ht = NULL;
}
retval = LTTNG_ERR_PROCESS_ATTR_EXISTS;
goto end;
}
- tracker_node = (ust_id_tracker_node *) zmalloc(sizeof(*tracker_node));
+ tracker_node = zmalloc<ust_id_tracker_node>();
if (!tracker_node) {
retval = LTTNG_ERR_NOMEM;
goto end;
}
rcu_read_unlock();
- ht_cleanup_push(ht);
+ lttng_ht_destroy(ht);
}
/*
}
rcu_read_unlock();
- ht_cleanup_push(events);
+ lttng_ht_destroy(events);
}
/*
}
rcu_read_unlock();
- ht_cleanup_push(channels);
+ lttng_ht_destroy(channels);
}
/*
/*
* Cleanup ust session structure, keeping data required by
* destroy notifier.
- *
- * Should *NOT* be called with RCU read-side lock held.
*/
void trace_ust_destroy_session(struct ltt_ust_session *session)
{
}
rcu_read_unlock();
- ht_cleanup_push(session->agents);
+ lttng_ht_destroy(session->agents);
/* Cleanup UID buffer registry object(s). */
cds_list_for_each_entry_safe(reg, sreg, &session->buffer_reg_uid_list,