mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 13:21:36 +08:00
perf: add documentation
This commit is contained in:
+14
-20
@@ -31,36 +31,30 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Included Files
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#include <px4_config.h>
|
#include <px4_config.h>
|
||||||
|
#include <px4_module.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "systemlib/perf_counter.h"
|
#include "systemlib/perf_counter.h"
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
__EXPORT int perf_main(int argc, char *argv[]);
|
__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[])
|
int perf_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -75,7 +69,7 @@ int perf_main(int argc, char *argv[])
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Usage: perf [reset | latency]\n");
|
print_usage();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user