projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introduce application contexts to session configuration schema
[lttng-tools.git]
/
src
/
common
/
ust-consumer
/
ust-consumer.c
diff --git
a/src/common/ust-consumer/ust-consumer.c
b/src/common/ust-consumer/ust-consumer.c
index 7dfcf9a3cf46381675222dfbcb94a474e0e8eaa9..44bcfdc374d9a0bd9b2ce869059fa912794a19c1 100644
(file)
--- a/
src/common/ust-consumer/ust-consumer.c
+++ b/
src/common/ust-consumer/ust-consumer.c
@@
-16,7
+16,6
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <assert.h>
#include <lttng/ust-ctl.h>
#define _LGPL_SOURCE
#include <assert.h>
#include <lttng/ust-ctl.h>
@@
-39,15
+38,15
@@
#include <common/relayd/relayd.h>
#include <common/compat/fcntl.h>
#include <common/compat/endian.h>
#include <common/relayd/relayd.h>
#include <common/compat/fcntl.h>
#include <common/compat/endian.h>
-#include <common/consumer-metadata-cache.h>
-#include <common/consumer-stream.h>
-#include <common/consumer-timer.h>
+#include <common/consumer
/consumer
-metadata-cache.h>
+#include <common/consumer
/consumer
-stream.h>
+#include <common/consumer
/consumer
-timer.h>
#include <common/utils.h>
#include <common/index/index.h>
#include "ust-consumer.h"
#include <common/utils.h>
#include <common/index/index.h>
#include "ust-consumer.h"
-#define
UINT_MAX_STR_LEN 11
/* includes \0 */
+#define
INT_MAX_STR_LEN 12
/* includes \0 */
extern struct lttng_consumer_global_data consumer_data;
extern int consumer_poll_timeout;
extern struct lttng_consumer_global_data consumer_data;
extern int consumer_poll_timeout;
@@
-82,6
+81,7
@@
static void destroy_channel(struct lttng_consumer_channel *channel)
*/
if (channel->uchan) {
lttng_ustconsumer_del_channel(channel);
*/
if (channel->uchan) {
lttng_ustconsumer_del_channel(channel);
+ lttng_ustconsumer_free_channel(channel);
}
free(channel);
}
}
free(channel);
}
@@
-247,14
+247,14
@@
error:
static
int get_stream_shm_path(char *stream_shm_path, const char *shm_path, int cpu)
{
static
int get_stream_shm_path(char *stream_shm_path, const char *shm_path, int cpu)
{
- char cpu_nr[
UINT_MAX_STR_LEN]; /* unsigned
int max len */
+ char cpu_nr[
INT_MAX_STR_LEN]; /*
int max len */
int ret;
strncpy(stream_shm_path, shm_path, PATH_MAX);
stream_shm_path[PATH_MAX - 1] = '\0';
int ret;
strncpy(stream_shm_path, shm_path, PATH_MAX);
stream_shm_path[PATH_MAX - 1] = '\0';
- ret = snprintf(cpu_nr,
UINT_MAX_STR_LEN, "%u
", cpu);
- if (ret
!= 1
) {
-
ret = -1
;
+ ret = snprintf(cpu_nr,
INT_MAX_STR_LEN, "%i
", cpu);
+ if (ret
< 0
) {
+
PERROR("snprintf")
;
goto end;
}
strncat(stream_shm_path, cpu_nr,
goto end;
}
strncat(stream_shm_path, cpu_nr,
@@
-1830,8
+1830,6
@@
void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
if (chan->switch_timer_enabled == 1) {
consumer_timer_switch_stop(chan);
}
if (chan->switch_timer_enabled == 1) {
consumer_timer_switch_stop(chan);
}
- consumer_metadata_cache_destroy(chan);
- ustctl_destroy_channel(chan->uchan);
for (i = 0; i < chan->nr_stream_fds; i++) {
int ret;
for (i = 0; i < chan->nr_stream_fds; i++) {
int ret;
@@
-1852,7
+1850,6
@@
void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
}
}
}
}
}
}
- free(chan->stream_fds);
/* Try to rmdir all directories under shm_path root. */
if (chan->root_shm_path[0]) {
(void) run_as_recursive_rmdir(chan->root_shm_path,
/* Try to rmdir all directories under shm_path root. */
if (chan->root_shm_path[0]) {
(void) run_as_recursive_rmdir(chan->root_shm_path,
@@
-1860,6
+1857,16
@@
void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
}
}
}
}
+void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan)
+{
+ assert(chan);
+ assert(chan->uchan);
+
+ consumer_metadata_cache_destroy(chan);
+ ustctl_destroy_channel(chan->uchan);
+ free(chan->stream_fds);
+}
+
void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
{
assert(stream);
void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
{
assert(stream);
This page took
0.024841 seconds
and
4
git commands to generate.