Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5451464imm; Tue, 16 Oct 2018 10:25:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV61FQKarLzNKW3x1aqsZorDnsu5xckVKA7y5eRytNd0OBzqjKg8mEcO99b5M2xf5aw6QrvAw X-Received: by 2002:a62:8c93:: with SMTP id m141-v6mr23440828pfd.16.1539710705898; Tue, 16 Oct 2018 10:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539710705; cv=none; d=google.com; s=arc-20160816; b=PLcrQisNC2YZUaVuhk0lhglKOhFBFTb/MNLonIfhNppk77lt8o01YxdT8sg2/85zFm fKNshOYH9qyP5Ai8o5myxa4CEcXUgf+AEiL71LWygS5tEefAvoyZh61nExJYw6ASC8PH N3VN5tdZk+7YBjccAiIYcqA+0Wi8IpF2X+W3T5J9dPpBLToHcjxgqqomABSaJJMp9jpt hhn/oJggtmc/U3kIOUL9F/AsIsIAGgJV2VqqeTOMD6sNh3uKdlSsx23+lhVwLRMoe3Rg DjfLA+o3d+2MyI7X2bGLVh9dkiQSxFFTMEzRe91arkp+mGrovpXCVGEENoT6FofaV7lt 3z2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=I4eoudjUcf6OyxzLD+qcP3Zuq92/G4/0ShoCEP0i2Sw=; b=hHfNqIyeO03y6h6/qwyFa3iYqJUI//aWZdzTnzoh49Js4vOGa7cpin201XTgDWftEN VKXDEbukRsgKIEexKU2JmQmv1CIBVQxLdg3DdzxG4lRPvtGqJWpQdwBF2NmwqWVkSSIG U20p+1PFxXb1Cfnyw78ye6/7hZAKAMkwH6p0lUq60UNfpo7TGbFVRTKjLxkYHWI89a6f uRsQJ3IOSwI9t1j+9GDeEqg3lSYKQOEGFhxzmmwvX5/XcnGATvP09IDCIe3xfKV8+e9R a86CX9TfIxcDjA0m1uJ7ZJGkdm61jrnJ14vncaoCCgGyvlxerqvHFjgJMicM+TJMAoRI +fDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wzkFzGFl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21-v6si11923899pll.221.2018.10.16.10.24.50; Tue, 16 Oct 2018 10:25:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wzkFzGFl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731299AbeJQBOc (ORCPT + 99 others); Tue, 16 Oct 2018 21:14:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:32942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730397AbeJQBOc (ORCPT ); Tue, 16 Oct 2018 21:14:32 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 03E6220866; Tue, 16 Oct 2018 17:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539710586; bh=XrDiy3YmMkr5gQWKyM6u2HH2UVi0mLztmeocqmXETTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wzkFzGFl8JGbepPVi0k50X6iCv7tpk8StJSzCxSa6z19UX6aRyQBJkdu89woahLok S/Kaf6w3JzLunNAbT5v11VeWx611kNKVY38AHpHGwbw1ySPhLRSn0iTbu/Z/zqtfuE 0gwTJBQ2vyeOeJqhQRoSN+UqOf/pPhbrasDMtxXY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Jiri Olsa , Arnaldo Carvalho de Melo Subject: [PATCH 4.9 18/71] perf script python: Fix export-to-postgresql.py occasional failure Date: Tue, 16 Oct 2018 19:09:15 +0200 Message-Id: <20181016170540.313226239@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016170539.315587743@linuxfoundation.org> References: <20181016170539.315587743@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Adrian Hunter commit 25e11700b54c7b6b5ebfc4361981dae12299557b 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 Cc: Jiri Olsa 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 Signed-off-by: Greg Kroah-Hartman --- tools/perf/scripts/python/export-to-postgresql.py | 9 +++++++++ 1 file changed, 9 insertions(+) --- 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'] + \