From 6e751d26e8011616e10b611df5dedbc24aa188bf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 24 Jan 2013 10:00:49 +1100 Subject: perf: added 'perf reset' command resets all perf counters --- apps/systemcmds/perf/perf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 #include #include +#include #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 \n"); + return -1; + } + perf_print_all(); fflush(stdout); return 0; -- cgit v1.2.3