src/jdk.jfr/share/classes/jdk/jfr/consumer/EventParser.java
branchJEP-349-branch
changeset 57470 025c9b8eaefd
parent 57463 e8d4ec2bf480
child 57690 9316d02dd4a5
equal deleted inserted replaced
57467:de154169948b 57470:025c9b8eaefd
    99     public void setEnabled(boolean enabled) {
    99     public void setEnabled(boolean enabled) {
   100         this.enabled = enabled;
   100         this.enabled = enabled;
   101     }
   101     }
   102 
   102 
   103     public boolean isEnabled() {
   103     public boolean isEnabled() {
   104         return this.enabled;
   104         return enabled;
   105     }
   105     }
   106 
   106 
   107     public RecordedEvent parse(RecordingInput input) throws IOException {
   107     public RecordedEvent parse(RecordingInput input) throws IOException {
   108         if (!enabled) {
   108         if (!enabled) {
   109             return null;
   109             return null;
   110         }
   110         }
   111 
   111 
   112         long startTicks = input.readLong();
   112         long startTicks = input.readLong();
   113         long durationTicks = 0;
   113         long endTicks = startTicks;
   114         if (hasDuration) {
   114         if (hasDuration) {
   115             durationTicks = input.readLong();
   115             long durationTicks = input.readLong();
   116             if (thresholdNanos > 0L) {
   116             if (thresholdNanos > 0L) {
   117                 if (timeConverter.convertTimespan(durationTicks) < thresholdNanos) {
   117                 if (timeConverter.convertTimespan(durationTicks) < thresholdNanos) {
   118                     return null;
   118                     return null;
   119                 }
   119                 }
   120             }
   120             }
       
   121             endTicks += durationTicks;
   121         }
   122         }
   122         long endTicks = startTicks + durationTicks;
       
   123         if (firstNanos > 0L) {
   123         if (firstNanos > 0L) {
   124             if (timeConverter.convertTimestamp(endTicks) < firstNanos) {
   124             if (timeConverter.convertTimestamp(endTicks) < firstNanos) {
   125                 return null;
   125                 return null;
   126             }
   126             }
   127         }
   127         }