Add the perf_evsel__init() function to initialize perf_evsel struct.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190721112506.12306-38-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
 
 #include <perf/evsel.h>
 #include <linux/list.h>
 #include <internal/evsel.h>
+
+void perf_evsel__init(struct perf_evsel *evsel)
+{
+       INIT_LIST_HEAD(&evsel->node);
+}
 
 #ifndef __LIBPERF_EVSEL_H
 #define __LIBPERF_EVSEL_H
 
+#include <perf/core.h>
+
 struct perf_evsel;
 
+LIBPERF_API void perf_evsel__init(struct perf_evsel *evsel);
+
 #endif /* __LIBPERF_EVSEL_H */
 
                perf_thread_map__comm;
                perf_thread_map__get;
                perf_thread_map__put;
+               perf_evsel__init;
        local:
                *;
 };
 
 #include <sys/resource.h>
 #include <sys/types.h>
 #include <dirent.h>
+#include <perf/evsel.h>
 #include "asm/bug.h"
 #include "callchain.h"
 #include "cgroup.h"
 void evsel__init(struct evsel *evsel,
                 struct perf_event_attr *attr, int idx)
 {
+       perf_evsel__init(&evsel->core);
        evsel->idx         = idx;
        evsel->tracking    = !idx;
        evsel->attr        = *attr;
        evsel->evlist      = NULL;
        evsel->bpf_obj     = NULL;
        evsel->bpf_fd      = -1;
-       INIT_LIST_HEAD(&evsel->core.node);
        INIT_LIST_HEAD(&evsel->config_terms);
        perf_evsel__object.init(evsel);
        evsel->sample_size = __perf_evsel__sample_size(attr->sample_type);