diff options
Diffstat (limited to 'tools/perf/scripts/python')
| -rw-r--r-- | tools/perf/scripts/python/export-to-postgresql.py | 2 | ||||
| -rwxr-xr-x | tools/perf/scripts/python/exported-sql-viewer.py | 11 | 
2 files changed, 10 insertions, 3 deletions
| diff --git a/tools/perf/scripts/python/export-to-postgresql.py b/tools/perf/scripts/python/export-to-postgresql.py index 7bd73a904b4e..d187e46c2683 100644 --- a/tools/perf/scripts/python/export-to-postgresql.py +++ b/tools/perf/scripts/python/export-to-postgresql.py @@ -1055,7 +1055,7 @@ def cbr(id, raw_buf):  	cbr = data[0]  	MHz = (data[4] + 500) / 1000  	percent = ((cbr * 1000 / data[2]) + 5) / 10 -	value = struct.pack("!hiqiiiiii", 4, 8, id, 4, cbr, 4, MHz, 4, percent) +	value = struct.pack("!hiqiiiiii", 4, 8, id, 4, cbr, 4, int(MHz), 4, int(percent))  	cbr_file.write(value)  def mwait(id, raw_buf): diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py index 26d7be785288..7daa8bb70a5a 100755 --- a/tools/perf/scripts/python/exported-sql-viewer.py +++ b/tools/perf/scripts/python/exported-sql-viewer.py @@ -768,7 +768,8 @@ class CallGraphModel(CallGraphModelBase):  						" FROM calls"  						" INNER JOIN call_paths ON calls.call_path_id = call_paths.id"  						" INNER JOIN symbols ON call_paths.symbol_id = symbols.id" -						" WHERE symbols.name" + match + +						" WHERE calls.id <> 0" +						" AND symbols.name" + match +  						" GROUP BY comm_id, thread_id, call_path_id"  						" ORDER BY comm_id, thread_id, call_path_id") @@ -963,7 +964,8 @@ class CallTreeModel(CallGraphModelBase):  						" FROM calls"  						" INNER JOIN call_paths ON calls.call_path_id = call_paths.id"  						" INNER JOIN symbols ON call_paths.symbol_id = symbols.id" -						" WHERE symbols.name" + match + +						" WHERE calls.id <> 0" +						" AND symbols.name" + match +  						" ORDER BY comm_id, thread_id, call_time, calls.id")  	def FindPath(self, query): @@ -1050,6 +1052,7 @@ class TreeWindowBase(QMdiSubWindow):  				child = self.model.index(row, 0, parent)  				if child.internalPointer().dbid == dbid:  					found = True +					self.view.setExpanded(parent, True)  					self.view.setCurrentIndex(child)  					parent = child  					break @@ -1127,6 +1130,7 @@ class CallTreeWindow(TreeWindowBase):  				child = self.model.index(row, 0, parent)  				if child.internalPointer().dbid == dbid:  					found = True +					self.view.setExpanded(parent, True)  					self.view.setCurrentIndex(child)  					parent = child  					break @@ -1139,6 +1143,7 @@ class CallTreeWindow(TreeWindowBase):  				return  			last_child = None  			for row in xrange(n): +				self.view.setExpanded(parent, True)  				child = self.model.index(row, 0, parent)  				child_call_time = child.internalPointer().call_time  				if child_call_time < time: @@ -1151,9 +1156,11 @@ class CallTreeWindow(TreeWindowBase):  			if not last_child:  				if not found:  					child = self.model.index(0, 0, parent) +					self.view.setExpanded(parent, True)  					self.view.setCurrentIndex(child)  				return  			found = True +			self.view.setExpanded(parent, True)  			self.view.setCurrentIndex(last_child)  			parent = last_child | 
