2 * Copyright (C) 2015 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef _MEMORY_REPLAY_THREADS_H
18 #define _MEMORY_REPLAY_THREADS_H
21 #include <sys/types.h>
28 Threads(Pointers* pointers, size_t max_threads);
31 Thread* CreateThread(pid_t tid);
32 Thread* FindThread(pid_t tid);
33 void WaitForAllToQuiesce();
34 void Finish(Thread* thread);
37 size_t num_threads() { return num_threads_; }
38 size_t max_threads() { return max_threads_; }
39 uint64_t total_time_nsecs() { return total_time_nsecs_; }
42 Pointers* pointers_ = nullptr;
43 Thread* threads_ = nullptr;
44 size_t data_size_ = 0;
45 size_t max_threads_ = 0;
46 size_t num_threads_= 0;
47 uint64_t total_time_nsecs_ = 0;
49 Thread* FindEmptyEntry(pid_t tid);
50 size_t GetHashEntry(pid_t tid);
57 #endif // _MEMORY_REPLAY_THREADS_H