aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-stat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 003caa857a44..5658a770dbd7 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -128,6 +128,7 @@ static pid_t target_tid = -1;
128static pid_t child_pid = -1; 128static pid_t child_pid = -1;
129static bool null_run = false; 129static bool null_run = false;
130static bool detailed_run = false; 130static bool detailed_run = false;
131static bool sync_run = false;
131static bool big_num = true; 132static bool big_num = true;
132static int big_num_opt = -1; 133static int big_num_opt = -1;
133static const char *cpu_list; 134static const char *cpu_list;
@@ -819,6 +820,8 @@ static const struct option options[] = {
819 "null run - dont start any counters"), 820 "null run - dont start any counters"),
820 OPT_BOOLEAN('d', "detailed", &detailed_run, 821 OPT_BOOLEAN('d', "detailed", &detailed_run,
821 "detailed run - start a lot of events"), 822 "detailed run - start a lot of events"),
823 OPT_BOOLEAN('S', "sync", &sync_run,
824 "call sync() before starting a run"),
822 OPT_CALLBACK_NOOPT('B', "big-num", NULL, NULL, 825 OPT_CALLBACK_NOOPT('B', "big-num", NULL, NULL,
823 "print large numbers with thousands\' separators", 826 "print large numbers with thousands\' separators",
824 stat__set_big_num), 827 stat__set_big_num),
@@ -944,6 +947,10 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used)
944 for (run_idx = 0; run_idx < run_count; run_idx++) { 947 for (run_idx = 0; run_idx < run_count; run_idx++) {
945 if (run_count != 1 && verbose) 948 if (run_count != 1 && verbose)
946 fprintf(stderr, "[ perf stat: executing run #%d ... ]\n", run_idx + 1); 949 fprintf(stderr, "[ perf stat: executing run #%d ... ]\n", run_idx + 1);
950
951 if (sync_run)
952 sync();
953
947 status = run_perf_stat(argc, argv); 954 status = run_perf_stat(argc, argv);
948 } 955 }
949 956