// SPDX-License-Identifier: GPL-2.0#include<Python.h>#include<structmember.h>#include<inttypes.h>#include<poll.h>#include<linux/err.h>#include<perf/cpumap.h>#ifdef HAVE_LIBTRACEEVENT#include<traceevent/event-parse.h>#endif#include<perf/mmap.h>#include"evlist.h"#include"callchain.h"#include"evsel.h"#include"event.h"#include"print_binary.h"#include"thread_map.h"#include"trace-event.h"#include"mmap.h"#include"stat.h"#include"metricgroup.h"#include"util/bpf-filter.h"#include"util/env.h"#include"util/pmu.h"#include<internal/lib.h>#include"util.h"#if PY_MAJOR_VERSION < 3#define _PyUnicode_FromString(arg) \ PyString_FromString(arg)#define _PyUnicode_AsString(arg) \ PyString_AsString(arg)#define _PyUnicode_FromFormat(...) \ PyString_FromFormat(__VA_ARGS__)#define _PyLong_FromLong(arg) \ PyInt_FromLong(arg)#else#define _PyUnicode_FromString(arg) \ PyUnicode_FromString(arg)#define _PyUnicode_FromFormat(...) \ PyUnicode_FromFormat(__VA_ARGS__)#define _PyLong_FromLong(arg) \ PyLong_FromLong(arg)#endif#ifndef Py_TYPE#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)#endif/* * Provide these two so that we don't have to link against callchain.c and * start dragging hist.c, etc. */structcallchain_paramcallchain_param;intparse_callchain_record(constchar*arg__maybe_unused,structcallchain_param*param__maybe_unused){return0;}/* * Add these not to drag util/env.c */structperf_envperf_env;constchar*perf_env__cpuid(