simpleperf: fix --app option for multiprocess apps.
1. Search all processes in an app when using --app option in record command.
2. Fix searching one app process when using -p option in app_profiler.py.
3. Add unittest for profiling multiprocess apps.
Bug: http://b/65025325
Test: run test.py
Change-Id: Iba2e97c2174815d0236636e3cf15b1fc17a5d838
diff --git a/simpleperf/environment.h b/simpleperf/environment.h
index 52d0a7c..0f12146 100644
--- a/simpleperf/environment.h
+++ b/simpleperf/environment.h
@@ -92,7 +92,7 @@
ArchType GetMachineArch();
void PrepareVdsoFile();
-int WaitForAppProcess(const std::string& package_name);
+std::set<pid_t> WaitForAppProcesses(const std::string& package_name);
bool RunInAppContext(const std::string& app_package_name, const std::string& cmd,
const std::vector<std::string>& args, size_t workload_args_size,
const std::string& output_filepath, bool need_tracepoint_events);