1. fix inferno.bat to correctly pass arguments.
2. type `inferno.bat` instead of `./inferno.bat`.
3. call `inferno.bat` in python should use shell=True.
4. fix the way to open browser on darwin/windows.
Bug: http://b/
64035530
Test: run test.py on all platforms.
Change-Id: I5e22907d0c25186b129bf82e0f83d3b71e28ffb2
On Windows platform:
- $ ./inferno.bat -sc --symfs binary_cache
+ $ inferno.bat -sc --symfs binary_cache
Remove `--symfs binary_cache` if you selected not to collect binaries when
using `app_profiler.py`.
Open a terminal and from `simpleperf/scripts` directory type:
```
./inferno.sh (on Linux/Mac)
-./inferno.bat (on Windows)
+inferno.bat (on Windows)
```
Inferno will collect data, process them and automatically open your web browser
-python -m inferno.inferno %
+python -m inferno.inferno %*
def open_report_in_browser(report_path):
- # Try to open the report with Chrome
- browser_key = ""
- for key, value in webbrowser._browsers.items():
- if key.find("chrome") != -1:
- browser_key = key
- browser = webbrowser.get(browser_key)
- browser.open(report_path, new=0, autoraise=True)
+ try:
+ # Try to open the report with Chrome
+ browser_key = ""
+ for key, value in webbrowser._browsers.items():
+ if key.find("chrome") != -1:
+ browser_key = key
+ browser = webbrowser.get(browser_key)
+ browser.open(report_path, new=0, autoraise=True)
+ except:
+ # webbrowser.get() doesn't work well on darwin/windows.
+ webbrowser.open_new_tab(report_path)
def main():
def run_cmd(self, args, return_output=False):
if args[0].endswith('.py'):
args = [sys.executable] + args
+ use_shell = args[0].endswith('.bat')
try:
if not return_output:
- returncode = subprocess.call(args)
+ returncode = subprocess.call(args, shell=use_shell)
else:
- subproc = subprocess.Popen(args, stdout=subprocess.PIPE)
+ subproc = subprocess.Popen(args, stdout=subprocess.PIPE, shell=use_shell)
(output_data, _) = subproc.communicate()
returncode = subproc.returncode
except: