Commit 581cc8a2 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf stat: Rename perf_stat struct into perf_stat_evsel

It's used as the perf_evsel::priv data, so the name suits better. Also
we'll need the perf_stat name free for more generic struct.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Tested-by: default avatarKan Liang <kan.liang@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1444992092-17897-29-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3a134ae9
...@@ -434,7 +434,7 @@ static void print_noise_pct(double total, double avg) ...@@ -434,7 +434,7 @@ static void print_noise_pct(double total, double avg)
static void print_noise(struct perf_evsel *evsel, double avg) static void print_noise(struct perf_evsel *evsel, double avg)
{ {
struct perf_stat *ps; struct perf_stat_evsel *ps;
if (run_count == 1) if (run_count == 1)
return; return;
...@@ -671,7 +671,7 @@ static void print_aggr_thread(struct perf_evsel *counter, char *prefix) ...@@ -671,7 +671,7 @@ static void print_aggr_thread(struct perf_evsel *counter, char *prefix)
static void print_counter_aggr(struct perf_evsel *counter, char *prefix) static void print_counter_aggr(struct perf_evsel *counter, char *prefix)
{ {
FILE *output = stat_config.output; FILE *output = stat_config.output;
struct perf_stat *ps = counter->priv; struct perf_stat_evsel *ps = counter->priv;
double avg = avg_stats(&ps->res_stats[0]); double avg = avg_stats(&ps->res_stats[0]);
int scaled = counter->counts->scaled; int scaled = counter->counts->scaled;
double uval; double uval;
......
...@@ -67,7 +67,7 @@ double rel_stddev_stats(double stddev, double avg) ...@@ -67,7 +67,7 @@ double rel_stddev_stats(double stddev, double avg)
bool __perf_evsel_stat__is(struct perf_evsel *evsel, bool __perf_evsel_stat__is(struct perf_evsel *evsel,
enum perf_stat_evsel_id id) enum perf_stat_evsel_id id)
{ {
struct perf_stat *ps = evsel->priv; struct perf_stat_evsel *ps = evsel->priv;
return ps->id == id; return ps->id == id;
} }
...@@ -84,7 +84,7 @@ static const char *id_str[PERF_STAT_EVSEL_ID__MAX] = { ...@@ -84,7 +84,7 @@ static const char *id_str[PERF_STAT_EVSEL_ID__MAX] = {
void perf_stat_evsel_id_init(struct perf_evsel *evsel) void perf_stat_evsel_id_init(struct perf_evsel *evsel)
{ {
struct perf_stat *ps = evsel->priv; struct perf_stat_evsel *ps = evsel->priv;
int i; int i;
/* ps->id is 0 hence PERF_STAT_EVSEL_ID__NONE by default */ /* ps->id is 0 hence PERF_STAT_EVSEL_ID__NONE by default */
...@@ -100,7 +100,7 @@ void perf_stat_evsel_id_init(struct perf_evsel *evsel) ...@@ -100,7 +100,7 @@ void perf_stat_evsel_id_init(struct perf_evsel *evsel)
void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) void perf_evsel__reset_stat_priv(struct perf_evsel *evsel)
{ {
int i; int i;
struct perf_stat *ps = evsel->priv; struct perf_stat_evsel *ps = evsel->priv;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
init_stats(&ps->res_stats[i]); init_stats(&ps->res_stats[i]);
...@@ -110,7 +110,7 @@ void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) ...@@ -110,7 +110,7 @@ void perf_evsel__reset_stat_priv(struct perf_evsel *evsel)
int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel) int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel)
{ {
evsel->priv = zalloc(sizeof(struct perf_stat)); evsel->priv = zalloc(sizeof(struct perf_stat_evsel));
if (evsel->priv == NULL) if (evsel->priv == NULL)
return -ENOMEM; return -ENOMEM;
perf_evsel__reset_stat_priv(evsel); perf_evsel__reset_stat_priv(evsel);
...@@ -304,7 +304,7 @@ int perf_stat_process_counter(struct perf_stat_config *config, ...@@ -304,7 +304,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
struct perf_evsel *counter) struct perf_evsel *counter)
{ {
struct perf_counts_values *aggr = &counter->counts->aggr; struct perf_counts_values *aggr = &counter->counts->aggr;
struct perf_stat *ps = counter->priv; struct perf_stat_evsel *ps = counter->priv;
u64 *count = counter->counts->aggr.values; u64 *count = counter->counts->aggr.values;
int i, ret; int i, ret;
......
...@@ -20,7 +20,7 @@ enum perf_stat_evsel_id { ...@@ -20,7 +20,7 @@ enum perf_stat_evsel_id {
PERF_STAT_EVSEL_ID__MAX, PERF_STAT_EVSEL_ID__MAX,
}; };
struct perf_stat { struct perf_stat_evsel {
struct stats res_stats[3]; struct stats res_stats[3];
enum perf_stat_evsel_id id; enum perf_stat_evsel_id id;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment