// 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/* * Avoid bringing in event parsing. */intparse_event(structevlist*evlist__maybe_unused,constchar*str__maybe_unused){return0;}/* * Provide these two so that we don't have to link against callchain.c and * start dragging hist.c, etc. */structcallchain_paramcallchain_param;