summaryrefslogtreecommitdiff
path: root/simpleperf/utils.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-06-17 21:15:09 -0700
committerYabin Cui <yabinc@google.com>2015-06-18 16:47:02 -0700
commitb032de7a9e1975a838cd6df2e7c8df3c7f70a3ce (patch)
tree08c1d077015624b5488edc7483050f492364c451 /simpleperf/utils.cpp
parent1ded5c77b86bf64d121251e70d84fbe7cf19b06c (diff)
downloadextras-b032de7a9e1975a838cd6df2e7c8df3c7f70a3ce.tar.gz
Simpleperf: support monitoring existing processes/threads.
Also change the default record freq from 1000 to 4000. Because 1000 seems to be too low. Bug: 19483574 Change-Id: I340fcb9d28a156862705e483ee340a1c824eea21
Diffstat (limited to 'simpleperf/utils.cpp')
-rw-r--r--simpleperf/utils.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/simpleperf/utils.cpp b/simpleperf/utils.cpp
index 783bc8ff..b2122636 100644
--- a/simpleperf/utils.cpp
+++ b/simpleperf/utils.cpp
@@ -68,6 +68,16 @@ void GetEntriesInDir(const std::string& dirpath, std::vector<std::string>* files
closedir(dir);
}
+bool IsDir(const std::string& dirpath) {
+ struct stat st;
+ if (stat(dirpath.c_str(), &st) == 0) {
+ if (S_ISDIR(st.st_mode)) {
+ return true;
+ }
+ }
+ return false;
+}
+
bool RemovePossibleFile(const std::string& filename) {
struct stat st;
if (stat(filename.c_str(), &st) == 0) {