projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix context order: stream before event
[lttng-modules.git]
/
ltt-events.c
diff --git
a/ltt-events.c
b/ltt-events.c
index 42d486c195d73c8cdfd265b6a54a5d2bd20950ec..3532dee5a1c8d46e246fa14c8e6c07a1257f26c7 100644
(file)
--- a/
ltt-events.c
+++ b/
ltt-events.c
@@
-14,7
+14,7
@@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
-#include
<linux/uuid.h>
+#include
"wrapper/uuid.h"
#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "ltt-events.h"
#include "ltt-tracer.h"
#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "ltt-events.h"
#include "ltt-tracer.h"
@@
-34,8
+34,6
@@
int _ltt_event_metadata_statedump(struct ltt_session *session,
static
int _ltt_session_metadata_statedump(struct ltt_session *session);
static
int _ltt_session_metadata_statedump(struct ltt_session *session);
-
-static
void synchronize_trace(void)
{
synchronize_sched();
void synchronize_trace(void)
{
synchronize_sched();
@@
-108,12
+106,9
@@
int ltt_session_enable(struct ltt_session *session)
ACCESS_ONCE(session->active) = 1;
ACCESS_ONCE(session->been_active) = 1;
ACCESS_ONCE(session->active) = 1;
ACCESS_ONCE(session->been_active) = 1;
- synchronize_trace(); /* Wait for in-flight events to complete */
ret = _ltt_session_metadata_statedump(session);
ret = _ltt_session_metadata_statedump(session);
- if (ret)
{
+ if (ret)
ACCESS_ONCE(session->active) = 0;
ACCESS_ONCE(session->active) = 0;
- synchronize_trace(); /* Wait for in-flight events to complete */
- }
end:
mutex_unlock(&sessions_mutex);
return ret;
end:
mutex_unlock(&sessions_mutex);
return ret;
@@
-129,7
+124,6
@@
int ltt_session_disable(struct ltt_session *session)
goto end;
}
ACCESS_ONCE(session->active) = 0;
goto end;
}
ACCESS_ONCE(session->active) = 0;
- synchronize_trace(); /* Wait for in-flight events to complete */
end:
mutex_unlock(&sessions_mutex);
return ret;
end:
mutex_unlock(&sessions_mutex);
return ret;
@@
-202,7
+196,7
@@
struct ltt_channel *ltt_channel_create(struct ltt_session *session,
unsigned int read_timer_interval)
{
struct ltt_channel *chan;
unsigned int read_timer_interval)
{
struct ltt_channel *chan;
- struct ltt_transport *transport;
+ struct ltt_transport *transport
= NULL
;
mutex_lock(&sessions_mutex);
if (session->been_active)
mutex_lock(&sessions_mutex);
if (session->been_active)
@@
-213,6
+207,10
@@
struct ltt_channel *ltt_channel_create(struct ltt_session *session,
transport_name);
goto notransport;
}
transport_name);
goto notransport;
}
+ if (!try_module_get(transport->owner)) {
+ printk(KERN_WARNING "LTT : Can't lock transport module.\n");
+ goto notransport;
+ }
chan = kzalloc(sizeof(struct ltt_channel), GFP_KERNEL);
if (!chan)
goto nomem;
chan = kzalloc(sizeof(struct ltt_channel), GFP_KERNEL);
if (!chan)
goto nomem;
@@
-230,6
+228,7
@@
struct ltt_channel *ltt_channel_create(struct ltt_session *session,
goto create_error;
chan->enabled = 1;
chan->ops = &transport->ops;
goto create_error;
chan->enabled = 1;
chan->ops = &transport->ops;
+ chan->transport = transport;
list_add(&chan->list, &session->chan);
mutex_unlock(&sessions_mutex);
return chan;
list_add(&chan->list, &session->chan);
mutex_unlock(&sessions_mutex);
return chan;
@@
-237,6
+236,8
@@
struct ltt_channel *ltt_channel_create(struct ltt_session *session,
create_error:
kfree(chan);
nomem:
create_error:
kfree(chan);
nomem:
+ if (transport)
+ module_put(transport->owner);
notransport:
active:
mutex_unlock(&sessions_mutex);
notransport:
active:
mutex_unlock(&sessions_mutex);
@@
-250,6
+251,7
@@
static
void _ltt_channel_destroy(struct ltt_channel *chan)
{
chan->ops->channel_destroy(chan->chan);
void _ltt_channel_destroy(struct ltt_channel *chan)
{
chan->ops->channel_destroy(chan->chan);
+ module_put(chan->transport->owner);
list_del(&chan->list);
lttng_destroy_context(chan->ctx);
kfree(chan);
list_del(&chan->list);
lttng_destroy_context(chan->ctx);
kfree(chan);
This page took
0.025427 seconds
and
4
git commands to generate.