perf stat: Rename struct perf_counts::cpu member to values
Renaming 'struct xyarray *cpu' pointer to more fitting/generic values, because now we store both cpu and thread values. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1435310967-14570-8-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
a6fa003855
commit
57b289159a
2 changed files with 8 additions and 8 deletions
|
@ -100,15 +100,15 @@ struct perf_counts *perf_counts__new(int ncpus, int nthreads)
|
||||||
struct perf_counts *counts = zalloc(sizeof(*counts));
|
struct perf_counts *counts = zalloc(sizeof(*counts));
|
||||||
|
|
||||||
if (counts) {
|
if (counts) {
|
||||||
struct xyarray *cpu;
|
struct xyarray *values;
|
||||||
|
|
||||||
cpu = xyarray__new(ncpus, nthreads, sizeof(struct perf_counts_values));
|
values = xyarray__new(ncpus, nthreads, sizeof(struct perf_counts_values));
|
||||||
if (!cpu) {
|
if (!values) {
|
||||||
free(counts);
|
free(counts);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
counts->cpu = cpu;
|
counts->values = values;
|
||||||
}
|
}
|
||||||
|
|
||||||
return counts;
|
return counts;
|
||||||
|
@ -117,14 +117,14 @@ struct perf_counts *perf_counts__new(int ncpus, int nthreads)
|
||||||
void perf_counts__delete(struct perf_counts *counts)
|
void perf_counts__delete(struct perf_counts *counts)
|
||||||
{
|
{
|
||||||
if (counts) {
|
if (counts) {
|
||||||
xyarray__delete(counts->cpu);
|
xyarray__delete(counts->values);
|
||||||
free(counts);
|
free(counts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void perf_counts__reset(struct perf_counts *counts)
|
static void perf_counts__reset(struct perf_counts *counts)
|
||||||
{
|
{
|
||||||
xyarray__reset(counts->cpu);
|
xyarray__reset(counts->values);
|
||||||
}
|
}
|
||||||
|
|
||||||
void perf_evsel__reset_counts(struct perf_evsel *evsel)
|
void perf_evsel__reset_counts(struct perf_evsel *evsel)
|
||||||
|
|
|
@ -46,13 +46,13 @@ struct perf_counts_values {
|
||||||
struct perf_counts {
|
struct perf_counts {
|
||||||
s8 scaled;
|
s8 scaled;
|
||||||
struct perf_counts_values aggr;
|
struct perf_counts_values aggr;
|
||||||
struct xyarray *cpu;
|
struct xyarray *values;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline struct perf_counts_values*
|
static inline struct perf_counts_values*
|
||||||
perf_counts(struct perf_counts *counts, int cpu, int thread)
|
perf_counts(struct perf_counts *counts, int cpu, int thread)
|
||||||
{
|
{
|
||||||
return xyarray__entry(counts->cpu, cpu, thread);
|
return xyarray__entry(counts->values, cpu, thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_stats(struct stats *stats, u64 val);
|
void update_stats(struct stats *stats, u64 val);
|
||||||
|
|
Loading…
Add table
Reference in a new issue