OSDN Git Service

Merge "ext4_utils: copy mke2fs.conf to /etc" into oc-dr1-dev am: 7f60c1a8af
[android-x86/system-extras.git] / simpleperf / environment.h
index 5d9cee8..2f4d58b 100644 (file)
 #include <sys/types.h>
 #include <time.h>
 
+#if defined(__linux__)
+#include <sys/syscall.h>
+#include <unistd.h>
+#endif
+
 #include <functional>
 #include <set>
 #include <string>
@@ -64,6 +69,7 @@ bool GetThreadName(pid_t tid, std::string* name);
 bool GetValidThreadsFromThreadString(const std::string& tid_str, std::set<pid_t>* tid_set);
 
 bool CheckPerfEventLimit();
+bool GetMaxSampleFrequency(uint64_t* max_sample_freq);
 bool CheckSampleFrequency(uint64_t sample_freq);
 bool CheckKernelSymbolAddresses();
 
@@ -74,8 +80,15 @@ static inline uint64_t GetSystemClock() {
   clock_gettime(CLOCK_MONOTONIC, &ts);
   return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
 }
+
+#if !defined(__ANDROID__)
+static inline int gettid() {
+  return syscall(__NR_gettid);
+}
+#endif
 #endif
 
 ArchType GetMachineArch();
+void PrepareVdsoFile();
 
 #endif  // SIMPLE_PERF_ENVIRONMENT_H_