@@ -362,6 +362,7 @@ def __init__(self, parent=None):
362362 self .graph = False
363363 self .subgraph = False
364364 self .skip_tracing = False
365+ self .pid = None
365366
366367 # Governor control
367368 self .governorRadioButtons = []
@@ -649,6 +650,9 @@ def buttonrun(self):
649650 try :
650651 self .checkrun ()
651652
653+ if self .lineEditAppPID .text () != "" :
654+ self .pid = self .lineEditAppPID .text ()
655+
652656 self .application_name = self .lineEditApplicationName .text ()
653657 self .duration = self .doubleSpinBoxDuration .value ()
654658 self .events = []
@@ -682,21 +686,20 @@ def buttonrun(self):
682686 for x in range (test_start_value ,
683687 test_start_value + no_of_tests ):
684688 try :
685- buttonrunprocess (
686- self .application_name ,
687- self .governor ,
688- self .duration ,
689- self .events ,
690- self .events_to_process ,
691- self .preamble ,
692- self .subgraph ,
693- self .graph ,
694- self .skip_tracing ,
695- progress_signal = self .changed_progress ,
696- open_func = self .openallresults ,
697- subdir = self .application_name + "/" +
698- self .governor + "/" + str (x ) + "/" ,
699- )
689+ buttonrunprocess (self .application_name ,
690+ self .governor ,
691+ self .duration ,
692+ self .events ,
693+ self .events_to_process ,
694+ self .preamble ,
695+ self .subgraph ,
696+ self .graph ,
697+ self .skip_tracing ,
698+ progress_signal = self .changed_progress ,
699+ open_func = self .openallresults ,
700+ subdir = self .application_name + "/" +
701+ self .governor + "/" + str (x ) + "/" ,
702+ pid = self .pid )
700703 if self .checkBoxTestAutomationPrompt .isChecked ():
701704 QMessageBox .information (
702705 self ,
@@ -811,22 +814,22 @@ def buttonrunprocess(
811814 progress_signal = None ,
812815 open_func = None ,
813816 subdir = None ,
817+ pid = None ,
814818):
815819
816820 try :
817- current_debugger = EnergyDebugger (
818- application = application_name ,
819- governor = governor ,
820- duration = duration ,
821- events = events ,
822- event_count = events_to_process ,
823- preamble = preamble ,
824- graph = graph ,
825- subgraph = subgraph ,
826- skip_tracing = skip_tracing ,
827- progress_signal = progress_signal ,
828- results_subdir = subdir ,
829- )
821+ current_debugger = EnergyDebugger (application = application_name ,
822+ governor = governor ,
823+ duration = duration ,
824+ events = events ,
825+ event_count = events_to_process ,
826+ preamble = preamble ,
827+ graph = graph ,
828+ subgraph = subgraph ,
829+ skip_tracing = skip_tracing ,
830+ progress_signal = progress_signal ,
831+ results_subdir = subdir ,
832+ pid = pid )
830833 current_debugger .run ()
831834 if open_func is not None :
832835 open_func (subdir )
@@ -895,20 +898,19 @@ def run(self):
895898
896899
897900class EnergyDebugger :
898- def __init__ (
899- self ,
900- application ,
901- governor ,
902- duration ,
903- events ,
904- event_count ,
905- preamble ,
906- graph ,
907- subgraph ,
908- skip_tracing ,
909- progress_signal ,
910- results_subdir ,
911- ):
901+ def __init__ (self ,
902+ application ,
903+ governor ,
904+ duration ,
905+ events ,
906+ event_count ,
907+ preamble ,
908+ graph ,
909+ subgraph ,
910+ skip_tracing ,
911+ progress_signal ,
912+ results_subdir ,
913+ pid = None ):
912914 self .adb = ADBInterface ()
913915 self .application = application
914916 self .governor = governor
@@ -922,13 +924,14 @@ def __init__(
922924 self .skip_tracing = skip_tracing
923925 self .progress_signal = progress_signal
924926 self .results_subdir = results_subdir
927+ self .pid = pid
925928 """ Required objects for tracking system metrics and interfacing with a target system, connected
926929 via an ADB connection.
927930 """
928931
929932 start_time = time .time ()
930933 try :
931- self .pid_tool = PIDTool (self .adb , self .application )
934+ self .pid_tool = PIDTool (self .adb , self .application , self . pid )
932935 except Exception , e :
933936 raise Exception ("Trace failed: {}" .format (e ))
934937 print ("PIDs gathered --- %s Sec" % (time .time () - start_time ))
0 commit comments