perf python: Put perf.event objects into dictionary
authorJiri Olsa <jolsa@kernel.org>
Sun, 10 Jul 2016 11:07:57 +0000 (13:07 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Jul 2016 19:17:14 +0000 (16:17 -0300)
commit85e37de3a993b9e407398f792b996acad27f4cdc
tree97d0b8f156785d020daa5e355567a162f8ef79f9
parente8968e654191390a1300f0847250353a1c9da30d
perf python: Put perf.event objects into dictionary

Make perf.event object parts of the perf module dictionary so we can
address them by name.

The following objects/names are added:

  mmap_event
  lost_event
  comm_event
  task_event
  throttle_event
  task_event
  read_event
  sample_event
  switch_event

We can now use it in python script like:
  ...
  event = evlist.read_on_cpu(cpu)
  ...
  if not isinstance(event, perf.sample_event):

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1468148882-10362-6-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/python.c