projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: parse monitor timer parameter as an unsigned 64-bit integer
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
enable_channels.c
diff --git
a/src/bin/lttng/commands/enable_channels.c
b/src/bin/lttng/commands/enable_channels.c
index 27d4618a9d0fd5b2f40f7c0dd7b05055bbd90d79..19490477e4a65f4e1d8cee8b61d53787483cebb3 100644
(file)
--- a/
src/bin/lttng/commands/enable_channels.c
+++ b/
src/bin/lttng/commands/enable_channels.c
@@
-46,7
+46,7
@@
static int opt_buffer_pid;
static int opt_buffer_global;
static struct {
bool set;
static int opt_buffer_global;
static struct {
bool set;
- uint
32
_t interval;
+ uint
64
_t interval;
} opt_monitor_timer;
static struct {
bool set;
} opt_monitor_timer;
static struct {
bool set;
@@
-534,24
+534,19
@@
int cmd_enable_channels(int argc, const char **argv)
}
case OPT_MONITOR_TIMER:
{
}
case OPT_MONITOR_TIMER:
{
- unsigned long v;
+ unsigned long
long
v;
errno = 0;
opt_arg = poptGetOptArg(pc);
errno = 0;
opt_arg = poptGetOptArg(pc);
- v = strtoul(opt_arg, NULL, 0);
+ v = strtoul
l
(opt_arg, NULL, 0);
if (errno != 0 || !isdigit(opt_arg[0])) {
ERR("Wrong value in --monitor-timer parameter: %s", opt_arg);
ret = CMD_ERROR;
goto end;
}
if (errno != 0 || !isdigit(opt_arg[0])) {
ERR("Wrong value in --monitor-timer parameter: %s", opt_arg);
ret = CMD_ERROR;
goto end;
}
- if (v != (uint32_t) v) {
- ERR("32-bit overflow in --monitor-timer parameter: %s", opt_arg);
- ret = CMD_ERROR;
- goto end;
- }
- opt_monitor_timer.interval = (uint32_t) v;
+ opt_monitor_timer.interval = (uint64_t) v;
opt_monitor_timer.set = true;
opt_monitor_timer.set = true;
- DBG("Channel monitor timer interval set to %
d
", opt_monitor_timer.interval);
+ DBG("Channel monitor timer interval set to %
" PRIu64" (µs)
", opt_monitor_timer.interval);
break;
}
case OPT_BLOCKING_TIMEOUT:
break;
}
case OPT_BLOCKING_TIMEOUT:
This page took
0.02405 seconds
and
4
git commands to generate.