From: tip-bot for Adrian Hunter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@redhat.com, acme@redhat.com, mingo@kernel.org,
tglx@linutronix.de, linux-kernel@vger.kernel.org,
adrian.hunter@intel.com, hpa@zytor.com
Subject: [tip:perf/urgent] perf script python: Fix export-to-postgresql.py occasional failure
Date: Fri, 5 Oct 2018 09:18:55 -0700 [thread overview]
Message-ID: <tip-25e11700b54c7b6b5ebfc4361981dae12299557b@git.kernel.org> (raw)
In-Reply-To: <20180911114504.28516-2-adrian.hunter@intel.com>
Commit-ID: 25e11700b54c7b6b5ebfc4361981dae12299557b
Gitweb: https://git.kernel.org/tip/25e11700b54c7b6b5ebfc4361981dae12299557b
Author: Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Tue, 11 Sep 2018 14:45:03 +0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 25 Sep 2018 11:33:06 -0300
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>
---
tools/perf/scripts/python/export-to-postgresql.py | 9 +++++++++
1 file changed, 9 insertions(+)
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 *
libpq = CDLL("libpq.so.5")
PQconnectdb = libpq.PQconnectdb
PQconnectdb.restype = c_void_p
+PQconnectdb.argtypes = [ c_char_p ]
PQfinish = libpq.PQfinish
+PQfinish.argtypes = [ c_void_p ]
PQstatus = libpq.PQstatus
+PQstatus.restype = c_int
+PQstatus.argtypes = [ c_void_p ]
PQexec = libpq.PQexec
PQexec.restype = c_void_p
+PQexec.argtypes = [ c_void_p, c_char_p ]
PQresultStatus = libpq.PQresultStatus
+PQresultStatus.restype = c_int
+PQresultStatus.argtypes = [ c_void_p ]
PQputCopyData = libpq.PQputCopyData
+PQputCopyData.restype = c_int
PQputCopyData.argtypes = [ c_void_p, c_void_p, c_int ]
PQputCopyEnd = libpq.PQputCopyEnd
+PQputCopyEnd.restype = c_int
PQputCopyEnd.argtypes = [ c_void_p, c_void_p ]
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
next prev parent reply other threads:[~2018-10-05 16:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-11 11:45 [PATCH 0/2] perf script python: Database export fixes Adrian Hunter
2018-09-11 11:45 ` [PATCH 1/2] perf script python: Fix export-to-postgresql.py occasional failure Adrian Hunter
2018-10-05 16:18 ` tip-bot for Adrian Hunter [this message]
2018-09-11 11:45 ` [PATCH 2/2] perf script python: Fix export-to-sqlite.py sample columns Adrian Hunter
2018-10-05 16:19 ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-09-25 11:08 ` [PATCH 0/2] perf script python: Database export fixes Adrian Hunter
2018-09-25 14:36 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-25e11700b54c7b6b5ebfc4361981dae12299557b@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.