lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 1 Mar 2019 14:55:09 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Adrian Hunter <adrian.hunter@...el.com>
Cc:     Jiri Olsa <jolsa@...hat.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/8] perf scripts python: exported-sql-viewer.py: Factor
 out TreeWindowBase

Em Thu, Feb 28, 2019 at 03:00:28PM +0200, Adrian Hunter escreveu:
> Factor out a base class TreeWindowBase from CallGraphWindow, so that
> TreeWindowBase can be reused.

Thanks, applied.

- Arnaldo
 
> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
>  .../scripts/python/exported-sql-viewer.py     | 50 ++++++++++++-------
>  1 file changed, 31 insertions(+), 19 deletions(-)
> 
> diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
> index 09ce73b07d35..df854f0a69f0 100755
> --- a/tools/perf/scripts/python/exported-sql-viewer.py
> +++ b/tools/perf/scripts/python/exported-sql-viewer.py
> @@ -693,28 +693,16 @@ class VBox():
>  	def Widget(self):
>  		return self.vbox
>  
> -# Context-sensitive call graph window
> -
> -class CallGraphWindow(QMdiSubWindow):
> -
> -	def __init__(self, glb, parent=None):
> -		super(CallGraphWindow, self).__init__(parent)
> +# Tree window base
>  
> -		self.model = LookupCreateModel("Context-Sensitive Call Graph", lambda x=glb: CallGraphModel(x))
> +class TreeWindowBase(QMdiSubWindow):
>  
> -		self.view = QTreeView()
> -		self.view.setModel(self.model)
> -
> -		for c, w in ((0, 250), (1, 100), (2, 60), (3, 70), (4, 70), (5, 100)):
> -			self.view.setColumnWidth(c, w)
> -
> -		self.find_bar = FindBar(self, self)
> -
> -		self.vbox = VBox(self.view, self.find_bar.Widget())
> -
> -		self.setWidget(self.vbox.Widget())
> +	def __init__(self, parent=None):
> +		super(TreeWindowBase, self).__init__(parent)
>  
> -		AddSubWindow(glb.mainwindow.mdi_area, self, "Context-Sensitive Call Graph")
> +		self.model = None
> +		self.view = None
> +		self.find_bar = None
>  
>  	def DisplayFound(self, ids):
>  		if not len(ids):
> @@ -747,6 +735,30 @@ class CallGraphWindow(QMdiSubWindow):
>  		if not found:
>  			self.find_bar.NotFound()
>  
> +
> +# Context-sensitive call graph window
> +
> +class CallGraphWindow(TreeWindowBase):
> +
> +	def __init__(self, glb, parent=None):
> +		super(CallGraphWindow, self).__init__(parent)
> +
> +		self.model = LookupCreateModel("Context-Sensitive Call Graph", lambda x=glb: CallGraphModel(x))
> +
> +		self.view = QTreeView()
> +		self.view.setModel(self.model)
> +
> +		for c, w in ((0, 250), (1, 100), (2, 60), (3, 70), (4, 70), (5, 100)):
> +			self.view.setColumnWidth(c, w)
> +
> +		self.find_bar = FindBar(self, self)
> +
> +		self.vbox = VBox(self.view, self.find_bar.Widget())
> +
> +		self.setWidget(self.vbox.Widget())
> +
> +		AddSubWindow(glb.mainwindow.mdi_area, self, "Context-Sensitive Call Graph")
> +
>  # Child data item  finder
>  
>  class ChildDataItemFinder():
> -- 
> 2.17.1

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ