aboutsummaryrefslogtreecommitdiff
path: root/apps/systemcmds/perf/perf.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2013-01-24 10:00:49 +1100
committerAndrew Tridgell <tridge@samba.org>2013-01-24 10:26:02 +1100
commit6e751d26e8011616e10b611df5dedbc24aa188bf (patch)
tree21c78f00ef6cfce25753e3f8cc4bb378853025b2 /apps/systemcmds/perf/perf.c
parentf4da4bb8ca29a48e1bf10958cbc45fc9fb10e9f7 (diff)
downloadpx4-firmware-6e751d26e8011616e10b611df5dedbc24aa188bf.tar.gz
px4-firmware-6e751d26e8011616e10b611df5dedbc24aa188bf.tar.bz2
px4-firmware-6e751d26e8011616e10b611df5dedbc24aa188bf.zip
perf: added 'perf reset' command
resets all perf counters
Diffstat (limited to 'apps/systemcmds/perf/perf.c')
-rw-r--r--apps/systemcmds/perf/perf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/systemcmds/perf/perf.c b/apps/systemcmds/perf/perf.c
index ced942fd6..64443d019 100644
--- a/apps/systemcmds/perf/perf.c
+++ b/apps/systemcmds/perf/perf.c
@@ -39,6 +39,7 @@
#include <nuttx/config.h>
#include <unistd.h>
#include <stdio.h>
+#include <string.h>
#include "systemlib/perf_counter.h"
@@ -63,6 +64,15 @@ __EXPORT int perf_main(int argc, char *argv[]);
int perf_main(int argc, char *argv[])
{
+ if (argc > 1) {
+ if (strcmp(argv[1], "reset") == 0) {
+ perf_reset_all();
+ return 0;
+ }
+ printf("Usage: perf <reset>\n");
+ return -1;
+ }
+
perf_print_all();
fflush(stdout);
return 0;