[lttng-dev] [PATCH lttng-modules] Fix: build failure on 2.6.36

Michael Jeanson mjeanson at efficios.com
Sat Aug 29 13:03:39 EDT 2015


Fixes build failure on the 2.6.36 kernel branch which misses the
vzalloc() function.

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 lttng-events.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lttng-events.c b/lttng-events.c
index b49851b..422a2dd 100644
--- a/lttng-events.c
+++ b/lttng-events.c
@@ -133,7 +133,12 @@ struct lttng_session *lttng_session_create(void)
 			GFP_KERNEL);
 	if (!metadata_cache)
 		goto err_free_session;
+#if LTTNG_KERNEL_RANGE(2,6,36, 2,6,37)
+	metadata_cache->data = vmalloc(METADATA_CACHE_DEFAULT_SIZE);
+	memset(metadata_cache->data, 0, METADATA_CACHE_DEFAULT_SIZE);
+#else
 	metadata_cache->data = vzalloc(METADATA_CACHE_DEFAULT_SIZE);
+#endif
 	if (!metadata_cache->data)
 		goto err_free_cache;
 	metadata_cache->cache_alloc = METADATA_CACHE_DEFAULT_SIZE;
@@ -1531,7 +1536,12 @@ int lttng_metadata_printf(struct lttng_session *session,
 		tmp_cache_alloc_size = max_t(unsigned int,
 				session->metadata_cache->cache_alloc + len,
 				session->metadata_cache->cache_alloc << 1);
+#if LTTNG_KERNEL_RANGE(2,6,36, 2,6,37)
+		tmp_cache_realloc = vmalloc(tmp_cache_alloc_size);
+		memset(tmp_cache_realloc, 0, tmp_cache_alloc_size);
+#else
 		tmp_cache_realloc = vzalloc(tmp_cache_alloc_size);
+#endif
 		if (!tmp_cache_realloc)
 			goto err;
 		if (session->metadata_cache->data) {
-- 
1.9.1




More information about the lttng-dev mailing list