#include <common/defaults.h>
#include "consumer.h"
+#include "health.h"
#include "kernel-consumer.h"
/*
/* Get the right path name destination */
if (consumer->type == CONSUMER_DST_LOCAL) {
/* Set application path to the destination path */
- ret = snprintf(tmp_path, sizeof(tmp_path), "%s/%s",
+ ret = snprintf(tmp_path, sizeof(tmp_path), "%s%s",
consumer->dst.trace_path, consumer->subdir);
if (ret < 0) {
PERROR("snprintf metadata path");
channel->channel->name,
channel->stream_count,
channel->channel->attr.output,
- CONSUMER_CHANNEL_TYPE_DATA);
+ CONSUMER_CHANNEL_TYPE_DATA,
+ channel->channel->attr.tracefile_size,
+ channel->channel->attr.tracefile_count);
health_code_update();
* Sending metadata to the consumer with command ADD_CHANNEL and ADD_STREAM.
*/
int kernel_consumer_add_metadata(struct consumer_socket *sock,
- struct ltt_kernel_session *session)
+ struct ltt_kernel_session *session, int no_monitor)
{
int ret;
char tmp_path[PATH_MAX];
/* Get the right path name destination */
if (consumer->type == CONSUMER_DST_LOCAL) {
/* Set application path to the destination path */
- ret = snprintf(tmp_path, sizeof(tmp_path), "%s/%s",
+ ret = snprintf(tmp_path, sizeof(tmp_path), "%s%s",
consumer->dst.trace_path, consumer->subdir);
if (ret < 0) {
PERROR("snprintf metadata path");
DEFAULT_METADATA_NAME,
1,
DEFAULT_KERNEL_CHANNEL_OUTPUT,
- CONSUMER_CHANNEL_TYPE_METADATA);
+ CONSUMER_CHANNEL_TYPE_METADATA,
+ 0, 0);
health_code_update();
LTTNG_CONSUMER_ADD_STREAM,
session->metadata->fd,
session->metadata_stream_fd,
- 0); /* CPU: 0 for metadata. */
+ 0); /* CPU: 0 for metadata. */
+
+ /*
+ * Set the no monitor flag. If set to 1, it indicates the consumer to NOT
+ * monitor the stream but rather add it to a special list in the associated
+ * channel. This is used to handle ephemeral stream used by the snapshot
+ * command or store streams for the flight recorder mode.
+ */
+ lkm.u.stream.no_monitor = no_monitor;
health_code_update();
DBG("Sending session stream to kernel consumer");
if (session->metadata_stream_fd >= 0) {
- ret = kernel_consumer_add_metadata(sock, session);
+ ret = kernel_consumer_add_metadata(sock, session, 0);
if (ret < 0) {
goto error;
}