perf stat: Move 'initial_delay' to 'struct perf_stat_config'

Move the static 'initial_delay' variable to 'struct perf_stat_config',
so it can be passed around and used outside the 'perf stat' command.

Add 'struct perf_stat_config' argument to create_perf_stat_counter() and
use its 'initial_delay' member instead of the static one.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180830063252.23729-3-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Jiri Olsa
2018-08-30 08:32:11 +02:00
committed by Arnaldo Carvalho de Melo
parent d50ed0ce82
commit 728c0ee0a8
2 changed files with 18 additions and 16 deletions

View File

@@ -6,6 +6,7 @@
#include <stdio.h>
#include "xyarray.h"
#include "rblist.h"
#include "perf.h"
struct stats {
double n, mean, M2;
@@ -85,14 +86,15 @@ struct runtime_stat {
};
struct perf_stat_config {
enum aggr_mode aggr_mode;
bool scale;
FILE *output;
unsigned int interval;
unsigned int timeout;
int times;
struct runtime_stat *stats;
int stats_num;
enum aggr_mode aggr_mode;
bool scale;
FILE *output;
unsigned int interval;
unsigned int timeout;
unsigned int initial_delay;
int times;
struct runtime_stat *stats;
int stats_num;
};
void update_stats(struct stats *stats, u64 val);