]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - tools/perf/util/python.c
perf tools: Rename perf_evlist__exit() to evlist__exit()
[linux.git] / tools / perf / util / python.c
index 11479a7ad1c7e6c24ccd4378bfe5a66036f44ff0..60a6b6e8e17641342bc7e64884ae3343e10a9211 100644 (file)
@@ -5,15 +5,17 @@
 #include <poll.h>
 #include <linux/err.h>
 #include <perf/cpumap.h>
+#include <traceevent/event-parse.h>
 #include "evlist.h"
 #include "callchain.h"
 #include "evsel.h"
 #include "event.h"
-#include "cpumap.h"
 #include "print_binary.h"
 #include "thread_map.h"
+#include "trace-event.h"
 #include "mmap.h"
 #include "util.h"
+#include "../perf-sys.h"
 
 #if PY_MAJOR_VERSION < 3
 #define _PyUnicode_FromString(arg) \
@@ -57,6 +59,8 @@ int parse_callchain_record(const char *arg __maybe_unused,
  */
 int verbose;
 
+int eprintf(int level, int var, const char *fmt, ...);
+
 int eprintf(int level, int var, const char *fmt, ...)
 {
        va_list args;
@@ -880,7 +884,7 @@ static int pyrf_evlist__init(struct pyrf_evlist *pevlist,
 
 static void pyrf_evlist__delete(struct pyrf_evlist *pevlist)
 {
-       perf_evlist__exit(&pevlist->evlist);
+       evlist__exit(&pevlist->evlist);
        Py_TYPE(pevlist)->tp_free((PyObject*)pevlist);
 }
 
@@ -895,7 +899,7 @@ static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist,
                                         &pages, &overwrite))
                return NULL;
 
-       if (perf_evlist__mmap(evlist, pages) < 0) {
+       if (evlist__mmap(evlist, pages) < 0) {
                PyErr_SetFromErrno(PyExc_OSError);
                return NULL;
        }
@@ -980,12 +984,12 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist,
        return Py_BuildValue("i", evlist->core.nr_entries);
 }
 
-static struct perf_mmap *get_md(struct evlist *evlist, int cpu)
+static struct mmap *get_md(struct evlist *evlist, int cpu)
 {
        int i;
 
        for (i = 0; i < evlist->nr_mmaps; i++) {
-               struct perf_mmap *md = &evlist->mmap[i];
+               struct mmap *md = &evlist->mmap[i];
 
                if (md->cpu == cpu)
                        return md;
@@ -1001,7 +1005,7 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist,
        union perf_event *event;
        int sample_id_all = 1, cpu;
        static char *kwlist[] = { "cpu", "sample_id_all", NULL };
-       struct perf_mmap *md;
+       struct mmap *md;
        int err;
 
        if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|i", kwlist,