perf: add documentation

This commit is contained in:
Beat Küng
2017-05-04 16:42:41 +02:00
parent ba1a483cd6
commit 16e0e1f7ca
+14 -20
View File
@@ -31,36 +31,30 @@
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <px4_config.h>
#include <px4_module.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include "systemlib/perf_counter.h"
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
__EXPORT int perf_main(int argc, char *argv[]);
/****************************************************************************
* user_start
****************************************************************************/
static void print_usage(void)
{
PRINT_MODULE_DESCRIPTION("Tool to print performance counters");
PRINT_MODULE_USAGE_NAME_SIMPLE("perf", "command");
PRINT_MODULE_USAGE_COMMAND_DESCR("reset", "Reset all counters");
PRINT_MODULE_USAGE_COMMAND_DESCR("latency", "Print HRT timer latency histogram");
PRINT_MODULE_USAGE_PARAM_COMMENT("Prints all performance counters if no arguments given");
}
int perf_main(int argc, char *argv[])
{
@@ -75,7 +69,7 @@ int perf_main(int argc, char *argv[])
return 0;
}
printf("Usage: perf [reset | latency]\n");
print_usage();
return -1;
}