org.eclipse.tracecompass.ctf.core.tests;bundle-version="0.1.0",
org.eclipse.tracecompass.gdbtrace.core.tests;bundle-version="0.1.0",
org.eclipse.tracecompass.gdbtrace.ui.tests;bundle-version="0.1.0",
+ org.eclipse.tracecompass.analysis.os.linux.core.tests;bundle-version="0.1.0",
org.eclipse.tracecompass.lttng2.control.core.tests;bundle-version="0.1.0",
org.eclipse.tracecompass.lttng2.control.ui.tests;bundle-version="0.1.0",
org.eclipse.tracecompass.lttng2.kernel.core.tests;bundle-version="0.1.0",
org.eclipse.tracecompass.ctf.core.tests.AllCtfCoreTests.class,
org.eclipse.tracecompass.ctf.parser.tests.AllCtfParserTests.class,
org.eclipse.tracecompass.gdbtrace.core.tests.AllGdbTraceCoreTests.class,
+ org.eclipse.tracecompass.analysis.os.linux.core.tests.AllTests.class,
org.eclipse.tracecompass.lttng2.control.core.tests.AllTests.class,
org.eclipse.tracecompass.lttng2.kernel.core.tests.AllTests.class,
org.eclipse.tracecompass.lttng2.ust.core.tests.AllTests.class,
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tracecompass.analysis.os.linux.core.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
--- /dev/null
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=error
+org.eclipse.jdt.core.compiler.problem.deprecation=error
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=error
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=error
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=enabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=error
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=250
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
--- /dev/null
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_tmf-style
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
--- /dev/null
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
--- /dev/null
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 0.1.0.qualifier
+Bundle-Localization: plugin
+Bundle-SymbolicName: org.eclipse.tracecompass.analysis.os.linux.core.tests;singleton:=true
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.junit;bundle-version="4.0.0",
+ org.eclipse.core.runtime,
+ org.eclipse.tracecompass.common.core;bundle-version="0.1.0",
+ org.eclipse.tracecompass.analysis.os.linux.core;bundle-version="0.1.0",
+ org.eclipse.tracecompass.tmf.core;bundle-version="0.1.0",
+ org.eclipse.tracecompass.tmf.core.tests;bundle-version="0.1.0",
+ org.eclipse.tracecompass.tmf.ctf.core,
+ org.eclipse.tracecompass.tmf.ctf.core.tests,
+ org.eclipse.core.resources
+Import-Package: com.google.common.collect
+Export-Package: org.eclipse.tracecompass.analysis.os.linux.core.tests,
+ org.eclipse.tracecompass.analysis.os.linux.core.tests.cpuusage
+Bundle-Activator: org.eclipse.tracecompass.analysis.os.linux.core.tests.Activator
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2015 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ plugin.xml
+src.includes = about.html
+additional.bundles = org.eclipse.jdt.annotation
+jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
--- /dev/null
+###############################################################################
+# Copyright (c) 2015 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+
+Bundle-Vendor = Eclipse Trace Compass
+Bundle-Name = Trace Compass Linux Kernel Analysis Core Tests Plug-in
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.linuxtools.tmf.core.analysis">
+ <module
+ analysis_module="org.eclipse.tracecompass.analysis.os.linux.core.cpuusage.KernelCpuUsageAnalysis"
+ automatic="false"
+ id="org.eclipse.tracecompass.analysis.os.linux.tests.cpuusage"
+ name="CPU Usage Test Analysis">
+ <tracetype
+ applies="true"
+ class="org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub">
+ </tracetype>
+ </module>
+ <module
+ analysis_module="org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis"
+ automatic="false"
+ id="org.eclipse.tracecompass.analysis.os.linux.tests.kernel"
+ name="Linux Kernel Test Analysis">
+ <tracetype
+ applies="true"
+ class="org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub">
+ </tracetype>
+ </module>
+ </extension>
+
+</plugin>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>org.eclipse.tracecompass</artifactId>
+ <groupId>org.eclipse.tracecompass</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.tracecompass.analysis.os.linux.core.tests</artifactId>
+ <groupId>org.eclipse.tracecompass</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <name>Trace Compass Linux Kernel Analysis Core Tests Plug-in</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <id>prepare</id>
+ <phase>validate</phase>
+ <configuration>
+ <target>
+ <echo message="prepare phase" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <includes>
+ <include>**/AllTests.*</include>
+ </includes>
+ <useUIHarness>false</useUIHarness>
+ <useUIThread>false</useUIThread>
+ <product>org.eclipse.platform.ide</product>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.tests;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Activator for this plugin
+ *
+ * @author Geneviève Bastien
+ */
+public class Activator extends Plugin {
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ /**
+ * The plug-in ID
+ */
+ public static final String PLUGIN_ID = "org.eclipse.tracecompass.analysis.linux.core.tests"; //$NON-NLS-1$
+
+ /**
+ * The shared instance
+ */
+ private static Activator PLUGIN;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return PLUGIN;
+ }
+
+ // ------------------------------------------------------------------------
+ // Operators
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ PLUGIN = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ PLUGIN = null;
+ super.stop(context);
+ }
+
+ /**
+ * Return a path to a file relative to this plugin's base directory
+ *
+ * @param relativePath
+ * The path relative to the plugin's root directory
+ * @return The path corresponding to the relative path in parameter
+ */
+ public static IPath getAbsoluteFilePath(String relativePath) {
+ Activator plugin = Activator.getDefault();
+ if (plugin == null) {
+ /*
+ * Shouldn't happen but at least throw something to get the test to
+ * fail early
+ */
+ throw new IllegalStateException();
+ }
+ URL location = FileLocator.find(plugin.getBundle(), new Path(relativePath), null);
+ try {
+ return new Path(FileLocator.toFileURL(location).getPath());
+ } catch (IOException e) {
+ throw new IllegalStateException();
+ }
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.tests;
+
+import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
+import org.junit.runner.RunWith;
+
+/**
+ * Runner for the unit tests of this plugin
+ */
+@RunWith(DebugSuite.class)
+@DebugSuite.SuiteClasses({
+ org.eclipse.tracecompass.analysis.os.linux.core.tests.cpuusage.AllTests.class,
+ org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis.AllTests.class
+})
+public class AllTests {
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.tests.cpuusage;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Test suite for the CPU usage package
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ CpuUsageStateProviderTest.class
+})
+public class AllTests {
+
+}
\ No newline at end of file
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.tests.cpuusage;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.tracecompass.analysis.os.linux.core.cpuusage.KernelCpuUsageAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.Activator;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
+import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
+import org.eclipse.tracecompass.tmf.core.tests.shared.TmfTestHelper;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
+import org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for the {@link KernelCpuUsageAnalysis} class
+ *
+ * @author Geneviève Bastien
+ */
+public class CpuUsageStateProviderTest {
+
+ private static final String CPU_USAGE_FILE = "testfiles/cpu_analysis.xml";
+
+ /**
+ * The ID of the cpu usage analysis module for development traces
+ */
+ private static final String TEST_CPU_USAGE_ANALYSIS_ID = "org.eclipse.tracecompass.analysis.os.linux.tests.cpuusage";
+
+ private ITmfTrace fTrace;
+ private KernelCpuUsageAnalysis fModule;
+
+ private static void deleteSuppFiles(ITmfTrace trace) {
+ /* Remove supplementary files */
+ File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(trace));
+ for (File file : suppDir.listFiles()) {
+ file.delete();
+ }
+ }
+
+ /**
+ * Setup the trace for the tests
+ */
+ @Before
+ public void setUp() {
+ fTrace = new TmfXmlTraceStub();
+ IPath filePath = Activator.getAbsoluteFilePath(CPU_USAGE_FILE);
+ IStatus status = fTrace.validate(null, filePath.toOSString());
+ if (!status.isOK()) {
+ fail(status.getException().getMessage());
+ }
+ try {
+ fTrace.initTrace(null, filePath.toOSString(), TmfEvent.class);
+ } catch (TmfTraceException e) {
+ fail(e.getMessage());
+ }
+ deleteSuppFiles(fTrace);
+ ((TmfTrace) fTrace).traceOpened(new TmfTraceOpenedSignal(this, fTrace, null));
+ /*
+ * FIXME: Make sure this analysis is finished before running the CPU
+ * analysis. This block can be removed once analysis dependency and
+ * request precedence is implemented
+ */
+ IAnalysisModule module = null;
+ for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(fTrace, KernelAnalysis.class)) {
+ module = mod;
+ }
+ assertNotNull(module);
+ module.schedule();
+ module.waitForCompletion();
+ /* End of the FIXME block */
+
+ fModule = TmfTraceUtils.getAnalysisModuleOfClass(fTrace, KernelCpuUsageAnalysis.class, TEST_CPU_USAGE_ANALYSIS_ID);
+ assertNotNull(fModule);
+ }
+
+ /**
+ * Clean up
+ */
+ @After
+ public void tearDown() {
+ deleteSuppFiles(fTrace);
+ fTrace.dispose();
+ }
+
+ /**
+ * Test that the analysis executes without problems
+ */
+ @Test
+ public void testAnalysisExecution() {
+ /* Make sure the analysis hasn't run yet */
+ assertNull(fModule.getStateSystem());
+
+ /* Execute the analysis */
+ assertTrue(TmfTestHelper.executeAnalysis(fModule));
+ assertNotNull(fModule.getStateSystem());
+ }
+
+ /**
+ * Test that the state system is returned with the expected results
+ */
+ @Test
+ public void testReturnedStateSystem() {
+ fModule.schedule();
+ fModule.waitForCompletion();
+ ITmfStateSystem ss = fModule.getStateSystem();
+ assertNotNull(ss);
+ assertEquals(1L, ss.getStartTime());
+ assertEquals(25L, ss.getCurrentEndTime());
+
+ try {
+ int cpusQuark = ss.getQuarkAbsolute(Attributes.CPUS);
+
+ /*
+ * There should be 2 CPU entries: 0 and 1 and 3 process entries
+ * under each
+ */
+ List<Integer> cpuQuarks = ss.getSubAttributes(cpusQuark, false);
+ assertEquals(2, cpuQuarks.size());
+ for (Integer cpuQuark : cpuQuarks) {
+ assertEquals(3, ss.getSubAttributes(cpuQuark, false).size());
+ }
+
+ /* Proc 2 on CPU 0 should run from 1 to 20 seconds */
+ int proc2Quark = ss.getQuarkAbsolute(Attributes.CPUS, "0", "2");
+ ITmfStateInterval interval = ss.querySingleState(2L, proc2Quark);
+ assertEquals(1L, interval.getStartTime());
+ assertEquals(19L, interval.getEndTime());
+
+ /*
+ * Query at the end and make sure all processes on all CPU have the
+ * expected values
+ */
+ Map<String, Long> expected = new HashMap<>();
+ expected.put("CPUs/0/1", 0L);
+ expected.put("CPUs/0/2", 19L);
+ expected.put("CPUs/0/3", 5L);
+ expected.put("CPUs/1/1", 5L);
+ expected.put("CPUs/1/3", 6L);
+ expected.put("CPUs/1/4", 8L);
+ List<ITmfStateInterval> intervals = ss.queryFullState(25L);
+ Map<String, Long> intervalMap = new HashMap<>();
+ for (ITmfStateInterval oneInterval : intervals) {
+ if (!oneInterval.getStateValue().isNull()) {
+ intervalMap.put(ss.getFullAttributePath(oneInterval.getAttribute()), oneInterval.getStateValue().unboxLong());
+ }
+ }
+ assertEquals(expected, intervalMap);
+
+ } catch (AttributeNotFoundException | StateSystemDisposedException e) {
+ fail(e.getMessage());
+ }
+ }
+
+ /**
+ * Test the
+ * {@link KernelCpuUsageAnalysis#getCpuUsageInRange(long, long)}
+ * method.
+ */
+ @Test
+ public void testUsageInRange() {
+ fModule.schedule();
+ fModule.waitForCompletion();
+
+ /* This range should query the total range */
+ Map<String, Long> expected = new HashMap<>();
+ expected.put("0/1", 0L);
+ expected.put("0/2", 19L);
+ expected.put("0/3", 5L);
+ expected.put("1/1", 5L);
+ expected.put("1/3", 6L);
+ expected.put("1/4", 13L);
+ expected.put("total", 48L);
+ expected.put("total/1", 5L);
+ expected.put("total/2", 19L);
+ expected.put("total/3", 11L);
+ expected.put("total/4", 13L);
+ expected.put("0", 24L);
+ expected.put("1", 24L);
+ Map<String, Long> resultMap = fModule.getCpuUsageInRange(0L, 30L);
+ assertEquals(expected, resultMap);
+
+ /* Verify a range when a process runs at the start */
+ expected.clear();
+ expected.put("0/1", 0L);
+ expected.put("0/2", 0L);
+ expected.put("0/3", 3L);
+ expected.put("1/1", 0L);
+ expected.put("1/3", 0L);
+ expected.put("1/4", 3L);
+ expected.put("total", 6L);
+ expected.put("total/1", 0L);
+ expected.put("total/2", 0L);
+ expected.put("total/3", 3L);
+ expected.put("total/4", 3L);
+ expected.put("0", 3L);
+ expected.put("1", 3L);
+ resultMap = fModule.getCpuUsageInRange(22L, 25L);
+ assertEquals(expected, resultMap);
+
+ /* Verify a range when a process runs at the end */
+ expected.clear();
+ expected.put("0/1", 0L);
+ expected.put("0/2", 3L);
+ expected.put("0/3", 0L);
+ expected.put("1/1", 0L);
+ expected.put("1/3", 1L);
+ expected.put("1/4", 2L);
+ expected.put("total", 6L);
+ expected.put("total/1", 0L);
+ expected.put("total/2", 3L);
+ expected.put("total/3", 1L);
+ expected.put("total/4", 2L);
+ expected.put("0", 3L);
+ expected.put("1", 3L);
+ resultMap = fModule.getCpuUsageInRange(1L, 4L);
+ assertEquals(expected, resultMap);
+
+ /* Verify a range when a process runs at start and at the end */
+ expected.clear();
+ expected.put("0/1", 0L);
+ expected.put("0/2", 9L);
+ expected.put("0/3", 0L);
+ expected.put("1/1", 0L);
+ expected.put("1/3", 5L);
+ expected.put("1/4", 4L);
+ expected.put("total", 18L);
+ expected.put("total/1", 0L);
+ expected.put("total/2", 9L);
+ expected.put("total/3", 5L);
+ expected.put("total/4", 4L);
+ expected.put("0", 9L);
+ expected.put("1", 9L);
+ resultMap = fModule.getCpuUsageInRange(4L, 13L);
+ assertEquals(expected, resultMap);
+
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexandre Montplaisir - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Test suite
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ KernelThreadInformationProviderTest.class
+})
+public class AllTests {
+
+}
\ No newline at end of file
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.StateValues;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.Activator;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
+import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
+import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
+import org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test analysis-specific methods for the {@link KernelAnalysis} class.
+ *
+ * @author Geneviève Bastien
+ */
+public class KernelThreadInformationProviderTest {
+
+ private static final @NonNull String LTTNG_KERNEL_FILE = "testfiles/lttng_kernel_analysis.xml";
+
+ /**
+ * The ID of the kernel analysis module for development traces
+ */
+ private static final String TEST_KERNEL_ANALYSIS_ID = "org.eclipse.tracecompass.analysis.os.linux.tests.kernel";
+
+ private ITmfTrace fTrace;
+ private KernelAnalysis fModule;
+
+ private static void deleteSuppFiles(ITmfTrace trace) {
+ /* Remove supplementary files */
+ File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(trace));
+ for (File file : suppDir.listFiles()) {
+ file.delete();
+ }
+ }
+
+ /**
+ * Setup the trace for the tests
+ */
+ @Before
+ public void setUp() {
+ fTrace = new TmfXmlTraceStub();
+ IPath filePath = Activator.getAbsoluteFilePath(LTTNG_KERNEL_FILE);
+ IStatus status = fTrace.validate(null, filePath.toOSString());
+ if (!status.isOK()) {
+ fail(status.getException().getMessage());
+ }
+ try {
+ fTrace.initTrace(null, filePath.toOSString(), TmfEvent.class);
+ } catch (TmfTraceException e) {
+ fail(e.getMessage());
+ }
+ deleteSuppFiles(fTrace);
+ ((TmfTrace) fTrace).traceOpened(new TmfTraceOpenedSignal(this, fTrace, null));
+ IAnalysisModule module = null;
+ for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(fTrace, KernelAnalysis.class)) {
+ module = mod;
+ }
+ assertNotNull(module);
+ module.schedule();
+ module.waitForCompletion();
+ fModule = TmfTraceUtils.getAnalysisModuleOfClass(fTrace, KernelAnalysis.class, TEST_KERNEL_ANALYSIS_ID);
+ }
+
+ /**
+ * Clean up
+ */
+ @After
+ public void tearDown() {
+ deleteSuppFiles(fTrace);
+ fTrace.dispose();
+ }
+
+ /**
+ * Test the
+ * {@link KernelThreadInformationProvider#getThreadIds(KernelAnalysis)}
+ * method
+ */
+ @Test
+ public void testGetThreadQuarks() {
+ KernelAnalysis module = checkNotNull(fModule);
+ Collection<Integer> threadIds = KernelThreadInformationProvider.getThreadIds(module);
+ assertEquals(7, threadIds.size());
+ }
+
+ /**
+ * Test the
+ * {@link KernelThreadInformationProvider#getThreadOnCpu(KernelAnalysis, long, long)}
+ * method
+ */
+ @Test
+ public void testGetThreadOnCpu() {
+ KernelAnalysis module = checkNotNull(fModule);
+
+ /* Check with invalid timestamps */
+ Integer tid = KernelThreadInformationProvider.getThreadOnCpu(module, 0, -1);
+ assertNull(tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 0, 80);
+ assertNull(tid);
+
+ /* Check with invalid cpus */
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 2, 20);
+ assertNull(tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, -1, 20);
+ assertNull(tid);
+
+ /* Check valid values */
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 0, 4);
+ assertNull(tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 0, 15);
+ assertNull(tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 1, 15);
+ assertEquals(Integer.valueOf(11), tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 1, 29);
+ assertEquals(Integer.valueOf(20), tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 1, 30);
+ assertEquals(Integer.valueOf(21), tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 0, 59);
+ assertEquals(Integer.valueOf(11), tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 1, 59);
+ assertEquals(Integer.valueOf(30), tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 0, 60);
+ assertEquals(Integer.valueOf(11), tid);
+
+ tid = KernelThreadInformationProvider.getThreadOnCpu(module, 1, 60);
+ assertEquals(Integer.valueOf(21), tid);
+
+ }
+
+ /**
+ * Test the
+ * {@link KernelThreadInformationProvider#getParentPid(KernelAnalysis, Integer, long)}
+ * method
+ */
+ @Test
+ public void testGetPpid() {
+ KernelAnalysis module = checkNotNull(fModule);
+
+ /* Check with invalid timestamps */
+ Integer ppid = KernelThreadInformationProvider.getParentPid(module, 11, -1);
+ assertNull(ppid);
+
+ ppid = KernelThreadInformationProvider.getParentPid(module, 11, 80);
+ assertNull(ppid);
+
+ /* Check with invalid cpus */
+ ppid = KernelThreadInformationProvider.getParentPid(module, -4, 20);
+ assertNull(ppid);
+
+ ppid = KernelThreadInformationProvider.getParentPid(module, 12, 20);
+ assertNull(ppid);
+
+ /* Check values with no parent */
+ ppid = KernelThreadInformationProvider.getParentPid(module, 10, 20);
+ assertEquals(Integer.valueOf(0), ppid);
+
+ ppid = KernelThreadInformationProvider.getParentPid(module, 30, 60);
+ assertEquals(Integer.valueOf(0), ppid);
+
+ /* Check parent determined at statedump */
+ ppid = KernelThreadInformationProvider.getParentPid(module, 11, 4);
+ assertNull(ppid);
+
+ ppid = KernelThreadInformationProvider.getParentPid(module, 11, 5);
+ assertEquals(Integer.valueOf(10), ppid);
+
+ /* Check parent after process fork */
+ ppid = KernelThreadInformationProvider.getParentPid(module, 21, 25);
+ assertEquals(Integer.valueOf(20), ppid);
+
+ ppid = KernelThreadInformationProvider.getParentPid(module, 21, 70);
+ assertEquals(Integer.valueOf(20), ppid);
+
+ }
+
+ /**
+ * Test the {@link KernelThreadInformationProvider#getExecutableName(KernelAnalysis, Integer)} method
+ */
+ @Test
+ public void testGetExecutableName() {
+ KernelAnalysis module = checkNotNull(fModule);
+
+ /* Check with invalid threads */
+ String execName = KernelThreadInformationProvider.getExecutableName(module, 101);
+ assertNull(execName);
+
+ execName = KernelThreadInformationProvider.getExecutableName(module, -2);
+ assertNull(execName);
+
+ /* Check valid value */
+ execName = KernelThreadInformationProvider.getExecutableName(module, 20);
+ assertEquals("proc20", execName);
+
+ /* Check valid value with process name change in history */
+ execName = KernelThreadInformationProvider.getExecutableName(module, 21);
+ assertEquals("proc21", execName);
+
+ }
+
+ private static void testIntervals(String info, List<ITmfStateInterval> intervals, ITmfStateValue[] values) {
+ assertEquals(info + " interval count", values.length, intervals.size());
+ for (int i = 0; i < values.length; i++) {
+ assertEquals(info + " interval " + i, values[i], intervals.get(i).getStateValue());
+ }
+ }
+
+ /**
+ * Test the
+ * {@link KernelThreadInformationProvider#getStatusIntervalsForThread(KernelAnalysis, Integer, long, long, long, IProgressMonitor)}
+ * method
+ */
+ @Test
+ public void testGetStatusIntervalsForThread() {
+ KernelAnalysis module = checkNotNull(fModule);
+
+ IProgressMonitor monitor = new NullProgressMonitor();
+ Integer process21 = 21;
+ Integer process20 = 20;
+
+ /* Check invalid time ranges */
+ List<ITmfStateInterval> intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, process21, -15, -5, 3, monitor);
+ assertTrue(intervals.isEmpty());
+
+ intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, process21, 80, 1500000000L, 50, monitor);
+ assertTrue(intervals.isEmpty());
+
+ /* Check invalid quarks */
+ intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, -1, 0, 70L, 3, monitor);
+ assertTrue(intervals.isEmpty());
+
+ intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, 0, 0, 70L, 3, monitor);
+ assertTrue(intervals.isEmpty());
+
+ /* Check different time ranges and resolutions */
+ ITmfStateValue[] values = { TmfStateValue.nullValue(), StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE,
+ StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE, StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE,
+ StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE };
+ intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, process21, 0, 70L, 3, monitor);
+ testIntervals("tid 21 [0,70,3]", intervals, values);
+
+ ITmfStateValue[] values2 = { TmfStateValue.nullValue(), StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE,
+ StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE };
+ intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, process21, 1, 70L, 30, monitor);
+ testIntervals("tid 21 [0,70,30]", intervals, values2);
+
+ ITmfStateValue[] values3 = { StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE,
+ StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE };
+ intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, process21, 25, 50L, 3, monitor);
+ testIntervals("tid 21 [25,50,3]", intervals, values3);
+
+ ITmfStateValue[] values4 = { TmfStateValue.nullValue(), StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE,
+ StateValues.PROCESS_STATUS_RUN_USERMODE_VALUE, StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE };
+ intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, process20, 0, 70L, 3, monitor);
+ testIntervals("tid 20 [0,70,3]", intervals, values4);
+
+ ITmfStateValue[] values5 = { TmfStateValue.nullValue(), StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE };
+ intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, process20, 1, 70L, 30, monitor);
+ testIntervals("tid 20 [0,70,30]", intervals, values5);
+
+ ITmfStateValue[] values6 = { StateValues.PROCESS_STATUS_RUN_USERMODE_VALUE,
+ StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE };
+ intervals = KernelThreadInformationProvider.getStatusIntervalsForThread(module, process20, 25, 50L, 3, monitor);
+ testIntervals("tid 20 [25,50,3]", intervals, values6);
+
+ }
+
+}
--- /dev/null
+<trace>
+<event timestamp="0" name="set_aspects">
+<field name="cpu" value="1" type="int" />
+</event>
+<event timestamp="1" name="sched_switch">
+<field name="cpu" value="0" type="int" />
+<field name="prev_comm" value="proc1" type="string" />
+<field name="prev_tid" value="1" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc2" type="string" />
+<field name="next_tid" value="2" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="2" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc3" type="string" />
+<field name="prev_tid" value="3" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc4" type="string" />
+<field name="next_tid" value="4" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="5" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc4" type="string" />
+<field name="prev_tid" value="4" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc3" type="string" />
+<field name="next_tid" value="3" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="10" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc3" type="string" />
+<field name="prev_tid" value="3" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc4" type="string" />
+<field name="next_tid" value="4" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="15" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc4" type="string" />
+<field name="prev_tid" value="4" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc1" type="string" />
+<field name="next_tid" value="1" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="20" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc1" type="string" />
+<field name="prev_tid" value="1" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc4" type="string" />
+<field name="next_tid" value="4" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="20" name="sched_switch">
+<field name="cpu" value="0" type="int" />
+<field name="prev_comm" value="proc2" type="string" />
+<field name="prev_tid" value="2" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc3" type="string" />
+<field name="next_tid" value="3" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="25" name="sched_switch">
+<field name="cpu" value="0" type="int" />
+<field name="prev_comm" value="proc3" type="string" />
+<field name="prev_tid" value="3" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc2" type="string" />
+<field name="next_tid" value="2" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+</trace>
\ No newline at end of file
--- /dev/null
+<!-- ***************************************************************************
+* Simple LTTng Kernel trace, with simple process statedumps,
+* sched_switches and a process forking
+*************************************************************************** -->
+<trace>
+<event timestamp="0" name="set_aspects">
+<field name="cpu" value="1" type="int" />
+</event>
+<event timestamp="1" name="lttng_statedump_process_state">
+<field name="cpu" value="0" type="int" />
+<field name="tid" value="10" type="long" />
+<field name="vtid" value="10" type="long" />
+<field name="pid" value="10" type="long" />
+<field name="vpid" value="10" type="long" />
+<field name="ppid" value="0" type="long" />
+<field name="vppid" value="0" type="long" />
+<field name="type" value="1" type="int" />
+<field name="mode" value="5" type="int" />
+<field name="submode" value="0" type="int" />
+<field name="status" value="5" type="long" />
+<field name="ns_level" value="0" type="int" />
+<field name="name" value="proc10" type="string" />
+</event>
+<event timestamp="5" name="lttng_statedump_process_state">
+<field name="cpu" value="0" type="int" />
+<field name="tid" value="11" type="long" />
+<field name="vtid" value="11" type="long" />
+<field name="pid" value="11" type="long" />
+<field name="vpid" value="11" type="long" />
+<field name="ppid" value="10" type="long" />
+<field name="vppid" value="10" type="long" />
+<field name="type" value="1" type="int" />
+<field name="mode" value="5" type="int" />
+<field name="submode" value="0" type="int" />
+<field name="status" value="5" type="long" />
+<field name="ns_level" value="0" type="int" />
+<field name="name" value="proc11" type="string" />
+</event>
+<event timestamp="10" name="lttng_statedump_process_state">
+<field name="cpu" value="0" type="int" />
+<field name="tid" value="20" type="long" />
+<field name="vtid" value="20" type="long" />
+<field name="pid" value="20" type="long" />
+<field name="vpid" value="20" type="long" />
+<field name="ppid" value="0" type="long" />
+<field name="vppid" value="0" type="long" />
+<field name="type" value="1" type="int" />
+<field name="mode" value="5" type="int" />
+<field name="submode" value="0" type="int" />
+<field name="status" value="5" type="long" />
+<field name="ns_level" value="0" type="int" />
+<field name="name" value="proc20" type="string" />
+</event>
+<event timestamp="12" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc3" type="string" />
+<field name="prev_tid" value="30" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc11" type="string" />
+<field name="next_tid" value="11" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="15" name="lttng_statedump_process_state">
+<field name="cpu" value="0" type="int" />
+<field name="tid" value="30" type="long" />
+<field name="vtid" value="30" type="long" />
+<field name="pid" value="30" type="long" />
+<field name="vpid" value="30" type="long" />
+<field name="ppid" value="0" type="long" />
+<field name="vppid" value="0" type="long" />
+<field name="type" value="1" type="int" />
+<field name="mode" value="5" type="int" />
+<field name="submode" value="0" type="int" />
+<field name="status" value="5" type="long" />
+<field name="ns_level" value="0" type="int" />
+<field name="name" value="proc30" type="string" />
+</event>
+<event timestamp="17" name="lttng_statedump_end">
+<field name="cpu" value="0" type="int" />
+</event>
+<event timestamp="20" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc11" type="string" />
+<field name="prev_tid" value="10" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc20" type="string" />
+<field name="next_tid" value="20" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="25" name="sched_process_fork">
+<field name="cpu" value="1" type="int" />
+<field name="parent_comm" value="proc20" type="string" />
+<field name="parent_tid" value="20" type="long" />
+<field name="parent_pid" value="20" type="int" />
+<field name="child_comm" value="proc20" type="string" />
+<field name="child_tid" value="21" type="long" />
+<field name="child_pid" value="20" type="int" />
+</event>
+<event timestamp="30" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc20" type="string" />
+<field name="prev_tid" value="20" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc21" type="string" />
+<field name="next_tid" value="21" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="35" name="sched_switch">
+<field name="cpu" value="0" type="int" />
+<field name="prev_comm" value="lttng-sessiond" type="string" />
+<field name="prev_tid" value="100" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc11" type="string" />
+<field name="next_tid" value="11" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="50" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc21" type="string" />
+<field name="prev_tid" value="21" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc30" type="string" />
+<field name="next_tid" value="30" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="60" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc30" type="string" />
+<field name="prev_tid" value="30" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc21" type="string" />
+<field name="next_tid" value="21" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+<event timestamp="70" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc21" type="string" />
+<field name="prev_tid" value="21" type="long" />
+<field name="prev_prio" value="20" type="int" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc20" type="string" />
+<field name="next_tid" value="20" type="long" />
+<field name="next_prio" value="20" type="int" />
+</event>
+</trace>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tracecompass.analysis.os.linux.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
--- /dev/null
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=error
+org.eclipse.jdt.core.compiler.problem.deprecation=error
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=error
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=error
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=enabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=error
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=error
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=error
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=250
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
--- /dev/null
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_tmf-style
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
--- /dev/null
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
--- /dev/null
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 0.1.0.qualifier
+Bundle-Localization: plugin
+Bundle-SymbolicName: org.eclipse.tracecompass.analysis.os.linux.core;singleton:=true
+Bundle-Activator: org.eclipse.tracecompass.internal.analysis.os.linux.core.Activator
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.tracecompass.common.core;bundle-version="0.1.0",
+ org.eclipse.tracecompass.tmf.core;bundle-version="0.1.0"
+Import-Package: com.google.common.collect
+Export-Package: org.eclipse.tracecompass.analysis.os.linux.core.cpuusage,
+ org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis,
+ org.eclipse.tracecompass.analysis.os.linux.core.trace,
+ org.eclipse.tracecompass.internal.analysis.os.linux.core;x-internal:=true
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2015 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties,\
+ plugin.xml
+src.includes = about.html
+additional.bundles = org.eclipse.jdt.annotation
+jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
--- /dev/null
+###############################################################################
+# Copyright (c) 2015 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+
+Bundle-Vendor = Eclipse Trace Compass
+Bundle-Name = Trace Compass Linux Kernel Analysis Core Plug-in
+
+tracetype.type.kernel = Linux Kernel Trace
+analysis.linuxkernel = Linux Kernel Analysis
+
+analysis.cpuusage = CPU usage
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.linuxtools.tmf.core.analysis">
+ <module
+ analysis_module="org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis"
+ automatic="true"
+ id="org.eclipse.tracecompass.analysis.os.linux.kernel"
+ name="%analysis.linuxkernel">
+ <tracetype
+ applies="true"
+ class="org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace">
+ </tracetype>
+ </module>
+ <module
+ analysis_module="org.eclipse.tracecompass.analysis.os.linux.core.cpuusage.KernelCpuUsageAnalysis"
+ automatic="false"
+ id="org.eclipse.tracecompass.analysis.os.linux.cpuusage"
+ name="%analysis.cpuusage">
+ <tracetype
+ applies="true"
+ class="org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace">
+ </tracetype>
+ </module>
+ </extension>
+</plugin>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>org.eclipse.tracecompass</artifactId>
+ <groupId>org.eclipse.tracecompass</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.tracecompass.analysis.os.linux.core</artifactId>
+ <groupId>org.eclipse.tracecompass</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Trace Compass Linux Kernel Analysis Core Plug-in</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.cpuusage;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
+import org.eclipse.tracecompass.internal.analysis.os.linux.core.Activator;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
+import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
+
+/**
+ * This analysis module computes the CPU usage of a system from a kernel trace.
+ * It requires the LTTng Kernel analysis module to have accurate CPU usage data.
+ *
+ * @author Geneviève Bastien
+ */
+public class KernelCpuUsageAnalysis extends TmfStateSystemAnalysisModule {
+
+ /** The ID of this analysis */
+ public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.cpuusage"; //$NON-NLS-1$
+
+ /** Text used to identify 'total' entries in the returned maps */
+ public static final String TOTAL = "total"; //$NON-NLS-1$
+ /** String used to separate elements in the returned maps */
+ public static final String SPLIT_STRING = "/"; //$NON-NLS-1$
+ /** Idle process thread ID */
+ public static final String TID_ZERO = "0"; //$NON-NLS-1$
+
+ @Override
+ protected ITmfStateProvider createStateProvider() {
+ ITmfTrace trace = checkNotNull(getTrace());
+ IKernelAnalysisEventLayout layout;
+
+ if (trace instanceof IKernelTrace) {
+ layout = ((IKernelTrace) trace).getKernelEventLayout();
+ } else {
+ /* Fall-back to the base LttngEventLayout */
+ layout = IKernelAnalysisEventLayout.DEFAULT_LAYOUT;
+ }
+
+ return new KernelCpuUsageStateProvider(trace, layout);
+ }
+
+ @Override
+ protected StateSystemBackendType getBackendType() {
+ return StateSystemBackendType.FULL;
+ }
+
+ @Override
+ protected Iterable<IAnalysisModule> getDependentAnalyses() {
+ Set<IAnalysisModule> modules = new HashSet<>();
+
+ ITmfTrace trace = getTrace();
+ if (trace == null) {
+ throw new IllegalStateException();
+ }
+ /*
+ * This analysis depends on the LTTng kernel analysis, so it's added to
+ * dependent modules.
+ */
+ Iterable<KernelAnalysis> kernelModules = TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysis.class);
+ for (KernelAnalysis kernelModule : kernelModules) {
+ /* Only add the first one we find, if there is one */
+ modules.add(kernelModule);
+ break;
+ }
+ return modules;
+ }
+
+ /**
+ * Get a map of time spent on CPU by various threads during a time range.
+ *
+ * @param start
+ * Start time of requested range
+ * @param end
+ * End time of requested range
+ * @return A map of TID -> time spent on CPU in the [start, end] interval
+ */
+ public Map<String, Long> getCpuUsageInRange(long start, long end) {
+ Map<String, Long> map = new HashMap<>();
+ Map<String, Long> totalMap = new HashMap<>();
+
+ ITmfTrace trace = getTrace();
+ ITmfStateSystem cpuSs = getStateSystem();
+ if (trace == null || cpuSs == null) {
+ return map;
+ }
+ ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystemByModuleClass(trace, KernelAnalysis.class);
+ if (kernelSs == null) {
+ return map;
+ }
+
+ /*
+ * Make sure the start/end times are within the state history, so we
+ * don't get TimeRange exceptions.
+ */
+ long startTime = Math.max(start, cpuSs.getStartTime());
+ startTime = Math.max(startTime, kernelSs.getStartTime());
+ long endTime = Math.min(end, cpuSs.getCurrentEndTime());
+ endTime = Math.min(endTime, kernelSs.getCurrentEndTime());
+ long totalTime = 0;
+ if (endTime < startTime) {
+ return map;
+ }
+
+ try {
+ /* Get the list of quarks for each CPU and CPU's TIDs */
+ int cpusNode = cpuSs.getQuarkAbsolute(Attributes.CPUS);
+ Map<Integer, List<Integer>> tidsPerCpu = new HashMap<>();
+ for (int cpuNode : cpuSs.getSubAttributes(cpusNode, false)) {
+ tidsPerCpu.put(cpuNode, cpuSs.getSubAttributes(cpuNode, false));
+ }
+
+ /* Query full states at start and end times */
+ List<ITmfStateInterval> kernelEndState = kernelSs.queryFullState(endTime);
+ List<ITmfStateInterval> endState = cpuSs.queryFullState(endTime);
+ List<ITmfStateInterval> kernelStartState = kernelSs.queryFullState(startTime);
+ List<ITmfStateInterval> startState = cpuSs.queryFullState(startTime);
+
+ long countAtStart, countAtEnd;
+
+ for (Entry<Integer, List<Integer>> entry : tidsPerCpu.entrySet()) {
+ int cpuNode = entry.getKey();
+ List<Integer> tidNodes = entry.getValue();
+
+ String curCpuName = cpuSs.getAttributeName(cpuNode);
+ long cpuTotal = 0;
+
+ /* Get the quark of the thread running on this CPU */
+ int currentThreadQuark = kernelSs.getQuarkAbsolute(Attributes.CPUS, curCpuName, Attributes.CURRENT_THREAD);
+ /* Get the currently running thread on this CPU */
+ int startThread = kernelStartState.get(currentThreadQuark).getStateValue().unboxInt();
+ int endThread = kernelEndState.get(currentThreadQuark).getStateValue().unboxInt();
+
+ for (int tidNode : tidNodes) {
+ String curTidName = cpuSs.getAttributeName(tidNode);
+ if (curTidName == null) {
+ continue;
+ }
+ int tid = Integer.parseInt(curTidName);
+
+ countAtEnd = endState.get(tidNode).getStateValue().unboxLong();
+ countAtStart = startState.get(tidNode).getStateValue().unboxLong();
+ if (countAtStart == -1) {
+ countAtStart = 0;
+ }
+ if (countAtEnd == -1) {
+ countAtEnd = 0;
+ }
+
+ /*
+ * Interpolate start and end time of threads running at
+ * those times
+ */
+ if (tid == startThread || startThread == -1) {
+ long runningTime = kernelStartState.get(currentThreadQuark).getEndTime() - kernelStartState.get(currentThreadQuark).getStartTime();
+ long runningEnd = kernelStartState.get(currentThreadQuark).getEndTime();
+
+ countAtStart = interpolateCount(countAtStart, startTime, runningEnd, runningTime);
+ }
+ if (tid == endThread) {
+ long runningTime = kernelEndState.get(currentThreadQuark).getEndTime() - kernelEndState.get(currentThreadQuark).getStartTime();
+ long runningEnd = kernelEndState.get(currentThreadQuark).getEndTime();
+
+ countAtEnd = interpolateCount(countAtEnd, endTime, runningEnd, runningTime);
+ }
+ /*
+ * If startThread is -1, we made the hypothesis that the
+ * process running at start was the current one. If the
+ * count is negative, we were wrong in this hypothesis. Also
+ * if the time at end is 0, it either means the process
+ * hasn't been on the CPU or that we still don't know who is
+ * running. In both cases, that invalidates the hypothesis.
+ */
+ if ((startThread == -1) && ((countAtEnd - countAtStart < 0) || (countAtEnd == 0))) {
+ countAtStart = 0;
+ }
+
+ long currentCount = countAtEnd - countAtStart;
+ if (currentCount < 0) {
+ Activator.getDefault().logWarning(checkNotNull(String.format("Negative count: start %d, end %d", countAtStart, countAtEnd))); //$NON-NLS-1$
+ currentCount = 0;
+ } else if (currentCount > endTime - startTime) {
+ Activator.getDefault().logWarning(checkNotNull(String.format("CPU Usage: Spent more time on CPU than allowed: %s spent %d when max should be %d", curTidName, currentCount, endTime - startTime))); //$NON-NLS-1$
+ currentCount = 0;
+ }
+ cpuTotal += currentCount;
+ map.put(curCpuName + SPLIT_STRING + curTidName, currentCount);
+ addToMap(totalMap, curTidName, currentCount);
+ totalTime += (currentCount);
+ }
+ map.put(curCpuName, cpuTotal);
+ }
+
+ /* Add the totals to the map */
+ for (Entry<String, Long> entry : totalMap.entrySet()) {
+ map.put(TOTAL + SPLIT_STRING + entry.getKey(), entry.getValue());
+ }
+ map.put(TOTAL, totalTime);
+
+ } catch (TimeRangeException | AttributeNotFoundException e) {
+ /*
+ * Assume there is no events or the attribute does not exist yet,
+ * nothing will be put in the map.
+ */
+ } catch (StateValueTypeException | StateSystemDisposedException e) {
+ /*
+ * These other exception types would show a logic problem, so they
+ * should not happen.
+ */
+ Activator.getDefault().logError("Error getting CPU usage in a time range", e); //$NON-NLS-1$
+ }
+
+ return map;
+ }
+
+ private static long interpolateCount(long count, long ts, long runningEnd, long runningTime) {
+ long newCount = count;
+
+ /* sanity check */
+ if (runningTime > 0) {
+
+ long runningStart = runningEnd - runningTime;
+
+ if (ts < runningStart) {
+ /*
+ * This interval was not started, this can happen if the current
+ * running thread is unknown and we execute this method. It just
+ * means that this process was not the one running
+ */
+ return newCount;
+ }
+ newCount += (ts - runningStart);
+ }
+ return newCount;
+ }
+
+ /*
+ * Add the value to the previous value in the map. If the key was not set,
+ * assume 0
+ */
+ private static void addToMap(Map<String, Long> map, String key, Long value) {
+ Long addTo = map.get(key);
+ if (addTo == null) {
+ map.put(key, value);
+ } else {
+ map.put(key, addTo + value);
+ }
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * François Rajotte - Initial API and implementation
+ * Geneviève Bastien - Revision of the initial implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.cpuusage;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
+import org.eclipse.tracecompass.internal.analysis.os.linux.core.Activator;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
+import org.eclipse.tracecompass.tmf.core.event.aspect.TmfCpuAspect;
+import org.eclipse.tracecompass.tmf.core.statesystem.AbstractTmfStateProvider;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
+
+/**
+ * Creates a state system with the total time spent on CPU for each thread and
+ * for each CPU from a kernel trace.
+ *
+ * This state system in itself keeps the total time on CPU since last time the
+ * process was scheduled out. The state system queries will only be accurate
+ * when the process is not in a running state. To have exact CPU usage when
+ * running, this state system needs to be used along the LTTng Kernel analysis.
+ *
+ * It requires only the 'sched_switch' events enabled on the trace.
+ *
+ * @author François Rajotte
+ */
+public class KernelCpuUsageStateProvider extends AbstractTmfStateProvider {
+
+ private static final int VERSION = 2;
+
+ /* For each CPU, maps the last time a thread was scheduled in */
+ private final Map<Integer, Long> fLastStartTimes = new HashMap<>();
+ private final long fTraceStart;
+ private final IKernelAnalysisEventLayout fLayout;
+
+ /**
+ * Constructor
+ *
+ * @param trace
+ * The trace from which to get the CPU usage
+ * @param layout
+ * The event layout to use for this state provider.
+ */
+ public KernelCpuUsageStateProvider(ITmfTrace trace, IKernelAnalysisEventLayout layout) {
+ super(trace, ITmfEvent.class, "Kernel CPU usage"); //$NON-NLS-1$
+ fTraceStart = trace.getStartTime().getValue();
+ fLayout = layout;
+ }
+
+ // ------------------------------------------------------------------------
+ // ITmfStateProvider
+ // ------------------------------------------------------------------------
+
+ @Override
+ public int getVersion() {
+ return VERSION;
+ }
+
+ @Override
+ public KernelCpuUsageStateProvider getNewInstance() {
+ return new KernelCpuUsageStateProvider(this.getTrace(), this.fLayout);
+ }
+
+ @Override
+ protected void eventHandle(@Nullable ITmfEvent event) {
+ if (event == null) {
+ return;
+ }
+ final String eventName = event.getType().getName();
+
+ if (eventName.equals(fLayout.eventSchedSwitch())) {
+ Integer cpu = null;
+ Iterable<TmfCpuAspect> aspects = TmfTraceUtils.getEventAspectsOfClass(event.getTrace(), TmfCpuAspect.class);
+ for (TmfCpuAspect aspect : aspects) {
+ cpu = aspect.resolve(event);
+ if (cpu != null) {
+ break;
+ }
+ }
+ if (cpu == null) {
+ /* We couldn't find any CPU information, ignore this event */
+ return;
+ }
+
+ /*
+ * Fields: string prev_comm, int32 prev_tid, int32 prev_prio, int64
+ * prev_state, string next_comm, int32 next_tid, int32 next_prio
+ */
+ ITmfEventField content = event.getContent();
+ long ts = event.getTimestamp().getValue();
+
+ Long prevTid = (Long) content.getField(fLayout.fieldPrevTid()).getValue();
+
+ try {
+ final ITmfStateSystemBuilder ss = checkNotNull(getStateSystemBuilder());
+
+ Integer currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(ss), cpu.toString());
+
+ /*
+ * This quark contains the value of the cumulative time spent on
+ * the source CPU by the currently running thread
+ */
+ Integer cumulativeTimeQuark = ss.getQuarkRelativeAndAdd(currentCPUNode, prevTid.toString());
+ Long startTime = fLastStartTimes.get(cpu);
+ /*
+ * If start time is null, we haven't seen the start of the
+ * process, so we assume beginning of the trace
+ */
+ if (startTime == null) {
+ startTime = fTraceStart;
+ }
+
+ /*
+ * We add the time from startTime until now to the cumulative
+ * time of the thread
+ */
+ if (startTime != null) {
+ ITmfStateValue value = ss.queryOngoingState(cumulativeTimeQuark);
+
+ /*
+ * Modify cumulative time for this CPU/TID combo: The total
+ * time changes when the process is scheduled out. Nothing
+ * happens when the process is scheduled in.
+ */
+ long prevCumulativeTime = Math.max(0, value.unboxLong());
+ long newCumulativeTime = prevCumulativeTime + (ts - startTime);
+
+ value = TmfStateValue.newValueLong(newCumulativeTime);
+ ss.modifyAttribute(ts, value, cumulativeTimeQuark);
+ fLastStartTimes.put(cpu, ts);
+ }
+ } catch (AttributeNotFoundException e) {
+ Activator.getDefault().logError("Attribute not found in LttngKernelCpuStateProvider", e); //$NON-NLS-1$
+ }
+
+ }
+ }
+
+ /* Shortcut for the "current CPU" attribute node */
+ private static int getNodeCPUs(ITmfStateSystemBuilder ssb) {
+ return ssb.getQuarkAbsoluteAndAdd(Attributes.CPUS);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson - Initial API and implementation
+ *******************************************************************************/
+
+@org.eclipse.jdt.annotation.NonNullByDefault
+package org.eclipse.tracecompass.analysis.os.linux.core.cpuusage;
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexandre Montplaisir - Initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis;
+
+/**
+ * This file defines all the attribute names used in the handler. Both the
+ * construction and query steps should use them.
+ *
+ * These should not be externalized! The values here are used as-is in the
+ * history file on disk, so they should be kept the same to keep the file format
+ * compatible. If a view shows attribute names directly, the localization should
+ * be done on the viewer side.
+ *
+ * @author alexmont
+ *
+ */
+@SuppressWarnings({"nls", "javadoc"})
+public interface Attributes {
+
+ /* First-level attributes */
+ static final String CPUS = "CPUs";
+ static final String THREADS = "Threads";
+ static final String RESOURCES = "Resources";
+
+ /* Sub-attributes of the CPU nodes */
+ static final String CURRENT_THREAD = "Current_thread";
+ static final String STATUS = "Status";
+
+ /* Sub-attributes of the Thread nodes */
+ static final String PPID = "PPID";
+ //static final String STATUS = "Status"
+ static final String EXEC_NAME = "Exec_name";
+ static final String SYSTEM_CALL = "System_call";
+
+ /* Attributes under "Resources" */
+ static final String IRQS = "IRQs";
+ static final String SOFT_IRQS = "Soft_IRQs";
+
+ /* Misc stuff */
+ static final String UNKNOWN = "Unknown";
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2013, 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ * Mathieu Rail - Provide the requirements of the analysis
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
+import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement;
+import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
+import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+
+/**
+ * State System Module for lttng kernel traces
+ *
+ * @author Geneviève Bastien
+ */
+public class KernelAnalysis extends TmfStateSystemAnalysisModule {
+
+ /**
+ * The file name of the History Tree
+ */
+ public static final String HISTORY_TREE_FILE_NAME = "stateHistory.ht"; //$NON-NLS-1$
+
+ /** The ID of this analysis module */
+ public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.kernel"; //$NON-NLS-1$
+
+ /*
+ * TODO: Decide which events should be mandatory for the analysis, once the
+ * appropriate error messages and session setup are in place.
+ */
+// private static final ImmutableSet<String> REQUIRED_EVENTS = ImmutableSet.of();
+//
+// private static final ImmutableSet<String> OPTIONAL_EVENTS = ImmutableSet.of(
+ // FIXME These cannot be declared statically anymore, they depend on
+ // the OriginTracer of the kernel trace.
+ // LttngStrings.EXIT_SYSCALL,
+ // LttngStrings.IRQ_HANDLER_ENTRY,
+ // LttngStrings.IRQ_HANDLER_EXIT,
+ // LttngStrings.SOFTIRQ_ENTRY,
+ // LttngStrings.SOFTIRQ_EXIT,
+ // LttngStrings.SOFTIRQ_RAISE,
+ // LttngStrings.SCHED_PROCESS_FORK,
+ // LttngStrings.SCHED_PROCESS_EXIT,
+ // LttngStrings.SCHED_PROCESS_FREE,
+ // LttngStrings.SCHED_SWITCH,
+ // LttngStrings.STATEDUMP_PROCESS_STATE,
+ // LttngStrings.SCHED_WAKEUP,
+ // LttngStrings.SCHED_WAKEUP_NEW,
+ //
+ // /* FIXME Add the prefix for syscalls */
+ // LttngStrings.SYSCALL_PREFIX
+ // );
+
+ /** The requirements as an immutable set */
+ private static final Set<TmfAnalysisRequirement> REQUIREMENTS;
+
+ static {
+// /* initialize the requirement: domain and events */
+// TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN);
+// domainReq.addValue(SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL, ValuePriorityLevel.MANDATORY);
+//
+// TmfAnalysisRequirement eventReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT, REQUIRED_EVENTS, ValuePriorityLevel.MANDATORY);
+// eventReq.addValues(OPTIONAL_EVENTS, ValuePriorityLevel.OPTIONAL);
+//
+// REQUIREMENTS = checkNotNull(ImmutableSet.of(domainReq, eventReq));
+ REQUIREMENTS = checkNotNull(Collections.EMPTY_SET);
+ }
+
+ @Override
+ protected @NonNull ITmfStateProvider createStateProvider() {
+ ITmfTrace trace = checkNotNull(getTrace());
+ IKernelAnalysisEventLayout layout;
+
+ if (trace instanceof IKernelTrace) {
+ layout = ((IKernelTrace) trace).getKernelEventLayout();
+ } else {
+ /* Fall-back to the base LttngEventLayout */
+ layout = IKernelAnalysisEventLayout.DEFAULT_LAYOUT;
+ }
+
+ return new KernelStateProvider(trace, layout);
+ }
+
+ @Override
+ @NonNull
+ protected String getSsFileName() {
+ return HISTORY_TREE_FILE_NAME;
+ }
+
+ @Override
+ protected String getFullHelpText() {
+ return NonNullUtils.nullToEmptyString(Messages.LttngKernelAnalysisModule_Help);
+ }
+
+ @Override
+ public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() {
+ return REQUIREMENTS;
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2010, 2011 École Polytechnique de Montréal
+ * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import java.util.Map;
+
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
+import org.eclipse.tracecompass.tmf.core.event.aspect.TmfCpuAspect;
+import org.eclipse.tracecompass.tmf.core.statesystem.AbstractTmfStateProvider;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
+
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * This is the state change input plugin for TMF's state system which handles
+ * the LTTng 2.0 kernel traces in CTF format.
+ *
+ * It uses the reference handler defined in CTFKernelHandler.java.
+ *
+ * @author alexmont
+ *
+ */
+public class KernelStateProvider extends AbstractTmfStateProvider {
+
+ // ------------------------------------------------------------------------
+ // Static fields
+ // ------------------------------------------------------------------------
+
+ /**
+ * Version number of this state provider. Please bump this if you modify the
+ * contents of the generated state history in some way.
+ */
+ private static final int VERSION = 5;
+
+ private static final int IRQ_HANDLER_ENTRY_INDEX = 1;
+ private static final int IRQ_HANDLER_EXIT_INDEX = 2;
+ private static final int SOFT_IRQ_ENTRY_INDEX = 3;
+ private static final int SOFT_IRQ_EXIT_INDEX = 4;
+ private static final int SOFT_IRQ_RAISE_INDEX = 5;
+ private static final int SCHED_SWITCH_INDEX = 6;
+ private static final int SCHED_PROCESS_FORK_INDEX = 7;
+ private static final int SCHED_PROCESS_EXIT_INDEX = 8;
+ private static final int SCHED_PROCESS_FREE_INDEX = 9;
+ private static final int STATEDUMP_PROCESS_STATE_INDEX = 10;
+ private static final int SCHED_WAKEUP_INDEX = 11;
+
+
+ // ------------------------------------------------------------------------
+ // Fields
+ // ------------------------------------------------------------------------
+
+ private final Map<String, Integer> fEventNames;
+ private final IKernelAnalysisEventLayout fLayout;
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Instantiate a new state provider plugin.
+ *
+ * @param trace
+ * The LTTng 2.0 kernel trace directory
+ * @param layout
+ * The event layout to use for this state provider. Usually
+ * depending on the tracer implementation.
+ */
+ public KernelStateProvider(ITmfTrace trace, IKernelAnalysisEventLayout layout) {
+ super(trace, ITmfEvent.class, "Kernel"); //$NON-NLS-1$
+ fLayout = layout;
+ fEventNames = buildEventNames(layout);
+ }
+
+ // ------------------------------------------------------------------------
+ // Event names management
+ // ------------------------------------------------------------------------
+
+ private static Map<String, Integer> buildEventNames(IKernelAnalysisEventLayout layout) {
+ ImmutableMap.Builder<String, Integer> builder = ImmutableMap.builder();
+
+ builder.put(layout.eventIrqHandlerEntry(), IRQ_HANDLER_ENTRY_INDEX);
+ builder.put(layout.eventIrqHandlerExit(), IRQ_HANDLER_EXIT_INDEX);
+ builder.put(layout.eventSoftIrqEntry(), SOFT_IRQ_ENTRY_INDEX);
+ builder.put(layout.eventSoftIrqExit(), SOFT_IRQ_EXIT_INDEX);
+ builder.put(layout.eventSoftIrqRaise(), SOFT_IRQ_RAISE_INDEX);
+ builder.put(layout.eventSchedSwitch(), SCHED_SWITCH_INDEX);
+ builder.put(layout.eventSchedProcessFork(), SCHED_PROCESS_FORK_INDEX);
+ builder.put(layout.eventSchedProcessExit(), SCHED_PROCESS_EXIT_INDEX);
+ builder.put(layout.eventSchedProcessFree(), SCHED_PROCESS_FREE_INDEX);
+
+ if (layout.eventStatedumpProcessState() != null) {
+ builder.put(layout.eventStatedumpProcessState(), STATEDUMP_PROCESS_STATE_INDEX);
+ }
+
+ for (String eventSchedWakeup : layout.eventsSchedWakeup()) {
+ builder.put(eventSchedWakeup, SCHED_WAKEUP_INDEX);
+ }
+
+ return checkNotNull(builder.build());
+ }
+
+ // ------------------------------------------------------------------------
+ // IStateChangeInput
+ // ------------------------------------------------------------------------
+
+ @Override
+ public int getVersion() {
+ return VERSION;
+ }
+
+ @Override
+ public void assignTargetStateSystem(ITmfStateSystemBuilder ssb) {
+ /* We can only set up the locations once the state system is assigned */
+ super.assignTargetStateSystem(ssb);
+ }
+
+ @Override
+ public KernelStateProvider getNewInstance() {
+ return new KernelStateProvider(this.getTrace(), fLayout);
+ }
+
+ @Override
+ protected void eventHandle(@Nullable ITmfEvent event) {
+ if (event == null) {
+ return;
+ }
+
+ Integer cpu = null;
+ Iterable<TmfCpuAspect> aspects = TmfTraceUtils.getEventAspectsOfClass(event.getTrace(), TmfCpuAspect.class);
+ for (TmfCpuAspect aspect : aspects) {
+ cpu = aspect.resolve(event);
+ if (cpu != null) {
+ break;
+ }
+ }
+ if (cpu == null) {
+ /* We couldn't find any CPU information, ignore this event */
+ return;
+ }
+
+ final String eventName = event.getType().getName();
+ final long ts = event.getTimestamp().getValue();
+
+ try {
+ final ITmfStateSystemBuilder ss = checkNotNull(getStateSystemBuilder());
+
+ /* Shortcut for the "current CPU" attribute node */
+ final int currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(ss), cpu.toString());
+
+ /*
+ * Shortcut for the "current thread" attribute node. It requires
+ * querying the current CPU's current thread.
+ */
+ int quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.CURRENT_THREAD);
+ ITmfStateValue value = ss.queryOngoingState(quark);
+ int thread = value.isNull() ? -1 : value.unboxInt();
+ final int currentThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), String.valueOf(thread));
+
+ /*
+ * Feed event to the history system if it's known to cause a state
+ * transition.
+ */
+ Integer idx = fEventNames.get(eventName);
+ int intval = (idx == null ? -1 : idx.intValue());
+ switch (intval) {
+
+ case IRQ_HANDLER_ENTRY_INDEX:
+ {
+ Integer irqId = ((Long) event.getContent().getField(fLayout.fieldIrq()).getValue()).intValue();
+
+ /* Mark this IRQ as active in the resource tree.
+ * The state value = the CPU on which this IRQ is sitting */
+ quark = ss.getQuarkRelativeAndAdd(getNodeIRQs(ss), irqId.toString());
+ value = TmfStateValue.newValueInt(cpu.intValue());
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Change the status of the running process to interrupted */
+ quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
+ value = StateValues.PROCESS_STATUS_INTERRUPTED_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Change the status of the CPU to interrupted */
+ quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
+ value = StateValues.CPU_STATUS_IRQ_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+ }
+ break;
+
+ case IRQ_HANDLER_EXIT_INDEX:
+ {
+ Integer irqId = ((Long) event.getContent().getField(fLayout.fieldIrq()).getValue()).intValue();
+
+ /* Put this IRQ back to inactive in the resource tree */
+ quark = ss.getQuarkRelativeAndAdd(getNodeIRQs(ss), irqId.toString());
+ value = TmfStateValue.nullValue();
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Set the previous process back to running */
+ setProcessToRunning(ss, ts, currentThreadNode);
+
+ /* Set the CPU status back to running or "idle" */
+ cpuExitInterrupt(ss, ts, currentCPUNode, currentThreadNode);
+ }
+ break;
+
+ case SOFT_IRQ_ENTRY_INDEX:
+ {
+ Integer softIrqId = ((Long) event.getContent().getField(fLayout.fieldVec()).getValue()).intValue();
+
+ /* Mark this SoftIRQ as active in the resource tree.
+ * The state value = the CPU on which this SoftIRQ is processed */
+ quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(ss), softIrqId.toString());
+ value = TmfStateValue.newValueInt(cpu.intValue());
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Change the status of the running process to interrupted */
+ quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
+ value = StateValues.PROCESS_STATUS_INTERRUPTED_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Change the status of the CPU to interrupted */
+ quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
+ value = StateValues.CPU_STATUS_SOFTIRQ_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+ }
+ break;
+
+ case SOFT_IRQ_EXIT_INDEX:
+ {
+ Integer softIrqId = ((Long) event.getContent().getField(fLayout.fieldVec()).getValue()).intValue();
+
+ /* Put this SoftIRQ back to inactive (= -1) in the resource tree */
+ quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(ss), softIrqId.toString());
+ value = TmfStateValue.nullValue();
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Set the previous process back to running */
+ setProcessToRunning(ss, ts, currentThreadNode);
+
+ /* Set the CPU status back to "busy" or "idle" */
+ cpuExitInterrupt(ss, ts, currentCPUNode, currentThreadNode);
+ }
+ break;
+
+ case SOFT_IRQ_RAISE_INDEX:
+ /* Fields: int32 vec */
+ {
+ Integer softIrqId = ((Long) event.getContent().getField(fLayout.fieldVec()).getValue()).intValue();
+
+ /* Mark this SoftIRQ as *raised* in the resource tree.
+ * State value = -2 */
+ quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(ss), softIrqId.toString());
+ value = StateValues.SOFT_IRQ_RAISED_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+ }
+ break;
+
+ case SCHED_SWITCH_INDEX:
+ {
+ ITmfEventField content = event.getContent();
+ Integer prevTid = ((Long) content.getField(fLayout.fieldPrevTid()).getValue()).intValue();
+ Long prevState = (Long) content.getField(fLayout.fieldPrevState()).getValue();
+ String nextProcessName = (String) content.getField(fLayout.fieldNextComm()).getValue();
+ Integer nextTid = ((Long) content.getField(fLayout.fieldNextTid()).getValue()).intValue();
+
+ Integer formerThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), prevTid.toString());
+ Integer newCurrentThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), nextTid.toString());
+
+ /* Set the status of the process that got scheduled out. */
+ quark = ss.getQuarkRelativeAndAdd(formerThreadNode, Attributes.STATUS);
+ if (prevState != 0) {
+ value = StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE;
+ } else {
+ value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
+ }
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Set the status of the new scheduled process */
+ setProcessToRunning(ss, ts, newCurrentThreadNode);
+
+ /* Set the exec name of the new process */
+ quark = ss.getQuarkRelativeAndAdd(newCurrentThreadNode, Attributes.EXEC_NAME);
+ value = TmfStateValue.newValueString(nextProcessName);
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Make sure the PPID and system_call sub-attributes exist */
+ ss.getQuarkRelativeAndAdd(newCurrentThreadNode, Attributes.SYSTEM_CALL);
+ ss.getQuarkRelativeAndAdd(newCurrentThreadNode, Attributes.PPID);
+
+ /* Set the current scheduled process on the relevant CPU */
+ quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.CURRENT_THREAD);
+ value = TmfStateValue.newValueInt(nextTid);
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Set the status of the CPU itself */
+ if (nextTid > 0) {
+ /* Check if the entering process is in kernel or user mode */
+ quark = ss.getQuarkRelativeAndAdd(newCurrentThreadNode, Attributes.SYSTEM_CALL);
+ if (ss.queryOngoingState(quark).isNull()) {
+ value = StateValues.CPU_STATUS_RUN_USERMODE_VALUE;
+ } else {
+ value = StateValues.CPU_STATUS_RUN_SYSCALL_VALUE;
+ }
+ } else {
+ value = StateValues.CPU_STATUS_IDLE_VALUE;
+ }
+ quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
+ ss.modifyAttribute(ts, value, quark);
+ }
+ break;
+
+ case SCHED_PROCESS_FORK_INDEX:
+ {
+ ITmfEventField content = event.getContent();
+ // String parentProcessName = (String) event.getFieldValue("parent_comm");
+ String childProcessName = (String) content.getField(fLayout.fieldChildComm()).getValue();
+ // assert ( parentProcessName.equals(childProcessName) );
+
+ Integer parentTid = ((Long) content.getField(fLayout.fieldParentTid()).getValue()).intValue();
+ Integer childTid = ((Long) content.getField(fLayout.fieldChildTid()).getValue()).intValue();
+
+ Integer parentTidNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), parentTid.toString());
+ Integer childTidNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), childTid.toString());
+
+ /* Assign the PPID to the new process */
+ quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.PPID);
+ value = TmfStateValue.newValueInt(parentTid);
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Set the new process' exec_name */
+ quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.EXEC_NAME);
+ value = TmfStateValue.newValueString(childProcessName);
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Set the new process' status */
+ quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.STATUS);
+ value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Set the process' syscall name, to be the same as the parent's */
+ quark = ss.getQuarkRelativeAndAdd(parentTidNode, Attributes.SYSTEM_CALL);
+ value = ss.queryOngoingState(quark);
+ if (value.isNull()) {
+ /*
+ * Maybe we were missing info about the parent? At least we
+ * will set the child right. Let's suppose "sys_clone".
+ */
+ value = TmfStateValue.newValueString(fLayout.eventSyscallEntryPrefix() + IKernelAnalysisEventLayout.INITIAL_SYSCALL_NAME);
+ }
+ quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.SYSTEM_CALL);
+ ss.modifyAttribute(ts, value, quark);
+ }
+ break;
+
+ case SCHED_PROCESS_EXIT_INDEX:
+ break;
+
+ case SCHED_PROCESS_FREE_INDEX:
+ {
+ Integer tid = ((Long) event.getContent().getField(fLayout.fieldTid()).getValue()).intValue();
+ /*
+ * Remove the process and all its sub-attributes from the
+ * current state
+ */
+ quark = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), tid.toString());
+ ss.removeAttribute(ts, quark);
+ }
+ break;
+
+ case STATEDUMP_PROCESS_STATE_INDEX:
+ /* LTTng-specific */
+ {
+ ITmfEventField content = event.getContent();
+ int tid = ((Long) content.getField("tid").getValue()).intValue(); //$NON-NLS-1$
+ int pid = ((Long) content.getField("pid").getValue()).intValue(); //$NON-NLS-1$
+ int ppid = ((Long) content.getField("ppid").getValue()).intValue(); //$NON-NLS-1$
+ int status = ((Long) content.getField("status").getValue()).intValue(); //$NON-NLS-1$
+ String name = (String) content.getField("name").getValue(); //$NON-NLS-1$
+ /*
+ * "mode" could be interesting too, but it doesn't seem to be
+ * populated with anything relevant for now.
+ */
+
+ int curThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), String.valueOf(tid));
+
+ /* Set the process' name */
+ quark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.EXEC_NAME);
+ if (ss.queryOngoingState(quark).isNull()) {
+ /* If the value didn't exist previously, set it */
+ value = TmfStateValue.newValueString(name);
+ ss.modifyAttribute(ts, value, quark);
+ }
+
+ /* Set the process' PPID */
+ quark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.PPID);
+ if (ss.queryOngoingState(quark).isNull()) {
+ if (pid == tid) {
+ /* We have a process. Use the 'PPID' field. */
+ value = TmfStateValue.newValueInt(ppid);
+ } else {
+ /* We have a thread, use the 'PID' field for the parent. */
+ value = TmfStateValue.newValueInt(pid);
+ }
+ ss.modifyAttribute(ts, value, quark);
+ }
+
+ /* Set the process' status */
+ quark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.STATUS);
+ if (ss.queryOngoingState(quark).isNull()) {
+ /* "2" here means "WAIT_FOR_CPU", and "5" "WAIT_BLOCKED" in the LTTng kernel. */
+ if (status == 2) {
+ value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
+ } else if (status == 5) {
+ value = StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE;
+ } else {
+ value = StateValues.PROCESS_STATUS_UNKNOWN_VALUE;
+ }
+ ss.modifyAttribute(ts, value, quark);
+ }
+ }
+ break;
+
+ case SCHED_WAKEUP_INDEX:
+ {
+ final int tid = ((Long) event.getContent().getField(fLayout.fieldTid()).getValue()).intValue();
+ final int threadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), String.valueOf(tid));
+
+ /*
+ * The process indicated in the event's payload is now ready to
+ * run. Assign it to the "wait for cpu" state, but only if it
+ * was not already running.
+ */
+ quark = ss.getQuarkRelativeAndAdd(threadNode, Attributes.STATUS);
+ int status = ss.queryOngoingState(quark).unboxInt();
+
+ if (status != StateValues.PROCESS_STATUS_RUN_SYSCALL &&
+ status != StateValues.PROCESS_STATUS_RUN_USERMODE) {
+ value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+ }
+ }
+ break;
+
+ default:
+ /* Other event types not covered by the main switch */
+ {
+ if (eventName.startsWith(fLayout.eventSyscallEntryPrefix())
+ || eventName.startsWith(fLayout.eventCompatSyscallEntryPrefix())) {
+
+ /* Assign the new system call to the process */
+ quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL);
+ value = TmfStateValue.newValueString(eventName);
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Put the process in system call mode */
+ quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
+ value = StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Put the CPU in system call (kernel) mode */
+ quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
+ value = StateValues.CPU_STATUS_RUN_SYSCALL_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+
+ } else if (eventName.startsWith(fLayout.eventSyscallExitPrefix())) {
+
+ /* Clear the current system call on the process */
+ quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL);
+ value = TmfStateValue.nullValue();
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Put the process' status back to user mode */
+ quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
+ value = StateValues.PROCESS_STATUS_RUN_USERMODE_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+
+ /* Put the CPU's status back to user mode */
+ quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
+ value = StateValues.CPU_STATUS_RUN_USERMODE_VALUE;
+ ss.modifyAttribute(ts, value, quark);
+ }
+
+ }
+ break;
+ } // End of big switch
+
+ } catch (AttributeNotFoundException ae) {
+ /*
+ * This would indicate a problem with the logic of the manager here,
+ * so it shouldn't happen.
+ */
+ ae.printStackTrace();
+
+ } catch (TimeRangeException tre) {
+ /*
+ * This would happen if the events in the trace aren't ordered
+ * chronologically, which should never be the case ...
+ */
+ System.err.println("TimeRangeExcpetion caught in the state system's event manager."); //$NON-NLS-1$
+ System.err.println("Are the events in the trace correctly ordered?"); //$NON-NLS-1$
+ tre.printStackTrace();
+
+ } catch (StateValueTypeException sve) {
+ /*
+ * This would happen if we were trying to push/pop attributes not of
+ * type integer. Which, once again, should never happen.
+ */
+ sve.printStackTrace();
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Convenience methods for commonly-used attribute tree locations
+ // ------------------------------------------------------------------------
+
+ private static int getNodeCPUs(ITmfStateSystemBuilder ssb) {
+ return ssb.getQuarkAbsoluteAndAdd(Attributes.CPUS);
+ }
+
+ private static int getNodeThreads(ITmfStateSystemBuilder ssb) {
+ return ssb.getQuarkAbsoluteAndAdd(Attributes.THREADS);
+ }
+
+ private static int getNodeIRQs(ITmfStateSystemBuilder ssb) {
+ return ssb.getQuarkAbsoluteAndAdd(Attributes.RESOURCES, Attributes.IRQS);
+ }
+
+ private static int getNodeSoftIRQs(ITmfStateSystemBuilder ssb) {
+ return ssb.getQuarkAbsoluteAndAdd(Attributes.RESOURCES, Attributes.SOFT_IRQS);
+ }
+
+ // ------------------------------------------------------------------------
+ // Advanced state-setting methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * When we want to set a process back to a "running" state, first check
+ * its current System_call attribute. If there is a system call active, we
+ * put the process back in the syscall state. If not, we put it back in
+ * user mode state.
+ */
+ private static void setProcessToRunning(ITmfStateSystemBuilder ssb, long ts, int currentThreadNode)
+ throws AttributeNotFoundException, TimeRangeException,
+ StateValueTypeException {
+ int quark;
+ ITmfStateValue value;
+
+ quark = ssb.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL);
+ if (ssb.queryOngoingState(quark).isNull()) {
+ /* We were in user mode before the interruption */
+ value = StateValues.PROCESS_STATUS_RUN_USERMODE_VALUE;
+ } else {
+ /* We were previously in kernel mode */
+ value = StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE;
+ }
+ quark = ssb.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
+ ssb.modifyAttribute(ts, value, quark);
+ }
+
+ /**
+ * Similar logic as above, but to set the CPU's status when it's coming out
+ * of an interruption.
+ */
+ private static void cpuExitInterrupt(ITmfStateSystemBuilder ssb, long ts,
+ int currentCpuNode, int currentThreadNode)
+ throws StateValueTypeException, AttributeNotFoundException,
+ TimeRangeException {
+ int quark;
+ ITmfStateValue value;
+
+ quark = ssb.getQuarkRelativeAndAdd(currentCpuNode, Attributes.CURRENT_THREAD);
+ if (ssb.queryOngoingState(quark).unboxInt() > 0) {
+ /* There was a process on the CPU */
+ quark = ssb.getQuarkRelative(currentThreadNode, Attributes.SYSTEM_CALL);
+ if (ssb.queryOngoingState(quark).isNull()) {
+ /* That process was in user mode */
+ value = StateValues.CPU_STATUS_RUN_USERMODE_VALUE;
+ } else {
+ /* That process was in a system call */
+ value = StateValues.CPU_STATUS_RUN_SYSCALL_VALUE;
+ }
+ } else {
+ /* There was no real process scheduled, CPU was idle */
+ value = StateValues.CPU_STATUS_IDLE_VALUE;
+ }
+ quark = ssb.getQuarkRelativeAndAdd(currentCpuNode, Attributes.STATUS);
+ ssb.modifyAttribute(ts, value, quark);
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+
+/**
+ * Information provider utility class that retrieves thread-related information
+ * from a Linux Kernel Analysis
+ *
+ * @author Geneviève Bastien
+ */
+public final class KernelThreadInformationProvider {
+
+ private KernelThreadInformationProvider() {
+ }
+
+ /**
+ * Get the ID of the thread running on the CPU at time ts
+ *
+ * TODO: This method may later be replaced by an aspect, when the aspect can
+ * resolve to something that is not an event
+ *
+ * @param module
+ * The lttng kernel analysis instance to run this method on
+ * @param cpuId
+ * The CPU number the process is running on
+ * @param ts
+ * The timestamp at which we want the running process
+ * @return The TID of the thread running on CPU cpuId at time ts or
+ * {@code null} if either no thread is running or we do not know.
+ */
+ public static @Nullable Integer getThreadOnCpu(KernelAnalysis module, long cpuId, long ts) {
+ ITmfStateSystem ss = module.getStateSystem();
+ if (ss == null) {
+ return null;
+ }
+ try {
+ int cpuQuark = ss.getQuarkAbsolute(Attributes.CPUS, Long.toString(cpuId), Attributes.CURRENT_THREAD);
+ ITmfStateInterval interval = ss.querySingleState(ts, cpuQuark);
+ ITmfStateValue val = interval.getStateValue();
+ switch (val.getType()) {
+ case INTEGER:
+ return val.unboxInt();
+ case LONG:
+ case DOUBLE:
+ case NULL:
+ case STRING:
+ default:
+ break;
+ }
+ } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) {
+ }
+ return null;
+ }
+
+ /**
+ * Get the TIDs of the threads from an analysis
+ *
+ * @param module
+ * The lttng kernel analysis instance to run this method on
+ * @return The set of TIDs corresponding to the threads
+ */
+ public static Collection<Integer> getThreadIds(KernelAnalysis module) {
+ ITmfStateSystem ss = module.getStateSystem();
+ if (ss == null) {
+ return NonNullUtils.checkNotNull(Collections.EMPTY_SET);
+ }
+ int threadQuark;
+ try {
+ threadQuark = ss.getQuarkAbsolute(Attributes.THREADS);
+ Set<Integer> tids = new TreeSet<>();
+ for (Integer quark : ss.getSubAttributes(threadQuark, false)) {
+ tids.add(Integer.parseInt(ss.getAttributeName(quark)));
+ }
+ return tids;
+ } catch (AttributeNotFoundException e) {
+ }
+ return NonNullUtils.checkNotNull(Collections.EMPTY_SET);
+ }
+
+ /**
+ * Get the parent process ID of a thread
+ *
+ * @param module
+ * The lttng kernel analysis instance to run this method on
+ * @param threadId
+ * The thread ID of the process for which to get the parent
+ * @param ts
+ * The timestamp at which to get the parent
+ * @return The parent PID or {@code null} if the PPID is not found.
+ */
+ public static @Nullable Integer getParentPid(KernelAnalysis module, Integer threadId, long ts) {
+ Integer ppid = null;
+ ITmfStateSystem ss = module.getStateSystem();
+ if (ss == null) {
+ return ppid;
+ }
+ Integer ppidNode;
+ try {
+ ppidNode = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.PPID);
+ ITmfStateInterval ppidInterval = ss.querySingleState(ts, ppidNode);
+ ITmfStateValue ppidValue = ppidInterval.getStateValue();
+
+ switch (ppidValue.getType()) {
+ case INTEGER:
+ ppid = NonNullUtils.checkNotNull(Integer.valueOf(ppidValue.unboxInt()));
+ break;
+ case DOUBLE:
+ case LONG:
+ case NULL:
+ case STRING:
+ default:
+ break;
+ }
+ } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) {
+ }
+ return ppid;
+ }
+
+ /**
+ * Get the executable name of the thread ID. If the thread ID was used
+ * multiple time or the name changed in between, it will return the last
+ * name the thread has taken, or {@code null} if no name is found
+ *
+ * @param module
+ * The lttng kernel analysis instance to run this method on
+ * @param threadId
+ * The thread ID of the process for which to get the name
+ * @return The last executable name of this process, or {@code null} if not
+ * found
+ */
+ public static @Nullable String getExecutableName(KernelAnalysis module, Integer threadId) {
+ String execName = null;
+ ITmfStateSystem ss = module.getStateSystem();
+ if (ss == null) {
+ return execName;
+ }
+ Integer execNameNode;
+ try {
+ execNameNode = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.EXEC_NAME);
+ List<ITmfStateInterval> execNameIntervals = StateSystemUtils.queryHistoryRange(ss, execNameNode, ss.getStartTime(), ss.getCurrentEndTime());
+
+ ITmfStateValue execNameValue;
+ for (ITmfStateInterval interval : execNameIntervals) {
+ execNameValue = interval.getStateValue();
+ switch (execNameValue.getType()) {
+ case STRING:
+ execName = NonNullUtils.checkNotNull(execNameValue.unboxStr());
+ break;
+ case DOUBLE:
+ case LONG:
+ case NULL:
+ case INTEGER:
+ default:
+ break;
+ }
+ }
+ } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) {
+ }
+ return execName;
+ }
+
+ /**
+ * Get the status intervals for a given thread with a resolution
+ *
+ * @param module
+ * The lttng kernel analysis instance to run this method on
+ * @param threadId
+ * The ID of the thread to get the intervals for
+ * @param start
+ * The start time of the requested range
+ * @param end
+ * The end time of the requested range
+ * @param resolution
+ * The resolution or the minimal time between the requested
+ * intervals. If interval times are smaller than resolution, only
+ * the first interval is returned, the others are ignored.
+ * @param monitor
+ * A progress monitor for this task
+ * @return The list of status intervals for this thread, an empty list is
+ * returned if either the state system is {@code null} or the quark
+ * is not found
+ */
+ public static List<ITmfStateInterval> getStatusIntervalsForThread(KernelAnalysis module, Integer threadId, long start, long end, long resolution, IProgressMonitor monitor) {
+ ITmfStateSystem ss = module.getStateSystem();
+ if (ss == null) {
+ return NonNullUtils.checkNotNull(Collections.EMPTY_LIST);
+ }
+
+ try {
+ int threadQuark = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString());
+ int statusQuark = ss.getQuarkRelative(threadQuark, Attributes.STATUS);
+ List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ss, statusQuark, Math.max(start, ss.getStartTime()), Math.min(end - 1, ss.getCurrentEndTime()), resolution, monitor);
+ return statusIntervals;
+ } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) {
+ }
+ return NonNullUtils.checkNotNull(Collections.EMPTY_LIST);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis;
+
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized message strings from the LTTng Kernel Analysis
+ *
+ * @author Geneviève Bastien
+ */
+@SuppressWarnings("javadoc")
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.tracecompass.lttng2.kernel.core.analysis.messages"; //$NON-NLS-1$
+
+ public static @Nullable String LttngKernelAnalysisModule_Help;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexandre Montplaisir - Initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis;
+
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
+
+/**
+ * State values that are used in the kernel event handler. It's much better to
+ * use integer values whenever possible, since those take much less space in the
+ * history file.
+ *
+ * @author Alexandre Montplaisir
+ */
+@SuppressWarnings("javadoc")
+public interface StateValues {
+
+ /* CPU Status */
+ static final int CPU_STATUS_IDLE = 0;
+ static final int CPU_STATUS_RUN_USERMODE = 1;
+ static final int CPU_STATUS_RUN_SYSCALL = 2;
+ static final int CPU_STATUS_IRQ = 3;
+ static final int CPU_STATUS_SOFTIRQ = 4;
+
+ static final ITmfStateValue CPU_STATUS_IDLE_VALUE = TmfStateValue.newValueInt(CPU_STATUS_IDLE);
+ static final ITmfStateValue CPU_STATUS_RUN_USERMODE_VALUE = TmfStateValue.newValueInt(CPU_STATUS_RUN_USERMODE);
+ static final ITmfStateValue CPU_STATUS_RUN_SYSCALL_VALUE = TmfStateValue.newValueInt(CPU_STATUS_RUN_SYSCALL);
+ static final ITmfStateValue CPU_STATUS_IRQ_VALUE = TmfStateValue.newValueInt(CPU_STATUS_IRQ);
+ static final ITmfStateValue CPU_STATUS_SOFTIRQ_VALUE = TmfStateValue.newValueInt(CPU_STATUS_SOFTIRQ);
+
+ /* Process status */
+ static final int PROCESS_STATUS_UNKNOWN = 0;
+ static final int PROCESS_STATUS_WAIT_BLOCKED = 1;
+ static final int PROCESS_STATUS_RUN_USERMODE = 2;
+ static final int PROCESS_STATUS_RUN_SYSCALL = 3;
+ static final int PROCESS_STATUS_INTERRUPTED = 4;
+ static final int PROCESS_STATUS_WAIT_FOR_CPU = 5;
+
+ static final ITmfStateValue PROCESS_STATUS_UNKNOWN_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_UNKNOWN);
+ static final ITmfStateValue PROCESS_STATUS_WAIT_BLOCKED_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_WAIT_BLOCKED);
+ static final ITmfStateValue PROCESS_STATUS_RUN_USERMODE_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_RUN_USERMODE);
+ static final ITmfStateValue PROCESS_STATUS_RUN_SYSCALL_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_RUN_SYSCALL);
+ static final ITmfStateValue PROCESS_STATUS_INTERRUPTED_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_INTERRUPTED);
+ static final ITmfStateValue PROCESS_STATUS_WAIT_FOR_CPU_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_WAIT_FOR_CPU);
+
+ /* SoftIRQ-specific stuff. -1: null/disabled, >= 0: running on that CPU */
+ static final int SOFT_IRQ_RAISED = -2;
+
+ static final ITmfStateValue SOFT_IRQ_RAISED_VALUE = TmfStateValue.newValueInt(SOFT_IRQ_RAISED);
+}
--- /dev/null
+###############################################################################
+# Copyright (c) 2014 École Polytechnique de Montréal
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Geneviève Bastien - Initial API and implementation
+###############################################################################
+
+LttngKernelAnalysisModule_Help=Builds the LTTng2 kernel state system to populate the Control Flow view and the Resources View
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson - Initial API and implementation
+ *******************************************************************************/
+
+@org.eclipse.jdt.annotation.NonNullByDefault
+package org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis;
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexandre Montplaisir - Initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.trace;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import java.util.Collection;
+
+import org.eclipse.jdt.annotation.NonNull;
+
+import com.google.common.collect.ImmutableList;
+
+/**
+ * A kernel event layout to be used by default. This can be useful for
+ * data-driven traces for example, where they can provide whatever event names
+ * they want.
+ *
+ * Due to historical reasons, the definitions are the same as LTTng event names.
+ *
+ * @author Alexandre Montplaisir
+ */
+public class DefaultEventLayout implements IKernelAnalysisEventLayout{
+
+ /* Event names */
+ private static final String IRQ_HANDLER_ENTRY = "irq_handler_entry"; //$NON-NLS-1$
+ private static final String IRQ_HANDLER_EXIT = "irq_handler_exit"; //$NON-NLS-1$
+ private static final String SOFTIRQ_ENTRY = "softirq_entry"; //$NON-NLS-1$
+ private static final String SOFTIRQ_EXIT = "softirq_exit"; //$NON-NLS-1$
+ private static final String SOFTIRQ_RAISE = "softirq_raise"; //$NON-NLS-1$
+ private static final String SCHED_SWITCH = "sched_switch"; //$NON-NLS-1$
+
+ private static final Collection<String> SCHED_WAKEUP_EVENTS =
+ checkNotNull(ImmutableList.of("sched_wakeup", "sched_wakeup_new")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ private static final String SCHED_PROCESS_FORK = "sched_process_fork"; //$NON-NLS-1$
+ private static final String SCHED_PROCESS_EXIT = "sched_process_exit"; //$NON-NLS-1$
+ private static final String SCHED_PROCESS_FREE = "sched_process_free"; //$NON-NLS-1$
+ private static final String STATEDUMP_PROCESS_STATE = "lttng_statedump_process_state"; //$NON-NLS-1$
+
+ private static final String SYSCALL_ENTRY_PREFIX = "sys_"; //$NON-NLS-1$
+ private static final String COMPAT_SYSCALL_ENTRY_PREFIX = "compat_sys_"; //$NON-NLS-1$
+ private static final String SYSCALL_EXIT_PREFIX = "exit_syscall"; //$NON-NLS-1$
+
+ /* Field names */
+ private static final String IRQ = "irq"; //$NON-NLS-1$
+ private static final String TID = "tid"; //$NON-NLS-1$
+ private static final String VEC = "vec"; //$NON-NLS-1$
+ private static final String PREV_TID = "prev_tid"; //$NON-NLS-1$
+ private static final String PREV_STATE = "prev_state"; //$NON-NLS-1$
+ private static final String NEXT_COMM = "next_comm"; //$NON-NLS-1$
+ private static final String NEXT_TID = "next_tid"; //$NON-NLS-1$
+ private static final String PARENT_TID = "parent_tid"; //$NON-NLS-1$
+ private static final String CHILD_COMM = "child_comm"; //$NON-NLS-1$
+ private static final String CHILD_TID = "child_tid"; //$NON-NLS-1$
+
+ /** All instances are the same. Only provide a static instance getter */
+ private DefaultEventLayout() {
+ }
+
+ /**
+ * The instance of this event layout
+ *
+ * This object is completely immutable, so no need to create additional
+ * instances via the constructor.
+ */
+ static final IKernelAnalysisEventLayout INSTANCE = new DefaultEventLayout();
+
+ // ------------------------------------------------------------------------
+ // Event names
+ // ------------------------------------------------------------------------
+
+ @Override
+ public String eventIrqHandlerEntry() {
+ return IRQ_HANDLER_ENTRY;
+ }
+
+ @Override
+ public String eventIrqHandlerExit() {
+ return IRQ_HANDLER_EXIT;
+ }
+
+ @Override
+ public String eventSoftIrqEntry() {
+ return SOFTIRQ_ENTRY;
+ }
+
+ @Override
+ public String eventSoftIrqExit() {
+ return SOFTIRQ_EXIT;
+ }
+
+ @Override
+ public String eventSoftIrqRaise() {
+ return SOFTIRQ_RAISE;
+ }
+
+ @Override
+ public String eventSchedSwitch() {
+ return SCHED_SWITCH;
+ }
+
+ @Override
+ public Collection<String> eventsSchedWakeup() {
+ return SCHED_WAKEUP_EVENTS;
+ }
+
+ @Override
+ public String eventSchedProcessFork() {
+ return SCHED_PROCESS_FORK;
+ }
+
+ @Override
+ public String eventSchedProcessExit() {
+ return SCHED_PROCESS_EXIT;
+ }
+
+ @Override
+ public String eventSchedProcessFree() {
+ return SCHED_PROCESS_FREE;
+ }
+
+ @Override
+ public @NonNull String eventStatedumpProcessState() {
+ return STATEDUMP_PROCESS_STATE;
+ }
+
+ @Override
+ public String eventSyscallEntryPrefix() {
+ return SYSCALL_ENTRY_PREFIX;
+ }
+
+ @Override
+ public String eventCompatSyscallEntryPrefix() {
+ return COMPAT_SYSCALL_ENTRY_PREFIX;
+ }
+
+ @Override
+ public String eventSyscallExitPrefix() {
+ return SYSCALL_EXIT_PREFIX;
+ }
+
+ // ------------------------------------------------------------------------
+ // Event field names
+ // ------------------------------------------------------------------------
+
+ @Override
+ public String fieldIrq() {
+ return IRQ;
+ }
+
+ @Override
+ public String fieldVec() {
+ return VEC;
+ }
+
+ @Override
+ public String fieldTid() {
+ return TID;
+ }
+
+ @Override
+ public String fieldPrevTid() {
+ return PREV_TID;
+ }
+
+ @Override
+ public String fieldPrevState() {
+ return PREV_STATE;
+ }
+
+ @Override
+ public String fieldNextComm() {
+ return NEXT_COMM;
+ }
+
+ @Override
+ public String fieldNextTid() {
+ return NEXT_TID;
+ }
+
+ @Override
+ public String fieldChildComm() {
+ return CHILD_COMM;
+ }
+
+ @Override
+ public String fieldParentTid() {
+ return PARENT_TID;
+ }
+
+ @Override
+ public String fieldChildTid() {
+ return CHILD_TID;
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexandre Montplaisir - Initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.trace;
+
+import java.util.Collection;
+
+import org.eclipse.jdt.annotation.Nullable;
+
+/**
+ * Interface to define "concepts" present in the Linux kernel (represented by
+ * its tracepoints), that can then be exposed by different tracers under
+ * different names.
+ *
+ * @author Alexandre Montplaisir
+ */
+// The methods are named after the TRACE_EVENT's, should be straightforward
+@SuppressWarnings("javadoc")
+public interface IKernelAnalysisEventLayout {
+
+ // ------------------------------------------------------------------------
+ // Common definitions
+ // ------------------------------------------------------------------------
+
+ IKernelAnalysisEventLayout DEFAULT_LAYOUT = DefaultEventLayout.INSTANCE;
+
+ /**
+ * Whenever a process appears for the first time in a trace, we assume it
+ * starts inside this system call. (The syscall prefix is defined by the
+ * implementer of this interface.)
+ *
+ * TODO Change to a default method with Java 8?
+ */
+ String INITIAL_SYSCALL_NAME = "clone"; //$NON-NLS-1$
+
+ // ------------------------------------------------------------------------
+ // Event names
+ // ------------------------------------------------------------------------
+
+ String eventIrqHandlerEntry();
+ String eventIrqHandlerExit();
+ String eventSoftIrqEntry();
+ String eventSoftIrqExit();
+ String eventSoftIrqRaise();
+ String eventSchedSwitch();
+ Collection<String> eventsSchedWakeup();
+ String eventSchedProcessFork();
+ String eventSchedProcessExit();
+ String eventSchedProcessFree();
+ @Nullable String eventStatedumpProcessState();
+ String eventSyscallEntryPrefix();
+ String eventCompatSyscallEntryPrefix();
+ String eventSyscallExitPrefix();
+
+ // ------------------------------------------------------------------------
+ // Event field names
+ // ------------------------------------------------------------------------
+
+ String fieldIrq();
+ String fieldVec();
+ String fieldTid();
+ String fieldPrevTid();
+ String fieldPrevState();
+ String fieldNextComm();
+ String fieldNextTid();
+ String fieldChildComm();
+ String fieldParentTid();
+ String fieldChildTid();
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexandre Montplaisir - Initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.trace;
+
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+
+/**
+ * Trace type that represents a Linux kernel trace.
+ *
+ * Any trace implementing the interface should be able to run the different
+ * Linux kernel analyses in this plugin.
+ *
+ * @author Alexandre Montplaisir
+ */
+public interface IKernelTrace extends ITmfTrace {
+
+ /**
+ * Get the event layout of this trace. Many known concepts from the Linux
+ * kernel may be exported under different names, depending on the tracer.
+ *
+ * @return The event layout
+ */
+ IKernelAnalysisEventLayout getKernelEventLayout();
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson - Initial API and implementation
+ *******************************************************************************/
+
+@org.eclipse.jdt.annotation.NonNullByDefault
+package org.eclipse.tracecompass.analysis.os.linux.core.trace;
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexandre Montplaisir - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.analysis.os.linux.core;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.annotation.Nullable;
+import org.osgi.framework.BundleContext;
+
+/**
+ * <b><u>Activator</u></b>
+ * <p>
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ /**
+ * The plug-in ID
+ */
+ public static final String PLUGIN_ID = "org.eclipse.tracecompass.analysis.linux.core"; //$NON-NLS-1$
+
+ /**
+ * The shared instance
+ */
+ private static @Nullable Activator fPlugin;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ Activator plugin = fPlugin;
+ if (plugin == null) {
+ throw new IllegalStateException();
+ }
+ return plugin;
+ }
+
+ // ------------------------------------------------------------------------
+ // Operators
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void start(@Nullable BundleContext context) throws Exception {
+ super.start(context);
+ fPlugin = this;
+ }
+
+ @Override
+ public void stop(@Nullable BundleContext context) throws Exception {
+ fPlugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Logs a message with severity INFO in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logInfo(String message) {
+ getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity INFO in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logInfo(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message, exception));
+ }
+
+ /**
+ * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logWarning(String message) {
+ getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logWarning(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message, exception));
+ }
+
+ /**
+ * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logError(String message) {
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logError(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson - Initial API and implementation
+ *******************************************************************************/
+
+@org.eclipse.jdt.annotation.NonNullByDefault
+package org.eclipse.tracecompass.internal.analysis.os.linux.core;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tracecompass.analysis.os.linux.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
--- /dev/null
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=error
+org.eclipse.jdt.core.compiler.problem.deprecation=error
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=error
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=error
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=enabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=error
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=error
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=error
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=250
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
--- /dev/null
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_tmf-style
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
--- /dev/null
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
--- /dev/null
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 0.1.0.qualifier
+Bundle-Localization: plugin
+Bundle-SymbolicName: org.eclipse.tracecompass.analysis.os.linux.ui;singleton:=true
+Bundle-Activator: org.eclipse.tracecompass.internal.analysis.os.linux.ui.Activator
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.core.resources,
+ org.eclipse.core.runtime,
+ org.eclipse.tracecompass.common.core;bundle-version="0.1.0",
+ org.eclipse.tracecompass.analysis.os.linux.core,
+ org.eclipse.tracecompass.tmf.core;bundle-version="0.1.0",
+ org.eclipse.tracecompass.tmf.ui;bundle-version="0.1.0",
+ org.eclipse.tracecompass.tmf.ctf.core;bundle-version="0.1.0"
+Import-Package: com.google.common.collect
+Export-Package: org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow,
+ org.eclipse.tracecompass.analysis.os.linux.ui.views.cpuusage,
+ org.eclipse.tracecompass.analysis.os.linux.ui.views.resources,
+ org.eclipse.tracecompass.internal.analysis.os.linux.ui;x-internal:=true
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2015 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/,\
+ about.html,\
+ plugin.properties
+src.includes = about.html
+additional.bundles = org.eclipse.jdt.annotation
+jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2015 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+
+Bundle-Vendor = Eclipse Trace Compass
+Bundle-Name = Trace Compass Linux Kernel Analysis UI Plug-in
+
+kernel.perspective.name = LTTng Kernel
+
+controlflow.view.name = Control Flow
+resources.view.name = Resources
+cpuusage.view.name = CPU Usage
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ allowMultiple="false"
+ category="org.eclipse.linuxtools.lttng2.ui.views.category"
+ class="org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow.ControlFlowView"
+ icon="icons/eview16/control_flow_view.gif"
+ id="org.eclipse.tracecompass.analysis.os.linux.views.controlflow"
+ name="%controlflow.view.name"
+ restorable="true">
+ </view>
+ <view
+ allowMultiple="false"
+ category="org.eclipse.linuxtools.lttng2.ui.views.category"
+ class="org.eclipse.tracecompass.analysis.os.linux.ui.views.resources.ResourcesView"
+ icon="icons/eview16/resources_view.gif"
+ id="org.eclipse.tracecompass.analysis.os.linux.views.resources"
+ name="%resources.view.name"
+ restorable="true">
+ </view>
+ <view
+ allowMultiple="false"
+ category="org.eclipse.linuxtools.lttng2.ui.views.category"
+ class="org.eclipse.tracecompass.analysis.os.linux.ui.views.cpuusage.CpuUsageView"
+ id="org.eclipse.tracecompass.analysis.os.linux.views.cpuusage"
+ name="%cpuusage.view.name"
+ restorable="true">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.linuxtools.tmf.core.analysis">
+ <output
+ class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
+ id="org.eclipse.tracecompass.analysis.os.linux.views.controlflow">
+ <analysisModuleClass
+ class="org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis">
+ </analysisModuleClass>
+ </output>
+ <output
+ class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
+ id="org.eclipse.tracecompass.analysis.os.linux.views.resources">
+ <analysisModuleClass
+ class="org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis">
+ </analysisModuleClass>
+ </output>
+ <output
+ class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
+ id="org.eclipse.tracecompass.analysis.os.linux.views.cpuusage">
+ <analysisModuleClass
+ class="org.eclipse.tracecompass.analysis.os.linux.core.cpuusage.KernelCpuUsageAnalysis">
+ </analysisModuleClass>
+ </output>
+ </extension>
+</plugin>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>org.eclipse.tracecompass</artifactId>
+ <groupId>org.eclipse.tracecompass</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.tracecompass.analysis.os.linux.ui</artifactId>
+ <groupId>org.eclipse.tracecompass</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Trace Compass Linux Kernel Analysis UI Plug-in</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tasse - Initial API and implementation
+ * Geneviève Bastien - Move code to provide base classes for time graph view
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
+
+/**
+ * An entry in the Control Flow view
+ */
+public class ControlFlowEntry extends TimeGraphEntry {
+
+ private final @NonNull ITmfTrace fTrace;
+ private final int fThreadId;
+ private final int fParentThreadId;
+ private final int fThreadQuark;
+
+ /**
+ * Constructor
+ *
+ * @param quark
+ * The attribute quark matching the thread
+ * @param trace
+ * The trace on which we are working
+ * @param execName
+ * The exec_name of this entry
+ * @param threadId
+ * The TID of the thread
+ * @param parentThreadId
+ * the Parent_TID of this thread
+ * @param startTime
+ * The start time of this process's lifetime
+ * @param endTime
+ * The end time of this process
+ */
+ public ControlFlowEntry(int quark, @NonNull ITmfTrace trace, String execName, int threadId, int parentThreadId, long startTime, long endTime) {
+ super(execName, startTime, endTime);
+ fTrace = trace;
+ fThreadId = threadId;
+ fParentThreadId = parentThreadId;
+ fThreadQuark = quark;
+ }
+
+ /**
+ * Get this entry's thread ID
+ *
+ * @return The TID
+ */
+ public int getThreadId() {
+ return fThreadId;
+ }
+
+ /**
+ * Get the entry's trace
+ *
+ * @return the entry's trace
+ */
+ public @NonNull ITmfTrace getTrace() {
+ return fTrace;
+ }
+
+ /**
+ * Get this thread's parent TID
+ *
+ * @return The "PTID"
+ */
+ public int getParentThreadId() {
+ return fParentThreadId;
+ }
+
+ /**
+ * Get the quark of the attribute matching this thread's TID
+ *
+ * @return The quark
+ */
+ public int getThreadQuark() {
+ return fThreadQuark;
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getSimpleName() + '(' + getName() + '[' + fThreadId + "])"; //$NON-NLS-1$
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tasse - Initial API and implementation
+ * Geneviève Bastien - Move code to provide base classes for time graph view
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.StateValues;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
+import org.eclipse.tracecompass.internal.analysis.os.linux.ui.Activator;
+import org.eclipse.tracecompass.internal.analysis.os.linux.ui.Messages;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.StateItem;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils;
+
+/**
+ * Presentation provider for the control flow view
+ */
+public class ControlFlowPresentationProvider extends TimeGraphPresentationProvider {
+
+ private enum State {
+ UNKNOWN (new RGB(100, 100, 100)),
+ WAIT_BLOCKED (new RGB(200, 200, 0)),
+ WAIT_FOR_CPU (new RGB(200, 100, 0)),
+ USERMODE (new RGB(0, 200, 0)),
+ SYSCALL (new RGB(0, 0, 200)),
+ INTERRUPTED (new RGB(200, 0, 100));
+
+ public final RGB rgb;
+
+ private State(RGB rgb) {
+ this.rgb = rgb;
+ }
+
+ }
+
+ /**
+ * Default constructor
+ */
+ public ControlFlowPresentationProvider() {
+ super(Messages.ControlFlowView_stateTypeName);
+ }
+
+ private static State[] getStateValues() {
+ return State.values();
+ }
+
+ @Override
+ public StateItem[] getStateTable() {
+ State[] states = getStateValues();
+ StateItem[] stateTable = new StateItem[states.length];
+ for (int i = 0; i < stateTable.length; i++) {
+ State state = states[i];
+ stateTable[i] = new StateItem(state.rgb, state.toString());
+ }
+ return stateTable;
+ }
+
+ @Override
+ public int getStateTableIndex(ITimeEvent event) {
+ if (event instanceof TimeEvent && ((TimeEvent) event).hasValue()) {
+ int status = ((TimeEvent) event).getValue();
+ return getMatchingState(status).ordinal();
+ }
+ return TRANSPARENT;
+ }
+
+ @Override
+ public String getEventName(ITimeEvent event) {
+ if (event instanceof TimeEvent) {
+ TimeEvent ev = (TimeEvent) event;
+ if (ev.hasValue()) {
+ return getMatchingState(ev.getValue()).toString();
+ }
+ }
+ return Messages.ControlFlowView_multipleStates;
+ }
+
+ private static State getMatchingState(int status) {
+ switch (status) {
+ case StateValues.PROCESS_STATUS_WAIT_BLOCKED:
+ return State.WAIT_BLOCKED;
+ case StateValues.PROCESS_STATUS_WAIT_FOR_CPU:
+ return State.WAIT_FOR_CPU;
+ case StateValues.PROCESS_STATUS_RUN_USERMODE:
+ return State.USERMODE;
+ case StateValues.PROCESS_STATUS_RUN_SYSCALL:
+ return State.SYSCALL;
+ case StateValues.PROCESS_STATUS_INTERRUPTED:
+ return State.INTERRUPTED;
+ default:
+ return State.UNKNOWN;
+ }
+ }
+
+ @Override
+ public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event) {
+ Map<String, String> retMap = new LinkedHashMap<>();
+ if (!(event instanceof TimeEvent) || !((TimeEvent) event).hasValue() ||
+ !(event.getEntry() instanceof ControlFlowEntry)) {
+ return retMap;
+ }
+ ControlFlowEntry entry = (ControlFlowEntry) event.getEntry();
+ ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), KernelAnalysis.ID);
+ if (ssq == null) {
+ return retMap;
+ }
+ int tid = entry.getThreadId();
+
+ try {
+ // Find every CPU first, then get the current thread
+ int cpusQuark = ssq.getQuarkAbsolute(Attributes.CPUS);
+ List<Integer> cpuQuarks = ssq.getSubAttributes(cpusQuark, false);
+ for (Integer cpuQuark : cpuQuarks) {
+ int currentThreadQuark = ssq.getQuarkRelative(cpuQuark, Attributes.CURRENT_THREAD);
+ ITmfStateInterval interval = ssq.querySingleState(event.getTime(), currentThreadQuark);
+ if (!interval.getStateValue().isNull()) {
+ ITmfStateValue state = interval.getStateValue();
+ int currentThreadId = state.unboxInt();
+ if (tid == currentThreadId) {
+ retMap.put(Messages.ControlFlowView_attributeCpuName, ssq.getAttributeName(cpuQuark));
+ break;
+ }
+ }
+ }
+
+ } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
+ Activator.getDefault().logError("Error in ControlFlowPresentationProvider", e); //$NON-NLS-1$
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ int status = ((TimeEvent) event).getValue();
+ if (status == StateValues.PROCESS_STATUS_RUN_SYSCALL) {
+ try {
+ int syscallQuark = ssq.getQuarkRelative(entry.getThreadQuark(), Attributes.SYSTEM_CALL);
+ ITmfStateInterval value = ssq.querySingleState(event.getTime(), syscallQuark);
+ if (!value.getStateValue().isNull()) {
+ ITmfStateValue state = value.getStateValue();
+ retMap.put(Messages.ControlFlowView_attributeSyscallName, state.toString());
+ }
+
+ } catch (AttributeNotFoundException | TimeRangeException e) {
+ Activator.getDefault().logError("Error in ControlFlowPresentationProvider", e); //$NON-NLS-1$
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ }
+
+ return retMap;
+ }
+
+ @Override
+ public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) {
+ if (bounds.width <= gc.getFontMetrics().getAverageCharWidth()) {
+ return;
+ }
+ if (!(event instanceof TimeEvent)) {
+ return;
+ }
+ ControlFlowEntry entry = (ControlFlowEntry) event.getEntry();
+ ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), KernelAnalysis.ID);
+ if (ss == null) {
+ return;
+ }
+ int status = ((TimeEvent) event).getValue();
+
+ if (status != StateValues.PROCESS_STATUS_RUN_SYSCALL) {
+ return;
+ }
+ try {
+ int syscallQuark = ss.getQuarkRelative(entry.getThreadQuark(), Attributes.SYSTEM_CALL);
+ ITmfStateInterval value = ss.querySingleState(event.getTime(), syscallQuark);
+ if (!value.getStateValue().isNull()) {
+ ITmfStateValue state = value.getStateValue();
+ gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE));
+
+ /*
+ * Remove the "sys_" or "syscall_entry_" or similar from what we
+ * draw in the rectangle. This depends on the trace's event layout.
+ */
+ int beginIndex = 0;
+ ITmfTrace trace = entry.getTrace();
+ if (trace instanceof IKernelTrace) {
+ IKernelAnalysisEventLayout layout = ((IKernelTrace) trace).getKernelEventLayout();
+ beginIndex = layout.eventSyscallEntryPrefix().length();
+ }
+
+ Utils.drawText(gc, state.toString().substring(beginIndex), bounds.x, bounds.y - 2, bounds.width, true, true);
+ }
+ } catch (AttributeNotFoundException | TimeRangeException e) {
+ Activator.getDefault().logError("Error in ControlFlowPresentationProvider", e); //$NON-NLS-1$
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tasse - Initial API and implementation
+ * Geneviève Bastien - Move code to provide base classes for time graph view
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
+import org.eclipse.tracecompass.internal.analysis.os.linux.ui.Activator;
+import org.eclipse.tracecompass.internal.analysis.os.linux.ui.Messages;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
+import org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ILinkEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeLinkEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.Resolution;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat;
+
+/**
+ * The Control Flow view main object
+ *
+ */
+public class ControlFlowView extends AbstractTimeGraphView {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+
+ /**
+ * View ID.
+ */
+ public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.views.controlflow"; //$NON-NLS-1$
+
+ private static final String PROCESS_COLUMN = Messages.ControlFlowView_processColumn;
+ private static final String TID_COLUMN = Messages.ControlFlowView_tidColumn;
+ private static final String PTID_COLUMN = Messages.ControlFlowView_ptidColumn;
+ private static final String BIRTH_TIME_COLUMN = Messages.ControlFlowView_birthTimeColumn;
+ private static final String TRACE_COLUMN = Messages.ControlFlowView_traceColumn;
+
+ private static final String[] COLUMN_NAMES = new String[] {
+ PROCESS_COLUMN,
+ TID_COLUMN,
+ PTID_COLUMN,
+ BIRTH_TIME_COLUMN,
+ TRACE_COLUMN
+ };
+
+ private static final String[] FILTER_COLUMN_NAMES = new String[] {
+ PROCESS_COLUMN,
+ TID_COLUMN
+ };
+
+ // Timeout between updates in the build thread in ms
+ private static final long BUILD_UPDATE_TIMEOUT = 500;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ */
+ public ControlFlowView() {
+ super(ID, new ControlFlowPresentationProvider());
+ setTreeColumns(COLUMN_NAMES);
+ setTreeLabelProvider(new ControlFlowTreeLabelProvider());
+ setFilterColumns(FILTER_COLUMN_NAMES);
+ setFilterLabelProvider(new ControlFlowFilterLabelProvider());
+ setEntryComparator(new ControlFlowEntryComparator());
+ }
+
+ @Override
+ protected void fillLocalToolBar(IToolBarManager manager) {
+ super.fillLocalToolBar(manager);
+ IDialogSettings settings = Activator.getDefault().getDialogSettings();
+ IDialogSettings section = settings.getSection(getClass().getName());
+ if (section == null) {
+ section = settings.addNewSection(getClass().getName());
+ }
+
+ IAction hideArrowsAction = getTimeGraphCombo().getTimeGraphViewer().getHideArrowsAction(section);
+ manager.add(hideArrowsAction);
+
+ IAction followArrowBwdAction = getTimeGraphCombo().getTimeGraphViewer().getFollowArrowBwdAction();
+ followArrowBwdAction.setText(Messages.ControlFlowView_followCPUBwdText);
+ followArrowBwdAction.setToolTipText(Messages.ControlFlowView_followCPUBwdText);
+ manager.add(followArrowBwdAction);
+
+ IAction followArrowFwdAction = getTimeGraphCombo().getTimeGraphViewer().getFollowArrowFwdAction();
+ followArrowFwdAction.setText(Messages.ControlFlowView_followCPUFwdText);
+ followArrowFwdAction.setToolTipText(Messages.ControlFlowView_followCPUFwdText);
+ manager.add(followArrowFwdAction);
+ }
+
+ @Override
+ protected String getNextText() {
+ return Messages.ControlFlowView_nextProcessActionNameText;
+ }
+
+ @Override
+ protected String getNextTooltip() {
+ return Messages.ControlFlowView_nextProcessActionToolTipText;
+ }
+
+ @Override
+ protected String getPrevText() {
+ return Messages.ControlFlowView_previousProcessActionNameText;
+ }
+
+ @Override
+ protected String getPrevTooltip() {
+ return Messages.ControlFlowView_previousProcessActionToolTipText;
+ }
+
+ private static class ControlFlowEntryComparator implements Comparator<ITimeGraphEntry> {
+
+ @Override
+ public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) {
+
+ int result = 0;
+
+ if ((o1 instanceof ControlFlowEntry) && (o2 instanceof ControlFlowEntry)) {
+ ControlFlowEntry entry1 = (ControlFlowEntry) o1;
+ ControlFlowEntry entry2 = (ControlFlowEntry) o2;
+ result = entry1.getTrace().getStartTime().compareTo(entry2.getTrace().getStartTime());
+ if (result == 0) {
+ result = entry1.getTrace().getName().compareTo(entry2.getTrace().getName());
+ }
+ if (result == 0) {
+ result = entry1.getThreadId() < entry2.getThreadId() ? -1 : entry1.getThreadId() > entry2.getThreadId() ? 1 : 0;
+ }
+ }
+
+ if (result == 0) {
+ result = o1.getStartTime() < o2.getStartTime() ? -1 : o1.getStartTime() > o2.getStartTime() ? 1 : 0;
+ }
+
+ return result;
+ }
+ }
+
+ /**
+ * @author gbastien
+ *
+ */
+ protected static class ControlFlowTreeLabelProvider extends TreeLabelProvider {
+
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ ControlFlowEntry entry = (ControlFlowEntry) element;
+
+ if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_processColumn)) {
+ return entry.getName();
+ } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_tidColumn)) {
+ return Integer.toString(entry.getThreadId());
+ } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_ptidColumn)) {
+ if (entry.getParentThreadId() > 0) {
+ return Integer.toString(entry.getParentThreadId());
+ }
+ } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_birthTimeColumn)) {
+ return Utils.formatTime(entry.getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC);
+ } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_traceColumn)) {
+ return entry.getTrace().getName();
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ }
+
+ private static class ControlFlowFilterLabelProvider extends TreeLabelProvider {
+
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ ControlFlowEntry entry = (ControlFlowEntry) element;
+
+ if (columnIndex == 0) {
+ return entry.getName();
+ } else if (columnIndex == 1) {
+ return Integer.toString(entry.getThreadId());
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ }
+
+ // ------------------------------------------------------------------------
+ // Internal
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected void buildEventList(final ITmfTrace trace, ITmfTrace parentTrace, IProgressMonitor monitor) {
+ ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysis.ID);
+ if (ssq == null) {
+ return;
+ }
+
+ List<ControlFlowEntry> entryList = new ArrayList<>();
+ Map<Integer, ControlFlowEntry> entryMap = new HashMap<>();
+
+ long start = ssq.getStartTime();
+ setStartTime(Math.min(getStartTime(), start));
+
+ boolean complete = false;
+ while (!complete) {
+ if (monitor.isCanceled()) {
+ return;
+ }
+ complete = ssq.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
+ if (ssq.isCancelled()) {
+ return;
+ }
+ long end = ssq.getCurrentEndTime();
+ if (start == end && !complete) { // when complete execute one last time regardless of end time
+ continue;
+ }
+ setEndTime(Math.max(getEndTime(), end + 1));
+ List<Integer> threadQuarks = ssq.getQuarks(Attributes.THREADS, "*"); //$NON-NLS-1$
+ for (int threadQuark : threadQuarks) {
+ if (monitor.isCanceled()) {
+ return;
+ }
+ String threadName = ssq.getAttributeName(threadQuark);
+ int threadId = -1;
+ try {
+ threadId = Integer.parseInt(threadName);
+ } catch (NumberFormatException e1) {
+ continue;
+ }
+ if (threadId <= 0) { // ignore the 'unknown' (-1) and swapper (0) threads
+ continue;
+ }
+
+ int execNameQuark;
+ List<ITmfStateInterval> execNameIntervals;
+ try {
+ execNameQuark = ssq.getQuarkRelative(threadQuark, Attributes.EXEC_NAME);
+ execNameIntervals = StateSystemUtils.queryHistoryRange(ssq, execNameQuark, start, end);
+ } catch (AttributeNotFoundException e) {
+ /* No information on this thread (yet?), skip it for now */
+ continue;
+ } catch (StateSystemDisposedException e) {
+ /* State system is closing down, no point continuing */
+ break;
+ }
+
+ for (ITmfStateInterval execNameInterval : execNameIntervals) {
+ if (monitor.isCanceled()) {
+ return;
+ }
+ ControlFlowEntry entry = entryMap.get(threadId);
+ if (!execNameInterval.getStateValue().isNull() &&
+ execNameInterval.getStateValue().getType() == ITmfStateValue.Type.STRING) {
+ String execName = execNameInterval.getStateValue().unboxStr();
+ long startTime = execNameInterval.getStartTime();
+ long endTime = execNameInterval.getEndTime() + 1;
+
+ if (entry == null) {
+ ITmfStateInterval ppidInterval = null;
+ try {
+ int ppidQuark = ssq.getQuarkRelative(threadQuark, Attributes.PPID);
+ ppidInterval = StateSystemUtils.queryUntilNonNullValue(ssq, ppidQuark, startTime, endTime);
+ } catch (AttributeNotFoundException e) {
+ /* No info, keep PPID at -1 */
+ }
+
+ int ppid = -1;
+ if (ppidInterval != null) {
+ ppid = ppidInterval.getStateValue().unboxInt();
+ }
+ entry = new ControlFlowEntry(threadQuark, trace, execName, threadId, ppid, startTime, endTime);
+ entryList.add(entry);
+ entryMap.put(threadId, entry);
+ } else {
+ // update the name of the entry to the latest
+ // execName
+ entry.setName(execName);
+ entry.updateEndTime(endTime);
+ }
+ } else {
+ entryMap.remove(threadId);
+ }
+ }
+ }
+
+ updateTree(entryList, parentTrace);
+
+ if (parentTrace.equals(getTrace())) {
+ refresh();
+ }
+
+ for (ControlFlowEntry entry : entryList) {
+ if (monitor.isCanceled()) {
+ return;
+ }
+ buildStatusEvents(entry.getTrace(), entry, monitor, start, end);
+ }
+
+ start = end;
+ }
+ }
+
+ private void updateTree(List<ControlFlowEntry> entryList, ITmfTrace parentTrace) {
+ List<TimeGraphEntry> rootListToAdd = new ArrayList<>();
+ List<TimeGraphEntry> rootListToRemove = new ArrayList<>();
+ List<TimeGraphEntry> rootList = getEntryList(parentTrace);
+
+ for (ControlFlowEntry entry : entryList) {
+ boolean root = (entry.getParent() == null);
+ if (root && entry.getParentThreadId() > 0) {
+ for (ControlFlowEntry parent : entryList) {
+ /*
+ * Associate the parent entry only if their time overlap. A
+ * child entry may start before its parent, for example at
+ * the beginning of the trace if a parent has not yet
+ * appeared in the state system. We just want to make sure
+ * that the entry didn't start after the parent ended or
+ * ended before the parent started.
+ */
+ if (parent.getThreadId() == entry.getParentThreadId() &&
+ !(entry.getStartTime() > parent.getEndTime() ||
+ entry.getEndTime() < parent.getStartTime())) {
+ parent.addChild(entry);
+ root = false;
+ if (rootList != null && rootList.contains(entry)) {
+ rootListToRemove.add(entry);
+ }
+ break;
+ }
+ }
+ }
+ if (root && (rootList == null || !rootList.contains(entry))) {
+ rootListToAdd.add(entry);
+ }
+ }
+
+ addToEntryList(parentTrace, rootListToAdd);
+ removeFromEntryList(parentTrace, rootListToRemove);
+ }
+
+ private void buildStatusEvents(ITmfTrace trace, ControlFlowEntry entry, @NonNull IProgressMonitor monitor, long start, long end) {
+ if (start < entry.getEndTime() && end > entry.getStartTime()) {
+ ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), KernelAnalysis.ID);
+ if (ssq == null) {
+ return;
+ }
+
+ long startTime = Math.max(start, entry.getStartTime());
+ long endTime = Math.min(end + 1, entry.getEndTime());
+ long resolution = Math.max(1, (end - ssq.getStartTime()) / getDisplayWidth());
+ List<ITimeEvent> eventList = getEventList(entry, startTime, endTime, resolution, monitor);
+ if (eventList == null) {
+ return;
+ }
+ for (ITimeEvent event : eventList) {
+ entry.addEvent(event);
+ }
+ if (trace.equals(getTrace())) {
+ redraw();
+ }
+ }
+ for (ITimeGraphEntry child : entry.getChildren()) {
+ if (monitor.isCanceled()) {
+ return;
+ }
+ buildStatusEvents(trace, (ControlFlowEntry) child, monitor, start, end);
+ }
+ }
+
+ @Override
+ protected @Nullable List<ITimeEvent> getEventList(TimeGraphEntry tgentry, long startTime, long endTime, long resolution, IProgressMonitor monitor) {
+ List<ITimeEvent> eventList = null;
+ if (!(tgentry instanceof ControlFlowEntry)) {
+ return eventList;
+ }
+ ControlFlowEntry entry = (ControlFlowEntry) tgentry;
+ final long realStart = Math.max(startTime, entry.getStartTime());
+ final long realEnd = Math.min(endTime, entry.getEndTime());
+ if (realEnd <= realStart) {
+ return null;
+ }
+ KernelAnalysis kernelAnalysis = TmfTraceUtils.getAnalysisModuleOfClass(entry.getTrace(), KernelAnalysis.class, KernelAnalysis.ID);
+ if (kernelAnalysis == null) {
+// ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), KernelAnalysis.ID);
+// if (ssq == null) {
+ return null;
+ }
+ try {
+ List<ITmfStateInterval> statusIntervals = KernelThreadInformationProvider.getStatusIntervalsForThread(
+ kernelAnalysis, checkNotNull(entry.getThreadId()), realStart, realEnd, resolution, monitor);
+ eventList = new ArrayList<>(statusIntervals.size());
+ long lastEndTime = -1;
+ for (ITmfStateInterval statusInterval : statusIntervals) {
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ long time = statusInterval.getStartTime();
+ long duration = statusInterval.getEndTime() - time + 1;
+ int status = -1;
+ try {
+ status = statusInterval.getStateValue().unboxInt();
+ } catch (StateValueTypeException e) {
+ e.printStackTrace();
+ }
+ if (lastEndTime != time && lastEndTime != -1) {
+ eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
+ }
+ eventList.add(new TimeEvent(entry, time, duration, status));
+ lastEndTime = time + duration;
+ }
+ } catch (TimeRangeException e) {
+ Activator.getDefault().logError(e.getMessage());
+ }
+ return eventList;
+ }
+
+ /**
+ * Returns a value corresponding to the selected entry.
+ *
+ * Used in conjunction with synchingToTime to change the selected entry. If
+ * one of these methods is overridden in child class, then both should be.
+ *
+ * @param time
+ * The currently selected time
+ * @return a value identifying the entry
+ */
+ private int getSelectionValue(long time) {
+ int thread = -1;
+ ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace());
+ if (traces == null) {
+ return thread;
+ }
+ for (ITmfTrace trace : traces) {
+ if (thread > 0) {
+ break;
+ }
+ if (trace == null) {
+ continue;
+ }
+ ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysis.ID);
+ if (ssq == null) {
+ continue;
+ }
+ if (time >= ssq.getStartTime() && time <= ssq.getCurrentEndTime()) {
+ List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); //$NON-NLS-1$
+ for (int currentThreadQuark : currentThreadQuarks) {
+ try {
+ ITmfStateInterval currentThreadInterval = ssq.querySingleState(time, currentThreadQuark);
+ int currentThread = currentThreadInterval.getStateValue().unboxInt();
+ if (currentThread > 0) {
+ int statusQuark = ssq.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThread), Attributes.STATUS);
+ ITmfStateInterval statusInterval = ssq.querySingleState(time, statusQuark);
+ if (statusInterval.getStartTime() == time) {
+ thread = currentThread;
+ break;
+ }
+ }
+ } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
+ e.printStackTrace();
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ }
+ }
+ }
+ return thread;
+ }
+
+ @Override
+ protected void synchingToTime(long time) {
+ int selected = getSelectionValue(time);
+ if (selected > 0) {
+ for (Object element : getTimeGraphViewer().getExpandedElements()) {
+ if (element instanceof ControlFlowEntry) {
+ ControlFlowEntry entry = (ControlFlowEntry) element;
+ if (entry.getThreadId() == selected) {
+ getTimeGraphCombo().setSelection(entry);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ protected List<ILinkEvent> getLinkList(long startTime, long endTime, long resolution, IProgressMonitor monitor) {
+ List<ILinkEvent> list = new ArrayList<>();
+ ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace());
+ List<TimeGraphEntry> entryList = getEntryList(getTrace());
+ if (traces == null || entryList == null) {
+ return list;
+ }
+ for (ITmfTrace trace : traces) {
+ if (trace == null) {
+ continue;
+ }
+ ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysis.ID);
+ if (ssq == null) {
+ continue;
+ }
+ try {
+ long start = Math.max(startTime, ssq.getStartTime());
+ long end = Math.min(endTime, ssq.getCurrentEndTime());
+ if (end < start) {
+ continue;
+ }
+ List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); //$NON-NLS-1$
+ for (int currentThreadQuark : currentThreadQuarks) {
+ // adjust the query range to include the previous and following intervals
+ long qstart = Math.max(ssq.querySingleState(start, currentThreadQuark).getStartTime() - 1, ssq.getStartTime());
+ long qend = Math.min(ssq.querySingleState(end, currentThreadQuark).getEndTime() + 1, ssq.getCurrentEndTime());
+ List<ITmfStateInterval> currentThreadIntervals = StateSystemUtils.queryHistoryRange(ssq, currentThreadQuark, qstart, qend, resolution, monitor);
+ int prevThread = 0;
+ long prevEnd = 0;
+ long lastEnd = 0;
+ for (ITmfStateInterval currentThreadInterval : currentThreadIntervals) {
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ long time = currentThreadInterval.getStartTime();
+ if (time != lastEnd) {
+ // don't create links where there are gaps in intervals due to the resolution
+ prevThread = 0;
+ prevEnd = 0;
+ }
+ int thread = currentThreadInterval.getStateValue().unboxInt();
+ if (thread > 0 && prevThread > 0) {
+ ITimeGraphEntry prevEntry = findEntry(entryList, trace, prevThread);
+ ITimeGraphEntry nextEntry = findEntry(entryList, trace, thread);
+ list.add(new TimeLinkEvent(prevEntry, nextEntry, prevEnd, time - prevEnd, 0));
+ }
+ lastEnd = currentThreadInterval.getEndTime() + 1;
+ if (thread != 0) {
+ prevThread = thread;
+ prevEnd = lastEnd;
+ }
+ }
+ }
+ } catch (TimeRangeException | AttributeNotFoundException | StateValueTypeException e) {
+ e.printStackTrace();
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ }
+ return list;
+ }
+
+ private ControlFlowEntry findEntry(List<? extends ITimeGraphEntry> entryList, ITmfTrace trace, int threadId) {
+ for (ITimeGraphEntry entry : entryList) {
+ if (entry instanceof ControlFlowEntry) {
+ ControlFlowEntry controlFlowEntry = (ControlFlowEntry) entry;
+ if (controlFlowEntry.getThreadId() == threadId && controlFlowEntry.getTrace() == trace) {
+ return controlFlowEntry;
+ } else if (entry.hasChildren()) {
+ controlFlowEntry = findEntry(entry.getChildren(), trace, threadId);
+ if (controlFlowEntry != null) {
+ return controlFlowEntry;
+ }
+ }
+ }
+ }
+ return null;
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.cpuusage;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tracecompass.analysis.os.linux.core.cpuusage.KernelCpuUsageAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
+import org.eclipse.tracecompass.tmf.ui.viewers.tree.AbstractTmfTreeViewer;
+import org.eclipse.tracecompass.tmf.ui.viewers.tree.ITmfTreeColumnDataProvider;
+import org.eclipse.tracecompass.tmf.ui.viewers.tree.ITmfTreeViewerEntry;
+import org.eclipse.tracecompass.tmf.ui.viewers.tree.TmfTreeColumnData;
+import org.eclipse.tracecompass.tmf.ui.viewers.tree.TmfTreeColumnData.ITmfColumnPercentageProvider;
+import org.eclipse.tracecompass.tmf.ui.viewers.tree.TmfTreeViewerEntry;
+
+/**
+ * Tree viewer to display CPU usage information in a specified time range. It
+ * shows the process's TID, its name, the time spent on the CPU during that
+ * range, in % and absolute value.
+ *
+ * @author Geneviève Bastien
+ */
+public class CpuUsageComposite extends AbstractTmfTreeViewer {
+
+ // Timeout between to wait for in the updateElements method
+ private static final long BUILD_UPDATE_TIMEOUT = 500;
+
+ private KernelCpuUsageAnalysis fModule = null;
+ private String fSelectedThread = null;
+
+ private static final String[] COLUMN_NAMES = new String[] {
+ Messages.CpuUsageComposite_ColumnTID,
+ Messages.CpuUsageComposite_ColumnProcess,
+ Messages.CpuUsageComposite_ColumnPercent,
+ Messages.CpuUsageComposite_ColumnTime
+ };
+
+ /* A map that saves the mapping of a thread ID to its executable name */
+ private final Map<String, String> fProcessNameMap = new HashMap<>();
+
+ /** Provides label for the CPU usage tree viewer cells */
+ protected static class CpuLabelProvider extends TreeLabelProvider {
+
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ CpuUsageEntry obj = (CpuUsageEntry) element;
+ if (columnIndex == 0) {
+ return obj.getTid();
+ } else if (columnIndex == 1) {
+ return obj.getProcessName();
+ } else if (columnIndex == 2) {
+ return String.format(Messages.CpuUsageComposite_TextPercent, obj.getPercent());
+ } else if (columnIndex == 3) {
+ return NLS.bind(Messages.CpuUsageComposite_TextTime, obj.getTime());
+ }
+
+ return element.toString();
+ }
+
+ }
+
+ /**
+ * Constructor
+ *
+ * @param parent
+ * The parent composite that holds this viewer
+ */
+ public CpuUsageComposite(Composite parent) {
+ super(parent, false);
+ setLabelProvider(new CpuLabelProvider());
+ }
+
+ @Override
+ protected ITmfTreeColumnDataProvider getColumnDataProvider() {
+ return new ITmfTreeColumnDataProvider() {
+
+ @Override
+ public List<TmfTreeColumnData> getColumnData() {
+ /* All columns are sortable */
+ List<TmfTreeColumnData> columns = new ArrayList<>();
+ TmfTreeColumnData column = new TmfTreeColumnData(COLUMN_NAMES[0]);
+ column.setComparator(new ViewerComparator() {
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ CpuUsageEntry n1 = (CpuUsageEntry) e1;
+ CpuUsageEntry n2 = (CpuUsageEntry) e2;
+
+ return n1.getTid().compareTo(n2.getTid());
+
+ }
+ });
+ columns.add(column);
+ column = new TmfTreeColumnData(COLUMN_NAMES[1]);
+ column.setComparator(new ViewerComparator() {
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ CpuUsageEntry n1 = (CpuUsageEntry) e1;
+ CpuUsageEntry n2 = (CpuUsageEntry) e2;
+
+ return n1.getProcessName().compareTo(n2.getProcessName());
+
+ }
+ });
+ columns.add(column);
+ column = new TmfTreeColumnData(COLUMN_NAMES[2]);
+ column.setComparator(new ViewerComparator() {
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ CpuUsageEntry n1 = (CpuUsageEntry) e1;
+ CpuUsageEntry n2 = (CpuUsageEntry) e2;
+
+ return n1.getPercent().compareTo(n2.getPercent());
+
+ }
+ });
+ column.setPercentageProvider(new ITmfColumnPercentageProvider() {
+
+ @Override
+ public double getPercentage(Object data) {
+ CpuUsageEntry parent = (CpuUsageEntry) data;
+ return parent.getPercent() / 100;
+ }
+ });
+ columns.add(column);
+ column = new TmfTreeColumnData(COLUMN_NAMES[3]);
+ column.setComparator(new ViewerComparator() {
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ CpuUsageEntry n1 = (CpuUsageEntry) e1;
+ CpuUsageEntry n2 = (CpuUsageEntry) e2;
+
+ return n1.getTime().compareTo(n2.getTime());
+
+ }
+ });
+ columns.add(column);
+
+ return columns;
+ }
+
+ };
+ }
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected void contentChanged(ITmfTreeViewerEntry rootEntry) {
+ String selectedThread = fSelectedThread;
+ if (selectedThread != null) {
+ /* Find the selected thread among the inputs */
+ for (ITmfTreeViewerEntry entry : rootEntry.getChildren()) {
+ if (entry instanceof CpuUsageEntry) {
+ if (selectedThread.equals(((CpuUsageEntry) entry).getTid())) {
+ List<ITmfTreeViewerEntry> list = checkNotNull(Collections.singletonList(entry));
+ super.setSelection(list);
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void initializeDataSource() {
+ fModule = TmfTraceUtils.getAnalysisModuleOfClass(getTrace(), KernelCpuUsageAnalysis.class, KernelCpuUsageAnalysis.ID);
+ if (fModule == null) {
+ return;
+ }
+ fModule.schedule();
+ fModule.waitForInitialization();
+ fProcessNameMap.clear();
+ }
+
+ @Override
+ protected ITmfTreeViewerEntry updateElements(long start, long end, boolean isSelection) {
+ if (isSelection || (start == end)) {
+ return null;
+ }
+ if (getTrace() == null || fModule == null) {
+ return null;
+ }
+ fModule.waitForInitialization();
+ ITmfStateSystem ss = fModule.getStateSystem();
+ if (ss == null) {
+ return null;
+ }
+
+ boolean complete = false;
+ long currentEnd = start;
+
+ while (!complete && currentEnd < end) {
+ complete = ss.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
+ currentEnd = ss.getCurrentEndTime();
+ }
+
+ /* Initialize the data */
+ Map<String, Long> cpuUsageMap = fModule.getCpuUsageInRange(Math.max(start, getStartTime()), Math.min(end, getEndTime()));
+
+ TmfTreeViewerEntry root = new TmfTreeViewerEntry(""); //$NON-NLS-1$
+ List<ITmfTreeViewerEntry> entryList = root.getChildren();
+
+ for (Entry<String, Long> entry : cpuUsageMap.entrySet()) {
+ /*
+ * Process only entries representing the total of all CPUs and that
+ * have time on CPU
+ */
+ if (entry.getValue() == 0) {
+ continue;
+ }
+ if (!entry.getKey().startsWith(KernelCpuUsageAnalysis.TOTAL)) {
+ continue;
+ }
+ String[] strings = entry.getKey().split(KernelCpuUsageAnalysis.SPLIT_STRING, 2);
+
+ if ((strings.length > 1) && !(strings[1].equals(KernelCpuUsageAnalysis.TID_ZERO))) {
+ CpuUsageEntry obj = new CpuUsageEntry(strings[1], getProcessName(strings[1]), (double) entry.getValue() / (double) (end - start) * 100, entry.getValue());
+ entryList.add(obj);
+ }
+ }
+
+ return root;
+ }
+
+ /*
+ * Get the process name from its TID by using the LTTng kernel analysis
+ * module
+ */
+ private String getProcessName(String tid) {
+ String execName = fProcessNameMap.get(tid);
+ if (execName != null) {
+ return execName;
+ }
+ ITmfTrace trace = getTrace();
+ if (trace == null) {
+ return tid;
+ }
+ ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysis.ID);
+ if (kernelSs == null) {
+ return tid;
+ }
+
+ try {
+ int cpusNode = kernelSs.getQuarkAbsolute(Attributes.THREADS);
+
+ /* Get the quarks for each cpu */
+ List<Integer> cpuNodes = kernelSs.getSubAttributes(cpusNode, false);
+
+ for (Integer tidQuark : cpuNodes) {
+ if (kernelSs.getAttributeName(tidQuark).equals(tid)) {
+ int execNameQuark;
+ List<ITmfStateInterval> execNameIntervals;
+ try {
+ execNameQuark = kernelSs.getQuarkRelative(tidQuark, Attributes.EXEC_NAME);
+ execNameIntervals = StateSystemUtils.queryHistoryRange(kernelSs, execNameQuark, getStartTime(), getEndTime());
+ } catch (AttributeNotFoundException e) {
+ /* No information on this thread (yet?), skip it for now */
+ continue;
+ } catch (StateSystemDisposedException e) {
+ /* State system is closing down, no point continuing */
+ break;
+ }
+
+ for (ITmfStateInterval execNameInterval : execNameIntervals) {
+ if (!execNameInterval.getStateValue().isNull() &&
+ execNameInterval.getStateValue().getType() == ITmfStateValue.Type.STRING) {
+ execName = execNameInterval.getStateValue().unboxStr();
+ fProcessNameMap.put(tid, execName);
+ return execName;
+ }
+ }
+ }
+ }
+
+ } catch (AttributeNotFoundException e) {
+ /* can't find the process name, just return the tid instead */
+ }
+ return tid;
+ }
+
+ /**
+ * Set the currently selected thread ID
+ *
+ * @param tid
+ * The selected thread ID
+ */
+ public void setSelectedThread(String tid) {
+ fSelectedThread = tid;
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.cpuusage;
+
+import org.eclipse.tracecompass.tmf.ui.viewers.tree.TmfTreeViewerEntry;
+
+/**
+ * Represents an entry in the tree viewer of the CPU usage view. An entry is a
+ * thread that occupied part of the CPU in the selected time range.
+ *
+ * @author Geneviève Bastien
+ */
+public class CpuUsageEntry extends TmfTreeViewerEntry {
+ private final String fTid;
+ private final String fProcessName;
+ private final Double fPercent;
+ private final Long fTime;
+
+ /**
+ * Constructor
+ *
+ * @param tid
+ * The TID of the process
+ * @param name
+ * The thread's name
+ * @param percent
+ * The percentage CPU usage
+ * @param time
+ * The total amount of time spent on CPU
+ */
+ public CpuUsageEntry(String tid, String name, double percent, long time) {
+ super(tid);
+ fTid = tid;
+ fProcessName = name;
+ fPercent = percent;
+ fTime = time;
+ }
+
+ /**
+ * Get the TID of the thread represented by this entry
+ *
+ * @return The thread's TID
+ */
+ public String getTid() {
+ return fTid;
+ }
+
+ /**
+ * Get the process name
+ *
+ * @return The process name
+ */
+ public String getProcessName() {
+ return fProcessName;
+ }
+
+ /**
+ * Get the percentage of time spent on CPU in the time interval represented
+ * by this entry.
+ *
+ * @return The percentage of time spent on CPU
+ */
+ public Double getPercent() {
+ return fPercent;
+ }
+
+ /**
+ * Get the total time spent on CPU in the time interval represented by this
+ * entry.
+ *
+ * @return The total time spent on CPU
+ */
+ public Long getTime() {
+ return fTime;
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.cpuusage;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.ui.views.TmfView;
+
+/**
+ * CPU usage view. It contains 2 viewers: one tree viewer showing all the
+ * threads who were on the CPU in the time range, and one XY chart viewer
+ * plotting the total time spent on CPU and the time of the threads selected in
+ * the tree viewer.
+ *
+ * @author Geneviève Bastien
+ */
+public class CpuUsageView extends TmfView {
+
+ /** ID string */
+ public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.views.cpuusage"; //$NON-NLS-1$
+
+ private CpuUsageComposite fTreeViewer = null;
+ private CpuUsageXYViewer fXYViewer = null;
+
+ /**
+ * Constructor
+ */
+ public CpuUsageView() {
+ super(Messages.CpuUsageView_Title);
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+
+ final SashForm sash = new SashForm(parent, SWT.NONE);
+
+ fTreeViewer = new CpuUsageComposite(sash);
+
+ /* Build the XY chart part of the view */
+ fXYViewer = new CpuUsageXYViewer(sash);
+
+ /* Add selection listener to tree viewer */
+ fTreeViewer.addSelectionChangeListener(new ISelectionChangedListener() {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Object structSelection = ((IStructuredSelection) selection).getFirstElement();
+ if (structSelection instanceof CpuUsageEntry) {
+ CpuUsageEntry entry = (CpuUsageEntry) structSelection;
+ fTreeViewer.setSelectedThread(entry.getTid());
+ fXYViewer.setSelectedThread(Long.valueOf(entry.getTid()));
+ }
+ }
+ }
+ });
+
+ sash.setLayout(new FillLayout());
+
+ /* Initialize the viewers with the currently selected trace */
+ ITmfTrace trace = getActiveTrace();
+ if (trace != null) {
+ TmfTraceSelectedSignal signal = new TmfTraceSelectedSignal(this, trace);
+ fTreeViewer.traceSelected(signal);
+ fXYViewer.traceSelected(signal);
+ }
+
+ }
+
+ @Override
+ public void setFocus() {
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ if (fTreeViewer != null) {
+ fTreeViewer.dispose();
+ }
+ if (fXYViewer != null) {
+ fXYViewer.dispose();
+ }
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.cpuusage;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tracecompass.analysis.os.linux.core.cpuusage.KernelCpuUsageAnalysis;
+import org.eclipse.tracecompass.internal.analysis.os.linux.ui.Activator;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
+import org.eclipse.tracecompass.tmf.ui.viewers.xycharts.linecharts.TmfCommonXLineChartViewer;
+
+/**
+ * CPU usage viewer with XY line chart. It displays the total CPU usage and that
+ * of the threads selected in the CPU usage tree viewer.
+ *
+ * @author Geneviève Bastien
+ */
+public class CpuUsageXYViewer extends TmfCommonXLineChartViewer {
+
+ private KernelCpuUsageAnalysis fModule = null;
+
+ /* Maps a thread ID to a list of y values */
+ private final Map<String, double[]> fYValues = new LinkedHashMap<>();
+ /*
+ * To avoid up and downs CPU usage when process is in and out of CPU
+ * frequently, use a smaller resolution to get better averages.
+ */
+ private static final double RESOLUTION = 0.4;
+
+ // Timeout between updates in the updateData thread
+ private static final long BUILD_UPDATE_TIMEOUT = 500;
+
+ private long fSelectedThread = -1;
+
+ /**
+ * Constructor
+ *
+ * @param parent
+ * parent composite
+ */
+ public CpuUsageXYViewer(Composite parent) {
+ super(parent, Messages.CpuUsageXYViewer_Title, Messages.CpuUsageXYViewer_TimeXAxis, Messages.CpuUsageXYViewer_CpuYAxis);
+ setResolution(RESOLUTION);
+ }
+
+ @Override
+ protected void initializeDataSource() {
+ if (getTrace() != null) {
+ fModule = TmfTraceUtils.getAnalysisModuleOfClass(getTrace(), KernelCpuUsageAnalysis.class, KernelCpuUsageAnalysis.ID);
+ if (fModule == null) {
+ return;
+ }
+ fModule.schedule();
+ }
+ }
+
+ private static double[] zeroFill(int nb) {
+ double[] arr = new double[nb];
+ Arrays.fill(arr, 0.0);
+ return arr;
+ }
+
+ @Override
+ protected void updateData(long start, long end, int nb, IProgressMonitor monitor) {
+ try {
+ if (getTrace() == null || fModule == null) {
+ return;
+ }
+ fModule.waitForInitialization();
+ ITmfStateSystem ss = fModule.getStateSystem();
+ if (ss == null) {
+ return;
+ }
+ double[] xvalues = getXAxis(start, end, nb);
+ if (xvalues.length == 0) {
+ return;
+ }
+ setXAxis(xvalues);
+
+ boolean complete = false;
+ long currentEnd = start;
+
+ while (!complete && currentEnd < end) {
+
+ if (monitor.isCanceled()) {
+ return;
+ }
+
+ long traceStart = getStartTime();
+ long traceEnd = getEndTime();
+ long offset = getTimeOffset();
+ long selectedThread = fSelectedThread;
+
+ complete = ss.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
+ currentEnd = ss.getCurrentEndTime();
+
+ /* Initialize the data */
+ Map<String, Long> cpuUsageMap = fModule.getCpuUsageInRange(Math.max(start, traceStart), Math.min(end, traceEnd));
+ Map<String, String> totalEntries = new HashMap<>();
+ fYValues.clear();
+ fYValues.put(Messages.CpuUsageXYViewer_Total, zeroFill(xvalues.length));
+ String stringSelectedThread = Long.toString(selectedThread);
+ if (selectedThread != -1) {
+ fYValues.put(stringSelectedThread, zeroFill(xvalues.length));
+ }
+
+ for (Entry<String, Long> entry : cpuUsageMap.entrySet()) {
+ /*
+ * Process only entries representing the total of all CPUs
+ * and that have time on CPU
+ */
+ if (entry.getValue() == 0) {
+ continue;
+ }
+ if (!entry.getKey().startsWith(KernelCpuUsageAnalysis.TOTAL)) {
+ continue;
+ }
+ String[] strings = entry.getKey().split(KernelCpuUsageAnalysis.SPLIT_STRING, 2);
+
+ if ((strings.length > 1) && !(strings[1].equals(KernelCpuUsageAnalysis.TID_ZERO))) {
+ /* This is the total cpu usage for a thread */
+ totalEntries.put(strings[1], entry.getKey());
+ }
+ }
+
+ double prevX = xvalues[0];
+ long prevTime = (long) prevX + offset;
+ /*
+ * make sure that time is in the trace range after double to
+ * long conversion
+ */
+ prevTime = Math.max(traceStart, prevTime);
+ prevTime = Math.min(traceEnd, prevTime);
+ /* Get CPU usage statistics for each x value */
+ for (int i = 1; i < xvalues.length; i++) {
+ if (monitor.isCanceled()) {
+ return;
+ }
+ long totalCpu = 0;
+ double x = xvalues[i];
+ long time = (long) x + offset;
+ time = Math.max(traceStart, time);
+ time = Math.min(traceEnd, time);
+
+ cpuUsageMap = fModule.getCpuUsageInRange(prevTime, time);
+
+ /*
+ * Calculate the sum of all total entries, and add a data
+ * point to the selected one
+ */
+ for (Entry<String, String> entry : totalEntries.entrySet()) {
+ Long cpuEntry = cpuUsageMap.get(entry.getValue());
+ cpuEntry = cpuEntry != null ? cpuEntry : 0L;
+
+ totalCpu += cpuEntry;
+
+ if (entry.getKey().equals(stringSelectedThread)) {
+ /* This is the total cpu usage for a thread */
+ fYValues.get(entry.getKey())[i] = (double) cpuEntry / (double) (time - prevTime) * 100;
+ }
+
+ }
+ fYValues.get(Messages.CpuUsageXYViewer_Total)[i] = (double) totalCpu / (double) (time - prevTime) * 100;
+ prevTime = time;
+ }
+ for (Entry<String, double[]> entry : fYValues.entrySet()) {
+ setSeries(entry.getKey(), entry.getValue());
+ }
+ if (monitor.isCanceled()) {
+ return;
+ }
+ updateDisplay();
+ }
+ } catch (StateValueTypeException e) {
+ Activator.getDefault().logError("Error updating the data of the CPU usage view", e); //$NON-NLS-1$
+ }
+
+ }
+
+ /**
+ * Set the selected thread ID, which will be graphed in this viewer
+ *
+ * @param tid
+ * The selected thread ID
+ */
+ public void setSelectedThread(long tid) {
+ cancelUpdate();
+ deleteSeries(Long.toString(fSelectedThread));
+ fSelectedThread = tid;
+ updateContent();
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.cpuusage;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Messages used in the LTTng kernel CPU usage view and viewers.
+ *
+ * @author Geneviève Bastien
+ */
+@SuppressWarnings("javadoc")
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.tracecompass.analysis.os.linux.ui.views.cpuusage.messages"; //$NON-NLS-1$
+
+ public static String CpuUsageComposite_ColumnPercent;
+ public static String CpuUsageComposite_ColumnProcess;
+ public static String CpuUsageComposite_ColumnTID;
+ public static String CpuUsageComposite_ColumnTime;
+ public static String CpuUsageComposite_TextPercent;
+ public static String CpuUsageComposite_TextTime;
+ public static String CpuUsageView_Title;
+ public static String CpuUsageXYViewer_CpuYAxis;
+ public static String CpuUsageXYViewer_TimeXAxis;
+ public static String CpuUsageXYViewer_Title;
+ public static String CpuUsageXYViewer_Total;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
--- /dev/null
+###############################################################################
+# Copyright (c) 2014 École Polytechnique de Montréal
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Geneviève Bastien - Initial API and implementation
+###############################################################################
+
+CpuUsageComposite_ColumnPercent=%
+CpuUsageComposite_ColumnProcess=Process
+CpuUsageComposite_ColumnTID=TID
+CpuUsageComposite_ColumnTime=Time
+CpuUsageComposite_TextPercent=%1$.3f %%
+CpuUsageComposite_TextTime={0} ns
+CpuUsageView_Title=CPU Usage
+CpuUsageXYViewer_CpuYAxis=% CPU
+CpuUsageXYViewer_TimeXAxis=Time
+CpuUsageXYViewer_Title=CPU usage
+CpuUsageXYViewer_Total=Total
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tasse - Initial API and implementation
+ * Geneviève Bastien - Move code to provide base classes for time graph view
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.resources;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
+
+/**
+ * An entry, or row, in the resource view
+ *
+ * @author Patrick Tasse
+ */
+public class ResourcesEntry extends TimeGraphEntry implements Comparable<ITimeGraphEntry> {
+
+ /** Type of resource */
+ public static enum Type {
+ /** Null resources (filler rows, etc.) */
+ NULL,
+ /** Entries for CPUs */
+ CPU,
+ /** Entries for IRQs */
+ IRQ,
+ /** Entries for Soft IRQ */
+ SOFT_IRQ
+ }
+
+ private final int fId;
+ private final @NonNull ITmfTrace fTrace;
+ private final Type fType;
+ private final int fQuark;
+
+ /**
+ * Constructor
+ *
+ * @param quark
+ * The attribute quark matching the entry
+ * @param trace
+ * The trace on which we are working
+ * @param name
+ * The exec_name of this entry
+ * @param startTime
+ * The start time of this entry lifetime
+ * @param endTime
+ * The end time of this entry
+ * @param type
+ * The type of this entry
+ * @param id
+ * The id of this entry
+ */
+ public ResourcesEntry(int quark, @NonNull ITmfTrace trace, String name,
+ long startTime, long endTime, Type type, int id) {
+ super(name, startTime, endTime);
+ fId = id;
+ fTrace = trace;
+ fType = type;
+ fQuark = quark;
+ }
+
+ /**
+ * Constructor
+ *
+ * @param trace
+ * The trace on which we are working
+ * @param name
+ * The exec_name of this entry
+ * @param startTime
+ * The start time of this entry lifetime
+ * @param endTime
+ * The end time of this entry
+ * @param id
+ * The id of this entry
+ */
+ public ResourcesEntry(@NonNull ITmfTrace trace, String name,
+ long startTime, long endTime, int id) {
+ this(-1, trace, name, startTime, endTime, Type.NULL, id);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param quark
+ * The attribute quark matching the entry
+ * @param trace
+ * The trace on which we are working
+ * @param startTime
+ * The start time of this entry lifetime
+ * @param endTime
+ * The end time of this entry
+ * @param type
+ * The type of this entry
+ * @param id
+ * The id of this entry
+ */
+ public ResourcesEntry(int quark, @NonNull ITmfTrace trace,
+ long startTime, long endTime, Type type, int id) {
+ this(quark, trace, type.toString() + " " + id, startTime, endTime, type, id); //$NON-NLS-1$
+ }
+
+ /**
+ * Get the entry's id
+ *
+ * @return the entry's id
+ */
+ public int getId() {
+ return fId;
+ }
+
+ /**
+ * Get the entry's trace
+ *
+ * @return the entry's trace
+ */
+ public @NonNull ITmfTrace getTrace() {
+ return fTrace;
+ }
+
+ /**
+ * Get the entry Type of this entry. Uses the inner Type enum.
+ *
+ * @return The entry type
+ */
+ public Type getType() {
+ return fType;
+ }
+
+ /**
+ * Retrieve the attribute quark that's represented by this entry.
+ *
+ * @return The integer quark The attribute quark matching the entry
+ */
+ public int getQuark() {
+ return fQuark;
+ }
+
+ @Override
+ public boolean hasTimeEvents() {
+ if (fType == Type.NULL) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int compareTo(ITimeGraphEntry other) {
+ if (!(other instanceof ResourcesEntry)) {
+ /* Should not happen, but if it does, put those entries at the end */
+ return -1;
+ }
+ ResourcesEntry o = (ResourcesEntry) other;
+
+ /*
+ * Resources entry names should all be of type "ABC 123"
+ *
+ * We want to filter on the Type first (the "ABC" part), then on the ID
+ * ("123") in numerical order (so we get 1,2,10 and not 1,10,2).
+ */
+ int ret = this.getType().compareTo(o.getType());
+ if (ret != 0) {
+ return ret;
+ }
+ return Integer.compare(this.getId(), o.getId());
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tasse - Initial API and implementation
+ * Geneviève Bastien - Move code to provide base classes for time graph view
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.resources;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.StateValues;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
+import org.eclipse.tracecompass.analysis.os.linux.ui.views.resources.ResourcesEntry.Type;
+import org.eclipse.tracecompass.internal.analysis.os.linux.ui.Activator;
+import org.eclipse.tracecompass.internal.analysis.os.linux.ui.Messages;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.StateItem;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.NullTimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.ITmfTimeGraphDrawingHelper;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.Resolution;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat;
+
+/**
+ * Presentation provider for the Resource view, based on the generic TMF
+ * presentation provider.
+ *
+ * @author Patrick Tasse
+ */
+public class ResourcesPresentationProvider extends TimeGraphPresentationProvider {
+
+ private long fLastThreadId = -1;
+ private Color fColorWhite;
+ private Color fColorGray;
+ private Integer fAverageCharWidth;
+
+ private enum State {
+ IDLE (new RGB(200, 200, 200)),
+ USERMODE (new RGB( 0, 200, 0)),
+ SYSCALL (new RGB( 0, 0, 200)),
+ IRQ (new RGB(200, 0, 100)),
+ SOFT_IRQ (new RGB(200, 150, 100)),
+ IRQ_ACTIVE (new RGB(200, 0, 100)),
+ SOFT_IRQ_RAISED (new RGB(200, 200, 0)),
+ SOFT_IRQ_ACTIVE (new RGB(200, 150, 100));
+
+ public final RGB rgb;
+
+ private State(RGB rgb) {
+ this.rgb = rgb;
+ }
+ }
+
+ /**
+ * Default constructor
+ */
+ public ResourcesPresentationProvider() {
+ super();
+ }
+
+ private static State[] getStateValues() {
+ return State.values();
+ }
+
+ private static State getEventState(TimeEvent event) {
+ if (event.hasValue()) {
+ ResourcesEntry entry = (ResourcesEntry) event.getEntry();
+ int value = event.getValue();
+
+ if (entry.getType() == Type.CPU) {
+ if (value == StateValues.CPU_STATUS_IDLE) {
+ return State.IDLE;
+ } else if (value == StateValues.CPU_STATUS_RUN_USERMODE) {
+ return State.USERMODE;
+ } else if (value == StateValues.CPU_STATUS_RUN_SYSCALL) {
+ return State.SYSCALL;
+ } else if (value == StateValues.CPU_STATUS_IRQ) {
+ return State.IRQ;
+ } else if (value == StateValues.CPU_STATUS_SOFTIRQ) {
+ return State.SOFT_IRQ;
+ }
+ } else if (entry.getType() == Type.IRQ) {
+ return State.IRQ_ACTIVE;
+ } else if (entry.getType() == Type.SOFT_IRQ) {
+ if (value == StateValues.SOFT_IRQ_RAISED) {
+ return State.SOFT_IRQ_RAISED;
+ }
+ return State.SOFT_IRQ_ACTIVE;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public int getStateTableIndex(ITimeEvent event) {
+ State state = getEventState((TimeEvent) event);
+ if (state != null) {
+ return state.ordinal();
+ }
+ if (event instanceof NullTimeEvent) {
+ return INVISIBLE;
+ }
+ return TRANSPARENT;
+ }
+
+ @Override
+ public StateItem[] getStateTable() {
+ State[] states = getStateValues();
+ StateItem[] stateTable = new StateItem[states.length];
+ for (int i = 0; i < stateTable.length; i++) {
+ State state = states[i];
+ stateTable[i] = new StateItem(state.rgb, state.toString());
+ }
+ return stateTable;
+ }
+
+ @Override
+ public String getEventName(ITimeEvent event) {
+ State state = getEventState((TimeEvent) event);
+ if (state != null) {
+ return state.toString();
+ }
+ if (event instanceof NullTimeEvent) {
+ return null;
+ }
+ return Messages.ResourcesView_multipleStates;
+ }
+
+ @Override
+ public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) {
+
+ Map<String, String> retMap = new LinkedHashMap<>();
+ if (event instanceof TimeEvent && ((TimeEvent) event).hasValue()) {
+
+ TimeEvent tcEvent = (TimeEvent) event;
+ ResourcesEntry entry = (ResourcesEntry) event.getEntry();
+
+ if (tcEvent.hasValue()) {
+ ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), KernelAnalysis.ID);
+ if (ss == null) {
+ return retMap;
+ }
+ // Check for IRQ or Soft_IRQ type
+ if (entry.getType().equals(Type.IRQ) || entry.getType().equals(Type.SOFT_IRQ)) {
+
+ // Get CPU of IRQ or SoftIRQ and provide it for the tooltip display
+ int cpu = tcEvent.getValue();
+ if (cpu >= 0) {
+ retMap.put(Messages.ResourcesView_attributeCpuName, String.valueOf(cpu));
+ }
+ }
+
+ // Check for type CPU
+ else if (entry.getType().equals(Type.CPU)) {
+ int status = tcEvent.getValue();
+
+ if (status == StateValues.CPU_STATUS_IRQ) {
+ // In IRQ state get the IRQ that caused the interruption
+ int cpu = entry.getId();
+
+ try {
+ List<ITmfStateInterval> fullState = ss.queryFullState(event.getTime());
+ List<Integer> irqQuarks = ss.getQuarks(Attributes.RESOURCES, Attributes.IRQS, "*"); //$NON-NLS-1$
+
+ for (int irqQuark : irqQuarks) {
+ if (fullState.get(irqQuark).getStateValue().unboxInt() == cpu) {
+ ITmfStateInterval value = ss.querySingleState(event.getTime(), irqQuark);
+ if (!value.getStateValue().isNull()) {
+ int irq = Integer.parseInt(ss.getAttributeName(irqQuark));
+ retMap.put(Messages.ResourcesView_attributeIrqName, String.valueOf(irq));
+ }
+ break;
+ }
+ }
+ } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
+ Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ } else if (status == StateValues.CPU_STATUS_SOFTIRQ) {
+ // In SOFT_IRQ state get the SOFT_IRQ that caused the interruption
+ int cpu = entry.getId();
+
+ try {
+ List<ITmfStateInterval> fullState = ss.queryFullState(event.getTime());
+ List<Integer> softIrqQuarks = ss.getQuarks(Attributes.RESOURCES, Attributes.SOFT_IRQS, "*"); //$NON-NLS-1$
+
+ for (int softIrqQuark : softIrqQuarks) {
+ if (fullState.get(softIrqQuark).getStateValue().unboxInt() == cpu) {
+ ITmfStateInterval value = ss.querySingleState(event.getTime(), softIrqQuark);
+ if (!value.getStateValue().isNull()) {
+ int softIrq = Integer.parseInt(ss.getAttributeName(softIrqQuark));
+ retMap.put(Messages.ResourcesView_attributeSoftIrqName, String.valueOf(softIrq));
+ }
+ break;
+ }
+ }
+ } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
+ Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ } else if (status == StateValues.CPU_STATUS_RUN_USERMODE || status == StateValues.CPU_STATUS_RUN_SYSCALL) {
+ // In running state get the current tid
+
+ try {
+ retMap.put(Messages.ResourcesView_attributeHoverTime, Utils.formatTime(hoverTime, TimeFormat.CALENDAR, Resolution.NANOSEC));
+ int cpuQuark = entry.getQuark();
+ int currentThreadQuark = ss.getQuarkRelative(cpuQuark, Attributes.CURRENT_THREAD);
+ ITmfStateInterval interval = ss.querySingleState(hoverTime, currentThreadQuark);
+ if (!interval.getStateValue().isNull()) {
+ ITmfStateValue value = interval.getStateValue();
+ int currentThreadId = value.unboxInt();
+ retMap.put(Messages.ResourcesView_attributeTidName, Integer.toString(currentThreadId));
+ int execNameQuark = ss.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThreadId), Attributes.EXEC_NAME);
+ interval = ss.querySingleState(hoverTime, execNameQuark);
+ if (!interval.getStateValue().isNull()) {
+ value = interval.getStateValue();
+ retMap.put(Messages.ResourcesView_attributeProcessName, value.unboxStr());
+ }
+ if (status == StateValues.CPU_STATUS_RUN_SYSCALL) {
+ int syscallQuark = ss.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThreadId), Attributes.SYSTEM_CALL);
+ interval = ss.querySingleState(hoverTime, syscallQuark);
+ if (!interval.getStateValue().isNull()) {
+ value = interval.getStateValue();
+ retMap.put(Messages.ResourcesView_attributeSyscallName, value.unboxStr());
+ }
+ }
+ }
+ } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
+ Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ }
+ }
+ }
+ }
+
+ return retMap;
+ }
+
+ @Override
+ public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) {
+ if (fColorGray == null) {
+ fColorGray = gc.getDevice().getSystemColor(SWT.COLOR_GRAY);
+ }
+ if (fColorWhite == null) {
+ fColorWhite = gc.getDevice().getSystemColor(SWT.COLOR_WHITE);
+ }
+ if (fAverageCharWidth == null) {
+ fAverageCharWidth = gc.getFontMetrics().getAverageCharWidth();
+ }
+
+ ITmfTimeGraphDrawingHelper drawingHelper = getDrawingHelper();
+ if (bounds.width <= fAverageCharWidth) {
+ return;
+ }
+
+ if (!(event instanceof TimeEvent)) {
+ return;
+ }
+ TimeEvent tcEvent = (TimeEvent) event;
+ if (!tcEvent.hasValue()) {
+ return;
+ }
+
+ ResourcesEntry entry = (ResourcesEntry) event.getEntry();
+ if (!entry.getType().equals(Type.CPU)) {
+ return;
+ }
+
+ int status = tcEvent.getValue();
+ if (status != StateValues.CPU_STATUS_RUN_USERMODE && status != StateValues.CPU_STATUS_RUN_SYSCALL) {
+ return;
+ }
+
+ ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), KernelAnalysis.ID);
+ if (ss == null) {
+ return;
+ }
+ long time = event.getTime();
+ try {
+ while (time < event.getTime() + event.getDuration()) {
+ int cpuQuark = entry.getQuark();
+ int currentThreadQuark = ss.getQuarkRelative(cpuQuark, Attributes.CURRENT_THREAD);
+ ITmfStateInterval tidInterval = ss.querySingleState(time, currentThreadQuark);
+ long startTime = Math.max(tidInterval.getStartTime(), event.getTime());
+ int x = Math.max(drawingHelper.getXForTime(startTime), bounds.x);
+ if (x >= bounds.x + bounds.width) {
+ break;
+ }
+ if (!tidInterval.getStateValue().isNull()) {
+ ITmfStateValue value = tidInterval.getStateValue();
+ int currentThreadId = value.unboxInt();
+ long endTime = Math.min(tidInterval.getEndTime() + 1, event.getTime() + event.getDuration());
+ int xForEndTime = drawingHelper.getXForTime(endTime);
+ if (xForEndTime > bounds.x) {
+ int width = Math.min(xForEndTime, bounds.x + bounds.width) - x - 1;
+ if (width > 0) {
+ String attribute = null;
+ int beginIndex = 0;
+ if (status == StateValues.CPU_STATUS_RUN_USERMODE && currentThreadId != fLastThreadId) {
+ attribute = Attributes.EXEC_NAME;
+ } else if (status == StateValues.CPU_STATUS_RUN_SYSCALL) {
+ attribute = Attributes.SYSTEM_CALL;
+ /*
+ * Remove the "sys_" or "syscall_entry_" or similar from what we
+ * draw in the rectangle. This depends on the trace's event layout.
+ */
+ ITmfTrace trace = entry.getTrace();
+ if (trace instanceof IKernelTrace) {
+ IKernelAnalysisEventLayout layout = ((IKernelTrace) trace).getKernelEventLayout();
+ beginIndex = layout.eventSyscallEntryPrefix().length();
+ }
+ }
+ if (attribute != null) {
+ int quark = ss.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThreadId), attribute);
+ ITmfStateInterval interval = ss.querySingleState(time, quark);
+ if (!interval.getStateValue().isNull()) {
+ value = interval.getStateValue();
+ gc.setForeground(fColorWhite);
+ int drawn = Utils.drawText(gc, value.unboxStr().substring(beginIndex), x + 1, bounds.y - 2, width, true, true);
+ if (drawn > 0) {
+ fLastThreadId = currentThreadId;
+ }
+ }
+ }
+ if (xForEndTime < bounds.x + bounds.width) {
+ gc.setForeground(fColorGray);
+ gc.drawLine(xForEndTime, bounds.y + 1, xForEndTime, bounds.y + bounds.height - 2);
+ }
+ }
+ }
+ }
+ // make sure next time is at least at the next pixel
+ time = Math.max(tidInterval.getEndTime() + 1, drawingHelper.getTimeAtX(x + 1));
+ }
+ } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
+ Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ }
+
+ @Override
+ public void postDrawEntry(ITimeGraphEntry entry, Rectangle bounds, GC gc) {
+ fLastThreadId = -1;
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tasse - Initial API and implementation
+ * Geneviève Bastien - Move code to provide base classes for time graph views
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.ui.views.resources;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.ui.views.resources.ResourcesEntry.Type;
+import org.eclipse.tracecompass.internal.analysis.os.linux.ui.Messages;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.NullTimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent;
+import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
+
+/**
+ * Main implementation for the LTTng 2.0 kernel Resource view
+ *
+ * @author Patrick Tasse
+ */
+public class ResourcesView extends AbstractTimeGraphView {
+
+ /** View ID. */
+ public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.views.resources"; //$NON-NLS-1$
+
+ private static final String[] FILTER_COLUMN_NAMES = new String[] {
+ Messages.ResourcesView_stateTypeName
+ };
+
+ // Timeout between updates in the build thread in ms
+ private static final long BUILD_UPDATE_TIMEOUT = 500;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Default constructor
+ */
+ public ResourcesView() {
+ super(ID, new ResourcesPresentationProvider());
+ setFilterColumns(FILTER_COLUMN_NAMES);
+ }
+
+ // ------------------------------------------------------------------------
+ // Internal
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected String getNextText() {
+ return Messages.ResourcesView_nextResourceActionNameText;
+ }
+
+ @Override
+ protected String getNextTooltip() {
+ return Messages.ResourcesView_nextResourceActionToolTipText;
+ }
+
+ @Override
+ protected String getPrevText() {
+ return Messages.ResourcesView_previousResourceActionNameText;
+ }
+
+ @Override
+ protected String getPrevTooltip() {
+ return Messages.ResourcesView_previousResourceActionToolTipText;
+ }
+
+ @Override
+ protected void buildEventList(ITmfTrace trace, ITmfTrace parentTrace, IProgressMonitor monitor) {
+ ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysis.ID);
+ if (ssq == null) {
+ return;
+ }
+ Comparator<ITimeGraphEntry> comparator = new Comparator<ITimeGraphEntry>() {
+ @Override
+ public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) {
+ return ((ResourcesEntry) o1).compareTo(o2);
+ }
+ };
+
+ Map<Integer, ResourcesEntry> entryMap = new HashMap<>();
+ TimeGraphEntry traceEntry = null;
+
+ long startTime = ssq.getStartTime();
+ long start = startTime;
+ setStartTime(Math.min(getStartTime(), startTime));
+ boolean complete = false;
+ while (!complete) {
+ if (monitor.isCanceled()) {
+ return;
+ }
+ complete = ssq.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
+ if (ssq.isCancelled()) {
+ return;
+ }
+ long end = ssq.getCurrentEndTime();
+ if (start == end && !complete) { // when complete execute one last time regardless of end time
+ continue;
+ }
+ long endTime = end + 1;
+ setEndTime(Math.max(getEndTime(), endTime));
+
+ if (traceEntry == null) {
+ traceEntry = new ResourcesEntry(trace, trace.getName(), startTime, endTime, 0);
+ traceEntry.sortChildren(comparator);
+ List<TimeGraphEntry> entryList = Collections.singletonList(traceEntry);
+ addToEntryList(parentTrace, entryList);
+ } else {
+ traceEntry.updateEndTime(endTime);
+ }
+
+ List<Integer> cpuQuarks = ssq.getQuarks(Attributes.CPUS, "*"); //$NON-NLS-1$
+ for (Integer cpuQuark : cpuQuarks) {
+ int cpu = Integer.parseInt(ssq.getAttributeName(cpuQuark));
+ ResourcesEntry entry = entryMap.get(cpuQuark);
+ if (entry == null) {
+ entry = new ResourcesEntry(cpuQuark, trace, startTime, endTime, Type.CPU, cpu);
+ entryMap.put(cpuQuark, entry);
+ traceEntry.addChild(entry);
+ } else {
+ entry.updateEndTime(endTime);
+ }
+ }
+ List<Integer> irqQuarks = ssq.getQuarks(Attributes.RESOURCES, Attributes.IRQS, "*"); //$NON-NLS-1$
+ for (Integer irqQuark : irqQuarks) {
+ int irq = Integer.parseInt(ssq.getAttributeName(irqQuark));
+ ResourcesEntry entry = entryMap.get(irqQuark);
+ if (entry == null) {
+ entry = new ResourcesEntry(irqQuark, trace, startTime, endTime, Type.IRQ, irq);
+ entryMap.put(irqQuark, entry);
+ traceEntry.addChild(entry);
+ } else {
+ entry.updateEndTime(endTime);
+ }
+ }
+ List<Integer> softIrqQuarks = ssq.getQuarks(Attributes.RESOURCES, Attributes.SOFT_IRQS, "*"); //$NON-NLS-1$
+ for (Integer softIrqQuark : softIrqQuarks) {
+ int softIrq = Integer.parseInt(ssq.getAttributeName(softIrqQuark));
+ ResourcesEntry entry = entryMap.get(softIrqQuark);
+ if (entry == null) {
+ entry = new ResourcesEntry(softIrqQuark, trace, startTime, endTime, Type.SOFT_IRQ, softIrq);
+ entryMap.put(softIrqQuark, entry);
+ traceEntry.addChild(entry);
+ } else {
+ entry.updateEndTime(endTime);
+ }
+ }
+
+ if (parentTrace.equals(getTrace())) {
+ refresh();
+ }
+ long resolution = Math.max(1, (endTime - ssq.getStartTime()) / getDisplayWidth());
+ for (ITimeGraphEntry child : traceEntry.getChildren()) {
+ if (monitor.isCanceled()) {
+ return;
+ }
+ if (child instanceof TimeGraphEntry) {
+ TimeGraphEntry entry = (TimeGraphEntry) child;
+ List<ITimeEvent> eventList = getEventList(entry, start, endTime, resolution, monitor);
+ if (eventList != null) {
+ for (ITimeEvent event : eventList) {
+ entry.addEvent(event);
+ }
+ }
+ redraw();
+ }
+ }
+
+ start = end;
+ }
+ }
+
+ @Override
+ protected @Nullable List<ITimeEvent> getEventList(TimeGraphEntry entry,
+ long startTime, long endTime, long resolution,
+ IProgressMonitor monitor) {
+ ResourcesEntry resourcesEntry = (ResourcesEntry) entry;
+ ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(resourcesEntry.getTrace(), KernelAnalysis.ID);
+ if (ssq == null) {
+ return null;
+ }
+ final long realStart = Math.max(startTime, ssq.getStartTime());
+ final long realEnd = Math.min(endTime, ssq.getCurrentEndTime() + 1);
+ if (realEnd <= realStart) {
+ return null;
+ }
+ List<ITimeEvent> eventList = null;
+ int quark = resourcesEntry.getQuark();
+
+ try {
+ if (resourcesEntry.getType().equals(Type.CPU)) {
+ int statusQuark;
+ try {
+ statusQuark = ssq.getQuarkRelative(quark, Attributes.STATUS);
+ } catch (AttributeNotFoundException e) {
+ /*
+ * The sub-attribute "status" is not available. May happen
+ * if the trace does not have sched_switch events enabled.
+ */
+ return null;
+ }
+ List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ssq, statusQuark, realStart, realEnd - 1, resolution, monitor);
+ eventList = new ArrayList<>(statusIntervals.size());
+ long lastEndTime = -1;
+ for (ITmfStateInterval statusInterval : statusIntervals) {
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ int status = statusInterval.getStateValue().unboxInt();
+ long time = statusInterval.getStartTime();
+ long duration = statusInterval.getEndTime() - time + 1;
+ if (!statusInterval.getStateValue().isNull()) {
+ if (lastEndTime != time && lastEndTime != -1) {
+ eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
+ }
+ eventList.add(new TimeEvent(entry, time, duration, status));
+ } else if (lastEndTime == -1 || time + duration >= endTime) {
+ // add null event if it intersects the start or end time
+ eventList.add(new NullTimeEvent(entry, time, duration));
+ }
+ lastEndTime = time + duration;
+ }
+ } else if (resourcesEntry.getType().equals(Type.IRQ)) {
+ List<ITmfStateInterval> irqIntervals = StateSystemUtils.queryHistoryRange(ssq, quark, realStart, realEnd - 1, resolution, monitor);
+ eventList = new ArrayList<>(irqIntervals.size());
+ long lastEndTime = -1;
+ boolean lastIsNull = true;
+ for (ITmfStateInterval irqInterval : irqIntervals) {
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ long time = irqInterval.getStartTime();
+ long duration = irqInterval.getEndTime() - time + 1;
+ if (!irqInterval.getStateValue().isNull()) {
+ int cpu = irqInterval.getStateValue().unboxInt();
+ eventList.add(new TimeEvent(entry, time, duration, cpu));
+ lastIsNull = false;
+ } else {
+ if (lastEndTime == -1) {
+ // add null event if it intersects the start time
+ eventList.add(new NullTimeEvent(entry, time, duration));
+ } else {
+ if (lastEndTime != time && lastIsNull) {
+ /* This is a special case where we want to show IRQ_ACTIVE state but we don't know the CPU (it is between two null samples) */
+ eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime, -1));
+ }
+ if (time + duration >= endTime) {
+ // add null event if it intersects the end time
+ eventList.add(new NullTimeEvent(entry, time, duration));
+ }
+ }
+ lastIsNull = true;
+ }
+ lastEndTime = time + duration;
+ }
+ } else if (resourcesEntry.getType().equals(Type.SOFT_IRQ)) {
+ List<ITmfStateInterval> softIrqIntervals = StateSystemUtils.queryHistoryRange(ssq, quark, realStart, realEnd - 1, resolution, monitor);
+ eventList = new ArrayList<>(softIrqIntervals.size());
+ long lastEndTime = -1;
+ boolean lastIsNull = true;
+ for (ITmfStateInterval softIrqInterval : softIrqIntervals) {
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ long time = softIrqInterval.getStartTime();
+ long duration = softIrqInterval.getEndTime() - time + 1;
+ if (!softIrqInterval.getStateValue().isNull()) {
+ int cpu = softIrqInterval.getStateValue().unboxInt();
+ eventList.add(new TimeEvent(entry, time, duration, cpu));
+ } else {
+ if (lastEndTime == -1) {
+ // add null event if it intersects the start time
+ eventList.add(new NullTimeEvent(entry, time, duration));
+ } else {
+ if (lastEndTime != time && lastIsNull) {
+ /* This is a special case where we want to show IRQ_ACTIVE state but we don't know the CPU (it is between two null samples) */
+ eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime, -1));
+ }
+ if (time + duration >= endTime) {
+ // add null event if it intersects the end time
+ eventList.add(new NullTimeEvent(entry, time, duration));
+ }
+ }
+ lastIsNull = true;
+ }
+ lastEndTime = time + duration;
+ }
+ }
+
+ } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
+ e.printStackTrace();
+ } catch (StateSystemDisposedException e) {
+ /* Ignored */
+ }
+ return eventList;
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexandre Montplaisir - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.analysis.os.linux.ui;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ /**
+ * The plug-in ID
+ */
+ public static final String PLUGIN_ID = "org.eclipse.tracecompass.analysis.os.linux.ui"; //$NON-NLS-1$
+
+ /**
+ * The shared instance
+ */
+ private static Activator plugin;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ // ------------------------------------------------------------------------
+ // AbstractUIPlugin
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ @Override
+ protected void initializeImageRegistry(ImageRegistry reg) {
+ }
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ /**
+ * Get the image object from a given path
+ *
+ * @param path
+ * The path to the image file
+ * @return The Image object
+ */
+ public Image getImageFromPath(String path) {
+ return getImageDescripterFromPath(path).createImage();
+ }
+
+ /**
+ * Get the ImageDescriptor from a given path
+ *
+ * @param path
+ * The path to the image file
+ * @return The ImageDescriptor object
+ */
+ public ImageDescriptor getImageDescripterFromPath(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ * Get the Image from a registry
+ *
+ * @param path
+ * The path to the image registry
+ * @return The Image object
+ */
+ public Image getImageFromImageRegistry(String path) {
+ Image icon = getImageRegistry().get(path);
+ if (icon == null) {
+ icon = getImageDescripterFromPath(path).createImage();
+ plugin.getImageRegistry().put(path, icon);
+ }
+ return icon;
+ }
+
+ /**
+ * Logs a message with severity INFO in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logInfo(String message) {
+ getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity INFO in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logInfo(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message, exception));
+ }
+
+ /**
+ * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logWarning(String message) {
+ getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logWarning(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message, exception));
+ }
+
+ /**
+ * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logError(String message) {
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logError(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2013, 2014 Ericsson
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tassé - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.analysis.os.linux.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+@SuppressWarnings("javadoc")
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.tracecompass.internal.analysis.os.linux.ui.messages"; //$NON-NLS-1$
+
+ public static String ControlFlowView_birthTimeColumn;
+ public static String ControlFlowView_tidColumn;
+ public static String ControlFlowView_ptidColumn;
+ public static String ControlFlowView_processColumn;
+ public static String ControlFlowView_traceColumn;
+
+ public static String ControlFlowView_stateTypeName;
+ public static String ControlFlowView_multipleStates;
+ public static String ControlFlowView_nextProcessActionNameText;
+ public static String ControlFlowView_nextProcessActionToolTipText;
+ public static String ControlFlowView_previousProcessActionNameText;
+ public static String ControlFlowView_previousProcessActionToolTipText;
+ public static String ControlFlowView_followCPUBwdText;
+ public static String ControlFlowView_followCPUFwdText;
+
+ public static String ControlFlowView_attributeSyscallName;
+ public static String ControlFlowView_attributeCpuName;
+
+ public static String ResourcesView_stateTypeName;
+ public static String ResourcesView_multipleStates;
+ public static String ResourcesView_nextResourceActionNameText;
+ public static String ResourcesView_nextResourceActionToolTipText;
+ public static String ResourcesView_previousResourceActionNameText;
+ public static String ResourcesView_previousResourceActionToolTipText;
+ public static String ResourcesView_attributeCpuName;
+ public static String ResourcesView_attributeIrqName;
+ public static String ResourcesView_attributeSoftIrqName;
+ public static String ResourcesView_attributeHoverTime;
+ public static String ResourcesView_attributeTidName;
+ public static String ResourcesView_attributeProcessName;
+ public static String ResourcesView_attributeSyscallName;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
--- /dev/null
+###############################################################################
+# Copyright (c) 2013, 2014 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+
+ControlFlowView_birthTimeColumn=Birth time
+ControlFlowView_tidColumn=TID
+ControlFlowView_ptidColumn=PTID
+ControlFlowView_processColumn=Process
+ControlFlowView_traceColumn=Trace
+
+ControlFlowView_stateTypeName=Process
+ControlFlowView_multipleStates=(multiple)
+ControlFlowView_nextProcessActionNameText=Next Process
+ControlFlowView_nextProcessActionToolTipText=Select Next Process
+ControlFlowView_previousProcessActionNameText=Previous Process
+ControlFlowView_previousProcessActionToolTipText=Select Previous Process
+ControlFlowView_followCPUBwdText=Follow CPU Backward
+ControlFlowView_followCPUFwdText=Follow CPU Forward
+
+ControlFlowView_attributeSyscallName=System Call
+ControlFlowView_attributeCpuName=CPU
+
+ResourcesView_stateTypeName=Resource
+ResourcesView_multipleStates=(multiple)
+ResourcesView_nextResourceActionNameText=Next Resource
+ResourcesView_nextResourceActionToolTipText=Select Next Resource
+ResourcesView_previousResourceActionNameText=Previous Resource
+ResourcesView_previousResourceActionToolTipText=Select Previous Resource
+ResourcesView_attributeCpuName=CPU
+ResourcesView_attributeIrqName=IRQ
+ResourcesView_attributeSoftIrqName=SOFT IRQ
+ResourcesView_attributeHoverTime=> Hover Time
+ResourcesView_attributeTidName=> TID
+ResourcesView_attributeProcessName=> Process
+ResourcesView_attributeSyscallName=> System Call
org.eclipse.tracecompass.tmf.ctf.core.tests,
org.eclipse.tracecompass.lttng2.kernel.core;bundle-version="0.1.0",
org.eclipse.core.resources,
- org.eclipse.tracecompass.lttng2.control.core
+ org.eclipse.tracecompass.lttng2.control.core,
+ org.eclipse.tracecompass.analysis.os.linux.core,
+ org.eclipse.tracecompass.analysis.os.linux.core.tests
Export-Package: org.eclipse.tracecompass.lttng2.kernel.core.tests,
org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel;x-internal:=true,
org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel.statesystem;x-internal:=true,
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.properties,\
- plugin.xml
+ plugin.properties
src.includes = about.html
additional.bundles = org.eclipse.jdt.annotation
jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
import org.eclipse.test.performance.Dimension;
import org.eclipse.test.performance.Performance;
import org.eclipse.test.performance.PerformanceMeter;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
import org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
for (int i = 0; i < LOOP_COUNT; i++) {
IAnalysisModule module = null;
try (LttngKernelTrace trace = new LttngKernelTrace()) {
- module = new LttngKernelAnalysis();
+ module = new KernelAnalysis();
module.setId("test");
trace.initTrace(null, testTrace.getPath(), CtfTmfEvent.class);
module.setTrace(trace);
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.linuxtools.tmf.core.analysis">
- <module
- analysis_module="org.eclipse.tracecompass.lttng2.kernel.core.analysis.cpuusage.LttngKernelCpuUsageAnalysis"
- automatic="false"
- id="lttng2.kernel.core.tests.cpuusage"
- name="lttng2.kernel.core.tests.cpuusage">
- <tracetype
- applies="true"
- class="org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub">
- </tracetype>
- </module>
- <module
- analysis_module="org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis"
- automatic="false"
- id="lttng2.kernel.core.tests.kernel.analysis"
- name="lttng2.kernel.core.tests.kernel.analysis">
- <tracetype
- applies="true"
- class="org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub">
- </tracetype>
- </module>
- </extension>
-
-</plugin>
<name>Trace Compass LTTng Kernel Analysis Core Tests Plug-in</name>
<build>
- <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 -->
- <resources>
- <resource>
- <directory>src</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <id>prepare</id>
- <phase>validate</phase>
- <configuration>
- <target>
- <echo message="prepare phase" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <includes>
- <include>**/AllTests.*</include>
- </includes>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <testSuite>org.eclipse.tracecompass.lttng2.kernel.core.tests</testSuite>
+ <testClass>org.eclipse.tracecompass.lttng2.kernel.core.tests.AllTests</testClass>
+ <useUIHarness>false</useUIHarness>
+ <useUIThread>false</useUIThread>
+ <product>org.eclipse.platform.ide</product>
+ </configuration>
+ </plugin>
</plugins>
</build>
@RunWith(DebugSuite.class)
@DebugSuite.SuiteClasses({
ActivatorTest.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.cpuusage.AllTests.class,
org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel.AllTests.class,
org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel.statesystem.TestAll.class,
org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.vm.AllTests.class,
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.cpuusage;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for the lttng2.kernel CPU usage package
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CpuUsageStateProviderTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.cpuusage;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.cpuusage.LttngKernelCpuUsageAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.tests.Activator;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
-import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
-import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
-import org.eclipse.tracecompass.tmf.core.tests.shared.TmfTestHelper;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-import org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test suite for the {@link LttngKernelCpuUsageAnalysis} class
- *
- * @author Geneviève Bastien
- */
-public class CpuUsageStateProviderTest {
-
- private static final String CPU_USAGE_FILE = "testfiles/cpu_analysis.xml";
- /**
- * The ID of the cpu usage analysis module for development traces
- */
- public static final String CPU_USAGE_ANALYSIS_ID = "lttng2.kernel.core.tests.cpuusage";
-
- private ITmfTrace fTrace;
- private LttngKernelCpuUsageAnalysis fModule;
-
- private static void deleteSuppFiles(ITmfTrace trace) {
- /* Remove supplementary files */
- File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(trace));
- for (File file : suppDir.listFiles()) {
- file.delete();
- }
- }
-
- /**
- * Setup the trace for the tests
- */
- @Before
- public void setUp() {
- fTrace = new TmfXmlTraceStub();
- IPath filePath = Activator.getAbsoluteFilePath(CPU_USAGE_FILE);
- IStatus status = fTrace.validate(null, filePath.toOSString());
- if (!status.isOK()) {
- fail(status.getException().getMessage());
- }
- try {
- fTrace.initTrace(null, filePath.toOSString(), TmfEvent.class);
- } catch (TmfTraceException e) {
- fail(e.getMessage());
- }
- deleteSuppFiles(fTrace);
- ((TmfTrace) fTrace).traceOpened(new TmfTraceOpenedSignal(this, fTrace, null));
- /*
- * FIXME: Make sure this analysis is finished before running the CPU
- * analysis. This block can be removed once analysis dependency and
- * request precedence is implemented
- */
- IAnalysisModule module = null;
- for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(fTrace, LttngKernelAnalysis.class)) {
- module = mod;
- }
- assertNotNull(module);
- module.schedule();
- module.waitForCompletion();
- /* End of the FIXME block */
- fModule = TmfTraceUtils.getAnalysisModuleOfClass(fTrace, LttngKernelCpuUsageAnalysis.class, CPU_USAGE_ANALYSIS_ID);
- assertNotNull(fModule);
- }
-
- /**
- * Clean up
- */
- @After
- public void tearDown() {
- deleteSuppFiles(fTrace);
- fTrace.dispose();
- }
-
- /**
- * Test that the analysis executes without problems
- */
- @Test
- public void testAnalysisExecution() {
- /* Make sure the analysis hasn't run yet */
- assertNull(fModule.getStateSystem());
-
- /* Execute the analysis */
- assertTrue(TmfTestHelper.executeAnalysis(fModule));
- assertNotNull(fModule.getStateSystem());
- }
-
- /**
- * Test that the state system is returned with the expected results
- */
- @Test
- public void testReturnedStateSystem() {
- fModule.schedule();
- fModule.waitForCompletion();
- ITmfStateSystem ss = fModule.getStateSystem();
- assertNotNull(ss);
- assertEquals(1L, ss.getStartTime());
- assertEquals(25L, ss.getCurrentEndTime());
-
- try {
- int cpusQuark = ss.getQuarkAbsolute(Attributes.CPUS);
-
- /*
- * There should be 2 CPU entries: 0 and 1 and 3 process entries
- * under each
- */
- List<Integer> cpuQuarks = ss.getSubAttributes(cpusQuark, false);
- assertEquals(2, cpuQuarks.size());
- for (Integer cpuQuark : cpuQuarks) {
- assertEquals(3, ss.getSubAttributes(cpuQuark, false).size());
- }
-
- /* Proc 2 on CPU 0 should run from 1 to 20 seconds */
- int proc2Quark = ss.getQuarkAbsolute(Attributes.CPUS, "0", "2");
- ITmfStateInterval interval = ss.querySingleState(2L, proc2Quark);
- assertEquals(1L, interval.getStartTime());
- assertEquals(19L, interval.getEndTime());
-
- /*
- * Query at the end and make sure all processes on all CPU have the
- * expected values
- */
- Map<String, Long> expected = new HashMap<>();
- expected.put("CPUs/0/1", 0L);
- expected.put("CPUs/0/2", 19L);
- expected.put("CPUs/0/3", 5L);
- expected.put("CPUs/1/1", 5L);
- expected.put("CPUs/1/3", 6L);
- expected.put("CPUs/1/4", 8L);
- List<ITmfStateInterval> intervals = ss.queryFullState(25L);
- Map<String, Long> intervalMap = new HashMap<>();
- for (ITmfStateInterval oneInterval : intervals) {
- if (!oneInterval.getStateValue().isNull()) {
- intervalMap.put(ss.getFullAttributePath(oneInterval.getAttribute()), oneInterval.getStateValue().unboxLong());
- }
- }
- assertEquals(expected, intervalMap);
-
- } catch (AttributeNotFoundException | StateSystemDisposedException e) {
- fail(e.getMessage());
- }
- }
-
- /**
- * Test the
- * {@link LttngKernelCpuUsageAnalysis#getCpuUsageInRange(long, long)}
- * method.
- */
- @Test
- public void testUsageInRange() {
- fModule.schedule();
- fModule.waitForCompletion();
-
- /* This range should query the total range */
- Map<String, Long> expected = new HashMap<>();
- expected.put("0/1", 0L);
- expected.put("0/2", 19L);
- expected.put("0/3", 5L);
- expected.put("1/1", 5L);
- expected.put("1/3", 6L);
- expected.put("1/4", 13L);
- expected.put("total", 48L);
- expected.put("total/1", 5L);
- expected.put("total/2", 19L);
- expected.put("total/3", 11L);
- expected.put("total/4", 13L);
- expected.put("0", 24L);
- expected.put("1", 24L);
- Map<String, Long> resultMap = fModule.getCpuUsageInRange(0L, 30L);
- assertEquals(expected, resultMap);
-
- /* Verify a range when a process runs at the start */
- expected.clear();
- expected.put("0/1", 0L);
- expected.put("0/2", 0L);
- expected.put("0/3", 3L);
- expected.put("1/1", 0L);
- expected.put("1/3", 0L);
- expected.put("1/4", 3L);
- expected.put("total", 6L);
- expected.put("total/1", 0L);
- expected.put("total/2", 0L);
- expected.put("total/3", 3L);
- expected.put("total/4", 3L);
- expected.put("0", 3L);
- expected.put("1", 3L);
- resultMap = fModule.getCpuUsageInRange(22L, 25L);
- assertEquals(expected, resultMap);
-
- /* Verify a range when a process runs at the end */
- expected.clear();
- expected.put("0/1", 0L);
- expected.put("0/2", 3L);
- expected.put("0/3", 0L);
- expected.put("1/1", 0L);
- expected.put("1/3", 1L);
- expected.put("1/4", 2L);
- expected.put("total", 6L);
- expected.put("total/1", 0L);
- expected.put("total/2", 3L);
- expected.put("total/3", 1L);
- expected.put("total/4", 2L);
- expected.put("0", 3L);
- expected.put("1", 3L);
- resultMap = fModule.getCpuUsageInRange(1L, 4L);
- assertEquals(expected, resultMap);
-
- /* Verify a range when a process runs at start and at the end */
- expected.clear();
- expected.put("0/1", 0L);
- expected.put("0/2", 9L);
- expected.put("0/3", 0L);
- expected.put("1/1", 0L);
- expected.put("1/3", 5L);
- expected.put("1/4", 4L);
- expected.put("total", 18L);
- expected.put("total/1", 0L);
- expected.put("total/2", 9L);
- expected.put("total/3", 5L);
- expected.put("total/4", 4L);
- expected.put("0", 9L);
- expected.put("1", 9L);
- resultMap = fModule.getCpuUsageInRange(4L, 13L);
- assertEquals(expected, resultMap);
-
- }
-}
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
- LttngKernelThreadInformationProviderTest.class,
LttngKernelAnalysisTest.class
})
public class AllTests {
import java.util.List;
import java.util.Set;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
import org.eclipse.tracecompass.lttng2.control.core.session.SessionConfigStrings;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
import org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import com.google.common.collect.ImmutableSet;
/**
- * Test the {@link LttngKernelAnalysis} class
+ * Test the {@link KernelAnalysis} class
*
* @author Geneviève Bastien
*/
public class LttngKernelAnalysisTest {
private LttngKernelTrace fTrace;
- private LttngKernelAnalysis fKernelAnalysisModule;
+ private KernelAnalysis fKernelAnalysisModule;
/**
* Class setup
*/
@Before
public void setUp() {
- fKernelAnalysisModule = new LttngKernelAnalysis();
+ fKernelAnalysisModule = new KernelAnalysis();
fTrace = new LttngKernelTrace();
try {
fTrace.initTrace(null, CtfTmfTestTrace.KERNEL.getPath(), CtfTmfEvent.class);
}
/**
- * Test for {@link LttngKernelAnalysis#getAnalysisRequirements()}
+ * Test for {@link KernelAnalysis#getAnalysisRequirements()}
+ *
+ * FIXME Ignored for now because the analysis does not provide any
+ * requirements (it doesn't look for particular event names anymore).
*/
@Test
+ @Ignore
public void testGetAnalysisRequirements() {
Iterable<TmfAnalysisRequirement> requirements = fKernelAnalysisModule.getAnalysisRequirements();
assertNotNull(requirements);
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.StateValues;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelThreadInformationProvider;
-import org.eclipse.tracecompass.lttng2.kernel.core.tests.Activator;
-import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
-import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
-import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-import org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test analysis-specific methods for the {@link LttngKernelAnalysis} class.
- *
- * @author Geneviève Bastien
- */
-public class LttngKernelThreadInformationProviderTest {
-
- private static final @NonNull String LTTNG_KERNEL_FILE = "testfiles/lttng_kernel_analysis.xml";
- /**
- * The ID of the cpu usage analysis module for development traces
- */
- public static final String LTTNG_KERNEL_ANALYSIS_ID = "lttng2.kernel.core.tests.kernel.analysis";
-
- private ITmfTrace fTrace;
- private LttngKernelAnalysis fModule;
-
- private static void deleteSuppFiles(ITmfTrace trace) {
- /* Remove supplementary files */
- File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(trace));
- for (File file : suppDir.listFiles()) {
- file.delete();
- }
- }
-
- /**
- * Setup the trace for the tests
- */
- @Before
- public void setUp() {
- fTrace = new TmfXmlTraceStub();
- IPath filePath = Activator.getAbsoluteFilePath(LTTNG_KERNEL_FILE);
- IStatus status = fTrace.validate(null, filePath.toOSString());
- if (!status.isOK()) {
- fail(status.getException().getMessage());
- }
- try {
- fTrace.initTrace(null, filePath.toOSString(), TmfEvent.class);
- } catch (TmfTraceException e) {
- fail(e.getMessage());
- }
- deleteSuppFiles(fTrace);
- ((TmfTrace) fTrace).traceOpened(new TmfTraceOpenedSignal(this, fTrace, null));
- IAnalysisModule module = null;
- for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(fTrace, LttngKernelAnalysis.class)) {
- module = mod;
- }
- assertNotNull(module);
- module.schedule();
- module.waitForCompletion();
- fModule = TmfTraceUtils.getAnalysisModuleOfClass(fTrace, LttngKernelAnalysis.class, LTTNG_KERNEL_ANALYSIS_ID);
- assertNotNull(fModule);
- }
-
- /**
- * Clean up
- */
- @After
- public void tearDown() {
- deleteSuppFiles(fTrace);
- fTrace.dispose();
- }
-
- /**
- * Test the
- * {@link LttngKernelThreadInformationProvider#getThreadIds(LttngKernelAnalysis)}
- * method
- */
- @Test
- public void testGetThreadQuarks() {
- Collection<Integer> threadIds = LttngKernelThreadInformationProvider.getThreadIds(fModule);
- assertEquals(7, threadIds.size());
- }
-
- /**
- * Test the
- * {@link LttngKernelThreadInformationProvider#getThreadOnCpu(LttngKernelAnalysis, long, long)}
- * method
- */
- @Test
- public void testGetThreadOnCpu() {
-
- /* Check with invalid timestamps */
- Integer tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 0, -1);
- assertNull(tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 0, 80);
- assertNull(tid);
-
- /* Check with invalid cpus */
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 2, 20);
- assertNull(tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, -1, 20);
- assertNull(tid);
-
- /* Check valid values */
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 0, 4);
- assertNull(tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 0, 15);
- assertNull(tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 1, 15);
- assertEquals(Integer.valueOf(11), tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 1, 29);
- assertEquals(Integer.valueOf(20), tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 1, 30);
- assertEquals(Integer.valueOf(21), tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 0, 59);
- assertEquals(Integer.valueOf(11), tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 1, 59);
- assertEquals(Integer.valueOf(30), tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 0, 60);
- assertEquals(Integer.valueOf(11), tid);
-
- tid = LttngKernelThreadInformationProvider.getThreadOnCpu(fModule, 1, 60);
- assertEquals(Integer.valueOf(21), tid);
-
- }
-
- /**
- * Test the
- * {@link LttngKernelThreadInformationProvider#getParentPid(LttngKernelAnalysis, Integer, long)}
- * method
- */
- @Test
- public void testGetPpid() {
-
- /* Check with invalid timestamps */
- Integer ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, 11, -1);
- assertNull(ppid);
-
- ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, 11, 80);
- assertNull(ppid);
-
- /* Check with invalid cpus */
- ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, -4, 20);
- assertNull(ppid);
-
- ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, 12, 20);
- assertNull(ppid);
-
- /* Check values with no parent */
- ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, 10, 20);
- assertEquals(Integer.valueOf(0), ppid);
-
- ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, 30, 60);
- assertEquals(Integer.valueOf(0), ppid);
-
- /* Check parent determined at statedump */
- ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, 11, 4);
- assertNull(ppid);
-
- ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, 11, 5);
- assertEquals(Integer.valueOf(10), ppid);
-
- /* Check parent after process fork */
- ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, 21, 25);
- assertEquals(Integer.valueOf(20), ppid);
-
- ppid = LttngKernelThreadInformationProvider.getParentPid(fModule, 21, 70);
- assertEquals(Integer.valueOf(20), ppid);
-
- }
-
- /**
- * Test the {@link LttngKernelThreadInformationProvider#getExecutableName(LttngKernelAnalysis, Integer)} method
- */
- @Test
- public void testGetExecutableName() {
- /* Check with invalid threads */
- String execName = LttngKernelThreadInformationProvider.getExecutableName(fModule, 101);
- assertNull(execName);
-
- execName = LttngKernelThreadInformationProvider.getExecutableName(fModule, -2);
- assertNull(execName);
-
- /* Check valid value */
- execName = LttngKernelThreadInformationProvider.getExecutableName(fModule, 20);
- assertEquals("proc20", execName);
-
- /* Check valid value with process name change in history */
- execName = LttngKernelThreadInformationProvider.getExecutableName(fModule, 21);
- assertEquals("proc21", execName);
-
- }
-
- private static void testIntervals(String info, List<ITmfStateInterval> intervals, ITmfStateValue[] values) {
- assertEquals(info + " interval count", values.length, intervals.size());
- for (int i = 0; i < values.length; i++) {
- assertEquals(info + " interval " + i, values[i], intervals.get(i).getStateValue());
- }
- }
-
- /**
- * Test the
- * {@link LttngKernelThreadInformationProvider#getStatusIntervalsForThread(LttngKernelAnalysis, Integer, long, long, long, IProgressMonitor)}
- * method
- */
- @Test
- public void testGetStatusIntervalsForThread() {
-
- IProgressMonitor monitor = new NullProgressMonitor();
- Integer process21 = 21;
- Integer process20 = 20;
-
- /* Check invalid time ranges */
- List<ITmfStateInterval> intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, process21, -15, -5, 3, monitor);
- assertTrue(intervals.isEmpty());
-
- intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, process21, 80, 1500000000L, 50, monitor);
- assertTrue(intervals.isEmpty());
-
- /* Check invalid quarks */
- intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, -1, 0, 70L, 3, monitor);
- assertTrue(intervals.isEmpty());
-
- intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, 0, 0, 70L, 3, monitor);
- assertTrue(intervals.isEmpty());
-
- /* Check different time ranges and resolutions */
- ITmfStateValue[] values = { TmfStateValue.nullValue(), StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE,
- StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE, StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE,
- StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE };
- intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, process21, 0, 70L, 3, monitor);
- testIntervals("tid 21 [0,70,3]", intervals, values);
-
- ITmfStateValue[] values2 = { TmfStateValue.nullValue(), StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE,
- StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE };
- intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, process21, 1, 70L, 30, monitor);
- testIntervals("tid 21 [0,70,30]", intervals, values2);
-
- ITmfStateValue[] values3 = { StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE,
- StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE };
- intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, process21, 25, 50L, 3, monitor);
- testIntervals("tid 21 [25,50,3]", intervals, values3);
-
- ITmfStateValue[] values4 = { TmfStateValue.nullValue(), StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE,
- StateValues.PROCESS_STATUS_RUN_USERMODE_VALUE, StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE };
- intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, process20, 0, 70L, 3, monitor);
- testIntervals("tid 20 [0,70,3]", intervals, values4);
-
- ITmfStateValue[] values5 = { TmfStateValue.nullValue(), StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE };
- intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, process20, 1, 70L, 30, monitor);
- testIntervals("tid 20 [0,70,30]", intervals, values5);
-
- ITmfStateValue[] values6 = { StateValues.PROCESS_STATUS_RUN_USERMODE_VALUE,
- StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE };
- intervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(fModule, process20, 25, 50L, 3, monitor);
- testIntervals("tid 20 [25,50,3]", intervals, values6);
-
- }
-
-}
import java.io.PrintWriter;
import java.util.List;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelStateProvider;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.LttngEventLayout;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelStateProvider;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
TmfStateSystemAnalysisModule module = new TmfStateSystemAnalysisModule() {
@Override
protected ITmfStateProvider createStateProvider() {
- return new LttngKernelStateProvider(trace, LttngEventLayout.getInstance());
+ return new KernelStateProvider(trace, LttngEventLayout.getInstance());
}
@Override
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeTrue;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelStateProvider;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.LttngEventLayout;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelStateProvider;
import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTrace;
import org.junit.BeforeClass;
import org.junit.Test;
/**
- * Tests for the {@link LttngKernelStateProvider}
+ * Tests for the {@link KernelStateProvider}
*
* @author Alexandre Montplaisir
*/
@BeforeClass
public static void initialize() {
assumeTrue(testTrace.exists());
- input = new LttngKernelStateProvider(testTrace.getTrace(), LttngEventLayout.getInstance());
+ input = new KernelStateProvider(testTrace.getTrace(), LttngEventLayout.getInstance());
}
/**
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelStateProvider;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.LttngEventLayout;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelStateProvider;
import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
@Override
protected ITmfStateProvider createStateProvider() {
- return new LttngKernelStateProvider(checkNotNull(getTrace()), LttngEventLayout.getInstance());
+ return new KernelStateProvider(checkNotNull(getTrace()), LttngEventLayout.getInstance());
}
@Override
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelStateProvider;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.LttngEventLayout;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelStateProvider;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
@Override
protected ITmfStateProvider createStateProvider() {
- return new LttngKernelStateProvider(checkNotNull(getTrace()), LttngEventLayout.getInstance());
+ return new KernelStateProvider(checkNotNull(getTrace()), LttngEventLayout.getInstance());
}
@Override
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelStateProvider;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.LttngEventLayout;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelStateProvider;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
@Override
protected ITmfStateProvider createStateProvider() {
- return new LttngKernelStateProvider(checkNotNull(getTrace()), LttngEventLayout.getInstance());
+ return new KernelStateProvider(checkNotNull(getTrace()), LttngEventLayout.getInstance());
}
@Override
import java.util.List;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
import java.util.List;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VcpuStateValues;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VmAttributes;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.module.VirtualMachineCpuAnalysis;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.trace.VirtualMachineExperiment;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
import org.eclipse.tracecompass.lttng2.lttng.kernel.core.tests.shared.vm.VmTestExperiment;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
* is implemented, we can remove this
*/
for (ITmfTrace trace : experiment.getTraces()) {
- for (LttngKernelAnalysis module : TmfTraceUtils.getAnalysisModulesOfClass(trace, LttngKernelAnalysis.class)) {
+ for (KernelAnalysis module : TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysis.class)) {
module.schedule();
module.waitForCompletion();
}
+++ /dev/null
-<trace>
-<event timestamp="0" name="set_aspects">
-<field name="cpu" value="1" type="int" />
-</event>
-<event timestamp="1" name="sched_switch">
-<field name="cpu" value="0" type="int" />
-<field name="prev_comm" value="proc1" type="string" />
-<field name="prev_tid" value="1" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc2" type="string" />
-<field name="next_tid" value="2" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="2" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc3" type="string" />
-<field name="prev_tid" value="3" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc4" type="string" />
-<field name="next_tid" value="4" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="5" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc4" type="string" />
-<field name="prev_tid" value="4" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc3" type="string" />
-<field name="next_tid" value="3" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="10" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc3" type="string" />
-<field name="prev_tid" value="3" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc4" type="string" />
-<field name="next_tid" value="4" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="15" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc4" type="string" />
-<field name="prev_tid" value="4" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc1" type="string" />
-<field name="next_tid" value="1" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="20" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc1" type="string" />
-<field name="prev_tid" value="1" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc4" type="string" />
-<field name="next_tid" value="4" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="20" name="sched_switch">
-<field name="cpu" value="0" type="int" />
-<field name="prev_comm" value="proc2" type="string" />
-<field name="prev_tid" value="2" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc3" type="string" />
-<field name="next_tid" value="3" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="25" name="sched_switch">
-<field name="cpu" value="0" type="int" />
-<field name="prev_comm" value="proc3" type="string" />
-<field name="prev_tid" value="3" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc2" type="string" />
-<field name="next_tid" value="2" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-</trace>
\ No newline at end of file
+++ /dev/null
-<!-- ***************************************************************************
-* Simple LTTng Kernel trace, with simple process statedumps,
-* sched_switches and a process forking
-*************************************************************************** -->
-<trace>
-<event timestamp="0" name="set_aspects">
-<field name="cpu" value="1" type="int" />
-</event>
-<event timestamp="1" name="lttng_statedump_process_state">
-<field name="cpu" value="0" type="int" />
-<field name="tid" value="10" type="long" />
-<field name="vtid" value="10" type="long" />
-<field name="pid" value="10" type="long" />
-<field name="vpid" value="10" type="long" />
-<field name="ppid" value="0" type="long" />
-<field name="vppid" value="0" type="long" />
-<field name="type" value="1" type="int" />
-<field name="mode" value="5" type="int" />
-<field name="submode" value="0" type="int" />
-<field name="status" value="5" type="long" />
-<field name="ns_level" value="0" type="int" />
-<field name="name" value="proc10" type="string" />
-</event>
-<event timestamp="5" name="lttng_statedump_process_state">
-<field name="cpu" value="0" type="int" />
-<field name="tid" value="11" type="long" />
-<field name="vtid" value="11" type="long" />
-<field name="pid" value="11" type="long" />
-<field name="vpid" value="11" type="long" />
-<field name="ppid" value="10" type="long" />
-<field name="vppid" value="10" type="long" />
-<field name="type" value="1" type="int" />
-<field name="mode" value="5" type="int" />
-<field name="submode" value="0" type="int" />
-<field name="status" value="5" type="long" />
-<field name="ns_level" value="0" type="int" />
-<field name="name" value="proc11" type="string" />
-</event>
-<event timestamp="10" name="lttng_statedump_process_state">
-<field name="cpu" value="0" type="int" />
-<field name="tid" value="20" type="long" />
-<field name="vtid" value="20" type="long" />
-<field name="pid" value="20" type="long" />
-<field name="vpid" value="20" type="long" />
-<field name="ppid" value="0" type="long" />
-<field name="vppid" value="0" type="long" />
-<field name="type" value="1" type="int" />
-<field name="mode" value="5" type="int" />
-<field name="submode" value="0" type="int" />
-<field name="status" value="5" type="long" />
-<field name="ns_level" value="0" type="int" />
-<field name="name" value="proc20" type="string" />
-</event>
-<event timestamp="12" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc3" type="string" />
-<field name="prev_tid" value="30" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc11" type="string" />
-<field name="next_tid" value="11" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="15" name="lttng_statedump_process_state">
-<field name="cpu" value="0" type="int" />
-<field name="tid" value="30" type="long" />
-<field name="vtid" value="30" type="long" />
-<field name="pid" value="30" type="long" />
-<field name="vpid" value="30" type="long" />
-<field name="ppid" value="0" type="long" />
-<field name="vppid" value="0" type="long" />
-<field name="type" value="1" type="int" />
-<field name="mode" value="5" type="int" />
-<field name="submode" value="0" type="int" />
-<field name="status" value="5" type="long" />
-<field name="ns_level" value="0" type="int" />
-<field name="name" value="proc30" type="string" />
-</event>
-<event timestamp="17" name="lttng_statedump_end">
-<field name="cpu" value="0" type="int" />
-</event>
-<event timestamp="20" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc11" type="string" />
-<field name="prev_tid" value="10" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc20" type="string" />
-<field name="next_tid" value="20" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="25" name="sched_process_fork">
-<field name="cpu" value="1" type="int" />
-<field name="parent_comm" value="proc20" type="string" />
-<field name="parent_tid" value="20" type="long" />
-<field name="parent_pid" value="20" type="int" />
-<field name="child_comm" value="proc20" type="string" />
-<field name="child_tid" value="21" type="long" />
-<field name="child_pid" value="20" type="int" />
-</event>
-<event timestamp="30" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc20" type="string" />
-<field name="prev_tid" value="20" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc21" type="string" />
-<field name="next_tid" value="21" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="35" name="sched_switch">
-<field name="cpu" value="0" type="int" />
-<field name="prev_comm" value="lttng-sessiond" type="string" />
-<field name="prev_tid" value="100" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc11" type="string" />
-<field name="next_tid" value="11" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="50" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc21" type="string" />
-<field name="prev_tid" value="21" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc30" type="string" />
-<field name="next_tid" value="30" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="60" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc30" type="string" />
-<field name="prev_tid" value="30" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc21" type="string" />
-<field name="next_tid" value="21" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-<event timestamp="70" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc21" type="string" />
-<field name="prev_tid" value="21" type="long" />
-<field name="prev_prio" value="20" type="int" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc20" type="string" />
-<field name="next_tid" value="20" type="long" />
-<field name="next_prio" value="20" type="int" />
-</event>
-</trace>
\ No newline at end of file
org.eclipse.tracecompass.ctf.core;bundle-version="0.1.0",
org.eclipse.tracecompass.tmf.core;bundle-version="0.1.0",
org.eclipse.tracecompass.tmf.ctf.core,
- org.eclipse.tracecompass.lttng2.control.core
+ org.eclipse.tracecompass.lttng2.control.core,
+ org.eclipse.tracecompass.analysis.os.linux.core
Export-Package: org.eclipse.tracecompass.internal.lttng2.kernel.core;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui,org.eclipse.tracecompass.lttng2.kernel.core.tests",
org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm;x-friends:="org.eclipse.tracecompass.lttng2.kernel.core.tests,org.eclipse.tracecompass.lttng2.kernel.ui",
org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model;x-friends:="org.eclipse.tracecompass.lttng2.kernel.core.tests,org.eclipse.tracecompass.lttng2.kernel.ui",
org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.trace;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui,org.eclipse.tracecompass.lttng2.kernel.core.tests",
org.eclipse.tracecompass.internal.lttng2.kernel.core.event.matching,
org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout;x-friends:="org.eclipse.tracecompass.lttng2.kernel.core.tests,org.eclipse.tracecompass.lttng2.kernel.ui",
- org.eclipse.tracecompass.lttng2.kernel.core.analysis.cpuusage,
- org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel,
org.eclipse.tracecompass.lttng2.kernel.core.trace
Import-Package: com.google.common.collect,
com.google.common.hash;version="15.0.0"
</extension>
<extension
point="org.eclipse.linuxtools.tmf.core.analysis">
- <module
- analysis_module="org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis"
- automatic="true"
- id="org.eclipse.linuxtools.lttng2.kernel.analysis"
- name="%analysis.lttngkernel">
- <tracetype
- class="org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace">
- </tracetype>
- </module>
- <module
- analysis_module="org.eclipse.tracecompass.lttng2.kernel.core.analysis.cpuusage.LttngKernelCpuUsageAnalysis"
- id="org.eclipse.linuxtools.lttng2.kernel.core.cpuusage"
- name="%cpuusage.lttng.kernel">
- <tracetype
- applies="true"
- class="org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace">
- </tracetype>
- </module>
<module
analysis_module="org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.module.VirtualMachineCpuAnalysis"
automatic="false"
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexandre Montplaisir - Initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.core;
-
-/**
- * This file defines all the attribute names used in the handler. Both the
- * construction and query steps should use them.
- *
- * These should not be externalized! The values here are used as-is in the
- * history file on disk, so they should be kept the same to keep the file format
- * compatible. If a view shows attribute names directly, the localization should
- * be done on the viewer side.
- *
- * @author alexmont
- *
- */
-@SuppressWarnings({"nls", "javadoc"})
-public interface Attributes {
-
- /* First-level attributes */
- static final String CPUS = "CPUs";
- static final String THREADS = "Threads";
- static final String RESOURCES = "Resources";
-
- /* Sub-attributes of the CPU nodes */
- static final String CURRENT_THREAD = "Current_thread";
- static final String STATUS = "Status";
-
- /* Sub-attributes of the Thread nodes */
- static final String PPID = "PPID";
- //static final String STATUS = "Status"
- static final String EXEC_NAME = "Exec_name";
- static final String SYSTEM_CALL = "System_call";
-
- /* Attributes under "Resources" */
- static final String IRQS = "IRQs";
- static final String SOFT_IRQS = "Soft_IRQs";
-
- /* Misc stuff */
- static final String UNKNOWN = "Unknown";
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexandre Montplaisir - Initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.core;
-
-import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
-
-/**
- * State values that are used in the kernel event handler. It's much better to
- * use integer values whenever possible, since those take much less space in the
- * history file.
- *
- * @author alexmont
- *
- */
-@SuppressWarnings("javadoc")
-public interface StateValues {
-
- /* CPU Status */
- static final int CPU_STATUS_IDLE = 0;
- static final int CPU_STATUS_RUN_USERMODE = 1;
- static final int CPU_STATUS_RUN_SYSCALL = 2;
- static final int CPU_STATUS_IRQ = 3;
- static final int CPU_STATUS_SOFTIRQ = 4;
-
- static final ITmfStateValue CPU_STATUS_IDLE_VALUE = TmfStateValue.newValueInt(CPU_STATUS_IDLE);
- static final ITmfStateValue CPU_STATUS_RUN_USERMODE_VALUE = TmfStateValue.newValueInt(CPU_STATUS_RUN_USERMODE);
- static final ITmfStateValue CPU_STATUS_RUN_SYSCALL_VALUE = TmfStateValue.newValueInt(CPU_STATUS_RUN_SYSCALL);
- static final ITmfStateValue CPU_STATUS_IRQ_VALUE = TmfStateValue.newValueInt(CPU_STATUS_IRQ);
- static final ITmfStateValue CPU_STATUS_SOFTIRQ_VALUE = TmfStateValue.newValueInt(CPU_STATUS_SOFTIRQ);
-
- /* Process status */
- static final int PROCESS_STATUS_UNKNOWN = 0;
- static final int PROCESS_STATUS_WAIT_BLOCKED = 1;
- static final int PROCESS_STATUS_RUN_USERMODE = 2;
- static final int PROCESS_STATUS_RUN_SYSCALL = 3;
- static final int PROCESS_STATUS_INTERRUPTED = 4;
- static final int PROCESS_STATUS_WAIT_FOR_CPU = 5;
-
- static final ITmfStateValue PROCESS_STATUS_UNKNOWN_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_UNKNOWN);
- static final ITmfStateValue PROCESS_STATUS_WAIT_BLOCKED_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_WAIT_BLOCKED);
- static final ITmfStateValue PROCESS_STATUS_RUN_USERMODE_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_RUN_USERMODE);
- static final ITmfStateValue PROCESS_STATUS_RUN_SYSCALL_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_RUN_SYSCALL);
- static final ITmfStateValue PROCESS_STATUS_INTERRUPTED_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_INTERRUPTED);
- static final ITmfStateValue PROCESS_STATUS_WAIT_FOR_CPU_VALUE = TmfStateValue.newValueInt(PROCESS_STATUS_WAIT_FOR_CPU);
-
- /* SoftIRQ-specific stuff. -1: null/disabled, >= 0: running on that CPU */
- static final int SOFT_IRQ_RAISED = -2;
-
- static final ITmfStateValue SOFT_IRQ_RAISED_VALUE = TmfStateValue.newValueInt(SOFT_IRQ_RAISED);
-}
import java.util.Set;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
import org.eclipse.tracecompass.common.core.NonNullUtils;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.HostThread;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.IVirtualMachineModel;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualCPU;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualMachine;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelThreadInformationProvider;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
import org.eclipse.tracecompass.tmf.core.event.TmfEventField;
* Maybe the parent of the current thread has a VM associated, see if we
* can infer the VM for this thread
*/
- LttngKernelAnalysis module = getLttngKernelModuleFor(ht.getHost());
+ KernelAnalysis module = getLttngKernelModuleFor(ht.getHost());
if (module == null) {
return null;
}
- Integer ppid = LttngKernelThreadInformationProvider.getParentPid(module, ht.getTid(), event.getTimestamp().getValue());
+ Integer ppid = KernelThreadInformationProvider.getParentPid(module, ht.getTid(), event.getTimestamp().getValue());
if (ppid == null) {
return null;
}
* We found the VM being run, let's associate it with the thread
* ID
*/
- LttngKernelAnalysis module = getLttngKernelModuleFor(hostId);
+ KernelAnalysis module = getLttngKernelModuleFor(hostId);
if (module == null) {
break;
}
- Integer tid = LttngKernelThreadInformationProvider.getThreadOnCpu(module, cpu, ts);
+ Integer tid = KernelThreadInformationProvider.getThreadOnCpu(module, cpu, ts);
if (tid == null) {
/*
* We do not know which process is running at this point. It
* To make sure siblings are also associated with this VM, also
* add an entry for the parent TID
*/
- Integer ppid = LttngKernelThreadInformationProvider.getParentPid(module, tid, ts);
+ Integer ppid = KernelThreadInformationProvider.getParentPid(module, tid, ts);
if (ppid != null) {
HostThread parentHt = new HostThread(hostId, ppid);
fTidToVm.put(parentHt, entry.getValue());
}
}
- private @Nullable LttngKernelAnalysis getLttngKernelModuleFor(String hostId) {
- return TmfExperimentUtils.getAnalysisModuleOfClassForHost(fExperiment, hostId, LttngKernelAnalysis.class);
+ private @Nullable KernelAnalysis getLttngKernelModuleFor(String hostId) {
+ return TmfExperimentUtils.getAnalysisModuleOfClassForHost(fExperiment, hostId, KernelAnalysis.class);
}
}
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
import org.eclipse.tracecompass.common.core.NonNullUtils;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VcpuStateValues;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VmAttributes;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelThreadInformationProvider;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
Set<IAnalysisModule> modules = new HashSet<>();
/* Depends on the LTTng Kernel analysis modules */
for (ITmfTrace trace : TmfTraceManager.getTraceSet(getTrace())) {
- for (LttngKernelAnalysis module : TmfTraceUtils.getAnalysisModulesOfClass(trace, LttngKernelAnalysis.class)) {
+ for (KernelAnalysis module : TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysis.class)) {
modules.add(module);
}
}
}
String vmHostId = NonNullUtils.checkNotNull(ss.getAttributeName(vmQuark));
- LttngKernelAnalysis kernelModule = TmfExperimentUtils.getAnalysisModuleOfClassForHost((TmfExperiment) trace, vmHostId, LttngKernelAnalysis.class);
+ KernelAnalysis kernelModule = TmfExperimentUtils.getAnalysisModuleOfClassForHost((TmfExperiment) trace, vmHostId, KernelAnalysis.class);
if (kernelModule == null) {
return map;
}
* Initialize the map with the original status intervals from the kernel
* module
*/
- for (Integer tid : LttngKernelThreadInformationProvider.getThreadIds(kernelModule)) {
+ for (Integer tid : KernelThreadInformationProvider.getThreadIds(kernelModule)) {
if (tid == null) {
throw new IllegalStateException();
}
- map.putAll(tid, LttngKernelThreadInformationProvider.getStatusIntervalsForThread(kernelModule, tid, start, end, resolution, monitor));
+ map.putAll(tid, KernelThreadInformationProvider.getStatusIntervalsForThread(kernelModule, tid, start, end, resolution, monitor));
if (monitor.isCanceled()) {
return map;
}
if ((value & (VcpuStateValues.VCPU_PREEMPT | VcpuStateValues.VCPU_VMM)) == 0) {
break;
}
- Integer threadOnCpu = LttngKernelThreadInformationProvider.getThreadOnCpu(kernelModule, virtualCPU, cpuInterval.getStartTime());
+ Integer threadOnCpu = KernelThreadInformationProvider.getThreadOnCpu(kernelModule, virtualCPU, cpuInterval.getStartTime());
if (threadOnCpu != null) {
map.put(threadOnCpu, new TmfStateInterval(cpuInterval.getStartTime(), cpuInterval.getEndTime(), threadOnCpu, VCPU_PREEMPT_VALUE));
}
import java.util.Map;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
import org.eclipse.tracecompass.common.core.NonNullUtils;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.Activator;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VcpuStateValues;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualCPU;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualMachine;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.qemukvm.QemuKvmVmModel;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.IKernelAnalysisEventLayout;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.LttngEventLayout;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelThreadInformationProvider;
import org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
private void buildEventNames(ITmfTrace trace) {
IKernelAnalysisEventLayout layout;
if (trace instanceof LttngKernelTrace) {
- layout = ((LttngKernelTrace) trace).getEventLayout();
+ layout = ((LttngKernelTrace) trace).getKernelEventLayout();
} else {
/* Fall-back to the base LttngEventLayout */
layout = LttngEventLayout.getInstance();
private @Nullable HostThread getCurrentHostThread(ITmfEvent event, long ts) {
/* Get the LTTng kernel analysis for the host */
String hostId = event.getTrace().getHostId();
- LttngKernelAnalysis module = TmfExperimentUtils.getAnalysisModuleOfClassForHost(getTrace(), hostId, LttngKernelAnalysis.class);
+ KernelAnalysis module = TmfExperimentUtils.getAnalysisModuleOfClassForHost(getTrace(), hostId, KernelAnalysis.class);
if (module == null) {
return null;
}
return null;
}
- Integer currentTid = LttngKernelThreadInformationProvider.getThreadOnCpu(module, cpu, ts);
+ Integer currentTid = KernelThreadInformationProvider.getThreadOnCpu(module, cpu, ts);
if (currentTid == null) {
return null;
}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexandre Montplaisir - Initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout;
-
-import java.util.Collection;
-
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * Interface to define "concepts" present in the Linux kernel (represented by
- * its tracepoints), that can then be exposed by different tracers under
- * different names.
- *
- * @author Alexandre Montplaisir
- */
-// The methods are named after the TRACE_EVENT's, should be straightforward
-@SuppressWarnings("javadoc")
-public interface IKernelAnalysisEventLayout {
-
- // ------------------------------------------------------------------------
- // Common definitions
- // ------------------------------------------------------------------------
-
- /**
- * Whenever a process appears for the first time in a trace, we assume it
- * starts inside this system call. (The syscall prefix is defined by the
- * implementer of this interface.)
- *
- * TODO Change to a default method with Java 8?
- */
- String INITIAL_SYSCALL_NAME = "clone"; //$NON-NLS-1$
-
- // ------------------------------------------------------------------------
- // Event names
- // ------------------------------------------------------------------------
-
- String eventIrqHandlerEntry();
- String eventIrqHandlerExit();
- String eventSoftIrqEntry();
- String eventSoftIrqExit();
- String eventSoftIrqRaise();
- String eventSchedSwitch();
- Collection<String> eventsSchedWakeup();
- String eventSchedProcessFork();
- String eventSchedProcessExit();
- String eventSchedProcessFree();
- @Nullable String eventStatedumpProcessState();
- String eventSyscallEntryPrefix();
- String eventCompatSyscallEntryPrefix();
- String eventSyscallExitPrefix();
-
- // ------------------------------------------------------------------------
- // Event field names
- // ------------------------------------------------------------------------
-
- String fieldIrq();
- String fieldVec();
- String fieldTid();
- String fieldPrevTid();
- String fieldPrevState();
- String fieldNextComm();
- String fieldNextTid();
- String fieldChildComm();
- String fieldParentTid();
- String fieldChildTid();
-}
import java.util.Collection;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
import com.google.common.collect.ImmutableList;
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.analysis.cpuusage;
-
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Activator;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.IKernelAnalysisEventLayout;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.LttngEventLayout;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
-import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
-import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
-import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-
-/**
- * This analysis module computes the CPU usage of a system from a kernel trace.
- * It requires the LTTng Kernel analysis module to have accurate CPU usage data.
- *
- * @author Geneviève Bastien
- * @since 3.0
- */
-public class LttngKernelCpuUsageAnalysis extends TmfStateSystemAnalysisModule {
-
- /** The ID of this analysis */
- public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.core.cpuusage"; //$NON-NLS-1$
-
- /** Text used to identify 'total' entries in the returned maps */
- public static final String TOTAL = "total"; //$NON-NLS-1$
- /** String used to separate elements in the returned maps */
- public static final String SPLIT_STRING = "/"; //$NON-NLS-1$
- /** Idle process thread ID */
- public static final String TID_ZERO = "0"; //$NON-NLS-1$
-
- @Override
- protected ITmfStateProvider createStateProvider() {
- ITmfTrace trace = checkNotNull(getTrace());
- IKernelAnalysisEventLayout layout;
-
- if (trace instanceof LttngKernelTrace) {
- layout = ((LttngKernelTrace) trace).getEventLayout();
- } else {
- /* Fall-back to the base LttngEventLayout */
- layout = LttngEventLayout.getInstance();
- }
-
- return new LttngKernelCpuUsageStateProvider(trace, layout);
- }
-
- @Override
- protected StateSystemBackendType getBackendType() {
- return StateSystemBackendType.FULL;
- }
-
- @Override
- protected Iterable<IAnalysisModule> getDependentAnalyses() {
- Set<IAnalysisModule> modules = new HashSet<>();
-
- ITmfTrace trace = getTrace();
- if (trace == null) {
- throw new IllegalStateException();
- }
- /*
- * This analysis depends on the LTTng kernel analysis, so it's added to
- * dependent modules.
- */
- Iterable<LttngKernelAnalysis> kernelModules = TmfTraceUtils.getAnalysisModulesOfClass(trace, LttngKernelAnalysis.class);
- for (LttngKernelAnalysis kernelModule : kernelModules) {
- /* Only add the first one we find, if there is one */
- modules.add(kernelModule);
- break;
- }
- return modules;
- }
-
- /**
- * Get a map of time spent on CPU by various threads during a time range.
- *
- * @param start
- * Start time of requested range
- * @param end
- * End time of requested range
- * @return A map of TID -> time spent on CPU in the [start, end] interval
- */
- public Map<String, Long> getCpuUsageInRange(long start, long end) {
- Map<String, Long> map = new HashMap<>();
- Map<String, Long> totalMap = new HashMap<>();
-
- ITmfTrace trace = getTrace();
- ITmfStateSystem cpuSs = getStateSystem();
- if (trace == null || cpuSs == null) {
- return map;
- }
- ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystemByModuleClass(trace, LttngKernelAnalysis.class);
- if (kernelSs == null) {
- return map;
- }
-
- /*
- * Make sure the start/end times are within the state history, so we
- * don't get TimeRange exceptions.
- */
- long startTime = Math.max(start, cpuSs.getStartTime());
- startTime = Math.max(startTime, kernelSs.getStartTime());
- long endTime = Math.min(end, cpuSs.getCurrentEndTime());
- endTime = Math.min(endTime, kernelSs.getCurrentEndTime());
- long totalTime = 0;
- if (endTime < startTime) {
- return map;
- }
-
- try {
- /* Get the list of quarks for each CPU and CPU's TIDs */
- int cpusNode = cpuSs.getQuarkAbsolute(Attributes.CPUS);
- Map<Integer, List<Integer>> tidsPerCpu = new HashMap<>();
- for (int cpuNode : cpuSs.getSubAttributes(cpusNode, false)) {
- tidsPerCpu.put(cpuNode, cpuSs.getSubAttributes(cpuNode, false));
- }
-
- /* Query full states at start and end times */
- List<ITmfStateInterval> kernelEndState = kernelSs.queryFullState(endTime);
- List<ITmfStateInterval> endState = cpuSs.queryFullState(endTime);
- List<ITmfStateInterval> kernelStartState = kernelSs.queryFullState(startTime);
- List<ITmfStateInterval> startState = cpuSs.queryFullState(startTime);
-
- long countAtStart, countAtEnd;
-
- for (Entry<Integer, List<Integer>> entry : tidsPerCpu.entrySet()) {
- int cpuNode = entry.getKey();
- List<Integer> tidNodes = entry.getValue();
-
- String curCpuName = cpuSs.getAttributeName(cpuNode);
- long cpuTotal = 0;
-
- /* Get the quark of the thread running on this CPU */
- int currentThreadQuark = kernelSs.getQuarkAbsolute(Attributes.CPUS, curCpuName, Attributes.CURRENT_THREAD);
- /* Get the currently running thread on this CPU */
- int startThread = kernelStartState.get(currentThreadQuark).getStateValue().unboxInt();
- int endThread = kernelEndState.get(currentThreadQuark).getStateValue().unboxInt();
-
- for (int tidNode : tidNodes) {
- String curTidName = cpuSs.getAttributeName(tidNode);
- int tid = Integer.parseInt(curTidName);
-
- countAtEnd = endState.get(tidNode).getStateValue().unboxLong();
- countAtStart = startState.get(tidNode).getStateValue().unboxLong();
- if (countAtStart == -1) {
- countAtStart = 0;
- }
- if (countAtEnd == -1) {
- countAtEnd = 0;
- }
-
- /*
- * Interpolate start and end time of threads running at
- * those times
- */
- if (tid == startThread || startThread == -1) {
- long runningTime = kernelStartState.get(currentThreadQuark).getEndTime() - kernelStartState.get(currentThreadQuark).getStartTime();
- long runningEnd = kernelStartState.get(currentThreadQuark).getEndTime();
-
- countAtStart = interpolateCount(countAtStart, startTime, runningEnd, runningTime);
- }
- if (tid == endThread) {
- long runningTime = kernelEndState.get(currentThreadQuark).getEndTime() - kernelEndState.get(currentThreadQuark).getStartTime();
- long runningEnd = kernelEndState.get(currentThreadQuark).getEndTime();
-
- countAtEnd = interpolateCount(countAtEnd, endTime, runningEnd, runningTime);
- }
- /*
- * If startThread is -1, we made the hypothesis that the
- * process running at start was the current one. If the
- * count is negative, we were wrong in this hypothesis. Also
- * if the time at end is 0, it either means the process
- * hasn't been on the CPU or that we still don't know who is
- * running. In both cases, that invalidates the hypothesis.
- */
- if ((startThread == -1) && ((countAtEnd - countAtStart < 0) || (countAtEnd == 0))) {
- countAtStart = 0;
- }
-
- long currentCount = countAtEnd - countAtStart;
- if (currentCount < 0) {
- Activator.getDefault().logWarning(String.format("Negative count: start %d, end %d", countAtStart, countAtEnd)); //$NON-NLS-1$
- currentCount = 0;
- } else if (currentCount > endTime - startTime) {
- Activator.getDefault().logWarning(String.format("CPU Usage: Spent more time on CPU than allowed: %s spent %d when max should be %d", curTidName, currentCount, endTime - startTime)); //$NON-NLS-1$
- currentCount = 0;
- }
- cpuTotal += currentCount;
- map.put(curCpuName + SPLIT_STRING + curTidName, currentCount);
- addToMap(totalMap, curTidName, currentCount);
- totalTime += (currentCount);
- }
- map.put(curCpuName, cpuTotal);
- }
-
- /* Add the totals to the map */
- for (Entry<String, Long> entry : totalMap.entrySet()) {
- map.put(TOTAL + SPLIT_STRING + entry.getKey(), entry.getValue());
- }
- map.put(TOTAL, totalTime);
-
- } catch (TimeRangeException | AttributeNotFoundException e) {
- /*
- * Assume there is no events or the attribute does not exist yet,
- * nothing will be put in the map.
- */
- } catch (StateValueTypeException | StateSystemDisposedException e) {
- /*
- * These other exception types would show a logic problem, so they
- * should not happen.
- */
- Activator.getDefault().logError("Error getting CPU usage in a time range", e); //$NON-NLS-1$
- }
-
- return map;
- }
-
- private static long interpolateCount(long count, long ts, long runningEnd, long runningTime) {
- long newCount = count;
-
- /* sanity check */
- if (runningTime > 0) {
-
- long runningStart = runningEnd - runningTime;
-
- if (ts < runningStart) {
- /*
- * This interval was not started, this can happen if the current
- * running thread is unknown and we execute this method. It just
- * means that this process was not the one running
- */
- return newCount;
- }
- newCount += (ts - runningStart);
- }
- return newCount;
- }
-
- /*
- * Add the value to the previous value in the map. If the key was not set,
- * assume 0
- */
- private static void addToMap(Map<String, Long> map, String key, Long value) {
- Long addTo = map.get(key);
- if (addTo == null) {
- map.put(key, value);
- } else {
- map.put(key, addTo + value);
- }
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * François Rajotte - Initial API and implementation
- * Geneviève Bastien - Revision of the initial implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.analysis.cpuusage;
-
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Activator;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.IKernelAnalysisEventLayout;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
-import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
-import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
-import org.eclipse.tracecompass.tmf.core.event.aspect.TmfCpuAspect;
-import org.eclipse.tracecompass.tmf.core.statesystem.AbstractTmfStateProvider;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-
-/**
- * Creates a state system with the total time spent on CPU for each thread and
- * for each CPU from a kernel trace.
- *
- * This state system in itself keeps the total time on CPU since last time the
- * process was scheduled out. The state system queries will only be accurate
- * when the process is not in a running state. To have exact CPU usage when
- * running, this state system needs to be used along the LTTng Kernel analysis.
- *
- * It requires only the 'sched_switch' events enabled on the trace.
- *
- * @author François Rajotte
- * @since 3.0
- */
-public class LttngKernelCpuUsageStateProvider extends AbstractTmfStateProvider {
-
- private static final int VERSION = 2;
-
- /* For each CPU, maps the last time a thread was scheduled in */
- private final Map<Integer, Long> fLastStartTimes = new HashMap<>();
- private final long fTraceStart;
- private final @NonNull IKernelAnalysisEventLayout fLayout;
-
- /**
- * Constructor
- *
- * @param trace
- * The trace from which to get the CPU usage
- * @param layout
- * The event layout to use for this state provider.
- */
- public LttngKernelCpuUsageStateProvider(@NonNull ITmfTrace trace,
- @NonNull IKernelAnalysisEventLayout layout) {
- super(trace, ITmfEvent.class, "LTTng Kernel CPU usage"); //$NON-NLS-1$
- fTraceStart = trace.getStartTime().getValue();
- fLayout = layout;
- }
-
- // ------------------------------------------------------------------------
- // ITmfStateProvider
- // ------------------------------------------------------------------------
-
- @Override
- public int getVersion() {
- return VERSION;
- }
-
- @Override
- public LttngKernelCpuUsageStateProvider getNewInstance() {
- return new LttngKernelCpuUsageStateProvider(this.getTrace(), this.fLayout);
- }
-
- @Override
- protected void eventHandle(ITmfEvent event) {
- final ITmfStateSystemBuilder ss = checkNotNull(getStateSystemBuilder());
- final String eventName = event.getType().getName();
-
- if (eventName.equals(fLayout.eventSchedSwitch())) {
- Integer cpu = null;
- Iterable<TmfCpuAspect> aspects = TmfTraceUtils.getEventAspectsOfClass(event.getTrace(), TmfCpuAspect.class);
- for (TmfCpuAspect aspect : aspects) {
- cpu = aspect.resolve(event);
- if (cpu != null) {
- break;
- }
- }
- if (cpu == null) {
- /* We couldn't find any CPU information, ignore this event */
- return;
- }
-
- /*
- * Fields: string prev_comm, int32 prev_tid, int32 prev_prio, int64
- * prev_state, string next_comm, int32 next_tid, int32 next_prio
- */
- ITmfEventField content = event.getContent();
- long ts = event.getTimestamp().getValue();
-
- Long prevTid = (Long) content.getField(fLayout.fieldPrevTid()).getValue();
-
- try {
- Integer currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(ss), cpu.toString());
-
- /*
- * This quark contains the value of the cumulative time spent on
- * the source CPU by the currently running thread
- */
- Integer cumulativeTimeQuark = ss.getQuarkRelativeAndAdd(currentCPUNode, prevTid.toString());
- Long startTime = fLastStartTimes.get(cpu);
- /*
- * If start time is null, we haven't seen the start of the
- * process, so we assume beginning of the trace
- */
- if (startTime == null) {
- startTime = fTraceStart;
- }
-
- /*
- * We add the time from startTime until now to the cumulative
- * time of the thread
- */
- if (startTime != null) {
- ITmfStateValue value = ss.queryOngoingState(cumulativeTimeQuark);
-
- /*
- * Modify cumulative time for this CPU/TID combo: The total
- * time changes when the process is scheduled out. Nothing
- * happens when the process is scheduled in.
- */
- long prevCumulativeTime = Math.max(0, value.unboxLong());
- long newCumulativeTime = prevCumulativeTime + (ts - startTime);
-
- value = TmfStateValue.newValueLong(newCumulativeTime);
- ss.modifyAttribute(ts, value, cumulativeTimeQuark);
- fLastStartTimes.put(cpu, ts);
- }
- } catch (AttributeNotFoundException e) {
- Activator.getDefault().logError("Attribute not found in LttngKernelCpuStateProvider", e); //$NON-NLS-1$
- }
-
- }
- }
-
- /* Shortcut for the "current CPU" attribute node */
- private static int getNodeCPUs(ITmfStateSystemBuilder ssb) {
- return ssb.getQuarkAbsoluteAndAdd(Attributes.CPUS);
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- * Mathieu Rail - Provide the requirements of the analysis
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel;
-
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
-import java.util.Set;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.IKernelAnalysisEventLayout;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.LttngEventLayout;
-import org.eclipse.tracecompass.lttng2.control.core.session.SessionConfigStrings;
-import org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace;
-import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement;
-import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel;
-import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
-import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * State System Module for lttng kernel traces
- *
- * @author Geneviève Bastien
- * @since 3.0
- */
-public class LttngKernelAnalysis extends TmfStateSystemAnalysisModule {
-
- /**
- * The file name of the History Tree
- */
- public static final @NonNull String HISTORY_TREE_FILE_NAME = "stateHistory.ht"; //$NON-NLS-1$
-
- /** The ID of this analysis module */
- public static final @NonNull String ID = "org.eclipse.linuxtools.lttng2.kernel.analysis"; //$NON-NLS-1$
-
- /*
- * TODO: Decide which events should be mandatory for the analysis, once the
- * appropriate error messages and session setup are in place.
- */
- private static final ImmutableSet<String> REQUIRED_EVENTS = ImmutableSet.of();
-
- private static final ImmutableSet<String> OPTIONAL_EVENTS = ImmutableSet.of(
- // FIXME These cannot be declared statically anymore, they depend on
- // the OriginTracer of the kernel trace.
- // LttngStrings.EXIT_SYSCALL,
- // LttngStrings.IRQ_HANDLER_ENTRY,
- // LttngStrings.IRQ_HANDLER_EXIT,
- // LttngStrings.SOFTIRQ_ENTRY,
- // LttngStrings.SOFTIRQ_EXIT,
- // LttngStrings.SOFTIRQ_RAISE,
- // LttngStrings.SCHED_PROCESS_FORK,
- // LttngStrings.SCHED_PROCESS_EXIT,
- // LttngStrings.SCHED_PROCESS_FREE,
- // LttngStrings.SCHED_SWITCH,
- // LttngStrings.STATEDUMP_PROCESS_STATE,
- // LttngStrings.SCHED_WAKEUP,
- // LttngStrings.SCHED_WAKEUP_NEW,
- //
- // /* FIXME Add the prefix for syscalls */
- // LttngStrings.SYSCALL_PREFIX
- );
-
- /** The requirements as an immutable set */
- private static final @NonNull Set<TmfAnalysisRequirement> REQUIREMENTS;
-
- static {
- /* initialize the requirement: domain and events */
- TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN);
- domainReq.addValue(SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL, ValuePriorityLevel.MANDATORY);
-
- TmfAnalysisRequirement eventReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT, REQUIRED_EVENTS, ValuePriorityLevel.MANDATORY);
- eventReq.addValues(OPTIONAL_EVENTS, ValuePriorityLevel.OPTIONAL);
-
- REQUIREMENTS = checkNotNull(ImmutableSet.of(domainReq, eventReq));
- }
-
- @Override
- protected @NonNull ITmfStateProvider createStateProvider() {
- ITmfTrace trace = checkNotNull(getTrace());
- IKernelAnalysisEventLayout layout;
-
- if (trace instanceof LttngKernelTrace) {
- layout = ((LttngKernelTrace) trace).getEventLayout();
- } else {
- /* Fall-back to the base LttngEventLayout */
- layout = LttngEventLayout.getInstance();
- }
-
- return new LttngKernelStateProvider(trace, layout);
- }
-
- @Override
- @NonNull
- protected String getSsFileName() {
- return HISTORY_TREE_FILE_NAME;
- }
-
- @Override
- protected String getFullHelpText() {
- return NonNullUtils.nullToEmptyString(Messages.LttngKernelAnalysisModule_Help);
- }
-
- @Override
- public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() {
- return REQUIREMENTS;
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
- * Copyright (c) 2010, 2011 École Polytechnique de Montréal
- * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel;
-
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
-import java.util.Map;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.StateValues;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.IKernelAnalysisEventLayout;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
-import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
-import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
-import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
-import org.eclipse.tracecompass.tmf.core.event.aspect.TmfCpuAspect;
-import org.eclipse.tracecompass.tmf.core.statesystem.AbstractTmfStateProvider;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-
-import com.google.common.collect.ImmutableMap;
-
-/**
- * This is the state change input plugin for TMF's state system which handles
- * the LTTng 2.0 kernel traces in CTF format.
- *
- * It uses the reference handler defined in CTFKernelHandler.java.
- *
- * @author alexmont
- *
- */
-public class LttngKernelStateProvider extends AbstractTmfStateProvider {
-
- // ------------------------------------------------------------------------
- // Static fields
- // ------------------------------------------------------------------------
-
- /**
- * Version number of this state provider. Please bump this if you modify the
- * contents of the generated state history in some way.
- */
- private static final int VERSION = 5;
-
- private static final int IRQ_HANDLER_ENTRY_INDEX = 1;
- private static final int IRQ_HANDLER_EXIT_INDEX = 2;
- private static final int SOFT_IRQ_ENTRY_INDEX = 3;
- private static final int SOFT_IRQ_EXIT_INDEX = 4;
- private static final int SOFT_IRQ_RAISE_INDEX = 5;
- private static final int SCHED_SWITCH_INDEX = 6;
- private static final int SCHED_PROCESS_FORK_INDEX = 7;
- private static final int SCHED_PROCESS_EXIT_INDEX = 8;
- private static final int SCHED_PROCESS_FREE_INDEX = 9;
- private static final int STATEDUMP_PROCESS_STATE_INDEX = 10;
- private static final int SCHED_WAKEUP_INDEX = 11;
-
-
- // ------------------------------------------------------------------------
- // Fields
- // ------------------------------------------------------------------------
-
- private final Map<String, Integer> fEventNames;
- private final @NonNull IKernelAnalysisEventLayout fLayout;
-
- // ------------------------------------------------------------------------
- // Constructor
- // ------------------------------------------------------------------------
-
- /**
- * Instantiate a new state provider plugin.
- *
- * @param trace
- * The LTTng 2.0 kernel trace directory
- * @param layout
- * The event layout to use for this state provider. Usually
- * depending on the tracer implementation.
- */
- public LttngKernelStateProvider(@NonNull ITmfTrace trace, @NonNull IKernelAnalysisEventLayout layout) {
- super(trace, ITmfEvent.class, "Kernel"); //$NON-NLS-1$
- fLayout = layout;
- fEventNames = buildEventNames(layout);
- }
-
- // ------------------------------------------------------------------------
- // Event names management
- // ------------------------------------------------------------------------
-
- private static Map<String, Integer> buildEventNames(IKernelAnalysisEventLayout layout) {
- ImmutableMap.Builder<String, Integer> builder = ImmutableMap.builder();
-
- builder.put(layout.eventIrqHandlerEntry(), IRQ_HANDLER_ENTRY_INDEX);
- builder.put(layout.eventIrqHandlerExit(), IRQ_HANDLER_EXIT_INDEX);
- builder.put(layout.eventSoftIrqEntry(), SOFT_IRQ_ENTRY_INDEX);
- builder.put(layout.eventSoftIrqExit(), SOFT_IRQ_EXIT_INDEX);
- builder.put(layout.eventSoftIrqRaise(), SOFT_IRQ_RAISE_INDEX);
- builder.put(layout.eventSchedSwitch(), SCHED_SWITCH_INDEX);
- builder.put(layout.eventSchedProcessFork(), SCHED_PROCESS_FORK_INDEX);
- builder.put(layout.eventSchedProcessExit(), SCHED_PROCESS_EXIT_INDEX);
- builder.put(layout.eventSchedProcessFree(), SCHED_PROCESS_FREE_INDEX);
-
- if (layout.eventStatedumpProcessState() != null) {
- builder.put(layout.eventStatedumpProcessState(), STATEDUMP_PROCESS_STATE_INDEX);
- }
-
- for (String eventSchedWakeup : layout.eventsSchedWakeup()) {
- builder.put(eventSchedWakeup, SCHED_WAKEUP_INDEX);
- }
-
- return builder.build();
- }
-
- // ------------------------------------------------------------------------
- // IStateChangeInput
- // ------------------------------------------------------------------------
-
- @Override
- public int getVersion() {
- return VERSION;
- }
-
- @Override
- public void assignTargetStateSystem(ITmfStateSystemBuilder ssb) {
- /* We can only set up the locations once the state system is assigned */
- super.assignTargetStateSystem(ssb);
- }
-
- @Override
- public LttngKernelStateProvider getNewInstance() {
- return new LttngKernelStateProvider(this.getTrace(), fLayout);
- }
-
- @Override
- protected void eventHandle(ITmfEvent event) {
- ITmfStateSystemBuilder ss = checkNotNull(getStateSystemBuilder());
-
- Integer cpu = null;
- Iterable<TmfCpuAspect> aspects = TmfTraceUtils.getEventAspectsOfClass(event.getTrace(), TmfCpuAspect.class);
- for (TmfCpuAspect aspect : aspects) {
- cpu = aspect.resolve(event);
- if (cpu != null) {
- break;
- }
- }
- if (cpu == null) {
- /* We couldn't find any CPU information, ignore this event */
- return;
- }
-
- final String eventName = event.getType().getName();
- final long ts = event.getTimestamp().getValue();
-
- try {
- /* Shortcut for the "current CPU" attribute node */
- final int currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(ss), cpu.toString());
-
- /*
- * Shortcut for the "current thread" attribute node. It requires
- * querying the current CPU's current thread.
- */
- int quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.CURRENT_THREAD);
- ITmfStateValue value = ss.queryOngoingState(quark);
- int thread = value.isNull() ? -1 : value.unboxInt();
- final int currentThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), String.valueOf(thread));
-
- /*
- * Feed event to the history system if it's known to cause a state
- * transition.
- */
- Integer idx = fEventNames.get(eventName);
- int intval = (idx == null ? -1 : idx.intValue());
- switch (intval) {
-
- case IRQ_HANDLER_ENTRY_INDEX:
- {
- Integer irqId = ((Long) event.getContent().getField(fLayout.fieldIrq()).getValue()).intValue();
-
- /* Mark this IRQ as active in the resource tree.
- * The state value = the CPU on which this IRQ is sitting */
- quark = ss.getQuarkRelativeAndAdd(getNodeIRQs(ss), irqId.toString());
- value = TmfStateValue.newValueInt(cpu.intValue());
- ss.modifyAttribute(ts, value, quark);
-
- /* Change the status of the running process to interrupted */
- quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
- value = StateValues.PROCESS_STATUS_INTERRUPTED_VALUE;
- ss.modifyAttribute(ts, value, quark);
-
- /* Change the status of the CPU to interrupted */
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
- value = StateValues.CPU_STATUS_IRQ_VALUE;
- ss.modifyAttribute(ts, value, quark);
- }
- break;
-
- case IRQ_HANDLER_EXIT_INDEX:
- {
- Integer irqId = ((Long) event.getContent().getField(fLayout.fieldIrq()).getValue()).intValue();
-
- /* Put this IRQ back to inactive in the resource tree */
- quark = ss.getQuarkRelativeAndAdd(getNodeIRQs(ss), irqId.toString());
- value = TmfStateValue.nullValue();
- ss.modifyAttribute(ts, value, quark);
-
- /* Set the previous process back to running */
- setProcessToRunning(ss, ts, currentThreadNode);
-
- /* Set the CPU status back to running or "idle" */
- cpuExitInterrupt(ss, ts, currentCPUNode, currentThreadNode);
- }
- break;
-
- case SOFT_IRQ_ENTRY_INDEX:
- {
- Integer softIrqId = ((Long) event.getContent().getField(fLayout.fieldVec()).getValue()).intValue();
-
- /* Mark this SoftIRQ as active in the resource tree.
- * The state value = the CPU on which this SoftIRQ is processed */
- quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(ss), softIrqId.toString());
- value = TmfStateValue.newValueInt(cpu.intValue());
- ss.modifyAttribute(ts, value, quark);
-
- /* Change the status of the running process to interrupted */
- quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
- value = StateValues.PROCESS_STATUS_INTERRUPTED_VALUE;
- ss.modifyAttribute(ts, value, quark);
-
- /* Change the status of the CPU to interrupted */
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
- value = StateValues.CPU_STATUS_SOFTIRQ_VALUE;
- ss.modifyAttribute(ts, value, quark);
- }
- break;
-
- case SOFT_IRQ_EXIT_INDEX:
- {
- Integer softIrqId = ((Long) event.getContent().getField(fLayout.fieldVec()).getValue()).intValue();
-
- /* Put this SoftIRQ back to inactive (= -1) in the resource tree */
- quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(ss), softIrqId.toString());
- value = TmfStateValue.nullValue();
- ss.modifyAttribute(ts, value, quark);
-
- /* Set the previous process back to running */
- setProcessToRunning(ss, ts, currentThreadNode);
-
- /* Set the CPU status back to "busy" or "idle" */
- cpuExitInterrupt(ss, ts, currentCPUNode, currentThreadNode);
- }
- break;
-
- case SOFT_IRQ_RAISE_INDEX:
- /* Fields: int32 vec */
- {
- Integer softIrqId = ((Long) event.getContent().getField(fLayout.fieldVec()).getValue()).intValue();
-
- /* Mark this SoftIRQ as *raised* in the resource tree.
- * State value = -2 */
- quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(ss), softIrqId.toString());
- value = StateValues.SOFT_IRQ_RAISED_VALUE;
- ss.modifyAttribute(ts, value, quark);
- }
- break;
-
- case SCHED_SWITCH_INDEX:
- {
- ITmfEventField content = event.getContent();
- Integer prevTid = ((Long) content.getField(fLayout.fieldPrevTid()).getValue()).intValue();
- Long prevState = (Long) content.getField(fLayout.fieldPrevState()).getValue();
- String nextProcessName = (String) content.getField(fLayout.fieldNextComm()).getValue();
- Integer nextTid = ((Long) content.getField(fLayout.fieldNextTid()).getValue()).intValue();
-
- Integer formerThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), prevTid.toString());
- Integer newCurrentThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), nextTid.toString());
-
- /* Set the status of the process that got scheduled out. */
- quark = ss.getQuarkRelativeAndAdd(formerThreadNode, Attributes.STATUS);
- if (prevState != 0) {
- value = StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE;
- } else {
- value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
- }
- ss.modifyAttribute(ts, value, quark);
-
- /* Set the status of the new scheduled process */
- setProcessToRunning(ss, ts, newCurrentThreadNode);
-
- /* Set the exec name of the new process */
- quark = ss.getQuarkRelativeAndAdd(newCurrentThreadNode, Attributes.EXEC_NAME);
- value = TmfStateValue.newValueString(nextProcessName);
- ss.modifyAttribute(ts, value, quark);
-
- /* Make sure the PPID and system_call sub-attributes exist */
- ss.getQuarkRelativeAndAdd(newCurrentThreadNode, Attributes.SYSTEM_CALL);
- ss.getQuarkRelativeAndAdd(newCurrentThreadNode, Attributes.PPID);
-
- /* Set the current scheduled process on the relevant CPU */
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.CURRENT_THREAD);
- value = TmfStateValue.newValueInt(nextTid);
- ss.modifyAttribute(ts, value, quark);
-
- /* Set the status of the CPU itself */
- if (nextTid > 0) {
- /* Check if the entering process is in kernel or user mode */
- quark = ss.getQuarkRelativeAndAdd(newCurrentThreadNode, Attributes.SYSTEM_CALL);
- if (ss.queryOngoingState(quark).isNull()) {
- value = StateValues.CPU_STATUS_RUN_USERMODE_VALUE;
- } else {
- value = StateValues.CPU_STATUS_RUN_SYSCALL_VALUE;
- }
- } else {
- value = StateValues.CPU_STATUS_IDLE_VALUE;
- }
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
- ss.modifyAttribute(ts, value, quark);
- }
- break;
-
- case SCHED_PROCESS_FORK_INDEX:
- {
- ITmfEventField content = event.getContent();
- // String parentProcessName = (String) event.getFieldValue("parent_comm");
- String childProcessName = (String) content.getField(fLayout.fieldChildComm()).getValue();
- // assert ( parentProcessName.equals(childProcessName) );
-
- Integer parentTid = ((Long) content.getField(fLayout.fieldParentTid()).getValue()).intValue();
- Integer childTid = ((Long) content.getField(fLayout.fieldChildTid()).getValue()).intValue();
-
- Integer parentTidNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), parentTid.toString());
- Integer childTidNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), childTid.toString());
-
- /* Assign the PPID to the new process */
- quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.PPID);
- value = TmfStateValue.newValueInt(parentTid);
- ss.modifyAttribute(ts, value, quark);
-
- /* Set the new process' exec_name */
- quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.EXEC_NAME);
- value = TmfStateValue.newValueString(childProcessName);
- ss.modifyAttribute(ts, value, quark);
-
- /* Set the new process' status */
- quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.STATUS);
- value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
- ss.modifyAttribute(ts, value, quark);
-
- /* Set the process' syscall name, to be the same as the parent's */
- quark = ss.getQuarkRelativeAndAdd(parentTidNode, Attributes.SYSTEM_CALL);
- value = ss.queryOngoingState(quark);
- if (value.isNull()) {
- /*
- * Maybe we were missing info about the parent? At least we
- * will set the child right. Let's suppose "sys_clone".
- */
- value = TmfStateValue.newValueString(fLayout.eventSyscallEntryPrefix() + IKernelAnalysisEventLayout.INITIAL_SYSCALL_NAME);
- }
- quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.SYSTEM_CALL);
- ss.modifyAttribute(ts, value, quark);
- }
- break;
-
- case SCHED_PROCESS_EXIT_INDEX:
- break;
-
- case SCHED_PROCESS_FREE_INDEX:
- {
- Integer tid = ((Long) event.getContent().getField(fLayout.fieldTid()).getValue()).intValue();
- /*
- * Remove the process and all its sub-attributes from the
- * current state
- */
- quark = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), tid.toString());
- ss.removeAttribute(ts, quark);
- }
- break;
-
- case STATEDUMP_PROCESS_STATE_INDEX:
- /* LTTng-specific */
- {
- ITmfEventField content = event.getContent();
- int tid = ((Long) content.getField("tid").getValue()).intValue(); //$NON-NLS-1$
- int pid = ((Long) content.getField("pid").getValue()).intValue(); //$NON-NLS-1$
- int ppid = ((Long) content.getField("ppid").getValue()).intValue(); //$NON-NLS-1$
- int status = ((Long) content.getField("status").getValue()).intValue(); //$NON-NLS-1$
- String name = (String) content.getField("name").getValue(); //$NON-NLS-1$
- /*
- * "mode" could be interesting too, but it doesn't seem to be
- * populated with anything relevant for now.
- */
-
- int curThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), String.valueOf(tid));
-
- /* Set the process' name */
- quark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.EXEC_NAME);
- if (ss.queryOngoingState(quark).isNull()) {
- /* If the value didn't exist previously, set it */
- value = TmfStateValue.newValueString(name);
- ss.modifyAttribute(ts, value, quark);
- }
-
- /* Set the process' PPID */
- quark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.PPID);
- if (ss.queryOngoingState(quark).isNull()) {
- if (pid == tid) {
- /* We have a process. Use the 'PPID' field. */
- value = TmfStateValue.newValueInt(ppid);
- } else {
- /* We have a thread, use the 'PID' field for the parent. */
- value = TmfStateValue.newValueInt(pid);
- }
- ss.modifyAttribute(ts, value, quark);
- }
-
- /* Set the process' status */
- quark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.STATUS);
- if (ss.queryOngoingState(quark).isNull()) {
- /* "2" here means "WAIT_FOR_CPU", and "5" "WAIT_BLOCKED" in the LTTng kernel. */
- if (status == 2) {
- value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
- } else if (status == 5) {
- value = StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE;
- } else {
- value = StateValues.PROCESS_STATUS_UNKNOWN_VALUE;
- }
- ss.modifyAttribute(ts, value, quark);
- }
- }
- break;
-
- case SCHED_WAKEUP_INDEX:
- {
- final int tid = ((Long) event.getContent().getField(fLayout.fieldTid()).getValue()).intValue();
- final int threadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(ss), String.valueOf(tid));
-
- /*
- * The process indicated in the event's payload is now ready to
- * run. Assign it to the "wait for cpu" state, but only if it
- * was not already running.
- */
- quark = ss.getQuarkRelativeAndAdd(threadNode, Attributes.STATUS);
- int status = ss.queryOngoingState(quark).unboxInt();
-
- if (status != StateValues.PROCESS_STATUS_RUN_SYSCALL &&
- status != StateValues.PROCESS_STATUS_RUN_USERMODE) {
- value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
- ss.modifyAttribute(ts, value, quark);
- }
- }
- break;
-
- default:
- /* Other event types not covered by the main switch */
- {
- if (eventName.startsWith(fLayout.eventSyscallEntryPrefix())
- || eventName.startsWith(fLayout.eventCompatSyscallEntryPrefix())) {
-
- /* Assign the new system call to the process */
- quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL);
- value = TmfStateValue.newValueString(eventName);
- ss.modifyAttribute(ts, value, quark);
-
- /* Put the process in system call mode */
- quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
- value = StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE;
- ss.modifyAttribute(ts, value, quark);
-
- /* Put the CPU in system call (kernel) mode */
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
- value = StateValues.CPU_STATUS_RUN_SYSCALL_VALUE;
- ss.modifyAttribute(ts, value, quark);
-
- } else if (eventName.startsWith(fLayout.eventSyscallExitPrefix())) {
-
- /* Clear the current system call on the process */
- quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL);
- value = TmfStateValue.nullValue();
- ss.modifyAttribute(ts, value, quark);
-
- /* Put the process' status back to user mode */
- quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
- value = StateValues.PROCESS_STATUS_RUN_USERMODE_VALUE;
- ss.modifyAttribute(ts, value, quark);
-
- /* Put the CPU's status back to user mode */
- quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
- value = StateValues.CPU_STATUS_RUN_USERMODE_VALUE;
- ss.modifyAttribute(ts, value, quark);
- }
-
- }
- break;
- } // End of big switch
-
- } catch (AttributeNotFoundException ae) {
- /*
- * This would indicate a problem with the logic of the manager here,
- * so it shouldn't happen.
- */
- ae.printStackTrace();
-
- } catch (TimeRangeException tre) {
- /*
- * This would happen if the events in the trace aren't ordered
- * chronologically, which should never be the case ...
- */
- System.err.println("TimeRangeExcpetion caught in the state system's event manager."); //$NON-NLS-1$
- System.err.println("Are the events in the trace correctly ordered?"); //$NON-NLS-1$
- tre.printStackTrace();
-
- } catch (StateValueTypeException sve) {
- /*
- * This would happen if we were trying to push/pop attributes not of
- * type integer. Which, once again, should never happen.
- */
- sve.printStackTrace();
- }
- }
-
- // ------------------------------------------------------------------------
- // Convenience methods for commonly-used attribute tree locations
- // ------------------------------------------------------------------------
-
- private static int getNodeCPUs(ITmfStateSystemBuilder ssb) {
- return ssb.getQuarkAbsoluteAndAdd(Attributes.CPUS);
- }
-
- private static int getNodeThreads(ITmfStateSystemBuilder ssb) {
- return ssb.getQuarkAbsoluteAndAdd(Attributes.THREADS);
- }
-
- private static int getNodeIRQs(ITmfStateSystemBuilder ssb) {
- return ssb.getQuarkAbsoluteAndAdd(Attributes.RESOURCES, Attributes.IRQS);
- }
-
- private static int getNodeSoftIRQs(ITmfStateSystemBuilder ssb) {
- return ssb.getQuarkAbsoluteAndAdd(Attributes.RESOURCES, Attributes.SOFT_IRQS);
- }
-
- // ------------------------------------------------------------------------
- // Advanced state-setting methods
- // ------------------------------------------------------------------------
-
- /**
- * When we want to set a process back to a "running" state, first check
- * its current System_call attribute. If there is a system call active, we
- * put the process back in the syscall state. If not, we put it back in
- * user mode state.
- */
- private static void setProcessToRunning(ITmfStateSystemBuilder ssb, long ts, int currentThreadNode)
- throws AttributeNotFoundException, TimeRangeException,
- StateValueTypeException {
- int quark;
- ITmfStateValue value;
-
- quark = ssb.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL);
- if (ssb.queryOngoingState(quark).isNull()) {
- /* We were in user mode before the interruption */
- value = StateValues.PROCESS_STATUS_RUN_USERMODE_VALUE;
- } else {
- /* We were previously in kernel mode */
- value = StateValues.PROCESS_STATUS_RUN_SYSCALL_VALUE;
- }
- quark = ssb.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
- ssb.modifyAttribute(ts, value, quark);
- }
-
- /**
- * Similar logic as above, but to set the CPU's status when it's coming out
- * of an interruption.
- */
- private static void cpuExitInterrupt(ITmfStateSystemBuilder ssb, long ts,
- int currentCpuNode, int currentThreadNode)
- throws StateValueTypeException, AttributeNotFoundException,
- TimeRangeException {
- int quark;
- ITmfStateValue value;
-
- quark = ssb.getQuarkRelativeAndAdd(currentCpuNode, Attributes.CURRENT_THREAD);
- if (ssb.queryOngoingState(quark).unboxInt() > 0) {
- /* There was a process on the CPU */
- quark = ssb.getQuarkRelative(currentThreadNode, Attributes.SYSTEM_CALL);
- if (ssb.queryOngoingState(quark).isNull()) {
- /* That process was in user mode */
- value = StateValues.CPU_STATUS_RUN_USERMODE_VALUE;
- } else {
- /* That process was in a system call */
- value = StateValues.CPU_STATUS_RUN_SYSCALL_VALUE;
- }
- } else {
- /* There was no real process scheduled, CPU was idle */
- value = StateValues.CPU_STATUS_IDLE_VALUE;
- }
- quark = ssb.getQuarkRelativeAndAdd(currentCpuNode, Attributes.STATUS);
- ssb.modifyAttribute(ts, value, quark);
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
-import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
-import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-
-/**
- * Information provider utility class that retrieves thread-related information
- * from a Linux Kernel Analysis
- *
- * @author Geneviève Bastien
- */
-public final class LttngKernelThreadInformationProvider {
-
- private LttngKernelThreadInformationProvider() {
- }
-
- /**
- * Get the ID of the thread running on the CPU at time ts
- *
- * TODO: This method may later be replaced by an aspect, when the aspect can
- * resolve to something that is not an event
- *
- * @param module
- * The lttng kernel analysis instance to run this method on
- * @param cpuId
- * The CPU number the process is running on
- * @param ts
- * The timestamp at which we want the running process
- * @return The TID of the thread running on CPU cpuId at time ts or
- * {@code null} if either no thread is running or we do not know.
- */
- public static @Nullable Integer getThreadOnCpu(LttngKernelAnalysis module, long cpuId, long ts) {
- ITmfStateSystem ss = module.getStateSystem();
- if (ss == null) {
- return null;
- }
- try {
- int cpuQuark = ss.getQuarkAbsolute(Attributes.CPUS, Long.toString(cpuId), Attributes.CURRENT_THREAD);
- ITmfStateInterval interval = ss.querySingleState(ts, cpuQuark);
- ITmfStateValue val = interval.getStateValue();
- switch (val.getType()) {
- case INTEGER:
- return val.unboxInt();
- case LONG:
- case DOUBLE:
- case NULL:
- case STRING:
- default:
- break;
- }
- } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) {
- }
- return null;
- }
-
- /**
- * Get the TIDs of the threads from an analysis
- *
- * @param module
- * The lttng kernel analysis instance to run this method on
- * @return The set of TIDs corresponding to the threads
- */
- public static @NonNull Collection<Integer> getThreadIds(LttngKernelAnalysis module) {
- ITmfStateSystem ss = module.getStateSystem();
- if (ss == null) {
- return NonNullUtils.checkNotNull(Collections.EMPTY_SET);
- }
- int threadQuark;
- try {
- threadQuark = ss.getQuarkAbsolute(Attributes.THREADS);
- Set<Integer> tids = new TreeSet<>();
- for (Integer quark : ss.getSubAttributes(threadQuark, false)) {
- tids.add(Integer.parseInt(ss.getAttributeName(quark)));
- }
- return tids;
- } catch (AttributeNotFoundException e) {
- }
- return NonNullUtils.checkNotNull(Collections.EMPTY_SET);
- }
-
- /**
- * Get the parent process ID of a thread
- *
- * @param module
- * The lttng kernel analysis instance to run this method on
- * @param threadId
- * The thread ID of the process for which to get the parent
- * @param ts
- * The timestamp at which to get the parent
- * @return The parent PID or {@code null} if the PPID is not found.
- */
- public static @Nullable Integer getParentPid(LttngKernelAnalysis module, @NonNull Integer threadId, long ts) {
- Integer ppid = null;
- ITmfStateSystem ss = module.getStateSystem();
- if (ss == null) {
- return ppid;
- }
- Integer ppidNode;
- try {
- ppidNode = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.PPID);
- ITmfStateInterval ppidInterval = ss.querySingleState(ts, ppidNode);
- ITmfStateValue ppidValue = ppidInterval.getStateValue();
-
- switch (ppidValue.getType()) {
- case INTEGER:
- ppid = NonNullUtils.checkNotNull(Integer.valueOf(ppidValue.unboxInt()));
- break;
- case DOUBLE:
- case LONG:
- case NULL:
- case STRING:
- default:
- break;
- }
- } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) {
- }
- return ppid;
- }
-
- /**
- * Get the executable name of the thread ID. If the thread ID was used
- * multiple time or the name changed in between, it will return the last
- * name the thread has taken, or {@code null} if no name is found
- *
- * @param module
- * The lttng kernel analysis instance to run this method on
- * @param threadId
- * The thread ID of the process for which to get the name
- * @return The last executable name of this process, or {@code null} if not
- * found
- */
- public static @Nullable String getExecutableName(LttngKernelAnalysis module, @NonNull Integer threadId) {
- String execName = null;
- ITmfStateSystem ss = module.getStateSystem();
- if (ss == null) {
- return execName;
- }
- Integer execNameNode;
- try {
- execNameNode = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.EXEC_NAME);
- List<ITmfStateInterval> execNameIntervals = StateSystemUtils.queryHistoryRange(ss, execNameNode, ss.getStartTime(), ss.getCurrentEndTime());
-
- ITmfStateValue execNameValue;
- for (ITmfStateInterval interval : execNameIntervals) {
- execNameValue = interval.getStateValue();
- switch (execNameValue.getType()) {
- case STRING:
- execName = NonNullUtils.checkNotNull(execNameValue.unboxStr());
- break;
- case DOUBLE:
- case LONG:
- case NULL:
- case INTEGER:
- default:
- break;
- }
- }
- } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) {
- }
- return execName;
- }
-
- /**
- * Get the status intervals for a given thread with a resolution
- *
- * @param module
- * The lttng kernel analysis instance to run this method on
- * @param threadId
- * The ID of the thread to get the intervals for
- * @param start
- * The start time of the requested range
- * @param end
- * The end time of the requested range
- * @param resolution
- * The resolution or the minimal time between the requested
- * intervals. If interval times are smaller than resolution, only
- * the first interval is returned, the others are ignored.
- * @param monitor
- * A progress monitor for this task
- * @return The list of status intervals for this thread, an empty list is
- * returned if either the state system is {@code null} or the quark
- * is not found
- */
- public static @NonNull List<ITmfStateInterval> getStatusIntervalsForThread(LttngKernelAnalysis module, Integer threadId, long start, long end, long resolution, IProgressMonitor monitor) {
- ITmfStateSystem ss = module.getStateSystem();
- if (ss == null) {
- return NonNullUtils.checkNotNull(Collections.EMPTY_LIST);
- }
-
- try {
- int threadQuark = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString());
- int statusQuark = ss.getQuarkRelative(threadQuark, Attributes.STATUS);
- List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ss, statusQuark, Math.max(start, ss.getStartTime()), Math.min(end - 1, ss.getCurrentEndTime()), resolution, monitor);
- return statusIntervals;
- } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) {
- }
- return NonNullUtils.checkNotNull(Collections.EMPTY_LIST);
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Externalized message strings from the LTTng Kernel Analysis
- *
- * @author Geneviève Bastien
- * @since 3.0
- */
-@SuppressWarnings("javadoc")
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.tracecompass.lttng2.kernel.core.analysis.messages"; //$NON-NLS-1$
-
- public static String LttngKernelAnalysisModule_Help;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
+++ /dev/null
-###############################################################################
-# Copyright (c) 2014 École Polytechnique de Montréal
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Geneviève Bastien - Initial API and implementation
-###############################################################################
-
-LttngKernelAnalysisModule_Help=Builds the LTTng2 kernel state system to populate the Control Flow view and the Resources View
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
+import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
import org.eclipse.tracecompass.ctf.core.trace.CTFReaderException;
import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.Activator;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.IKernelAnalysisEventLayout;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.Lttng26EventLayout;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.LttngEventLayout;
import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.PerfEventLayout;
*
* @author Alexandre Montplaisir
*/
-public class LttngKernelTrace extends CtfTmfTrace {
+public class LttngKernelTrace extends CtfTmfTrace implements IKernelTrace {
/**
* Supported Linux kernel tracers
super();
}
- /**
- * Return the kernel event layout (event and field names) used in this
- * trace.
- *
- * @return The event layout
- */
- public @NonNull IKernelAnalysisEventLayout getEventLayout() {
+ @Override
+ public @NonNull IKernelAnalysisEventLayout getKernelEventLayout() {
OriginTracer tracer = fOriginTracer;
if (tracer == null) {
throw new IllegalStateException("Cannot get the layout of a non-initialized trace!"); //$NON-NLS-1$
org.eclipse.tracecompass.lttng2.kernel.core,
org.eclipse.tracecompass.lttng2.kernel.ui,
org.eclipse.tracecompass.lttng2.control.ui,
+ org.eclipse.tracecompass.analysis.os.linux.ui,
org.eclipse.tracecompass.tmf.core,
org.eclipse.tracecompass.tmf.core.tests,
org.eclipse.tracecompass.tmf.ctf.core,
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources.ResourcesView;
+import org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow.ControlFlowView;
+import org.eclipse.tracecompass.analysis.os.linux.ui.views.resources.ResourcesView;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.signal.TmfTimeSynchSignal;
import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
import java.util.ArrayList;
import java.util.Arrays;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
+import org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow.ControlFlowView;
+import org.eclipse.tracecompass.analysis.os.linux.ui.views.resources.ResourcesView;
import org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.PerspectiveFactory;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources.ResourcesView;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.AbstractPerspectiveChecker;
import org.eclipse.tracecompass.tmf.ui.views.histogram.HistogramView;
import org.eclipse.tracecompass.tmf.ui.views.statistics.TmfStatisticsView;
org.eclipse.tracecompass.common.core,
org.eclipse.tracecompass.tmf.core;bundle-version="0.1.0",
org.eclipse.tracecompass.tmf.ui;bundle-version="0.1.0",
+ org.eclipse.tracecompass.analysis.os.linux.ui,
org.eclipse.tracecompass.tmf.ctf.core;bundle-version="0.1.0",
org.eclipse.tracecompass.lttng2.control.core;bundle-version="0.1.0",
org.eclipse.tracecompass.lttng2.control.ui;bundle-version="0.1.0",
- org.eclipse.tracecompass.lttng2.kernel.core;bundle-version="0.1.0"
-Export-Package: org.eclipse.tracecompass.internal.lttng2.kernel.ui;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.tests",
- org.eclipse.tracecompass.internal.lttng2.kernel.ui.views;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests",
- org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.controlflow;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests",
- org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.cpuusage;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests",
- org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests"
+ org.eclipse.tracecompass.lttng2.kernel.core;bundle-version="0.1.0",
+ org.eclipse.tracecompass.lttng2.kernel.ui
Import-Package: com.google.common.collect
+Export-Package: org.eclipse.tracecompass.internal.lttng2.kernel.ui;x-internal:=true,
+ org.eclipse.tracecompass.internal.lttng2.kernel.ui.views;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests"
name="%kernel.perspective.name">
</perspective>
</extension>
- <extension
- point="org.eclipse.ui.views">
- <view
- allowMultiple="false"
- category="org.eclipse.linuxtools.lttng2.ui.views.category"
- class="org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView"
- icon="icons/eview16/control_flow_view.gif"
- id="org.eclipse.linuxtools.lttng2.kernel.ui.views.controlflow"
- name="%controlflow.view.name"
- restorable="true">
- </view>
- <view
- allowMultiple="false"
- category="org.eclipse.linuxtools.lttng2.ui.views.category"
- class="org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources.ResourcesView"
- icon="icons/eview16/resources_view.gif"
- id="org.eclipse.linuxtools.lttng2.kernel.ui.views.resources"
- name="%resources.view.name"
- restorable="true">
- </view>
- <view
- allowMultiple="false"
- category="org.eclipse.linuxtools.lttng2.ui.views.category"
- class="org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.cpuusage.CpuUsageView"
- id="org.eclipse.linuxtools.lttng2.kernel.ui.views.cpuusage"
- name="%cpuusage.view.name"
- restorable="true">
- </view>
- </extension>
<extension
point="org.eclipse.ui.navigator.navigatorContent">
<commonWizard
</enablement>
</commonWizard>
</extension>
- <extension
- point="org.eclipse.linuxtools.tmf.core.analysis">
- <output
- class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
- id="org.eclipse.linuxtools.lttng2.kernel.ui.views.controlflow">
- <analysisId
- id="org.eclipse.linuxtools.lttng2.kernel.analysis">
- </analysisId>
- </output>
- <output
- class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
- id="org.eclipse.linuxtools.lttng2.kernel.ui.views.resources">
- <analysisId
- id="org.eclipse.linuxtools.lttng2.kernel.analysis">
- </analysisId>
- </output>
- <output
- class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
- id="org.eclipse.linuxtools.lttng2.kernel.ui.views.cpuusage">
- <analysisId
- id="org.eclipse.linuxtools.lttng2.kernel.core.cpuusage">
- </analysisId>
- </output>
- </extension>
<extension
point="org.eclipse.linuxtools.tmf.ui.tracetypeui">
<type
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tassé - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui;
-
-import org.eclipse.osgi.util.NLS;
-
-@SuppressWarnings("javadoc")
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.tracecompass.internal.lttng2.kernel.ui.messages"; //$NON-NLS-1$
-
- public static String ControlFlowView_birthTimeColumn;
- public static String ControlFlowView_tidColumn;
- public static String ControlFlowView_ptidColumn;
- public static String ControlFlowView_processColumn;
- public static String ControlFlowView_traceColumn;
-
- public static String ControlFlowView_stateTypeName;
- public static String ControlFlowView_multipleStates;
- public static String ControlFlowView_nextProcessActionNameText;
- public static String ControlFlowView_nextProcessActionToolTipText;
- public static String ControlFlowView_previousProcessActionNameText;
- public static String ControlFlowView_previousProcessActionToolTipText;
- public static String ControlFlowView_followCPUBwdText;
- public static String ControlFlowView_followCPUFwdText;
-
- public static String ControlFlowView_attributeSyscallName;
- public static String ControlFlowView_attributeCpuName;
-
- public static String ResourcesView_stateTypeName;
- public static String ResourcesView_multipleStates;
- public static String ResourcesView_nextResourceActionNameText;
- public static String ResourcesView_nextResourceActionToolTipText;
- public static String ResourcesView_previousResourceActionNameText;
- public static String ResourcesView_previousResourceActionToolTipText;
- public static String ResourcesView_attributeCpuName;
- public static String ResourcesView_attributeIrqName;
- public static String ResourcesView_attributeSoftIrqName;
- public static String ResourcesView_attributeHoverTime;
- public static String ResourcesView_attributeTidName;
- public static String ResourcesView_attributeProcessName;
- public static String ResourcesView_attributeSyscallName;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
+++ /dev/null
-###############################################################################
-# Copyright (c) 2013, 2014 Ericsson
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Ericsson - Initial API and implementation
-###############################################################################
-
-ControlFlowView_birthTimeColumn=Birth time
-ControlFlowView_tidColumn=TID
-ControlFlowView_ptidColumn=PTID
-ControlFlowView_processColumn=Process
-ControlFlowView_traceColumn=Trace
-
-ControlFlowView_stateTypeName=Process
-ControlFlowView_multipleStates=(multiple)
-ControlFlowView_nextProcessActionNameText=Next Process
-ControlFlowView_nextProcessActionToolTipText=Select Next Process
-ControlFlowView_previousProcessActionNameText=Previous Process
-ControlFlowView_previousProcessActionToolTipText=Select Previous Process
-ControlFlowView_followCPUBwdText=Follow CPU Backward
-ControlFlowView_followCPUFwdText=Follow CPU Forward
-
-ControlFlowView_attributeSyscallName=System Call
-ControlFlowView_attributeCpuName=CPU
-
-ResourcesView_stateTypeName=Resource
-ResourcesView_multipleStates=(multiple)
-ResourcesView_nextResourceActionNameText=Next Resource
-ResourcesView_nextResourceActionToolTipText=Select Next Resource
-ResourcesView_previousResourceActionNameText=Previous Resource
-ResourcesView_previousResourceActionToolTipText=Select Previous Resource
-ResourcesView_attributeCpuName=CPU
-ResourcesView_attributeIrqName=IRQ
-ResourcesView_attributeSoftIrqName=SOFT IRQ
-ResourcesView_attributeHoverTime=> Hover Time
-ResourcesView_attributeTidName=> TID
-ResourcesView_attributeProcessName=> Process
-ResourcesView_attributeSyscallName=> System Call
package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views;
+import org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow.ControlFlowView;
+import org.eclipse.tracecompass.analysis.os.linux.ui.views.resources.ResourcesView;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources.ResourcesView;
import org.eclipse.tracecompass.tmf.ui.project.wizards.NewTmfProjectWizard;
import org.eclipse.tracecompass.tmf.ui.views.histogram.HistogramView;
import org.eclipse.tracecompass.tmf.ui.views.statistics.TmfStatisticsView;
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tasse - Initial API and implementation
- * Geneviève Bastien - Move code to provide base classes for time graph view
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.controlflow;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
-
-/**
- * An entry in the Control Flow view
- */
-public class ControlFlowEntry extends TimeGraphEntry {
-
- private final @NonNull ITmfTrace fTrace;
- private final int fThreadId;
- private final int fParentThreadId;
- private final int fThreadQuark;
-
- /**
- * Constructor
- *
- * @param quark
- * The attribute quark matching the thread
- * @param trace
- * The trace on which we are working
- * @param execName
- * The exec_name of this entry
- * @param threadId
- * The TID of the thread
- * @param parentThreadId
- * the Parent_TID of this thread
- * @param startTime
- * The start time of this process's lifetime
- * @param endTime
- * The end time of this process
- */
- public ControlFlowEntry(int quark, @NonNull ITmfTrace trace, String execName, int threadId, int parentThreadId, long startTime, long endTime) {
- super(execName, startTime, endTime);
- fTrace = trace;
- fThreadId = threadId;
- fParentThreadId = parentThreadId;
- fThreadQuark = quark;
- }
-
- /**
- * Get this entry's thread ID
- *
- * @return The TID
- */
- public int getThreadId() {
- return fThreadId;
- }
-
- /**
- * Get the entry's trace
- *
- * @return the entry's trace
- */
- public @NonNull ITmfTrace getTrace() {
- return fTrace;
- }
-
- /**
- * Get this thread's parent TID
- *
- * @return The "PTID"
- */
- public int getParentThreadId() {
- return fParentThreadId;
- }
-
- /**
- * Get the quark of the attribute matching this thread's TID
- *
- * @return The quark
- */
- public int getThreadQuark() {
- return fThreadQuark;
- }
-
- @Override
- public String toString() {
- return getClass().getSimpleName() + '(' + getName() + '[' + fThreadId + "])"; //$NON-NLS-1$
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tasse - Initial API and implementation
- * Geneviève Bastien - Move code to provide base classes for time graph view
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.controlflow;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.StateValues;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.IKernelAnalysisEventLayout;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Activator;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Messages;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
-import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
-import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.StateItem;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils;
-
-/**
- * Presentation provider for the control flow view
- */
-public class ControlFlowPresentationProvider extends TimeGraphPresentationProvider {
-
- private enum State {
- UNKNOWN (new RGB(100, 100, 100)),
- WAIT_BLOCKED (new RGB(200, 200, 0)),
- WAIT_FOR_CPU (new RGB(200, 100, 0)),
- USERMODE (new RGB(0, 200, 0)),
- SYSCALL (new RGB(0, 0, 200)),
- INTERRUPTED (new RGB(200, 0, 100));
-
- public final RGB rgb;
-
- private State(RGB rgb) {
- this.rgb = rgb;
- }
-
- }
-
- /**
- * Default constructor
- */
- public ControlFlowPresentationProvider() {
- super(Messages.ControlFlowView_stateTypeName);
- }
-
- private static State[] getStateValues() {
- return State.values();
- }
-
- @Override
- public StateItem[] getStateTable() {
- State[] states = getStateValues();
- StateItem[] stateTable = new StateItem[states.length];
- for (int i = 0; i < stateTable.length; i++) {
- State state = states[i];
- stateTable[i] = new StateItem(state.rgb, state.toString());
- }
- return stateTable;
- }
-
- @Override
- public int getStateTableIndex(ITimeEvent event) {
- if (event instanceof TimeEvent && ((TimeEvent) event).hasValue()) {
- int status = ((TimeEvent) event).getValue();
- return getMatchingState(status).ordinal();
- }
- return TRANSPARENT;
- }
-
- @Override
- public String getEventName(ITimeEvent event) {
- if (event instanceof TimeEvent) {
- TimeEvent ev = (TimeEvent) event;
- if (ev.hasValue()) {
- return getMatchingState(ev.getValue()).toString();
- }
- }
- return Messages.ControlFlowView_multipleStates;
- }
-
- private static State getMatchingState(int status) {
- switch (status) {
- case StateValues.PROCESS_STATUS_WAIT_BLOCKED:
- return State.WAIT_BLOCKED;
- case StateValues.PROCESS_STATUS_WAIT_FOR_CPU:
- return State.WAIT_FOR_CPU;
- case StateValues.PROCESS_STATUS_RUN_USERMODE:
- return State.USERMODE;
- case StateValues.PROCESS_STATUS_RUN_SYSCALL:
- return State.SYSCALL;
- case StateValues.PROCESS_STATUS_INTERRUPTED:
- return State.INTERRUPTED;
- default:
- return State.UNKNOWN;
- }
- }
-
- @Override
- public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event) {
- Map<String, String> retMap = new LinkedHashMap<>();
- if (!(event instanceof TimeEvent) || !((TimeEvent) event).hasValue() ||
- !(event.getEntry() instanceof ControlFlowEntry)) {
- return retMap;
- }
- ControlFlowEntry entry = (ControlFlowEntry) event.getEntry();
- ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysis.ID);
- if (ssq == null) {
- return retMap;
- }
- int tid = entry.getThreadId();
-
- try {
- // Find every CPU first, then get the current thread
- int cpusQuark = ssq.getQuarkAbsolute(Attributes.CPUS);
- List<Integer> cpuQuarks = ssq.getSubAttributes(cpusQuark, false);
- for (Integer cpuQuark : cpuQuarks) {
- int currentThreadQuark = ssq.getQuarkRelative(cpuQuark, Attributes.CURRENT_THREAD);
- ITmfStateInterval interval = ssq.querySingleState(event.getTime(), currentThreadQuark);
- if (!interval.getStateValue().isNull()) {
- ITmfStateValue state = interval.getStateValue();
- int currentThreadId = state.unboxInt();
- if (tid == currentThreadId) {
- retMap.put(Messages.ControlFlowView_attributeCpuName, ssq.getAttributeName(cpuQuark));
- break;
- }
- }
- }
-
- } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
- Activator.getDefault().logError("Error in ControlFlowPresentationProvider", e); //$NON-NLS-1$
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- int status = ((TimeEvent) event).getValue();
- if (status == StateValues.PROCESS_STATUS_RUN_SYSCALL) {
- try {
- int syscallQuark = ssq.getQuarkRelative(entry.getThreadQuark(), Attributes.SYSTEM_CALL);
- ITmfStateInterval value = ssq.querySingleState(event.getTime(), syscallQuark);
- if (!value.getStateValue().isNull()) {
- ITmfStateValue state = value.getStateValue();
- retMap.put(Messages.ControlFlowView_attributeSyscallName, state.toString());
- }
-
- } catch (AttributeNotFoundException | TimeRangeException e) {
- Activator.getDefault().logError("Error in ControlFlowPresentationProvider", e); //$NON-NLS-1$
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- }
-
- return retMap;
- }
-
- @Override
- public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) {
- if (bounds.width <= gc.getFontMetrics().getAverageCharWidth()) {
- return;
- }
- if (!(event instanceof TimeEvent)) {
- return;
- }
- ControlFlowEntry entry = (ControlFlowEntry) event.getEntry();
- ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysis.ID);
- if (ss == null) {
- return;
- }
- int status = ((TimeEvent) event).getValue();
-
- if (status != StateValues.PROCESS_STATUS_RUN_SYSCALL) {
- return;
- }
- try {
- int syscallQuark = ss.getQuarkRelative(entry.getThreadQuark(), Attributes.SYSTEM_CALL);
- ITmfStateInterval value = ss.querySingleState(event.getTime(), syscallQuark);
- if (!value.getStateValue().isNull()) {
- ITmfStateValue state = value.getStateValue();
- gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE));
-
- /*
- * Remove the "sys_" or "syscall_entry_" or similar from what we
- * draw in the rectangle. This depends on the trace's event layout.
- */
- int beginIndex = 0;
- ITmfTrace trace = entry.getTrace();
- if (trace instanceof LttngKernelTrace) {
- IKernelAnalysisEventLayout layout = ((LttngKernelTrace) trace).getEventLayout();
- beginIndex = layout.eventSyscallEntryPrefix().length();
- }
-
- Utils.drawText(gc, state.toString().substring(beginIndex), bounds.x, bounds.y - 2, bounds.width, true, true);
- }
- } catch (AttributeNotFoundException | TimeRangeException e) {
- Activator.getDefault().logError("Error in ControlFlowPresentationProvider", e); //$NON-NLS-1$
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tasse - Initial API and implementation
- * Geneviève Bastien - Move code to provide base classes for time graph view
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.controlflow;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Activator;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Messages;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelThreadInformationProvider;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
-import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
-import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-import org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ILinkEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeLinkEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.Resolution;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat;
-
-/**
- * The Control Flow view main object
- *
- */
-public class ControlFlowView extends AbstractTimeGraphView {
-
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
-
- /**
- * View ID.
- */
- public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.views.controlflow"; //$NON-NLS-1$
-
- private static final String PROCESS_COLUMN = Messages.ControlFlowView_processColumn;
- private static final String TID_COLUMN = Messages.ControlFlowView_tidColumn;
- private static final String PTID_COLUMN = Messages.ControlFlowView_ptidColumn;
- private static final String BIRTH_TIME_COLUMN = Messages.ControlFlowView_birthTimeColumn;
- private static final String TRACE_COLUMN = Messages.ControlFlowView_traceColumn;
-
- private static final String[] COLUMN_NAMES = new String[] {
- PROCESS_COLUMN,
- TID_COLUMN,
- PTID_COLUMN,
- BIRTH_TIME_COLUMN,
- TRACE_COLUMN
- };
-
- private static final String[] FILTER_COLUMN_NAMES = new String[] {
- PROCESS_COLUMN,
- TID_COLUMN
- };
-
- // Timeout between updates in the build thread in ms
- private static final long BUILD_UPDATE_TIMEOUT = 500;
-
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
- /**
- * Constructor
- */
- public ControlFlowView() {
- super(ID, new ControlFlowPresentationProvider());
- setTreeColumns(COLUMN_NAMES);
- setTreeLabelProvider(new ControlFlowTreeLabelProvider());
- setFilterColumns(FILTER_COLUMN_NAMES);
- setFilterLabelProvider(new ControlFlowFilterLabelProvider());
- setEntryComparator(new ControlFlowEntryComparator());
- }
-
- @Override
- protected void fillLocalToolBar(IToolBarManager manager) {
- super.fillLocalToolBar(manager);
- IDialogSettings settings = Activator.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getClass().getName());
- if (section == null) {
- section = settings.addNewSection(getClass().getName());
- }
-
- IAction hideArrowsAction = getTimeGraphCombo().getTimeGraphViewer().getHideArrowsAction(section);
- manager.add(hideArrowsAction);
-
- IAction followArrowBwdAction = getTimeGraphCombo().getTimeGraphViewer().getFollowArrowBwdAction();
- followArrowBwdAction.setText(Messages.ControlFlowView_followCPUBwdText);
- followArrowBwdAction.setToolTipText(Messages.ControlFlowView_followCPUBwdText);
- manager.add(followArrowBwdAction);
-
- IAction followArrowFwdAction = getTimeGraphCombo().getTimeGraphViewer().getFollowArrowFwdAction();
- followArrowFwdAction.setText(Messages.ControlFlowView_followCPUFwdText);
- followArrowFwdAction.setToolTipText(Messages.ControlFlowView_followCPUFwdText);
- manager.add(followArrowFwdAction);
- }
-
- @Override
- protected String getNextText() {
- return Messages.ControlFlowView_nextProcessActionNameText;
- }
-
- @Override
- protected String getNextTooltip() {
- return Messages.ControlFlowView_nextProcessActionToolTipText;
- }
-
- @Override
- protected String getPrevText() {
- return Messages.ControlFlowView_previousProcessActionNameText;
- }
-
- @Override
- protected String getPrevTooltip() {
- return Messages.ControlFlowView_previousProcessActionToolTipText;
- }
-
- private static class ControlFlowEntryComparator implements Comparator<ITimeGraphEntry> {
-
- @Override
- public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) {
-
- int result = 0;
-
- if ((o1 instanceof ControlFlowEntry) && (o2 instanceof ControlFlowEntry)) {
- ControlFlowEntry entry1 = (ControlFlowEntry) o1;
- ControlFlowEntry entry2 = (ControlFlowEntry) o2;
- result = entry1.getTrace().getStartTime().compareTo(entry2.getTrace().getStartTime());
- if (result == 0) {
- result = entry1.getTrace().getName().compareTo(entry2.getTrace().getName());
- }
- if (result == 0) {
- result = entry1.getThreadId() < entry2.getThreadId() ? -1 : entry1.getThreadId() > entry2.getThreadId() ? 1 : 0;
- }
- }
-
- if (result == 0) {
- result = o1.getStartTime() < o2.getStartTime() ? -1 : o1.getStartTime() > o2.getStartTime() ? 1 : 0;
- }
-
- return result;
- }
- }
-
- /**
- * @author gbastien
- *
- */
- protected static class ControlFlowTreeLabelProvider extends TreeLabelProvider {
-
- @Override
- public String getColumnText(Object element, int columnIndex) {
- ControlFlowEntry entry = (ControlFlowEntry) element;
-
- if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_processColumn)) {
- return entry.getName();
- } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_tidColumn)) {
- return Integer.toString(entry.getThreadId());
- } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_ptidColumn)) {
- if (entry.getParentThreadId() > 0) {
- return Integer.toString(entry.getParentThreadId());
- }
- } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_birthTimeColumn)) {
- return Utils.formatTime(entry.getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC);
- } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_traceColumn)) {
- return entry.getTrace().getName();
- }
- return ""; //$NON-NLS-1$
- }
-
- }
-
- private static class ControlFlowFilterLabelProvider extends TreeLabelProvider {
-
- @Override
- public String getColumnText(Object element, int columnIndex) {
- ControlFlowEntry entry = (ControlFlowEntry) element;
-
- if (columnIndex == 0) {
- return entry.getName();
- } else if (columnIndex == 1) {
- return Integer.toString(entry.getThreadId());
- }
- return ""; //$NON-NLS-1$
- }
-
- }
-
- // ------------------------------------------------------------------------
- // Internal
- // ------------------------------------------------------------------------
-
- @Override
- protected void buildEventList(final ITmfTrace trace, ITmfTrace parentTrace, IProgressMonitor monitor) {
- ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysis.ID);
- if (ssq == null) {
- return;
- }
-
- List<ControlFlowEntry> entryList = new ArrayList<>();
- Map<Integer, ControlFlowEntry> entryMap = new HashMap<>();
-
- long start = ssq.getStartTime();
- setStartTime(Math.min(getStartTime(), start));
-
- boolean complete = false;
- while (!complete) {
- if (monitor.isCanceled()) {
- return;
- }
- complete = ssq.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
- if (ssq.isCancelled()) {
- return;
- }
- long end = ssq.getCurrentEndTime();
- if (start == end && !complete) { // when complete execute one last time regardless of end time
- continue;
- }
- setEndTime(Math.max(getEndTime(), end + 1));
- List<Integer> threadQuarks = ssq.getQuarks(Attributes.THREADS, "*"); //$NON-NLS-1$
- for (int threadQuark : threadQuarks) {
- if (monitor.isCanceled()) {
- return;
- }
- String threadName = ssq.getAttributeName(threadQuark);
- int threadId = -1;
- try {
- threadId = Integer.parseInt(threadName);
- } catch (NumberFormatException e1) {
- continue;
- }
- if (threadId <= 0) { // ignore the 'unknown' (-1) and swapper (0) threads
- continue;
- }
-
- int execNameQuark;
- List<ITmfStateInterval> execNameIntervals;
- try {
- execNameQuark = ssq.getQuarkRelative(threadQuark, Attributes.EXEC_NAME);
- execNameIntervals = StateSystemUtils.queryHistoryRange(ssq, execNameQuark, start, end);
- } catch (AttributeNotFoundException e) {
- /* No information on this thread (yet?), skip it for now */
- continue;
- } catch (StateSystemDisposedException e) {
- /* State system is closing down, no point continuing */
- break;
- }
-
- for (ITmfStateInterval execNameInterval : execNameIntervals) {
- if (monitor.isCanceled()) {
- return;
- }
- ControlFlowEntry entry = entryMap.get(threadId);
- if (!execNameInterval.getStateValue().isNull() &&
- execNameInterval.getStateValue().getType() == ITmfStateValue.Type.STRING) {
- String execName = execNameInterval.getStateValue().unboxStr();
- long startTime = execNameInterval.getStartTime();
- long endTime = execNameInterval.getEndTime() + 1;
-
- if (entry == null) {
- ITmfStateInterval ppidInterval = null;
- try {
- int ppidQuark = ssq.getQuarkRelative(threadQuark, Attributes.PPID);
- ppidInterval = StateSystemUtils.queryUntilNonNullValue(ssq, ppidQuark, startTime, endTime);
- } catch (AttributeNotFoundException e) {
- /* No info, keep PPID at -1 */
- }
-
- int ppid = -1;
- if (ppidInterval != null) {
- ppid = ppidInterval.getStateValue().unboxInt();
- }
- entry = new ControlFlowEntry(threadQuark, trace, execName, threadId, ppid, startTime, endTime);
- entryList.add(entry);
- entryMap.put(threadId, entry);
- } else {
- // update the name of the entry to the latest
- // execName
- entry.setName(execName);
- entry.updateEndTime(endTime);
- }
- } else {
- entryMap.remove(threadId);
- }
- }
- }
-
- updateTree(entryList, parentTrace);
-
- if (parentTrace.equals(getTrace())) {
- refresh();
- }
-
- for (ControlFlowEntry entry : entryList) {
- if (monitor.isCanceled()) {
- return;
- }
- buildStatusEvents(entry.getTrace(), entry, monitor, start, end);
- }
-
- start = end;
- }
- }
-
- private void updateTree(List<ControlFlowEntry> entryList, ITmfTrace parentTrace) {
- List<TimeGraphEntry> rootListToAdd = new ArrayList<>();
- List<TimeGraphEntry> rootListToRemove = new ArrayList<>();
- List<TimeGraphEntry> rootList = getEntryList(parentTrace);
-
- for (ControlFlowEntry entry : entryList) {
- boolean root = (entry.getParent() == null);
- if (root && entry.getParentThreadId() > 0) {
- for (ControlFlowEntry parent : entryList) {
- /*
- * Associate the parent entry only if their time overlap. A
- * child entry may start before its parent, for example at
- * the beginning of the trace if a parent has not yet
- * appeared in the state system. We just want to make sure
- * that the entry didn't start after the parent ended or
- * ended before the parent started.
- */
- if (parent.getThreadId() == entry.getParentThreadId() &&
- !(entry.getStartTime() > parent.getEndTime() ||
- entry.getEndTime() < parent.getStartTime())) {
- parent.addChild(entry);
- root = false;
- if (rootList != null && rootList.contains(entry)) {
- rootListToRemove.add(entry);
- }
- break;
- }
- }
- }
- if (root && (rootList == null || !rootList.contains(entry))) {
- rootListToAdd.add(entry);
- }
- }
-
- addToEntryList(parentTrace, rootListToAdd);
- removeFromEntryList(parentTrace, rootListToRemove);
- }
-
- private void buildStatusEvents(ITmfTrace trace, ControlFlowEntry entry, @NonNull IProgressMonitor monitor, long start, long end) {
- if (start < entry.getEndTime() && end > entry.getStartTime()) {
- ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysis.ID);
- if (ssq == null) {
- return;
- }
-
- long startTime = Math.max(start, entry.getStartTime());
- long endTime = Math.min(end + 1, entry.getEndTime());
- long resolution = Math.max(1, (end - ssq.getStartTime()) / getDisplayWidth());
- List<ITimeEvent> eventList = getEventList(entry, startTime, endTime, resolution, monitor);
- if (eventList == null) {
- return;
- }
- for (ITimeEvent event : eventList) {
- entry.addEvent(event);
- }
- if (trace.equals(getTrace())) {
- redraw();
- }
- }
- for (ITimeGraphEntry child : entry.getChildren()) {
- if (monitor.isCanceled()) {
- return;
- }
- buildStatusEvents(trace, (ControlFlowEntry) child, monitor, start, end);
- }
- }
-
- @Override
- protected @Nullable List<ITimeEvent> getEventList(TimeGraphEntry tgentry, long startTime, long endTime, long resolution, IProgressMonitor monitor) {
- List<ITimeEvent> eventList = null;
- if (!(tgentry instanceof ControlFlowEntry)) {
- return eventList;
- }
- ControlFlowEntry entry = (ControlFlowEntry) tgentry;
- final long realStart = Math.max(startTime, entry.getStartTime());
- final long realEnd = Math.min(endTime, entry.getEndTime());
- if (realEnd <= realStart) {
- return null;
- }
- LttngKernelAnalysis kernelAnalysis = TmfTraceUtils.getAnalysisModuleOfClass(entry.getTrace(), LttngKernelAnalysis.class, LttngKernelAnalysis.ID);
- if (kernelAnalysis == null) {
- return null;
- }
- try {
- List<ITmfStateInterval> statusIntervals = LttngKernelThreadInformationProvider.getStatusIntervalsForThread(kernelAnalysis, entry.getThreadId(), realStart, realEnd, resolution, monitor);
- eventList = new ArrayList<>(statusIntervals.size());
- long lastEndTime = -1;
- for (ITmfStateInterval statusInterval : statusIntervals) {
- if (monitor.isCanceled()) {
- return null;
- }
- long time = statusInterval.getStartTime();
- long duration = statusInterval.getEndTime() - time + 1;
- int status = -1;
- try {
- status = statusInterval.getStateValue().unboxInt();
- } catch (StateValueTypeException e) {
- e.printStackTrace();
- }
- if (lastEndTime != time && lastEndTime != -1) {
- eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
- }
- eventList.add(new TimeEvent(entry, time, duration, status));
- lastEndTime = time + duration;
- }
- } catch (TimeRangeException e) {
- Activator.getDefault().logError(e.getMessage());
- }
- return eventList;
- }
-
- /**
- * Returns a value corresponding to the selected entry.
- *
- * Used in conjunction with synchingToTime to change the selected entry. If
- * one of these methods is overridden in child class, then both should be.
- *
- * @param time
- * The currently selected time
- * @return a value identifying the entry
- */
- private int getSelectionValue(long time) {
- int thread = -1;
- ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace());
- if (traces == null) {
- return thread;
- }
- for (ITmfTrace trace : traces) {
- if (thread > 0) {
- break;
- }
- if (trace == null) {
- continue;
- }
- ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysis.ID);
- if (ssq == null) {
- continue;
- }
- if (time >= ssq.getStartTime() && time <= ssq.getCurrentEndTime()) {
- List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); //$NON-NLS-1$
- for (int currentThreadQuark : currentThreadQuarks) {
- try {
- ITmfStateInterval currentThreadInterval = ssq.querySingleState(time, currentThreadQuark);
- int currentThread = currentThreadInterval.getStateValue().unboxInt();
- if (currentThread > 0) {
- int statusQuark = ssq.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThread), Attributes.STATUS);
- ITmfStateInterval statusInterval = ssq.querySingleState(time, statusQuark);
- if (statusInterval.getStartTime() == time) {
- thread = currentThread;
- break;
- }
- }
- } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
- e.printStackTrace();
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- }
- }
- }
- return thread;
- }
-
- @Override
- protected void synchingToTime(long time) {
- int selected = getSelectionValue(time);
- if (selected > 0) {
- for (Object element : getTimeGraphViewer().getExpandedElements()) {
- if (element instanceof ControlFlowEntry) {
- ControlFlowEntry entry = (ControlFlowEntry) element;
- if (entry.getThreadId() == selected) {
- getTimeGraphCombo().setSelection(entry);
- break;
- }
- }
- }
- }
- }
-
- @Override
- protected List<ILinkEvent> getLinkList(long startTime, long endTime, long resolution, IProgressMonitor monitor) {
- List<ILinkEvent> list = new ArrayList<>();
- ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace());
- List<TimeGraphEntry> entryList = getEntryList(getTrace());
- if (traces == null || entryList == null) {
- return list;
- }
- for (ITmfTrace trace : traces) {
- if (trace == null) {
- continue;
- }
- ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysis.ID);
- if (ssq == null) {
- continue;
- }
- try {
- long start = Math.max(startTime, ssq.getStartTime());
- long end = Math.min(endTime, ssq.getCurrentEndTime());
- if (end < start) {
- continue;
- }
- List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); //$NON-NLS-1$
- for (int currentThreadQuark : currentThreadQuarks) {
- // adjust the query range to include the previous and following intervals
- long qstart = Math.max(ssq.querySingleState(start, currentThreadQuark).getStartTime() - 1, ssq.getStartTime());
- long qend = Math.min(ssq.querySingleState(end, currentThreadQuark).getEndTime() + 1, ssq.getCurrentEndTime());
- List<ITmfStateInterval> currentThreadIntervals = StateSystemUtils.queryHistoryRange(ssq, currentThreadQuark, qstart, qend, resolution, monitor);
- int prevThread = 0;
- long prevEnd = 0;
- long lastEnd = 0;
- for (ITmfStateInterval currentThreadInterval : currentThreadIntervals) {
- if (monitor.isCanceled()) {
- return null;
- }
- long time = currentThreadInterval.getStartTime();
- if (time != lastEnd) {
- // don't create links where there are gaps in intervals due to the resolution
- prevThread = 0;
- prevEnd = 0;
- }
- int thread = currentThreadInterval.getStateValue().unboxInt();
- if (thread > 0 && prevThread > 0) {
- ITimeGraphEntry prevEntry = findEntry(entryList, trace, prevThread);
- ITimeGraphEntry nextEntry = findEntry(entryList, trace, thread);
- list.add(new TimeLinkEvent(prevEntry, nextEntry, prevEnd, time - prevEnd, 0));
- }
- lastEnd = currentThreadInterval.getEndTime() + 1;
- if (thread != 0) {
- prevThread = thread;
- prevEnd = lastEnd;
- }
- }
- }
- } catch (TimeRangeException | AttributeNotFoundException | StateValueTypeException e) {
- e.printStackTrace();
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- }
- return list;
- }
-
- private ControlFlowEntry findEntry(List<? extends ITimeGraphEntry> entryList, ITmfTrace trace, int threadId) {
- for (ITimeGraphEntry entry : entryList) {
- if (entry instanceof ControlFlowEntry) {
- ControlFlowEntry controlFlowEntry = (ControlFlowEntry) entry;
- if (controlFlowEntry.getThreadId() == threadId && controlFlowEntry.getTrace() == trace) {
- return controlFlowEntry;
- } else if (entry.hasChildren()) {
- controlFlowEntry = findEntry(entry.getChildren(), trace, threadId);
- if (controlFlowEntry != null) {
- return controlFlowEntry;
- }
- }
- }
- }
- return null;
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.cpuusage;
-
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.cpuusage.LttngKernelCpuUsageAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
-import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
-import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-import org.eclipse.tracecompass.tmf.ui.viewers.tree.AbstractTmfTreeViewer;
-import org.eclipse.tracecompass.tmf.ui.viewers.tree.ITmfTreeColumnDataProvider;
-import org.eclipse.tracecompass.tmf.ui.viewers.tree.ITmfTreeViewerEntry;
-import org.eclipse.tracecompass.tmf.ui.viewers.tree.TmfTreeColumnData;
-import org.eclipse.tracecompass.tmf.ui.viewers.tree.TmfTreeColumnData.ITmfColumnPercentageProvider;
-import org.eclipse.tracecompass.tmf.ui.viewers.tree.TmfTreeViewerEntry;
-
-/**
- * Tree viewer to display CPU usage information in a specified time range. It
- * shows the process's TID, its name, the time spent on the CPU during that
- * range, in % and absolute value.
- *
- * @author Geneviève Bastien
- */
-public class CpuUsageComposite extends AbstractTmfTreeViewer {
-
- // Timeout between to wait for in the updateElements method
- private static final long BUILD_UPDATE_TIMEOUT = 500;
-
- private LttngKernelCpuUsageAnalysis fModule = null;
- private String fSelectedThread = null;
-
- private static final String[] COLUMN_NAMES = new String[] {
- Messages.CpuUsageComposite_ColumnTID,
- Messages.CpuUsageComposite_ColumnProcess,
- Messages.CpuUsageComposite_ColumnPercent,
- Messages.CpuUsageComposite_ColumnTime
- };
-
- /* A map that saves the mapping of a thread ID to its executable name */
- private final Map<String, String> fProcessNameMap = new HashMap<>();
-
- /** Provides label for the CPU usage tree viewer cells */
- protected static class CpuLabelProvider extends TreeLabelProvider {
-
- @Override
- public String getColumnText(Object element, int columnIndex) {
- CpuUsageEntry obj = (CpuUsageEntry) element;
- if (columnIndex == 0) {
- return obj.getTid();
- } else if (columnIndex == 1) {
- return obj.getProcessName();
- } else if (columnIndex == 2) {
- return String.format(Messages.CpuUsageComposite_TextPercent, obj.getPercent());
- } else if (columnIndex == 3) {
- return NLS.bind(Messages.CpuUsageComposite_TextTime, obj.getTime());
- }
-
- return element.toString();
- }
-
- }
-
- /**
- * Constructor
- *
- * @param parent
- * The parent composite that holds this viewer
- */
- public CpuUsageComposite(Composite parent) {
- super(parent, false);
- setLabelProvider(new CpuLabelProvider());
- }
-
- @Override
- protected ITmfTreeColumnDataProvider getColumnDataProvider() {
- return new ITmfTreeColumnDataProvider() {
-
- @Override
- public List<TmfTreeColumnData> getColumnData() {
- /* All columns are sortable */
- List<TmfTreeColumnData> columns = new ArrayList<>();
- TmfTreeColumnData column = new TmfTreeColumnData(COLUMN_NAMES[0]);
- column.setComparator(new ViewerComparator() {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- CpuUsageEntry n1 = (CpuUsageEntry) e1;
- CpuUsageEntry n2 = (CpuUsageEntry) e2;
-
- return n1.getTid().compareTo(n2.getTid());
-
- }
- });
- columns.add(column);
- column = new TmfTreeColumnData(COLUMN_NAMES[1]);
- column.setComparator(new ViewerComparator() {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- CpuUsageEntry n1 = (CpuUsageEntry) e1;
- CpuUsageEntry n2 = (CpuUsageEntry) e2;
-
- return n1.getProcessName().compareTo(n2.getProcessName());
-
- }
- });
- columns.add(column);
- column = new TmfTreeColumnData(COLUMN_NAMES[2]);
- column.setComparator(new ViewerComparator() {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- CpuUsageEntry n1 = (CpuUsageEntry) e1;
- CpuUsageEntry n2 = (CpuUsageEntry) e2;
-
- return n1.getPercent().compareTo(n2.getPercent());
-
- }
- });
- column.setPercentageProvider(new ITmfColumnPercentageProvider() {
-
- @Override
- public double getPercentage(Object data) {
- CpuUsageEntry parent = (CpuUsageEntry) data;
- return parent.getPercent() / 100;
- }
- });
- columns.add(column);
- column = new TmfTreeColumnData(COLUMN_NAMES[3]);
- column.setComparator(new ViewerComparator() {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- CpuUsageEntry n1 = (CpuUsageEntry) e1;
- CpuUsageEntry n2 = (CpuUsageEntry) e2;
-
- return n1.getTime().compareTo(n2.getTime());
-
- }
- });
- columns.add(column);
-
- return columns;
- }
-
- };
- }
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- protected void contentChanged(ITmfTreeViewerEntry rootEntry) {
- String selectedThread = fSelectedThread;
- if (selectedThread != null) {
- /* Find the selected thread among the inputs */
- for (ITmfTreeViewerEntry entry : rootEntry.getChildren()) {
- if (entry instanceof CpuUsageEntry) {
- if (selectedThread.equals(((CpuUsageEntry) entry).getTid())) {
- List<ITmfTreeViewerEntry> list = checkNotNull(Collections.singletonList(entry));
- super.setSelection(list);
- return;
- }
- }
- }
- }
- }
-
- @Override
- public void initializeDataSource() {
- fModule = TmfTraceUtils.getAnalysisModuleOfClass(getTrace(), LttngKernelCpuUsageAnalysis.class, LttngKernelCpuUsageAnalysis.ID);
- if (fModule == null) {
- return;
- }
- fModule.schedule();
- fModule.waitForInitialization();
- fProcessNameMap.clear();
- }
-
- @Override
- protected ITmfTreeViewerEntry updateElements(long start, long end, boolean isSelection) {
- if (isSelection || (start == end)) {
- return null;
- }
- if (getTrace() == null || fModule == null) {
- return null;
- }
- fModule.waitForInitialization();
- ITmfStateSystem ss = fModule.getStateSystem();
- if (ss == null) {
- return null;
- }
-
- boolean complete = false;
- long currentEnd = start;
-
- while (!complete && currentEnd < end) {
- complete = ss.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
- currentEnd = ss.getCurrentEndTime();
- }
-
- /* Initialize the data */
- Map<String, Long> cpuUsageMap = fModule.getCpuUsageInRange(Math.max(start, getStartTime()), Math.min(end, getEndTime()));
-
- TmfTreeViewerEntry root = new TmfTreeViewerEntry(""); //$NON-NLS-1$
- List<ITmfTreeViewerEntry> entryList = root.getChildren();
-
- for (Entry<String, Long> entry : cpuUsageMap.entrySet()) {
- /*
- * Process only entries representing the total of all CPUs and that
- * have time on CPU
- */
- if (entry.getValue() == 0) {
- continue;
- }
- if (!entry.getKey().startsWith(LttngKernelCpuUsageAnalysis.TOTAL)) {
- continue;
- }
- String[] strings = entry.getKey().split(LttngKernelCpuUsageAnalysis.SPLIT_STRING, 2);
-
- if ((strings.length > 1) && !(strings[1].equals(LttngKernelCpuUsageAnalysis.TID_ZERO))) {
- CpuUsageEntry obj = new CpuUsageEntry(strings[1], getProcessName(strings[1]), (double) entry.getValue() / (double) (end - start) * 100, entry.getValue());
- entryList.add(obj);
- }
- }
-
- return root;
- }
-
- /*
- * Get the process name from its TID by using the LTTng kernel analysis
- * module
- */
- private String getProcessName(String tid) {
- String execName = fProcessNameMap.get(tid);
- if (execName != null) {
- return execName;
- }
- ITmfTrace trace = getTrace();
- if (trace == null) {
- return tid;
- }
- ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysis.ID);
- if (kernelSs == null) {
- return tid;
- }
-
- try {
- int cpusNode = kernelSs.getQuarkAbsolute(Attributes.THREADS);
-
- /* Get the quarks for each cpu */
- List<Integer> cpuNodes = kernelSs.getSubAttributes(cpusNode, false);
-
- for (Integer tidQuark : cpuNodes) {
- if (kernelSs.getAttributeName(tidQuark).equals(tid)) {
- int execNameQuark;
- List<ITmfStateInterval> execNameIntervals;
- try {
- execNameQuark = kernelSs.getQuarkRelative(tidQuark, Attributes.EXEC_NAME);
- execNameIntervals = StateSystemUtils.queryHistoryRange(kernelSs, execNameQuark, getStartTime(), getEndTime());
- } catch (AttributeNotFoundException e) {
- /* No information on this thread (yet?), skip it for now */
- continue;
- } catch (StateSystemDisposedException e) {
- /* State system is closing down, no point continuing */
- break;
- }
-
- for (ITmfStateInterval execNameInterval : execNameIntervals) {
- if (!execNameInterval.getStateValue().isNull() &&
- execNameInterval.getStateValue().getType() == ITmfStateValue.Type.STRING) {
- execName = execNameInterval.getStateValue().unboxStr();
- fProcessNameMap.put(tid, execName);
- return execName;
- }
- }
- }
- }
-
- } catch (AttributeNotFoundException e) {
- /* can't find the process name, just return the tid instead */
- }
- return tid;
- }
-
- /**
- * Set the currently selected thread ID
- *
- * @param tid
- * The selected thread ID
- */
- public void setSelectedThread(String tid) {
- fSelectedThread = tid;
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.cpuusage;
-
-import org.eclipse.tracecompass.tmf.ui.viewers.tree.TmfTreeViewerEntry;
-
-/**
- * Represents an entry in the tree viewer of the CPU usage view. An entry is a
- * thread that occupied part of the CPU in the selected time range.
- *
- * @author Geneviève Bastien
- */
-public class CpuUsageEntry extends TmfTreeViewerEntry {
- private final String fTid;
- private final String fProcessName;
- private final Double fPercent;
- private final Long fTime;
-
- /**
- * Constructor
- *
- * @param tid
- * The TID of the process
- * @param name
- * The thread's name
- * @param percent
- * The percentage CPU usage
- * @param time
- * The total amount of time spent on CPU
- */
- public CpuUsageEntry(String tid, String name, double percent, long time) {
- super(tid);
- fTid = tid;
- fProcessName = name;
- fPercent = percent;
- fTime = time;
- }
-
- /**
- * Get the TID of the thread represented by this entry
- *
- * @return The thread's TID
- */
- public String getTid() {
- return fTid;
- }
-
- /**
- * Get the process name
- *
- * @return The process name
- */
- public String getProcessName() {
- return fProcessName;
- }
-
- /**
- * Get the percentage of time spent on CPU in the time interval represented
- * by this entry.
- *
- * @return The percentage of time spent on CPU
- */
- public Double getPercent() {
- return fPercent;
- }
-
- /**
- * Get the total time spent on CPU in the time interval represented by this
- * entry.
- *
- * @return The total time spent on CPU
- */
- public Long getTime() {
- return fTime;
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.cpuusage;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.ui.views.TmfView;
-
-/**
- * CPU usage view. It contains 2 viewers: one tree viewer showing all the
- * threads who were on the CPU in the time range, and one XY chart viewer
- * plotting the total time spent on CPU and the time of the threads selected in
- * the tree viewer.
- *
- * @author Geneviève Bastien
- */
-public class CpuUsageView extends TmfView {
-
- /** ID string */
- public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.views.cpuusage"; //$NON-NLS-1$
-
- private CpuUsageComposite fTreeViewer = null;
- private CpuUsageXYViewer fXYViewer = null;
-
- /**
- * Constructor
- */
- public CpuUsageView() {
- super(Messages.CpuUsageView_Title);
- }
-
- @Override
- public void createPartControl(Composite parent) {
-
- final SashForm sash = new SashForm(parent, SWT.NONE);
-
- fTreeViewer = new CpuUsageComposite(sash);
-
- /* Build the XY chart part of the view */
- fXYViewer = new CpuUsageXYViewer(sash);
-
- /* Add selection listener to tree viewer */
- fTreeViewer.addSelectionChangeListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection) {
- Object structSelection = ((IStructuredSelection) selection).getFirstElement();
- if (structSelection instanceof CpuUsageEntry) {
- CpuUsageEntry entry = (CpuUsageEntry) structSelection;
- fTreeViewer.setSelectedThread(entry.getTid());
- fXYViewer.setSelectedThread(Long.valueOf(entry.getTid()));
- }
- }
- }
- });
-
- sash.setLayout(new FillLayout());
-
- /* Initialize the viewers with the currently selected trace */
- ITmfTrace trace = getActiveTrace();
- if (trace != null) {
- TmfTraceSelectedSignal signal = new TmfTraceSelectedSignal(this, trace);
- fTreeViewer.traceSelected(signal);
- fXYViewer.traceSelected(signal);
- }
-
- }
-
- @Override
- public void setFocus() {
- }
-
- @Override
- public void dispose() {
- super.dispose();
- if (fTreeViewer != null) {
- fTreeViewer.dispose();
- }
- if (fXYViewer != null) {
- fXYViewer.dispose();
- }
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.cpuusage;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Activator;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.cpuusage.LttngKernelCpuUsageAnalysis;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-import org.eclipse.tracecompass.tmf.ui.viewers.xycharts.linecharts.TmfCommonXLineChartViewer;
-
-/**
- * CPU usage viewer with XY line chart. It displays the total CPU usage and that
- * of the threads selected in the CPU usage tree viewer.
- *
- * @author Geneviève Bastien
- */
-public class CpuUsageXYViewer extends TmfCommonXLineChartViewer {
-
- private LttngKernelCpuUsageAnalysis fModule = null;
-
- /* Maps a thread ID to a list of y values */
- private final Map<String, double[]> fYValues = new LinkedHashMap<>();
- /*
- * To avoid up and downs CPU usage when process is in and out of CPU
- * frequently, use a smaller resolution to get better averages.
- */
- private static final double RESOLUTION = 0.4;
-
- // Timeout between updates in the updateData thread
- private static final long BUILD_UPDATE_TIMEOUT = 500;
-
- private long fSelectedThread = -1;
-
- /**
- * Constructor
- *
- * @param parent
- * parent composite
- */
- public CpuUsageXYViewer(Composite parent) {
- super(parent, Messages.CpuUsageXYViewer_Title, Messages.CpuUsageXYViewer_TimeXAxis, Messages.CpuUsageXYViewer_CpuYAxis);
- setResolution(RESOLUTION);
- }
-
- @Override
- protected void initializeDataSource() {
- if (getTrace() != null) {
- fModule = TmfTraceUtils.getAnalysisModuleOfClass(getTrace(), LttngKernelCpuUsageAnalysis.class, LttngKernelCpuUsageAnalysis.ID);
- if (fModule == null) {
- return;
- }
- fModule.schedule();
- }
- }
-
- private static double[] zeroFill(int nb) {
- double[] arr = new double[nb];
- Arrays.fill(arr, 0.0);
- return arr;
- }
-
- @Override
- protected void updateData(long start, long end, int nb, IProgressMonitor monitor) {
- try {
- if (getTrace() == null || fModule == null) {
- return;
- }
- fModule.waitForInitialization();
- ITmfStateSystem ss = fModule.getStateSystem();
- if (ss == null) {
- return;
- }
- double[] xvalues = getXAxis(start, end, nb);
- if (xvalues.length == 0) {
- return;
- }
- setXAxis(xvalues);
-
- boolean complete = false;
- long currentEnd = start;
-
- while (!complete && currentEnd < end) {
-
- if (monitor.isCanceled()) {
- return;
- }
-
- long traceStart = getStartTime();
- long traceEnd = getEndTime();
- long offset = getTimeOffset();
- long selectedThread = fSelectedThread;
-
- complete = ss.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
- currentEnd = ss.getCurrentEndTime();
-
- /* Initialize the data */
- Map<String, Long> cpuUsageMap = fModule.getCpuUsageInRange(Math.max(start, traceStart), Math.min(end, traceEnd));
- Map<String, String> totalEntries = new HashMap<>();
- fYValues.clear();
- fYValues.put(Messages.CpuUsageXYViewer_Total, zeroFill(xvalues.length));
- String stringSelectedThread = Long.toString(selectedThread);
- if (selectedThread != -1) {
- fYValues.put(stringSelectedThread, zeroFill(xvalues.length));
- }
-
- for (Entry<String, Long> entry : cpuUsageMap.entrySet()) {
- /*
- * Process only entries representing the total of all CPUs
- * and that have time on CPU
- */
- if (entry.getValue() == 0) {
- continue;
- }
- if (!entry.getKey().startsWith(LttngKernelCpuUsageAnalysis.TOTAL)) {
- continue;
- }
- String[] strings = entry.getKey().split(LttngKernelCpuUsageAnalysis.SPLIT_STRING, 2);
-
- if ((strings.length > 1) && !(strings[1].equals(LttngKernelCpuUsageAnalysis.TID_ZERO))) {
- /* This is the total cpu usage for a thread */
- totalEntries.put(strings[1], entry.getKey());
- }
- }
-
- double prevX = xvalues[0];
- long prevTime = (long) prevX + offset;
- /*
- * make sure that time is in the trace range after double to
- * long conversion
- */
- prevTime = Math.max(traceStart, prevTime);
- prevTime = Math.min(traceEnd, prevTime);
- /* Get CPU usage statistics for each x value */
- for (int i = 1; i < xvalues.length; i++) {
- if (monitor.isCanceled()) {
- return;
- }
- long totalCpu = 0;
- double x = xvalues[i];
- long time = (long) x + offset;
- time = Math.max(traceStart, time);
- time = Math.min(traceEnd, time);
-
- cpuUsageMap = fModule.getCpuUsageInRange(prevTime, time);
-
- /*
- * Calculate the sum of all total entries, and add a data
- * point to the selected one
- */
- for (Entry<String, String> entry : totalEntries.entrySet()) {
- Long cpuEntry = cpuUsageMap.get(entry.getValue());
- cpuEntry = cpuEntry != null ? cpuEntry : 0L;
-
- totalCpu += cpuEntry;
-
- if (entry.getKey().equals(stringSelectedThread)) {
- /* This is the total cpu usage for a thread */
- fYValues.get(entry.getKey())[i] = (double) cpuEntry / (double) (time - prevTime) * 100;
- }
-
- }
- fYValues.get(Messages.CpuUsageXYViewer_Total)[i] = (double) totalCpu / (double) (time - prevTime) * 100;
- prevTime = time;
- }
- for (Entry<String, double[]> entry : fYValues.entrySet()) {
- setSeries(entry.getKey(), entry.getValue());
- }
- if (monitor.isCanceled()) {
- return;
- }
- updateDisplay();
- }
- } catch (StateValueTypeException e) {
- Activator.getDefault().logError("Error updating the data of the CPU usage view", e); //$NON-NLS-1$
- }
-
- }
-
- /**
- * Set the selected thread ID, which will be graphed in this viewer
- *
- * @param tid
- * The selected thread ID
- */
- public void setSelectedThread(long tid) {
- cancelUpdate();
- deleteSeries(Long.toString(fSelectedThread));
- fSelectedThread = tid;
- updateContent();
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.cpuusage;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Messages used in the LTTng kernel CPU usage view and viewers.
- *
- * @author Geneviève Bastien
- */
-@SuppressWarnings("javadoc")
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.cpuusage.messages"; //$NON-NLS-1$
- public static String CpuUsageComposite_ColumnPercent;
- public static String CpuUsageComposite_ColumnProcess;
- public static String CpuUsageComposite_ColumnTID;
- public static String CpuUsageComposite_ColumnTime;
- public static String CpuUsageComposite_TextPercent;
- public static String CpuUsageComposite_TextTime;
- public static String CpuUsageView_Title;
- public static String CpuUsageXYViewer_CpuYAxis;
- public static String CpuUsageXYViewer_TimeXAxis;
- public static String CpuUsageXYViewer_Title;
- public static String CpuUsageXYViewer_Total;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
+++ /dev/null
-###############################################################################
-# Copyright (c) 2014 École Polytechnique de Montréal
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Geneviève Bastien - Initial API and implementation
-###############################################################################
-
-CpuUsageComposite_ColumnPercent=%
-CpuUsageComposite_ColumnProcess=Process
-CpuUsageComposite_ColumnTID=TID
-CpuUsageComposite_ColumnTime=Time
-CpuUsageComposite_TextPercent=%1$.3f %%
-CpuUsageComposite_TextTime={0} ns
-CpuUsageView_Title=CPU Usage
-CpuUsageXYViewer_CpuYAxis=% CPU
-CpuUsageXYViewer_TimeXAxis=Time
-CpuUsageXYViewer_Title=CPU usage
-CpuUsageXYViewer_Total=Total
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tasse - Initial API and implementation
- * Geneviève Bastien - Move code to provide base classes for time graph view
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
-
-/**
- * An entry, or row, in the resource view
- *
- * @author Patrick Tasse
- */
-public class ResourcesEntry extends TimeGraphEntry implements Comparable<ITimeGraphEntry> {
-
- /** Type of resource */
- public static enum Type {
- /** Null resources (filler rows, etc.) */
- NULL,
- /** Entries for CPUs */
- CPU,
- /** Entries for IRQs */
- IRQ,
- /** Entries for Soft IRQ */
- SOFT_IRQ
- }
-
- private final int fId;
- private final @NonNull ITmfTrace fTrace;
- private final Type fType;
- private final int fQuark;
-
- /**
- * Constructor
- *
- * @param quark
- * The attribute quark matching the entry
- * @param trace
- * The trace on which we are working
- * @param name
- * The exec_name of this entry
- * @param startTime
- * The start time of this entry lifetime
- * @param endTime
- * The end time of this entry
- * @param type
- * The type of this entry
- * @param id
- * The id of this entry
- */
- public ResourcesEntry(int quark, @NonNull ITmfTrace trace, String name,
- long startTime, long endTime, Type type, int id) {
- super(name, startTime, endTime);
- fId = id;
- fTrace = trace;
- fType = type;
- fQuark = quark;
- }
-
- /**
- * Constructor
- *
- * @param trace
- * The trace on which we are working
- * @param name
- * The exec_name of this entry
- * @param startTime
- * The start time of this entry lifetime
- * @param endTime
- * The end time of this entry
- * @param id
- * The id of this entry
- */
- public ResourcesEntry(@NonNull ITmfTrace trace, String name,
- long startTime, long endTime, int id) {
- this(-1, trace, name, startTime, endTime, Type.NULL, id);
- }
-
- /**
- * Constructor
- *
- * @param quark
- * The attribute quark matching the entry
- * @param trace
- * The trace on which we are working
- * @param startTime
- * The start time of this entry lifetime
- * @param endTime
- * The end time of this entry
- * @param type
- * The type of this entry
- * @param id
- * The id of this entry
- */
- public ResourcesEntry(int quark, @NonNull ITmfTrace trace,
- long startTime, long endTime, Type type, int id) {
- this(quark, trace, type.toString() + " " + id, startTime, endTime, type, id); //$NON-NLS-1$
- }
-
- /**
- * Get the entry's id
- *
- * @return the entry's id
- */
- public int getId() {
- return fId;
- }
-
- /**
- * Get the entry's trace
- *
- * @return the entry's trace
- */
- public @NonNull ITmfTrace getTrace() {
- return fTrace;
- }
-
- /**
- * Get the entry Type of this entry. Uses the inner Type enum.
- *
- * @return The entry type
- */
- public Type getType() {
- return fType;
- }
-
- /**
- * Retrieve the attribute quark that's represented by this entry.
- *
- * @return The integer quark The attribute quark matching the entry
- */
- public int getQuark() {
- return fQuark;
- }
-
- @Override
- public boolean hasTimeEvents() {
- if (fType == Type.NULL) {
- return false;
- }
- return true;
- }
-
- @Override
- public int compareTo(ITimeGraphEntry other) {
- if (!(other instanceof ResourcesEntry)) {
- /* Should not happen, but if it does, put those entries at the end */
- return -1;
- }
- ResourcesEntry o = (ResourcesEntry) other;
-
- /*
- * Resources entry names should all be of type "ABC 123"
- *
- * We want to filter on the Type first (the "ABC" part), then on the ID
- * ("123") in numerical order (so we get 1,2,10 and not 1,10,2).
- */
- int ret = this.getType().compareTo(o.getType());
- if (ret != 0) {
- return ret;
- }
- return Integer.compare(this.getId(), o.getId());
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tasse - Initial API and implementation
- * Geneviève Bastien - Move code to provide base classes for time graph view
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.StateValues;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.IKernelAnalysisEventLayout;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Activator;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Messages;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
-import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
-import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.StateItem;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.NullTimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.ITmfTimeGraphDrawingHelper;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.Resolution;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat;
-
-/**
- * Presentation provider for the Resource view, based on the generic TMF
- * presentation provider.
- *
- * @author Patrick Tasse
- */
-public class ResourcesPresentationProvider extends TimeGraphPresentationProvider {
-
- private long fLastThreadId = -1;
- private Color fColorWhite;
- private Color fColorGray;
- private Integer fAverageCharWidth;
-
- private enum State {
- IDLE (new RGB(200, 200, 200)),
- USERMODE (new RGB( 0, 200, 0)),
- SYSCALL (new RGB( 0, 0, 200)),
- IRQ (new RGB(200, 0, 100)),
- SOFT_IRQ (new RGB(200, 150, 100)),
- IRQ_ACTIVE (new RGB(200, 0, 100)),
- SOFT_IRQ_RAISED (new RGB(200, 200, 0)),
- SOFT_IRQ_ACTIVE (new RGB(200, 150, 100));
-
- public final RGB rgb;
-
- private State(RGB rgb) {
- this.rgb = rgb;
- }
- }
-
- /**
- * Default constructor
- */
- public ResourcesPresentationProvider() {
- super();
- }
-
- private static State[] getStateValues() {
- return State.values();
- }
-
- private static State getEventState(TimeEvent event) {
- if (event.hasValue()) {
- ResourcesEntry entry = (ResourcesEntry) event.getEntry();
- int value = event.getValue();
-
- if (entry.getType() == Type.CPU) {
- if (value == StateValues.CPU_STATUS_IDLE) {
- return State.IDLE;
- } else if (value == StateValues.CPU_STATUS_RUN_USERMODE) {
- return State.USERMODE;
- } else if (value == StateValues.CPU_STATUS_RUN_SYSCALL) {
- return State.SYSCALL;
- } else if (value == StateValues.CPU_STATUS_IRQ) {
- return State.IRQ;
- } else if (value == StateValues.CPU_STATUS_SOFTIRQ) {
- return State.SOFT_IRQ;
- }
- } else if (entry.getType() == Type.IRQ) {
- return State.IRQ_ACTIVE;
- } else if (entry.getType() == Type.SOFT_IRQ) {
- if (value == StateValues.SOFT_IRQ_RAISED) {
- return State.SOFT_IRQ_RAISED;
- }
- return State.SOFT_IRQ_ACTIVE;
- }
- }
- return null;
- }
-
- @Override
- public int getStateTableIndex(ITimeEvent event) {
- State state = getEventState((TimeEvent) event);
- if (state != null) {
- return state.ordinal();
- }
- if (event instanceof NullTimeEvent) {
- return INVISIBLE;
- }
- return TRANSPARENT;
- }
-
- @Override
- public StateItem[] getStateTable() {
- State[] states = getStateValues();
- StateItem[] stateTable = new StateItem[states.length];
- for (int i = 0; i < stateTable.length; i++) {
- State state = states[i];
- stateTable[i] = new StateItem(state.rgb, state.toString());
- }
- return stateTable;
- }
-
- @Override
- public String getEventName(ITimeEvent event) {
- State state = getEventState((TimeEvent) event);
- if (state != null) {
- return state.toString();
- }
- if (event instanceof NullTimeEvent) {
- return null;
- }
- return Messages.ResourcesView_multipleStates;
- }
-
- @Override
- public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) {
-
- Map<String, String> retMap = new LinkedHashMap<>();
- if (event instanceof TimeEvent && ((TimeEvent) event).hasValue()) {
-
- TimeEvent tcEvent = (TimeEvent) event;
- ResourcesEntry entry = (ResourcesEntry) event.getEntry();
-
- if (tcEvent.hasValue()) {
- ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysis.ID);
- if (ss == null) {
- return retMap;
- }
- // Check for IRQ or Soft_IRQ type
- if (entry.getType().equals(Type.IRQ) || entry.getType().equals(Type.SOFT_IRQ)) {
-
- // Get CPU of IRQ or SoftIRQ and provide it for the tooltip display
- int cpu = tcEvent.getValue();
- if (cpu >= 0) {
- retMap.put(Messages.ResourcesView_attributeCpuName, String.valueOf(cpu));
- }
- }
-
- // Check for type CPU
- else if (entry.getType().equals(Type.CPU)) {
- int status = tcEvent.getValue();
-
- if (status == StateValues.CPU_STATUS_IRQ) {
- // In IRQ state get the IRQ that caused the interruption
- int cpu = entry.getId();
-
- try {
- List<ITmfStateInterval> fullState = ss.queryFullState(event.getTime());
- List<Integer> irqQuarks = ss.getQuarks(Attributes.RESOURCES, Attributes.IRQS, "*"); //$NON-NLS-1$
-
- for (int irqQuark : irqQuarks) {
- if (fullState.get(irqQuark).getStateValue().unboxInt() == cpu) {
- ITmfStateInterval value = ss.querySingleState(event.getTime(), irqQuark);
- if (!value.getStateValue().isNull()) {
- int irq = Integer.parseInt(ss.getAttributeName(irqQuark));
- retMap.put(Messages.ResourcesView_attributeIrqName, String.valueOf(irq));
- }
- break;
- }
- }
- } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
- Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- } else if (status == StateValues.CPU_STATUS_SOFTIRQ) {
- // In SOFT_IRQ state get the SOFT_IRQ that caused the interruption
- int cpu = entry.getId();
-
- try {
- List<ITmfStateInterval> fullState = ss.queryFullState(event.getTime());
- List<Integer> softIrqQuarks = ss.getQuarks(Attributes.RESOURCES, Attributes.SOFT_IRQS, "*"); //$NON-NLS-1$
-
- for (int softIrqQuark : softIrqQuarks) {
- if (fullState.get(softIrqQuark).getStateValue().unboxInt() == cpu) {
- ITmfStateInterval value = ss.querySingleState(event.getTime(), softIrqQuark);
- if (!value.getStateValue().isNull()) {
- int softIrq = Integer.parseInt(ss.getAttributeName(softIrqQuark));
- retMap.put(Messages.ResourcesView_attributeSoftIrqName, String.valueOf(softIrq));
- }
- break;
- }
- }
- } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
- Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- } else if (status == StateValues.CPU_STATUS_RUN_USERMODE || status == StateValues.CPU_STATUS_RUN_SYSCALL) {
- // In running state get the current tid
-
- try {
- retMap.put(Messages.ResourcesView_attributeHoverTime, Utils.formatTime(hoverTime, TimeFormat.CALENDAR, Resolution.NANOSEC));
- int cpuQuark = entry.getQuark();
- int currentThreadQuark = ss.getQuarkRelative(cpuQuark, Attributes.CURRENT_THREAD);
- ITmfStateInterval interval = ss.querySingleState(hoverTime, currentThreadQuark);
- if (!interval.getStateValue().isNull()) {
- ITmfStateValue value = interval.getStateValue();
- int currentThreadId = value.unboxInt();
- retMap.put(Messages.ResourcesView_attributeTidName, Integer.toString(currentThreadId));
- int execNameQuark = ss.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThreadId), Attributes.EXEC_NAME);
- interval = ss.querySingleState(hoverTime, execNameQuark);
- if (!interval.getStateValue().isNull()) {
- value = interval.getStateValue();
- retMap.put(Messages.ResourcesView_attributeProcessName, value.unboxStr());
- }
- if (status == StateValues.CPU_STATUS_RUN_SYSCALL) {
- int syscallQuark = ss.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThreadId), Attributes.SYSTEM_CALL);
- interval = ss.querySingleState(hoverTime, syscallQuark);
- if (!interval.getStateValue().isNull()) {
- value = interval.getStateValue();
- retMap.put(Messages.ResourcesView_attributeSyscallName, value.unboxStr());
- }
- }
- }
- } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
- Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- }
- }
- }
- }
-
- return retMap;
- }
-
- @Override
- public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) {
- if (fColorGray == null) {
- fColorGray = gc.getDevice().getSystemColor(SWT.COLOR_GRAY);
- }
- if (fColorWhite == null) {
- fColorWhite = gc.getDevice().getSystemColor(SWT.COLOR_WHITE);
- }
- if (fAverageCharWidth == null) {
- fAverageCharWidth = gc.getFontMetrics().getAverageCharWidth();
- }
-
- ITmfTimeGraphDrawingHelper drawingHelper = getDrawingHelper();
- if (bounds.width <= fAverageCharWidth) {
- return;
- }
-
- if (!(event instanceof TimeEvent)) {
- return;
- }
- TimeEvent tcEvent = (TimeEvent) event;
- if (!tcEvent.hasValue()) {
- return;
- }
-
- ResourcesEntry entry = (ResourcesEntry) event.getEntry();
- if (!entry.getType().equals(Type.CPU)) {
- return;
- }
-
- int status = tcEvent.getValue();
- if (status != StateValues.CPU_STATUS_RUN_USERMODE && status != StateValues.CPU_STATUS_RUN_SYSCALL) {
- return;
- }
-
- ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysis.ID);
- if (ss == null) {
- return;
- }
- long time = event.getTime();
- try {
- while (time < event.getTime() + event.getDuration()) {
- int cpuQuark = entry.getQuark();
- int currentThreadQuark = ss.getQuarkRelative(cpuQuark, Attributes.CURRENT_THREAD);
- ITmfStateInterval tidInterval = ss.querySingleState(time, currentThreadQuark);
- long startTime = Math.max(tidInterval.getStartTime(), event.getTime());
- int x = Math.max(drawingHelper.getXForTime(startTime), bounds.x);
- if (x >= bounds.x + bounds.width) {
- break;
- }
- if (!tidInterval.getStateValue().isNull()) {
- ITmfStateValue value = tidInterval.getStateValue();
- int currentThreadId = value.unboxInt();
- long endTime = Math.min(tidInterval.getEndTime() + 1, event.getTime() + event.getDuration());
- int xForEndTime = drawingHelper.getXForTime(endTime);
- if (xForEndTime > bounds.x) {
- int width = Math.min(xForEndTime, bounds.x + bounds.width) - x - 1;
- if (width > 0) {
- String attribute = null;
- int beginIndex = 0;
- if (status == StateValues.CPU_STATUS_RUN_USERMODE && currentThreadId != fLastThreadId) {
- attribute = Attributes.EXEC_NAME;
- } else if (status == StateValues.CPU_STATUS_RUN_SYSCALL) {
- attribute = Attributes.SYSTEM_CALL;
- /*
- * Remove the "sys_" or "syscall_entry_" or similar from what we
- * draw in the rectangle. This depends on the trace's event layout.
- */
- ITmfTrace trace = entry.getTrace();
- if (trace instanceof LttngKernelTrace) {
- IKernelAnalysisEventLayout layout = ((LttngKernelTrace) trace).getEventLayout();
- beginIndex = layout.eventSyscallEntryPrefix().length();
- }
- }
- if (attribute != null) {
- int quark = ss.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThreadId), attribute);
- ITmfStateInterval interval = ss.querySingleState(time, quark);
- if (!interval.getStateValue().isNull()) {
- value = interval.getStateValue();
- gc.setForeground(fColorWhite);
- int drawn = Utils.drawText(gc, value.unboxStr().substring(beginIndex), x + 1, bounds.y - 2, width, true, true);
- if (drawn > 0) {
- fLastThreadId = currentThreadId;
- }
- }
- }
- if (xForEndTime < bounds.x + bounds.width) {
- gc.setForeground(fColorGray);
- gc.drawLine(xForEndTime, bounds.y + 1, xForEndTime, bounds.y + bounds.height - 2);
- }
- }
- }
- }
- // make sure next time is at least at the next pixel
- time = Math.max(tidInterval.getEndTime() + 1, drawingHelper.getTimeAtX(x + 1));
- }
- } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
- Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- }
-
- @Override
- public void postDrawEntry(ITimeGraphEntry entry, Rectangle bounds, GC gc) {
- fLastThreadId = -1;
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tasse - Initial API and implementation
- * Geneviève Bastien - Move code to provide base classes for time graph views
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Messages;
-import org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type;
-import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
-import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
-import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
-import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
-import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
-import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
-import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.NullTimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent;
-import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
-
-/**
- * Main implementation for the LTTng 2.0 kernel Resource view
- *
- * @author Patrick Tasse
- */
-public class ResourcesView extends AbstractTimeGraphView {
-
- /** View ID. */
- public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.views.resources"; //$NON-NLS-1$
-
- private static final String[] FILTER_COLUMN_NAMES = new String[] {
- Messages.ResourcesView_stateTypeName
- };
-
- // Timeout between updates in the build thread in ms
- private static final long BUILD_UPDATE_TIMEOUT = 500;
-
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
- /**
- * Default constructor
- */
- public ResourcesView() {
- super(ID, new ResourcesPresentationProvider());
- setFilterColumns(FILTER_COLUMN_NAMES);
- }
-
- // ------------------------------------------------------------------------
- // Internal
- // ------------------------------------------------------------------------
-
- @Override
- protected String getNextText() {
- return Messages.ResourcesView_nextResourceActionNameText;
- }
-
- @Override
- protected String getNextTooltip() {
- return Messages.ResourcesView_nextResourceActionToolTipText;
- }
-
- @Override
- protected String getPrevText() {
- return Messages.ResourcesView_previousResourceActionNameText;
- }
-
- @Override
- protected String getPrevTooltip() {
- return Messages.ResourcesView_previousResourceActionToolTipText;
- }
-
- @Override
- protected void buildEventList(ITmfTrace trace, ITmfTrace parentTrace, IProgressMonitor monitor) {
- ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysis.ID);
- if (ssq == null) {
- return;
- }
- Comparator<ITimeGraphEntry> comparator = new Comparator<ITimeGraphEntry>() {
- @Override
- public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) {
- return ((ResourcesEntry) o1).compareTo(o2);
- }
- };
-
- Map<Integer, ResourcesEntry> entryMap = new HashMap<>();
- TimeGraphEntry traceEntry = null;
-
- long startTime = ssq.getStartTime();
- long start = startTime;
- setStartTime(Math.min(getStartTime(), startTime));
- boolean complete = false;
- while (!complete) {
- if (monitor.isCanceled()) {
- return;
- }
- complete = ssq.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
- if (ssq.isCancelled()) {
- return;
- }
- long end = ssq.getCurrentEndTime();
- if (start == end && !complete) { // when complete execute one last time regardless of end time
- continue;
- }
- long endTime = end + 1;
- setEndTime(Math.max(getEndTime(), endTime));
-
- if (traceEntry == null) {
- traceEntry = new ResourcesEntry(trace, trace.getName(), startTime, endTime, 0);
- traceEntry.sortChildren(comparator);
- List<TimeGraphEntry> entryList = Collections.singletonList(traceEntry);
- addToEntryList(parentTrace, entryList);
- } else {
- traceEntry.updateEndTime(endTime);
- }
-
- List<Integer> cpuQuarks = ssq.getQuarks(Attributes.CPUS, "*"); //$NON-NLS-1$
- for (Integer cpuQuark : cpuQuarks) {
- int cpu = Integer.parseInt(ssq.getAttributeName(cpuQuark));
- ResourcesEntry entry = entryMap.get(cpuQuark);
- if (entry == null) {
- entry = new ResourcesEntry(cpuQuark, trace, startTime, endTime, Type.CPU, cpu);
- entryMap.put(cpuQuark, entry);
- traceEntry.addChild(entry);
- } else {
- entry.updateEndTime(endTime);
- }
- }
- List<Integer> irqQuarks = ssq.getQuarks(Attributes.RESOURCES, Attributes.IRQS, "*"); //$NON-NLS-1$
- for (Integer irqQuark : irqQuarks) {
- int irq = Integer.parseInt(ssq.getAttributeName(irqQuark));
- ResourcesEntry entry = entryMap.get(irqQuark);
- if (entry == null) {
- entry = new ResourcesEntry(irqQuark, trace, startTime, endTime, Type.IRQ, irq);
- entryMap.put(irqQuark, entry);
- traceEntry.addChild(entry);
- } else {
- entry.updateEndTime(endTime);
- }
- }
- List<Integer> softIrqQuarks = ssq.getQuarks(Attributes.RESOURCES, Attributes.SOFT_IRQS, "*"); //$NON-NLS-1$
- for (Integer softIrqQuark : softIrqQuarks) {
- int softIrq = Integer.parseInt(ssq.getAttributeName(softIrqQuark));
- ResourcesEntry entry = entryMap.get(softIrqQuark);
- if (entry == null) {
- entry = new ResourcesEntry(softIrqQuark, trace, startTime, endTime, Type.SOFT_IRQ, softIrq);
- entryMap.put(softIrqQuark, entry);
- traceEntry.addChild(entry);
- } else {
- entry.updateEndTime(endTime);
- }
- }
-
- if (parentTrace.equals(getTrace())) {
- refresh();
- }
- long resolution = Math.max(1, (endTime - ssq.getStartTime()) / getDisplayWidth());
- for (ITimeGraphEntry child : traceEntry.getChildren()) {
- if (monitor.isCanceled()) {
- return;
- }
- if (child instanceof TimeGraphEntry) {
- TimeGraphEntry entry = (TimeGraphEntry) child;
- List<ITimeEvent> eventList = getEventList(entry, start, endTime, resolution, monitor);
- if (eventList != null) {
- for (ITimeEvent event : eventList) {
- entry.addEvent(event);
- }
- }
- redraw();
- }
- }
-
- start = end;
- }
- }
-
- @Override
- protected @Nullable List<ITimeEvent> getEventList(TimeGraphEntry entry,
- long startTime, long endTime, long resolution,
- IProgressMonitor monitor) {
- ResourcesEntry resourcesEntry = (ResourcesEntry) entry;
- ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(resourcesEntry.getTrace(), LttngKernelAnalysis.ID);
- if (ssq == null) {
- return null;
- }
- final long realStart = Math.max(startTime, ssq.getStartTime());
- final long realEnd = Math.min(endTime, ssq.getCurrentEndTime() + 1);
- if (realEnd <= realStart) {
- return null;
- }
- List<ITimeEvent> eventList = null;
- int quark = resourcesEntry.getQuark();
-
- try {
- if (resourcesEntry.getType().equals(Type.CPU)) {
- int statusQuark;
- try {
- statusQuark = ssq.getQuarkRelative(quark, Attributes.STATUS);
- } catch (AttributeNotFoundException e) {
- /*
- * The sub-attribute "status" is not available. May happen
- * if the trace does not have sched_switch events enabled.
- */
- return null;
- }
- List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ssq, statusQuark, realStart, realEnd - 1, resolution, monitor);
- eventList = new ArrayList<>(statusIntervals.size());
- long lastEndTime = -1;
- for (ITmfStateInterval statusInterval : statusIntervals) {
- if (monitor.isCanceled()) {
- return null;
- }
- int status = statusInterval.getStateValue().unboxInt();
- long time = statusInterval.getStartTime();
- long duration = statusInterval.getEndTime() - time + 1;
- if (!statusInterval.getStateValue().isNull()) {
- if (lastEndTime != time && lastEndTime != -1) {
- eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
- }
- eventList.add(new TimeEvent(entry, time, duration, status));
- } else if (lastEndTime == -1 || time + duration >= endTime) {
- // add null event if it intersects the start or end time
- eventList.add(new NullTimeEvent(entry, time, duration));
- }
- lastEndTime = time + duration;
- }
- } else if (resourcesEntry.getType().equals(Type.IRQ)) {
- List<ITmfStateInterval> irqIntervals = StateSystemUtils.queryHistoryRange(ssq, quark, realStart, realEnd - 1, resolution, monitor);
- eventList = new ArrayList<>(irqIntervals.size());
- long lastEndTime = -1;
- boolean lastIsNull = true;
- for (ITmfStateInterval irqInterval : irqIntervals) {
- if (monitor.isCanceled()) {
- return null;
- }
- long time = irqInterval.getStartTime();
- long duration = irqInterval.getEndTime() - time + 1;
- if (!irqInterval.getStateValue().isNull()) {
- int cpu = irqInterval.getStateValue().unboxInt();
- eventList.add(new TimeEvent(entry, time, duration, cpu));
- lastIsNull = false;
- } else {
- if (lastEndTime == -1) {
- // add null event if it intersects the start time
- eventList.add(new NullTimeEvent(entry, time, duration));
- } else {
- if (lastEndTime != time && lastIsNull) {
- /* This is a special case where we want to show IRQ_ACTIVE state but we don't know the CPU (it is between two null samples) */
- eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime, -1));
- }
- if (time + duration >= endTime) {
- // add null event if it intersects the end time
- eventList.add(new NullTimeEvent(entry, time, duration));
- }
- }
- lastIsNull = true;
- }
- lastEndTime = time + duration;
- }
- } else if (resourcesEntry.getType().equals(Type.SOFT_IRQ)) {
- List<ITmfStateInterval> softIrqIntervals = StateSystemUtils.queryHistoryRange(ssq, quark, realStart, realEnd - 1, resolution, monitor);
- eventList = new ArrayList<>(softIrqIntervals.size());
- long lastEndTime = -1;
- boolean lastIsNull = true;
- for (ITmfStateInterval softIrqInterval : softIrqIntervals) {
- if (monitor.isCanceled()) {
- return null;
- }
- long time = softIrqInterval.getStartTime();
- long duration = softIrqInterval.getEndTime() - time + 1;
- if (!softIrqInterval.getStateValue().isNull()) {
- int cpu = softIrqInterval.getStateValue().unboxInt();
- eventList.add(new TimeEvent(entry, time, duration, cpu));
- } else {
- if (lastEndTime == -1) {
- // add null event if it intersects the start time
- eventList.add(new NullTimeEvent(entry, time, duration));
- } else {
- if (lastEndTime != time && lastIsNull) {
- /* This is a special case where we want to show IRQ_ACTIVE state but we don't know the CPU (it is between two null samples) */
- eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime, -1));
- }
- if (time + duration >= endTime) {
- // add null event if it intersects the end time
- eventList.add(new NullTimeEvent(entry, time, duration));
- }
- }
- lastIsNull = true;
- }
- lastEndTime = time + duration;
- }
- }
-
- } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
- e.printStackTrace();
- } catch (StateSystemDisposedException e) {
- /* Ignored */
- }
- return eventList;
- }
-
-}
<import plugin="org.eclipse.help"/>
</requires>
+ <plugin
+ id="org.eclipse.tracecompass.analysis.os.linux.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.tracecompass.analysis.os.linux.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
<plugin
id="org.eclipse.tracecompass.lttng2.kernel.core"
download-size="0"
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.tracecompass.analysis.os.linux.core.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
<plugin
id="org.eclipse.tracecompass.lttng2.control.core.tests"
download-size="0"
<module>org.eclipse.tracecompass.target</module>
<module>org.eclipse.tracecompass.testing</module>
+ <module>org.eclipse.tracecompass.analysis.os.linux.core</module>
+ <module>org.eclipse.tracecompass.analysis.os.linux.core.tests</module>
+ <module>org.eclipse.tracecompass.analysis.os.linux.ui</module>
+
<module>org.eclipse.tracecompass.lttng2.control</module>
<module>org.eclipse.tracecompass.lttng2.control.core</module>
<module>org.eclipse.tracecompass.lttng2.control.core.tests</module>