d809560b36
Moving 'struct perf_counts' and associated functions into separate object, so we could remove stat.c object dependency from python build. It makes the python code to build properly, because it fails to load due to missing stat-shadow.c object dependency if some patches from Kan Liang are applied. So apply this one, then Kan's. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20150807105103.GB8624@krava.brq.redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
37 lines
790 B
C
37 lines
790 B
C
#ifndef __PERF_COUNTS_H
|
|
#define __PERF_COUNTS_H
|
|
|
|
#include "xyarray.h"
|
|
|
|
struct perf_counts_values {
|
|
union {
|
|
struct {
|
|
u64 val;
|
|
u64 ena;
|
|
u64 run;
|
|
};
|
|
u64 values[3];
|
|
};
|
|
};
|
|
|
|
struct perf_counts {
|
|
s8 scaled;
|
|
struct perf_counts_values aggr;
|
|
struct xyarray *values;
|
|
};
|
|
|
|
|
|
static inline struct perf_counts_values*
|
|
perf_counts(struct perf_counts *counts, int cpu, int thread)
|
|
{
|
|
return xyarray__entry(counts->values, cpu, thread);
|
|
}
|
|
|
|
struct perf_counts *perf_counts__new(int ncpus, int nthreads);
|
|
void perf_counts__delete(struct perf_counts *counts);
|
|
|
|
void perf_evsel__reset_counts(struct perf_evsel *evsel);
|
|
int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus, int nthreads);
|
|
void perf_evsel__free_counts(struct perf_evsel *evsel);
|
|
|
|
#endif /* __PERF_COUNTS_H */
|