Skip to content

Commit

Permalink
jfropts=mem is supported on Linux only
Browse files Browse the repository at this point in the history
  • Loading branch information
apangin committed May 7, 2024
1 parent 61be698 commit 2ce713f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,10 @@ $ asprof -d 30 -f /tmp/flamegraph.html 8983
only events between the safepoint request and the start of the VM operation
will be recorded.

* `--jfropts OPTIONS` - comma separated list of JFR recording options. The only
option currently supported is `mem`: accumulate events in memory instead of
flushing synchronously to a file.
* `--jfropts OPTIONS` - comma separated list of JFR recording options.
Currently, the only available option is `mem` supported on Linux 3.17+.
`mem` enables accumulating events in memory instead of flushing
synchronously to a file.

* `--jfrsync CONFIG` - start Java Flight Recording with the given configuration
synchronously with the profiler. The output .jfr file will include all regular
Expand Down
10 changes: 2 additions & 8 deletions src/os_macos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/times.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include "os.h"
Expand Down Expand Up @@ -328,13 +327,8 @@ u64 OS::getTotalCpuTime(u64* utime, u64* stime) {
}

int OS::createMemoryFile(const char* name) {
char buf[128];
snprintf(buf, sizeof(buf), "%.100s.%d", name, processId());
int fd = shm_open(buf, O_RDWR | O_CREAT | O_TRUNC, 0600);
if (fd >= 0) {
shm_unlink(buf);
}
return fd;
// Not supported on macOS
return -1;
}

void OS::copyFile(int src_fd, int dst_fd, off_t offset, size_t size) {
Expand Down

0 comments on commit 2ce713f

Please sign in to comment.