mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8329138: Convert JFR FileForceEvent to static mirror event
Reviewed-by: alanb, egahlin
This commit is contained in:
parent
2cc8eccb36
commit
f4caac8dea
12 changed files with 252 additions and 42 deletions
|
@ -50,6 +50,7 @@ import java.util.Objects;
|
|||
|
||||
import jdk.internal.access.JavaIOFileDescriptorAccess;
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
import jdk.internal.event.FileForceEvent;
|
||||
import jdk.internal.foreign.MemorySessionImpl;
|
||||
import jdk.internal.foreign.SegmentFactories;
|
||||
import jdk.internal.misc.Blocker;
|
||||
|
@ -486,8 +487,7 @@ public class FileChannelImpl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void force(boolean metaData) throws IOException {
|
||||
private void implForce(boolean metaData) throws IOException {
|
||||
ensureOpen();
|
||||
int rv = -1;
|
||||
int ti = -1;
|
||||
|
@ -511,6 +511,17 @@ public class FileChannelImpl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void force(boolean metaData) throws IOException {
|
||||
if (!FileForceEvent.enabled()) {
|
||||
implForce(metaData);
|
||||
return;
|
||||
}
|
||||
long start = FileForceEvent.timestamp();
|
||||
implForce(metaData);
|
||||
FileForceEvent.offer(start, path, metaData);
|
||||
}
|
||||
|
||||
// Assume at first that the underlying kernel supports sendfile/equivalent;
|
||||
// set this to true if we find out later that it doesn't
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue