lttng: add status command
[lttng-tools.git] / src / bin / lttng / command.h
index 9caa7b4034333fc6fd70e41fe17fbfa071e594cf..fc6f01c1c6db6e891aaa6e8cc5a425f192341683 100644 (file)
@@ -1,38 +1,40 @@
 /*
  * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
  *
- * 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.
  */
 
 #ifndef _LTTNG_CMD_H
 #define _LTTNG_CMD_H
 
 #include <lttng/lttng.h>
-#include <common/lttngerr.h>
 #include <common/common.h>
 #include <common/defaults.h>
 
 #include "conf.h"
 #include "utils.h"
 
+#define DECL_COMMAND(_name) \
+       extern int cmd_##_name(int, const char **)
+
 enum cmd_error_code {
-       CMD_SUCCESS,
+       CMD_SUCCESS = 0,
        CMD_ERROR,
        CMD_UNDEFINED,
-       CMD_NOT_IMPLEMENTED,
        CMD_FATAL,
+       CMD_WARNING,
+       CMD_UNSUPPORTED,
 };
 
 struct cmd_struct {
@@ -40,18 +42,27 @@ struct cmd_struct {
        int (*func)(int argc, const char **argv);
 };
 
-extern int cmd_list(int argc, const char **argv);
-extern int cmd_create(int argc, const char **argv);
-extern int cmd_destroy(int argc, const char **argv);
-extern int cmd_start(int argc, const char **argv);
-extern int cmd_stop(int argc, const char **argv);
-extern int cmd_enable_events(int argc, const char **argv);
-extern int cmd_disable_events(int argc, const char **argv);
-extern int cmd_enable_channels(int argc, const char **argv);
-extern int cmd_disable_channels(int argc, const char **argv);
-extern int cmd_add_context(int argc, const char **argv);
-extern int cmd_set_session(int argc, const char **argv);
-extern int cmd_version(int argc, const char **argv);
-extern int cmd_calibrate(int argc, const char **argv);
+DECL_COMMAND(list);
+DECL_COMMAND(status);
+DECL_COMMAND(create);
+DECL_COMMAND(destroy);
+DECL_COMMAND(start);
+DECL_COMMAND(stop);
+DECL_COMMAND(enable_events);
+DECL_COMMAND(disable_events);
+DECL_COMMAND(enable_channels);
+DECL_COMMAND(disable_channels);
+DECL_COMMAND(add_context);
+DECL_COMMAND(set_session);
+DECL_COMMAND(version);
+DECL_COMMAND(calibrate);
+DECL_COMMAND(view);
+DECL_COMMAND(enable_consumer);
+DECL_COMMAND(disable_consumer);
+DECL_COMMAND(snapshot);
+DECL_COMMAND(save);
+DECL_COMMAND(load);
+DECL_COMMAND(track);
+DECL_COMMAND(untrack);
 
 #endif /* _LTTNG_CMD_H */
This page took 0.026001 seconds and 5 git commands to generate.