perf script python: Fix export-to-postgresql.py occasional failure
commit 25e11700b5
upstream.
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 <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20180911114504.28516-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
parent
54886c9783
commit
82ac2740aa
|
@ -204,14 +204,23 @@ from ctypes import *
|
||||||
libpq = CDLL("libpq.so.5")
|
libpq = CDLL("libpq.so.5")
|
||||||
PQconnectdb = libpq.PQconnectdb
|
PQconnectdb = libpq.PQconnectdb
|
||||||
PQconnectdb.restype = c_void_p
|
PQconnectdb.restype = c_void_p
|
||||||
|
PQconnectdb.argtypes = [ c_char_p ]
|
||||||
PQfinish = libpq.PQfinish
|
PQfinish = libpq.PQfinish
|
||||||
|
PQfinish.argtypes = [ c_void_p ]
|
||||||
PQstatus = libpq.PQstatus
|
PQstatus = libpq.PQstatus
|
||||||
|
PQstatus.restype = c_int
|
||||||
|
PQstatus.argtypes = [ c_void_p ]
|
||||||
PQexec = libpq.PQexec
|
PQexec = libpq.PQexec
|
||||||
PQexec.restype = c_void_p
|
PQexec.restype = c_void_p
|
||||||
|
PQexec.argtypes = [ c_void_p, c_char_p ]
|
||||||
PQresultStatus = libpq.PQresultStatus
|
PQresultStatus = libpq.PQresultStatus
|
||||||
|
PQresultStatus.restype = c_int
|
||||||
|
PQresultStatus.argtypes = [ c_void_p ]
|
||||||
PQputCopyData = libpq.PQputCopyData
|
PQputCopyData = libpq.PQputCopyData
|
||||||
|
PQputCopyData.restype = c_int
|
||||||
PQputCopyData.argtypes = [ c_void_p, c_void_p, c_int ]
|
PQputCopyData.argtypes = [ c_void_p, c_void_p, c_int ]
|
||||||
PQputCopyEnd = libpq.PQputCopyEnd
|
PQputCopyEnd = libpq.PQputCopyEnd
|
||||||
|
PQputCopyEnd.restype = c_int
|
||||||
PQputCopyEnd.argtypes = [ c_void_p, c_void_p ]
|
PQputCopyEnd.argtypes = [ c_void_p, c_void_p ]
|
||||||
|
|
||||||
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
|
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
|
||||||
|
|
Loading…
Reference in New Issue