diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-08-02 10:42:57 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-08-02 10:42:57 -0400 |
| commit | cb0b29e0861659c9eef9664772cd7e845ba1104a (patch) | |
| tree | a53dd1ebccef16cb9e7873aa76566ab339fb73ff /tools/perf/util/python.c | |
| parent | 7b56cce27123ccbf2cb82febbbc88443d719f1f8 (diff) | |
perf evlist: Introduce perf_evlist__parse_sample
That is a more compact form of perf_session__parse_sample and to support
multiple evlists per perf_session is the way to go anyway.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-vkxx3j5qktoj11bvcwmfjj13@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/python.c')
| -rw-r--r-- | tools/perf/util/python.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index b0d6f85e30f1..0688bfb6d280 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
| @@ -797,17 +797,13 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist, | |||
| 797 | 797 | ||
| 798 | event = perf_evlist__mmap_read(evlist, cpu); | 798 | event = perf_evlist__mmap_read(evlist, cpu); |
| 799 | if (event != NULL) { | 799 | if (event != NULL) { |
| 800 | struct perf_evsel *first; | ||
| 801 | PyObject *pyevent = pyrf_event__new(event); | 800 | PyObject *pyevent = pyrf_event__new(event); |
| 802 | struct pyrf_event *pevent = (struct pyrf_event *)pyevent; | 801 | struct pyrf_event *pevent = (struct pyrf_event *)pyevent; |
| 803 | 802 | ||
| 804 | if (pyevent == NULL) | 803 | if (pyevent == NULL) |
| 805 | return PyErr_NoMemory(); | 804 | return PyErr_NoMemory(); |
| 806 | 805 | ||
| 807 | first = list_entry(evlist->entries.next, struct perf_evsel, node); | 806 | err = perf_evlist__parse_sample(evlist, event, &pevent->sample, false); |
| 808 | err = perf_event__parse_sample(event, first->attr.sample_type, | ||
| 809 | first->sample_size, | ||
| 810 | sample_id_all, &pevent->sample, false); | ||
| 811 | if (err) | 807 | if (err) |
| 812 | return PyErr_Format(PyExc_OSError, | 808 | return PyErr_Format(PyExc_OSError, |
| 813 | "perf: can't parse sample, err=%d", err); | 809 | "perf: can't parse sample, err=%d", err); |
