projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
relayd: close viewer stream trace chunk earlier on release
[lttng-tools.git]
/
src
/
bin
/
lttng-relayd
/
viewer-stream.c
diff --git
a/src/bin/lttng-relayd/viewer-stream.c
b/src/bin/lttng-relayd/viewer-stream.c
index 70cd1cea15c13c27823c7555383d37f26f07cae9..8e3a1949288dfddf250b0f5cd6edfb3690318218 100644
(file)
--- a/
src/bin/lttng-relayd/viewer-stream.c
+++ b/
src/bin/lttng-relayd/viewer-stream.c
@@
-27,7
+27,6
@@
static void viewer_stream_destroy(struct relay_viewer_stream *vstream)
{
static void viewer_stream_destroy(struct relay_viewer_stream *vstream)
{
- lttng_trace_chunk_put(vstream->stream_file.trace_chunk);
free(vstream->path_name);
free(vstream->channel_name);
free(vstream);
free(vstream->path_name);
free(vstream->channel_name);
free(vstream);
@@
-42,11
+41,12
@@
static void viewer_stream_destroy_rcu(struct rcu_head *head)
}
struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream,
}
struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream,
+ struct lttng_trace_chunk *viewer_trace_chunk,
enum lttng_viewer_seek seek_t)
{
struct relay_viewer_stream *vstream = NULL;
const bool acquired_reference = lttng_trace_chunk_get(
enum lttng_viewer_seek seek_t)
{
struct relay_viewer_stream *vstream = NULL;
const bool acquired_reference = lttng_trace_chunk_get(
-
stream->
trace_chunk);
+
viewer_
trace_chunk);
if (!acquired_reference) {
goto error;
if (!acquired_reference) {
goto error;
@@
-58,7
+58,8
@@
struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream,
goto error;
}
goto error;
}
- vstream->stream_file.trace_chunk = stream->trace_chunk;
+ vstream->stream_file.trace_chunk = viewer_trace_chunk;
+ viewer_trace_chunk = NULL;
vstream->path_name = lttng_strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
if (vstream->path_name == NULL) {
PERROR("relay viewer path_name alloc");
vstream->path_name = lttng_strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
if (vstream->path_name == NULL) {
PERROR("relay viewer path_name alloc");
@@
-104,7
+105,7
@@
struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream,
}
case LTTNG_VIEWER_SEEK_LAST:
vstream->current_tracefile_id =
}
case LTTNG_VIEWER_SEEK_LAST:
vstream->current_tracefile_id =
- tracefile_array_get_file_index_head(stream->tfa);
+ tracefile_array_get_
read_
file_index_head(stream->tfa);
/*
* We seek at the very end of each stream, awaiting for
* a future packet to eventually come in.
/*
* We seek at the very end of each stream, awaiting for
* a future packet to eventually come in.
@@
-130,7
+131,8
@@
struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream,
const uint32_t connection_minor = stream->trace->session->minor;
vstream->index_file = lttng_index_file_create_from_trace_chunk_read_only(
const uint32_t connection_minor = stream->trace->session->minor;
vstream->index_file = lttng_index_file_create_from_trace_chunk_read_only(
- stream->trace_chunk, stream->path_name,
+ vstream->stream_file.trace_chunk,
+ stream->path_name,
stream->channel_name, stream->tracefile_size,
vstream->current_tracefile_id,
lttng_to_index_major(connection_major,
stream->channel_name, stream->tracefile_size,
vstream->current_tracefile_id,
lttng_to_index_major(connection_major,
@@
-170,6
+172,9
@@
error:
if (vstream) {
viewer_stream_destroy(vstream);
}
if (vstream) {
viewer_stream_destroy(vstream);
}
+ if (viewer_trace_chunk && acquired_reference) {
+ lttng_trace_chunk_put(viewer_trace_chunk);
+ }
return NULL;
}
return NULL;
}
@@
-206,7
+211,8
@@
static void viewer_stream_release(struct urcu_ref *ref)
stream_put(vstream->stream);
vstream->stream = NULL;
}
stream_put(vstream->stream);
vstream->stream = NULL;
}
-
+ lttng_trace_chunk_put(vstream->stream_file.trace_chunk);
+ vstream->stream_file.trace_chunk = NULL;
call_rcu(&vstream->rcu_node, viewer_stream_destroy_rcu);
}
call_rcu(&vstream->rcu_node, viewer_stream_destroy_rcu);
}
@@
-313,7
+319,8
@@
int viewer_stream_rotate(struct relay_viewer_stream *vstream)
}
vstream->index_file =
lttng_index_file_create_from_trace_chunk_read_only(
}
vstream->index_file =
lttng_index_file_create_from_trace_chunk_read_only(
- stream->trace_chunk, stream->path_name,
+ vstream->stream_file.trace_chunk,
+ stream->path_name,
stream->channel_name,
stream->tracefile_size,
vstream->current_tracefile_id,
stream->channel_name,
stream->tracefile_size,
vstream->current_tracefile_id,
This page took
0.024484 seconds
and
4
git commands to generate.