123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #include <string.h>
- #include <android-base/logging.h>
- #include "config.h"
- #include "perfprofd_binder.h"
- #include "perfprofd_cmdline.h"
- #include "perfprofdcore.h"
- extern int perfprofd_main(int argc, char** argv, Config* config);
- int main(int argc, char** argv)
- {
- if (argc > 1 && strcmp(argv[1], "--binder") == 0) {
- return android::perfprofd::binder::Main();
- }
- struct PosixSleepConfig : public Config {
- void Sleep(size_t seconds) override {
- sleep(seconds);
- }
- bool IsProfilingEnabled() const override {
-
-
-
- if (access(config_directory.c_str(), F_OK) == -1) {
- PLOG(WARNING) << "unable to open config directory " << config_directory;
- return false;
- }
-
- std::string semaphore_filepath = config_directory
- + "/" + SEMAPHORE_FILENAME;
- if (access(semaphore_filepath.c_str(), F_OK) == -1) {
- return false;
- }
- return true;
- }
- };
- PosixSleepConfig config;
- return perfprofd_main(argc, argv, &config);
- }
|