projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix ust app tracepoint list realloc
[lttng-tools.git]
/
lttng-sessiond
/
ust-app.c
diff --git
a/lttng-sessiond/ust-app.c
b/lttng-sessiond/ust-app.c
index 69164126beafbe15e276a7f694bc5dc2045cd7b9..3847004d4349abe70e17a517cfeb8b07b8da3f23 100644
(file)
--- a/
lttng-sessiond/ust-app.c
+++ b/
lttng-sessiond/ust-app.c
@@
-1383,12
+1383,11
@@
int ust_app_list_events(struct lttng_event **events)
while ((ret = ustctl_tracepoint_list_get(app->key.sock, handle,
&iter)) != -ENOENT) {
while ((ret = ustctl_tracepoint_list_get(app->key.sock, handle,
&iter)) != -ENOENT) {
- memcpy(tmp[count].name, iter.name, LTTNG_UST_SYM_NAME_LEN);
/* TODO : get loglevel too */
/* TODO : get loglevel too */
- if (count > nbmem) {
- DBG2("Reallocating event list from %zu to %zu
byt
es", nbmem,
-
nbmem + UST_APP_EVENT_LIST_SIZE
);
- nbmem
+= UST_APP_EVENT_LIST_SIZE
;
+ if (count >
=
nbmem) {
+ DBG2("Reallocating event list from %zu to %zu
entri
es", nbmem,
+
2 * nbmem
);
+ nbmem
*= 2
;
tmp = realloc(tmp, nbmem * sizeof(struct lttng_event));
if (tmp == NULL) {
PERROR("realloc ust app events");
tmp = realloc(tmp, nbmem * sizeof(struct lttng_event));
if (tmp == NULL) {
PERROR("realloc ust app events");
@@
-1396,7
+1395,7
@@
int ust_app_list_events(struct lttng_event **events)
goto rcu_error;
}
}
goto rcu_error;
}
}
-
+ memcpy(tmp[count].name, iter.name, LTTNG_UST_SYM_NAME_LEN);
tmp[count].type = LTTNG_UST_TRACEPOINT;
tmp[count].pid = app->key.pid;
tmp[count].enabled = -1;
tmp[count].type = LTTNG_UST_TRACEPOINT;
tmp[count].pid = app->key.pid;
tmp[count].enabled = -1;
This page took
0.038167 seconds
and
4
git commands to generate.