struct ltt_kernel_session *lks = NULL;
/* Allocate a new ltt kernel session */
- lks = zmalloc<ltt_kernel_session>();
+ lks = new ltt_kernel_session;
if (lks == NULL) {
PERROR("create kernel session zmalloc");
goto alloc_error;
}
+ lks->active = 0;
+
/* Init data structure */
- lks->fd = -1;
- lks->metadata_stream_fd = -1;
- lks->channel_count = 0;
- lks->stream_count_global = 0;
- lks->metadata = NULL;
CDS_INIT_LIST_HEAD(&lks->channel_list.head);
lks->tracker_pid = process_attr_tracker_create();
process_attr_tracker_destroy(lks->tracker_vuid);
process_attr_tracker_destroy(lks->tracker_gid);
process_attr_tracker_destroy(lks->tracker_vgid);
- free(lks);
+ delete (lks);
alloc_error:
return NULL;
process_attr_tracker_destroy(session->tracker_gid);
process_attr_tracker_destroy(session->tracker_vgid);
- free(session);
+ delete (session);
}
/* Kernel session */
struct ltt_kernel_session {
- int fd;
- int metadata_stream_fd;
- int consumer_fds_sent;
- unsigned int channel_count;
- unsigned int stream_count_global;
- struct ltt_kernel_metadata *metadata;
- struct ltt_kernel_channel_list channel_list;
+ int fd{-1};
+ int metadata_stream_fd{-1};
+ int consumer_fds_sent{};
+ unsigned int channel_count{};
+ unsigned int stream_count_global{};
+ struct ltt_kernel_metadata *metadata{};
+ struct ltt_kernel_channel_list channel_list {};
/* UID/GID of the user owning the session */
- uid_t uid;
- gid_t gid;
- struct consumer_output *consumer;
+ uid_t uid{};
+ gid_t gid{};
+ struct consumer_output *consumer{};
/* Tracing session id */
- uint64_t id;
+ uint64_t id{};
/* Session is active or not meaning it has been started or stopped. */
unsigned int active:1;
/* Tell or not if the session has to output the traces. */
- unsigned int output_traces;
- unsigned int snapshot_mode;
- unsigned int has_non_default_channel;
- bool is_live_session;
+ unsigned int output_traces{};
+ unsigned int snapshot_mode{};
+ unsigned int has_non_default_channel{};
+ bool is_live_session{false};
/* Current trace chunk of the ltt_session. */
- struct lttng_trace_chunk *current_trace_chunk;
+ struct lttng_trace_chunk *current_trace_chunk{};
/* Tracker lists */
- struct process_attr_tracker *tracker_pid;
- struct process_attr_tracker *tracker_vpid;
- struct process_attr_tracker *tracker_uid;
- struct process_attr_tracker *tracker_vuid;
- struct process_attr_tracker *tracker_gid;
- struct process_attr_tracker *tracker_vgid;
+ struct process_attr_tracker *tracker_pid{};
+ struct process_attr_tracker *tracker_vpid{};
+ struct process_attr_tracker *tracker_uid{};
+ struct process_attr_tracker *tracker_vuid{};
+ struct process_attr_tracker *tracker_gid{};
+ struct process_attr_tracker *tracker_vgid{};
};
/*