lkml.org 
[lkml]   [2013]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] perf: fix undefined symbols in python binding
    Date
    Add dummy test_attr__enabled and test_attr__open symbols to
    util/python.c to fix the following dynamic linker error:

    $ python python/twatch.py
    Traceback (most recent call last):
    File "python/twatch.py", line 16, in <module>
    import perf
    ImportError: /path/to/perf.so: undefined symbol: test_attr__enabled

    Signed-off-by: Ben Noordhuis <info@bnoordhuis.nl>
    ---
    tools/perf/util/python.c | 9 +++++++++
    1 file changed, 9 insertions(+)

    diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
    index a2657fd..163abbb 100644
    --- a/tools/perf/util/python.c
    +++ b/tools/perf/util/python.c
    @@ -8,6 +8,15 @@
    #include "cpumap.h"
    #include "thread_map.h"

    +/* Dummy to satisfy linker. */
    +bool test_attr__enabled;
    +
    +/* Dummy to satisfy linker. */
    +void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
    + int fd, int group_fd, unsigned long flags)
    +{
    +}
    +
    /* Define PyVarObject_HEAD_INIT for python 2.5 */
    #ifndef PyVarObject_HEAD_INIT
    # define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size,
    --
    1.7.9.5


    \
     
     \ /
      Last update: 2013-02-04 02:21    [W:9.570 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site