projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: compilation warnings on 4.1-rc1 kernel
[lttng-modules.git]
/
lttng-events.c
diff --git
a/lttng-events.c
b/lttng-events.c
index 701cff8ca8ff8663f82c0148bfb4ac15448bf81c..2820a0e4d1f9045017dd772d08b7f9325be85cc9 100644
(file)
--- a/
lttng-events.c
+++ b/
lttng-events.c
@@
-20,6
+20,12
@@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+/*
+ * This page_alloc.h wrapper needs to be included before gfpflags.h because it
+ * overrides a function with a define.
+ */
+#include "wrapper/page_alloc.h"
+
#include <linux/module.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/list.h>
#include <linux/mutex.h>
@@
-98,6
+104,8
@@
struct lttng_session *lttng_session_create(void)
kref_init(&metadata_cache->refcount);
session->metadata_cache = metadata_cache;
INIT_LIST_HEAD(&metadata_cache->metadata_stream);
kref_init(&metadata_cache->refcount);
session->metadata_cache = metadata_cache;
INIT_LIST_HEAD(&metadata_cache->metadata_stream);
+ memcpy(&metadata_cache->uuid, &session->uuid,
+ sizeof(metadata_cache->uuid));
list_add(&session->list, &sessions);
mutex_unlock(&sessions_mutex);
return session;
list_add(&session->list, &sessions);
mutex_unlock(&sessions_mutex);
return session;
@@
-377,8
+385,14
@@
struct lttng_event *lttng_event_create(struct lttng_channel *chan,
*/
list_for_each_entry(event, &chan->session->events, list) {
if (!strcmp(event->desc->name, event_param->name)) {
*/
list_for_each_entry(event, &chan->session->events, list) {
if (!strcmp(event->desc->name, event_param->name)) {
- ret = -EEXIST;
- goto exist;
+ /*
+ * Allow events with the same name to appear in
+ * different channels.
+ */
+ if (event->chan == chan) {
+ ret = -EEXIST;
+ goto exist;
+ }
}
}
event = kmem_cache_zalloc(event_cache, GFP_KERNEL);
}
}
event = kmem_cache_zalloc(event_cache, GFP_KERNEL);
@@
-597,16
+611,20
@@
int lttng_metadata_output_channel(struct lttng_metadata_stream *stream,
/*
* Ensure we support mutiple get_next / put sequences followed
/*
* Ensure we support mutiple get_next / put sequences followed
- * by put_next.
+ * by put_next. The metadata stream lock internally protects
+ * reading the metadata cache. It can indeed be read
+ * concurrently by "get_next_subbuf" and "flush" operations on
+ * the buffer invoked by different processes.
*/
*/
+ mutex_lock(&stream->lock);
WARN_ON(stream->metadata_in < stream->metadata_out);
if (stream->metadata_in != stream->metadata_out)
WARN_ON(stream->metadata_in < stream->metadata_out);
if (stream->metadata_in != stream->metadata_out)
-
return 0
;
+
goto end
;
len = stream->metadata_cache->metadata_written -
stream->metadata_in;
if (!len)
len = stream->metadata_cache->metadata_written -
stream->metadata_in;
if (!len)
-
return 0
;
+
goto end
;
reserve_len = min_t(size_t,
stream->transport->ops.packet_avail_size(chan),
len);
reserve_len = min_t(size_t,
stream->transport->ops.packet_avail_size(chan),
len);
@@
-628,6
+646,7
@@
int lttng_metadata_output_channel(struct lttng_metadata_stream *stream,
ret = reserve_len;
end:
ret = reserve_len;
end:
+ mutex_unlock(&stream->lock);
return ret;
}
return ret;
}
@@
-1258,7
+1277,9
@@
static int __init lttng_events_init(void)
ret = wrapper_lttng_fixup_sig(THIS_MODULE);
if (ret)
return ret;
ret = wrapper_lttng_fixup_sig(THIS_MODULE);
if (ret)
return ret;
-
+ ret = wrapper_get_pfnblock_flags_mask_init();
+ if (ret)
+ return ret;
ret = lttng_tracepoint_init();
if (ret)
return ret;
ret = lttng_tracepoint_init();
if (ret)
return ret;
This page took
0.023449 seconds
and
4
git commands to generate.