projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix wrong message with lttng list
[lttng-tools.git]
/
lttng
/
commands
/
enable_events.c
diff --git
a/lttng/commands/enable_events.c
b/lttng/commands/enable_events.c
index b99b7f4c942294784f577ea8465009aa2b0134c0..5b844e493d13c7d4f44b358a02205dd325df9ef6 100644
(file)
--- a/
lttng/commands/enable_events.c
+++ b/
lttng/commands/enable_events.c
@@
-125,6
+125,7
@@
static int parse_probe_opts(struct lttng_event *ev, char *opt)
ret = sscanf(opt, "%[^'+']+%s", name, s_hex);
if (ret == 2) {
strncpy(ev->attr.probe.symbol_name, name, LTTNG_SYMBOL_NAME_LEN);
ret = sscanf(opt, "%[^'+']+%s", name, s_hex);
if (ret == 2) {
strncpy(ev->attr.probe.symbol_name, name, LTTNG_SYMBOL_NAME_LEN);
+ ev->attr.probe.symbol_name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
DBG("probe symbol %s", ev->attr.probe.symbol_name);
if (strlen(s_hex) == 0) {
ERR("Invalid probe offset %s", s_hex);
DBG("probe symbol %s", ev->attr.probe.symbol_name);
if (strlen(s_hex) == 0) {
ERR("Invalid probe offset %s", s_hex);
@@
-142,6
+143,7
@@
static int parse_probe_opts(struct lttng_event *ev, char *opt)
ret = sscanf(opt, "%s", name);
if (ret == 1) {
strncpy(ev->attr.probe.symbol_name, name, LTTNG_SYMBOL_NAME_LEN);
ret = sscanf(opt, "%s", name);
if (ret == 1) {
strncpy(ev->attr.probe.symbol_name, name, LTTNG_SYMBOL_NAME_LEN);
+ ev->attr.probe.symbol_name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
DBG("probe symbol %s", ev->attr.probe.symbol_name);
ev->attr.probe.offset = 0;
DBG("probe offset %" PRIu64, ev->attr.probe.offset);
DBG("probe symbol %s", ev->attr.probe.symbol_name);
ev->attr.probe.offset = 0;
DBG("probe offset %" PRIu64, ev->attr.probe.offset);
@@
-230,6
+232,7
@@
static int enable_events(void)
event_name, channel_name);
/* Copy name and type of the event */
strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
event_name, channel_name);
/* Copy name and type of the event */
strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
+ ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
ev.type = opt_event_type;
switch (opt_event_type) {
ev.type = opt_event_type;
switch (opt_event_type) {
@@
-255,6
+258,7
@@
static int enable_events(void)
strncpy(ev.attr.ftrace.symbol_name,
opt_function_entry_symbol,
LTTNG_SYMBOL_NAME_LEN);
strncpy(ev.attr.ftrace.symbol_name,
opt_function_entry_symbol,
LTTNG_SYMBOL_NAME_LEN);
+ ev.attr.ftrace.symbol_name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
break;
default:
ret = CMD_NOT_IMPLEMENTED;
break;
default:
ret = CMD_NOT_IMPLEMENTED;
@@
-275,7
+279,7
@@
static int enable_events(void)
ret = CMD_NOT_IMPLEMENTED;
goto error;
} else {
ret = CMD_NOT_IMPLEMENTED;
goto error;
} else {
- ERR("Please specify a tracer (
kernel or user-
space)");
+ ERR("Please specify a tracer (
--kernel or --user
space)");
goto error;
}
goto error;
}
This page took
0.026209 seconds
and
4
git commands to generate.