[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-7e4fc93e2ade2b0c453a97e307203ffe3f930c98@git.kernel.org>
Date: Fri, 26 Oct 2018 00:38:21 -0700
From: tip-bot for Adrian Hunter <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, mingo@...nel.org, adrian.hunter@...el.com,
linux-kernel@...r.kernel.org, tglx@...utronix.de, acme@...hat.com,
jolsa@...hat.com, ak@...ux.intel.com
Subject: [tip:perf/urgent] perf scripts python: call-graph-from-sql.py: Make
a "Main" function
Commit-ID: 7e4fc93e2ade2b0c453a97e307203ffe3f930c98
Gitweb: https://git.kernel.org/tip/7e4fc93e2ade2b0c453a97e307203ffe3f930c98
Author: Adrian Hunter <adrian.hunter@...el.com>
AuthorDate: Mon, 1 Oct 2018 09:28:39 +0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 23 Oct 2018 14:22:54 -0300
perf scripts python: call-graph-from-sql.py: Make a "Main" function
Make a "Main" function so that the variables used do not pollute the global
namespace.
Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Link: http://lkml.kernel.org/r/20181001062853.28285-6-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/scripts/python/call-graph-from-sql.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/perf/scripts/python/call-graph-from-sql.py b/tools/perf/scripts/python/call-graph-from-sql.py
index 2e33540f3de0..2b74b94eeccc 100644
--- a/tools/perf/scripts/python/call-graph-from-sql.py
+++ b/tools/perf/scripts/python/call-graph-from-sql.py
@@ -284,7 +284,9 @@ class MainWindow(QMainWindow):
self.setCentralWidget(self.view)
-if __name__ == '__main__':
+# Main
+
+def Main():
if (len(sys.argv) < 2):
print >> sys.stderr, "Usage is: call-graph-from-sql.py <database name>"
raise Exception("Too few arguments")
@@ -331,3 +333,6 @@ if __name__ == '__main__':
err = app.exec_()
db.close()
sys.exit(err)
+
+if __name__ == "__main__":
+ Main()
Powered by blists - more mailing lists