perf python: Use exception to propagate errors
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 2 Jun 2011 13:55:10 +0000 (10:55 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 3 Jun 2011 13:07:01 +0000 (10:07 -0300)
commit9c850d6c4b95bb07fb066eb7f43dd4e3b4842b85
tree5f6429b7558b215593f274b061c2979196df877a
parentd21cc9f67d689effbfd24bac878bc2c057de8c46
perf python: Use exception to propagate errors

We were using pr_debug to tell the user about not being able to parse a sample
where we should really use the python way of reporting errors: exceptions.

Fixes this problem:

[root@emilia ~]# python
>>> import perf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/acme/git/build/perf/python/perf.so: undefined symbol: eprintf
>>>
[root@emilia ~]

As we want to keep the objects linked in the python binding (and in the future
in a shared library) minimal.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
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-m9dba9kaluas0kq8r58z191c@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/python.c