Skip to content

Commit 25e1170

Browse files
ahunter6acmel
authored andcommitted
perf script python: Fix export-to-postgresql.py occasional failure
Occasional export failures were found to be caused by truncating 64-bit pointers to 32-bits. Fix by explicitly setting types for all ctype arguments and results. Signed-off-by: Adrian Hunter <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 5d05dfd commit 25e1170

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: tools/perf/scripts/python/export-to-postgresql.py

+9
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,23 @@
204204
libpq = CDLL("libpq.so.5")
205205
PQconnectdb = libpq.PQconnectdb
206206
PQconnectdb.restype = c_void_p
207+
PQconnectdb.argtypes = [ c_char_p ]
207208
PQfinish = libpq.PQfinish
209+
PQfinish.argtypes = [ c_void_p ]
208210
PQstatus = libpq.PQstatus
211+
PQstatus.restype = c_int
212+
PQstatus.argtypes = [ c_void_p ]
209213
PQexec = libpq.PQexec
210214
PQexec.restype = c_void_p
215+
PQexec.argtypes = [ c_void_p, c_char_p ]
211216
PQresultStatus = libpq.PQresultStatus
217+
PQresultStatus.restype = c_int
218+
PQresultStatus.argtypes = [ c_void_p ]
212219
PQputCopyData = libpq.PQputCopyData
220+
PQputCopyData.restype = c_int
213221
PQputCopyData.argtypes = [ c_void_p, c_void_p, c_int ]
214222
PQputCopyEnd = libpq.PQputCopyEnd
223+
PQputCopyEnd.restype = c_int
215224
PQputCopyEnd.argtypes = [ c_void_p, c_void_p ]
216225

217226
sys.path.append(os.environ['PERF_EXEC_PATH'] + \

0 commit comments

Comments
 (0)