Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
         
       
     
  
  
  
  
  
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
  
  
SimplePerfUtil
  public
  
  
  
  class
  SimplePerfUtil
  
    extends Object
  
  
  
  
  
  
  
    
    | java.lang.Object | 
  
  
    
      | ↳ | com.android.tradefed.util.SimplePerfUtil | 
  
  
    
  Utility class to dispatch simple command and collect results
  
Summary
| Public methods | 
|---|
  
  
  
    | 
        
        
        
        
        
        SimplePerfResult | 
      executeCommand(String command)
      Executes the given adb shell command, with simpleperf wrapped around
 Simpleperf result will be parsed and return to caller | 
  
  
  
  
    | 
        
        
        
        
        
        void | 
      executeCommand(String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
      Executes the given adb shell command, with simpleperf wrapped around
 It is caller's responsibility to parse simpleperf result through receiver | 
  
  
  
  
    | 
        
        
        
        
        
        void | 
      executeCommand(String command, IShellOutputReceiver receiver)
      Executes the given adb shell command, with simpleperf wrapped around
 It is caller's responsibility to parse simpleperf result through receiver | 
  
  
  
  
    | 
        
        
        
        
        
         | 
      getArgumentList()
      Get argument for simpleperf command
        
    
 | 
  
  
  
  
    | 
        
        
        static
        
        
        SimplePerfUtil | 
      newInstance(ITestDevice device, SimplePerfUtil.SimplePerfType type)
      SimplePerfUtil Constructor
 Caller must define device and simpleperf type when initializing instance | 
  
  
  
  
    | 
        
        
        
        
        
        void | 
      setArgumentList( arguList)
      Set argument on simpleperf command
        
    
 | 
  
Public methods
    executeCommand
    
public SimplePerfResult executeCommand (String command)
    
    
    
  Executes the given adb shell command, with simpleperf wrapped around
 
 Simpleperf result will be parsed and return to caller
    
    | Parameters | 
|---|
      
        | command | String: command to run on device | 
    
    
      
  
 
    executeCommand
    
public void executeCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)
    
    
    
  Executes the given adb shell command, with simpleperf wrapped around
 
 It is caller's responsibility to parse simpleperf result through receiver
    
    | Parameters | 
|---|
      
        | command | String: command to run on device | 
      
        | receiver | IShellOutputReceiver:IShellOutputReceiverobject to direct shell output to | 
      
        | maxTimeToOutputShellResponse | long: the maximum amount of time during which the command is
 allowed to not output any response; unit as specified intimeUnit | 
      
        | timeUnit | TimeUnit: timeUnit unit formaxTimeToOutputShellResponse, seeERROR(/TimeUnit) | 
      
        | retryAttempts | int: the maximum number of times to retry command if it fails due to a
 exception. DeviceNotResponsiveException will be thrown if retryAttempts are
 performed without success. | 
    
      
  
 
    executeCommand
    
public void executeCommand (String command, 
                IShellOutputReceiver receiver)
    
    
    
  Executes the given adb shell command, with simpleperf wrapped around
 
 It is caller's responsibility to parse simpleperf result through receiver
    
    | Parameters | 
|---|
      
        | command | String: command to run on device | 
      
        | receiver | IShellOutputReceiver:IShellOutputReceiverobject to direct shell output to | 
    
      
  
 
    getArgumentList
    
public  getArgumentList ()
    
    
    
  Get argument for simpleperf command
    
      | Returns | 
|---|
      
        |  | list of subcommand and arguments (nullable) | 
    
 
    setArgumentList
    
public void setArgumentList ( arguList)
    
    
    
  Set argument on simpleperf command
    
    | Parameters | 
|---|
      
        | arguList | : list of subcommand and arguments | 
    
 
Protected methods
    commandStringPreparer
    
protected String commandStringPreparer (String command)
    
    
    
  
    
    | Parameters | 
|---|
      
        | command | String | 
    
    
 
 
 
  
  
 
  
    
    
      
    
    
  
       
    
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2023-03-08 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-03-08 UTC."],[],[]]