diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-31 17:56:27 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-31 17:56:27 -0500 |
commit | f6bbc1daac964da551130dbf01809d3fbd178b2d (patch) | |
tree | 6f9793f84ec52bc6af71652128a5302d95a086f1 /tools/perf/util/python.c | |
parent | 823c7164a92a6347d46bb64aaae728b6d08f3bb8 (diff) |
perf python: Fix build on 32-bit
Where there are lots of errors related to python methods receiving
'char *' for things like file open mode, which break the build, also
disable strict aliasing and fixup some other warnings. Now builds on
both 32-bit and 64-bit fedora systems.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
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 | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index d2d52175362e..5317ef229041 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
@@ -15,6 +15,8 @@ struct throttle_event { | |||
15 | u64 stream_id; | 15 | u64 stream_id; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | PyMODINIT_FUNC initperf(void); | ||
19 | |||
18 | #define member_def(type, member, ptype, help) \ | 20 | #define member_def(type, member, ptype, help) \ |
19 | { #member, ptype, \ | 21 | { #member, ptype, \ |
20 | offsetof(struct pyrf_event, event) + offsetof(struct type, member), \ | 22 | offsetof(struct pyrf_event, event) + offsetof(struct type, member), \ |
@@ -31,17 +33,15 @@ struct pyrf_event { | |||
31 | union perf_event event; | 33 | union perf_event event; |
32 | }; | 34 | }; |
33 | 35 | ||
34 | #define T_ULONG_LONG T_ULONG | ||
35 | |||
36 | #define sample_members \ | 36 | #define sample_members \ |
37 | sample_member_def(sample_ip, ip, T_ULONG_LONG, "event type"), \ | 37 | sample_member_def(sample_ip, ip, T_ULONGLONG, "event type"), \ |
38 | sample_member_def(sample_pid, pid, T_INT, "event pid"), \ | 38 | sample_member_def(sample_pid, pid, T_INT, "event pid"), \ |
39 | sample_member_def(sample_tid, tid, T_INT, "event tid"), \ | 39 | sample_member_def(sample_tid, tid, T_INT, "event tid"), \ |
40 | sample_member_def(sample_time, time, T_ULONG_LONG, "event timestamp"), \ | 40 | sample_member_def(sample_time, time, T_ULONGLONG, "event timestamp"), \ |
41 | sample_member_def(sample_addr, addr, T_ULONG_LONG, "event addr"), \ | 41 | sample_member_def(sample_addr, addr, T_ULONGLONG, "event addr"), \ |
42 | sample_member_def(sample_id, id, T_ULONG_LONG, "event id"), \ | 42 | sample_member_def(sample_id, id, T_ULONGLONG, "event id"), \ |
43 | sample_member_def(sample_stream_id, stream_id, T_ULONG_LONG, "event stream id"), \ | 43 | sample_member_def(sample_stream_id, stream_id, T_ULONGLONG, "event stream id"), \ |
44 | sample_member_def(sample_period, period, T_ULONG_LONG, "event period"), \ | 44 | sample_member_def(sample_period, period, T_ULONGLONG, "event period"), \ |
45 | sample_member_def(sample_cpu, cpu, T_UINT, "event cpu"), | 45 | sample_member_def(sample_cpu, cpu, T_UINT, "event cpu"), |
46 | 46 | ||
47 | static char pyrf_mmap_event__doc[] = PyDoc_STR("perf mmap event object."); | 47 | static char pyrf_mmap_event__doc[] = PyDoc_STR("perf mmap event object."); |
@@ -51,11 +51,11 @@ static PyMemberDef pyrf_mmap_event__members[] = { | |||
51 | member_def(perf_event_header, type, T_UINT, "event type"), | 51 | member_def(perf_event_header, type, T_UINT, "event type"), |
52 | member_def(mmap_event, pid, T_UINT, "event pid"), | 52 | member_def(mmap_event, pid, T_UINT, "event pid"), |
53 | member_def(mmap_event, tid, T_UINT, "event tid"), | 53 | member_def(mmap_event, tid, T_UINT, "event tid"), |
54 | member_def(mmap_event, start, T_ULONG_LONG, "start of the map"), | 54 | member_def(mmap_event, start, T_ULONGLONG, "start of the map"), |
55 | member_def(mmap_event, len, T_ULONG_LONG, "map length"), | 55 | member_def(mmap_event, len, T_ULONGLONG, "map length"), |
56 | member_def(mmap_event, pgoff, T_ULONG_LONG, "page offset"), | 56 | member_def(mmap_event, pgoff, T_ULONGLONG, "page offset"), |
57 | member_def(mmap_event, filename, T_STRING_INPLACE, "backing store"), | 57 | member_def(mmap_event, filename, T_STRING_INPLACE, "backing store"), |
58 | { NULL, }, | 58 | { .name = NULL, }, |
59 | }; | 59 | }; |
60 | 60 | ||
61 | static PyObject *pyrf_mmap_event__repr(struct pyrf_event *pevent) | 61 | static PyObject *pyrf_mmap_event__repr(struct pyrf_event *pevent) |
@@ -96,8 +96,8 @@ static PyMemberDef pyrf_task_event__members[] = { | |||
96 | member_def(fork_event, ppid, T_UINT, "event ppid"), | 96 | member_def(fork_event, ppid, T_UINT, "event ppid"), |
97 | member_def(fork_event, tid, T_UINT, "event tid"), | 97 | member_def(fork_event, tid, T_UINT, "event tid"), |
98 | member_def(fork_event, ptid, T_UINT, "event ptid"), | 98 | member_def(fork_event, ptid, T_UINT, "event ptid"), |
99 | member_def(fork_event, time, T_ULONG_LONG, "timestamp"), | 99 | member_def(fork_event, time, T_ULONGLONG, "timestamp"), |
100 | { NULL, }, | 100 | { .name = NULL, }, |
101 | }; | 101 | }; |
102 | 102 | ||
103 | static PyObject *pyrf_task_event__repr(struct pyrf_event *pevent) | 103 | static PyObject *pyrf_task_event__repr(struct pyrf_event *pevent) |
@@ -130,7 +130,7 @@ static PyMemberDef pyrf_comm_event__members[] = { | |||
130 | member_def(comm_event, pid, T_UINT, "event pid"), | 130 | member_def(comm_event, pid, T_UINT, "event pid"), |
131 | member_def(comm_event, tid, T_UINT, "event tid"), | 131 | member_def(comm_event, tid, T_UINT, "event tid"), |
132 | member_def(comm_event, comm, T_STRING_INPLACE, "process name"), | 132 | member_def(comm_event, comm, T_STRING_INPLACE, "process name"), |
133 | { NULL, }, | 133 | { .name = NULL, }, |
134 | }; | 134 | }; |
135 | 135 | ||
136 | static PyObject *pyrf_comm_event__repr(struct pyrf_event *pevent) | 136 | static PyObject *pyrf_comm_event__repr(struct pyrf_event *pevent) |
@@ -156,10 +156,10 @@ static char pyrf_throttle_event__doc[] = PyDoc_STR("perf throttle event object." | |||
156 | static PyMemberDef pyrf_throttle_event__members[] = { | 156 | static PyMemberDef pyrf_throttle_event__members[] = { |
157 | sample_members | 157 | sample_members |
158 | member_def(perf_event_header, type, T_UINT, "event type"), | 158 | member_def(perf_event_header, type, T_UINT, "event type"), |
159 | member_def(throttle_event, time, T_ULONG_LONG, "timestamp"), | 159 | member_def(throttle_event, time, T_ULONGLONG, "timestamp"), |
160 | member_def(throttle_event, id, T_ULONG_LONG, "event id"), | 160 | member_def(throttle_event, id, T_ULONGLONG, "event id"), |
161 | member_def(throttle_event, stream_id, T_ULONG_LONG, "event stream id"), | 161 | member_def(throttle_event, stream_id, T_ULONGLONG, "event stream id"), |
162 | { NULL, }, | 162 | { .name = NULL, }, |
163 | }; | 163 | }; |
164 | 164 | ||
165 | static PyObject *pyrf_throttle_event__repr(struct pyrf_event *pevent) | 165 | static PyObject *pyrf_throttle_event__repr(struct pyrf_event *pevent) |
@@ -522,7 +522,7 @@ static PyMethodDef pyrf_evsel__methods[] = { | |||
522 | .ml_flags = METH_VARARGS | METH_KEYWORDS, | 522 | .ml_flags = METH_VARARGS | METH_KEYWORDS, |
523 | .ml_doc = PyDoc_STR("open the event selector file descriptor table.") | 523 | .ml_doc = PyDoc_STR("open the event selector file descriptor table.") |
524 | }, | 524 | }, |
525 | { NULL, } | 525 | { .ml_name = NULL, } |
526 | }; | 526 | }; |
527 | 527 | ||
528 | static char pyrf_evsel__doc[] = PyDoc_STR("perf event selector list object."); | 528 | static char pyrf_evsel__doc[] = PyDoc_STR("perf event selector list object."); |
@@ -551,7 +551,7 @@ struct pyrf_evlist { | |||
551 | }; | 551 | }; |
552 | 552 | ||
553 | static int pyrf_evlist__init(struct pyrf_evlist *pevlist, | 553 | static int pyrf_evlist__init(struct pyrf_evlist *pevlist, |
554 | PyObject *args, PyObject *kwargs) | 554 | PyObject *args, PyObject *kwargs __used) |
555 | { | 555 | { |
556 | PyObject *pcpus = NULL, *pthreads = NULL; | 556 | PyObject *pcpus = NULL, *pthreads = NULL; |
557 | struct cpu_map *cpus; | 557 | struct cpu_map *cpus; |
@@ -613,7 +613,7 @@ static PyObject *pyrf_evlist__poll(struct pyrf_evlist *pevlist, | |||
613 | } | 613 | } |
614 | 614 | ||
615 | static PyObject *pyrf_evlist__get_pollfd(struct pyrf_evlist *pevlist, | 615 | static PyObject *pyrf_evlist__get_pollfd(struct pyrf_evlist *pevlist, |
616 | PyObject *args, PyObject *kwargs) | 616 | PyObject *args __used, PyObject *kwargs __used) |
617 | { | 617 | { |
618 | struct perf_evlist *evlist = &pevlist->evlist; | 618 | struct perf_evlist *evlist = &pevlist->evlist; |
619 | PyObject *list = PyList_New(0); | 619 | PyObject *list = PyList_New(0); |
@@ -645,7 +645,7 @@ free_list: | |||
645 | 645 | ||
646 | 646 | ||
647 | static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist, | 647 | static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist, |
648 | PyObject *args, PyObject *kwargs) | 648 | PyObject *args, PyObject *kwargs __used) |
649 | { | 649 | { |
650 | struct perf_evlist *evlist = &pevlist->evlist; | 650 | struct perf_evlist *evlist = &pevlist->evlist; |
651 | PyObject *pevsel; | 651 | PyObject *pevsel; |
@@ -724,7 +724,7 @@ static PyMethodDef pyrf_evlist__methods[] = { | |||
724 | .ml_flags = METH_VARARGS | METH_KEYWORDS, | 724 | .ml_flags = METH_VARARGS | METH_KEYWORDS, |
725 | .ml_doc = PyDoc_STR("reads an event.") | 725 | .ml_doc = PyDoc_STR("reads an event.") |
726 | }, | 726 | }, |
727 | { NULL, } | 727 | { .ml_name = NULL, } |
728 | }; | 728 | }; |
729 | 729 | ||
730 | static Py_ssize_t pyrf_evlist__length(PyObject *obj) | 730 | static Py_ssize_t pyrf_evlist__length(PyObject *obj) |
@@ -840,11 +840,11 @@ static struct { | |||
840 | { "RECORD_FORK", PERF_RECORD_FORK }, | 840 | { "RECORD_FORK", PERF_RECORD_FORK }, |
841 | { "RECORD_READ", PERF_RECORD_READ }, | 841 | { "RECORD_READ", PERF_RECORD_READ }, |
842 | { "RECORD_SAMPLE", PERF_RECORD_SAMPLE }, | 842 | { "RECORD_SAMPLE", PERF_RECORD_SAMPLE }, |
843 | { NULL, }, | 843 | { .name = NULL, }, |
844 | }; | 844 | }; |
845 | 845 | ||
846 | static PyMethodDef perf__methods[] = { | 846 | static PyMethodDef perf__methods[] = { |
847 | { NULL, NULL } | 847 | { .ml_name = NULL, } |
848 | }; | 848 | }; |
849 | 849 | ||
850 | PyMODINIT_FUNC initperf(void) | 850 | PyMODINIT_FUNC initperf(void) |