aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/python.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 12:25:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 12:25:52 -0400
commit19504828b4bee5e471bcd35e214bc6fd0d380692 (patch)
tree30d4ffb6783daf9fadd47548c035646d3f0f073e /tools/perf/util/python.c
parent57d19e80f459dd845fb3cfeba8e6df8471bac142 (diff)
parent3cb6d1540880e767d911b79eb49578de2190f428 (diff)
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: perf tools: Fix sample size bit operations perf tools: Fix ommitted mmap data update on remap watchdog: Change the default timeout and configure nmi watchdog period based on watchdog_thresh watchdog: Disable watchdog when thresh is zero watchdog: Only disable/enable watchdog if neccessary watchdog: Fix rounding bug in get_sample_period() perf tools: Propagate event parse error handling perf tools: Robustify dynamic sample content fetch perf tools: Pre-check sample size before parsing perf tools: Move evlist sample helpers to evlist area perf tools: Remove junk code in mmap size handling perf tools: Check we are able to read the event size on mmap
Diffstat (limited to 'tools/perf/util/python.c')
-rw-r--r--tools/perf/util/python.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index b5c7d818001c..69436b3200a4 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -675,6 +675,7 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist,
675 union perf_event *event; 675 union perf_event *event;
676 int sample_id_all = 1, cpu; 676 int sample_id_all = 1, cpu;
677 static char *kwlist[] = {"sample_id_all", NULL, NULL}; 677 static char *kwlist[] = {"sample_id_all", NULL, NULL};
678 int err;
678 679
679 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|i", kwlist, 680 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|i", kwlist,
680 &cpu, &sample_id_all)) 681 &cpu, &sample_id_all))
@@ -690,11 +691,17 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist,
690 return PyErr_NoMemory(); 691 return PyErr_NoMemory();
691 692
692 first = list_entry(evlist->entries.next, struct perf_evsel, node); 693 first = list_entry(evlist->entries.next, struct perf_evsel, node);
693 perf_event__parse_sample(event, first->attr.sample_type, sample_id_all, 694 err = perf_event__parse_sample(event, first->attr.sample_type,
694 &pevent->sample); 695 perf_sample_size(first->attr.sample_type),
696 sample_id_all, &pevent->sample);
697 if (err) {
698 pr_err("Can't parse sample, err = %d\n", err);
699 goto end;
700 }
701
695 return pyevent; 702 return pyevent;
696 } 703 }
697 704end:
698 Py_INCREF(Py_None); 705 Py_INCREF(Py_None);
699 return Py_None; 706 return Py_None;
700} 707}