Hi,
I need to profile a benchmark without intracting with the GUI. Can I use Trepn in a shell script? More precisely I just want to start and stop profiling from the shell.
Thanks,
Ujjwal
Hi,
I need to profile a benchmark without intracting with the GUI. Can I use Trepn in a shell script? More precisely I just want to start and stop profiling from the shell.
Thanks,
Ujjwal
Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.
Hi Ujjwal,
Yes, you can use Trepn Profiler in a shell script. To do that, you'll need to use Android intents to control Trepn via adb shell broadcasts.You can find an example on how to do that in section 3.2.1 of the Trepn 5.0 User Guide on page 38. The example in the user guide shows how you can start profiling, stop profiling, and load preferences. Although the examples specifically mention .bat files, the same commands work in bash, csh, or other scripts.
To start with, I'd recommend trying the following commands in your script:
This set of commands launches Trepn (if it's not running already) and starts profiling with the currently selected set of preferences. The "ping 123.45.67.89 -n 1 -w 1000 > NUL" command creates a one second delay. This command needs to be executed after launching Trepn but before sending the start profiling command. This gives Android enough time to launch Trepn prior to sending the start profiling command. Please note that this command may be different if you're using Linux or Mac.
Please let me know if you run into any problems using Android intents to control Trepn and we'll be happy to help.
- Eugene
Thanks Eugene! I have not been able to get onto this since I am soing soemthing else right now. But I will post a bash script in this thread once I work it out.
Could you please provide me the link to the section 3.2.1 of the Trepn 5.0 User Guide on page 38
We don't have a way to directly link to that section, however, you can download the Zip file that contains the User Guide here: https://developer.qualcomm.com/download/trepn-profiler.zip
I've also attempted to copy and paste the text from that section below, but it might be hard to read because some of the formatting has been lost.
- Rick
Thank you Rick!!
Hello,
I am not able to save the profiling as a db file using the below command.
adb shell am broadcast –a com.quicinc.trepn.start_profiling –e com.quicinc.trepn.database_file “<string_value>”
I am using Nexus 6P and profiler 6.2.
The below command starts the profiling in my case:
adb shell am broadcast –a com.quicinc.trepn.start_profiling
It would be great if you can help.
Thanks
Hi roshanbharathdas,
In the command that you posted, the hyphen characters and quotation marks are not properly encoded. This is a common problem when commands have been copy-and-pasted into the command-line from another source.
Try this command, which has been corrected:
If you experience this problem in the future, then in the command-line, delete and re-type the two hyphen symbols (-a and -e) and the quotation marks, and try again.
Let me know if this doesn't resolve your problem.
Thank you. It works now.
Thank you for letting us know it's now working.
- Rick
Hi Rick,
I tried running the command - ```adb shell am broadcast –a com.quicinc.trepn.stop_profiling``` to stop the profiling but it actually doesn't. Is there something that I am missing out?
Regards,
*/Thejus
Hi Thejus,
I know this is a bit late, but I noticed that the command you posted above has an incorrectly encoded hyphen for the "-a" argument. Perhaps you copy-pasted the command from the Trepn user guide?
Try typing the same command from scratch, or at least deleting and re-typing the hyphen. In the user guide, the hyphen got encoded incorrectly when it was converted to PDF and it doesn't work in a command-prompt correctly.