Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2232794imm; Thu, 18 Oct 2018 11:06:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV62dCheNtIF7j2mglIxAsEKHixTRs8V87uTil2mrpJWZnPMijUSyMuor0zKRZB8ZWZu6xNb1 X-Received: by 2002:a62:37c1:: with SMTP id e184-v6mr31976384pfa.112.1539885998191; Thu, 18 Oct 2018 11:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539885998; cv=none; d=google.com; s=arc-20160816; b=lU0nc0s4w9l5VOUA701y7OTgT44/MeWrP8GQWIAjRQAbogt4XLd1EZm1sw11beQM/w sGPWglCN6hni1ON89wvcgn16dj152m6xBz6KTAypGpJxKrku81puKU9U7laG+LJPY9br Zc3Q2qk7Kbiiz9PgE5S9XL8dAY5pANwNLaiojFwaUSZFGIi8uNAJXIwFvWwjoReLvx3s WFdlbCxuoWrYtKbis2oOplQSEBMFxftYYsIXNx2qRsnvxVVXi2WFg2BomYH1MzgPGgeF h1uryXQ9O6npUb/44CtF6NFsI+XlOUOJS2wZjMREkU0nq9yt6mheP/GMqDdciGbHzZ08 up4g== 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=TNrwPvnfnHSciuuuRDdkwFLVYYq/3fZg0mMxJeUxDFM=; b=r5o6hbN/V1V9Gpzk97KvuMhZbLR6C/l/I1vFbrN0J6LOWBOoK/CXBkAZjPjWEh3dW8 HZ5fWff//l1NMP4RiRHColTzWMDKRpI8AsCeOFQcXVaxnr8f81kce1FNBRmoepL2IOsU 7jn0qvgroyVRhGUxaUJPez3tv78zGDUlP2eAZCXrQN0pZ5iCW4Um4EnybitD8hQ3uxjD 0oFfKu1PlsKD5w/bqebFrpIuHMgg2NBkNcrwlzsvskrUgPmbeVo79WAAUY1rov/vy3yW HUaQjIKRDtWvFqNPR7HylndSZf9fbfOQU5502Gi+arETtckPSIvt/gG2oFivI2eC73Kr x7BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Safut3y9; 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 t33-v6si21698026pgk.141.2018.10.18.11.06.22; Thu, 18 Oct 2018 11:06:38 -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=Safut3y9; 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 S1730189AbeJSCHK (ORCPT + 99 others); Thu, 18 Oct 2018 22:07:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:55696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbeJSCHK (ORCPT ); Thu, 18 Oct 2018 22:07:10 -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 2007E21476; Thu, 18 Oct 2018 18:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539885902; bh=NN0aw00S206CPRXn3JNu+cm7IEUH4aVbsqcrB7E0rWw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Safut3y9fourdHH1yS7y9rFidNb6lvkDgFjBrwARftgUZbrI3Nm5ejA6VTD4NbKhY fcxlTS0tw6dZYeIhvL88QaKjCiaKs+FAUNm8rNsmE5rYeCUBoRMI5k098hhVI6SIW+ Nq4PvMoIq9cxm4JtvndlGme0UnAEkJF4ftCGGw1Y= 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.4 13/48] perf script python: Fix export-to-postgresql.py occasional failure Date: Thu, 18 Oct 2018 19:54:48 +0200 Message-Id: <20181018175428.694820325@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181018175427.133690306@linuxfoundation.org> References: <20181018175427.133690306@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.4-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 @@ -205,14 +205,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'] + \