Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ddprof-lib/src/main/cpp/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class OS {

static void *safeAlloc(size_t size);
static void safeFree(void *addr, size_t size);
static int mprotect(void *addr, size_t len, int prot);

static bool getCpuDescription(char *buf, size_t size);
static u64 getProcessCpuTime(u64 *utime, u64 *stime);
Expand Down
4 changes: 4 additions & 0 deletions ddprof-lib/src/main/cpp/os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ void *OS::safeAlloc(size_t size) {

void OS::safeFree(void *addr, size_t size) { syscall(__NR_munmap, addr, size); }

int OS::mprotect(void *addr, size_t len, int prot) {
return mprotect(addr, len, prot);
}

bool OS::getCpuDescription(char *buf, size_t size) {
int fd = open("/proc/cpuinfo", O_RDONLY);
if (fd == -1) {
Expand Down
4 changes: 4 additions & 0 deletions ddprof-lib/src/main/cpp/os_macos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ void *OS::safeAlloc(size_t size) {

void OS::safeFree(void *addr, size_t size) { munmap(addr, size); }

int OS::mprotect(void *addr, size_t len, int prot) {
return mprotect(addr, len, prot);
}

bool OS::getCpuDescription(char *buf, size_t size) {
return sysctlbyname("machdep.cpu.brand_string", buf, &size, NULL, 0) == 0;
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/ap-lock.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
branch=dd/master
commit=87b7b42ec65be0a00a67e3f9451fb8e4d472b188
commit=5930966a92860f6e5d2d89ab6faab5815720bad9
Loading