|
Lines 603-615
public class KernelStatisticsData extends StatisticsData {
Link Here
|
| 603 |
* #increase(org.eclipse.linuxtools.lttng.event.LttngEvent, |
603 |
* #increase(org.eclipse.linuxtools.lttng.event.LttngEvent, |
| 604 |
* org.eclipse.linuxtools.lttng.state.model.LttngTraceState, int) |
604 |
* org.eclipse.linuxtools.lttng.state.model.LttngTraceState, int) |
| 605 |
*/ |
605 |
*/ |
|
|
606 |
@SuppressWarnings("unused") |
| 606 |
@Override |
607 |
@Override |
| 607 |
public void increase(LttngEvent event, LttngTraceState traceState, int values) { |
608 |
public void increase(LttngEvent event, LttngTraceState traceState, int values) { |
| 608 |
try { |
609 |
try { |
| 609 |
int j; // Increment |
610 |
int j; // Increment |
| 610 |
Long cpu = event.getCpuId(); |
611 |
Long cpu = event.getCpuId(); |
| 611 |
LttngProcessState process = traceState.getRunning_process().get(cpu); |
612 |
LttngProcessState process = traceState.getRunning_process().get(cpu); |
| 612 |
|
613 |
|
|
|
614 |
// Updating the cumulative CPU time |
| 615 |
if ((values & Values.STATE_CUMULATIVE_CPU_TIME) != 0) { |
| 616 |
if (process.getState().getProc_status().equals(ProcessStatus.LTTV_STATE_RUN) && !process.getState().getExec_mode().equals(ExecutionMode.LTTV_STATE_MODE_UNKNOWN)) { |
| 617 |
long cumulativeCpuTime = process.getState().getCum_cpu_time(); |
| 618 |
long delta = event.getTimestamp().getValue() - process.getState().getChange_LttTime(); |
| 619 |
process.getState().setCum_cpu_time(cumulativeCpuTime + delta); |
| 620 |
} |
| 621 |
} |
| 622 |
if ((values & Values.CUMULATIVE_CPU_TIME) != 0) { |
| 623 |
if (!process.getState().getExec_mode().equals(ExecutionMode.LTTV_STATE_MODE_UNKNOWN)) { |
| 624 |
long cumulativeCpuTime = process.getState().getCum_cpu_time(); |
| 625 |
long delta = event.getTimestamp().getValue() - process.getState().getEntry_LttTime(); |
| 626 |
long newCumulativeCpuTime = cumulativeCpuTime + delta; |
| 627 |
process.getState().setCum_cpu_time(newCumulativeCpuTime); |
| 628 |
} else if (process.getState().getProc_status().equals(ProcessStatus.LTTV_STATE_RUN) && !process.getState().getExec_mode().equals(ExecutionMode.LTTV_STATE_MODE_UNKNOWN)) { |
| 629 |
long cumulativeCpuTime = process.getState().getCum_cpu_time(); |
| 630 |
long delta = event.getTimestamp().getValue() - process.getState().getChange_LttTime(); |
| 631 |
long newCumulativeCpuTime = cumulativeCpuTime + delta; |
| 632 |
process.getState().setCum_cpu_time(newCumulativeCpuTime); |
| 633 |
} |
| 634 |
} |
| 635 |
|
| 636 |
// Getting normal paths |
| 613 |
FixedArray[] paths = getNormalPaths(event, traceState, (int) traceState.getContext().getIdentifier()); |
637 |
FixedArray[] paths = getNormalPaths(event, traceState, (int) traceState.getContext().getIdentifier()); |
| 614 |
// Clone the paths to avoid conflict with the TraceSetPaths |
638 |
// Clone the paths to avoid conflict with the TraceSetPaths |
| 615 |
FixedArray[] clonedPaths = new FixedArray[paths.length]; |
639 |
FixedArray[] clonedPaths = new FixedArray[paths.length]; |
|
Lines 638-655
public class KernelStatisticsData extends StatisticsData {
Link Here
|
| 638 |
if ((values & Values.CUMULATIVE_CPU_TIME) != 0) { |
662 |
if ((values & Values.CUMULATIVE_CPU_TIME) != 0) { |
| 639 |
if (!process.getState().getExec_mode().equals(ExecutionMode.LTTV_STATE_MODE_UNKNOWN)) { |
663 |
if (!process.getState().getExec_mode().equals(ExecutionMode.LTTV_STATE_MODE_UNKNOWN)) { |
| 640 |
long cumulativeCpuTime = process.getState().getCum_cpu_time(); |
664 |
long cumulativeCpuTime = process.getState().getCum_cpu_time(); |
| 641 |
long delta = event.getTimestamp().getValue() - process.getState().getEntry_LttTime(); |
665 |
node.getValue().cumulativeCpuTime += cumulativeCpuTime; |
| 642 |
long newCumulativeCpuTime = cumulativeCpuTime + delta; |
666 |
traceSetNode.getValue().cumulativeCpuTime += cumulativeCpuTime; |
| 643 |
process.getState().setCum_cpu_time(newCumulativeCpuTime); |
|
|
| 644 |
node.getValue().cumulativeCpuTime += newCumulativeCpuTime; |
| 645 |
traceSetNode.getValue().cumulativeCpuTime += newCumulativeCpuTime; |
| 646 |
} else if (process.getState().getProc_status().equals(ProcessStatus.LTTV_STATE_RUN) && !process.getState().getExec_mode().equals(ExecutionMode.LTTV_STATE_MODE_UNKNOWN)) { |
667 |
} else if (process.getState().getProc_status().equals(ProcessStatus.LTTV_STATE_RUN) && !process.getState().getExec_mode().equals(ExecutionMode.LTTV_STATE_MODE_UNKNOWN)) { |
| 647 |
long cumulativeCpuTime = process.getState().getCum_cpu_time(); |
668 |
long cumulativeCpuTime = process.getState().getCum_cpu_time(); |
| 648 |
long delta = event.getTimestamp().getValue() - process.getState().getChange_LttTime(); |
669 |
node.getValue().cumulativeCpuTime += cumulativeCpuTime; |
| 649 |
long newCumulativeCpuTime = cumulativeCpuTime + delta; |
670 |
traceSetNode.getValue().cumulativeCpuTime += cumulativeCpuTime; |
| 650 |
process.getState().setCum_cpu_time(newCumulativeCpuTime); |
|
|
| 651 |
node.getValue().cumulativeCpuTime += newCumulativeCpuTime; |
| 652 |
traceSetNode.getValue().cumulativeCpuTime += newCumulativeCpuTime; |
| 653 |
} |
671 |
} |
| 654 |
} |
672 |
} |
| 655 |
if ((values & Values.ELAPSED_TIME) != 0) { |
673 |
if ((values & Values.ELAPSED_TIME) != 0) { |
|
Lines 658-670
public class KernelStatisticsData extends StatisticsData {
Link Here
|
| 658 |
traceSetNode.getValue().elapsedTime += event.getTimestamp().getValue() - process.getState().getEntry_LttTime(); |
676 |
traceSetNode.getValue().elapsedTime += event.getTimestamp().getValue() - process.getState().getEntry_LttTime(); |
| 659 |
} |
677 |
} |
| 660 |
} |
678 |
} |
| 661 |
if ((values & Values.STATE_CUMULATIVE_CPU_TIME) != 0) { |
|
|
| 662 |
if (process.getState().getProc_status().equals(ProcessStatus.LTTV_STATE_RUN) && !process.getState().getExec_mode().equals(ExecutionMode.LTTV_STATE_MODE_UNKNOWN)) { |
| 663 |
long cumulativeCpuTime = process.getState().getCum_cpu_time(); |
| 664 |
long delta = event.getTimestamp().getValue() - process.getState().getChange_LttTime(); |
| 665 |
process.getState().setCum_cpu_time(cumulativeCpuTime + delta); |
| 666 |
} |
| 667 |
} |
| 668 |
} |
679 |
} |
| 669 |
} catch (Exception e) { |
680 |
} catch (Exception e) { |
| 670 |
e.printStackTrace(); |
681 |
e.printStackTrace(); |
| 671 |
- |
|
|