projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: update sched wakeup instrumentation for 4.3 kernel
[lttng-modules.git]
/
lttng-events.c
diff --git
a/lttng-events.c
b/lttng-events.c
index 9b3d766915fd4dcd78f564b1681497eccccf5b26..d02f4dff0596934ad256c92fe45c01fa3edf5b8c 100644
(file)
--- a/
lttng-events.c
+++ b/
lttng-events.c
@@
-34,6
+34,8
@@
#include <linux/jiffies.h>
#include <linux/utsname.h>
#include <linux/err.h>
#include <linux/jiffies.h>
#include <linux/utsname.h>
#include <linux/err.h>
+#include <linux/vmalloc.h>
+
#include "wrapper/uuid.h"
#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "wrapper/random.h"
#include "wrapper/uuid.h"
#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "wrapper/random.h"
@@
-42,6
+44,7
@@
#include "lttng-events.h"
#include "lttng-tracer.h"
#include "lttng-abi-old.h"
#include "lttng-events.h"
#include "lttng-tracer.h"
#include "lttng-abi-old.h"
+#include "wrapper/vzalloc.h"
#define METADATA_CACHE_DEFAULT_SIZE 4096
#define METADATA_CACHE_DEFAULT_SIZE 4096
@@
-96,8
+99,7
@@
struct lttng_session *lttng_session_create(void)
GFP_KERNEL);
if (!metadata_cache)
goto err_free_session;
GFP_KERNEL);
if (!metadata_cache)
goto err_free_session;
- metadata_cache->data = kzalloc(METADATA_CACHE_DEFAULT_SIZE,
- GFP_KERNEL);
+ metadata_cache->data = lttng_vzalloc(METADATA_CACHE_DEFAULT_SIZE);
if (!metadata_cache->data)
goto err_free_cache;
metadata_cache->cache_alloc = METADATA_CACHE_DEFAULT_SIZE;
if (!metadata_cache->data)
goto err_free_cache;
metadata_cache->cache_alloc = METADATA_CACHE_DEFAULT_SIZE;
@@
-124,7
+126,7
@@
void metadata_cache_destroy(struct kref *kref)
{
struct lttng_metadata_cache *cache =
container_of(kref, struct lttng_metadata_cache, refcount);
{
struct lttng_metadata_cache *cache =
container_of(kref, struct lttng_metadata_cache, refcount);
-
k
free(cache->data);
+
v
free(cache->data);
kfree(cache);
}
kfree(cache);
}
@@
-687,10
+689,16
@@
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);
tmp_cache_alloc_size = max_t(unsigned int,
session->metadata_cache->cache_alloc + len,
session->metadata_cache->cache_alloc << 1);
- tmp_cache_realloc = krealloc(session->metadata_cache->data,
- tmp_cache_alloc_size, GFP_KERNEL);
+ tmp_cache_realloc = lttng_vzalloc(tmp_cache_alloc_size);
if (!tmp_cache_realloc)
goto err;
if (!tmp_cache_realloc)
goto err;
+ if (session->metadata_cache->data) {
+ memcpy(tmp_cache_realloc,
+ session->metadata_cache->data,
+ session->metadata_cache->cache_alloc);
+ vfree(session->metadata_cache->data);
+ }
+
session->metadata_cache->cache_alloc = tmp_cache_alloc_size;
session->metadata_cache->data = tmp_cache_realloc;
}
session->metadata_cache->cache_alloc = tmp_cache_alloc_size;
session->metadata_cache->data = tmp_cache_realloc;
}
This page took
0.023927 seconds
and
4
git commands to generate.