Android-cuttlefish cvd tool
run_cvd_proc_collector.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <sys/types.h>
20
21#include <optional>
22#include <set>
23#include <string>
24#include <unordered_map>
25#include <vector>
26
27#include <android-base/file.h>
29
32
33namespace cuttlefish {
34
36 std::string home_;
37 std::string exec_path_;
38 std::string stop_cvd_path_;
40 std::optional<std::string> android_host_out_;
41 struct InstanceInfo {
42 std::set<pid_t> pids_;
43 std::set<pid_t> parent_run_cvd_pids_;
46 unsigned id_;
47 };
48 // instance id to instance info mapping
49 std::unordered_map<unsigned, InstanceInfo> instances_;
50};
51
53
54} // namespace cuttlefish
Definition: expected.h:86
std::vector< std::string > Args
Definition: types.h:25
std::unordered_map< std::string, std::string > Envs
Definition: types.h:26
Definition: alloc_utils.cpp:23
Result< std::vector< GroupProcInfo > > CollectRunCvdGroups()
Definition: run_cvd_proc_collector.cpp:235
Definition: run_cvd_proc_collector.h:41
cvd_common::Envs envs_
Definition: run_cvd_proc_collector.h:44
unsigned id_
Definition: run_cvd_proc_collector.h:46
std::set< pid_t > parent_run_cvd_pids_
Definition: run_cvd_proc_collector.h:43
std::set< pid_t > pids_
Definition: run_cvd_proc_collector.h:42
cvd_common::Args cmd_args_
Definition: run_cvd_proc_collector.h:45
Definition: run_cvd_proc_collector.h:35
std::string stop_cvd_path_
Definition: run_cvd_proc_collector.h:38
std::string exec_path_
Definition: run_cvd_proc_collector.h:37
std::optional< std::string > android_host_out_
Definition: run_cvd_proc_collector.h:40
std::string home_
Definition: run_cvd_proc_collector.h:36
std::unordered_map< unsigned, InstanceInfo > instances_
Definition: run_cvd_proc_collector.h:49
bool is_cvd_server_started_
Definition: run_cvd_proc_collector.h:39