Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2690781pxj; Mon, 31 May 2021 08:20:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZykn5sIF4mX6iN9iV8BCA7t3LXf3gejDkwLkqpZ/A32C/pkT0wxtTfsaMZ1gWwynm/9Sa X-Received: by 2002:a05:6638:37a9:: with SMTP id w41mr21386061jal.12.1622474438327; Mon, 31 May 2021 08:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622474438; cv=none; d=google.com; s=arc-20160816; b=TRIOtoBV03Ayzt6oO3xiTQ3XR3KpRwm7yw9UVfuK3mr0YRGVhvpYtvbxqFB2tgrUqj QF3LtC/NVJY0f6GdQaVBFkQ3tlnuFGEvJ4wtUIJmnrJXWpYHZK2FTlwRFAZum7i6vDbk N7efQGRUpIcR5QP8yUxGrduFDZADH6vHPRSgork2hVpybYv8mOHh6BW4zOsA0WQ/EsGn aJqR9XD6upGYAaGrwnTzQ6rkZQtzSiMVRg9432IOVHv+HlJWxm+hEL11HqV/969PqZKA lp0nQ6Tkb3i2zXq+8v3t16OpApJ2qpy5EFboWu84l/m6JduRNHVPIEvuMj5DtEk0I431 lN4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gEy+orrKXdNvfg/3D3zxKmFiuOQYuyR3pwKgZqP8+4I=; b=Lirrgh9pIyOoPdK5ZuIav/qwsXHRiTw5KMHUUGla3SDk5D/pULp60JtDjvhm16/uj9 53q3sdiMLKBqriVwaLvtFUPdplxOev+CRJYA4ZKbHWTUNl3ZFqqbucCupAj5dnXwbEdZ vRmFTURCs0AzLIWr1r4l/JUTRUkinOZ/ZwlXstkQ0scQcD85PaoYJrL9EJpXm8hg/GQY 1jcqH95ZqJEN40mST1Eak7NSxdfD0Oe/vH/4vY7Ml2mRiR/br4uGrpr8cr/mcx58dt+c 0BzWPjJJ7/fxdMk9kp0baJyOLm+wqN6BQdSvaOsINVAYxSYEKcw84tUfDHH+6JwZ3s3Q Exrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BZjOjd2q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si3509613iln.114.2021.05.31.08.20.24; Mon, 31 May 2021 08:20:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BZjOjd2q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234562AbhEaPUJ (ORCPT + 99 others); Mon, 31 May 2021 11:20:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:43030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233720AbhEaOPQ (ORCPT ); Mon, 31 May 2021 10:15:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9C79661996; Mon, 31 May 2021 13:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468564; bh=MdXx8nvefx0CsVv8KljOMYZO5YFzTnvk+ckz98B0Rd4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BZjOjd2qDR56SpGxhyo/DAFS6HvChxHvYrmJFb56+bjOiy2pPleeLnMizPPY7Zxbu My1/4T+hg9ctRkvxGPmiZ6lVtdZuV0hNFvc3JXY8yypR38qVt5LccuydOmFQPz0QxD MjNUW09Rxjcr85vL2Aacj9T4xbSksyxhPeuSQx2c= 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 5.4 011/177] perf scripts python: exported-sql-viewer.py: Fix warning display Date: Mon, 31 May 2021 15:12:48 +0200 Message-Id: <20210531130648.291666995@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter commit f56299a9c998e0bfbd4ab07cafe9eb8444512448 upstream. Deprecation warnings are useful only for the developer, not an end user. Display warnings only when requested using the python -W option. This stops the display of warnings like: tools/perf/scripts/python/exported-sql-viewer.py:5102: DeprecationWarning: an integer is required (got type PySide2.QtCore.Qt.AlignmentFlag). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python. err = app.exec_() Since the warning can be fixed only in PySide2, we must wait for it to be finally fixed there. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org # v5.3+ Link: http://lore.kernel.org/lkml/20210521092053.25683-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/scripts/python/exported-sql-viewer.py | 5 +++++ 1 file changed, 5 insertions(+) --- a/tools/perf/scripts/python/exported-sql-viewer.py +++ b/tools/perf/scripts/python/exported-sql-viewer.py @@ -91,6 +91,11 @@ from __future__ import print_function import sys +# Only change warnings if the python -W option was not used +if not sys.warnoptions: + import warnings + # PySide2 causes deprecation warnings, ignore them. + warnings.filterwarnings("ignore", category=DeprecationWarning) import argparse import weakref import threading