Linux Perf
python.c File Reference
#include <Python.h>
#include <structmember.h>
#include <inttypes.h>
#include <poll.h>
#include <linux/err.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 dependency graph for python.c:

Go to the source code of this file.

Classes

struct  pyrf_event
 
struct  pyrf_cpu_map
 
struct  pyrf_thread_map
 
struct  pyrf_evsel
 
struct  pyrf_evlist
 

Macros

#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)
 
#define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
 
#define PyVarObject_HEAD_INIT(type, size)   PyObject_HEAD_INIT(type) size,
 
#define member_def(type, member, ptype, help)
 
#define sample_member_def(name, member, ptype, help)
 
#define sample_members
 
#define PERF_CONST(name)   { #name, PERF_##name }
 

Functions

int parse_callchain_record (const char *arg __maybe_unused, struct callchain_param *param __maybe_unused)
 
int eprintf (int level, int var, const char *fmt,...)
 
PyMODINIT_FUNC initperf (void)
 
static PyObject * pyrf_mmap_event__repr (struct pyrf_event *pevent)
 
static PyObject * pyrf_task_event__repr (struct pyrf_event *pevent)
 
static PyObject * pyrf_comm_event__repr (struct pyrf_event *pevent)
 
static PyObject * pyrf_throttle_event__repr (struct pyrf_event *pevent)
 
static PyObject * pyrf_lost_event__repr (struct pyrf_event *pevent)
 
static PyObject * pyrf_read_event__repr (struct pyrf_event *pevent)
 
static PyObject * pyrf_sample_event__repr (struct pyrf_event *pevent)
 
static bool is_tracepoint (struct pyrf_event *pevent)
 
static PyObject * tracepoint_field (struct pyrf_event *pe, struct format_field *field)
 
static PyObject * get_tracepoint_field (struct pyrf_event *pevent, PyObject *attr_name)
 
static PyObject * pyrf_sample_event__getattro (struct pyrf_event *pevent, PyObject *attr_name)
 
static PyObject * pyrf_context_switch_event__repr (struct pyrf_event *pevent)
 
static int pyrf_event__setup_types (void)
 
static PyObject * pyrf_event__new (union perf_event *event)
 
static int pyrf_cpu_map__init (struct pyrf_cpu_map *pcpus, PyObject *args, PyObject *kwargs)
 
static void pyrf_cpu_map__delete (struct pyrf_cpu_map *pcpus)
 
static Py_ssize_t pyrf_cpu_map__length (PyObject *obj)
 
static PyObject * pyrf_cpu_map__item (PyObject *obj, Py_ssize_t i)
 
static int pyrf_cpu_map__setup_types (void)
 
static int pyrf_thread_map__init (struct pyrf_thread_map *pthreads, PyObject *args, PyObject *kwargs)
 
static void pyrf_thread_map__delete (struct pyrf_thread_map *pthreads)
 
static Py_ssize_t pyrf_thread_map__length (PyObject *obj)
 
static PyObject * pyrf_thread_map__item (PyObject *obj, Py_ssize_t i)
 
static int pyrf_thread_map__setup_types (void)
 
static int pyrf_evsel__init (struct pyrf_evsel *pevsel, PyObject *args, PyObject *kwargs)
 
static void pyrf_evsel__delete (struct pyrf_evsel *pevsel)
 
static PyObject * pyrf_evsel__open (struct pyrf_evsel *pevsel, PyObject *args, PyObject *kwargs)
 
static int pyrf_evsel__setup_types (void)
 
static int pyrf_evlist__init (struct pyrf_evlist *pevlist, PyObject *args, PyObject *kwargs __maybe_unused)
 
static void pyrf_evlist__delete (struct pyrf_evlist *pevlist)
 
static PyObject * pyrf_evlist__mmap (struct pyrf_evlist *pevlist, PyObject *args, PyObject *kwargs)
 
static PyObject * pyrf_evlist__poll (struct pyrf_evlist *pevlist, PyObject *args, PyObject *kwargs)
 
static PyObject * pyrf_evlist__get_pollfd (struct pyrf_evlist *pevlist, PyObject *args __maybe_unused, PyObject *kwargs __maybe_unused)
 
static PyObject * pyrf_evlist__add (struct pyrf_evlist *pevlist, PyObject *args, PyObject *kwargs __maybe_unused)
 
static PyObject * pyrf_evlist__read_on_cpu (struct pyrf_evlist *pevlist, PyObject *args, PyObject *kwargs)
 
static PyObject * pyrf_evlist__open (struct pyrf_evlist *pevlist, PyObject *args, PyObject *kwargs)
 
static Py_ssize_t pyrf_evlist__length (PyObject *obj)
 
static PyObject * pyrf_evlist__item (PyObject *obj, Py_ssize_t i)
 
static int pyrf_evlist__setup_types (void)
 
static PyObject * pyrf__tracepoint (struct pyrf_evsel *pevsel, PyObject *args, PyObject *kwargs)
 
void test_attr__open (struct perf_event_attr *attr, pid_t pid, int cpu, int fd, int group_fd, unsigned long flags)
 

Variables

struct callchain_param callchain_param
 
int verbose
 
static char pyrf_mmap_event__doc [] = PyDoc_STR("perf mmap event object.")
 
static PyMemberDef pyrf_mmap_event__members []
 
static PyTypeObject pyrf_mmap_event__type
 
static char pyrf_task_event__doc [] = PyDoc_STR("perf task (fork/exit) event object.")
 
static PyMemberDef pyrf_task_event__members []
 
static PyTypeObject pyrf_task_event__type
 
static char pyrf_comm_event__doc [] = PyDoc_STR("perf comm event object.")
 
static PyMemberDef pyrf_comm_event__members []
 
static PyTypeObject pyrf_comm_event__type
 
static char pyrf_throttle_event__doc [] = PyDoc_STR("perf throttle event object.")
 
static PyMemberDef pyrf_throttle_event__members []
 
static PyTypeObject pyrf_throttle_event__type
 
static char pyrf_lost_event__doc [] = PyDoc_STR("perf lost event object.")
 
static PyMemberDef pyrf_lost_event__members []
 
static PyTypeObject pyrf_lost_event__type
 
static char pyrf_read_event__doc [] = PyDoc_STR("perf read event object.")
 
static PyMemberDef pyrf_read_event__members []
 
static PyTypeObject pyrf_read_event__type
 
static char pyrf_sample_event__doc [] = PyDoc_STR("perf sample event object.")
 
static PyMemberDef pyrf_sample_event__members []
 
static PyTypeObject pyrf_sample_event__type
 
static char pyrf_context_switch_event__doc [] = PyDoc_STR("perf context_switch event object.")
 
static PyMemberDef pyrf_context_switch_event__members []
 
static PyTypeObject pyrf_context_switch_event__type
 
static PyTypeObject * pyrf_event__type []
 
static PySequenceMethods pyrf_cpu_map__sequence_methods
 
static char pyrf_cpu_map__doc [] = PyDoc_STR("cpu map object.")
 
static PyTypeObject pyrf_cpu_map__type
 
static PySequenceMethods pyrf_thread_map__sequence_methods
 
static char pyrf_thread_map__doc [] = PyDoc_STR("thread map object.")
 
static PyTypeObject pyrf_thread_map__type
 
static PyMethodDef pyrf_evsel__methods []
 
static char pyrf_evsel__doc [] = PyDoc_STR("perf event selector list object.")
 
static PyTypeObject pyrf_evsel__type
 
static PyMethodDef pyrf_evlist__methods []
 
static PySequenceMethods pyrf_evlist__sequence_methods
 
static char pyrf_evlist__doc [] = PyDoc_STR("perf event selector list object.")
 
static PyTypeObject pyrf_evlist__type
 
struct {
   const char *   name
 
   int   value
 
perf__constants []
 
static PyMethodDef perf__methods []
 

Macro Definition Documentation

◆ _PyLong_FromLong

#define _PyLong_FromLong (   arg)    PyInt_FromLong(arg)

Definition at line 22 of file python.c.

◆ _PyUnicode_AsString

#define _PyUnicode_AsString (   arg)    PyString_AsString(arg)

Definition at line 18 of file python.c.

◆ _PyUnicode_FromFormat

#define _PyUnicode_FromFormat (   ...)    PyString_FromFormat(__VA_ARGS__)

Definition at line 20 of file python.c.

◆ _PyUnicode_FromString

#define _PyUnicode_FromString (   arg)    PyString_FromString(arg)

Definition at line 16 of file python.c.

◆ member_def

#define member_def (   type,
  member,
  ptype,
  help 
)
Value:
{ #member, ptype, \
offsetof(struct pyrf_event, event) + offsetof(struct type, member), \
0, help }
#define event

Definition at line 82 of file python.c.

◆ PERF_CONST

#define PERF_CONST (   name)    { #name, PERF_##name }

Definition at line 1139 of file python.c.

◆ Py_TYPE

#define Py_TYPE (   ob)    (((PyObject*)(ob))->ob_type)

Definition at line 36 of file python.c.

◆ PyVarObject_HEAD_INIT

#define PyVarObject_HEAD_INIT (   type,
  size 
)    PyObject_HEAD_INIT(type) size,

Definition at line 73 of file python.c.

◆ sample_member_def

#define sample_member_def (   name,
  member,
  ptype,
  help 
)
Value:
{ #name, ptype, \
offsetof(struct pyrf_event, sample) + offsetof(struct perf_sample, member), \
0, help }
const char * name
Definition: python.c:1142

Definition at line 87 of file python.c.

◆ sample_members

#define sample_members
Value:
sample_member_def(sample_ip, ip, T_ULONGLONG, "event type"), \
sample_member_def(sample_pid, pid, T_INT, "event pid"), \
sample_member_def(sample_tid, tid, T_INT, "event tid"), \
sample_member_def(sample_time, time, T_ULONGLONG, "event timestamp"), \
sample_member_def(sample_addr, addr, T_ULONGLONG, "event addr"), \
sample_member_def(sample_id, id, T_ULONGLONG, "event id"), \
sample_member_def(sample_stream_id, stream_id, T_ULONGLONG, "event stream id"), \
sample_member_def(sample_period, period, T_ULONGLONG, "event period"), \
sample_member_def(sample_cpu, cpu, T_UINT, "event cpu"),
u32 pid
Definition: hists_common.c:15
#define sample_member_def(name, member, ptype, help)
Definition: python.c:87

Definition at line 99 of file python.c.

Function Documentation

◆ eprintf()

int eprintf ( int  level,
int  var,
const char *  fmt,
  ... 
)

Definition at line 57 of file python.c.

◆ get_tracepoint_field()

static PyObject* get_tracepoint_field ( struct pyrf_event pevent,
PyObject *  attr_name 
)
static

Definition at line 381 of file python.c.

Here is the call graph for this function:

◆ initperf()

PyMODINIT_FUNC initperf ( void  )

Definition at line 1252 of file python.c.

Here is the call graph for this function:

◆ is_tracepoint()

static bool is_tracepoint ( struct pyrf_event pevent)
static

Definition at line 336 of file python.c.

◆ parse_callchain_record()

int parse_callchain_record ( const char *arg  __maybe_unused,
struct callchain_param *param  __maybe_unused 
)

Definition at line 45 of file python.c.

◆ pyrf__tracepoint()

static PyObject* pyrf__tracepoint ( struct pyrf_evsel pevsel,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 1222 of file python.c.

Here is the call graph for this function:

◆ pyrf_comm_event__repr()

static PyObject* pyrf_comm_event__repr ( struct pyrf_event pevent)
static

Definition at line 200 of file python.c.

◆ pyrf_context_switch_event__repr()

static PyObject* pyrf_context_switch_event__repr ( struct pyrf_event pevent)
static

Definition at line 436 of file python.c.

Here is the call graph for this function:

◆ pyrf_cpu_map__delete()

static void pyrf_cpu_map__delete ( struct pyrf_cpu_map pcpus)
static

Definition at line 556 of file python.c.

Here is the call graph for this function:

◆ pyrf_cpu_map__init()

static int pyrf_cpu_map__init ( struct pyrf_cpu_map pcpus,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 540 of file python.c.

Here is the call graph for this function:

◆ pyrf_cpu_map__item()

static PyObject* pyrf_cpu_map__item ( PyObject *  obj,
Py_ssize_t  i 
)
static

Definition at line 569 of file python.c.

◆ pyrf_cpu_map__length()

static Py_ssize_t pyrf_cpu_map__length ( PyObject *  obj)
static

Definition at line 562 of file python.c.

◆ pyrf_cpu_map__setup_types()

static int pyrf_cpu_map__setup_types ( void  )
static

Definition at line 597 of file python.c.

◆ pyrf_event__new()

static PyObject* pyrf_event__new ( union perf_event event)
static

Definition at line 516 of file python.c.

Here is the call graph for this function:

◆ pyrf_event__setup_types()

static int pyrf_event__setup_types ( void  )
static

Definition at line 463 of file python.c.

◆ pyrf_evlist__add()

static PyObject* pyrf_evlist__add ( struct pyrf_evlist pevlist,
PyObject *  args,
PyObject *kwargs  __maybe_unused 
)
static

Definition at line 960 of file python.c.

Here is the call graph for this function:

◆ pyrf_evlist__delete()

static void pyrf_evlist__delete ( struct pyrf_evlist pevlist)
static

Definition at line 878 of file python.c.

Here is the call graph for this function:

◆ pyrf_evlist__get_pollfd()

static PyObject* pyrf_evlist__get_pollfd ( struct pyrf_evlist pevlist,
PyObject *args  __maybe_unused,
PyObject *kwargs  __maybe_unused 
)
static

Definition at line 923 of file python.c.

◆ pyrf_evlist__init()

static int pyrf_evlist__init ( struct pyrf_evlist pevlist,
PyObject *  args,
PyObject *kwargs  __maybe_unused 
)
static

Definition at line 862 of file python.c.

Here is the call graph for this function:

◆ pyrf_evlist__item()

static PyObject* pyrf_evlist__item ( PyObject *  obj,
Py_ssize_t  i 
)
static

Definition at line 1098 of file python.c.

◆ pyrf_evlist__length()

static Py_ssize_t pyrf_evlist__length ( PyObject *  obj)
static

Definition at line 1091 of file python.c.

◆ pyrf_evlist__mmap()

static PyObject* pyrf_evlist__mmap ( struct pyrf_evlist pevlist,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 884 of file python.c.

Here is the call graph for this function:

◆ pyrf_evlist__open()

static PyObject* pyrf_evlist__open ( struct pyrf_evlist pevlist,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 1029 of file python.c.

Here is the call graph for this function:

◆ pyrf_evlist__poll()

static PyObject* pyrf_evlist__poll ( struct pyrf_evlist pevlist,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 904 of file python.c.

Here is the call graph for this function:

◆ pyrf_evlist__read_on_cpu()

static PyObject* pyrf_evlist__read_on_cpu ( struct pyrf_evlist pevlist,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 979 of file python.c.

Here is the call graph for this function:

◆ pyrf_evlist__setup_types()

static int pyrf_evlist__setup_types ( void  )
static

Definition at line 1133 of file python.c.

◆ pyrf_evsel__delete()

static void pyrf_evsel__delete ( struct pyrf_evsel pevsel)
static

Definition at line 787 of file python.c.

Here is the call graph for this function:

◆ pyrf_evsel__init()

static int pyrf_evsel__init ( struct pyrf_evsel pevsel,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 678 of file python.c.

Here is the call graph for this function:

◆ pyrf_evsel__open()

static PyObject* pyrf_evsel__open ( struct pyrf_evsel pevsel,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 793 of file python.c.

Here is the call graph for this function:

◆ pyrf_evsel__setup_types()

static int pyrf_evsel__setup_types ( void  )
static

Definition at line 850 of file python.c.

◆ pyrf_lost_event__repr()

static PyObject* pyrf_lost_event__repr ( struct pyrf_event pevent)
static

Definition at line 258 of file python.c.

Here is the call graph for this function:

◆ pyrf_mmap_event__repr()

static PyObject* pyrf_mmap_event__repr ( struct pyrf_event pevent)
static

Definition at line 125 of file python.c.

Here is the call graph for this function:

◆ pyrf_read_event__repr()

static PyObject* pyrf_read_event__repr ( struct pyrf_event pevent)
static

Definition at line 293 of file python.c.

◆ pyrf_sample_event__getattro()

static PyObject* pyrf_sample_event__getattro ( struct pyrf_event pevent,
PyObject *  attr_name 
)
static

Definition at line 405 of file python.c.

Here is the call graph for this function:

◆ pyrf_sample_event__repr()

static PyObject* pyrf_sample_event__repr ( struct pyrf_event pevent)
static

Definition at line 322 of file python.c.

Here is the call graph for this function:

◆ pyrf_task_event__repr()

static PyObject* pyrf_task_event__repr ( struct pyrf_event pevent)
static

Definition at line 167 of file python.c.

◆ pyrf_thread_map__delete()

static void pyrf_thread_map__delete ( struct pyrf_thread_map pthreads)
static

Definition at line 625 of file python.c.

Here is the call graph for this function:

◆ pyrf_thread_map__init()

static int pyrf_thread_map__init ( struct pyrf_thread_map pthreads,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 609 of file python.c.

Here is the call graph for this function:

◆ pyrf_thread_map__item()

static PyObject* pyrf_thread_map__item ( PyObject *  obj,
Py_ssize_t  i 
)
static

Definition at line 638 of file python.c.

◆ pyrf_thread_map__length()

static Py_ssize_t pyrf_thread_map__length ( PyObject *  obj)
static

Definition at line 631 of file python.c.

◆ pyrf_thread_map__setup_types()

static int pyrf_thread_map__setup_types ( void  )
static

Definition at line 666 of file python.c.

◆ pyrf_throttle_event__repr()

static PyObject* pyrf_throttle_event__repr ( struct pyrf_event pevent)
static

Definition at line 229 of file python.c.

◆ test_attr__open()

void test_attr__open ( struct perf_event_attr *  attr,
pid_t  pid,
int  cpu,
int  fd,
int  group_fd,
unsigned long  flags 
)

Definition at line 1355 of file python.c.

◆ tracepoint_field()

static PyObject* tracepoint_field ( struct pyrf_event pe,
struct format_field *  field 
)
static

Definition at line 342 of file python.c.

Here is the call graph for this function:

Variable Documentation

◆ callchain_param

Definition at line 43 of file python.c.

◆ name

const char* name

Definition at line 1142 of file python.c.

◆ perf__constants

struct { ... } perf__constants[]

◆ perf__methods

PyMethodDef perf__methods[]
static
Initial value:
= {
{
.ml_name = "tracepoint",
.ml_meth = (PyCFunction) pyrf__tracepoint,
.ml_flags = METH_VARARGS | METH_KEYWORDS,
.ml_doc = PyDoc_STR("Get tracepoint config.")
},
{ .ml_name = NULL, }
}
static PyObject * pyrf__tracepoint(struct pyrf_evsel *pevsel, PyObject *args, PyObject *kwargs)
Definition: python.c:1222

Definition at line 1241 of file python.c.

◆ pyrf_comm_event__doc

char pyrf_comm_event__doc[] = PyDoc_STR("perf comm event object.")
static

Definition at line 189 of file python.c.

◆ pyrf_comm_event__members

PyMemberDef pyrf_comm_event__members[]
static
Initial value:
= {
member_def(perf_event_header, type, T_UINT, "event type"),
member_def(comm_event, pid, T_UINT, "event pid"),
member_def(comm_event, tid, T_UINT, "event tid"),
member_def(comm_event, comm, T_STRING_INPLACE, "process name"),
{ .name = NULL, },
}
Definition: comm.h:11
u32 pid
Definition: hists_common.c:15
#define member_def(type, member, ptype, help)
Definition: python.c:82
#define sample_members
Definition: python.c:99

Definition at line 191 of file python.c.

◆ pyrf_comm_event__type

PyTypeObject pyrf_comm_event__type
static
Initial value:
= {
.tp_name = "perf.comm_event",
.tp_basicsize = sizeof(struct pyrf_event),
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_members = pyrf_comm_event__members,
.tp_repr = (reprfunc)pyrf_comm_event__repr,
}
static PyMemberDef pyrf_comm_event__members[]
Definition: python.c:191
static char pyrf_comm_event__doc[]
Definition: python.c:189
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static PyObject * pyrf_comm_event__repr(struct pyrf_event *pevent)
Definition: python.c:200

Definition at line 208 of file python.c.

◆ pyrf_context_switch_event__doc

char pyrf_context_switch_event__doc[] = PyDoc_STR("perf context_switch event object.")
static

Definition at line 426 of file python.c.

◆ pyrf_context_switch_event__members

PyMemberDef pyrf_context_switch_event__members[]
static
Initial value:
= {
member_def(perf_event_header, type, T_UINT, "event type"),
member_def(context_switch_event, next_prev_pid, T_UINT, "next/prev pid"),
member_def(context_switch_event, next_prev_tid, T_UINT, "next/prev tid"),
{ .name = NULL, },
}
#define member_def(type, member, ptype, help)
Definition: python.c:82
#define sample_members
Definition: python.c:99

Definition at line 428 of file python.c.

◆ pyrf_context_switch_event__type

PyTypeObject pyrf_context_switch_event__type
static
Initial value:
= {
.tp_name = "perf.context_switch_event",
.tp_basicsize = sizeof(struct pyrf_event),
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_repr = (reprfunc)pyrf_context_switch_event__repr,
}
static PyMemberDef pyrf_context_switch_event__members[]
Definition: python.c:428
static PyObject * pyrf_context_switch_event__repr(struct pyrf_event *pevent)
Definition: python.c:436
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static char pyrf_context_switch_event__doc[]
Definition: python.c:426

Definition at line 453 of file python.c.

◆ pyrf_cpu_map__doc

char pyrf_cpu_map__doc[] = PyDoc_STR("cpu map object.")
static

Definition at line 584 of file python.c.

◆ pyrf_cpu_map__sequence_methods

PySequenceMethods pyrf_cpu_map__sequence_methods
static
Initial value:
= {
.sq_length = pyrf_cpu_map__length,
.sq_item = pyrf_cpu_map__item,
}
static PyObject * pyrf_cpu_map__item(PyObject *obj, Py_ssize_t i)
Definition: python.c:569
static Py_ssize_t pyrf_cpu_map__length(PyObject *obj)
Definition: python.c:562

Definition at line 579 of file python.c.

◆ pyrf_cpu_map__type

PyTypeObject pyrf_cpu_map__type
static
Initial value:
= {
.tp_name = "perf.cpu_map",
.tp_basicsize = sizeof(struct pyrf_cpu_map),
.tp_dealloc = (destructor)pyrf_cpu_map__delete,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = pyrf_cpu_map__doc,
.tp_as_sequence = &pyrf_cpu_map__sequence_methods,
.tp_init = (initproc)pyrf_cpu_map__init,
}
static int pyrf_cpu_map__init(struct pyrf_cpu_map *pcpus, PyObject *args, PyObject *kwargs)
Definition: python.c:540
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static PySequenceMethods pyrf_cpu_map__sequence_methods
Definition: python.c:579
static void pyrf_cpu_map__delete(struct pyrf_cpu_map *pcpus)
Definition: python.c:556
static char pyrf_cpu_map__doc[]
Definition: python.c:584

Definition at line 586 of file python.c.

◆ pyrf_event__type

PyTypeObject* pyrf_event__type[]
static
Initial value:
= {
[PERF_RECORD_MMAP] = &pyrf_mmap_event__type,
[PERF_RECORD_LOST] = &pyrf_lost_event__type,
[PERF_RECORD_COMM] = &pyrf_comm_event__type,
[PERF_RECORD_EXIT] = &pyrf_task_event__type,
[PERF_RECORD_THROTTLE] = &pyrf_throttle_event__type,
[PERF_RECORD_UNTHROTTLE] = &pyrf_throttle_event__type,
[PERF_RECORD_FORK] = &pyrf_task_event__type,
[PERF_RECORD_READ] = &pyrf_read_event__type,
[PERF_RECORD_SAMPLE] = &pyrf_sample_event__type,
[PERF_RECORD_SWITCH] = &pyrf_context_switch_event__type,
[PERF_RECORD_SWITCH_CPU_WIDE] = &pyrf_context_switch_event__type,
}
static PyTypeObject pyrf_task_event__type
Definition: python.c:179
static PyTypeObject pyrf_throttle_event__type
Definition: python.c:239
static PyTypeObject pyrf_sample_event__type
Definition: python.c:415
static PyTypeObject pyrf_context_switch_event__type
Definition: python.c:453
static PyTypeObject pyrf_mmap_event__type
Definition: python.c:144
static PyTypeObject pyrf_comm_event__type
Definition: python.c:208
static PyTypeObject pyrf_read_event__type
Definition: python.c:304
static PyTypeObject pyrf_lost_event__type
Definition: python.c:274

Definition at line 502 of file python.c.

◆ pyrf_evlist__doc

char pyrf_evlist__doc[] = PyDoc_STR("perf event selector list object.")
static

Definition at line 1119 of file python.c.

◆ pyrf_evlist__methods

PyMethodDef pyrf_evlist__methods[]
static

Definition at line 1051 of file python.c.

◆ pyrf_evlist__sequence_methods

PySequenceMethods pyrf_evlist__sequence_methods
static
Initial value:
= {
.sq_length = pyrf_evlist__length,
.sq_item = pyrf_evlist__item,
}
static Py_ssize_t pyrf_evlist__length(PyObject *obj)
Definition: python.c:1091
static PyObject * pyrf_evlist__item(PyObject *obj, Py_ssize_t i)
Definition: python.c:1098

Definition at line 1114 of file python.c.

◆ pyrf_evlist__type

PyTypeObject pyrf_evlist__type
static
Initial value:
= {
.tp_name = "perf.evlist",
.tp_basicsize = sizeof(struct pyrf_evlist),
.tp_dealloc = (destructor)pyrf_evlist__delete,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_as_sequence = &pyrf_evlist__sequence_methods,
.tp_doc = pyrf_evlist__doc,
.tp_methods = pyrf_evlist__methods,
.tp_init = (initproc)pyrf_evlist__init,
}
static PySequenceMethods pyrf_evlist__sequence_methods
Definition: python.c:1114
static int pyrf_evlist__init(struct pyrf_evlist *pevlist, PyObject *args, PyObject *kwargs __maybe_unused)
Definition: python.c:862
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static void pyrf_evlist__delete(struct pyrf_evlist *pevlist)
Definition: python.c:878
static PyMethodDef pyrf_evlist__methods[]
Definition: python.c:1051
static char pyrf_evlist__doc[]
Definition: python.c:1119

Definition at line 1121 of file python.c.

◆ pyrf_evsel__doc

char pyrf_evsel__doc[] = PyDoc_STR("perf event selector list object.")
static

Definition at line 837 of file python.c.

◆ pyrf_evsel__methods

PyMethodDef pyrf_evsel__methods[]
static
Initial value:
= {
{
.ml_name = "open",
.ml_meth = (PyCFunction)pyrf_evsel__open,
.ml_flags = METH_VARARGS | METH_KEYWORDS,
.ml_doc = PyDoc_STR("open the event selector file descriptor table.")
},
{ .ml_name = NULL, }
}
static PyObject * pyrf_evsel__open(struct pyrf_evsel *pevsel, PyObject *args, PyObject *kwargs)
Definition: python.c:793

Definition at line 827 of file python.c.

◆ pyrf_evsel__type

PyTypeObject pyrf_evsel__type
static
Initial value:
= {
.tp_name = "perf.evsel",
.tp_basicsize = sizeof(struct pyrf_evsel),
.tp_dealloc = (destructor)pyrf_evsel__delete,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = pyrf_evsel__doc,
.tp_methods = pyrf_evsel__methods,
.tp_init = (initproc)pyrf_evsel__init,
}
static int pyrf_evsel__init(struct pyrf_evsel *pevsel, PyObject *args, PyObject *kwargs)
Definition: python.c:678
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static char pyrf_evsel__doc[]
Definition: python.c:837
static PyMethodDef pyrf_evsel__methods[]
Definition: python.c:827
static void pyrf_evsel__delete(struct pyrf_evsel *pevsel)
Definition: python.c:787

Definition at line 839 of file python.c.

◆ pyrf_lost_event__doc

char pyrf_lost_event__doc[] = PyDoc_STR("perf lost event object.")
static

Definition at line 249 of file python.c.

◆ pyrf_lost_event__members

PyMemberDef pyrf_lost_event__members[]
static
Initial value:
= {
member_def(lost_event, id, T_ULONGLONG, "event id"),
member_def(lost_event, lost, T_ULONGLONG, "number of lost events"),
{ .name = NULL, },
}
#define member_def(type, member, ptype, help)
Definition: python.c:82
#define sample_members
Definition: python.c:99

Definition at line 251 of file python.c.

◆ pyrf_lost_event__type

PyTypeObject pyrf_lost_event__type
static
Initial value:
= {
.tp_name = "perf.lost_event",
.tp_basicsize = sizeof(struct pyrf_event),
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_members = pyrf_lost_event__members,
.tp_repr = (reprfunc)pyrf_lost_event__repr,
}
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static PyMemberDef pyrf_lost_event__members[]
Definition: python.c:251
static char pyrf_lost_event__doc[]
Definition: python.c:249
static PyObject * pyrf_lost_event__repr(struct pyrf_event *pevent)
Definition: python.c:258

Definition at line 274 of file python.c.

◆ pyrf_mmap_event__doc

char pyrf_mmap_event__doc[] = PyDoc_STR("perf mmap event object.")
static

Definition at line 110 of file python.c.

◆ pyrf_mmap_event__members

PyMemberDef pyrf_mmap_event__members[]
static
Initial value:
= {
member_def(perf_event_header, type, T_UINT, "event type"),
member_def(perf_event_header, misc, T_UINT, "event misc"),
member_def(mmap_event, pid, T_UINT, "event pid"),
member_def(mmap_event, tid, T_UINT, "event tid"),
member_def(mmap_event, start, T_ULONGLONG, "start of the map"),
member_def(mmap_event, len, T_ULONGLONG, "map length"),
member_def(mmap_event, pgoff, T_ULONGLONG, "page offset"),
member_def(mmap_event, filename, T_STRING_INPLACE, "backing store"),
{ .name = NULL, },
}
const char * filename
Definition: hists_common.c:26
u32 pid
Definition: hists_common.c:15
u64 start
Definition: hists_common.c:25
#define member_def(type, member, ptype, help)
Definition: python.c:82
#define sample_members
Definition: python.c:99

Definition at line 112 of file python.c.

◆ pyrf_mmap_event__type

PyTypeObject pyrf_mmap_event__type
static
Initial value:
= {
.tp_name = "perf.mmap_event",
.tp_basicsize = sizeof(struct pyrf_event),
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_members = pyrf_mmap_event__members,
.tp_repr = (reprfunc)pyrf_mmap_event__repr,
}
static char pyrf_mmap_event__doc[]
Definition: python.c:110
static PyMemberDef pyrf_mmap_event__members[]
Definition: python.c:112
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static PyObject * pyrf_mmap_event__repr(struct pyrf_event *pevent)
Definition: python.c:125

Definition at line 144 of file python.c.

◆ pyrf_read_event__doc

char pyrf_read_event__doc[] = PyDoc_STR("perf read event object.")
static

Definition at line 284 of file python.c.

◆ pyrf_read_event__members

PyMemberDef pyrf_read_event__members[]
static
Initial value:
= {
member_def(read_event, pid, T_UINT, "event pid"),
member_def(read_event, tid, T_UINT, "event tid"),
{ .name = NULL, },
}
u32 pid
Definition: hists_common.c:15
#define member_def(type, member, ptype, help)
Definition: python.c:82
#define sample_members
Definition: python.c:99

Definition at line 286 of file python.c.

◆ pyrf_read_event__type

PyTypeObject pyrf_read_event__type
static
Initial value:
= {
.tp_name = "perf.read_event",
.tp_basicsize = sizeof(struct pyrf_event),
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_members = pyrf_read_event__members,
.tp_repr = (reprfunc)pyrf_read_event__repr,
}
static PyObject * pyrf_read_event__repr(struct pyrf_event *pevent)
Definition: python.c:293
static PyMemberDef pyrf_read_event__members[]
Definition: python.c:286
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static char pyrf_read_event__doc[]
Definition: python.c:284

Definition at line 304 of file python.c.

◆ pyrf_sample_event__doc

char pyrf_sample_event__doc[] = PyDoc_STR("perf sample event object.")
static

Definition at line 314 of file python.c.

◆ pyrf_sample_event__members

PyMemberDef pyrf_sample_event__members[]
static
Initial value:
= {
member_def(perf_event_header, type, T_UINT, "event type"),
{ .name = NULL, },
}
#define member_def(type, member, ptype, help)
Definition: python.c:82
#define sample_members
Definition: python.c:99

Definition at line 316 of file python.c.

◆ pyrf_sample_event__type

PyTypeObject pyrf_sample_event__type
static
Initial value:
= {
.tp_name = "perf.sample_event",
.tp_basicsize = sizeof(struct pyrf_event),
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_repr = (reprfunc)pyrf_sample_event__repr,
.tp_getattro = (getattrofunc) pyrf_sample_event__getattro,
}
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static PyMemberDef pyrf_sample_event__members[]
Definition: python.c:316
static PyObject * pyrf_sample_event__getattro(struct pyrf_event *pevent, PyObject *attr_name)
Definition: python.c:405
static PyObject * pyrf_sample_event__repr(struct pyrf_event *pevent)
Definition: python.c:322
static char pyrf_sample_event__doc[]
Definition: python.c:314

Definition at line 415 of file python.c.

◆ pyrf_task_event__doc

char pyrf_task_event__doc[] = PyDoc_STR("perf task (fork/exit) event object.")
static

Definition at line 154 of file python.c.

◆ pyrf_task_event__members

PyMemberDef pyrf_task_event__members[]
static
Initial value:
= {
member_def(perf_event_header, type, T_UINT, "event type"),
member_def(fork_event, pid, T_UINT, "event pid"),
member_def(fork_event, ppid, T_UINT, "event ppid"),
member_def(fork_event, tid, T_UINT, "event tid"),
member_def(fork_event, ptid, T_UINT, "event ptid"),
member_def(fork_event, time, T_ULONGLONG, "timestamp"),
{ .name = NULL, },
}
u32 pid
Definition: hists_common.c:15
#define member_def(type, member, ptype, help)
Definition: python.c:82
#define sample_members
Definition: python.c:99

Definition at line 156 of file python.c.

◆ pyrf_task_event__type

PyTypeObject pyrf_task_event__type
static
Initial value:
= {
.tp_name = "perf.task_event",
.tp_basicsize = sizeof(struct pyrf_event),
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_members = pyrf_task_event__members,
.tp_repr = (reprfunc)pyrf_task_event__repr,
}
static PyMemberDef pyrf_task_event__members[]
Definition: python.c:156
static char pyrf_task_event__doc[]
Definition: python.c:154
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static PyObject * pyrf_task_event__repr(struct pyrf_event *pevent)
Definition: python.c:167

Definition at line 179 of file python.c.

◆ pyrf_thread_map__doc

char pyrf_thread_map__doc[] = PyDoc_STR("thread map object.")
static

Definition at line 653 of file python.c.

◆ pyrf_thread_map__sequence_methods

PySequenceMethods pyrf_thread_map__sequence_methods
static
Initial value:
= {
}
static Py_ssize_t pyrf_thread_map__length(PyObject *obj)
Definition: python.c:631
static PyObject * pyrf_thread_map__item(PyObject *obj, Py_ssize_t i)
Definition: python.c:638

Definition at line 648 of file python.c.

◆ pyrf_thread_map__type

PyTypeObject pyrf_thread_map__type
static
Initial value:
= {
.tp_name = "perf.thread_map",
.tp_basicsize = sizeof(struct pyrf_thread_map),
.tp_dealloc = (destructor)pyrf_thread_map__delete,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_init = (initproc)pyrf_thread_map__init,
}
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static int pyrf_thread_map__init(struct pyrf_thread_map *pthreads, PyObject *args, PyObject *kwargs)
Definition: python.c:609
static char pyrf_thread_map__doc[]
Definition: python.c:653
static void pyrf_thread_map__delete(struct pyrf_thread_map *pthreads)
Definition: python.c:625
static PySequenceMethods pyrf_thread_map__sequence_methods
Definition: python.c:648

Definition at line 655 of file python.c.

◆ pyrf_throttle_event__doc

char pyrf_throttle_event__doc[] = PyDoc_STR("perf throttle event object.")
static

Definition at line 218 of file python.c.

◆ pyrf_throttle_event__members

PyMemberDef pyrf_throttle_event__members[]
static
Initial value:
= {
member_def(perf_event_header, type, T_UINT, "event type"),
member_def(throttle_event, time, T_ULONGLONG, "timestamp"),
member_def(throttle_event, id, T_ULONGLONG, "event id"),
member_def(throttle_event, stream_id, T_ULONGLONG, "event stream id"),
{ .name = NULL, },
}
#define member_def(type, member, ptype, help)
Definition: python.c:82
#define sample_members
Definition: python.c:99

Definition at line 220 of file python.c.

◆ pyrf_throttle_event__type

PyTypeObject pyrf_throttle_event__type
static
Initial value:
= {
.tp_name = "perf.throttle_event",
.tp_basicsize = sizeof(struct pyrf_event),
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_repr = (reprfunc)pyrf_throttle_event__repr,
}
static PyMemberDef pyrf_throttle_event__members[]
Definition: python.c:220
static PyObject * pyrf_throttle_event__repr(struct pyrf_event *pevent)
Definition: python.c:229
#define PyVarObject_HEAD_INIT(type, size)
Definition: python.c:73
static char pyrf_throttle_event__doc[]
Definition: python.c:218

Definition at line 239 of file python.c.

◆ value

int value

Definition at line 1143 of file python.c.

◆ verbose

int verbose

Definition at line 55 of file python.c.