* Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
* Copyright (C) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; only version 2
- * of the License.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2 only,
+ * as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define _GNU_SOURCE
struct lttng_domain dom;
struct lttng_calibrate calibrate;
+ memset(&dom, 0, sizeof(dom));
+ memset(&calibrate, 0, sizeof(calibrate));
+
/* Create lttng domain */
if (opt_kernel) {
dom.type = LTTNG_DOMAIN_KERNEL;
calibrate.type = LTTNG_CALIBRATE_FUNCTION;
ret = lttng_calibrate(handle, &calibrate);
if (ret < 0) {
- ret = CMD_ERROR;
goto error;
}
MSG("%s calibration done", opt_kernel ? "Kernel" : "UST");
/*
* Calibrate LTTng tracer.
+ *
+ * Returns a CMD_* error.
*/
int cmd_calibrate(int argc, const char **argv)
{
- int opt, ret;
+ int opt, ret = CMD_SUCCESS;
static poptContext pc;
pc = poptGetContext(NULL, argc, argv, long_options, 0);
switch (opt) {
case OPT_HELP:
usage(stdout);
- ret = CMD_SUCCESS;
goto end;
case OPT_TRACEPOINT:
ret = CMD_UNDEFINED;
break;
case OPT_LIST_OPTIONS:
list_cmd_options(stdout, long_options);
- ret = CMD_SUCCESS;
goto end;
default:
usage(stderr);
ret = calibrate_lttng();
end:
+ poptFreeContext(pc);
return ret;
}