diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2018-09-11 07:45:03 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-09-25 10:33:06 -0400 |
commit | 25e11700b54c7b6b5ebfc4361981dae12299557b (patch) | |
tree | af8b88eed442c68df45a7cda8e6eac2ef33ea051 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 5d05dfd13f20b01a3cd5d293058baa7d5c1583b6 (diff) |
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 <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>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
-rw-r--r-- | tools/perf/scripts/python/export-to-postgresql.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/scripts/python/export-to-postgresql.py b/tools/perf/scripts/python/export-to-postgresql.py index efcaf6cac2eb..e46f51b17513 100644 --- a/tools/perf/scripts/python/export-to-postgresql.py +++ b/tools/perf/scripts/python/export-to-postgresql.py | |||
@@ -204,14 +204,23 @@ from ctypes import * | |||
204 | libpq = CDLL("libpq.so.5") | 204 | libpq = CDLL("libpq.so.5") |
205 | PQconnectdb = libpq.PQconnectdb | 205 | PQconnectdb = libpq.PQconnectdb |
206 | PQconnectdb.restype = c_void_p | 206 | PQconnectdb.restype = c_void_p |
207 | PQconnectdb.argtypes = [ c_char_p ] | ||
207 | PQfinish = libpq.PQfinish | 208 | PQfinish = libpq.PQfinish |
209 | PQfinish.argtypes = [ c_void_p ] | ||
208 | PQstatus = libpq.PQstatus | 210 | PQstatus = libpq.PQstatus |
211 | PQstatus.restype = c_int | ||
212 | PQstatus.argtypes = [ c_void_p ] | ||
209 | PQexec = libpq.PQexec | 213 | PQexec = libpq.PQexec |
210 | PQexec.restype = c_void_p | 214 | PQexec.restype = c_void_p |
215 | PQexec.argtypes = [ c_void_p, c_char_p ] | ||
211 | PQresultStatus = libpq.PQresultStatus | 216 | PQresultStatus = libpq.PQresultStatus |
217 | PQresultStatus.restype = c_int | ||
218 | PQresultStatus.argtypes = [ c_void_p ] | ||
212 | PQputCopyData = libpq.PQputCopyData | 219 | PQputCopyData = libpq.PQputCopyData |
220 | PQputCopyData.restype = c_int | ||
213 | PQputCopyData.argtypes = [ c_void_p, c_void_p, c_int ] | 221 | PQputCopyData.argtypes = [ c_void_p, c_void_p, c_int ] |
214 | PQputCopyEnd = libpq.PQputCopyEnd | 222 | PQputCopyEnd = libpq.PQputCopyEnd |
223 | PQputCopyEnd.restype = c_int | ||
215 | PQputCopyEnd.argtypes = [ c_void_p, c_void_p ] | 224 | PQputCopyEnd.argtypes = [ c_void_p, c_void_p ] |
216 | 225 | ||
217 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ | 226 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ |