From: Alexandre Montplaisir Date: Tue, 23 Sep 2014 20:59:53 +0000 (-0400) Subject: lttng: Move plugins to the Trace Compass namespace X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=86703386c780da0b1fbf74f18f682d72f7aae8dd;p=deliverable%2Ftracecompass.git lttng: Move plugins to the Trace Compass namespace Change-Id: Iba52d6b728b235e76f1ce1fc0eb9a96c2205c702 Signed-off-by: Alexandre Montplaisir --- diff --git a/org.eclipse.linuxtools.lttng.alltests/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng.alltests/META-INF/MANIFEST.MF index 87c65be00b..2eff8fdb01 100644 --- a/org.eclipse.linuxtools.lttng.alltests/META-INF/MANIFEST.MF +++ b/org.eclipse.linuxtools.lttng.alltests/META-INF/MANIFEST.MF @@ -13,13 +13,13 @@ Require-Bundle: org.junit;bundle-version="4.0.0", org.eclipse.tracecompass.ctf.core.tests;bundle-version="2.1.0", org.eclipse.tracecompass.gdbtrace.core.tests;bundle-version="1.1.0", org.eclipse.tracecompass.gdbtrace.ui.tests;bundle-version="1.1.0", - org.eclipse.linuxtools.lttng2.control.core.tests;bundle-version="2.1.0", - org.eclipse.linuxtools.lttng2.control.ui.tests;bundle-version="2.1.0", - org.eclipse.linuxtools.lttng2.kernel.core.tests;bundle-version="2.1.0", - org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests;bundle-version="3.1.0", - org.eclipse.linuxtools.lttng2.kernel.ui.tests;bundle-version="2.1.0", - org.eclipse.linuxtools.lttng2.ust.core.tests;bundle-version="2.1.0", - org.eclipse.linuxtools.lttng2.ust.ui.tests;bundle-version="2.1.0", + org.eclipse.tracecompass.lttng2.control.core.tests;bundle-version="2.1.0", + org.eclipse.tracecompass.lttng2.control.ui.tests;bundle-version="2.1.0", + org.eclipse.tracecompass.lttng2.kernel.core.tests;bundle-version="2.1.0", + org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests;bundle-version="3.1.0", + org.eclipse.tracecompass.lttng2.kernel.ui.tests;bundle-version="2.1.0", + org.eclipse.tracecompass.lttng2.ust.core.tests;bundle-version="2.1.0", + org.eclipse.tracecompass.lttng2.ust.ui.tests;bundle-version="2.1.0", org.eclipse.linuxtools.statesystem.core.tests;bundle-version="3.1.0", org.eclipse.linuxtools.tmf.core.tests;bundle-version="2.1.0", org.eclipse.linuxtools.tmf.ctf.core.tests;bundle-version="3.1.0", diff --git a/org.eclipse.linuxtools.lttng.testing/feature.xml b/org.eclipse.linuxtools.lttng.testing/feature.xml index 4d27af6ba7..97586da8bb 100644 --- a/org.eclipse.linuxtools.lttng.testing/feature.xml +++ b/org.eclipse.linuxtools.lttng.testing/feature.xml @@ -52,49 +52,49 @@ unpack="false"/> - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/.project b/org.eclipse.linuxtools.lttng2.control.core.tests/.project deleted file mode 100644 index 9aaf321441..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.control.core.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f3fc64575b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,393 +0,0 @@ -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=enabled -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 diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 62cfa90dee..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.control.core.tests/META-INF/MANIFEST.MF deleted file mode 100644 index fe1e11c770..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.control.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.linuxtools.lttng2.control.core;bundle-version="3.1.0" -Export-Package: org.eclipse.linuxtools.lttng2.control.core.tests;x-friends:="org.eclipse.linuxtools.lttng.alltests", - org.eclipse.linuxtools.lttng2.control.core.tests.model.impl;x-internal:=true, - org.eclipse.linuxtools.lttng2.control.core.tests.relayd, - org.eclipse.linuxtools.lttng2.control.core.tests.session diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/about.html b/org.eclipse.linuxtools.lttng2.control.core.tests/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/build.properties b/org.eclipse.linuxtools.lttng2.control.core.tests/build.properties deleted file mode 100644 index f7a0b9854e..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/build.properties +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties -src.includes = about.html diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/plugin.properties b/org.eclipse.linuxtools.lttng2.control.core.tests/plugin.properties deleted file mode 100644 index f2ad963160..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/plugin.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.control.core.tests -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Control Core Tests Plug-in diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/pom.xml b/org.eclipse.linuxtools.lttng2.control.core.tests/pom.xml deleted file mode 100644 index a521311e32..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.control.core.tests - 3.1.0-SNAPSHOT - eclipse-test-plugin - - Linux Tools LTTng Control Core Tests Plug-in - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - org.eclipse.linuxtools.lttng2.control.core.tests - org.eclipse.linuxtools.lttng2.control.core.tests.AllTests - false - false - org.eclipse.platform.ide - - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/ActivatorTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/ActivatorTest.java deleted file mode 100644 index c0239d81af..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/ActivatorTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * 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 - * Alexandre Montplaisir - Port to JUnit4 - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -/** - * Test stubs for the Activator. - */ -public class ActivatorTest { - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.core.Activator#Activator()}. - */ - @Test - public void testActivator() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.core.Activator#getDefault()}. - */ - @Test - public void testGetDefault() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.core.Activator#start(org.osgi.framework.BundleContext)}. - */ - @Test - public void testStartBundleContext() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.core.Activator#stop(org.osgi.framework.BundleContext)}. - */ - @Test - public void testStopBundleContext() { - assertTrue(true); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/AllTests.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/AllTests.java deleted file mode 100644 index cd640621f3..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/AllTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * 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 - * Alexandre Montplaisir - Port to JUnit4 - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Run all the tests in the test suite - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - ActivatorTest.class, - org.eclipse.linuxtools.lttng2.control.core.tests.model.impl.AllTests.class, - org.eclipse.linuxtools.lttng2.control.core.tests.session.AllTests.class, - org.eclipse.linuxtools.lttng2.control.core.tests.model.impl.AllTests.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/AllTests.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/AllTests.java deleted file mode 100644 index 76f4d33447..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/AllTests.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Runner for the test suite - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - BaseEventInfoTest.class, - ChannelInfoTest.class, - DomainInfoTest.class, - EventInfoTest.class, - FieldInfoTest.class, - ProbeEventInfoTest.class, - SessionInfoTest.class, - TraceInfoTest.class, - UstProviderInfoTest.class, - SnapshotInfoTest.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/BaseEventInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/BaseEventInfoTest.java deleted file mode 100644 index 871d2970cb..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/BaseEventInfoTest.java +++ /dev/null @@ -1,567 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.*; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class BaseEventInfoTest contains test for the class - * {@link BaseEventInfo}. - */ -public class BaseEventInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private IBaseEventInfo fEventInfo1 = null; - private IBaseEventInfo fEventInfo2 = null; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - ModelImplFactory factory = new ModelImplFactory(); - fEventInfo1 = factory.getBaseEventInfo1(); - fEventInfo2 = factory.getBaseEventInfo2(); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Run the BaseEventInfo() constructor test. - */ - @Test - public void testBaseEventInfo() { - BaseEventInfo fixture = new BaseEventInfo("event"); - assertNotNull(fixture); - - TraceEventType result = fixture.getEventType(); - - assertEquals("event", fixture.getName()); - assertEquals("unknown", result.getInName()); - assertEquals("UNKNOWN", result.name()); - assertEquals("UNKNOWN", result.toString()); - assertEquals(4, result.ordinal()); - - TraceLogLevel level = fixture.getLogLevel(); - assertEquals("TRACE_DEBUG", level.getInName()); - assertEquals("TRACE_DEBUG", level.name()); - assertEquals("TRACE_DEBUG", level.toString()); - assertEquals(14, level.ordinal()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testEventInfoCopy() { - BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo1); - - assertEquals(fEventInfo1.getName(), info.getName()); - assertEquals(fEventInfo1.getEventType(), info.getEventType()); - assertEquals(fEventInfo1.getLogLevel(), info.getLogLevel()); - assertEquals(fEventInfo1.getFilterExpression(), info.getFilterExpression()); - - IFieldInfo[] orignalFields = fEventInfo1.getFields(); - IFieldInfo[] copiedFields = info.getFields(); - assertEquals(orignalFields.length, copiedFields.length); - - for (int i = 0; i < copiedFields.length; i++) { - assertEquals(orignalFields[i], copiedFields[i]); - } - } - - /** - * Test Copy Constructor - */ - @Test - public void testEventCopy2() { - try { - BaseEventInfo info = null; - new BaseEventInfo(info); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Run the TraceEventType getEventType() method test. - */ - @Test - public void testGetEventType_1() { - BaseEventInfo fixture = new BaseEventInfo("event"); - fixture.setEventType("unknown"); - - TraceEventType result = fixture.getEventType(); - - assertNotNull(result); - assertEquals("unknown", result.getInName()); - assertEquals("UNKNOWN", result.name()); - assertEquals("UNKNOWN", result.toString()); - assertEquals(4, result.ordinal()); - - fixture.setEventType(""); - result = fixture.getEventType(); - assertEquals("unknown", result.getInName()); - assertEquals("UNKNOWN", result.name()); - assertEquals("UNKNOWN", result.toString()); - assertEquals(4, result.ordinal()); - - fixture.setEventType("tracepoint"); - result = fixture.getEventType(); - assertNotNull(result); - assertEquals("tracepoint", result.getInName()); - assertEquals("TRACEPOINT", result.name()); - assertEquals("TRACEPOINT", result.toString()); - assertEquals(0, result.ordinal()); - - fixture.setEventType("syscall"); - result = fixture.getEventType(); - assertNotNull(result); - assertEquals("syscall", result.getInName()); - assertEquals("SYSCALL", result.name()); - assertEquals("SYSCALL", result.toString()); - assertEquals(1, result.ordinal()); - - fixture.setEventType("probe"); - result = fixture.getEventType(); - assertNotNull(result); - assertEquals("probe", result.getInName()); - assertEquals("PROBE", result.name()); - assertEquals("PROBE", result.toString()); - assertEquals(2, result.ordinal()); - - fixture.setEventType("function"); - result = fixture.getEventType(); - assertNotNull(result); - assertEquals("function", result.getInName()); - assertEquals("FUNCTION", result.name()); - assertEquals("FUNCTION", result.toString()); - assertEquals(3, result.ordinal()); - - - } - - /** - * Run the void setEventType(TraceEventType) method test. - */ - @Test - public void testSetEventType_2() { - BaseEventInfo fixture = new BaseEventInfo("event"); - fixture.setEventType(TraceEventType.TRACEPOINT); - - TraceEventType result = fixture.getEventType(); - - assertNotNull(result); - assertEquals("tracepoint", result.getInName()); - assertEquals("TRACEPOINT", result.name()); - assertEquals("TRACEPOINT", result.toString()); - assertEquals(0, result.ordinal()); - - fixture.setEventType(TraceEventType.UNKNOWN); - result = fixture.getEventType(); - - assertNotNull(result); - assertEquals("unknown", result.getInName()); - assertEquals("UNKNOWN", result.name()); - assertEquals("UNKNOWN", result.toString()); - assertEquals(4, result.ordinal()); - - fixture.setEventType(TraceEventType.SYSCALL); - result = fixture.getEventType(); - assertNotNull(result); - assertEquals("syscall", result.getInName()); - assertEquals("SYSCALL", result.name()); - assertEquals("SYSCALL", result.toString()); - assertEquals(1, result.ordinal()); - - fixture.setEventType(TraceEventType.PROBE); - result = fixture.getEventType(); - assertNotNull(result); - assertEquals("probe", result.getInName()); - assertEquals("PROBE", result.name()); - assertEquals("PROBE", result.toString()); - assertEquals(2, result.ordinal()); - - fixture.setEventType(TraceEventType.FUNCTION); - result = fixture.getEventType(); - assertNotNull(result); - assertEquals("function", result.getInName()); - assertEquals("FUNCTION", result.name()); - assertEquals("FUNCTION", result.toString()); - assertEquals(3, result.ordinal()); - - - } - - /** - * Run the void setLogLevel(TraceLogLevel) method test. - * Run the TraceLogLevel getLogLevel() method test - */ - @Test - public void testSetLogLevel1() { - BaseEventInfo fixture = new BaseEventInfo("event"); - fixture.setEventType(TraceEventType.TRACEPOINT); - fixture.setLogLevel(TraceLogLevel.TRACE_CRIT); - - // 2 set/get-operations are enough to test the method - TraceLogLevel result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_CRIT", result.getInName()); - assertEquals("TRACE_CRIT", result.name()); - assertEquals("TRACE_CRIT", result.toString()); - assertEquals(2, result.ordinal()); - - fixture.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_DEBUG_FUNCTION", result.getInName()); - assertEquals("TRACE_DEBUG_FUNCTION", result.name()); - assertEquals("TRACE_DEBUG_FUNCTION", result.toString()); - assertEquals(12, result.ordinal()); - } - - /** - * Run the void setLogLevel(String) method test. - * Run the TraceLogLevel getLogLevel() method test - */ - @Test - public void testSetLogLevel2() { - BaseEventInfo fixture = new BaseEventInfo("event"); - fixture.setEventType(TraceEventType.TRACEPOINT); - fixture.setLogLevel("TRACE_EMERG"); - - TraceLogLevel result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_EMERG", result.getInName()); - assertEquals("TRACE_EMERG", result.name()); - assertEquals(0, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_ALERT"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_ALERT", result.getInName()); - assertEquals("TRACE_ALERT", result.name()); - assertEquals(1, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_CRIT"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_CRIT", result.getInName()); - assertEquals("TRACE_CRIT", result.name()); - assertEquals(2, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_ERR"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_ERR", result.getInName()); - assertEquals("TRACE_ERR", result.name()); - assertEquals(3, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_WARNING"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_WARNING", result.getInName()); - assertEquals("TRACE_WARNING", result.name()); - assertEquals(4, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_NOTICE"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_NOTICE", result.getInName()); - assertEquals("TRACE_NOTICE", result.name()); - assertEquals(5, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_INFO"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_INFO", result.getInName()); - assertEquals("TRACE_INFO", result.name()); - assertEquals(6, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_DEBUG_SYSTEM"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_DEBUG_SYSTEM", result.getInName()); - assertEquals("TRACE_DEBUG_SYSTEM", result.name()); - assertEquals(7, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_DEBUG_PROGRAM"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_DEBUG_PROGRAM", result.getInName()); - assertEquals("TRACE_DEBUG_PROGRAM", result.name()); - assertEquals(8, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_DEBUG_PROCESS"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_DEBUG_PROCESS", result.getInName()); - assertEquals("TRACE_DEBUG_PROCESS", result.name()); - assertEquals(9, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_DEBUG_MODULE"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_DEBUG_MODULE", result.getInName()); - assertEquals("TRACE_DEBUG_MODULE", result.name()); - assertEquals(10, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_DEBUG_UNIT"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_DEBUG_UNIT", result.getInName()); - assertEquals("TRACE_DEBUG_UNIT", result.name()); - assertEquals(11, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_DEBUG_FUNCTION"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_DEBUG_FUNCTION", result.getInName()); - assertEquals("TRACE_DEBUG_FUNCTION", result.name()); - assertEquals(12, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_DEBUG_LINE"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_DEBUG_LINE", result.getInName()); - assertEquals("TRACE_DEBUG_LINE", result.name()); - assertEquals(13, result.ordinal()); - - //------------------------ - fixture.setLogLevel("TRACE_DEBUG"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("TRACE_DEBUG", result.getInName()); - assertEquals("TRACE_DEBUG", result.name()); - assertEquals(14, result.ordinal()); - - //------------------------- - fixture.setLogLevel("LEVEL_UNKNOWN"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("LEVEL_UNKNOWN", result.getInName()); - assertEquals("LEVEL_UNKNOWN", result.name()); - assertEquals(15, result.ordinal()); - - fixture.setLogLevel("garbage"); - - result = fixture.getLogLevel(); - assertNotNull(result); - assertEquals("LEVEL_UNKNOWN", result.getInName()); - assertEquals("LEVEL_UNKNOWN", result.name()); - assertEquals(15, result.ordinal()); - } - - /** - * test filter expression - */ - @Test - public void testSetFields() { - BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo2); - info.setFilterExpression("stringfield==test"); - assertEquals("stringfield==test", info.getFilterExpression()); - } - - - /** - * test add field - */ - @Test - public void testAddField() { - BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo2); - - IFieldInfo field = new FieldInfo("intfield"); - field.setFieldType("int"); - - info.addField(field); - - // Verify the stored events - IFieldInfo[] result = info.getFields(); - - assertNotNull(result); - assertEquals(1, result.length); - assertNotNull(result[0]); - assertTrue(field.equals(result[0])); - } - - /** - * test set fields - */ - @Test - public void testFields() { - BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo2); - - IFieldInfo field1 = new FieldInfo("intfield"); - field1.setFieldType("int"); - - IFieldInfo field2 = new FieldInfo("stringfield"); - field2.setFieldType("string"); - - List fields = new LinkedList<>(); - fields.add(field1); - fields.add(field2); - info.setFields(fields); - - // Verify the stored events - IFieldInfo[] result = info.getFields(); - - assertNotNull(result); - assertEquals(2, result.length); - - for (int i = 0; i < result.length; i++) { - assertNotNull(result[i]); - assertTrue(fields.get(i).equals(result[i])); - } - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_1() { - BaseEventInfo fixture = new BaseEventInfo("event"); - fixture.setName("testName"); - fixture.setEventType(TraceEventType.TRACEPOINT); - fixture.setLogLevel(TraceLogLevel.TRACE_ERR); - - String result = fixture.toString(); - - // add additional test code here - assertEquals("[BaseEventInfo([TraceInfo(Name=testName)],type=TRACEPOINT,level=TRACE_ERR)]", result); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Test the .equals() method. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fEventInfo1.equals(fEventInfo1)); - assertTrue("equals", fEventInfo2.equals(fEventInfo2)); - - assertTrue("equals", !fEventInfo1.equals(fEventInfo2)); - assertTrue("equals", !fEventInfo2.equals(fEventInfo1)); - } - - /** - * Test the .equals() method. - */ - @Test - public void testEqualsSymmetry() { - BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1); - BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo2); - - assertTrue("equals", info1.equals(fEventInfo1)); - assertTrue("equals", fEventInfo1.equals(info1)); - - assertTrue("equals", info2.equals(fEventInfo2)); - assertTrue("equals", fEventInfo2.equals(info2)); - } - - /** - * Test the .equals() method. - */ - @Test - public void testEqualsTransivity() { - BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1); - BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo1); - BaseEventInfo info3 = new BaseEventInfo((BaseEventInfo)fEventInfo1); - - assertTrue("equals", info1.equals(info2)); - assertTrue("equals", info2.equals(info3)); - assertTrue("equals", info1.equals(info3)); - } - - /** - * Test the .equals() method. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fEventInfo1.equals(null)); - assertTrue("equals", !fEventInfo2.equals(null)); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Test the hashCode() method. - */ - @Test - public void testHashCode() { - BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1); - BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo2); - - assertTrue("hashCode", fEventInfo1.hashCode() == info1.hashCode()); - assertTrue("hashCode", fEventInfo2.hashCode() == info2.hashCode()); - - assertTrue("hashCode", fEventInfo1.hashCode() != info2.hashCode()); - assertTrue("hashCode", fEventInfo2.hashCode() != info1.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ChannelInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ChannelInfoTest.java deleted file mode 100644 index 44a078e012..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ChannelInfoTest.java +++ /dev/null @@ -1,382 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.*; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class ChannelInfoTest contains tests for the class - * {@link ChannelInfo}. - */ -public class ChannelInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private IChannelInfo fChannelInfo1 = null; - private IChannelInfo fChannelInfo2 = null; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - ModelImplFactory factory = new ModelImplFactory(); - fChannelInfo1 = factory.getChannel1(); - fChannelInfo2 = factory.getChannel2(); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Run the ChannelInfo() constructor test. - */ - @Test - public void testChannelInfo() { - ChannelInfo result = new ChannelInfo("test"); - assertNotNull(result); - - assertEquals("test", result.getName()); - assertEquals(0, result.getNumberOfSubBuffers()); - assertEquals("unknown", result.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.UNKNOWN, result.getOutputType()); - assertEquals(false, result.isOverwriteMode()); - assertEquals(0, result.getReadTimer()); - assertEquals("disabled", result.getState().getInName()); - assertEquals(0, result.getSubBufferSize()); - assertEquals(0, result.getSwitchTimer()); - assertEquals(0, result.getMaxSizeTraceFiles()); - assertEquals(0, result.getMaxNumberTraceFiles()); - assertEquals(BufferType.BUFFER_TYPE_UNKNOWN, result.getBufferType()); - } - - /** - * Test copy constructor. - */ - @Test - public void testChannelInfoCopy() { - ChannelInfo channelInfo = new ChannelInfo((ChannelInfo)fChannelInfo1); - - assertEquals(fChannelInfo1.getName(), channelInfo.getName()); - assertEquals(fChannelInfo1.getNumberOfSubBuffers(), channelInfo.getNumberOfSubBuffers()); - assertEquals(fChannelInfo1.getOutputType(), channelInfo.getOutputType()); - assertEquals(fChannelInfo1.isOverwriteMode(), channelInfo.isOverwriteMode()); - assertEquals(fChannelInfo1.getReadTimer(), channelInfo.getReadTimer()); - assertEquals(fChannelInfo1.getState(), channelInfo.getState()); - assertEquals(fChannelInfo1.getSwitchTimer(), channelInfo.getSwitchTimer()); - assertEquals(fChannelInfo1.getEvents().length, channelInfo.getEvents().length); - assertEquals(fChannelInfo1.getMaxSizeTraceFiles(), channelInfo.getMaxSizeTraceFiles()); - assertEquals(fChannelInfo1.getMaxNumberTraceFiles(), channelInfo.getMaxNumberTraceFiles()); - assertEquals(fChannelInfo1.getBufferType(), channelInfo.getBufferType()); - - IEventInfo[] orignalEvents = fChannelInfo1.getEvents(); - IEventInfo[] resultEvents = channelInfo.getEvents(); - for (int i = 0; i < orignalEvents.length; i++) { - assertEquals(orignalEvents[i], resultEvents[i]); - } - } - - /** - * Test copy constructor with a null value. - */ - @Test - public void testChannelCopy2() { - try { - ChannelInfo channel = null; - new ChannelInfo(channel); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Run the IEventInfo[] getEvents() method test. - */ - @Test - public void testAddAndGetEvents_1() { - ChannelInfo fixture = new ChannelInfo("test"); - fixture.setSwitchTimer(1L); - fixture.setOverwriteMode(true); - fixture.setReadTimer(1L); - fixture.setState(TraceEnablement.DISABLED); - fixture.setNumberOfSubBuffers(1); - fixture.setOutputType(""); - fixture.setSubBufferSize(1L); - - // add an event - IEventInfo event = new EventInfo("event"); - fixture.addEvent(event); - - // Verify the stored events - IEventInfo[] result = fixture.getEvents(); - - assertNotNull(result); - assertEquals(1, result.length); - assertNotNull(result[0]); - assertTrue(event.equals(result[0])); - } - - /** - * Run the long getNumberOfSubBuffers() method test. - */ - @Test - public void testGetAndSetters() { - ChannelInfo fixture = new ChannelInfo("test"); - fixture.setSwitchTimer(2L); - fixture.setOverwriteMode(true); - fixture.setReadTimer(3L); - fixture.setState(TraceEnablement.DISABLED); - fixture.setNumberOfSubBuffers(4); - fixture.setOutputType("splice()"); - fixture.setSubBufferSize(1L); - fixture.setMaxSizeTraceFiles(1024); - fixture.setMaxNumberTraceFiles(20); - fixture.setBufferType(BufferType.BUFFER_PER_UID); - fixture.addEvent(new EventInfo("event")); - - long switchTimer = fixture.getSwitchTimer(); - assertEquals(2L, switchTimer); - - boolean mode = fixture.isOverwriteMode(); - assertTrue(mode); - - long readTimer = fixture.getReadTimer(); - assertEquals(3L, readTimer); - - TraceEnablement state = fixture.getState(); - assertEquals("disabled", state.getInName()); - - long numSubBuffers = fixture.getNumberOfSubBuffers(); - assertEquals(4, numSubBuffers); - - String outputType = fixture.getOutputType().getInName(); - assertEquals("splice()", outputType); - - long subBufferSize = fixture.getSubBufferSize(); - assertEquals(1L, subBufferSize); - - int maxSizeTraceFiles = fixture.getMaxSizeTraceFiles(); - assertEquals(1024, maxSizeTraceFiles); - - int maxNumberTraceFiles = fixture.getMaxNumberTraceFiles(); - assertEquals(20, maxNumberTraceFiles); - - BufferType bufferType = fixture.getBufferType(); - assertTrue(bufferType == BufferType.BUFFER_PER_UID); - - fixture.setSwitchTimer(5L); - fixture.setOverwriteMode(false); - fixture.setReadTimer(6L); - fixture.setState(TraceEnablement.ENABLED); - fixture.setNumberOfSubBuffers(7); - fixture.setOutputType("mmap()"); - fixture.setSubBufferSize(8L); - fixture.setMaxSizeTraceFiles(4096); - fixture.setMaxNumberTraceFiles(10); - fixture.setBufferType(BufferType.BUFFER_PER_PID); - - switchTimer = fixture.getSwitchTimer(); - assertEquals(5L, switchTimer); - - mode = fixture.isOverwriteMode(); - assertFalse(mode); - - readTimer = fixture.getReadTimer(); - assertEquals(6L, readTimer); - - state = fixture.getState(); - assertEquals("enabled", state.getInName()); - - numSubBuffers = fixture.getNumberOfSubBuffers(); - assertEquals(7, numSubBuffers); - - outputType = fixture.getOutputType().getInName(); - assertEquals("mmap()", outputType); - - subBufferSize = fixture.getSubBufferSize(); - assertEquals(8L, subBufferSize); - - maxSizeTraceFiles = fixture.getMaxSizeTraceFiles(); - assertEquals(4096, maxSizeTraceFiles); - - maxNumberTraceFiles = fixture.getMaxNumberTraceFiles(); - assertEquals(10, maxNumberTraceFiles); - - bufferType = fixture.getBufferType(); - assertTrue(bufferType == BufferType.BUFFER_PER_PID); - } - - /** - * Run the void setEvents(List) method test. - */ - @Test - public void testSetEvents_1() { - ChannelInfo fixture = new ChannelInfo("test"); - fixture.setSwitchTimer(1L); - fixture.setOverwriteMode(true); - fixture.setReadTimer(1L); - fixture.setState(TraceEnablement.DISABLED); - fixture.setNumberOfSubBuffers(1); - fixture.setOutputType(""); - fixture.setSubBufferSize(1L); - List events = new LinkedList<>(); - - for (int i = 0; i < 2; i++) { - IEventInfo info = new EventInfo("event" + i); - info.setEventType("tracepoint"); - info.setState((i % 2 == 0 ? "enabled" : "disabled")); - events.add(info); - } - - fixture.setEvents(events); - - IEventInfo[] infos = fixture.getEvents(); - - assertEquals(events.size(), infos.length); - - for (int i = 0; i < infos.length; i++) { - assertEquals(events.get(i), infos[i]); - } - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_1() { - ChannelInfo fixture = new ChannelInfo("channel"); - fixture.setSwitchTimer(1L); - fixture.setOverwriteMode(true); - fixture.setReadTimer(1L); - fixture.setState(TraceEnablement.DISABLED); - fixture.setNumberOfSubBuffers(1); - fixture.setOutputType("splice()"); - fixture.setSubBufferSize(1L); - - String result = fixture.toString(); - - // add additional test code here - assertEquals("[ChannelInfo([TraceInfo(Name=channel)],State=DISABLED,OverwriteMode=true,SubBuffersSize=1,NumberOfSubBuffers=1,SwitchTimer=1,ReadTimer=1,output=splice(),Events=None)]", result); - } - - /** - * Run another String toString() method test. - */ - @Test - public void testToString_2() { - String result = fChannelInfo1.toString(); - - // add additional test code here - assertEquals("[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])]", result); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fChannelInfo1.equals(fChannelInfo1)); - assertTrue("equals", fChannelInfo2.equals(fChannelInfo2)); - - assertTrue("equals", !fChannelInfo1.equals(fChannelInfo2)); - assertTrue("equals", !fChannelInfo2.equals(fChannelInfo1)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsSymmetry() { - ChannelInfo event1 = new ChannelInfo((ChannelInfo)fChannelInfo1); - ChannelInfo event2 = new ChannelInfo((ChannelInfo)fChannelInfo2); - - assertTrue("equals", event1.equals(fChannelInfo1)); - assertTrue("equals", fChannelInfo1.equals(event1)); - - assertTrue("equals", event2.equals(fChannelInfo2)); - assertTrue("equals", fChannelInfo2.equals(event2)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsTransivity() { - ChannelInfo channel1 = new ChannelInfo((ChannelInfo)fChannelInfo1); - ChannelInfo channel2 = new ChannelInfo((ChannelInfo)fChannelInfo1); - ChannelInfo channel3 = new ChannelInfo((ChannelInfo)fChannelInfo1); - - assertTrue("equals", channel1.equals(channel2)); - assertTrue("equals", channel2.equals(channel3)); - assertTrue("equals", channel1.equals(channel3)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fChannelInfo1.equals(null)); - assertTrue("equals", !fChannelInfo2.equals(null)); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Run the hashCode() method test. - */ - @Test - public void testHashCode() { - ChannelInfo channel1 = new ChannelInfo((ChannelInfo)fChannelInfo1); - ChannelInfo channel2 = new ChannelInfo((ChannelInfo)fChannelInfo2); - - assertTrue("hashCode", fChannelInfo1.hashCode() == channel1.hashCode()); - assertTrue("hashCode", fChannelInfo2.hashCode() == channel2.hashCode()); - - assertTrue("hashCode", fChannelInfo1.hashCode() != channel2.hashCode()); - assertTrue("hashCode", fChannelInfo2.hashCode() != channel1.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/DomainInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/DomainInfoTest.java deleted file mode 100644 index ff6fba5cf0..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/DomainInfoTest.java +++ /dev/null @@ -1,225 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.*; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class ChannelInfoTest contains tests for the class - * {@link DomainInfo}. - */ -public class DomainInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private IDomainInfo fDomainInfo1 = null; - private IDomainInfo fDomainInfo2 = null; - private IChannelInfo fChannelInfo1 = null; - private IChannelInfo fChannelInfo2 = null; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - // Get test instances from the factory - ModelImplFactory factory = new ModelImplFactory(); - fChannelInfo1 = factory.getChannel1(); - fChannelInfo2 = factory.getChannel2(); - fDomainInfo1 = factory.getDomainInfo1(); - fDomainInfo2 = factory.getDomainInfo2(); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Run the ChannelInfo() constructor test. - */ - @Test - public void testDomainInfo() { - DomainInfo result = new DomainInfo("test"); - assertNotNull(result); - - assertEquals("test", result.getName()); - assertEquals(0, result.getChannels().length); - } - - /** - * Test the copy constructor. - */ - @Test - public void testDomainInfoCopy() { - DomainInfo channelInfo = new DomainInfo((DomainInfo)fDomainInfo1); - IChannelInfo[] orignalEvents = fDomainInfo1.getChannels(); - IChannelInfo[] resultEvents = channelInfo.getChannels(); - for (int i = 0; i < orignalEvents.length; i++) { - assertEquals(orignalEvents[i], resultEvents[i]); - } - } - - /** - * Test the copy constructor. - */ - @Test - public void testDomainlCopy2() { - try { - DomainInfo domain = null; - new DomainInfo(domain); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Run the long getNumberOfSubBuffers() method test. - */ - @Test - public void testGetAndSetters() { - - // Note that addChannel() has been executed in setUp() - // check get method here - assertEquals(1, fDomainInfo1.getChannels().length); - assertNotNull(fDomainInfo1.getChannels()[0]); - assertEquals(fChannelInfo1, fDomainInfo1.getChannels()[0]); - - IDomainInfo domain = new DomainInfo("domain"); - List list = new LinkedList<>(); - list.add(fChannelInfo1); - list.add(fChannelInfo2); - domain.setChannels(list); - - IChannelInfo[] result = domain.getChannels(); - assertEquals(2, result.length); - assertEquals(fChannelInfo1, result[0]); - assertEquals(fChannelInfo2, result[1]); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_1() { - DomainInfo fixture = new DomainInfo("domain"); - - String result = fixture.toString(); - - assertEquals("[DomainInfo([TraceInfo(Name=domain)],Channels=None,isKernel=false)]", result); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_2() { - String result = fDomainInfo1.toString(); - - assertEquals("[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])],isKernel=false)]", result); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fDomainInfo1.equals(fDomainInfo1)); - assertTrue("equals", fDomainInfo2.equals(fDomainInfo2)); - - assertTrue("equals", !fDomainInfo1.equals(fDomainInfo2)); - assertTrue("equals", !fDomainInfo2.equals(fDomainInfo1)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsSymmetry() { - DomainInfo event1 = new DomainInfo((DomainInfo)fDomainInfo1); - DomainInfo event2 = new DomainInfo((DomainInfo)fDomainInfo2); - - assertTrue("equals", event1.equals(fDomainInfo1)); - assertTrue("equals", fDomainInfo1.equals(event1)); - - assertTrue("equals", event2.equals(fDomainInfo2)); - assertTrue("equals", fDomainInfo2.equals(event2)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsTransivity() { - DomainInfo channel1 = new DomainInfo((DomainInfo)fDomainInfo1); - DomainInfo channel2 = new DomainInfo((DomainInfo)fDomainInfo1); - DomainInfo channel3 = new DomainInfo((DomainInfo)fDomainInfo1); - - assertTrue("equals", channel1.equals(channel2)); - assertTrue("equals", channel2.equals(channel3)); - assertTrue("equals", channel1.equals(channel3)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fDomainInfo1.equals(null)); - assertTrue("equals", !fDomainInfo2.equals(null)); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Run the hashCode() method test. - */ - @Test - public void testHashCode() { - DomainInfo channel1 = new DomainInfo((DomainInfo)fDomainInfo1); - DomainInfo channel2 = new DomainInfo((DomainInfo)fDomainInfo2); - - assertTrue("hashCode", fDomainInfo1.hashCode() == channel1.hashCode()); - assertTrue("hashCode", fDomainInfo2.hashCode() == channel2.hashCode()); - - assertTrue("hashCode", fDomainInfo1.hashCode() != channel2.hashCode()); - assertTrue("hashCode", fDomainInfo2.hashCode() != channel1.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/EventInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/EventInfoTest.java deleted file mode 100644 index e0c5212a35..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/EventInfoTest.java +++ /dev/null @@ -1,366 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class EventInfoTest contains test for the class - * {@link EventInfo}. - */ -public class EventInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private IEventInfo fEventInfo1 = null; - private IEventInfo fEventInfo2 = null; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - ModelImplFactory factory = new ModelImplFactory(); - fEventInfo1 = factory.getEventInfo1(); - fEventInfo2 = factory.getEventInfo2(); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Run the EventInfo() constructor test. - */ - @Test - public void testBaseEventInfo() { - EventInfo fixture = new EventInfo("event"); - assertNotNull(fixture); - - TraceEventType result = fixture.getEventType(); - - assertEquals("event", fixture.getName()); - assertEquals("unknown", result.getInName()); - assertEquals("UNKNOWN", result.name()); - assertEquals("UNKNOWN", result.toString()); - assertEquals(4, result.ordinal()); - - TraceEnablement state = fixture.getState(); - assertEquals("disabled", state.getInName()); - assertEquals("DISABLED", state.name()); - assertEquals("DISABLED", state.toString()); - assertEquals(0, state.ordinal()); - - LogLevelType logType = fixture.getLogLevelType(); - assertEquals("", logType.getShortName()); - assertEquals("LOGLEVEL_NONE", logType.name()); - assertEquals("LOGLEVEL_NONE", logType.toString()); - assertEquals(0, state.ordinal()); - - - } - - /** - * Test Copy Constructor - */ - @Test - public void testEventInfoCopy() { - EventInfo info = new EventInfo((EventInfo)fEventInfo1); - - assertEquals(fEventInfo1.getName(), info.getName()); - assertEquals(fEventInfo1.getEventType(), info.getEventType()); - assertEquals(fEventInfo1.getState(), info.getState()); - assertEquals(fEventInfo1.getLogLevelType(), info.getLogLevelType()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testEventCopy2() { - try { - EventInfo info = null; - new EventInfo(info); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Getter/Setter tests - */ - @Test - public void testGetAndSetter() { - EventInfo fixture = new EventInfo("event"); - - fixture.setEventType(TraceEventType.TRACEPOINT); - TraceEventType result = fixture.getEventType(); - - // setEventType(TraceEventType type) - assertNotNull(result); - assertEquals("tracepoint", result.getInName()); - assertEquals("TRACEPOINT", result.name()); - assertEquals("TRACEPOINT", result.toString()); - assertEquals(0, result.ordinal()); - - fixture.setEventType(TraceEventType.UNKNOWN); - result = fixture.getEventType(); - assertEquals("unknown", result.getInName()); - assertEquals("UNKNOWN", result.name()); - assertEquals("UNKNOWN", result.toString()); - assertEquals(4, result.ordinal()); - - // setEventType(String typeName) - String typeName = ""; - fixture.setEventType(typeName); - result = fixture.getEventType(); - - assertEquals("unknown", result.getInName()); - assertEquals("UNKNOWN", result.name()); - assertEquals("UNKNOWN", result.toString()); - assertEquals(4, result.ordinal()); - - typeName = "unknown"; - - fixture.setEventType(typeName); - result = fixture.getEventType(); - - assertEquals("unknown", result.getInName()); - assertEquals("UNKNOWN", result.name()); - assertEquals("UNKNOWN", result.toString()); - assertEquals(4, result.ordinal()); - - // setState(String stateName) - fixture.setState("disabled"); - TraceEnablement state = fixture.getState(); - assertEquals("disabled", state.getInName()); - assertEquals("DISABLED", state.name()); - assertEquals("DISABLED", state.toString()); - assertEquals(0, state.ordinal()); - - fixture.setState("false"); - state = fixture.getState(); - assertEquals("false", state.getInMiName()); - assertEquals("DISABLED", state.name()); - assertEquals("DISABLED", state.toString()); - assertEquals(0, state.ordinal()); - - fixture.setState("bla"); - state = fixture.getState(); - assertEquals("disabled", state.getInName()); - assertEquals("DISABLED", state.name()); - assertEquals("DISABLED", state.toString()); - assertEquals(0, state.ordinal()); - - fixture.setState("enabled"); - state = fixture.getState(); - assertEquals("enabled", state.getInName()); - assertEquals("ENABLED", state.name()); - assertEquals("ENABLED", state.toString()); - assertEquals(1, state.ordinal()); - - fixture.setState("true"); - state = fixture.getState(); - assertEquals("true", state.getInMiName()); - assertEquals("ENABLED", state.name()); - assertEquals("ENABLED", state.toString()); - assertEquals(1, state.ordinal()); - - // setState(TraceEnablement state) - fixture.setState(TraceEnablement.DISABLED); - state = fixture.getState(); - assertEquals("disabled", state.getInName()); - assertEquals("DISABLED", state.name()); - assertEquals("DISABLED", state.toString()); - assertEquals(0, state.ordinal()); - - fixture.setState(TraceEnablement.ENABLED); - state = fixture.getState(); - assertEquals("enabled", state.getInName()); - assertEquals("ENABLED", state.name()); - assertEquals("ENABLED", state.toString()); - assertEquals(1, state.ordinal()); - - // setLogLevelType(String name) - fixture.setLogLevelType("=="); - assertEquals("LOGLEVEL_ONLY", fixture.getLogLevelType().name()); - assertEquals("==", fixture.getLogLevelType().getShortName()); - - fixture.setLogLevelType("<="); - assertEquals("LOGLEVEL", fixture.getLogLevelType().name()); - assertEquals("<=", fixture.getLogLevelType().getShortName()); - - fixture.setLogLevelType(""); - assertEquals("LOGLEVEL_ALL", fixture.getLogLevelType().name()); - assertEquals("", fixture.getLogLevelType().getShortName()); - - fixture.setLogLevelType(LogLevelType.LOGLEVEL_ONLY); - assertEquals("LOGLEVEL_ONLY", fixture.getLogLevelType().name()); - assertEquals("==", fixture.getLogLevelType().getShortName()); - - fixture.setLogLevelType(LogLevelType.LOGLEVEL); - assertEquals("LOGLEVEL", fixture.getLogLevelType().name()); - assertEquals("<=", fixture.getLogLevelType().getShortName()); - - fixture.setLogLevelType(LogLevelType.LOGLEVEL_ALL); - assertEquals("LOGLEVEL_ALL", fixture.getLogLevelType().name()); - assertEquals("", fixture.getLogLevelType().getShortName()); - - fixture.setLogLevelType(LogLevelType.LOGLEVEL_NONE); - assertEquals("LOGLEVEL_NONE", fixture.getLogLevelType().name()); - assertEquals("", fixture.getLogLevelType().getShortName()); - - // setLogLevelType(String name) - // machine interface - fixture.setLogLevelType("SINGLE"); - assertEquals("LOGLEVEL_ONLY", fixture.getLogLevelType().name()); - assertEquals("SINGLE", fixture.getLogLevelType().getMiName()); - - fixture.setLogLevelType("RANGE"); - assertEquals("LOGLEVEL", fixture.getLogLevelType().name()); - assertEquals("RANGE", fixture.getLogLevelType().getMiName()); - - fixture.setLogLevelType("ALL"); - assertEquals("LOGLEVEL_ALL", fixture.getLogLevelType().name()); - assertEquals("ALL", fixture.getLogLevelType().getMiName()); - - fixture.setLogLevelType("UNKNOWN"); - assertEquals("LOGLEVEL_NONE", fixture.getLogLevelType().name()); - assertEquals("UNKNOWN", fixture.getLogLevelType().getMiName()); - - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_1() { - EventInfo fixture = new EventInfo("event"); - fixture.setName("testName"); - fixture.setEventType(TraceEventType.TRACEPOINT); - - String result = fixture.toString(); - - // add additional test code here - assertEquals("[EventInfo([BaseEventInfo([TraceInfo(Name=testName)],type=TRACEPOINT,level=TRACE_DEBUG)],State=DISABLED,levelType=LOGLEVEL_NONE)]", result); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_2() { - EventInfo fixture = new EventInfo("event"); - fixture.setName("testName"); - fixture.setEventType(TraceEventType.TRACEPOINT); - fixture.setLogLevelType(LogLevelType.LOGLEVEL_ONLY); - - String result = fixture.toString(); - - // add additional test code here - assertEquals("[EventInfo([BaseEventInfo([TraceInfo(Name=testName)],type=TRACEPOINT,level=TRACE_DEBUG)],State=DISABLED,levelType=LOGLEVEL_ONLY)]", result); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fEventInfo1.equals(fEventInfo1)); - assertTrue("equals", fEventInfo2.equals(fEventInfo2)); - - assertTrue("equals", !fEventInfo1.equals(fEventInfo2)); - assertTrue("equals", !fEventInfo2.equals(fEventInfo1)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsSymmetry() { - EventInfo info1 = new EventInfo((EventInfo)fEventInfo1); - EventInfo info2 = new EventInfo((EventInfo)fEventInfo2); - - assertTrue("equals", info1.equals(fEventInfo1)); - assertTrue("equals", fEventInfo1.equals(info1)); - - assertTrue("equals", info2.equals(fEventInfo2)); - assertTrue("equals", fEventInfo2.equals(info2)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsTransivity() { - EventInfo info1 = new EventInfo((EventInfo)fEventInfo1); - EventInfo info2 = new EventInfo((EventInfo)fEventInfo1); - EventInfo info3 = new EventInfo((EventInfo)fEventInfo1); - - assertTrue("equals", info1.equals(info2)); - assertTrue("equals", info2.equals(info3)); - assertTrue("equals", info1.equals(info3)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fEventInfo1.equals(null)); - assertTrue("equals", !fEventInfo2.equals(null)); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Run the hashCode() method test. - */ - @Test - public void testHashCode() { - EventInfo info1 = new EventInfo((EventInfo)fEventInfo1); - EventInfo info2 = new EventInfo((EventInfo)fEventInfo2); - - assertTrue("hashCode", fEventInfo1.hashCode() == info1.hashCode()); - assertTrue("hashCode", fEventInfo2.hashCode() == info2.hashCode()); - - assertTrue("hashCode", fEventInfo1.hashCode() != info2.hashCode()); - assertTrue("hashCode", fEventInfo2.hashCode() != info1.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/FieldInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/FieldInfoTest.java deleted file mode 100644 index c0b18c8a20..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/FieldInfoTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.*; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class FieldInfoTest contains test for the class - * {@link FieldInfo}. - */ -public class FieldInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private IFieldInfo fFieldInfo1 = null; - private IFieldInfo fFieldInfo2 = null; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - ModelImplFactory factory = new ModelImplFactory(); - fFieldInfo1 = factory.getFieldInfo1(); - fFieldInfo2 = factory.getFieldInfo2(); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Run the BaseEventInfo() constructor test. - */ - @Test - public void testFiledInfo() { - FieldInfo fixture = new FieldInfo("field"); - assertNotNull(fixture); - - assertEquals("field", fixture.getName()); - assertNull(fixture.getFieldType()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testEventInfoCopy() { - FieldInfo info = new FieldInfo((FieldInfo)fFieldInfo1); - - assertEquals(fFieldInfo1.getName(), info.getName()); - assertEquals(fFieldInfo1.getFieldType(), info.getFieldType()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testEventCopy2() { - try { - FieldInfo info = null; - new FieldInfo(info); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Run the TraceEventType getEventType() method test. - */ - @Test - public void testSetFieldType() { - FieldInfo info = new FieldInfo((FieldInfo)fFieldInfo1); - - info.setFieldType("string"); - assertEquals("string", info.getFieldType()); - } - - /** - * Run the toString() method test. - */ - @Test - public void testToString() { - String result = fFieldInfo1.toString(); - - // add additional test code here - assertEquals("[FieldInfo([TraceInfo(Name=intfield)],type=int", result); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fFieldInfo1.equals(fFieldInfo1)); - assertTrue("equals", fFieldInfo2.equals(fFieldInfo2)); - - assertTrue("equals", !fFieldInfo1.equals(fFieldInfo2)); - assertTrue("equals", !fFieldInfo2.equals(fFieldInfo1)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsSymmetry() { - FieldInfo info1 = new FieldInfo((FieldInfo)fFieldInfo1); - FieldInfo info2 = new FieldInfo((FieldInfo)fFieldInfo2); - - assertTrue("equals", info1.equals(fFieldInfo1)); - assertTrue("equals", fFieldInfo1.equals(info1)); - - assertTrue("equals", info2.equals(fFieldInfo2)); - assertTrue("equals", fFieldInfo2.equals(info2)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsTransivity() { - FieldInfo info1 = new FieldInfo((FieldInfo)fFieldInfo1); - FieldInfo info2 = new FieldInfo((FieldInfo)fFieldInfo1); - FieldInfo info3 = new FieldInfo((FieldInfo)fFieldInfo1); - - assertTrue("equals", info1.equals(info2)); - assertTrue("equals", info2.equals(info3)); - assertTrue("equals", info1.equals(info3)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fFieldInfo1.equals(null)); - assertTrue("equals", !fFieldInfo2.equals(null)); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Run the equals() method test. - */ - @Test - public void testHashCode() { - FieldInfo info1 = new FieldInfo((FieldInfo)fFieldInfo1); - FieldInfo info2 = new FieldInfo((FieldInfo)fFieldInfo2); - - assertTrue("hashCode", fFieldInfo1.hashCode() == info1.hashCode()); - assertTrue("hashCode", fFieldInfo2.hashCode() == info2.hashCode()); - - assertTrue("hashCode", fFieldInfo1.hashCode() != info2.hashCode()); - assertTrue("hashCode", fFieldInfo2.hashCode() != info1.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ModelImplFactory.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ModelImplFactory.java deleted file mode 100644 index 569f961007..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ModelImplFactory.java +++ /dev/null @@ -1,244 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; - -/** - * Test facility to constants across test case - */ -@SuppressWarnings("javadoc") -public class ModelImplFactory { - - private ISessionInfo fSessionInfo1 = null; - private ISessionInfo fSessionInfo2 = null; - private IDomainInfo fDomainInfo1 = null; - private IDomainInfo fDomainInfo2 = null; - private IChannelInfo fChannelInfo1 = null; - private IChannelInfo fChannelInfo2 = null; - private IEventInfo fEventInfo1 = null; - private IEventInfo fEventInfo2 = null; - private IEventInfo fEventInfo3 = null; - private IFieldInfo fFieldInfo1 = null; - private IFieldInfo fFieldInfo2 = null; - private IBaseEventInfo fBaseEventInfo1 = null; - private IBaseEventInfo fBaseEventInfo2 = null; - private IUstProviderInfo fUstProviderInfo1 = null; - private IUstProviderInfo fUstProviderInfo2 = null; - private IProbeEventInfo fProbeEventInfo1 = null; - private IProbeEventInfo fProbeEventInfo2 = null; - private ISnapshotInfo fSnapshotInfo1 = null; - private ISnapshotInfo fSnapshotInfo2 = null; - - public ModelImplFactory() { - - fFieldInfo1 = new FieldInfo("intfield"); - fFieldInfo1.setFieldType("int"); - fFieldInfo2 = new FieldInfo("stringfield"); - fFieldInfo2.setFieldType("string"); - - fBaseEventInfo1 = new BaseEventInfo("event1"); - fBaseEventInfo1.setEventType(TraceEventType.UNKNOWN); - fBaseEventInfo1.setLogLevel(TraceLogLevel.TRACE_ERR); - fBaseEventInfo1.addField(fFieldInfo1); - fBaseEventInfo1.addField(fFieldInfo2); - fBaseEventInfo1.setFilterExpression("intField==10"); - - fBaseEventInfo2 = new BaseEventInfo("event2"); - fBaseEventInfo2.setEventType(TraceEventType.TRACEPOINT); - fBaseEventInfo1.setLogLevel(TraceLogLevel.TRACE_DEBUG); - - fEventInfo1 = new EventInfo("event1"); - fEventInfo1.setEventType(TraceEventType.TRACEPOINT); - fEventInfo1.setLogLevelType("=="); - fEventInfo1.setLogLevel(TraceLogLevel.TRACE_DEBUG); - fEventInfo1.setState(TraceEnablement.ENABLED); - - fEventInfo2 = new EventInfo("event2"); - fEventInfo2.setLogLevelType("<="); - fEventInfo2.setLogLevel(TraceLogLevel.TRACE_INFO); - fEventInfo2.setEventType(TraceEventType.UNKNOWN); - fEventInfo2.setState(TraceEnablement.DISABLED); - - fEventInfo3 = new EventInfo("event3"); - fEventInfo3.setEventType(TraceEventType.TRACEPOINT); - fEventInfo3.setState(TraceEnablement.DISABLED); - - fUstProviderInfo1 = new UstProviderInfo("myUST1"); - fUstProviderInfo1.setPid(1234); - fUstProviderInfo1.addEvent(fBaseEventInfo1); - - fUstProviderInfo2 = new UstProviderInfo("myUST2"); - fUstProviderInfo2.setPid(2345); - fUstProviderInfo2.addEvent(fBaseEventInfo1); - fUstProviderInfo2.addEvent(fBaseEventInfo2); - - fChannelInfo1 = new ChannelInfo("channel1"); - fChannelInfo1.setSwitchTimer(10L); - fChannelInfo1.setOverwriteMode(true); - fChannelInfo1.setReadTimer(11L); - fChannelInfo1.setState(TraceEnablement.DISABLED); - fChannelInfo1.setNumberOfSubBuffers(12); - fChannelInfo1.setOutputType("splice()"); - fChannelInfo1.setSubBufferSize(13L); - fChannelInfo1.addEvent(fEventInfo1); - - fChannelInfo2 = new ChannelInfo("channel2"); - fChannelInfo2.setSwitchTimer(1L); - fChannelInfo2.setOverwriteMode(false); - fChannelInfo2.setReadTimer(2L); - fChannelInfo2.setState(TraceEnablement.ENABLED); - fChannelInfo2.setNumberOfSubBuffers(3); - fChannelInfo2.setOutputType("mmap()"); - fChannelInfo2.setSubBufferSize(4L); - fChannelInfo2.addEvent(fEventInfo2); - fChannelInfo2.addEvent(fEventInfo3); - - fDomainInfo1 = new DomainInfo("test1"); - fDomainInfo1.addChannel(fChannelInfo1); - - fDomainInfo2 = new DomainInfo("test2"); - fDomainInfo2.addChannel(fChannelInfo1); - fDomainInfo2.addChannel(fChannelInfo2); - - fSessionInfo1 = new SessionInfo("session1"); - fSessionInfo1.setSessionPath("/home/user"); - fSessionInfo1.setSessionState(TraceSessionState.ACTIVE); - fSessionInfo1.addDomain(fDomainInfo1); - - fSessionInfo2 = new SessionInfo("session2"); - fSessionInfo2.setSessionPath("/home/user1"); - fSessionInfo2.setSessionState(TraceSessionState.INACTIVE); - fSessionInfo2.addDomain(fDomainInfo1); - fSessionInfo2.addDomain(fDomainInfo2); - fSessionInfo2.setStreamedTrace(true); - - fProbeEventInfo1 = new ProbeEventInfo("probeEvent1"); - fProbeEventInfo1.setEventType(TraceEventType.TRACEPOINT); - fProbeEventInfo1.setState(TraceEnablement.ENABLED); - fProbeEventInfo1.setAddress("0xc1231234"); - - fProbeEventInfo2 = new ProbeEventInfo("probeEvent2"); - fProbeEventInfo2.setEventType(TraceEventType.FUNCTION); - fProbeEventInfo2.setState(TraceEnablement.DISABLED); - fProbeEventInfo2.setOffset("0x100"); - fProbeEventInfo2.setSymbol("init_post"); - - fSnapshotInfo1 = new SnapshotInfo("snapshot-1"); - fSnapshotInfo1.setId(1); - fSnapshotInfo1.setSnapshotPath("/home/user/lttng-trace/mysession/"); - fSnapshotInfo2 = new SnapshotInfo("other-snapshot"); - fSnapshotInfo2.setId(1); - fSnapshotInfo2.setSnapshotPath("net4://172.0.0.1:1234/"); - fSnapshotInfo2.setStreamedSnapshot(true); - - fSessionInfo1.setSnapshotInfo(fSnapshotInfo1); - } - - public ISessionInfo getSessionInfo1() { - return fSessionInfo1; - } - - public ISessionInfo getSessionInfo2() { - return fSessionInfo2; - } - - public IDomainInfo getDomainInfo1() { - return fDomainInfo1; - } - - public IDomainInfo getDomainInfo2() { - return fDomainInfo2; - } - - public IChannelInfo getChannel1() { - return fChannelInfo1; - } - - public IChannelInfo getChannel2() { - return fChannelInfo2; - } - - public IEventInfo getEventInfo1() { - return fEventInfo1; - } - - public IEventInfo getEventInfo2() { - return fEventInfo2; - } - - public IEventInfo getEventInfo3() { - return fEventInfo3; - } - - public IBaseEventInfo getBaseEventInfo1() { - return fBaseEventInfo1; - } - - public IBaseEventInfo getBaseEventInfo2() { - return fBaseEventInfo2; - } - - public IUstProviderInfo getUstProviderInfo1() { - return fUstProviderInfo1; - } - - public IUstProviderInfo getUstProviderInfo2() { - return fUstProviderInfo2; - } - - public IProbeEventInfo getProbeEventInfo1() { - return fProbeEventInfo1; - } - - public IProbeEventInfo getProbeEventInfo2() { - return fProbeEventInfo2; - } - - public IFieldInfo getFieldInfo1() { - return fFieldInfo1; - } - - public IFieldInfo getFieldInfo2() { - return fFieldInfo2; - } - - public ISnapshotInfo getSnapshotInfo1() { - return fSnapshotInfo1; - } - - public ISnapshotInfo getSnapshotInfo2() { - return fSnapshotInfo2; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ProbeEventInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ProbeEventInfoTest.java deleted file mode 100644 index 5d046f5b84..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ProbeEventInfoTest.java +++ /dev/null @@ -1,219 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.*; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class ProbEventInfoTest contains test for the class - * {@link ProbeEventInfo}. - */ -public class ProbeEventInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private IProbeEventInfo fEventInfo1 = null; - private IProbeEventInfo fEventInfo2 = null; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - ModelImplFactory factory = new ModelImplFactory(); - fEventInfo1 = factory.getProbeEventInfo1(); - fEventInfo2 = factory.getProbeEventInfo2(); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Run the BaseEventInfo() constructor test. - */ - @Test - public void testBaseEventInfo() { - ProbeEventInfo fixture = new ProbeEventInfo("event"); - assertNotNull(fixture); - - TraceEventType result = fixture.getEventType(); - - assertEquals("event", fixture.getName()); - assertEquals("unknown", result.getInName()); - assertEquals("UNKNOWN", result.name()); - assertEquals("UNKNOWN", result.toString()); - assertEquals(4, result.ordinal()); - - TraceEnablement state = fixture.getState(); - assertEquals("disabled", state.getInName()); - assertEquals("DISABLED", state.name()); - assertEquals("DISABLED", state.toString()); - assertEquals(0, state.ordinal()); - - assertNull(fixture.getAddress()); - assertNull(fixture.getOffset()); - assertNull(fixture.getSymbol()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testEventInfoCopy() { - ProbeEventInfo info = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); - - assertEquals(fEventInfo1.getName(), info.getName()); - assertEquals(fEventInfo1.getEventType(), info.getEventType()); - assertEquals(fEventInfo1.getState(), info.getState()); - assertEquals(fEventInfo1.getAddress(), info.getAddress()); - assertEquals(fEventInfo1.getOffset(), info.getOffset()); - assertEquals(fEventInfo1.getSymbol(), info.getSymbol()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testEventCopy2() { - try { - ProbeEventInfo info = null; - new ProbeEventInfo(info); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Getter/Setter tests - */ - @Test - public void testGetAndSetter() { - ProbeEventInfo fixture = new ProbeEventInfo("event"); - - fixture.setAddress("0xc12344321"); - String result = fixture.getAddress(); - - assertNotNull(result); - assertEquals("0xc12344321", result); - - fixture.setOffset("0x1000"); - result = fixture.getOffset(); - - assertNotNull(result); - assertEquals("0x1000", result); - - fixture.setSymbol("cpu_idle"); - result = fixture.getSymbol(); - - assertNotNull(result); - assertEquals("cpu_idle", result); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_1() { - assertEquals("[ProbeEventInfo([EventInfo([BaseEventInfo([TraceInfo(Name=probeEvent1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_NONE)],fAddress=0xc1231234)]", fEventInfo1.toString()); - assertEquals("[ProbeEventInfo([EventInfo([BaseEventInfo([TraceInfo(Name=probeEvent2)],type=FUNCTION,level=TRACE_DEBUG)],State=DISABLED,levelType=LOGLEVEL_NONE)],fOffset=0x100,fSymbol=init_post)]", fEventInfo2.toString()); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fEventInfo1.equals(fEventInfo1)); - assertTrue("equals", fEventInfo2.equals(fEventInfo2)); - - assertTrue("equals", !fEventInfo1.equals(fEventInfo2)); - assertTrue("equals", !fEventInfo2.equals(fEventInfo1)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsSymmetry() { - ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); - ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo2); - - assertTrue("equals", info1.equals(fEventInfo1)); - assertTrue("equals", fEventInfo1.equals(info1)); - - assertTrue("equals", info2.equals(fEventInfo2)); - assertTrue("equals", fEventInfo2.equals(info2)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsTransivity() { - ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); - ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); - ProbeEventInfo info3 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); - - assertTrue("equals", info1.equals(info2)); - assertTrue("equals", info2.equals(info3)); - assertTrue("equals", info1.equals(info3)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fEventInfo1.equals(null)); - assertTrue("equals", !fEventInfo2.equals(null)); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Run the hashCode() method test. - */ - @Test - public void testHashCode() { - ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); - ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo2); - - assertTrue("hashCode", fEventInfo1.hashCode() == info1.hashCode()); - assertTrue("hashCode", fEventInfo2.hashCode() == info2.hashCode()); - - assertTrue("hashCode", fEventInfo1.hashCode() != info2.hashCode()); - assertTrue("hashCode", fEventInfo2.hashCode() != info1.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SessionInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SessionInfoTest.java deleted file mode 100644 index 5ff8cff71d..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SessionInfoTest.java +++ /dev/null @@ -1,311 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.*; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class ChannelInfoTest contains tests for the class - * {@link SessionInfo}. - */ -public class SessionInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private ISessionInfo fSessionInfo1 = null; - private ISessionInfo fSessionInfo2 = null; - - private IDomainInfo fDomainInfo1 = null; - private IDomainInfo fDomainInfo2 = null; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - ModelImplFactory factory = new ModelImplFactory(); - fSessionInfo1 = factory.getSessionInfo1(); - fDomainInfo1 = factory.getDomainInfo1(); - fSessionInfo2 = factory.getSessionInfo2(); - fDomainInfo2 = factory.getDomainInfo2(); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Run the ChannelInfo() constructor test. - */ - @Test - public void testSessionInfo() { - ISessionInfo result = new SessionInfo("test"); - assertNotNull(result); - - assertEquals("test", result.getName()); - assertEquals("", result.getSessionPath()); - TraceSessionState state = result.getSessionState(); - assertEquals("inactive", state.getInName()); - assertEquals("INACTIVE", state.name()); - assertEquals("INACTIVE", state.toString()); - assertEquals(0, state.ordinal()); - assertEquals(0, result.getDomains().length); - assertFalse(result.isSnapshotSession()); - assertNull(result.getNetworkUrl()); - assertNull(result.getControlUrl()); - assertNull(result.getDataUrl()); - } - - /** - * Test copy constructor. - */ - @Test - public void testSessionInfoCopy() { - SessionInfo sessionInfo = new SessionInfo((SessionInfo)fSessionInfo1); - - assertEquals(sessionInfo.getName(), fSessionInfo1.getName()); - assertEquals(sessionInfo.getSessionPath(), fSessionInfo1.getSessionPath()); - assertEquals(sessionInfo.getSessionState(), fSessionInfo1.getSessionState()); - - IDomainInfo[] orignalDomains = fSessionInfo1.getDomains(); - IDomainInfo[] resultDomains = sessionInfo.getDomains(); - for (int i = 0; i < orignalDomains.length; i++) { - assertEquals(orignalDomains[i], resultDomains[i]); - } - - assertEquals(sessionInfo.getNetworkUrl(), fSessionInfo1.getNetworkUrl()); - assertEquals(sessionInfo.getControlUrl(), fSessionInfo1.getControlUrl()); - assertEquals(sessionInfo.getDataUrl(), fSessionInfo1.getDataUrl()); - } - - /** - * Test copy constructor. - */ - @Test - public void testSessionCopy2() { - try { - SessionInfo session = null; - new SessionInfo(session); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Run the long getNumberOfSubBuffers() method test. - */ - @Test - public void testGetAndSetters() { - - // Note that addDomain() has been executed in setUp() - // check get method here - assertEquals(1, fSessionInfo1.getDomains().length); - assertNotNull(fSessionInfo1.getDomains()[0]); - assertEquals(fDomainInfo1, fSessionInfo1.getDomains()[0]); - - ISessionInfo session = new SessionInfo("session"); - List list = new LinkedList<>(); - list.add(fDomainInfo1); - list.add(fDomainInfo2); - session.setDomains(list); - - IDomainInfo[] result = session.getDomains(); - assertEquals(2, result.length); - assertEquals(fDomainInfo1, result[0]); - assertEquals(fDomainInfo2, result[1]); - - session.setSessionPath("/home/user"); - assertEquals("/home/user", session.getSessionPath()); - - session.setSessionState("active"); - TraceSessionState state = session.getSessionState(); - state = session.getSessionState(); - assertEquals("active", state.getInName()); - assertEquals("ACTIVE", state.name()); - assertEquals("ACTIVE", state.toString()); - assertEquals(1, state.ordinal()); - - session.setSessionState("inactive"); - state = session.getSessionState(); - assertEquals("inactive", state.getInName()); - assertEquals("INACTIVE", state.name()); - assertEquals("INACTIVE", state.toString()); - assertEquals(0, state.ordinal()); - - session.setSessionState("test"); - state = session.getSessionState(); - assertEquals("inactive", state.getInName()); - assertEquals("INACTIVE", state.name()); - assertEquals("INACTIVE", state.toString()); - assertEquals(0, state.ordinal()); - - session.setSessionState(TraceSessionState.ACTIVE); - state = session.getSessionState(); - assertEquals("active", state.getInName()); - assertEquals("ACTIVE", state.name()); - assertEquals("ACTIVE", state.toString()); - assertEquals(1, state.ordinal()); - - session.setSessionState(TraceSessionState.INACTIVE); - state = session.getSessionState(); - assertEquals("inactive", state.getInName()); - assertEquals("INACTIVE", state.name()); - assertEquals("INACTIVE", state.toString()); - assertEquals(0, state.ordinal()); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_1() { - ISessionInfo fixture = new SessionInfo("sessionName"); - - String result = fixture.toString(); - - // add additional test code here - assertEquals("[SessionInfo([TraceInfo(Name=sessionName)],Path=,State=INACTIVE,isStreamedTrace=false,isSnapshot=false,Domains=,NetworkUrl=null,ControlUrl=null,DataUrl=null)]", result); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_2() { - String result = fSessionInfo1.toString(); - - // add additional test code here - assertEquals("[SessionInfo([TraceInfo(Name=session1)],Path=/home/user/lttng-trace/mysession/,State=ACTIVE,isStreamedTrace=false,isSnapshot=false,snapshotInfo=" - + "[SnapshotInfo([TraceInfo(Name=snapshot-1)],snapshotPath=/home/user/lttng-trace/mysession/,ID=1,isStreamedSnapshot=false)]," - + "Domains=[DomainInfo([TraceInfo(Name=test1)]," - + "Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice()," - + "Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])]," - + "isKernel=false)],NetworkUrl=null,ControlUrl=null,DataUrl=null)]", result); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_3() { - SessionInfo info = new SessionInfo((SessionInfo)fSessionInfo1); - info.setSnapshot(false); - info.setSnapshotInfo(null); - info.setSessionPath("/home/user/lttng-trace/mysession/"); - - String result = info.toString(); - - // add additional test code here - assertEquals("[SessionInfo([TraceInfo(Name=session1)],Path=/home/user/lttng-trace/mysession/,State=ACTIVE,isStreamedTrace=false,isSnapshot=false," - + "Domains=[DomainInfo([TraceInfo(Name=test1)]," - + "Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice()," - + "Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])]," - + "isKernel=false)],NetworkUrl=null,ControlUrl=null,DataUrl=null)]", result); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Run the {@link SessionInfo#equals} method test. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fSessionInfo1.equals(fSessionInfo1)); - assertTrue("equals", fSessionInfo2.equals(fSessionInfo2)); - - assertTrue("equals", !fSessionInfo1.equals(fSessionInfo2)); - assertTrue("equals", !fSessionInfo2.equals(fSessionInfo1)); - } - - /** - * Run the {@link SessionInfo#equals} method test. - */ - @Test - public void testEqualsSymmetry() { - SessionInfo event1 = new SessionInfo((SessionInfo)fSessionInfo1); - SessionInfo event2 = new SessionInfo((SessionInfo)fSessionInfo2); - - assertTrue("equals", event1.equals(fSessionInfo1)); - assertTrue("equals", fSessionInfo1.equals(event1)); - - assertTrue("equals", event2.equals(fSessionInfo2)); - assertTrue("equals", fSessionInfo2.equals(event2)); - } - - /** - * Run the {@link SessionInfo#equals} method test. - */ - @Test - public void testEqualsTransivity() { - SessionInfo channel1 = new SessionInfo((SessionInfo)fSessionInfo1); - SessionInfo channel2 = new SessionInfo((SessionInfo)fSessionInfo1); - SessionInfo channel3 = new SessionInfo((SessionInfo)fSessionInfo1); - - assertTrue("equals", channel1.equals(channel2)); - assertTrue("equals", channel2.equals(channel3)); - assertTrue("equals", channel1.equals(channel3)); - } - - /** - * Run the {@link SessionInfo#equals} method test. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fSessionInfo1.equals(null)); - assertTrue("equals", !fSessionInfo2.equals(null)); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Run the {@link SessionInfo#hashCode} method test. - */ - @Test - public void testHashCode() { - SessionInfo channel1 = new SessionInfo((SessionInfo)fSessionInfo1); - SessionInfo channel2 = new SessionInfo((SessionInfo)fSessionInfo2); - - assertTrue("hashCode", fSessionInfo1.hashCode() == channel1.hashCode()); - assertTrue("hashCode", fSessionInfo2.hashCode() == channel2.hashCode()); - - assertTrue("hashCode", fSessionInfo1.hashCode() != channel2.hashCode()); - assertTrue("hashCode", fSessionInfo2.hashCode() != channel1.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SnapshotInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SnapshotInfoTest.java deleted file mode 100644 index aa28c15644..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SnapshotInfoTest.java +++ /dev/null @@ -1,229 +0,0 @@ -/********************************************************************** - * Copyright (c) 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.TraceInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class SnapshotInfoTest contains test for the class - * {@link SnapshotInfo}. - */ -public class SnapshotInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private ISnapshotInfo fSnapshotInfo1 = null; - private ISnapshotInfo fSnapshotInfo2 = null; - - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - ModelImplFactory factory = new ModelImplFactory(); - fSnapshotInfo1 = factory.getSnapshotInfo1(); - fSnapshotInfo2 = factory.getSnapshotInfo2(); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Constructor test. - */ - @Test - public void testSnapshotInfo() { - SnapshotInfo fixture = new SnapshotInfo("event"); - assertNotNull(fixture); - assertEquals("event", fixture.getName()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testSnapshotInfo2() { - try { - String name = null; - new SnapshotInfo(name); - fail("null name in custructor"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Test Copy Constructor - */ - @Test - public void testSnapshotCopy() { - SnapshotInfo info = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); - - assertEquals(fSnapshotInfo1.getName(), info.getName()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testTraceCopy2() { - try { - SnapshotInfo info = null; - new SnapshotInfo(info); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Run the void setEventType(String) method test. - */ - @Test - public void testSetName() { - SnapshotInfo fixture = new SnapshotInfo("event"); - fixture.setName("newName"); - assertEquals("newName", fixture.getName()); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_1() { - String result = fSnapshotInfo1.toString(); - - // add additional test code here - assertEquals("[SnapshotInfo([TraceInfo(Name=snapshot-1)],snapshotPath=/home/user/lttng-trace/mysession/,ID=1,isStreamedSnapshot=false)]", result); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fSnapshotInfo1.equals(fSnapshotInfo1)); - assertTrue("equals", fSnapshotInfo2.equals(fSnapshotInfo2)); - - assertTrue("equals", !fSnapshotInfo1.equals(fSnapshotInfo2)); - assertTrue("equals", !fSnapshotInfo2.equals(fSnapshotInfo1)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsSymmetry() { - SnapshotInfo info1 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); - SnapshotInfo info2 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo2); - - assertTrue("equals", info1.equals(fSnapshotInfo1)); - assertTrue("equals", fSnapshotInfo1.equals(info1)); - - assertTrue("equals", info2.equals(fSnapshotInfo2)); - assertTrue("equals", fSnapshotInfo2.equals(info2)); - } - /** - * Run the equals() method test. - */ - @Test - public void testEqualsTransivity() { - SnapshotInfo info1 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); - SnapshotInfo info2 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); - SnapshotInfo info3 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); - - assertTrue("equals", info1.equals(info2)); - assertTrue("equals", info2.equals(info3)); - assertTrue("equals", info1.equals(info3)); - } - /** - * Run the equals() method test. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fSnapshotInfo1.equals(null)); - assertTrue("equals", !fSnapshotInfo2.equals(null)); - - SnapshotInfo info = new SnapshotInfo("snapshot-1"); - assertTrue("equals", !fSnapshotInfo1.equals(info)); - - info.setSnapshotPath(null); - assertTrue("equals", !fSnapshotInfo1.equals(info)); - - info.setId(fSnapshotInfo1.getId()); - assertTrue("equals", !info.equals(fSnapshotInfo1)); - - info.setSnapshotPath("/home/user/lttng-trace/mysession/"); - assertTrue("equals", fSnapshotInfo1.equals(info)); - info.setId(2); - assertTrue("equals", !fSnapshotInfo1.equals(info)); - - info.setId(fSnapshotInfo1.getId()); - info.setStreamedSnapshot(true); - assertTrue("equals", !fSnapshotInfo1.equals(info)); - - assertTrue("equals", !fSnapshotInfo1.equals(new TraceInfo(fSnapshotInfo1.getName()))); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Run the hashCode() method test. - */ - @Test - public void testHashCode() { - SnapshotInfo info1 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); - SnapshotInfo info2 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo2); - - assertTrue("hashCode", fSnapshotInfo1.hashCode() == info1.hashCode()); - assertTrue("hashCode", fSnapshotInfo2.hashCode() == info2.hashCode()); - - assertTrue("hashCode", fSnapshotInfo1.hashCode() != info2.hashCode()); - assertTrue("hashCode", fSnapshotInfo2.hashCode() != info1.hashCode()); - - // null values - SnapshotInfo info3 = new SnapshotInfo("snapshot-1"); - assertTrue("hashCode", fSnapshotInfo1.hashCode() != info3.hashCode()); - - info3.setSnapshotPath(null); - assertTrue("hashCode", fSnapshotInfo1.hashCode() != info3.hashCode()); - - info3.setSnapshotPath("/home/user/lttng-trace/mysession/"); - assertTrue("hashCode", fSnapshotInfo1.hashCode() != info3.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/TraceInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/TraceInfoTest.java deleted file mode 100644 index 3f6c8a9dc1..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/TraceInfoTest.java +++ /dev/null @@ -1,199 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ITraceInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.TraceInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class TraceInfoTest contains test for the class - * {@link TraceInfo}. - */ -public class TraceInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private ITraceInfo fTraceInfo1 = null; - private ITraceInfo fTraceInfo2 = null; - - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - fTraceInfo1 = new TraceInfo("event1"); - fTraceInfo2 = new TraceInfo("event2"); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Run the BaseEventInfo() constructor test. - */ - @Test - public void testTraceInfo() { - TraceInfo fixture = new TraceInfo("event"); - assertNotNull(fixture); - - assertEquals("event", fixture.getName()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testTraceInfo2() { - try { - String name = null; - new TraceInfo(name); - fail("null name in custructor"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Test Copy Constructor - */ - @Test - public void testTraceInfoCopy() { - TraceInfo info = new TraceInfo((TraceInfo)fTraceInfo1); - - assertEquals(fTraceInfo1.getName(), info.getName()); - } - - /** - * Test Copy Constructor - */ - @Test - public void testTraceCopy2() { - try { - TraceInfo info = null; - new TraceInfo(info); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Run the void setEventType(String) method test. - */ - @Test - public void testSetName() { - TraceInfo fixture = new TraceInfo("event"); - fixture.setName("newName"); - assertEquals("newName", fixture.getName()); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_1() { - String result = fTraceInfo1.toString(); - - // add additional test code here - assertEquals("[TraceInfo(Name=event1)]", result); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fTraceInfo1.equals(fTraceInfo1)); - assertTrue("equals", fTraceInfo2.equals(fTraceInfo2)); - - assertTrue("equals", !fTraceInfo1.equals(fTraceInfo2)); - assertTrue("equals", !fTraceInfo2.equals(fTraceInfo1)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsSymmetry() { - TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1); - TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo2); - - assertTrue("equals", info1.equals(fTraceInfo1)); - assertTrue("equals", fTraceInfo1.equals(info1)); - - assertTrue("equals", info2.equals(fTraceInfo2)); - assertTrue("equals", fTraceInfo2.equals(info2)); - } - /** - * Run the equals() method test. - */ - @Test - public void testEqualsTransivity() { - TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1); - TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo1); - TraceInfo info3 = new TraceInfo((TraceInfo)fTraceInfo1); - - assertTrue("equals", info1.equals(info2)); - assertTrue("equals", info2.equals(info3)); - assertTrue("equals", info1.equals(info3)); - } - /** - * Run the equals() method test. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fTraceInfo1.equals(null)); - assertTrue("equals", !fTraceInfo2.equals(null)); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Run the hashCode() method test. - */ - @Test - public void testHashCode() { - TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1); - TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo2); - - assertTrue("hashCode", fTraceInfo1.hashCode() == info1.hashCode()); - assertTrue("hashCode", fTraceInfo2.hashCode() == info2.hashCode()); - - assertTrue("hashCode", fTraceInfo1.hashCode() != info2.hashCode()); - assertTrue("hashCode", fTraceInfo2.hashCode() != info1.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/UstProviderInfoTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/UstProviderInfoTest.java deleted file mode 100644 index bb5dcdbac4..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/UstProviderInfoTest.java +++ /dev/null @@ -1,254 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; - -import static org.junit.Assert.*; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; -import org.junit.Before; -import org.junit.Test; - -/** - * The class ChannelInfoTest contains tests for the class - * {@link UstProviderInfo}. - */ -public class UstProviderInfoTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private IUstProviderInfo fUstProviderInfo1 = null; - private IUstProviderInfo fUstProviderInfo2 = null; - - private IBaseEventInfo fEventInfo1 = null; - private IBaseEventInfo fEventInfo2 = null; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - ModelImplFactory factory = new ModelImplFactory(); - fUstProviderInfo1 = factory.getUstProviderInfo1(); - fUstProviderInfo2 = factory.getUstProviderInfo2(); - fEventInfo1 = factory.getBaseEventInfo1(); - fEventInfo2 = factory.getBaseEventInfo2(); - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Run the UstProviderInfo() constructor test. - */ - @Test - public void testUstProviderInfo() { - IUstProviderInfo result = new UstProviderInfo("test"); - assertNotNull(result); - - assertEquals("test", result.getName()); - assertEquals(0, result.getPid()); - assertEquals(0, result.getEvents().length); - } - - /** - * Test the copy constructor. - */ - @Test - public void testUstProviderInfoCopy() { - IUstProviderInfo providerInf = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); - - assertEquals(fUstProviderInfo1.getName(), providerInf.getName()); - assertEquals(fUstProviderInfo1.getPid(), providerInf.getPid()); - assertEquals(fUstProviderInfo1.getEvents().length, providerInf.getEvents().length); - - IBaseEventInfo[] orignalEvents = fUstProviderInfo1.getEvents(); - IBaseEventInfo[] resultEvents = providerInf.getEvents(); - for (int i = 0; i < orignalEvents.length; i++) { - assertEquals(orignalEvents[i], resultEvents[i]); - } - } - - /** - * Test the copy constructor. - */ - @Test - public void testUstProviderCopy2() { - try { - UstProviderInfo providerInfo = null; - new UstProviderInfo(providerInfo); - fail("null copy"); - } - catch (IllegalArgumentException e) { - // Success - } - } - - /** - * Run the IEventInfo[] getEvents() method test. - */ - @Test - public void testGetAndSetters() { - IUstProviderInfo fixture = new UstProviderInfo("test"); - fixture.setPid(2468); - - // add an event - IBaseEventInfo event = new BaseEventInfo("event"); - fixture.addEvent(event); - - // Verify the stored events - IBaseEventInfo[] result = fixture.getEvents(); - - assertNotNull(result); - assertEquals(1, result.length); - assertNotNull(result[0]); - assertTrue(event.equals(result[0])); - - assertEquals(2468, fixture.getPid()); - } - - /** - * Run the void setEvents(List) method test. - */ - @Test - public void testSetEvents_1() { - UstProviderInfo fixture = new UstProviderInfo("test"); - fixture.setPid(2468); - List events = new LinkedList<>(); - events.add(fEventInfo1); - events.add(fEventInfo2); - fixture.setEvents(events); - - IBaseEventInfo[] infos = fixture.getEvents(); - - assertEquals(events.size(), infos.length); - - for (int i = 0; i < infos.length; i++) { - assertEquals(events.get(i), infos[i]); - } - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_1() { - UstProviderInfo fixture = new UstProviderInfo("test"); - fixture.setPid(2468); - String result = fixture.toString(); - - assertEquals("[EventInfo([TraceInfo(Name=test)],PID=2468,Events=None)]", result); - } - - /** - * Run the String toString() method test. - */ - @Test - public void testToString_2() { - String result = fUstProviderInfo2.toString(); - assertEquals("[EventInfo([TraceInfo(Name=myUST2)],PID=2345,Events=[BaseEventInfo([TraceInfo(Name=event1)]," + - "type=UNKNOWN,level=TRACE_DEBUG,Fields=[FieldInfo([TraceInfo(Name=intfield)],type=int[FieldInfo" + - "([TraceInfo(Name=stringfield)],type=string,Filter=intField==10)][BaseEventInfo([TraceInfo(Name=event2)]," + - "type=TRACEPOINT,level=TRACE_DEBUG)])]", result); - } - - // ------------------------------------------------------------------------ - // equals - // ------------------------------------------------------------------------ - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsReflexivity() { - assertTrue("equals", fUstProviderInfo1.equals(fUstProviderInfo1)); - assertTrue("equals", fUstProviderInfo2.equals(fUstProviderInfo2)); - - assertTrue("equals", !fUstProviderInfo1.equals(fUstProviderInfo2)); - assertTrue("equals", !fUstProviderInfo2.equals(fUstProviderInfo1)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsSymmetry() { - UstProviderInfo event1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); - UstProviderInfo event2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo2); - - assertTrue("equals", event1.equals(fUstProviderInfo1)); - assertTrue("equals", fUstProviderInfo1.equals(event1)); - - assertTrue("equals", event2.equals(fUstProviderInfo2)); - assertTrue("equals", fUstProviderInfo2.equals(event2)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsTransivity() { - UstProviderInfo UstProvider1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); - UstProviderInfo UstProvider2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); - UstProviderInfo UstProvider3 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); - - assertTrue("equals", UstProvider1.equals(UstProvider2)); - assertTrue("equals", UstProvider2.equals(UstProvider3)); - assertTrue("equals", UstProvider1.equals(UstProvider3)); - } - - /** - * Run the equals() method test. - */ - @Test - public void testEqualsNull() { - assertTrue("equals", !fUstProviderInfo1.equals(null)); - assertTrue("equals", !fUstProviderInfo2.equals(null)); - } - - // ------------------------------------------------------------------------ - // hashCode - // ------------------------------------------------------------------------ - - /** - * Run the hashCode() method test. - */ - @Test - public void testHashCode() { - UstProviderInfo UstProvider1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); - UstProviderInfo UstProvider2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo2); - - assertTrue("hashCode", fUstProviderInfo1.hashCode() == UstProvider1.hashCode()); - assertTrue("hashCode", fUstProviderInfo2.hashCode() == UstProvider2.hashCode()); - - assertTrue("hashCode", fUstProviderInfo1.hashCode() != UstProvider2.hashCode()); - assertTrue("hashCode", fUstProviderInfo2.hashCode() != UstProvider1.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/relayd/LttngRelayd24Test.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/relayd/LttngRelayd24Test.java deleted file mode 100644 index 0620f9d4a8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/relayd/LttngRelayd24Test.java +++ /dev/null @@ -1,108 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.relayd; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.net.InetAddress; -import java.net.Socket; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.ILttngRelaydConnector; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.LttngRelaydConnectorFactory; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.Command; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ConnectResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionReturnCode; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.GetNextIndex; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.NextIndexReturnCode; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ViewerCommand; -import org.junit.Test; - -/** - * Unit tests for lttng-relayd. It actually allows us to test the API. - * - * @author Matthew Khouzam - */ -public class LttngRelayd24Test { - - private static final int PACKETS_TO_READ = 100; - private static final String ADDRESS = "127.0.0.1"; // change me //$NON-NLS-1$ - private static final int PORT = 5344; - - private static void getPackets(AttachSessionResponse attachedSession, Socket connection, ILttngRelaydConnector relayD) throws IOException { - int numPacketsReceived = 0; - DataOutputStream fOutNet = new DataOutputStream(connection.getOutputStream()); - DataInputStream fInNet = new DataInputStream(connection.getInputStream()); - while (numPacketsReceived < PACKETS_TO_READ) { - for (StreamResponse stream : attachedSession.getStreamList()) { - if (stream.getMetadataFlag() != 1) { - ConnectResponse connectPayload = new ConnectResponse(fInNet); - assertNotNull(connectPayload); - - ViewerCommand connectCommand = new ViewerCommand(Command.VIEWER_GET_NEXT_INDEX, ConnectResponse.SIZE, 0); - fOutNet.write(connectCommand.serialize()); - fOutNet.flush(); - - GetNextIndex indexRequest = new GetNextIndex(stream.getId()); - fOutNet.write(indexRequest.serialize()); - fOutNet.flush(); - - IndexResponse indexReply = new IndexResponse(fInNet); - // Nothing else supported for now - if (indexReply.getStatus() == NextIndexReturnCode.VIEWER_INDEX_OK) { - if (relayD.getPacketFromStream(indexReply, stream.getId()) != null) { - numPacketsReceived++; - } - } - } - } - } - } - - /** - * Test a connection - * - * @throws IOException - * network timeout? - */ - @Test - public void testViewerConnection() throws IOException { - InetAddress addr = InetAddress.getByName(ADDRESS); - try (Socket connection = new Socket(addr, PORT); - ILttngRelaydConnector relayD = LttngRelaydConnectorFactory.getNewConnector(connection);) { - - List sessions = relayD.getSessions(); - assertTrue(sessions.size() > 0); - SessionResponse lttngViewerSession = sessions.get(0); - assertNotNull(lttngViewerSession); - CreateSessionResponse createSession = relayD.createSession(); - assertEquals(createSession.getStatus(), CreateSessionReturnCode.LTTNG_VIEWER_CREATE_SESSION_OK); - AttachSessionResponse attachedSession = relayD.attachToSession(lttngViewerSession); - - String metaData = relayD.getMetadata(attachedSession); - assertNotNull(metaData); - - getPackets(attachedSession, connection, relayD); - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/AllTests.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/AllTests.java deleted file mode 100644 index a647473f4a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/AllTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * 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: - * Guilliano Molaire - Initial API and implementation - *********************************************************************/ -package org.eclipse.linuxtools.lttng2.control.core.tests.session; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Run all the tests in the lttng2.core.session plugin. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - SessionConfigGeneratorTest.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/SessionConfigGeneratorTest.java b/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/SessionConfigGeneratorTest.java deleted file mode 100644 index aa45579dd9..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/SessionConfigGeneratorTest.java +++ /dev/null @@ -1,156 +0,0 @@ -/********************************************************************** - * 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: - * Guilliano Molaire - Initial API and implementation - *********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.tests.session; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.linuxtools.internal.lttng2.control.core.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigGenerator; -import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; -import org.eclipse.linuxtools.lttng2.control.core.tests.model.impl.ModelImplFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * This class contains tests for the class {@link SessionConfigGenerator}. - */ -public class SessionConfigGeneratorTest { - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - /** Session files for validation */ - private static final File VALID_SESSION_FILE = new File("../org.eclipse.linuxtools.lttng2.control.core.tests/test_session_config_files/test_valid.lttng"); - private static final File INVALID_SESSION_FILE = new File("../org.eclipse.linuxtools.lttng2.control.core.tests/test_session_config_files/test_invalid.lttng"); - - private static final String SESSION_FILENAME = "test_session." + SessionConfigStrings.SESSION_CONFIG_FILE_EXTENSION; - private static final IPath SESSION_FILE_PATH = Activator.getDefault().getStateLocation().addTrailingSeparator().append(SESSION_FILENAME); - private static final String TRACE_SESSION_PATH = "/home/user/folder"; - - private static final String SESSION_NAME_1 = "session1"; - private static final String SESSION_NAME_2 = "session2"; - private static final String SESSION_NAME_3 = "session3"; - - /** Session informations for generation tests */ - private ISessionInfo fValidSessionInfo = null; - private ISessionInfo fValidSessionSnapshotInfo = null; - private ISessionInfo fInvalidSessionInfo = null; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - /** - * Perform pre-test initialization. - */ - @Before - public void setUp() { - /* A valid domain with shared buffer type */ - ModelImplFactory factory = new ModelImplFactory(); - IDomainInfo domain = factory.getDomainInfo1(); - domain.setBufferType(BufferType.BUFFER_SHARED); - - /* The valid sessions */ - fValidSessionInfo = new SessionInfo(SESSION_NAME_1); - fValidSessionInfo.setSessionPath(TRACE_SESSION_PATH); - fValidSessionInfo.setSessionState(TraceSessionState.ACTIVE); - fValidSessionInfo.addDomain(domain); - - fValidSessionSnapshotInfo = new SessionInfo(SESSION_NAME_2); - fValidSessionSnapshotInfo.setSessionPath(TRACE_SESSION_PATH); - fValidSessionSnapshotInfo.setSessionState(TraceSessionState.ACTIVE); - fValidSessionSnapshotInfo.addDomain(domain); - fValidSessionSnapshotInfo.setSnapshotInfo(factory.getSnapshotInfo1()); - - /* The invalid session contains an event with an invalid type */ - fInvalidSessionInfo = factory.getSessionInfo2(); - fInvalidSessionInfo.setName(SESSION_NAME_3); - } - - /** - * Delete the session file created - */ - @After - public void tearUp() { - /* Tear up the file created if it exists */ - File sessionConfigurationFile = SESSION_FILE_PATH.toFile(); - if (sessionConfigurationFile.exists()) { - sessionConfigurationFile.delete(); - } - - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Test method for {@link SessionConfigGenerator#sessionValidate(File)} - */ - @Test - public void testSessionValidate() { - File testSessionFile = VALID_SESSION_FILE; - if ((testSessionFile == null) || !testSessionFile.exists()) { - fail("Session test file does not exist"); - } - IStatus status = SessionConfigGenerator.sessionValidate(testSessionFile); - if (!status.isOK()) { - fail(status.getMessage()); - } - - testSessionFile = INVALID_SESSION_FILE; - if ((testSessionFile == null) || !testSessionFile.exists()) { - fail("Session test file does not exist"); - } - assertFalse(SessionConfigGenerator.sessionValidate(testSessionFile).isOK()); - } - - /** - * Test method for - * {@link SessionConfigGenerator#generateSessionConfig(Set, IPath)} - */ - @Test - public void testGenerateSessionConfig() { - /* Should fail since it's empty */ - final Set sessions = new HashSet<>(); - assertFalse(SessionConfigGenerator.generateSessionConfig(sessions, SESSION_FILE_PATH).isOK()); - - /* Add a valid session and validate */ - sessions.add(fValidSessionInfo); - assertTrue(SessionConfigGenerator.generateSessionConfig(sessions, SESSION_FILE_PATH).isOK()); - assertTrue(SessionConfigGenerator.sessionValidate(SESSION_FILE_PATH.toFile()).isOK()); - - /* Add a valid snapshot session and validate */ - sessions.add(fValidSessionSnapshotInfo); - assertTrue(SessionConfigGenerator.generateSessionConfig(sessions, SESSION_FILE_PATH).isOK()); - assertTrue(SessionConfigGenerator.sessionValidate(SESSION_FILE_PATH.toFile()).isOK()); - - /* Add an invalid session */ - sessions.add(fInvalidSessionInfo); - assertFalse(SessionConfigGenerator.generateSessionConfig(sessions, SESSION_FILE_PATH).isOK()); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/test_session_config_files/test_invalid.lttng b/org.eclipse.linuxtools.lttng2.control.core.tests/test_session_config_files/test_invalid.lttng deleted file mode 100644 index d13f485874..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/test_session_config_files/test_invalid.lttng +++ /dev/null @@ -1,55 +0,0 @@ - - - - - auto-20140323-130527 - false - - - GLOBAL - - - channel0 - DISCARD - 4 - 0 - 0 - 0 - 0 - false - 262144 - 200000 - SPLICE - - - exit_syscall - true - TRACEPOINT - - - - - - - - - true - - /home/user/folder - - - - - diff --git a/org.eclipse.linuxtools.lttng2.control.core.tests/test_session_config_files/test_valid.lttng b/org.eclipse.linuxtools.lttng2.control.core.tests/test_session_config_files/test_valid.lttng deleted file mode 100644 index 4dea4df351..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core.tests/test_session_config_files/test_valid.lttng +++ /dev/null @@ -1,56 +0,0 @@ - - - - - auto-20140323-130527 - false - - - KERNEL - GLOBAL - - - channel0 - DISCARD - 4 - 0 - 0 - 0 - 0 - false - 262144 - 200000 - SPLICE - - - exit_syscall - true - TRACEPOINT - - - - - - - - - true - - /home/user/folder - - - - - diff --git a/org.eclipse.linuxtools.lttng2.control.core/.classpath b/org.eclipse.linuxtools.lttng2.control.core/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.control.core/.project b/org.eclipse.linuxtools.lttng2.control.core/.project deleted file mode 100644 index 6152f75871..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.control.core - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 9f3662cd78..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,394 +0,0 @@ -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.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 diff --git a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.pde.prefs deleted file mode 100644 index d92b94fd4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.control.core/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.control.core/META-INF/MANIFEST.MF deleted file mode 100644 index b49201c722..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.control.core;singleton:=true -Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.control.core.Activator -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.tracecompass.ctf.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.ctf.core;bundle-version="3.1.0" -Export-Package: org.eclipse.linuxtools.internal.lttng2.control.core;x-friends:="org.eclipse.linuxtools.lttng2.control.core.tests", - org.eclipse.linuxtools.internal.lttng2.control.core.model;x-friends:="org.eclipse.linuxtools.lttng2.control.ui,org.eclipse.linuxtools.lttng2.control.ui.tests,org.eclipse.linuxtools.lttng2.control.core.tests", - org.eclipse.linuxtools.internal.lttng2.control.core.model.impl;x-friends:="org.eclipse.linuxtools.lttng2.control.ui,org.eclipse.linuxtools.lttng2.control.ui.tests,org.eclipse.linuxtools.lttng2.control.core.tests", - org.eclipse.linuxtools.internal.lttng2.control.core.relayd;x-friends:="org.eclipse.linuxtools.lttng2.control.core.tests,org.eclipse.linuxtools.lttng2.control.ui,org.eclipse.linuxtools.lttng2.control.ui.tests", - org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl;x-friends:="org.eclipse.linuxtools.lttng2.control.core.tests,org.eclipse.linuxtools.lttng2.control.ui,org.eclipse.linuxtools.lttng2.control.ui.tests", - org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands;x-friends:="org.eclipse.linuxtools.lttng2.control.core.tests,org.eclipse.linuxtools.lttng2.control.ui,org.eclipse.linuxtools.lttng2.control.ui.tests", - org.eclipse.linuxtools.lttng2.control.core.session -Import-Package: com.google.common.collect diff --git a/org.eclipse.linuxtools.lttng2.control.core/about.html b/org.eclipse.linuxtools.lttng2.control.core/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/build.properties b/org.eclipse.linuxtools.lttng2.control.core/build.properties deleted file mode 100644 index 7a2207a1a0..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/build.properties +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - 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 diff --git a/org.eclipse.linuxtools.lttng2.control.core/plugin.properties b/org.eclipse.linuxtools.lttng2.control.core/plugin.properties deleted file mode 100644 index f4637e1581..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/plugin.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.control.core -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Control Core Plug-in diff --git a/org.eclipse.linuxtools.lttng2.control.core/pom.xml b/org.eclipse.linuxtools.lttng2.control.core/pom.xml deleted file mode 100644 index 84a609dbd0..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.control.core - 3.1.0-SNAPSHOT - eclipse-plugin - - Linux Tools LTTng Control Core Plug-in - - - - - org.eclipse.tycho - tycho-source-plugin - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/Activator.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/Activator.java deleted file mode 100644 index be722ee69b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/Activator.java +++ /dev/null @@ -1,136 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.control.core; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; -import org.osgi.framework.BundleContext; - -/** - * Activator - *

- * 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.linuxtools.lttng2.control.core"; //$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); - } - - /** - * 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)); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IBaseEventInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IBaseEventInfo.java deleted file mode 100644 index 21d7b3bfdc..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IBaseEventInfo.java +++ /dev/null @@ -1,89 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -/** - *

- * Interface for retrieval of basic trace event information. - *

- * - * @author Bernd Hufmann - */ -public interface IBaseEventInfo extends ITraceInfo { - - /** - * @return the trace event type - */ - TraceEventType getEventType(); - - /** - * Sets the trace event type to the given type - * @param type - type to set - */ - void setEventType(TraceEventType type); - - /** - * Sets the trace event type to the type specified by the given name. - * @param typeName - event type name - */ - void setEventType(String typeName); - - /** - * @return the trace event log level - */ - TraceLogLevel getLogLevel(); - - /** - * Sets the trace event log level to the given level - * @param level - event log level to set - */ - void setLogLevel(TraceLogLevel level); - - /** - * Sets the trace event log level to the level specified by the given name. - * @param levelName - event log level name - */ - void setLogLevel(String levelName); - - /** - * Returns the field information (if exists) - * @return the field information or null - */ - IFieldInfo[] getFields(); - - /** - * @param field The field to add - */ - void addField(IFieldInfo field); - - /** - * Sets the fields - * @param fields The fields - */ - void setFields(List fields); - - /** - * Returns filter expression. - * @return filter expression - */ - String getFilterExpression(); - - /** - * Sets the filter expression. - * @param filter The filter expression to set - */ - void setFilterExpression(String filter); - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IChannelInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IChannelInfo.java deleted file mode 100644 index 8018ea0458..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IChannelInfo.java +++ /dev/null @@ -1,157 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Simon Delisle - Updated for support of LTTng Tools 2.2 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; - -/** - *

- * Interface for retrieval of trace channel information. - *

- * - * @author Bernd Hufmann - */ -public interface IChannelInfo extends ITraceInfo { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Default value for overwrite mode. - */ - public final static boolean DEFAULT_OVERWRITE_MODE = false; - - /** - * @return the overwrite mode value. - */ - boolean isOverwriteMode(); - /** - * Sets the overwrite mode value to the given mode. - * @param mode - mode to set. - */ - void setOverwriteMode(boolean mode); - - /** - * @return the sub-buffer size. - */ - long getSubBufferSize(); - /** - * Sets the sub-buffer size to the given value. - * @param bufferSize - size to set to set. - */ - void setSubBufferSize(long bufferSize); - - /** - * @return the number of sub-buffers. - */ - int getNumberOfSubBuffers(); - /** - * Sets the number of sub-buffers to the given value. - * @param numberOfSubBuffers - value to set. - */ - void setNumberOfSubBuffers(int numberOfSubBuffers); - - /** - * @return the switch timer interval. - */ - long getSwitchTimer(); - /** - * Sets the switch timer interval to the given value. - * @param timer - timer value to set. - */ - void setSwitchTimer(long timer); - - /** - * @return the read timer interval. - */ - long getReadTimer(); - /** - * Sets the read timer interval to the given value. - * @param timer - timer value to set.. - */ - void setReadTimer(long timer); - - /** - * @return the output type. - */ - TraceChannelOutputType getOutputType(); - /** - * Sets the output type to the given value. - * @param type - type to set. - */ - void setOutputType(String type); - /** - * Sets the output type to the given value. - * @param type - type to set. - */ - void setOutputType(TraceChannelOutputType type); - - /** - * @return the channel state (enabled or disabled). - */ - TraceEnablement getState(); - /** - * Sets the channel state (enablement) to the given value. - * @param state - state to set. - */ - void setState(TraceEnablement state); - /** - * Sets the channel state (enablement) to the value specified by the given name. - * @param stateName - state to set. - */ - void setState(String stateName); - - /** - * @return all event information as array. - */ - IEventInfo[] getEvents(); - /** - * Sets the event information specified by given list. - * @param events - all event information to set. - */ - void setEvents(List events); - /** - * Adds a single event information. - * @param event - event information to add. - */ - void addEvent(IEventInfo event); - /** - * Sets the maximum size of trace files - * @param maxSizeTraceFiles - maximum size - */ - void setMaxSizeTraceFiles(int maxSizeTraceFiles); - /** - * Sets the maximum number of trace files - * @param maxNumberTraceFiles - maximum number - */ - void setMaxNumberTraceFiles(int maxNumberTraceFiles); - /** - * @return maximum size of trace files - */ - int getMaxSizeTraceFiles(); - /** - * @return maximum number of trace files - */ - int getMaxNumberTraceFiles(); - /** - * Sets per UID buffers - * @param buffersUID - enable or not - */ - void setBufferType(BufferType buffersUID); - /** - * @return the value of buffersUID (enable or not) - */ - BufferType getBufferType(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IDomainInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IDomainInfo.java deleted file mode 100644 index 783deb511f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IDomainInfo.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; - -/** - *

- * Interface for retrieval of trace domain information. - *

- * - * @author Bernd Hufmann - */ -public interface IDomainInfo extends ITraceInfo { - - /** - * @return information about all channels - */ - IChannelInfo[] getChannels(); - - /** - * Sets the channel information specified by given list. - * @param channels - all channel information to set. - */ - void setChannels(List channels); - - /** - * Adds a single channel information. - * @param channel - channel information to add. - */ - void addChannel(IChannelInfo channel); - - /** - * @return true if domain is kernel, false for UST - */ - boolean isKernel(); - - /** - * Sets whether domain is Kernel domain or UST - * @param isKernel true for kernel, false for UST - */ - void setIsKernel(boolean isKernel); - - /** - * @return Information about the buffer type - */ - BufferType getBufferType(); - - /** - * Sets the buffer type - * - * @param bufferType - * The buffer type - */ - void setBufferType(BufferType bufferType); - - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IEventInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IEventInfo.java deleted file mode 100644 index cd11e82b10..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IEventInfo.java +++ /dev/null @@ -1,58 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - *

- * Interface for retrieval of trace event information. - *

- * - * @author Bernd Hufmann - */ -public interface IEventInfo extends IBaseEventInfo { - - /** - * @return the event state (enabled or disabled). - */ - TraceEnablement getState(); - - /** - * Sets the event state (enablement) to the given value. - * @param state - state to set. - */ - void setState(TraceEnablement state); - - /** - * Sets the event state (enablement) to the value specified by the given name. - * @param stateName - state to set. - */ - void setState(String stateName); - - /** - * Returns the log level type. - * @return log level type. - */ - LogLevelType getLogLevelType(); - - /** - * Sets the LogLevelType. - * @param type - log level type - */ - void setLogLevelType(LogLevelType type); - - /** - * Sets the LogLevelType based on given short name. - * @param shortName - short name of type - */ - void setLogLevelType(String shortName); - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IFieldInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IFieldInfo.java deleted file mode 100644 index 3486a841fd..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IFieldInfo.java +++ /dev/null @@ -1,34 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - *

- * Interface for retrieval of event field information. - *

- * - * @author Bernd Hufmann - */ -public interface IFieldInfo extends ITraceInfo { - - /** - * @return the event field type - */ - String getFieldType(); - - /** - * Sets field type string - * - * @param fieldType - sting of event field type - */ - void setFieldType(String fieldType); -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IProbeEventInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IProbeEventInfo.java deleted file mode 100644 index 915998bdbf..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IProbeEventInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - *

- * Interface for retrieval of probe event information. - *

- * - * @author Bernd Hufmann - */ -public interface IProbeEventInfo extends IEventInfo { - - /** - * @return the address of the probe. (null if not used) - */ - String getAddress(); - - /** - * Sets the address of the probe. - * @param address - a address (null if not used) - */ - void setAddress(String address); - - /** - * @return the offset applied to the symbol (null if not used). - */ - String getOffset(); - - /** - * Sets the offset applied to the symbol. - * @param offset - a offset ((null if not used) - */ - void setOffset(String offset); - - /** - * @return the symbol name. ((null if not used)) - */ - String getSymbol(); - - /** - * Sets the symbol name. - * @param symbol - a symbol name ((null if not used)) - */ - void setSymbol(String symbol); -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISessionInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISessionInfo.java deleted file mode 100644 index d40a695b4a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISessionInfo.java +++ /dev/null @@ -1,222 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Marc-Andre Laperle - Support for creating a live session - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -/** - *

- * Interface for retrieval of trace session information. - *

- * - * @author Bernd Hufmann - */ -public interface ISessionInfo extends ITraceInfo { - - /** - * @return the session state state (active or inactive). - */ - TraceSessionState getSessionState(); - /** - * Sets the session state to the given value. - * @param state - state to set. - */ - void setSessionState(TraceSessionState state); - - /** - * Sets the event state to the value specified by the given name. - * @param stateName - state to set. - */ - void setSessionState(String stateName); - - /** - * @return path string where session is located. - */ - String getSessionPath(); - - /** - * Sets the path string (where session is located) to the given value. - * @param path - session path to set. - */ - void setSessionPath(String path); - - /** - * @return all domain information as array. - */ - IDomainInfo[] getDomains(); - - /** - * Sets all domain information specified by given list. - * @param domains - all domain information to set. - */ - void setDomains(List domains); - - /** - * Adds a single domain information. - * @param domainInfo domain information to add. - */ - void addDomain(IDomainInfo domainInfo); - - /** - * Returns if session is streamed over network - * @return true if streamed over network else false - */ - boolean isStreamedTrace(); - - /** - * Sets whether the trace is streamed or not - * @param isStreamedTrace true if streamed over network else false - */ - void setStreamedTrace(boolean isStreamedTrace); - - /** - * Returns whether the session is snapshot session or not - * @return true if it is snapshot session else false - */ - boolean isSnapshotSession(); - - /** - * Set whether or not the session should be in snapshot mode - * - * @param isSnapshot - * true for snapshot mode, false otherwise - */ - void setSnapshot(boolean isSnapshot); - - /** - * Gets the snapshot information the session or null if it is not a - * snapshot session. - * @return snapshot information - */ - ISnapshotInfo getSnapshotInfo(); - - /** - * Sets the snapshot information of the session - * @param setSnapshotInfo - the snapshot data to set. - */ - void setSnapshotInfo(ISnapshotInfo setSnapshotInfo); - - /** - * Get whether or not the session should be in Live mode - * - * @return true if is a live session else false - */ - public boolean isLive(); - - /** - * Set whether or not the session should be in Live mode - * - * @param isLive - * true for Live mode, false otherwise - */ - public void setLive(boolean isLive); - - /** - * Get the live delay which is the delay in micro seconds before the data is - * flushed and streamed. - * - * @return the live delay or -1 if the default value should be used - */ - public int getLiveDelay(); - - /** - * Set the live delay which is the delay in micro seconds before the data is - * flushed and streamed. - * - * @param liveDelay - * the live delay - */ - public void setLiveDelay(int liveDelay); - - /** - * Get the network URL in case control and data is configured together - * otherwise null If it returns a non-null value, getControlUrl() and - * getDataUrl() have to return null. - * - * @return The network URL or null. - */ - String getNetworkUrl(); - - /** - * Set the network URL - * - * @param networkUrl - * the network URL - */ - void setNetworkUrl(String networkUrl); - - /** - * Get the control URL in case control and data is configured separately. If - * it returns a non-null value, getDataUrl() has to return a valid value too - * and getNetworkUrl() has to return null. - * - * @return The control URL or null. - */ - String getControlUrl(); - - /** - * Set the control URL - * - * @param controlUrl - * the control URL - */ - void setControlUrl(String controlUrl); - - /** - * Get the data URL in case control and data is configured separately. If it - * returns a non-null value, getControlUrl() has to return a valid value too - * and getNetworkUrl() has to return null. - * - * @return The data URL or null. - */ - String getDataUrl(); - - /** - * Set the data URL - * - * @param datalUrl - * the data URL - */ - void setDataUrl(String datalUrl); - - /** - * Get the live URL. - * - * @return the live URL - */ - String getLiveUrl(); - - /** - * Set the live URL. - * - * @param liveUrl - * the live URL - */ - void setLiveUrl(String liveUrl); - - /** - * Get the live port. - * - * @return the live port - */ - Integer getLivePort(); - - /** - * Set the live port. - * - * @param livePort - * the live port - */ - void setLivePort(Integer livePort); -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISnapshotInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISnapshotInfo.java deleted file mode 100644 index 7c360feb9c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISnapshotInfo.java +++ /dev/null @@ -1,62 +0,0 @@ -/********************************************************************** - * Copyright (c) 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - - -/** - *

- * Interface for retrieval of snapshot information of a session. - *

- * - * @author Bernd Hufmann - */ -public interface ISnapshotInfo extends ITraceInfo { - - /** - * @return path string where snapshot is located. - */ - String getSnapshotPath(); - - /** - * Sets the path string (where snapshot is located) to the given value. - * @param path - session path to set. - */ - void setSnapshotPath(String path); - - /** - * @return the snapshot ID. - */ - int getId(); - - /** - * Sets the snapshot ID. - * @param id - the ID to set. - */ - void setId(int id); - - /** - * Sets whether snapshot is streamed over the network or stored locally - * at the tracers host. - * - * @param isStreamed - true if streamed else false - */ - void setStreamedSnapshot(boolean isStreamed); - - /** - * Gets whether snapshot is streamed over the network or stored locally - * at the tracers host. - * - * @return true if streamed else false - */ - boolean isStreamedSnapshot(); - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ITraceInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ITraceInfo.java deleted file mode 100644 index 1a3722730c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ITraceInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************** - * Copyright (c) 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - *

- * Interface for retrieve trace comon information. - *

- * - * @author Bernd Hufmann - */ -public interface ITraceInfo { - /** - * @return the name of the information element. - */ - String getName(); - - /** - * Sets the name of the information element. - * - * @param name - * The name to assign - */ - void setName(String name); - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IUstProviderInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IUstProviderInfo.java deleted file mode 100644 index 843028bf9d..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IUstProviderInfo.java +++ /dev/null @@ -1,52 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -/** - *

- * Interface for retrieval of UST provider information. - *

- * - * @author Bernd Hufmann - */ -public interface IUstProviderInfo extends ITraceInfo { - - /** - * @return the process ID of the UST provider. - */ - int getPid(); - - /** - * Sets the process ID of the UST provider to the given value. - * @param pid - process ID to set - */ - void setPid(int pid); - - /** - * @return all event information as array. - */ - IBaseEventInfo[] getEvents(); - - /** - * Sets the event information specified by given list. - * @param events - all event information to set. - */ - void setEvents(List events); - - /** - * Adds a single event information. - * @param event - event information to add. - */ - void addEvent(IBaseEventInfo event); -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/LogLevelType.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/LogLevelType.java deleted file mode 100644 index 7f6f2cef50..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/LogLevelType.java +++ /dev/null @@ -1,104 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - *********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - - -/** - * Type of log Level enumeration. - * - * @author Bernd Hufmann - */ -public enum LogLevelType { - - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** range of log levels [0,logLevel] */ - LOGLEVEL("<=", "RANGE"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** all log level */ - LOGLEVEL_ALL("", "ALL"), //$NON-NLS-1$//$NON-NLS-2$ - - /** single log level */ - LOGLEVEL_ONLY("==", "SINGLE"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** no log level */ - LOGLEVEL_NONE("", "UNKNOWN"); //$NON-NLS-1$ //$NON-NLS-2$ - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private LogLevelType(String shortName, String miName) { - fShortName = shortName; - fMiName = miName; - } - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum. - */ - private final String fShortName; - private final String fMiName; - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return short string - */ - public String getShortName() { - return fShortName; - } - - /** - * @return machine interface name string - */ - public String getMiName() { - return fMiName; - } - - // ------------------------------------------------------------------------ - // Utility - // ------------------------------------------------------------------------ - /** - * Return the corresponding {@link LogLevelType} to String "name" - * - * @param name - * String to compare to retrieve the good LogLevelType - * @return the corresponding {@link LogLevelType} - */ - public static LogLevelType valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (LogLevelType lltype : LogLevelType.values()) { - if (!lltype.equals(LOGLEVEL_NONE)) { - boolean isEqual = lltype.fShortName.equalsIgnoreCase(name) || lltype.fMiName.equalsIgnoreCase(name); - if (isEqual) { - return lltype; - } - } - } - - // No match - return LogLevelType.LOGLEVEL_NONE; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TargetNodeState.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TargetNodeState.java deleted file mode 100644 index 5a023155b2..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TargetNodeState.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - *

- * Enumeration for the node connection state. - *

- * - * @author Bernd Hufmann - */ -public enum TargetNodeState { - /** State when disconnected */ - DISCONNECTED, - /** State while disconnecting */ - DISCONNECTING, - /** State when connected */ - CONNECTED, - /** State while connecting */ - CONNECTING; -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceChannelOutputType.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceChannelOutputType.java deleted file mode 100644 index 7e53f81f96..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceChannelOutputType.java +++ /dev/null @@ -1,74 +0,0 @@ -/********************************************************************** - * 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: - * Jonathan Rajotte - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * Trace domain type enumeration. - * - * @author Jonathan Rajotte - */ -public enum TraceChannelOutputType { - /** Channel output type : splice */ - SPLICE("splice()", "SPLICE" ), //$NON-NLS-1$ //$NON-NLS-2$ - /** Channel output type : mmap */ - MMAP("mmap()", "MMAP"), //$NON-NLS-1$ //$NON-NLS-2$ - /** Channel output type : unknown */ - UNKNOWN("unknown", "unknown"); //$NON-NLS-1$ //$NON-NLS-2$ - - private final String fInName; - private final String fInMiName; - - private TraceChannelOutputType(String name, String miName) { - fInName = name; - fInMiName = miName; - } - - /** - * Get the type's name - * - * @return The type's name - */ - public String getInName() { - return fInName; - } - - /** - * Get the type's name - * - * @return The type's name - */ - public String getInMiName() { - return fInMiName; - } - - /** - * Return the corresponding {@link TraceChannelOutputType} of string miName - * - * @param name - * name of the Trace domain type to look for - * @return the corresponding {@link TraceChannelOutputType} - */ - public static TraceChannelOutputType valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (TraceChannelOutputType tdType : TraceChannelOutputType.values()) { - boolean isEqual = tdType.getInName().equalsIgnoreCase(name) || tdType.getInMiName().equalsIgnoreCase(name); - if (isEqual) { - return tdType; - } - } - // Unknown domain - return UNKNOWN; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java deleted file mode 100644 index de52919b66..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java +++ /dev/null @@ -1,64 +0,0 @@ -/********************************************************************** - * 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: - * Jonathan Rajotte - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * Trace domain type enumeration. - * - * @author Jonathan Rajotte - */ -public enum TraceDomainType { - /** Domain type : ust */ - UST("ust"), //$NON-NLS-1$ - /** Domain type : kernel */ - KERNEL("kernel"), //$NON-NLS-1$ - /** Domain type : jul */ - JUL("jul"), //$NON-NLS-1$ - /** Unknown domain type */ - UNKNOWN("Unknown domain type"); //$NON-NLS-1$ - - private final String fInName; - - private TraceDomainType(String name) { - fInName = name; - } - - /** - * Get the type's name - * - * @return The type's name - */ - public String getInName() { - return fInName; - } - - /** - * Return the corresponding {@link TraceDomainType} of string miName - * - * @param miName - * name of the Trace domain type to look for - * @return the corresponding {@link TraceDomainType} - */ - public static TraceDomainType valueOfString(String miName) { - if (miName == null) { - throw new IllegalArgumentException(); - } - for (TraceDomainType tdType : TraceDomainType.values()) { - if (tdType.getInName().equalsIgnoreCase(miName)) { - return tdType; - } - } - // Unknown domain - return UNKNOWN; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEnablement.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEnablement.java deleted file mode 100644 index a9583e3f29..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEnablement.java +++ /dev/null @@ -1,91 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Jonathan Rajotte - Machine interface support and utility function - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.security.InvalidParameterException; - -/** - * Enumeration for enabled/disabled states. - * - * @author Bernd Hufmann - */ -public enum TraceEnablement { - - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** Tracing is disabled */ - DISABLED("disabled", "false"), //$NON-NLS-1$ //$NON-NLS-2$ - /** Tracing is enabled */ - ENABLED("enabled", "true"); //$NON-NLS-1$ //$NON-NLS-2$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum - */ - private final String fInName; - private final String fInMiName; - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private TraceEnablement(String name, String miName) { - fInName = name; - fInMiName = miName; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return state name - */ - public String getInName() { - return fInName; - } - - /** - * @return state name - */ - public String getInMiName() { - return fInMiName; - } - - /** - * @param name - * name of the desired enum - * @return the corresponding {@link TraceEnablement} matching name - */ - public static TraceEnablement valueOfString(String name) { - if (name == null) { - throw new InvalidParameterException(); - } - for (TraceEnablement enablementType : TraceEnablement.values()) { - boolean exist = enablementType.fInName.equalsIgnoreCase(name) || enablementType.fInMiName.equalsIgnoreCase(name); - if (exist) { - return enablementType; - } - } - return DISABLED; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEventType.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEventType.java deleted file mode 100644 index f77e9201f4..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEventType.java +++ /dev/null @@ -1,65 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * Trace event type enumeration. - * - * @author Bernd Hufmann - */ -public enum TraceEventType { - /** Event type: tracepoint */ - TRACEPOINT("tracepoint"), //$NON-NLS-1$ - /** Event type: syscall */ - SYSCALL("syscall"), //$NON-NLS-1$ - /** Event type: probe */ - PROBE("probe"), //$NON-NLS-1$ - /** Event type: function */ - FUNCTION("function"), //$NON-NLS-1$ - /** Event type unknown */ - UNKNOWN("unknown"); //$NON-NLS-1$ - - private final String fInName; - - private TraceEventType(String name) { - fInName = name; - } - - /** - * Get the type's name - * - * @return The type's name - */ - public String getInName() { - return fInName; - } - - /** - * Return the corresponding {@link TraceEventType} of string miName - * - * @param name - * name of the {@link TraceEventType} to look for - * @return the corresponding {@link TraceEventType} - */ - public static TraceEventType valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (TraceEventType teType : TraceEventType.values()) { - if (teType.getInName().equalsIgnoreCase(name)) { - return teType; - } - } - return UNKNOWN; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceLogLevel.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceLogLevel.java deleted file mode 100644 index 465312d84a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceLogLevel.java +++ /dev/null @@ -1,114 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Jonathan Rajotte - Utility function - *********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - - -/** - * Log Level enumeration. - * - * @author Bernd Hufmann - */ -@SuppressWarnings("nls") -public enum TraceLogLevel { - - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** Log level 0 */ - TRACE_EMERG("TRACE_EMERG"), - /** Log level 1 */ - TRACE_ALERT("TRACE_ALERT"), - /** Log level 2 */ - TRACE_CRIT("TRACE_CRIT"), - /** Log level 3 */ - TRACE_ERR("TRACE_ERR"), - /** Log level 4 */ - TRACE_WARNING("TRACE_WARNING"), - /** Log level 5 */ - TRACE_NOTICE("TRACE_NOTICE"), - /** Log level 6 */ - TRACE_INFO("TRACE_INFO"), - /** Log level 7 */ - TRACE_DEBUG_SYSTEM("TRACE_DEBUG_SYSTEM"), - /** Log level 8 */ - TRACE_DEBUG_PROGRAM("TRACE_DEBUG_PROGRAM"), - /** Log level 9 */ - TRACE_DEBUG_PROCESS("TRACE_DEBUG_PROCESS"), - /** Log level 10 */ - TRACE_DEBUG_MODULE("TRACE_DEBUG_MODULE"), - /** Log level 11 */ - TRACE_DEBUG_UNIT("TRACE_DEBUG_UNIT"), - /** Log level 12 */ - TRACE_DEBUG_FUNCTION("TRACE_DEBUG_FUNCTION"), - /** Log level 13 */ - TRACE_DEBUG_LINE("TRACE_DEBUG_LINE"), - /** Log level 14 */ - TRACE_DEBUG("TRACE_DEBUG"), - /** Log level 15 */ - LEVEL_UNKNOWN("LEVEL_UNKNOWN"); - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum. - */ - private final String fInName; - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private TraceLogLevel(String name) { - fInName = name; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return state name - */ - public String getInName() { - return fInName; - } - - // ------------------------------------------------------------------------ - // Utility - // ------------------------------------------------------------------------ - /** - * Return the corresponding {@link TraceLogLevel} to String "name" - * - * @param name - * String to compare to retrieve the good {@link TraceLogLevel} - * @return the corresponding {@link TraceLogLevel} - */ - public static TraceLogLevel valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (TraceLogLevel tllevel : TraceLogLevel.values()) { - if (tllevel.getInName().equalsIgnoreCase(name)) { - return tllevel; - } - } - // No match - return LEVEL_UNKNOWN; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceSessionState.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceSessionState.java deleted file mode 100644 index 4473a11d67..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceSessionState.java +++ /dev/null @@ -1,96 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Jonathan Rajotte - machine interface support and utility function - *********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * Session state enumeration. - * - * @author Bernd Hufmann - */ -public enum TraceSessionState { - - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** Trace session inactive */ - INACTIVE("inactive", "false"), //$NON-NLS-1$ //$NON-NLS-2$ - /** Trace session active */ - ACTIVE("active", "true"); //$NON-NLS-1$ //$NON-NLS-2$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum. - */ - private final String fInName; - private final String fMiName; - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private TraceSessionState(String name, String miName) { - fInName = name; - fMiName = miName; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return state name - */ - public String getInName() { - return fInName; - } - - /** - * @return the machine interface name - */ - public String getfMiName() { - return fMiName; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * Return the corresponding {@link TraceSessionState} to String "name" - * - * @param name - * String to compare to retrieve the good - * {@link TraceSessionState} - * @return the corresponding {@link TraceSessionState} - */ - public static TraceSessionState valueOfString(String name) { - if (name == null) { - return INACTIVE; - } - for (TraceSessionState tst : TraceSessionState.values()) { - boolean isEqual = tst.fInName.equalsIgnoreCase(name) || tst.fMiName.equalsIgnoreCase(name); - if (isEqual) { - return tst; - } - } - // No match - return INACTIVE; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BaseEventInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BaseEventInfo.java deleted file mode 100644 index 217891138c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BaseEventInfo.java +++ /dev/null @@ -1,223 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; - -/** -*

-* Implementation of the basic trace event interface (IEventInfo) to store event -* related data. -*

-* -* @author Bernd Hufmann -*/ -public class BaseEventInfo extends TraceInfo implements IBaseEventInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The trace event type. - */ - private TraceEventType fEventType = TraceEventType.UNKNOWN; - /** - * The trace log level. - */ - private TraceLogLevel fLogLevel = TraceLogLevel.TRACE_DEBUG; - /** - * The Event fields - */ - private final List fFields = new ArrayList<>(); - /** - * The filter expression. - */ - private String fFilterExpression; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of base event - */ - public BaseEventInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public BaseEventInfo(BaseEventInfo other) { - super(other); - fEventType = other.fEventType; - fLogLevel = other.fLogLevel; - for (Iterator iterator = other.fFields.iterator(); iterator.hasNext();) { - IFieldInfo field = iterator.next(); - if (field instanceof FieldInfo) { - fFields.add(new FieldInfo((FieldInfo)field)); - } else { - fFields.add(field); - } - } - fFilterExpression = other.fFilterExpression; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public TraceEventType getEventType() { - return fEventType; - } - - @Override - public void setEventType(TraceEventType type) { - fEventType = type; - } - - @Override - public void setEventType(String typeName) { - if(TraceEventType.TRACEPOINT.getInName().equalsIgnoreCase(typeName)) { - fEventType = TraceEventType.TRACEPOINT; - } else if(TraceEventType.SYSCALL.getInName().equalsIgnoreCase(typeName)) { - fEventType = TraceEventType.SYSCALL; - } else if (TraceEventType.PROBE.getInName().equalsIgnoreCase(typeName)) { - fEventType = TraceEventType.PROBE; - } else if (TraceEventType.FUNCTION.getInName().equalsIgnoreCase(typeName)) { - fEventType = TraceEventType.FUNCTION; - } else { - fEventType = TraceEventType.UNKNOWN; - } - } - - @Override - public TraceLogLevel getLogLevel() { - return fLogLevel; - } - - @Override - public void setLogLevel(TraceLogLevel level) { - fLogLevel = level; - } - - @Override - public void setLogLevel(String levelName) { - fLogLevel = TraceLogLevel.valueOfString(levelName); - } - - @Override - public IFieldInfo[] getFields() { - return fFields.toArray(new IFieldInfo[fFields.size()]); - } - - @Override - public void addField(IFieldInfo field) { - fFields.add(field); - } - - @Override - public void setFields(List fields) { - fFields.clear(); - for (Iterator iterator = fields.iterator(); iterator.hasNext();) { - IFieldInfo fieldInfo = iterator.next(); - fFields.add(fieldInfo); - } - } - - @Override - public String getFilterExpression() { - return fFilterExpression; - } - - @Override - public void setFilterExpression(String filter) { - fFilterExpression = filter; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((fEventType == null) ? 0 : fEventType.hashCode()); - result = prime * result + fFields.hashCode(); - result = prime * result + ((fFilterExpression == null) ? 0 : fFilterExpression.hashCode()); - result = prime * result + ((fLogLevel == null) ? 0 : fLogLevel.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - BaseEventInfo other = (BaseEventInfo) obj; - if (fEventType != other.fEventType) { - return false; - } - if (!fFields.equals(other.fFields)) { - return false; - } - if (fFilterExpression == null) { - if (other.fFilterExpression != null) { - return false; - } - } else if (!fFilterExpression.equals(other.fFilterExpression)) { - return false; - } - if (fLogLevel != other.fLogLevel) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[BaseEventInfo("); - output.append(super.toString()); - output.append(",type="); - output.append(fEventType); - output.append(",level="); - output.append(fLogLevel); - if (!fFields.isEmpty()) { - output.append(",Fields="); - for (Iterator iterator = fFields.iterator(); iterator.hasNext();) { - IFieldInfo field = iterator.next(); - output.append(field.toString()); - } - } - if (fFilterExpression != null) { - output.append(",Filter="); - output.append(fFilterExpression); - } - output.append(")]"); - return output.toString(); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BufferType.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BufferType.java deleted file mode 100644 index 6f67292274..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BufferType.java +++ /dev/null @@ -1,116 +0,0 @@ -/********************************************************************** - * 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: - * Simon Delisle - Initial API and implementation - * Bernd Hufmann - Updated to enum definition - * Jonathan Rajotte - Updated enum definition for lttng machine interface - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -/** - * Constants for buffer type. - * - * @author Simon Delisle - * @author Bernd Hufmann - */ - -public enum BufferType { - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** - * Buffer type : per UID - */ - BUFFER_PER_UID("per UID", "PER_UID"), //$NON-NLS-1$ //$NON-NLS-2$ - /** - * Buffer type : per PID - */ - BUFFER_PER_PID("per PID", "PER_PID"), //$NON-NLS-1$ //$NON-NLS-2$ - /** - * Buffer type : shared - */ - BUFFER_SHARED("shared"), //$NON-NLS-1$ - /** - * If the LTTng version doesn't show the buffer type - */ - BUFFER_TYPE_UNKNOWN("information not unavailable"); //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum - */ - private final String fInName; - - /** - * Name of the machine interface enum - */ - private final String fInMiName; - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private BufferType(String name, String miName) { - fInName = name; - fInMiName = miName; - } - - private BufferType(String name) { - fInName = name; - fInMiName = ""; //$NON-NLS-1$ - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return state name - */ - public String getInName() { - return fInName; - } - - /** - * @return machine interface buffer name - */ - public String getInMiName() { - return fInMiName; - } - - // / - // ------------------------------------------------------------------------ - // Utility function - // ------------------------------------------------------------------------- - /** - * @param name - * the string representation of the type - * @return enum BufferType of the corresponding type - */ - public static BufferType valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (BufferType bufferType : BufferType.values()) { - boolean isEqual = bufferType.getInName().equalsIgnoreCase(name) || bufferType.getInMiName().equalsIgnoreCase(name); - if (isEqual) { - return bufferType; - } - } - return BUFFER_TYPE_UNKNOWN; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ChannelInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ChannelInfo.java deleted file mode 100644 index 6e2f626992..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ChannelInfo.java +++ /dev/null @@ -1,353 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Simon Delisle - Updated for support of LTTng Tools 2.2 - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; - -/** - * Implementation of the trace channel interface (IChannelInfo) to store channel - * related data. - * - * @author Bernd Hufmann - */ -public class ChannelInfo extends TraceInfo implements IChannelInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The overwrite mode of the channel. - */ - private boolean fOverwriteMode; - /** - * The sub-buffer size of the channel. - */ - private long fSubBufferSize; - /** - * The number of sub-buffers of the channel. - */ - private int fNumberOfSubBuffers; - /** - * The switch timer interval of the channel. - */ - private long fSwitchTimer; - /** - * The read timer interval of the channel. - */ - private long fReadTimer; - /** - * The Output type of the channel. - */ - private TraceChannelOutputType fOutputType = TraceChannelOutputType.UNKNOWN; - /** - * The channel enable state. - */ - private TraceEnablement fState = TraceEnablement.DISABLED; - /** - * The events information of the channel. - */ - private final List fEvents = new ArrayList<>(); - /** - * The maximum size of trace files - */ - private int fMaxSizeTraceFiles; - /** - * The maximum number of trace files - */ - private int fMaxNumberTraceFiles; - /** - * The value of buffer type - */ - private BufferType fBufferType = BufferType.BUFFER_TYPE_UNKNOWN; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * - * @param name - * - name channel - */ - public ChannelInfo(String name) { - super(name); - } - - /** - * Copy constructor - * - * @param other - * - the instance to copy - */ - public ChannelInfo(ChannelInfo other) { - super(other); - fOverwriteMode = other.fOverwriteMode; - fSubBufferSize = other.fSubBufferSize; - fNumberOfSubBuffers = other.fNumberOfSubBuffers; - fSwitchTimer = other.fSwitchTimer; - fReadTimer = other.fReadTimer; - fMaxSizeTraceFiles = other.fMaxSizeTraceFiles; - fMaxNumberTraceFiles = other.fMaxNumberTraceFiles; - fBufferType = other.fBufferType; - fOutputType = (other.fOutputType == null ? null : other.fOutputType); - fState = other.fState; - for (Iterator iterator = other.fEvents.iterator(); iterator.hasNext();) { - IEventInfo event = iterator.next(); - if (event instanceof EventInfo) { - fEvents.add(new EventInfo((EventInfo) event)); - } else { - fEvents.add(event); - } - } - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public boolean isOverwriteMode() { - return fOverwriteMode; - } - - @Override - public void setOverwriteMode(boolean mode) { - fOverwriteMode = mode; - } - - @Override - public long getSubBufferSize() { - return fSubBufferSize; - } - - @Override - public void setSubBufferSize(long bufferSize) { - fSubBufferSize = bufferSize; - } - - @Override - public int getNumberOfSubBuffers() { - return fNumberOfSubBuffers; - } - - @Override - public void setNumberOfSubBuffers(int numberOfSubBuffers) { - fNumberOfSubBuffers = numberOfSubBuffers; - } - - @Override - public long getSwitchTimer() { - return fSwitchTimer; - } - - @Override - public void setSwitchTimer(long timer) { - fSwitchTimer = timer; - } - - @Override - public long getReadTimer() { - return fReadTimer; - } - - @Override - public void setReadTimer(long timer) { - fReadTimer = timer; - } - - @Override - public TraceChannelOutputType getOutputType() { - return fOutputType; - } - - @Override - public void setOutputType(String type) { - fOutputType = TraceChannelOutputType.valueOfString(type); - } - - @Override - public void setOutputType(TraceChannelOutputType type) { - fOutputType = type; - } - - @Override - public TraceEnablement getState() { - return fState; - } - - @Override - public void setState(TraceEnablement state) { - fState = state; - } - - @Override - public void setState(String stateName) { - fState = TraceEnablement.valueOfString(stateName); - } - - @Override - public IEventInfo[] getEvents() { - return fEvents.toArray(new IEventInfo[fEvents.size()]); - } - - @Override - public void setEvents(List events) { - fEvents.clear(); - for (Iterator iterator = events.iterator(); iterator.hasNext();) { - IEventInfo eventInfo = iterator.next(); - fEvents.add(eventInfo); - } - } - - @Override - public void addEvent(IEventInfo channel) { - fEvents.add(channel); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + fEvents.hashCode(); - result = prime * result + fNumberOfSubBuffers; - result = prime * result + ((fOutputType == null) ? 0 : fOutputType.hashCode()); - result = prime * result + (fOverwriteMode ? 1231 : 1237); - result = prime * result + (int) (fReadTimer ^ (fReadTimer >>> 32)); - result = prime * result + ((fState == null) ? 0 : (fState.ordinal() + 1)); - result = prime * result + (int) (fSubBufferSize ^ (fSubBufferSize >>> 32)); - result = prime * result + (int) (fSwitchTimer ^ (fSwitchTimer >>> 32)); - result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1)); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ChannelInfo other = (ChannelInfo) obj; - if (!fEvents.equals(other.fEvents)) { - return false; - } - if (fNumberOfSubBuffers != other.fNumberOfSubBuffers) { - return false; - } - if (fOutputType == null) { - if (other.fOutputType != null) { - return false; - } - } else if (!fOutputType.equals(other.fOutputType)) { - return false; - } - if (fOverwriteMode != other.fOverwriteMode) { - return false; - } - if (fReadTimer != other.fReadTimer) { - return false; - } - if (fState != other.fState) { - return false; - } - if (fSubBufferSize != other.fSubBufferSize) { - return false; - } - if (fSwitchTimer != other.fSwitchTimer) { - return false; - } - if (fBufferType != other.fBufferType) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[ChannelInfo("); - output.append(super.toString()); - output.append(",State="); - output.append(fState); - output.append(",OverwriteMode="); - output.append(fOverwriteMode); - output.append(",SubBuffersSize="); - output.append(fSubBufferSize); - output.append(",NumberOfSubBuffers="); - output.append(fNumberOfSubBuffers); - output.append(",SwitchTimer="); - output.append(fSwitchTimer); - output.append(",ReadTimer="); - output.append(fReadTimer); - output.append(",output="); - output.append(fOutputType.getInName()); - if ((fBufferType != null) && !fBufferType.equals(BufferType.BUFFER_TYPE_UNKNOWN) && !fBufferType.equals(BufferType.BUFFER_SHARED)) { - output.append(",BufferType="); - output.append(fBufferType); - } - output.append(",Events="); - if (fEvents.isEmpty()) { - output.append("None"); - } else { - for (Iterator iterator = fEvents.iterator(); iterator.hasNext();) { - IEventInfo event = iterator.next(); - output.append(event.toString()); - } - } - output.append(")]"); - return output.toString(); - } - - @Override - public void setMaxSizeTraceFiles(int maxSizeTraceFiles) { - fMaxSizeTraceFiles = maxSizeTraceFiles; - } - - @Override - public void setMaxNumberTraceFiles(int maxNumberTraceFiles) { - fMaxNumberTraceFiles = maxNumberTraceFiles; - } - - @Override - public int getMaxSizeTraceFiles() { - return fMaxSizeTraceFiles; - } - - @Override - public int getMaxNumberTraceFiles() { - return fMaxNumberTraceFiles; - } - - @Override - public void setBufferType(BufferType bufferType) { - fBufferType = bufferType; - } - - @Override - public BufferType getBufferType() { - return fBufferType; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/DomainInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/DomainInfo.java deleted file mode 100644 index c378e125f0..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/DomainInfo.java +++ /dev/null @@ -1,173 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; - -/** - *

- * Implementation of the trace domain interface (IDomainInfo) to store domain - * related data. - *

- * - * @author Bernd Hufmann - */ -public class DomainInfo extends TraceInfo implements IDomainInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The channels information of the domain. - */ - private final List fChannels = new ArrayList<>(); - private boolean fIsKernel = false; - private BufferType fBufferType = BufferType.BUFFER_TYPE_UNKNOWN; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of domain - */ - public DomainInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public DomainInfo(DomainInfo other) { - super(other); - for (int i = 0; i < other.fChannels.size(); i++) { - if (other.fChannels.get(i) instanceof ChannelInfo) { - fChannels.add(new ChannelInfo((ChannelInfo)other.fChannels.get(i))); - } else { - fChannels.add(other.fChannels.get(i)); - } - } - fIsKernel = other.fIsKernel; - fBufferType = other.fBufferType; - } - - @Override - public boolean isKernel() { - return fIsKernel; - } - - @Override - public void setIsKernel(boolean isKernel) { - fIsKernel = isKernel; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public IChannelInfo[] getChannels() { - return fChannels.toArray(new IChannelInfo[fChannels.size()]); - } - - @Override - public void setChannels(List channels) { - fChannels.clear(); - for (Iterator iterator = channels.iterator(); iterator.hasNext();) { - IChannelInfo channelInfo = iterator.next(); - fChannels.add(channelInfo); - } - } - - @Override - public void addChannel(IChannelInfo channel) { - fChannels.add(channel); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + fChannels.hashCode(); - result = prime * result + (fIsKernel ? 1231 : 1237); - result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1)); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - DomainInfo other = (DomainInfo) obj; - if (!fChannels.equals(other.fChannels)) { - return false; - } - if (fIsKernel != other.fIsKernel) { - return false; - } - if (fBufferType != other.fBufferType) { - return false; - } - return true; - } - - @Override - public BufferType getBufferType() { - if (fIsKernel) { - return BufferType.BUFFER_SHARED; - } - return fBufferType; - } - - @Override - public void setBufferType(BufferType bufferType) { - fBufferType = bufferType; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[DomainInfo("); - output.append(super.toString()); - output.append(",Channels="); - if (fChannels.isEmpty()) { - output.append("None"); - } else { - for (Iterator iterator = fChannels.iterator(); iterator.hasNext();) { - IChannelInfo channel = iterator.next(); - output.append(channel.toString()); - } - } - output.append(",isKernel="); - output.append(String.valueOf(fIsKernel)); - if ((fBufferType != null) && !fBufferType.equals(BufferType.BUFFER_TYPE_UNKNOWN) && !fBufferType.equals(BufferType.BUFFER_SHARED)) { - output.append(",BufferType="); - output.append(fBufferType); - } - output.append(")]"); - return output.toString(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/EventInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/EventInfo.java deleted file mode 100644 index 1de851095f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/EventInfo.java +++ /dev/null @@ -1,139 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; - -/** -*

-* Implementation of the trace event interface (IEventInfo) to store event -* related data. -*

-* -* @author Bernd Hufmann -*/ -public class EventInfo extends BaseEventInfo implements IEventInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The enable state of the event. - */ - private TraceEnablement fState = TraceEnablement.DISABLED; - /** - * The log level type. - */ - private LogLevelType fLogLevelType = LogLevelType.LOGLEVEL_NONE; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of event - */ - public EventInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public EventInfo(EventInfo other) { - super(other); - fState = other.fState; - fLogLevelType = other.fLogLevelType; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public TraceEnablement getState() { - return fState; - } - - @Override - public void setState(TraceEnablement state) { - fState = state; - } - - @Override - public void setState(String stateName) { - fState = TraceEnablement.valueOfString(stateName); - } - - @Override - public LogLevelType getLogLevelType() { - return fLogLevelType; - } - - @Override - public void setLogLevelType(LogLevelType type) { - fLogLevelType = type; - } - - @Override - public void setLogLevelType(String shortName) { - fLogLevelType = LogLevelType.valueOfString(shortName); - } - - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((fState == null) ? 0 : (fState.ordinal() + 1)); - result = prime * result + ((fLogLevelType == null) ? 0 : fLogLevelType.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - EventInfo other = (EventInfo) obj; - if (fState != other.fState) { - return false; - } - if (fLogLevelType != other.fLogLevelType) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[EventInfo("); - output.append(super.toString()); - output.append(",State="); - output.append(fState); - output.append(",levelType="); - output.append(fLogLevelType); - output.append(")]"); - return output.toString(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/FieldInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/FieldInfo.java deleted file mode 100644 index 0ad2ceb42a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/FieldInfo.java +++ /dev/null @@ -1,109 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; - -/** -*

-* Implementation of the basic trace event interface (IEventInfo) to store event -* related data. -*

-* -* @author Bernd Hufmann -*/ -public class FieldInfo extends TraceInfo implements IFieldInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The trace event type. - */ - private String fFieldType; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of base event - */ - public FieldInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public FieldInfo(FieldInfo other) { - super(other); - fFieldType = other.fFieldType; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getFieldType() { - return fFieldType; - } - - @Override - public void setFieldType(String fieldType) { - fFieldType = fieldType.toLowerCase(); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result - + ((fFieldType == null) ? 0 : fFieldType.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - FieldInfo other = (FieldInfo) obj; - if (fFieldType == null) { - if (other.fFieldType != null) { - return false; - } - } else if (!fFieldType.equals(other.fFieldType)) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[FieldInfo("); - output.append(super.toString()); - output.append(",type="); - output.append(fFieldType); - return output.toString(); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java deleted file mode 100644 index 69068ee8c9..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java +++ /dev/null @@ -1,187 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; - -/** - * Implementation of the trace event interface (IProbeEventInfo) to store probe - * event related data. - * - * @author Bernd Hufmann - */ -public class ProbeEventInfo extends EventInfo implements IProbeEventInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The dynamic probe address (null if symbol is used). - */ - private String fAddress; - /** - * The dynamic probe offset (if symbol is used). - */ - private String fOffset; - - /** - * The symbol name (null if address is used) - */ - private String fSymbol; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * - * @param name - * - name of event - */ - public ProbeEventInfo(String name) { - super(name); - } - - /** - * Copy constructor - * - * @param other - * - the instance to copy - */ - public ProbeEventInfo(ProbeEventInfo other) { - super(other); - fAddress = other.fAddress; - fOffset = other.fOffset; - fSymbol = other.fSymbol; - } - - /** - * Constructor from a {@link IEventInfo} - * - * @param eventInfo - * - the instance to copy - */ - public ProbeEventInfo(IEventInfo eventInfo) { - super(eventInfo.getName()); - setState(eventInfo.getState()); - setLogLevelType(eventInfo.getLogLevelType()); - setLogLevel(eventInfo.getLogLevel()); - setFilterExpression(eventInfo.getFilterExpression()); - setEventType(eventInfo.getEventType()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getAddress() { - return fAddress; - } - - @Override - public void setAddress(String address) { - fAddress = address; - } - - @Override - public String getOffset() { - return fOffset; - } - - @Override - public void setOffset(String offset) { - fOffset = offset; - } - - @Override - public String getSymbol() { - return fSymbol; - } - - @Override - public void setSymbol(String symbol) { - fSymbol = symbol; - } - - // ------------------------------------------------------------------------ - // Operation - // ------------------------------------------------------------------------ - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((fAddress == null) ? 0 : fAddress.hashCode()); - result = prime * result + ((fOffset == null) ? 0 : fOffset.hashCode()); - result = prime * result + ((fSymbol == null) ? 0 : fSymbol.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ProbeEventInfo other = (ProbeEventInfo) obj; - if (fAddress == null) { - if (other.fAddress != null) { - return false; - } - } else if (!fAddress.equals(other.fAddress)) { - return false; - } - if (fOffset == null) { - if (other.fOffset != null) { - return false; - } - } else if (!fOffset.equals(other.fOffset)) { - return false; - } - if (fSymbol == null) { - if (other.fSymbol != null) { - return false; - } - } else if (!fSymbol.equals(other.fSymbol)) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[ProbeEventInfo("); - output.append(super.toString()); - if (fAddress != null) { - output.append(",fAddress="); - output.append(fAddress); - } else { - output.append(",fOffset="); - output.append(fOffset); - output.append(",fSymbol="); - output.append(fSymbol); - } - output.append(")]"); - return output.toString(); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SessionInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SessionInfo.java deleted file mode 100644 index 9f2789357c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SessionInfo.java +++ /dev/null @@ -1,333 +0,0 @@ -/********************************************************************** - - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Marc-Andre Laperle - Support for creating a live session - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; - -/** - * Implementation of the trace session interface (ISessionInfo) to store session - * related data. - * - * @author Bernd Hufmann - */ -public class SessionInfo extends TraceInfo implements ISessionInfo { - - /** - * The default network URL when creating a live session. - */ - public static final String DEFAULT_LIVE_NETWORK_URK = "net://127.0.0.1"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The trace session state. - */ - private TraceSessionState fState = TraceSessionState.INACTIVE; - /** - * The trace session path for storing traces. - */ - private String fSessionPath = ""; //$NON-NLS-1$ - /** - * The domains information of this session. - */ - private final List fDomains = new ArrayList<>(); - /** - * Flag to indicate whether trace is streamed over network or not. - */ - private boolean fIsStreamedTrace = false; - /** - * Flag to indicate whether the session is a snapshot session or not. - */ - private boolean fIsSnapshot = false; - /** - * The snapshot information of the session - */ - private ISnapshotInfo fSnapshotInfo = null; - /** - * The network URL for the session (-U) - */ - private String fNetworkUrl = null; - /** - * The control URL for the session (-C) - */ - private String fControlUrl = null; - /** - * The data URL for the session (-D) - */ - private String fDataUrl = null; - - /** - * Flag to indicate whether trace is live or not. - */ - private boolean fIsLive = false; - - /** - * The delay in micro seconds before the data is flushed and streamed. - */ - private int fLiveDelay = -1; - - /** - * The live connection url (Relayd). - */ - private String fLiveUrl; - - /** - * The live connection port (Relayd). - */ - private Integer fLivePort; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * - * @param name - * - name of base event - */ - public SessionInfo(String name) { - super(name); - } - - /** - * Copy constructor - * - * @param other - * - the instance to copy - */ - public SessionInfo(SessionInfo other) { - super(other); - fState = other.fState; - fSessionPath = other.fSessionPath; - fIsStreamedTrace = other.fIsStreamedTrace; - fIsSnapshot = other.fIsSnapshot; - fSnapshotInfo = other.fSnapshotInfo; - fNetworkUrl = other.fNetworkUrl; - fControlUrl = other.fControlUrl; - fDataUrl = other.fDataUrl; - - for (Iterator iterator = other.fDomains.iterator(); iterator.hasNext();) { - IDomainInfo domain = iterator.next(); - if (domain instanceof DomainInfo) { - fDomains.add(new DomainInfo((DomainInfo) domain)); - } else { - fDomains.add(domain); - } - } - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public TraceSessionState getSessionState() { - return fState; - } - - @Override - public void setSessionState(TraceSessionState state) { - fState = state; - } - - @Override - public void setSessionState(String stateName) { - fState = TraceSessionState.valueOfString(stateName); - } - - @Override - public String getSessionPath() { - if (isSnapshotSession() && fSnapshotInfo != null) { - return fSnapshotInfo.getSnapshotPath(); - } - return fSessionPath; - } - - @Override - public void setSessionPath(String path) { - fSessionPath = path; - } - - @Override - public IDomainInfo[] getDomains() { - return fDomains.toArray(new IDomainInfo[fDomains.size()]); - } - - @Override - public void setDomains(List domains) { - fDomains.clear(); - for (Iterator iterator = domains.iterator(); iterator.hasNext();) { - IDomainInfo domainInfo = iterator.next(); - fDomains.add(domainInfo); - } - } - - @Override - public boolean isStreamedTrace() { - if (isSnapshotSession() && getSnapshotInfo() != null) { - return getSnapshotInfo().isStreamedSnapshot(); - } - return fIsStreamedTrace; - } - - @Override - public void setStreamedTrace(boolean isStreamedTrace) { - fIsStreamedTrace = isStreamedTrace; - } - - @Override - public boolean isSnapshotSession() { - return fIsSnapshot || fSnapshotInfo != null; - } - - @Override - public void setSnapshot(boolean isSnapshot) { - fIsSnapshot = isSnapshot; - } - - @Override - public ISnapshotInfo getSnapshotInfo() { - return fSnapshotInfo; - } - - @Override - public void setSnapshotInfo(ISnapshotInfo info) { - fSnapshotInfo = info; - } - - @Override - public boolean isLive() { - return fIsLive; - } - - @Override - public void setLive(boolean isLive) { - fIsLive = isLive; - } - - @Override - public int getLiveDelay() { - return fLiveDelay; - } - - @Override - public void setLiveDelay(int liveDelay) { - fLiveDelay = liveDelay; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void addDomain(IDomainInfo domainInfo) { - fDomains.add(domainInfo); - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[SessionInfo("); - output.append(super.toString()); - output.append(",Path="); - output.append(getSessionPath()); - output.append(",State="); - output.append(fState); - output.append(",isStreamedTrace="); - output.append(fIsStreamedTrace); - output.append(",isSnapshot="); - output.append(fIsSnapshot); - - if (fSnapshotInfo != null) { - output.append(",snapshotInfo="); - output.append(fSnapshotInfo.toString()); - } - output.append(",Domains="); - for (Iterator iterator = fDomains.iterator(); iterator.hasNext();) { - IDomainInfo domain = iterator.next(); - output.append(domain.toString()); - } - - output.append(",NetworkUrl="); - output.append(getNetworkUrl()); - output.append(",ControlUrl="); - output.append(getControlUrl()); - output.append(",DataUrl="); - output.append(getDataUrl()); - - output.append(")]"); - return output.toString(); - } - - @Override - public String getNetworkUrl() { - return fNetworkUrl; - } - - @Override - public void setNetworkUrl(String networkUrl) { - fNetworkUrl = networkUrl; - } - - @Override - public String getControlUrl() { - return fControlUrl; - } - - @Override - public void setControlUrl(String controlUrl) { - fControlUrl = controlUrl; - } - - @Override - public void setDataUrl(String datalUrl) { - fDataUrl = datalUrl; - } - - @Override - public String getDataUrl() { - return fDataUrl; - } - - @Override - public void setLiveUrl(String liveUrl) { - fLiveUrl = liveUrl; - } - - @Override - public void setLivePort(Integer livePort) { - fLivePort = livePort; - } - - @Override - public String getLiveUrl() { - return fLiveUrl; - } - - @Override - public Integer getLivePort() { - return fLivePort; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SnapshotInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SnapshotInfo.java deleted file mode 100644 index f7aa791e0e..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SnapshotInfo.java +++ /dev/null @@ -1,150 +0,0 @@ -/********************************************************************** - * Copyright (c) 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; - -/** - *

- * Implementation of the snapshot interface (ISnapshotInfo) to store snapshot - * related data. - *

- * - * @author Bernd Hufmann - */ -public class SnapshotInfo extends TraceInfo implements ISnapshotInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** The snapshot path for storing traces. */ - private String fPath = ""; //$NON-NLS-1$ - /** The snapshot ID */ - private int fId = -1; - /** Flag whether snapshot is stored over the network or locally */ - private boolean fIsStreamed = false; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of base event - */ - public SnapshotInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public SnapshotInfo(SnapshotInfo other) { - super(other); - fPath = other.fPath; - fId = other.fId; - fIsStreamed = other.fIsStreamed; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getSnapshotPath() { - return fPath; - } - - @Override - public void setSnapshotPath(String path) { - fPath = path; - } - - @Override - public int getId() { - return fId; - } - - @Override - public void setId(int id) { - fId = id; - } - - @Override - public void setStreamedSnapshot(boolean isStreamed) { - fIsStreamed = isStreamed; - } - - @Override - public boolean isStreamedSnapshot() { - return fIsStreamed; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + fId; - result = prime * result + (fIsStreamed ? 1231 : 1237); - result = prime * result + ((fPath == null) ? 0 : fPath.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - SnapshotInfo other = (SnapshotInfo) obj; - if (fId != other.fId) { - return false; - } - if (fIsStreamed != other.fIsStreamed) { - return false; - } - if (fPath == null) { - if (other.fPath != null) { - return false; - } - } else if (!fPath.equals(other.fPath)) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[SnapshotInfo("); - output.append(super.toString()); - output.append(",snapshotPath="); - output.append(fPath); - output.append(",ID="); - output.append(fId); - output.append(",isStreamedSnapshot="); - output.append(fIsStreamed); - output.append(")]"); - return output.toString(); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/TraceInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/TraceInfo.java deleted file mode 100644 index 65ef13b41b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/TraceInfo.java +++ /dev/null @@ -1,113 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ITraceInfo; - -/** - *

- * Implementation of the base trace information interface (ITraceInfo) to - * store common data. - *

- * - * @author Bernd Hufmann - */ -public class TraceInfo implements ITraceInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The name of the element. - */ - private String fName = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of trace element - */ - public TraceInfo(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - fName = name; - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public TraceInfo(TraceInfo other) { - if (other == null) { - throw new IllegalArgumentException(); - } - fName = String.valueOf(other.fName); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getName() { - return fName; - } - - @Override - public void setName(String name) { - fName = name; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((fName == null) ? 0 : fName.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - TraceInfo other = (TraceInfo) obj; - if (fName == null) { - if (other.fName != null) { - return false; - } - } else if (!fName.equals(other.fName)) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[TraceInfo("); - output.append("Name="); - output.append(getName()); - output.append(")]"); - return output.toString(); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/UstProviderInfo.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/UstProviderInfo.java deleted file mode 100644 index 7f33c8a150..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/UstProviderInfo.java +++ /dev/null @@ -1,162 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; - -/** - *

- * Implementation of the Ust Provider interface (IUstProviderInfo) to store UST - * provider related data. - *

- * - * @author Bernd Hufmann - */ -public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The process ID of the UST provider. - */ - private int fPid = 0; - - /** - * List of event information. - */ - private final List fEvents = new ArrayList<>(); - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param name - name of UST provider - */ - public UstProviderInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public UstProviderInfo(UstProviderInfo other) { - super(other); - fPid = other.fPid; - for (Iterator iterator = other.fEvents.iterator(); iterator.hasNext();) { - IBaseEventInfo event = iterator.next(); - if (event instanceof BaseEventInfo) { - fEvents.add(new BaseEventInfo((BaseEventInfo)event)); - } else { - fEvents.add(event); - } - } - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public int getPid() { - return fPid; - } - - @Override - public void setPid(int pid) { - fPid = pid; - } - - @Override - public IBaseEventInfo[] getEvents() { - return fEvents.toArray(new IBaseEventInfo[fEvents.size()]); - } - - @Override - public void setEvents(List events) { - fEvents.clear(); - for (Iterator iterator = events.iterator(); iterator.hasNext();) { - IBaseEventInfo eventInfo = iterator.next(); - fEvents.add(eventInfo); - } - } - - @Override - public void addEvent(IBaseEventInfo event) { - fEvents.add(event); - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + fEvents.hashCode(); - result = prime * result + fPid; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - UstProviderInfo other = (UstProviderInfo) obj; - if (!fEvents.equals(other.fEvents)) { - return false; - } - if (fPid != other.fPid) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[EventInfo("); - output.append(super.toString()); - output.append(",PID="); - output.append(fPid); - output.append(",Events="); - if (fEvents.isEmpty()) { - output.append("None"); - } else { - for (Iterator iterator = fEvents.iterator(); iterator.hasNext();) { - IBaseEventInfo event = iterator.next(); - output.append(event.toString()); - } - } - output.append(")]"); - return output.toString(); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/ILttngRelaydConnector.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/ILttngRelaydConnector.java deleted file mode 100644 index 88f376b566..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/ILttngRelaydConnector.java +++ /dev/null @@ -1,119 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd; - -import java.io.IOException; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.TracePacketResponse; - -/** - * Connector for Lttng Relayd - * - * @author Matthew Khouzam - * @since 3.0 - */ -public interface ILttngRelaydConnector extends AutoCloseable { - - /** - * Gets a list of active Lttng sessions - * - * @return the session List (we need the get function) - * @throws IOException - * timeout and such - */ - List getSessions() throws IOException; - - /** - * Create a session - * - * @return create session response - * @throws IOException - * timeout and such - */ - CreateSessionResponse createSession() throws IOException; - - /** - * Attach the trace viewer to a Session - * - * @param lttngViewerSession - * viewer session - * @return An AttachSessionResponse - * @throws IOException - * timeout and such - */ - AttachSessionResponse attachToSession(SessionResponse lttngViewerSession) throws IOException; - - /** - * Get the metadata from the relayd - * - * @param attachedSession - * the attached session - * @return a chunk of TSDL metadata - * @throws IOException - * timeout and such - */ - String getMetadata(AttachSessionResponse attachedSession) throws IOException; - - /** - * Get the next index - * - * @param stream - * the stream - * @return the stream input packet entry - * @throws IOException - * timeout and such - */ - IndexResponse getNextIndex(StreamResponse stream) throws IOException; - - /** - * Get the next packet in a stream - * - * @param stream - * the stream response - * @return the packet response - * @throws IOException - * timeout and such - */ - TracePacketResponse getNextPacket(StreamResponse stream) throws IOException; - - /** - * Gets the packet from the stream - * - * @param index - * the index of the stream - * @param id - * the stream id - * @return the packet response - * @throws IOException - * timeout and such - */ - TracePacketResponse getPacketFromStream(IndexResponse index, long id) throws IOException; - - /** - * Gets the new streams - * - * @return a list of stream responses - * @throws IOException - * timeout and such - */ - Iterable getNewStreams() throws IOException; - - @Override - void close() throws IOException; -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/LttngRelaydConnectorFactory.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/LttngRelaydConnectorFactory.java deleted file mode 100644 index 298d662877..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/LttngRelaydConnectorFactory.java +++ /dev/null @@ -1,78 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.net.Socket; - -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl.LttngRelaydConnector_2_4; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl.LttngRelaydConnector_Unsupported; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.Command; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ConnectResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ConnectionType; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ViewerCommand; - -/** - * LTTng RelayD connector factory - * - * @author Matthew Khouzam - * @since 3.0 - */ -public final class LttngRelaydConnectorFactory { - - private LttngRelaydConnectorFactory() { - } - - /** - * Create a connection to a relayd - * - * @param myConnection - * a connection to the relayd - * - * @return A relayd connector - * @throws IOException - * caused by invalid sockets - */ - public static ILttngRelaydConnector getNewConnector(Socket myConnection) throws IOException { - DataOutputStream outNet = new DataOutputStream(myConnection.getOutputStream()); - DataInputStream inNet = new DataInputStream(myConnection.getInputStream()); - - ViewerCommand connectCommand = new ViewerCommand(Command.VIEWER_CONNECT, ConnectResponse.SIZE, 0); - - outNet.write(connectCommand.serialize()); - outNet.flush(); - - ConnectResponse payload = new ConnectResponse(0, 2, 4, ConnectionType.VIEWER_CLIENT_COMMAND); - outNet.write(payload.serialize()); - outNet.flush(); - - ConnectResponse connectReply = new ConnectResponse(inNet); - switch (connectReply.getMajor()) { - case 2: - switch (connectReply.getMinor()) { - case 0: - case 1: - case 2: - case 3: - return new LttngRelaydConnector_Unsupported(); - case 4: - default: - return new LttngRelaydConnector_2_4(inNet, outNet); - } - default: - return new LttngRelaydConnector_Unsupported(); - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_2_4.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_2_4.java deleted file mode 100644 index 05435c6eea..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_2_4.java +++ /dev/null @@ -1,181 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation - * Marc-Andre Laperle - Create session and split getNextIndex from getNextPacket - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.util.List; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.ILttngRelaydConnector; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionRequest; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.Command; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ConnectResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.GetMetadata; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.GetNextIndex; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.GetPacket; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ListSessionsResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.MetadataPacketResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.NewStreamsResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.NextIndexReturnCode; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SeekCommand; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.TracePacketResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ViewerCommand; - -/** - * Lttng 2.4 implementation - * - * @author Matthew Khouzam - */ -public class LttngRelaydConnector_2_4 implements ILttngRelaydConnector { - - private final @NonNull DataInputStream fInNet; - private final @NonNull DataOutputStream fOutNet; - - /** - * Constructor needs two network streams - * - * @param inNet - * network incoming data - * @param outNet - * network outgoing data - */ - public LttngRelaydConnector_2_4(@NonNull DataInputStream inNet, @NonNull DataOutputStream outNet) { - fInNet = inNet; - fOutNet = outNet; - } - - // ------------------------------------------------------------------------ - // AutoCloseable - // ------------------------------------------------------------------------ - - @Override - public void close() throws IOException { - fInNet.close(); - fOutNet.close(); - } - - // ------------------------------------------------------------------------ - // ILttngRelaydConnector - // ------------------------------------------------------------------------ - - @Override - public List getSessions() throws IOException { - ViewerCommand listSessionsCmd = new ViewerCommand(Command.VIEWER_LIST_SESSIONS, 0,0); - - fOutNet.write(listSessionsCmd.serialize()); - fOutNet.flush(); - - return new ListSessionsResponse(fInNet).getSessionsList(); - } - - @Override - public CreateSessionResponse createSession() throws IOException { - ViewerCommand listSessionsCmd = new ViewerCommand(Command.VIEWER_CREATE_SESSION, 0, 0); - fOutNet.write(listSessionsCmd.serialize()); - fOutNet.flush(); - - return new CreateSessionResponse(fInNet); - } - - @Override - public AttachSessionResponse attachToSession(SessionResponse lttngViewerSession) throws IOException { - ViewerCommand listSessionsCmd = new ViewerCommand(Command.VIEWER_ATTACH_SESSION, 0,0); - fOutNet.write(listSessionsCmd.serialize()); - /* - * only flush if you read after - */ - - AttachSessionRequest attachRequest = new AttachSessionRequest(lttngViewerSession.getId(), SeekCommand.VIEWER_SEEK_BEGINNING); - fOutNet.write(attachRequest.serialize()); - fOutNet.flush(); - - return new AttachSessionResponse(fInNet); - } - - @Override - public String getMetadata(AttachSessionResponse attachedSession) throws IOException { - - for (StreamResponse stream : attachedSession.getStreamList()) { - if (stream.getMetadataFlag() == 1) { - issueCommand(Command.VIEWER_GET_METADATA); - - GetMetadata metadataRequest = new GetMetadata(stream.getId()); - fOutNet.write(metadataRequest.serialize()); - fOutNet.flush(); - - MetadataPacketResponse metaDataPacket = new MetadataPacketResponse(fInNet); - return new String(metaDataPacket.getData()); - } - } - - return null; - } - - @Override - public TracePacketResponse getPacketFromStream(IndexResponse index, long id) throws IOException { - - issueCommand(Command.VIEWER_GET_PACKET); - - GetPacket packetRequest = new GetPacket(id, index.getOffset(), (int) (index.getPacketSize() / 8)); - fOutNet.write(packetRequest.serialize()); - fOutNet.flush(); - - return new TracePacketResponse(fInNet); - } - - @Override - public TracePacketResponse getNextPacket(StreamResponse stream) throws IOException { - IndexResponse indexReply = getNextIndex(stream); - - TracePacketResponse packet = null; - if (indexReply.getStatus() == NextIndexReturnCode.VIEWER_INDEX_OK) { - packet = getPacketFromStream(indexReply, stream.getId()); - } - return packet; - } - - @Override - public IndexResponse getNextIndex(StreamResponse stream) throws IOException { - issueCommand(Command.VIEWER_GET_NEXT_INDEX); - - GetNextIndex indexRequest = new GetNextIndex(stream.getId()); - fOutNet.write(indexRequest.serialize()); - fOutNet.flush(); - - return new IndexResponse(fInNet); - } - - @Override - public List getNewStreams() throws IOException { - - Command viewerGetNewStreams = Command.VIEWER_GET_NEW_STREAMS; - - issueCommand(viewerGetNewStreams); - - return new NewStreamsResponse(fInNet).getStreamList(); - } - - private void issueCommand(Command command) throws IOException { - ViewerCommand connectCommand = new ViewerCommand(command, ConnectResponse.SIZE, 0); - fOutNet.write(connectCommand.serialize()); - fOutNet.flush(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_Unsupported.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_Unsupported.java deleted file mode 100644 index 85ad22a81c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_Unsupported.java +++ /dev/null @@ -1,76 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl; - -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.ILttngRelaydConnector; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.TracePacketResponse; - -/** - * Unsupported version of the relay daemon - * - * @author Matthew Khouzam - */ -public class LttngRelaydConnector_Unsupported implements ILttngRelaydConnector { - - @Override - public List getSessions() { - throw new UnsupportedOperationException(); - } - - @Override - public AttachSessionResponse attachToSession(SessionResponse lttngViewerSession) { - throw new UnsupportedOperationException(); - } - - @Override - public String getMetadata(AttachSessionResponse attachedSession) { - throw new UnsupportedOperationException(); - } - - @Override - public TracePacketResponse getNextPacket(StreamResponse stream) { - throw new UnsupportedOperationException(); - } - - @Override - public TracePacketResponse getPacketFromStream(IndexResponse index, long id) { - throw new UnsupportedOperationException(); - } - - @Override - public List getNewStreams() { - throw new UnsupportedOperationException(); - } - - @Override - public CreateSessionResponse createSession() { - throw new UnsupportedOperationException(); - } - - @Override - public IndexResponse getNextIndex(StreamResponse stream) { - throw new UnsupportedOperationException(); - } - - @Override - public void close() { - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachReturnCode.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachReturnCode.java deleted file mode 100644 index 4ec77c5ca5..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachReturnCode.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Return codes for "viewer attach" command - * - * @author Matthew Khouzam - * @since 3.0 - */ -public enum AttachReturnCode implements IBaseCommand { - - /** If the attach command succeeded. */ - VIEWER_ATTACH_OK(1), - /** If a viewer is already attached. */ - VIEWER_ATTACH_ALREADY(2), - /** If the session ID is unknown. */ - VIEWER_ATTACH_UNK(3), - /** If the session is not live. */ - VIEWER_ATTACH_NOT_LIVE(4), - /** Seek error. */ - VIEWER_ATTACH_SEEK_ERR(5), - /** No session */ - VIEWER_ATTACH_NO_SESSION(6); - - private final int fCode; - - private AttachReturnCode(int c) { - fCode = c; - } - - @Override - public int getCommand() { - return fCode; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionRequest.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionRequest.java deleted file mode 100644 index 4b426090a7..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionRequest.java +++ /dev/null @@ -1,81 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * VIEWER_ATTACH_SESSION payload. - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class AttachSessionRequest implements IRelayCommand { - - /** - * Command size - * - * fSessionId + fOffset + fSeek - */ - public static final int SIZE = (Long.SIZE + Long.SIZE) / 8 + SeekCommand.SIZE; - /** the id of a session */ - private final long fSessionId; - /** unused for now */ - private final long fOffset; - /** enum lttng_viewer_seek */ - private final SeekCommand fSeek; - - /** - * Attach session request constructor - * - * @param id - * the session id - * @param seekCommand - * the seek command - */ - public AttachSessionRequest(long id, SeekCommand seekCommand) { - this(id, 0, seekCommand); - } - - /** - * Attach session request constructor - * - * @param id - * the session id - * @param offset - * unused for now - * @param seekCommand - * the seek command - */ - - public AttachSessionRequest(long id, int offset, SeekCommand seekCommand) { - fSessionId = id; - fOffset = offset; - fSeek = seekCommand; - - } - - @Override - public byte[] serialize() { - byte data[] = new byte[SIZE]; - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - bb.putLong(fSessionId); - bb.putLong(fOffset); - bb.putInt(fSeek.getCommand()); - return data; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionResponse.java deleted file mode 100644 index 2903333d29..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.List; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableList.Builder; - -/** - * Attach session response - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class AttachSessionResponse implements IRelayResponse { - - /** - * Response size - * - * fStatus + fStreamsCount (first half of a packet) */ - private static final int SIZE = (Integer.SIZE + Integer.SIZE) / 8; - /** enum lttng_viewer_attach_return_code */ - private final AttachReturnCode fStatus; - /** how many streams are there */ - private final int fStreamsCount; - /** public class lttng_viewer_stream */ - private final List fStreamList; - - /** - * Attach session response network constructor - * - * @param inNet - * network input stream - * @throws IOException - * network error - */ - public AttachSessionResponse(DataInputStream inNet) throws IOException { - byte[] data = new byte[SIZE]; - inNet.readFully(data, 0, SIZE); - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - fStatus = AttachReturnCode.values()[bb.getInt() - 1]; - fStreamsCount = bb.getInt(); - Builder streamResponses = ImmutableList.builder(); - for (int i = 0; i < getNbStreams(); i++) { - streamResponses.add(new StreamResponse(inNet)); - } - fStreamList = streamResponses.build(); - - } - - /** - * Gets the Status - * - * @return the Status - */ - public AttachReturnCode getStatus() { - return fStatus; - } - - /** - * Gets the StreamsCount - * - * @return the StreamsCount - */ - public int getNbStreams() { - return fStreamsCount; - } - - /** - * Gets the StreamList - * - * @return the StreamList - */ - public List getStreamList() { - return fStreamList; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/Command.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/Command.java deleted file mode 100644 index 4478ae6de6..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/Command.java +++ /dev/null @@ -1,56 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Viewer commands - * - * @author Matthew Khouzam - * @since 3.0 - */ -public enum Command implements IBaseCommand { - - /** get version */ - VIEWER_CONNECT(1), - /** list all lttng sessions */ - VIEWER_LIST_SESSIONS(2), - /** attach to a session */ - VIEWER_ATTACH_SESSION(3), - /** get the next index */ - VIEWER_GET_NEXT_INDEX(4), - /** get packet */ - VIEWER_GET_PACKET(5), - /** get metadata */ - VIEWER_GET_METADATA(6), - /** get new streams */ - VIEWER_GET_NEW_STREAMS(7), - /** create a new session */ - VIEWER_CREATE_SESSION(8); - - /** - * Command size (fCode) - */ - public static final int SIZE = Integer.SIZE / 8; - - private final int fCode; - - private Command(int c) { - fCode = c; - } - - @Override - public int getCommand() { - return fCode; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectResponse.java deleted file mode 100644 index e2579e1f2c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectResponse.java +++ /dev/null @@ -1,119 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * CONNECT payload. - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class ConnectResponse implements IRelayResponse, IRelayCommand { - - /** - * Response or command size - * - * fViewerSessionId + fMajor + fMinor + fType - */ - public static final int SIZE = (Long.SIZE + Integer.SIZE + Integer.SIZE + Integer.SIZE) / 8; - /** session id, counts from 1 and increments by session */ - private final long fViewerSessionId; - /** - * Major version, hint, it's at least 2 - */ - private final int fMajor; - /** - * Minor version, hint, it's at least 4 - */ - private final int fMinor; - /** - * type of connect to {@link ConnectionType} - */ - private final ConnectionType fType; - - /** - * Connection response reply constructor - * - * @param inStream - * the data input stream - * @throws IOException - * a network error - */ - public ConnectResponse(DataInputStream inStream) throws IOException { - byte data[] = new byte[SIZE]; - inStream.readFully(data); - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - fViewerSessionId = bb.getLong(); - fMajor = bb.getInt(); - fMinor = bb.getInt(); - bb.getInt(); // Should not be used, see http://bugs.lttng.org/issues/728 - fType = ConnectionType.VIEWER_CLIENT_COMMAND; - } - - /** - * Constructor for command - * - * @param sessionID - * session id - * @param major - * the major version - * @param minor - * the minor version - * @param connection - * the connection type, typically VIEWER_CLIENT_COMMAND - */ - public ConnectResponse(long sessionID, int major, int minor, ConnectionType connection) { - fViewerSessionId = sessionID; - fMajor = major; - fMinor = minor; - fType = connection; - } - - /** - * get the major version - * - * @return the major version - */ - public int getMajor() { - return fMajor; - } - - /** - * get the minor version - * - * @return the minor version - */ - public int getMinor() { - return fMinor; - } - - @Override - public byte[] serialize() { - byte data[] = new byte[SIZE]; - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - bb.putLong(fViewerSessionId); - bb.putInt(fMajor); - bb.putInt(fMinor); - bb.putInt(fType.getCommand()); - return data; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectionType.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectionType.java deleted file mode 100644 index 0b650741a6..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectionType.java +++ /dev/null @@ -1,40 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Get viewer connection type - * - * @author Matthew Khouzam - * @since 3.0 - */ -public enum ConnectionType implements IBaseCommand { - - /** Command sent */ - VIEWER_CLIENT_COMMAND(1), - /** Notification sent */ - VIEWER_CLIENT_NOTIFICATION(2); - - private final int fCode; - - private ConnectionType(int c) { - fCode = c; - } - - @Override - public int getCommand() { - return fCode; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionResponse.java deleted file mode 100644 index 97200f34b5..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionResponse.java +++ /dev/null @@ -1,62 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * Response to a "create session" command - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class CreateSessionResponse implements IRelayResponse { - - /** - * Response size (fStatus) - */ - public static final int SIZE = Integer.SIZE / 8; - - /** enum lttng_viewer_create_session_return_code */ - private final CreateSessionReturnCode fStatus; - - /** - * Create session response network constructor - * - * @param inNet - * network input stream - * @throws IOException - * network error - */ - public CreateSessionResponse(DataInputStream inNet) throws IOException { - byte[] data = new byte[SIZE]; - inNet.readFully(data); - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - fStatus = (CreateSessionReturnCode.values()[bb.getInt() - 1]); - } - - /** - * Get status - * - * @return the status - */ - public CreateSessionReturnCode getStatus() { - return fStatus; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionReturnCode.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionReturnCode.java deleted file mode 100644 index 6c3f6b4d9b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionReturnCode.java +++ /dev/null @@ -1,39 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Create new session return code - * - * @author Matthew Khouzam - * @since 3.0 - */ -public enum CreateSessionReturnCode implements IBaseCommand { - - /** If new streams are being sent. */ - LTTNG_VIEWER_CREATE_SESSION_OK(1), - /** Fatal error on the server-side. */ - LTTNG_VIEWER_CREATE_SESSION_ERR(2); - - private final int fCode; - - private CreateSessionReturnCode(int c) { - fCode = c; - } - - @Override - public int getCommand() { - return fCode; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadata.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadata.java deleted file mode 100644 index 54ee517b09..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadata.java +++ /dev/null @@ -1,65 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * VIEWER_GET_METADATA payload. - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class GetMetadata implements IRelayCommand { - - /** - * Command size (fStreamId) - */ - public static final int SIZE = Long.SIZE / 8; - - /** - * The stream id - */ - private final long fStreamId; - - /** - * Set the stream id - * - * @param streamId - * the stream id - */ - public GetMetadata(long streamId) { - fStreamId = streamId; - } - - /** - * Get the stream id - * - * @return the stream id - */ - public long getStreamId() { - return fStreamId; - } - - @Override - public byte[] serialize() { - byte data[] = new byte[SIZE]; - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - bb.putLong(getStreamId()); - return data; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadataReturnCode.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadataReturnCode.java deleted file mode 100644 index 0df4b60316..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadataReturnCode.java +++ /dev/null @@ -1,42 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Get metadata return code - * - * @author Matthew Khouzam - * @since 3.0 - */ -public enum GetMetadataReturnCode implements IBaseCommand { - - /** Response was OK */ - VIEWER_METADATA_OK(1), - /** Response was nothing new */ - VIEWER_NO_NEW_METADATA(2), - /** Response was Error */ - VIEWER_METADATA_ERR(3); - - private final int fCode; - - private GetMetadataReturnCode(int c) { - fCode = c; - } - - @Override - public int getCommand() { - return fCode; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetNextIndex.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetNextIndex.java deleted file mode 100644 index 6a4e2fd1a3..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetNextIndex.java +++ /dev/null @@ -1,64 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * VIEWER_GET_NEXT_INDEX payload. - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class GetNextIndex implements IRelayCommand { - - /** - * Command size (fStreamId) - */ - public static final int SIZE = Long.SIZE / 8; - /** - * the id of the stream - */ - private final long fStreamId; - - /** - * Constructor - * - * @param streamId - * the index stream id - */ - public GetNextIndex(long streamId) { - fStreamId = streamId; - } - - /** - * Gets the stream id - * - * @return the stream id - */ - public long getStreamId() { - return fStreamId; - } - - @Override - public byte[] serialize() { - byte data[] = new byte[SIZE]; - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - bb.putLong(getStreamId()); - return data; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacket.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacket.java deleted file mode 100644 index 172ca30a5b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacket.java +++ /dev/null @@ -1,94 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * VIEWER_GET_PACKET payload. - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class GetPacket implements IRelayCommand { - - /** - * Command size - * - * fStreamId + fOffset + fLength - */ - public static final int SIZE = (Long.SIZE + Long.SIZE + Integer.SIZE) / 8; - /** the stream Id */ - private final long fStreamId; - /** the offset */ - private final long fOffset; - /** the length of the packet */ - private final int fLength; - - /** - * Get packet constructor - * - * @param streamId - * the stream id - * @param offset - * the offset - * @param length - * the packet length - */ - public GetPacket(long streamId, long offset, int length) { - fStreamId = streamId; - fOffset = offset; - fLength = length; - } - - /** - * Get the length of the packet - * - * @return the length of the packet in bytes - */ - public int getLength() { - return fLength; - } - - /** - * Gets the offset of the packet - * - * @return the offset - */ - public long getOffset() { - return fOffset; - } - - /** - * Gets the stream id - * - * @return the stream id - */ - public long getStreamId() { - return fStreamId; - } - - @Override - public byte[] serialize() { - byte data[] = new byte[SIZE]; - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - bb.putLong(getStreamId()); - bb.putLong(getOffset()); - bb.putInt(getLength()); - return data; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacketReturnCode.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacketReturnCode.java deleted file mode 100644 index b5fab2b21a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacketReturnCode.java +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Get packet return code - * - * @author Matthew Khouzam - * @since 3.0 - */ -public enum GetPacketReturnCode implements IBaseCommand { - - /** Response was OK */ - VIEWER_GET_PACKET_OK(1), - /** Response was RETRY */ - VIEWER_GET_PACKET_RETRY(2), - /** Response was ERROR */ - VIEWER_GET_PACKET_ERR(3), - /** Response was End of File */ - VIEWER_GET_PACKET_EOF(4); - - private final int fCode; - - private GetPacketReturnCode(int c) { - fCode = c; - } - - @Override - public int getCommand() { - return fCode; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IBaseCommand.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IBaseCommand.java deleted file mode 100644 index 905cfa8f6b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IBaseCommand.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Instruction to send to relayd - * - * @author Matthew Khouzam - * @since 3.0 - */ -public interface IBaseCommand { - - /** - * gets the numerical value of the command - * - * @return the numerical value of the command - */ - int getCommand(); -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayCommand.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayCommand.java deleted file mode 100644 index 2a47c05061..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayCommand.java +++ /dev/null @@ -1,31 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - - -/** - * Command sent, needs a getBytes to stream the data - * - * @author Matthew Khouzam - * @since 3.0 - */ -public interface IRelayCommand { - - /** - * Gets a byte array of the command so that it may be streamed - * - * @return the byte array of the command - */ - byte[] serialize(); -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayResponse.java deleted file mode 100644 index 153349d362..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayResponse.java +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Command response, this will allow sorting commands easier - * - * @author Matthew Khouzam - * @since 3.0 - */ -public interface IRelayResponse { - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IndexResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IndexResponse.java deleted file mode 100644 index 503ef279c2..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IndexResponse.java +++ /dev/null @@ -1,163 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * An Lttng packet index - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class IndexResponse implements IRelayResponse { - - /** - * Command size - * - * Sum of the field sizes / 8 ( 7 longs and 2 ints): - * fOffset + fPacketSize + fContentSize + fTimestampBegin + fTimestampEnd + - * fEventsDiscarded + fStreamId + fStatus + fFlags - */ - public final static int SIZE = - (Long.SIZE * 7 + Integer.SIZE * 2) / 8; - - /** the offset */ - private final long fOffset; - /** packet_size */ - private final long fPacketSize; - /** the content size - how much of the packet is used */ - private final long fContentSize; - /** timestamp of the beginning of the packet */ - private final long fTimestampBegin; - /** timestamp of the end of the packet */ - private final long fTimestampEnd; - /** number of discarded events BEFORE this packet */ - private final long fEventsDiscarded; - /** the CTF stream id */ - private final long fStreamId; - /** the status of the getNextIndex request */ - private final NextIndexReturnCode fStatus; - /** whether there are new streams or metadata */ - private final int fFlags; - - /** - * IndexResposne from network - * - * @param inNet - * data input stream - * @throws IOException - * network error - */ - public IndexResponse(DataInputStream inNet) throws IOException { - byte[] data = new byte[SIZE]; - inNet.readFully(data); - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - fOffset = bb.getLong(); - fPacketSize = bb.getLong(); - fContentSize = bb.getLong(); - fTimestampBegin = bb.getLong(); - fTimestampEnd = bb.getLong(); - fEventsDiscarded = bb.getLong(); - fStreamId = bb.getLong(); - fStatus = NextIndexReturnCode.values()[bb.getInt() - 1]; - fFlags = bb.getInt(); - } - - /** - * Gets the offset - * - * @return the offset - */ - public long getOffset() { - return fOffset; - } - - /** - * Gets the packet size - * - * @return the packet size - */ - public long getPacketSize() { - return fPacketSize; - } - - /** - * Gets the content size - how much of the packet is used - * - * @return the content size - */ - public long getContentSize() { - return fContentSize; - } - - /** - * Gets the timestamp of the beginning of the packet - * - * @return the timestamp of the beginning of the packet - */ - public long getTimestampBegin() { - return fTimestampBegin; - } - - /** - * Gets the timestamp of the end of the packet - * - * @return the timestamp of the end of the packet - */ - public long getTimestampEnd() { - return fTimestampEnd; - } - - /** - * Gets the number of discarded events BEFORE this packet - * - * @return the number of discarded events BEFORE this packet - */ - public long getEventsDiscarded() { - return fEventsDiscarded; - } - - /** - * Gets the CTF stream id - * - * @return the CTF stream id - */ - public long getStreamId() { - return fStreamId; - } - - /** - * Gets the status - * - * @return the status - */ - public NextIndexReturnCode getStatus() { - return fStatus; - } - - /** - * Gets the flags that describe whether there are new streams or metadata - * - * @return the flags - */ - public int getFlags() { - return fFlags; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ListSessionsResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ListSessionsResponse.java deleted file mode 100644 index 5a520912ce..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ListSessionsResponse.java +++ /dev/null @@ -1,72 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.List; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableList.Builder; - -/** - * VIEWER_LIST_SESSIONS payload. - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class ListSessionsResponse implements IRelayResponse { - - /** - * Response size (nbSessions) - */ - public static final int PACKET_FIXED_SIZE = Integer.SIZE / 8; - - /** the list of sessions */ - private final List fSessionList; - - /** - * List Sessions response from network - * - * @param inNet - * the network stream - * @throws IOException - * network error - */ - public ListSessionsResponse(DataInputStream inNet) throws IOException { - byte[] data = new byte[PACKET_FIXED_SIZE]; - inNet.readFully(data); - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - int nbSessions = bb.getInt(); - Builder sl = new ImmutableList.Builder<>(); - for (int session = 0; session < nbSessions; session++) { - sl.add(new SessionResponse(inNet)); - } - fSessionList = sl.build(); - } - - /** - * Gets the session list - * - * @return the sessions list - */ - public List getSessionsList() { - return fSessionList; - } - - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/LttngViewerCommands.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/LttngViewerCommands.java deleted file mode 100644 index 45b246c9a9..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/LttngViewerCommands.java +++ /dev/null @@ -1,37 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * LTTng Relay Daemon API. needs a TCP connection, API is defined from - * BSD-licensed implementation in Lttng tools: src/bin/lttng-relayd/lttng-viewer-abi.h - * - * @author Matthew Khouzam - * @since 3.0 - */ -public interface LttngViewerCommands { - - /** Maximum path name length */ - static final int LTTNG_VIEWER_PATH_MAX = 4096; - /** Maximum name length */ - static final int LTTNG_VIEWER_NAME_MAX = 255; - /** Maximum host name length */ - static final int LTTNG_VIEWER_HOST_NAME_MAX = 64; - /** New stream in the trace */ - static final int NEW_STREAM = (1 << 1); - /** New metadata in the trace */ - static final int NEW_METADATA = (1 << 0); - -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/MetadataPacketResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/MetadataPacketResponse.java deleted file mode 100644 index 97345def93..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/MetadataPacketResponse.java +++ /dev/null @@ -1,79 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * Metadata packet response containing a packet of metadata - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class MetadataPacketResponse implements IRelayResponse { - - /** - * Response size - * - * fData.length + fStatus - */ - private static final int SIZE = (Long.SIZE + Integer.SIZE) / 8; - /** status of the metadata request */ - private final GetMetadataReturnCode fStatus; - /** the packet */ - private final byte fData[]; - - /** - * Read new metadata packet from the network - * - * @param inNet - * network input reader - * @throws IOException - * network error - */ - public MetadataPacketResponse(DataInputStream inNet) throws IOException { - byte[] data = new byte[SIZE]; - inNet.readFully(data); - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - long length = bb.getLong(); - fStatus = GetMetadataReturnCode.values()[bb.getInt() - 1]; - if (length >= Integer.MAX_VALUE) { - throw new IOException("Metadata Packet too big " + length); //$NON-NLS-1$ - } - fData = new byte[(int) length]; - inNet.readFully(fData); - } - - /** - * Get the packet - * - * @return the packet - */ - public byte[] getData() { - return fData; - } - - /** - * Gets the status - * - * @return the status - */ - public GetMetadataReturnCode getStatus() { - return fStatus; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsRequest.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsRequest.java deleted file mode 100644 index e33691e05f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsRequest.java +++ /dev/null @@ -1,53 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * LTTNG_VIEWER_GET_NEW_STREAMS payload. - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class NewStreamsRequest implements IRelayCommand { - - /** - * Command size (fSessionId) - */ - public static final int SIZE = Long.SIZE / 8; - - /** session ID */ - private final long fSessionId; - - /** - * Constructor - * - * @param sessionId - * the session id we want - */ - public NewStreamsRequest(long sessionId) { - fSessionId = sessionId; - } - - @Override - public byte[] serialize() { - byte data[] = new byte[SIZE]; - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - bb.putLong(fSessionId); - return data; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsResponse.java deleted file mode 100644 index f107c1f51b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.List; - -import com.google.common.collect.ImmutableList; - -/** - * Response to a "new streams" command - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class NewStreamsResponse implements IRelayResponse { - - /** - * Response size - * - * fStatus + fNbStreams - */ - private static final int SIZE = (Integer.SIZE + Integer.SIZE) / 8; - /** status of the request */ - private final NewStreamsReturnCode fStatus; - /** the number of streams */ - private final int fNbStreams; - /** the list of streams in the response */ - private final List fStreamList; - - /** - * New stream response network constructor - * - * @param inNet - * network stream - * @throws IOException - * network error - */ - public NewStreamsResponse(DataInputStream inNet) throws IOException { - byte[] data = new byte[SIZE]; - inNet.readFully(data); - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - fStatus = NewStreamsReturnCode.values()[bb.getInt() - 1]; - fNbStreams = bb.getInt(); - ImmutableList.Builder sl = new ImmutableList.Builder<>(); - if (getStatus().equals(NewStreamsReturnCode.LTTNG_VIEWER_NEW_STREAMS_OK)) { - for (int stream = 0; stream < fNbStreams; stream++) { - sl.add(new StreamResponse(inNet)); - } - } - fStreamList = sl.build(); - } - - /** - * Gets the status - * - * @return the status - */ - public NewStreamsReturnCode getStatus() { - return fStatus; - } - - /** - * gets the stream list - * - * @return the stream list - */ - public List getStreamList() { - return fStreamList; - } - - /** - * The number of streams - * - * @return the number of streams - */ - public int getNbStreams() { - return fNbStreams; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsReturnCode.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsReturnCode.java deleted file mode 100644 index 7bb534c987..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsReturnCode.java +++ /dev/null @@ -1,43 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Return codes for "new streams" command - * - * @author Matthew Khouzam - * @since 3.0 - */ -public enum NewStreamsReturnCode implements IBaseCommand { - - /** If new streams are being sent. */ - LTTNG_VIEWER_NEW_STREAMS_OK(1), - /** If no new streams are available. */ - LTTNG_VIEWER_NEW_STREAMS_NO_NEW(2), - /** Error. */ - LTTNG_VIEWER_NEW_STREAMS_ERR(3), - /** Session closed. */ - LTTNG_VIEWER_NEW_STREAMS_HUP(4); - - private final int fCode; - - private NewStreamsReturnCode(int c) { - fCode = c; - } - - @Override - public int getCommand() { - return fCode; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NextIndexReturnCode.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NextIndexReturnCode.java deleted file mode 100644 index 6345ac5436..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NextIndexReturnCode.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Get next index return code (hope it's viewer_index_ok) - * - * @author Matthew Khouzam - * @since 3.0 - */ -public enum NextIndexReturnCode implements IBaseCommand { - - /** Index is available. */ - VIEWER_INDEX_OK(1), - /** Index not yet available. */ - VIEWER_INDEX_RETRY(2), - /** Index closed (trace destroyed). */ - VIEWER_INDEX_HUP(3), - /** Unknown error. */ - VIEWER_INDEX_ERR(4), - /** Inactive stream beacon. */ - VIEWER_INDEX_INACTIVE(5), - /** End of index file. */ - VIEWER_INDEX_EOF(6); - - private final int fCode; - - private NextIndexReturnCode(int c) { - fCode = c; - } - - @Override - public int getCommand() { - return fCode; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SeekCommand.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SeekCommand.java deleted file mode 100644 index 8e90cf40b8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SeekCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -/** - * Seek command - * - * @author Matthew Khouzam - * @since 3.0 - */ -public enum SeekCommand implements IBaseCommand { - - /** Receive the trace packets from the beginning. */ - VIEWER_SEEK_BEGINNING(1), - /** Receive the trace packets from now. */ - VIEWER_SEEK_LAST(2); - - private final int fCode; - - /** - * Command size (fCode) - */ - public static final int SIZE = Integer.SIZE / 8; - - private SeekCommand(int c) { - fCode = c; - } - - @Override - public int getCommand() { - return fCode; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SessionResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SessionResponse.java deleted file mode 100644 index e91bbe3767..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SessionResponse.java +++ /dev/null @@ -1,128 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * Get viewer session response to command - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class SessionResponse implements IRelayResponse { - - /** - * Response size - * - * fHostname + fSessionName + fId + fLiveTimer + fClients + fStreams - */ - public static final int SIZE = - LttngViewerCommands.LTTNG_VIEWER_HOST_NAME_MAX + LttngViewerCommands.LTTNG_VIEWER_NAME_MAX + (Long.SIZE + Integer.SIZE + Integer.SIZE + Integer.SIZE) / 8; - /** id of the session */ - private final long fId; - /** live timer */ - private final int fLiveTimer; - /** number of clients */ - private final int fClients; - /** number streams */ - private final int fStreams; - /** Hostname, like 'localhost' */ - private final String fHostname; - /** Session name, like 'streaming session' */ - private final String fSessionName; - - /** - * Session response network constructor - * - * @param inNet - * input network stream - * @throws IOException - * network error - */ - public SessionResponse(DataInputStream inNet) throws IOException { - byte[] data = new byte[SIZE]; - inNet.readFully(data); - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - fId = bb.getLong(); - fLiveTimer = bb.getInt(); - fClients = bb.getInt(); - fStreams = bb.getInt(); - byte[] hostName = new byte[LttngViewerCommands.LTTNG_VIEWER_HOST_NAME_MAX]; - byte[] sessionName = new byte[LttngViewerCommands.LTTNG_VIEWER_NAME_MAX]; - bb.get(hostName, 0, hostName.length); - bb.get(sessionName, 0, sessionName.length); - fHostname = new String(hostName); - fSessionName = new String(sessionName); - } - - /** - * Gets the id of the session - * - * @return the id of the session - */ - public long getId() { - return fId; - } - - /** - * Gets the live timer - * - * @return the live timer - */ - public int getLiveTimer() { - return fLiveTimer; - } - - /** - * Gets the number of clients - * - * @return the number of clients - */ - public int getClients() { - return fClients; - } - - /** - * Gets the number streams - * - * @return the number streams - */ - public int getStreams() { - return fStreams; - } - - /** - * Gets the Hostname - * - * @return the Hostname - */ - public String getHostname() { - return fHostname; - } - - /** - * Gets the session name - * - * @return the session name - */ - public String getSessionName() { - return fSessionName; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/StreamResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/StreamResponse.java deleted file mode 100644 index d19303cc1a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/StreamResponse.java +++ /dev/null @@ -1,127 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * Get response of viewer stream - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class StreamResponse implements IRelayResponse { - - /** - * Response size - * - * fId + fCtfTraceId + fMetadataFlag + fPathName + fChannelName - */ - public static final int SIZE = (Long.SIZE + Long.SIZE + Integer.SIZE) / 8 + LttngViewerCommands.LTTNG_VIEWER_PATH_MAX + LttngViewerCommands.LTTNG_VIEWER_NAME_MAX; - - /** - * id of the stream - */ - private final long fId; - /** - * It is guaranteed to be unique, because the value is assigned sequentially - * by the relay. - */ - private final long fCtfTraceId; - /** - * if the stream is a metadata stream - */ - private final int fMetadataFlag; - /** - * the path - */ - private final String fPathName; - /** - * The channel, traditionally channel0 - */ - private final String fChannelName; - - /** - * Stream response - * - * @param inNet - * input data stream - * @throws IOException - * network time - */ - public StreamResponse(DataInputStream inNet) throws IOException { - byte[] streamData = new byte[SIZE]; - inNet.readFully(streamData, 0, SIZE); - ByteBuffer bb = ByteBuffer.wrap(streamData); - bb.order(ByteOrder.BIG_ENDIAN); - fId = (bb.getLong()); - fCtfTraceId = bb.getLong(); - fMetadataFlag = bb.getInt(); - byte pathName[] = new byte[LttngViewerCommands.LTTNG_VIEWER_PATH_MAX]; - byte channelName[] = new byte[LttngViewerCommands.LTTNG_VIEWER_NAME_MAX]; - bb.get(pathName, 0, LttngViewerCommands.LTTNG_VIEWER_PATH_MAX); - bb.get(channelName, 0, LttngViewerCommands.LTTNG_VIEWER_NAME_MAX); - fPathName = new String(pathName); - fChannelName = new String(channelName); - } - - /** - * Get the id - * - * @return the Id - */ - public long getId() { - return fId; - } - - /** - * Get the CtfTraceId - * - * @return the CtfTraceId - */ - public long getCtfTraceId() { - return fCtfTraceId; - } - - /** - * Get the metadata flag - * - * @return the MetadataFlag - */ - public int getMetadataFlag() { - return fMetadataFlag; - } - - /** - * Get the path name - * - * @return the PathName - */ - public String getPathName() { - return fPathName; - } - - /** - * get the Channel name - * - * @return the ChannelName - */ - public String getChannelName() { - return fChannelName; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/TracePacketResponse.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/TracePacketResponse.java deleted file mode 100644 index 719bb27b8f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/TracePacketResponse.java +++ /dev/null @@ -1,93 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * Response to getpacket command - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class TracePacketResponse implements IRelayResponse { - - /** - * Command size - * - * fStatus + fData.length + fFlags - */ - private static final int SIZE = (Integer.SIZE + Integer.SIZE + Integer.SIZE) / 8; - /** Enum lttng_viewer_get_packet_return_code */ - private final GetPacketReturnCode fStatus; - /** flags: is there new metadata or new streams? */ - private final int fFlags; - /** the packet */ - private final byte[] fData; - - /** - * Trace packet response network constructor - * - * @param inNet - * network input stream - * @throws IOException - * network error - */ - public TracePacketResponse(DataInputStream inNet) throws IOException { - byte[] data = new byte[SIZE]; - inNet.readFully(data); - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - fStatus = GetPacketReturnCode.values()[bb.getInt() - 1]; - int length = bb.getInt(); - fFlags = bb.getInt(); - if (fStatus.equals(GetPacketReturnCode.VIEWER_GET_PACKET_OK)) { - fData = new byte[length]; - inNet.readFully(fData); - } else { - fData = new byte[0]; - } - } - - /** - * Get the status - * - * @return the Status - */ - public GetPacketReturnCode getStatus() { - return fStatus; - } - - /** - * Get the flags - * - * @return the Flags - */ - public int getFlags() { - return fFlags; - } - - /** - * Get the packet data, please do not modify the data - * - * @return the Data - */ - public byte[] getData() { - return fData; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ViewerCommand.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ViewerCommand.java deleted file mode 100644 index c8c4f8d89a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ViewerCommand.java +++ /dev/null @@ -1,96 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation and API - * Marc-Andre Laperle - Initial implementation and API - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * The LTTng command - * - * @author Matthew Khouzam - * @since 3.0 - */ -public class ViewerCommand implements IRelayCommand { - - /** - * Command size - * - * fDataSize + fCmdVersion + fCmd - */ - public static final int SIZE = (Long.SIZE + Integer.SIZE) / 8 + Command.SIZE; - /** - * data size following this header, you normally attach a payload that one, - * in bytes - */ - private final long fDataSize; - /** enum lttcomm_relayd_command */ - private final Command fCmd; - /** command version */ - private final int fCmdVersion; - - /** - * Sets the packet command - * - * @param viewerConnect - * the command - * @param size size of the command - * @param version the version number - */ - public ViewerCommand(Command viewerConnect, long size, int version) { - fCmd = viewerConnect; - fDataSize = size; - fCmdVersion = version; - } - - /** - * Get the data size - * - * @return the DataSize - */ - public long getDataSize() { - return fDataSize; - } - - /** - * Get the command - * - * @return the Cmd - */ - public Command getCmd() { - return fCmd; - } - - /** - * Get the command version - * - * @return the CmdVersion - */ - public int getCmdVersion() { - return fCmdVersion; - } - - @Override - public byte[] serialize() { - byte data[] = new byte[SIZE]; - ByteBuffer bb = ByteBuffer.wrap(data); - bb.order(ByteOrder.BIG_ENDIAN); - bb.putLong(getDataSize()); - bb.putInt(getCmd().getCommand()); - bb.putInt(fCmdVersion); - return data; - } - - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/Messages.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/Messages.java deleted file mode 100644 index 2c8bac841a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/Messages.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * 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: - * Guilliano Molaire - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.core.session; - -import org.eclipse.osgi.util.NLS; - -/** - * Externalized message strings from the lttng2.core.control.session - * - * @author Guilliano Molaire - * @since 3.0 - */ -@SuppressWarnings("javadoc") -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng2.control.core.session.messages"; //$NON-NLS-1$ - - public static String SessionConfigXML_BadRequirementType; - public static String SessionConfigXML_DomainTypeMissing; - public static String SessionConfigXML_EventTypeMissing; - public static String SessionConfigXML_InvalidSessionInfoList; - public static String SessionConfigXML_InvalidTraceSessionPath; - public static String SessionConfigXML_UnknownEventType; - public static String SessionConfigXML_UnknownDomainBufferType; - public static String SessionConfigXML_SessionConfigGenerationError; - public static String SessionConfigXML_XmlParseError; - public static String SessionConfigXML_XmlValidateError; - public static String SessionConfigXML_XmlValidationError; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigGenerator.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigGenerator.java deleted file mode 100644 index dcb59bc7f1..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigGenerator.java +++ /dev/null @@ -1,539 +0,0 @@ -/********************************************************************** - * 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: - * Guilliano Molaire - Initial API and implementation - *********************************************************************/ -package org.eclipse.linuxtools.lttng2.control.core.session; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Set; - -import javax.xml.XMLConstants; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; -import javax.xml.validation.Schema; -import javax.xml.validation.SchemaFactory; -import javax.xml.validation.Validator; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.linuxtools.internal.lttng2.control.core.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.osgi.util.NLS; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -/** - * Class for generating a session configuration file. A session configuration is - * used to configure a trace session. It is a XML formatted file that contains - * values defining the behavior of that specific trace session. - *

- * Kernel session configuration example: - * - *

- * {@code
- * 
- *     
- *         test_kernel
- *         
- *             
- *                 KERNEL
- *                 GLOBAL
- *                 
- *                     
- *                         channel0
- *                         false
- *                         DISCARD
- *                         262144
- *                         4
- *                         0
- *                         200000
- *                         SPLICE
- *                         0
- *                         0
- *                         0
- *                         
- *                             
- *                                 true
- *                                 SYSCALL
- *                             
- *                             
- *                                 snd_soc_cache_sync
- *                                 true
- *                                 TRACEPOINT
- *                             
- *                         
- *                     
- *                 
- *             
- *         
- *         false
- *         
- *             
- *                 true
- *                 
- *                     /home/user/lttng-traces/test_kernel
- *                 
- *             
- *         
- *     
- * 
- * }
- * 
- * - *

- * - * @author Guilliano Molaire - * @since 3.0 - */ -public final class SessionConfigGenerator { - - /** The name of the session schema */ - private static final String SESSION_XSD_FILENAME = "session.xsd"; //$NON-NLS-1$ - - /** The indent size used for the session configuration XML file */ - private static final String INDENT_AMOUNT_PROPERTY_NAME = "{http://xml.apache.org/xslt}indent-amount"; //$NON-NLS-1$ - private static final String INDENT_AMOUNT_PROPERTY_VALUE = "4"; //$NON-NLS-1$ - - /** - * Private constructor. The class should not be instantiated. - */ - private SessionConfigGenerator() { - } - - // --------------------------------------------------------- - // Methods to generate session configuration files - // --------------------------------------------------------- - - /** - * Generates a session configuration file from a set of session information. - * - * @param sessions - * The session informations - * @param sessionFileDestination - * The path of the locally saved session configuration file - * @return The status of the session configuration generation - */ - public static IStatus generateSessionConfig(Set sessions, IPath sessionFileDestination) { - /* Parameters validation */ - if (sessions == null || sessions.isEmpty()) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SessionConfigXML_InvalidSessionInfoList); - } else if (sessionFileDestination == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SessionConfigXML_InvalidTraceSessionPath); - } - - /* Generate the session configuration file */ - try { - Document sessionConfigDocument = generateSessionConfig(sessions); - - if (sessionConfigDocument != null) { - saveSessionConfig(sessionConfigDocument, sessionFileDestination.toString()); - } else { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SessionConfigXML_SessionConfigGenerationError); - } - } catch (TransformerException | IllegalArgumentException | ParserConfigurationException e) { - Activator.getDefault().logError("Error generating the session configuration file: " + sessionFileDestination.toString(), e); //$NON-NLS-1$ - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()); - } - - return Status.OK_STATUS; - } - - /** - * Generates a session configuration from a set of session informations. - * - * @param sessions - * The session informations - * @return The document with all session configuration nodes - * @throws IllegalArgumentException - * On an illegal argument inside sessions - * @throws ParserConfigurationException - * On an parser configuration error - */ - private static Document generateSessionConfig(Iterable sessions) throws IllegalArgumentException, ParserConfigurationException { - DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); - - Document document = docBuilder.newDocument(); - - Element rootElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_SESSIONS); - document.appendChild(rootElement); - - for (ISessionInfo session : sessions) { - /* All elements under "sessions" elements */ - Element sessionElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_SESSION); - - /* Contents of session element */ - String enabled = session.getSessionState().equals(TraceSessionState.ACTIVE) ? SessionConfigStrings.CONFIG_STRING_TRUE : SessionConfigStrings.CONFIG_STRING_FALSE; - - addElementContent(document, sessionElement, SessionConfigStrings.CONFIG_ELEMENT_NAME, session.getName()); - addElementContent(document, sessionElement, SessionConfigStrings.CONFIG_ELEMENT_STARTED, enabled); - - if (session.isSnapshotSession()) { - /* If it's a snapshot, we must add an attribute telling it is */ - Element attributesElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_ATTRIBUTES); - addElementContent(document, attributesElement, SessionConfigStrings.CONFIG_ELEMENT_SNAPSHOT_MODE, SessionConfigStrings.CONFIG_STRING_TRUE); - sessionElement.appendChild(attributesElement); - } - - sessionElement.appendChild(getDomainsElement(document, session)); - sessionElement.appendChild(getOutputElement(document, session)); - rootElement.appendChild(sessionElement); - } - - return document; - } - - // --------------------------------------------------------- - // Getters for each element of the configuration file - // --------------------------------------------------------- - - /** - * Gets the 'domains' element after creating it. - * - * @param document - * The document in which the nodes are being added - * @param session - * The session informations - * @return The domains element as an XML element - */ - private static Element getDomainsElement(Document document, ISessionInfo session) { - Element domainsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DOMAINS); - - for (IDomainInfo domain : session.getDomains()) { - Element domainElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN); - - /* - * Add everything specific to a domain - * - * TODO: We suppose here that domain is either kernel or UST. It - * will have to change if other domains are supported - */ - String domainType = domain.isKernel() ? SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL : SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST; - addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_TYPE, domainType); - - String bufferType = null; - switch (domain.getBufferType()) { - case BUFFER_PER_UID: - bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_PER_UID; - break; - case BUFFER_PER_PID: - bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_PER_PID; - break; - case BUFFER_SHARED: - bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_GLOBAL; - break; - case BUFFER_TYPE_UNKNOWN: - default: - throw new IllegalArgumentException(Messages.SessionConfigXML_UnknownDomainBufferType); - } - addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_DOMAIN_BUFFER_TYPE, bufferType); - - /* Add the channels */ - domainElement.appendChild(getChannelsElement(document, domain.isKernel(), domain.getChannels())); - domainsElement.appendChild(domainElement); - } - - return domainsElement; - } - - /** - * Gets the 'output' element after creating it. If the session is a - * snapshot, it will be composed of a snapshot outputs element. Otherwise, - * it will contain the consumer output element. - * - * @param document - * The document in which the nodes are being added - * @param session - * The session informations - * @return The output element as an XML node - */ - private static Element getOutputElement(Document document, ISessionInfo session) { - Element outputElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_OUTPUT); - - if (session.isSnapshotSession()) { - outputElement.appendChild(getSnapshotOuputsElement(document, session)); - } else if (session.isStreamedTrace()) { - outputElement.appendChild(getNetOutputElement(document, session)); - } else { - outputElement.appendChild(getConsumerOutputElement(document, session)); - } - - return outputElement; - } - - /** - * Gets the 'channels' element after creating it. - * - * @param document - * The document in which the nodes are being added - * @param isKernel - * Is it a kernel domain type - * @param channels - * The channels to be added as elements - * @return The channels element as an XML element - */ - private static Element getChannelsElement(Document document, boolean isKernel, IChannelInfo[] channels) { - Element channelsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_CHANNELS); - - for (IChannelInfo channel : channels) { - Element channelElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_CHANNEL); - - /* Add everything related to a channel */ - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_NAME, channel.getName()); - - String overwriteMode = channel.isOverwriteMode() ? SessionConfigStrings.CONFIG_OVERWRITE_MODE_OVERWRITE : SessionConfigStrings.CONFIG_OVERWRITE_MODE_DISCARD; - String enabled = channel.getState().equals(TraceEnablement.ENABLED) ? SessionConfigStrings.CONFIG_STRING_TRUE : SessionConfigStrings.CONFIG_STRING_FALSE; - - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_ENABLED, enabled); - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_OVERWRITE_MODE, overwriteMode); - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_SUBBUFFER_SIZE, channel.getSubBufferSize()); - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_SUBBUFFER_COUNT, channel.getNumberOfSubBuffers()); - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_SWITCH_TIMER_INTERVAL, channel.getSwitchTimer()); - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_READ_TIMER_INTERVAL, channel.getReadTimer()); - - String outputType = channel.getOutputType().getInName().startsWith(SessionConfigStrings.CONFIG_OUTPUT_TYPE_MMAP) ? - outputType = SessionConfigStrings.CONFIG_OUTPUT_TYPE_MMAP : SessionConfigStrings.CONFIG_OUTPUT_TYPE_SPLICE; - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_OUTPUT_TYPE, outputType); - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_TRACEFILE_SIZE, channel.getMaxSizeTraceFiles()); - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_TRACEFILE_COUNT, channel.getMaxNumberTraceFiles()); - - /* - * TODO: Replace the 0 value by the channel live timer property from - * SessionInfo once live session tracing is supported - */ - addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_LIVE_TIMER_INTERVAL, SessionConfigStrings.CONFIG_STRING_ZERO); - - /* Add the events */ - channelElement.appendChild(getEventsElement(document, isKernel, channel.getEvents())); - channelsElement.appendChild(channelElement); - } - - return channelsElement; - } - - /** - * Gets the 'events' element after creating it. It is composed of the event - * informations from a list of IEventInfo. - * - * @param document - * The document in which the nodes are being added - * @param isKernel - * Is the domain type kernel - * @param events - * The event informations to be added - * @return An element containing all the event informations as XML elements - */ - private static Element getEventsElement(Document document, boolean isKernel, IEventInfo[] events) { - Element eventsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_EVENTS); - - for (IEventInfo event : events) { - Element eventElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_EVENT); - - /* Enabled attribute */ - String enabled = event.getState().equals(TraceEnablement.ENABLED) ? SessionConfigStrings.CONFIG_STRING_TRUE : SessionConfigStrings.CONFIG_STRING_FALSE; - - /* Add the attributes to the event node */ - addElementContent(document, eventElement, SessionConfigStrings.CONFIG_ELEMENT_NAME, event.getName()); - addElementContent(document, eventElement, SessionConfigStrings.CONFIG_ELEMENT_ENABLED, enabled); - TraceEventType eventType = event.getEventType(); - if (!eventType.equals(TraceEventType.UNKNOWN)) { - addElementContent(document, eventElement, SessionConfigStrings.CONFIG_ELEMENT_TYPE, eventType.getInName().toUpperCase()); - } else { - throw new IllegalArgumentException(Messages.SessionConfigXML_UnknownEventType); - } - - /* Specific to UST session config: the log level */ - if (!isKernel && !event.getLogLevel().equals(TraceLogLevel.LEVEL_UNKNOWN)) { - addElementContent(document, eventElement, SessionConfigStrings.CONFIG_ELEMENT_LOGLEVEL, event.getLogLevel().ordinal()); - } - - /* Add the node to the parent node events */ - eventsElement.appendChild(eventElement); - } - - return eventsElement; - } - - /** - * Gets the 'consumer_output' element after creating it. - * - * @param document - * The document in which the nodes are being added - * @param session - * The session informations - * @return The consumer output element with his informations as XML elements - */ - private static Element getConsumerOutputElement(Document document, ISessionInfo session) { - Element consumerOutputElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_CONSUMER_OUTPUT); - Element destinationElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DESTINATION); - - /* Value of consumer output element */ - addElementContent(document, consumerOutputElement, SessionConfigStrings.CONFIG_ELEMENT_ENABLED, SessionConfigStrings.CONFIG_STRING_TRUE); - - if (session.isStreamedTrace()) { - /* If it is a streamed session, add the net output element */ - destinationElement.appendChild(getNetOutputElement(document, session)); - } else { - addElementContent(document, destinationElement, SessionConfigStrings.CONFIG_ELEMENT_PATH, session.getSessionPath()); - } - - consumerOutputElement.appendChild(destinationElement); - return consumerOutputElement; - } - - /** - * Gets the 'net_output' element after creating it. It is composed of the - * control and data URIs. - * - * @param document - * The document in which the nodes are being added - * @param session - * The session informations - * @return The net output element - */ - private static Element getNetOutputElement(Document document, ISessionInfo session) { - Element netOutputElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_NET_OUTPUT); - - String networkUrl = session.getNetworkUrl(); - String controlUri = networkUrl == null ? session.getControlUrl() : networkUrl; - String dataUri = networkUrl == null ? session.getDataUrl() : networkUrl; - addElementContent(document, netOutputElement, SessionConfigStrings.CONFIG_ELEMENT_CONTROL_URI, controlUri); - addElementContent(document, netOutputElement, SessionConfigStrings.CONFIG_ELEMENT_DATA_URI, dataUri); - - return netOutputElement; - } - - /** - * Gets the 'snapshot_outputs' element after creating it. - * - * @param document - * The document in which the nodes are being added - * @param session - * The session informations - * @return The snapshot outputs element with snapshot informations as XML - * elements - */ - private static Element getSnapshotOuputsElement(Document document, ISessionInfo session) { - Element snapshotOutputsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_SNAPSHOT_OUTPUTS); - Element outputElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_OUTPUT); - - /* Add the name of the snapshot and the max size element */ - addElementContent(document, outputElement, SessionConfigStrings.CONFIG_ELEMENT_NAME, session.getSnapshotInfo().getName()); - - /* - * TODO: find the proper max size value of output element. For now it is - * set to the default 0 value which means unlimited for lttng. - */ - addElementContent(document, outputElement, SessionConfigStrings.CONFIG_ELEMENT_MAX_SIZE, SessionConfigStrings.CONFIG_STRING_ZERO); - outputElement.appendChild(getConsumerOutputElement(document, session)); - - snapshotOutputsElement.appendChild(outputElement); - return snapshotOutputsElement; - } - - // --------------------------------------------------------- - // Utilities - // --------------------------------------------------------- - - /** - * Validates the session configuration file against its schema. - * - * @param sessionFile - * The session configuration file - * @return The status of the validation - */ - public static IStatus sessionValidate(File sessionFile) { - URL url = SessionConfigGenerator.class.getResource(SESSION_XSD_FILENAME); - SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); - Source xmlSource = new StreamSource(sessionFile); - - try { - Schema schema = schemaFactory.newSchema(url); - Validator validator = schema.newValidator(); - validator.validate(xmlSource); - } catch (SAXParseException e) { - String error = NLS.bind(Messages.SessionConfigXML_XmlParseError, e.getLineNumber(), e.getLocalizedMessage()); - Activator.getDefault().logError(error); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); - } catch (SAXException e) { - String error = NLS.bind(Messages.SessionConfigXML_XmlValidationError, e.getLocalizedMessage()); - Activator.getDefault().logError(error); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); - } catch (IOException e) { - String error = Messages.SessionConfigXML_XmlValidateError; - Activator.getDefault().logError("IO exception occurred", e); //$NON-NLS-1$ - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); - } - return Status.OK_STATUS; - } - - /** - * Saves the session configuration into a XML file. - * - * @param document - * The document representing the session configuration file - * @param destination - * The path of the locally saved session configuration file - * @throws TransformerException - * On an transformation process - */ - private static void saveSessionConfig(Document document, String destination) throws TransformerException { - /* Write the content into a XML file */ - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ - transformer.setOutputProperty(INDENT_AMOUNT_PROPERTY_NAME, INDENT_AMOUNT_PROPERTY_VALUE); - - DOMSource source = new DOMSource(document); - StreamResult result = new StreamResult(new File(destination)); - - transformer.transform(source, result); - } - - /** - * Adds to a parent node an element with his content. - * - * @param document - * The document in which the nodes are being added - * @param parent - * The parent node that contains the element and his content - * @param elementName - * The element container name - * @param elementContent - * The content itself - */ - private static void addElementContent(Document document, Element parent, String elementName, Object elementContent) { - Element contentElement = document.createElement(elementName); - contentElement.appendChild(document.createTextNode(elementContent.toString())); - parent.appendChild(contentElement); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigStrings.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigStrings.java deleted file mode 100644 index 6e3af06cdc..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigStrings.java +++ /dev/null @@ -1,82 +0,0 @@ -/********************************************************************** - * 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: - * Guilliano Molaire - Initial API and implementation - *********************************************************************/ -package org.eclipse.linuxtools.lttng2.control.core.session; - -/** - * This file defines most markers from a session configuration file used to - * configure a trace session. They can be found in the session configuration - * schema "session.xsd" in src/common/config/ folder of LTTng-tools. - * - * @author Guilliano Molaire - * @since 3.0 - */ -@SuppressWarnings({ "javadoc", "nls" }) -public interface SessionConfigStrings { - - /* Session configuration file extension */ - static final String SESSION_CONFIG_FILE_EXTENSION = "lttng"; - - /* Elements of the session configuration file */ - static final String CONFIG_ELEMENT_SESSIONS = "sessions"; - static final String CONFIG_ELEMENT_SESSION = "session"; - static final String CONFIG_ELEMENT_DOMAINS = "domains"; - static final String CONFIG_ELEMENT_DOMAIN = "domain"; - static final String CONFIG_ELEMENT_CHANNELS = "channels"; - static final String CONFIG_ELEMENT_CHANNEL = "channel"; - static final String CONFIG_ELEMENT_EVENTS = "events"; - static final String CONFIG_ELEMENT_EVENT = "event"; - static final String CONFIG_ELEMENT_OUTPUT = "output"; - static final String CONFIG_ELEMENT_ATTRIBUTES = "attributes"; - static final String CONFIG_ELEMENT_NET_OUTPUT = "net_output"; - static final String CONFIG_ELEMENT_MAX_SIZE = "max_size"; - static final String CONFIG_ELEMENT_SNAPSHOT_OUTPUTS = "snapshot_outputs"; - static final String CONFIG_ELEMENT_CONSUMER_OUTPUT = "consumer_output"; - static final String CONFIG_ELEMENT_DESTINATION = "destination"; - static final String CONFIG_ELEMENT_CONTROL_URI = "control_uri"; - static final String CONFIG_ELEMENT_DATA_URI = "data_uri"; - static final String CONFIG_ELEMENT_SNAPSHOT_MODE = "snapshot_mode"; - static final String CONFIG_ELEMENT_PATH = "path"; - static final String CONFIG_ELEMENT_NAME = "name"; - static final String CONFIG_ELEMENT_ENABLED = "enabled"; - static final String CONFIG_ELEMENT_TYPE = "type"; - static final String CONFIG_ELEMENT_STARTED = "started"; - static final String CONFIG_ELEMENT_DOMAIN_BUFFER_TYPE = "buffer_type"; - static final String CONFIG_ELEMENT_OVERWRITE_MODE = "overwrite_mode"; - static final String CONFIG_ELEMENT_SUBBUFFER_SIZE = "subbuffer_size"; - static final String CONFIG_ELEMENT_SUBBUFFER_COUNT = "subbuffer_count"; - static final String CONFIG_ELEMENT_SWITCH_TIMER_INTERVAL = "switch_timer_interval"; - static final String CONFIG_ELEMENT_READ_TIMER_INTERVAL = "read_timer_interval"; - static final String CONFIG_ELEMENT_OUTPUT_TYPE = "output_type"; - static final String CONFIG_ELEMENT_TRACEFILE_SIZE = "tracefile_size"; - static final String CONFIG_ELEMENT_TRACEFILE_COUNT = "tracefile_count"; - static final String CONFIG_ELEMENT_LIVE_TIMER_INTERVAL = "live_timer_interval"; - static final String CONFIG_ELEMENT_LOGLEVEL_TYPE = "loglevel_type"; - static final String CONFIG_ELEMENT_LOGLEVEL = "loglevel"; - - /* Common element values */ - static final String CONFIG_STRING_TRUE = "true"; - static final String CONFIG_STRING_FALSE = "false"; - static final String CONFIG_STRING_ZERO = "0"; - - static final String CONFIG_DOMAIN_TYPE_KERNEL = "KERNEL"; - static final String CONFIG_DOMAIN_TYPE_UST = "UST"; - - static final String CONFIG_BUFFER_TYPE_PER_UID = "PER_UID"; - static final String CONFIG_BUFFER_TYPE_PER_PID = "PER_PID"; - static final String CONFIG_BUFFER_TYPE_GLOBAL = "GLOBAL"; - - static final String CONFIG_OVERWRITE_MODE_DISCARD = "DISCARD"; - static final String CONFIG_OVERWRITE_MODE_OVERWRITE = "OVERWRITE"; - - static final String CONFIG_OUTPUT_TYPE_SPLICE = "SPLICE"; - static final String CONFIG_OUTPUT_TYPE_MMAP = "MMAP"; -} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/messages.properties b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/messages.properties deleted file mode 100644 index c0d252d198..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/messages.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# 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: -# Guilliano Molaire - Initial API and implementation -############################################################################### - -SessionConfigXML_BadRequirementType=The requirement type is not supported -SessionConfigXML_DomainTypeMissing=The domain requirement type is missing -SessionConfigXML_EventTypeMissing=The event requirement type is missing -SessionConfigXML_InvalidSessionInfoList=The list of session is empty or null -SessionConfigXML_InvalidTraceSessionPath=The trace session path is not valid -SessionConfigXML_UnknownEventType=The event type is not handled by the session configuration -SessionConfigXML_UnknownDomainBufferType=The domain buffer type is not handled by the session configuration -SessionConfigXML_SessionConfigGenerationError=An error occurred while generating the session configuration file -SessionConfigXML_XmlParseError=XML Parsing error at line {0}: {1} -SessionConfigXML_XmlValidateError=An error occurred while validating the XML file. -SessionConfigXML_XmlValidationError=Error validating XML file {0} diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/session.xsd b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/session.xsd deleted file mode 100644 index 7c3e9d8fc6..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/session.xsd +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/.classpath b/org.eclipse.linuxtools.lttng2.control.ui.tests/.classpath deleted file mode 100644 index f1d3296b72..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/.project b/org.eclipse.linuxtools.lttng2.control.ui.tests/.project deleted file mode 100644 index b92abe85bb..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.control.ui.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f3fc64575b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,393 +0,0 @@ -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=enabled -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 diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 62cfa90dee..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.control.ui.tests/META-INF/MANIFEST.MF deleted file mode 100644 index c631f71d81..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,29 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.control.ui.tests;singleton:=true -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Require-Bundle: org.junit;bundle-version="4.0.0", - org.eclipse.core.commands, - org.eclipse.core.runtime, - org.eclipse.ui, - org.eclipse.ui.ide, - org.eclipse.linuxtools.lttng2.control.core;bundle-version="3.1.0", - org.eclipse.linuxtools.lttng2.control.ui;bundle-version="3.1.0" -Import-Package: org.eclipse.rse.core, - org.eclipse.rse.core.model, - org.eclipse.rse.core.subsystems, - org.eclipse.rse.services.shells, - org.eclipse.rse.services.terminals, - org.eclipse.rse.subsystems.files.core, - org.eclipse.rse.subsystems.files.core.servicesubsystem -Export-Package: org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs;x-internal:=true, - org.eclipse.linuxtools.internal.lttng2.control.stubs.service;x-internal:=true, - org.eclipse.linuxtools.internal.lttng2.control.stubs.shells;x-internal:=true, - org.eclipse.linuxtools.lttng2.control.ui.tests;x-friends:="org.eclipse.linuxtools.lttng.alltests", - org.eclipse.linuxtools.lttng2.control.ui.tests.model.component;x-internal:=true, - org.eclipse.linuxtools.lttng2.control.ui.tests.service;x-internal:=true diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/about.html b/org.eclipse.linuxtools.lttng2.control.ui.tests/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/build.properties b/org.eclipse.linuxtools.lttng2.control.ui.tests/build.properties deleted file mode 100644 index 370858e81e..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -source.. = src/,\ - stubs/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties -src.includes = about.html diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/plugin.properties b/org.eclipse.linuxtools.lttng2.control.ui.tests/plugin.properties deleted file mode 100644 index cfd871204f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/plugin.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.control.ui.tests -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Control UI Tests Plug-in diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/pom.xml b/org.eclipse.linuxtools.lttng2.control.ui.tests/pom.xml deleted file mode 100644 index b21af36520..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.control.ui.tests - 3.1.0-SNAPSHOT - eclipse-test-plugin - - Linux Tools LTTng Control UI Tests Plug-in - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - org.eclipse.linuxtools.lttng2.control.ui.tests - org.eclipse.linuxtools.lttng2.control.ui.tests.AllTests - true - true - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide - - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/ActivatorTest.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/ActivatorTest.java deleted file mode 100644 index 7878ac0732..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/ActivatorTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.control.ui.tests; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -/** - * Test suite for the Activator class - */ -public class ActivatorTest { - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.ui.Activator#Activator}. - */ - @Test - public void testActivator() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.ui.Activator#getDefault}. - */ - @Test - public void testGetDefault() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.ui.Activator#start}. - */ - @Test - public void testStartBundleContext() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.ui.Activator#stop}. - */ - @Test - public void testStopBundleContext() { - assertTrue(true); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/AllTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/AllTests.java deleted file mode 100644 index 9d884e8921..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/AllTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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 - * Alexandre Montplaisir - Port to JUnit4 - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Runner for the test suite - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - ActivatorTest.class, - org.eclipse.linuxtools.lttng2.control.ui.tests.model.component.AllTests.class, - org.eclipse.linuxtools.lttng2.control.ui.tests.service.AllTests.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/AllTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/AllTests.java deleted file mode 100644 index 5ae2c88ac0..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/AllTests.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Runner for the model.component unit tests. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - TraceControlComponentTest.class, - TraceControlCreateSessionTests.class, - TraceControlCreateSessionMiTests.class, - TraceControlKernelProviderTests.class, - TraceControlKernelSessionTests.class, - TraceControlPropertiesTest.class, - TraceControlTreeModelNoProvidersTest.class, - TraceControlTreeModelTest.class, - TraceControlUstProviderTests.class, - TraceControlUstSessionTests.class, - TraceControlUstSessionTests2.class, - TraceControlSnapshotSessionTests.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/ListenerValidator.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/ListenerValidator.java deleted file mode 100644 index 9dbd99fada..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/ListenerValidator.java +++ /dev/null @@ -1,94 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponentChangedListener; - -/** - * The class can be used to validate the listener interface. - */ -@SuppressWarnings("javadoc") -public class ListenerValidator implements ITraceControlComponentChangedListener { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - private boolean fisAddedCalled = false; - private boolean fisRemoveCalled = false; - private boolean fisChangedCalled = false; - - private ITraceControlComponent fParent = null; - private ITraceControlComponent fChild = null; - private ITraceControlComponent fChangedComponent = null; - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - public boolean isAddedCalled() { - return fisAddedCalled; - } - - public boolean isRemovedCalled() { - return fisRemoveCalled; - } - - public boolean isChangedCalled() { - return fisChangedCalled; - } - - public ITraceControlComponent getSavedParent() { - return fParent; - } - - public ITraceControlComponent getSavedChild() { - return fChild; - } - - public ITraceControlComponent getSavedComponent() { - return fChangedComponent; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - public void initialize() { - fisAddedCalled = false; - fisRemoveCalled = false; - fisChangedCalled = false; - fParent = null; - fChild = null; - fChangedComponent = null; - } - - @Override - public void componentAdded(ITraceControlComponent parent, ITraceControlComponent component) { - fisAddedCalled = true; - fParent = parent; - fChild = component; - } - - @Override - public void componentRemoved(ITraceControlComponent parent, ITraceControlComponent component) { - fisRemoveCalled = true; - fParent = parent; - fChild = component; - } - - @Override - public void componentChanged(ITraceControlComponent component) { - fisChangedCalled = true; - fParent = null; - fChangedComponent = component; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlComponentTest.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlComponentTest.java deleted file mode 100644 index 74d4b1e439..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlComponentTest.java +++ /dev/null @@ -1,540 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponentChangedListener; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlRoot; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlService; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceMI; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.PlatformUI; -import org.junit.Test; - -/** - * The class TraceControlComponentTest contains tests for the class - * {@link TraceControlComponent}. - */ -public class TraceControlComponentTest { - - /** - * Run the TraceControlComponent(String) constructor test. - */ - @Test - public void testTraceControlComponent_1() { - - String name = "node"; - - TraceControlComponent result = new TraceControlComponent(name); - - assertNotNull(result); - assertEquals(name, result.getName()); - assertEquals(null, result.getParent()); - assertEquals(false, result.hasChildren()); - assertEquals(null, result.getImage()); - assertEquals(null, result.getControlService()); - assertEquals(null, result.getToolTip()); - } - - /** - * Run the TraceControlComponent(String,ITraceControlComponent) constructor test. - */ - @Test - public void testTraceControlComponent_2() { - String name = "node"; - - ITraceControlComponent parent = new TraceControlRoot(); - TraceControlComponent result = new TraceControlComponent(name, parent); - - assertNotNull(result); - assertEquals(name, result.getName()); - assertEquals(false, result.hasChildren()); - assertEquals(null, result.getImage()); - assertEquals(null, result.getControlService()); - assertEquals(null, result.getToolTip()); - } - - /** - * Run the void addChild(ITraceControlComponent) method test. - */ - @Test - public void testAddAndGetChild1() { - TraceControlComponent fixture = new TraceControlComponent("node", new TraceControlRoot()); - fixture.setToolTip("This is the test node"); - fixture.addChild(new TraceControlRoot()); - ITraceControlComponent component = new TraceControlRoot(); - fixture.addChild(component); - - ITraceControlComponent child = fixture.getChild(TraceControlRoot.TRACE_CONTROL_ROOT_NAME); - assertNotNull(child); - assertEquals(TraceControlRoot.TRACE_CONTROL_ROOT_NAME, child.getName()); - } - - /** - * Run the void addChild(ITraceControlComponent) method test. - */ - @Test - public void testAddAndGetChild2() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - ITraceControlComponent component = null; - - fixture.addChild(component); - assertFalse(fixture.hasChildren()); - } - - /** - * Run the void addComponentListener(ITraceControlComponentChangedListener) method test. - */ - @Test - public void testAddComponentListener_1() { - TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null); - fixture.setToolTip(""); - - ListenerValidator validator = new ListenerValidator(); - fixture.addComponentListener(validator); - - TraceControlRoot root = new TraceControlRoot(); - fixture.addChild(root); - assertTrue(validator.isAddedCalled()); - - fixture.removeChild(root); - assertTrue(validator.isRemovedCalled()); - - fixture.fireComponentChanged(fixture); - assertTrue(validator.isChangedCalled()); - } - - /** - * Run the boolean containsChild(String) method test. - */ - @Test - public void testContainsChild_1() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - fixture.addChild(new TraceControlRoot()); - String name = "node"; - - boolean result = fixture.containsChild(name); - - assertEquals(false, result); - } - - /** - * Run the boolean containsChild(String) method test. - */ - @Test - public void testContainsChild_2() { - TraceControlComponent fixture = new TraceControlComponent("name", new TraceControlRoot()); - fixture.setToolTip(""); - - boolean result = fixture.containsChild(TraceControlRoot.TRACE_CONTROL_ROOT_NAME); - - assertEquals(false, result); - } - - /** - * Run the void fireCompenentAdded(ITraceControlComponent,ITraceControlComponent) method test. - * Run the void fireCompenentRemoved(ITraceControlComponent,ITraceControlComponent) method test. - * Run the void fireCompenentChanged(ITraceControlComponent) method test - */ - @Test - public void testFireCompenentUpdated() { - ITraceControlComponent parent = new TraceControlRoot(); - - TraceControlComponent fixture = new TraceControlComponent("node", parent); - fixture.setToolTip(""); - - ITraceControlComponent component = new TraceControlComponent("child"); - fixture.addChild(component); - - ListenerValidator validator = new ListenerValidator(); - fixture.addComponentListener(validator); - - fixture.fireComponentAdded(parent, component); - assertTrue(validator.isAddedCalled()); - assertEquals(parent.getName(), validator.getSavedParent().getName()); - assertEquals(component.getName(), validator.getSavedChild().getName()); - - validator.initialize(); - - fixture.fireComponentRemoved(parent, component); - assertTrue(validator.isRemovedCalled()); - assertEquals(parent.getName(), validator.getSavedParent().getName()); - assertEquals(component.getName(), validator.getSavedChild().getName()); - - validator.initialize(); - fixture.fireComponentChanged(fixture); - assertTrue(validator.isChangedCalled()); - assertEquals(fixture.getName(), validator.getSavedComponent().getName()); - } - - /** - * Run the Object getAdapter(Class) method test. - */ - @Test - public void testGetAdapter() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - fixture.addChild(new TraceControlRoot()); - Class adapter = Object.class; - - Object result = fixture.getAdapter(adapter); - - assertEquals(null, result); - } - - /** - * Run the ITraceControlComponent[] getChildren() method test. - */ - @Test - public void testGetChildren_1() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - fixture.addChild(new TraceControlRoot()); - - ITraceControlComponent[] result = fixture.getChildren(); - - assertNotNull(result); - assertEquals(1, result.length); - assertNotNull(result[0]); - assertEquals("trace_control_root", result[0].getName()); - assertEquals(null, result[0].getParent()); - assertEquals(false, result[0].hasChildren()); - assertEquals(null, result[0].getImage()); - assertEquals(null, result[0].getControlService()); - assertEquals(null, result[0].getToolTip()); - } - - /** - * Run the ILttngControlService getControlService()/setControlService() - * method test. - * - * @throws ExecutionException - * Would fail the test - */ - @Test - public void testGetAndSetControlService_1() throws ExecutionException { - - TraceControlComponent parent = new TraceControlComponent("parent") { - ILttngControlService fService = null; - - @Override - public void setControlService(ILttngControlService service ) { - fService = service; - } - - @Override - public ILttngControlService getControlService() { - return fService; - } - }; - - TraceControlComponent fixture = new TraceControlComponent("", parent); - parent.addChild(fixture); - fixture.setToolTip(""); - TraceControlComponent child = new TraceControlComponent("child", fixture); - fixture.addChild(child); - - ILttngControlService result = fixture.getControlService(); - assertEquals(null, result); - - TestRemoteSystemProxy proxy = new TestRemoteSystemProxy(); - ILttngControlService service = new LTTngControlService(proxy.createCommandShell()); - fixture.setControlService(service); - result = fixture.getControlService(); - assertNotNull(service); - assertEquals(service, result); - - service = new LTTngControlServiceMI(proxy.createCommandShell(), LTTngControlServiceMI.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME)); - fixture.setControlService(service); - result = fixture.getControlService(); - assertNotNull(service); - assertEquals(service, result); - - result = fixture.getChildren()[0].getControlService(); - assertNotNull(service); - assertEquals(service, result); - } - - /** - * Run the Image getImage() method test. - */ - @Test - public void testGetImage_1() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - fixture.addChild(new TraceControlRoot()); - - Image result = fixture.getImage(); - assertEquals(null, result); - - fixture.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER)); - assertNotNull(fixture.getImage()); - } - - /** - * Run the boolean hasChildren() method test. - */ - @Test - public void testHasChildren_1() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - fixture.addChild(new TraceControlRoot()); - - boolean result = fixture.hasChildren(); - - assertTrue(result); - } - - /** - * Run the boolean hasChildren() method test. - */ - @Test - public void testHasChildren_2() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - - boolean result = fixture.hasChildren(); - - assertFalse(result); - } - - /** - * Run the void removeAllChildren() method test. - */ - @Test - public void testRemoveAllChildren_2() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - - fixture.addChild(new TraceControlRoot()); - fixture.addChild(new TraceControlComponent("child")); - - fixture.removeAllChildren(); - assertFalse(fixture.hasChildren()); - } - - /** - * Run the void removeChild(ITraceControlComponent) method test. - */ - @Test - public void testRemoveChild_1() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - TraceControlComponent child = new TraceControlComponent("child", fixture); - - fixture.addChild(child); - fixture.removeChild(child); - assertFalse(fixture.hasChildren()); - } - - /** - * Run the void removeChild(ITraceControlComponent) method test. - */ - @Test - public void testRemoveChild_2() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - fixture.addChild(new TraceControlRoot()); - ITraceControlComponent component = null; - - fixture.removeChild(component); - assertTrue(fixture.hasChildren()); - } - - /** - * Run the void removeComponentListener(ITraceControlComponentChangedListener) method test. - */ - @Test - public void testRemoveComponentListener_1() { - TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null); - fixture.setToolTip(""); - - ListenerValidator validator = new ListenerValidator(); - fixture.addComponentListener(validator); - - // Remove listener and check that validator is not called anymore - validator.initialize(); - fixture.removeComponentListener(validator); - TraceControlRoot root = new TraceControlRoot(); - fixture.addChild(root); - assertFalse(validator.isAddedCalled()); - - fixture.removeChild(root); - assertFalse(validator.isRemovedCalled()); - - fixture.fireComponentChanged(fixture); - assertFalse(validator.isChangedCalled()); - } - - /** - * Run the void removeComponentListener(ITraceControlComponentChangedListener) method test. - */ - @Test - public void testRemoveComponentListener_2() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - fixture.addChild(new TraceControlRoot()); - ITraceControlComponentChangedListener listener = new ControlView(); - - fixture.removeComponentListener(listener); - - } - - /** - * Run the void setChildren(List)/ITraceControlComponent[] getChildren() method test. - */ - @Test - public void testGetAndSetChildren() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - List children = new LinkedList<>(); - children.add(new TraceControlComponent("child1")); - children.add(new TraceControlComponent("child2")); - - fixture.setChildren(children); - - ITraceControlComponent[] result = fixture.getChildren(); - assertEquals(2, result.length); - assertEquals("child1", result[0].getName()); - assertEquals("child2", result[1].getName()); - } - - /** - * Run the void String getName()/setName(String) method tests. - */ - @Test - public void testGetAndSetName() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - fixture.addChild(new TraceControlRoot()); - String name = "node"; - - fixture.setName(name); - assertEquals(name,fixture.getName()); - - } - - /** - * Run the void ITraceControlComponent getParent()/setParent(ITraceControlComponent) method tests. - */ - @Test - public void testGetAndSetParent() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip(""); - fixture.addChild(new TraceControlRoot()); - ITraceControlComponent parent = new TraceControlRoot(); - parent.addChild(fixture); - - fixture.setParent(parent); - ITraceControlComponent retrievedParent = fixture.getParent(); - assertNotNull(retrievedParent); - assertEquals(parent.getName(), retrievedParent.getName()); - assertEquals(TraceControlRoot.TRACE_CONTROL_ROOT_NAME, retrievedParent.getName()); - assertEquals(null, retrievedParent.getParent()); - assertEquals(true, retrievedParent.hasChildren()); - } - - /** - * Run the void TargetNodeState getTargetNodeState()/etTargetNodeState(TargetNodeState) method tests. - */ - @Test - public void testGetAndSetTargetNodeState_1() { - TraceControlComponent parent = new TraceControlComponent("parent") { - private TargetNodeState fState; - - @Override - public void setTargetNodeState(TargetNodeState state ) { - fState = state; - } - - @Override - public TargetNodeState getTargetNodeState() { - return fState; - } - }; - - TraceControlComponent fixture = new TraceControlComponent("", parent); - parent.addChild(fixture); - - fixture.setToolTip(""); - TargetNodeState state = TargetNodeState.CONNECTED; - - fixture.setTargetNodeState(state); - TargetNodeState result = fixture.getTargetNodeState(); - - assertNotNull(result); - assertEquals(state, result); - // Check also parent - assertEquals(state, fixture.getParent().getTargetNodeState()); - assertEquals("CONNECTED", result.name()); - assertEquals("CONNECTED", result.toString()); - assertEquals(2, result.ordinal()); - - fixture.setTargetNodeState(TargetNodeState.DISCONNECTED); - result = fixture.getTargetNodeState(); - assertNotNull(result); - assertEquals("DISCONNECTED", result.name()); - assertEquals("DISCONNECTED", result.toString()); - assertEquals(0, result.ordinal()); - - state = TargetNodeState.CONNECTING; - - fixture.setTargetNodeState(state); - result = fixture.getTargetNodeState(); - assertNotNull(result); - assertEquals("CONNECTING", result.name()); - assertEquals("CONNECTING", result.toString()); - assertEquals(3, result.ordinal()); - - fixture.setTargetNodeState(TargetNodeState.DISCONNECTING); - result = fixture.getTargetNodeState(); - assertNotNull(result); - assertEquals("DISCONNECTING", result.name()); - assertEquals("DISCONNECTING", result.toString()); - assertEquals(1, result.ordinal()); - - } - - /** - * Run the void setToolTip(String) method test. - */ - @Test - public void testGetSndSetToolTip() { - TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); - fixture.setToolTip("This is a tooltip"); - fixture.addChild(new TraceControlRoot()); - - String result = fixture.getToolTip(); - - assertEquals("This is a tooltip", result); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTests.java deleted file mode 100644 index bb287f133a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/********************************************************************** - * 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: - * Jonathan Rajotte - Support for machine interface LTTng 2.6 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -/** - * Machine interface Kernel session manipulation handling test cases. - * LTTng 2.6 - */ -public class TraceControlCreateSessionMiTests extends TraceControlCreateSessionTests { - - private static final String TEST_STREAM = "CreateSessionTestMi.cfg"; - - @Override - protected String getTestStream() { - return TEST_STREAM; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTests.java deleted file mode 100644 index 50611ca5a2..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTests.java +++ /dev/null @@ -1,284 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Jonathan Rajotte - Support for LTTng 2.6 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class {@link TraceControlKernelSessionTests} contains Kernel - * session/channel/event handling test cases. - */ -public class TraceControlCreateSessionTests { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - private static final String TEST_STREAM = "CreateSessionTest.cfg"; - private static final String SCEN_SCENARIO_FILE_PROTO_TEST = "CreateSessionFileProto"; - private static final String SCEN_SCENARIO_CONTROL_DATA_TEST = "CreateSessionControlData"; - private static final String SCEN_SCENARIO_NETWORK_TEST = "CreateSessionNetwork"; - private static final String SCEN_SCENARIO_NETWORK2_TEST = "CreateSessionNetwork2"; - - private static final String SESSION = "mysession"; - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - private TraceControlTestFacility fFacility; - private TestRemoteSystemProxy fProxy; - private String fTestFile; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fFacility = TraceControlTestFacility.getInstance(); - fFacility.init(); - fProxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + getTestStream()), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestFile = testfile.getAbsolutePath(); - } - - /** - * Get the test stream file name to use for the test suite - * - * @return the name of the test stream file - */ - protected String getTestStream() { - return TEST_STREAM; - } - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - fFacility.waitForJobs(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * on internal error - */ - @Test - public void testTraceSessionTree() throws Exception { - - fProxy.setTestFile(fTestFile); - fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); - - ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); - - root.addChild(node); - fFacility.waitForJobs(); - - fFacility.executeCommand(node, "connect"); - int i = 0; - while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { - i++; - fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); - } - - // Verify that node is connected - assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); - - ILttngControlService controleService = node.getControlService(); - - // Get provider groups - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - // Initialize dialog implementations for command execution - CreateSessionDialogStub sessionDialogStub = new CreateSessionDialogStub(); - TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub); - TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); - - // ------------------------------------------------------------------------ - // Create session (--U file://...) and destroy - // ------------------------------------------------------------------------ - // Initialize session handling scenario - fProxy.setScenario(SCEN_SCENARIO_FILE_PROTO_TEST); - - sessionDialogStub.setNetworkUrl("file:///tmp"); - sessionDialogStub.setStreamedTrace(true); - TraceSessionComponent session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals(getSessionName(), session.getName()); - if (controleService.isVersionSupported("2.6.0")) { - assertEquals("/tmp", session.getSessionPath()); - } else { - assertEquals("file:///tmp", session.getSessionPath()); - } - - assertTrue(!session.isStreamedTrace()); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - sessionDialogStub.setNetworkUrl(null); - sessionDialogStub.setStreamedTrace(false); - - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - // ------------------------------------------------------------------------ - // Create session (--U file://,,, and destroy - // ------------------------------------------------------------------------ - // Initialize session handling scenario - fProxy.setScenario(SCEN_SCENARIO_CONTROL_DATA_TEST); - - sessionDialogStub.setControlUrl("tcp://172.0.0.1"); - sessionDialogStub.setDataUrl("tcp://172.0.0.1:5343"); - sessionDialogStub.setStreamedTrace(true); - - session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals(getSessionName(), session.getName()); - if (controleService.isVersionSupported("2.6.0")) { - assertEquals("tcp4://172.0.0.1:5342/ [data: 5343]", session.getSessionPath()); - } else { - assertEquals("tcp://172.0.0.1:5342 [data: 5343]", session.getSessionPath()); - } - assertTrue(session.isStreamedTrace()); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - sessionDialogStub.setControlUrl(null); - sessionDialogStub.setDataUrl(null); - sessionDialogStub.setStreamedTrace(false); - - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - // ------------------------------------------------------------------------ - // Create session (--U file://... and destroy - // ------------------------------------------------------------------------ - // Initialize session handling scenario - fProxy.setScenario(SCEN_SCENARIO_NETWORK_TEST); - - sessionDialogStub.setNetworkUrl("net://172.0.0.1:1234:2345"); - sessionDialogStub.setStreamedTrace(true); - - session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals(getSessionName(), session.getName()); - if (controleService.isVersionSupported("2.6.0")) { - assertEquals("tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]", session.getSessionPath()); - } else { - assertEquals("net://172.0.0.1:1234 [data: 2345]", session.getSessionPath()); - } - assertTrue(session.isStreamedTrace()); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - sessionDialogStub.setNetworkUrl(null); - - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - // ------------------------------------------------------------------------ - // Create session (--U net6://[...] and destroy - // ------------------------------------------------------------------------ - // Initialize session handling scenario - fProxy.setScenario(SCEN_SCENARIO_NETWORK2_TEST); - - sessionDialogStub.setNetworkUrl("net6://[ffff::eeee:dddd:cccc:0]"); - sessionDialogStub.setStreamedTrace(true); - - session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals(getSessionName(), session.getName()); - if (controleService.isVersionSupported("2.6.0")) { - assertEquals("tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]", session.getSessionPath()); - } else { - assertEquals("net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]", session.getSessionPath()); - } - assertTrue(session.isStreamedTrace()); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - sessionDialogStub.setNetworkUrl(null); - - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - // ------------------------------------------------------------------------- - // Disconnect node - // ------------------------------------------------------------------------- - fFacility.executeCommand(node, "disconnect"); - assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); - - // ------------------------------------------------------------------------- - // Delete node - // ------------------------------------------------------------------------- - - fFacility.executeCommand(node, "delete"); - assertEquals(0, fFacility.getControlView().getTraceControlRoot().getChildren().length); - } - - private static String getSessionName() { - return SESSION; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTests.java deleted file mode 100644 index 2a77d8c477..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTests.java +++ /dev/null @@ -1,271 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class TraceControlKernelProviderTests contains UST provider - * handling test cases. - */ -public class TraceControlKernelProviderTests { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private static final String TEST_STREAM = "CreateTreeTest.cfg"; - private static final String SCEN_SCENARIO1_TEST = "Scenario1"; - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private TraceControlTestFacility fFacility; - private TestRemoteSystemProxy fProxy; - private String fTestFile; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fFacility = TraceControlTestFacility.getInstance(); - fFacility.init(); - fProxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestFile = testfile.getAbsolutePath(); - } - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - fFacility.waitForJobs(); - fFacility.dispose(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * Would fail the test - */ - @Test - public void testKernelProviderTree() throws Exception { - - fProxy.setTestFile(fTestFile); - fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); - - ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); - - root.addChild(node); - - fFacility.waitForJobs(); - - fFacility.executeCommand(node, "connect"); - int i = 0; - while ((i < 20) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { - i++; - fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); - } - - // Verify that node is connected - assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); - - // Get provider and session group - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - // Check for kernel provider - TraceProviderGroup providerGroup = (TraceProviderGroup) groups[0]; - assertTrue(providerGroup.hasKernelProvider()); - - // Get kernel provider - ITraceControlComponent[] providers = providerGroup.getChildren(); - KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0]; - - // Get kernel provider events and select 2 events - ITraceControlComponent[] events = kernelProvider.getChildren(); - assertNotNull(events); - assertEquals(3, events.length); - - BaseEventComponent baseEventInfo0 = (BaseEventComponent) events[0]; - BaseEventComponent baseEventInfo1 = (BaseEventComponent) events[1]; - - // Initialize dialog implementations for command execution - TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); - TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); - TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); - - // Initialize session handling scenario - fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); - - // ------------------------------------------------------------------------ - // Create session - // ------------------------------------------------------------------------ - TraceSessionComponent session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals("mysession", session.getName()); - assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath()); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - - // ------------------------------------------------------------------------ - // Enable event on default channel on created session above - // ------------------------------------------------------------------------ - // Initialize scenario - fProxy.setScenario(SCEN_SCENARIO1_TEST); - - ITraceControlComponent[] components = { baseEventInfo0, baseEventInfo1 }; - - fFacility.executeCommand(components, "assign.event"); - - // Verify that kernel domain was created - ITraceControlComponent[] domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - assertEquals("Kernel", domains[0].getName()); - - // Verify that channel0 was created with default values - ITraceControlComponent[] channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(1, channels.length); - - assertTrue(channels[0] instanceof TraceChannelComponent); - TraceChannelComponent channel = (TraceChannelComponent) channels[0]; - assertEquals("channel0", channel.getName()); - assertEquals(4, channel.getNumberOfSubBuffers()); - assertEquals("splice()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); - assertEquals(false, channel.isOverwriteMode()); - assertEquals(200, channel.getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channel.getState()); - assertEquals(262144, channel.getSubBufferSize()); - assertEquals(0, channel.getSwitchTimer()); - - // Verify that event components were created - ITraceControlComponent[] channel0Events = channel.getChildren(); - assertNotNull(channel0Events); - assertEquals(2, channel0Events.length); - assertTrue(channel0Events[0] instanceof TraceEventComponent); - assertTrue(channel0Events[1] instanceof TraceEventComponent); - - TraceEventComponent event = (TraceEventComponent) channel0Events[0]; - assertEquals("sched_kthread_stop_ret", event.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - TraceEventComponent event1 = (TraceEventComponent) channel0Events[1]; - assertEquals("sched_kthread_stop", event1.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event1.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event1.getEventType()); - assertEquals(TraceEnablement.ENABLED, event1.getState()); - - // ------------------------------------------------------------------------ - // Disable event components - // ------------------------------------------------------------------------ - ITraceControlComponent[] selection = { event, event1 }; - fFacility.executeCommand(selection, "disableEvent"); - - assertEquals(TraceEnablement.DISABLED, event.getState()); - assertEquals(TraceEnablement.DISABLED, event1.getState()); - - // ------------------------------------------------------------------------ - // Enable event component - // ------------------------------------------------------------------------ - fFacility.executeCommand(event1, "enableEvent"); - - // Verify event state - assertEquals(TraceEnablement.ENABLED, event1.getState()); - - // ------------------------------------------------------------------------ - // Destroy session - // ------------------------------------------------------------------------ - // Initialize session handling scenario - fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); - - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - //------------------------------------------------------------------------- - // Disconnect node - //------------------------------------------------------------------------- - fFacility.executeCommand(node, "disconnect"); - assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); - - //------------------------------------------------------------------------- - // Delete node - //------------------------------------------------------------------------- - fFacility.executeCommand(node, "delete"); - assertEquals(0, fFacility.getControlView().getTraceControlRoot().getChildren().length); - - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTests.java deleted file mode 100644 index 3ae9a82730..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTests.java +++ /dev/null @@ -1,823 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -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.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.AddContextDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableEventsDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class TraceControlKernelSessionTests contains Kernel - * session/channel/event handling test cases. - */ -public class TraceControlKernelSessionTests { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private static final String TEST_STREAM = "CreateTreeTest.cfg"; - private static final String SCEN_SCENARIO3_TEST = "Scenario3"; - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private TraceControlTestFacility fFacility; - private TestRemoteSystemProxy fProxy; - private String fTestFile; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fFacility = TraceControlTestFacility.getInstance(); - fFacility.init(); - fProxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestFile = testfile.getAbsolutePath(); - } - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - fFacility.waitForJobs(); - fFacility.dispose(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * Would fail the test - */ - @Test - public void testTraceSessionTree() throws Exception { - - fProxy.setTestFile(fTestFile); - fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); - - ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); - - root.addChild(node); - fFacility.waitForJobs(); - - fFacility.executeCommand(node, "connect"); - int i = 0; - while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { - i++; - fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); - } - - // Verify that node is connected - assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); - - // Get provider groups - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - // Initialize dialog implementations for command execution - TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); - TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); - TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); - - // Initialize session handling scenario - fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); - - // ------------------------------------------------------------------------ - // Create session - // ------------------------------------------------------------------------ - TraceSessionComponent session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals("mysession", session.getName()); - assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath()); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - - // Initialize scenario - fProxy.setScenario(SCEN_SCENARIO3_TEST); - - // ------------------------------------------------------------------------ - // Enable channel on session - // ------------------------------------------------------------------------ - EnableChannelDialogStub channelStub = new EnableChannelDialogStub(); - channelStub.setIsKernel(true); - TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub); - - fFacility.executeCommand(session, "enableChannelOnSession"); - - // Verify that Kernel domain was created - ITraceControlComponent[] domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - assertEquals("Kernel", domains[0].getName()); - - // Verify that channel was created with correct data - ITraceControlComponent[] channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(1, channels.length); - - assertTrue(channels[0] instanceof TraceChannelComponent); - TraceChannelComponent channel = (TraceChannelComponent) channels[0]; - assertEquals("mychannel", channel.getName()); - assertEquals(4, channel.getNumberOfSubBuffers()); - assertEquals("splice()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); - assertEquals(true, channel.isOverwriteMode()); - assertEquals(200, channel.getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channel.getState()); - assertEquals(16384, channel.getSubBufferSize()); - assertEquals(100, channel.getSwitchTimer()); - - // ------------------------------------------------------------------------ - // Create channel on domain - // ------------------------------------------------------------------------ - ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo(); - info.setName("mychannel2"); - info.setOverwriteMode(false); - info.setSubBufferSize(32768); - info.setNumberOfSubBuffers(2); - info.setSwitchTimer(100); - info.setReadTimer(200); - channelStub.setChannelInfo(info); - - fFacility.executeCommand(domains[0], "enableChannelOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(2, channels.length); - - assertTrue(channels[1] instanceof TraceChannelComponent); - channel = (TraceChannelComponent) channels[1]; - assertEquals("mychannel2", channel.getName()); - assertEquals(2, channel.getNumberOfSubBuffers()); - assertEquals("splice()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); - assertEquals(false, channel.isOverwriteMode()); - assertEquals(200, channel.getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channel.getState()); - assertEquals(32768, channel.getSubBufferSize()); - assertEquals(100, channel.getSwitchTimer()); - - EnableEventsDialogStub eventsDialogStub = new EnableEventsDialogStub(); - eventsDialogStub.setIsTracePoints(true); - List events = new ArrayList<>(); - events.add("sched_kthread_stop"); - events.add("sched_kthread_stop_ret"); - eventsDialogStub.setNames(events); - eventsDialogStub.setIsKernel(true); - TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub); - - // ------------------------------------------------------------------------ - // disable channels - // ------------------------------------------------------------------------ - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(2, channels.length); - - fFacility.executeCommand(channels, "disableChannel"); - - assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[0]).getState()); - assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[1]).getState()); - - // ------------------------------------------------------------------------ - // enable channels - // ------------------------------------------------------------------------ - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(2, channels.length); - - fFacility.executeCommand(channels, "enableChannel"); - - assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[0]).getState()); - assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[1]).getState()); - - // ------------------------------------------------------------------------ - // enable event (tracepoints) on session - // ------------------------------------------------------------------------ - fFacility.executeCommand(session, "enableEventOnSession"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(3, channels.length); - - assertTrue(channels[2] instanceof TraceChannelComponent); - channel = (TraceChannelComponent) channels[2]; - assertEquals("channel0", channel.getName()); - // No need to check parameters of default channel because that has been done in other tests - - ITraceControlComponent[] channel0Events = channel.getChildren(); - assertEquals(2, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - assertTrue(channel0Events[1] instanceof TraceEventComponent); - - TraceEventComponent event = (TraceEventComponent) channel0Events[0]; - assertEquals("sched_kthread_stop_ret", event.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - event = (TraceEventComponent) channel0Events[1]; - assertEquals("sched_kthread_stop", event.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // enable event (tracepoints) on domain - // ------------------------------------------------------------------------ - events.clear(); - events.add("sched_wakeup_new"); - eventsDialogStub.setNames(events); - - fFacility.executeCommand(domains[0], "enableEventOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel = (TraceChannelComponent) channels[2]; - - channel0Events = channel.getChildren(); - assertEquals(3, channel0Events.length); - - assertTrue(channel0Events[2] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[2]; - assertEquals("sched_wakeup_new", event.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // enable event (tracepoints) on channel - // ------------------------------------------------------------------------ - events.clear(); - eventsDialogStub.setNames(events); - eventsDialogStub.setIsAllTracePoints(true); - - fFacility.executeCommand(channels[1], "enableEventOnChannel"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - // No need to check parameters of default channel because that has been done in other tests - channel = (TraceChannelComponent) channels[1]; - - channel0Events = channel.getChildren(); - assertEquals(3, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - assertTrue(channel0Events[1] instanceof TraceEventComponent); - assertTrue(channel0Events[2] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("sched_kthread_stop_ret", event.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - event = (TraceEventComponent) channel0Events[1]; - assertEquals("sched_kthread_stop", event.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - event = (TraceEventComponent) channel0Events[2]; - assertEquals("sched_wakeup_new", event.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // enable event (syscall) on channel - // ------------------------------------------------------------------------ - events.clear(); - eventsDialogStub.setIsTracePoints(false); - eventsDialogStub.setIsAllTracePoints(false); - eventsDialogStub.setIsSysCalls(true); - - fFacility.executeCommand(channels[0], "enableEventOnChannel"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[0]; - // No need to check parameters of default channel because that has been done in other tests - - channel = (TraceChannelComponent) channels[0]; - - channel0Events = channel.getChildren(); - assertEquals(1, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("syscalls", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.SYSCALL, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // enable event (syscall) on domain - // ------------------------------------------------------------------------ - fFacility.executeCommand(domains[0], "enableEventOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[0]; - // No need to check parameters of default channel because that has been done in other tests - - channel = (TraceChannelComponent) channels[2]; - - channel0Events = channel.getChildren(); - assertEquals(4, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("syscalls", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.SYSCALL, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // enable event (syscall) on session - // ------------------------------------------------------------------------ - fFacility.executeCommand(session, "enableEventOnSession"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[0]; - // No need to check parameters of default channel because that has been done in other tests - - channel = (TraceChannelComponent) channels[2]; - - channel0Events = channel.getChildren(); - assertEquals(4, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("syscalls", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.SYSCALL, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - - // ------------------------------------------------------------------------ - // enable event (dynamic probe) on domain - // ------------------------------------------------------------------------ - events.clear(); - eventsDialogStub.setIsSysCalls(false); - eventsDialogStub.setIsDynamicProbe(true); - eventsDialogStub.setDynamicProbe("0xc0101280"); - eventsDialogStub.setProbeEventName("myevent1"); - - fFacility.executeCommand(domains[0], "enableEventOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(5, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); - - TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[0]; - assertEquals("myevent1", probeEvent.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); - assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); - assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); - assertNull(probeEvent.getOffset()); - assertEquals("0xc0101280", probeEvent.getAddress()); - assertNull(probeEvent.getSymbol()); - - // ------------------------------------------------------------------------ - // enable event (dynamic probe) on channel - // ------------------------------------------------------------------------ - eventsDialogStub.setIsDynamicProbe(true); - eventsDialogStub.setDynamicProbe("init_post"); - eventsDialogStub.setProbeEventName("myevent2"); - - fFacility.executeCommand(channels[2], "enableEventOnChannel"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(6, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); - - probeEvent = (TraceProbeEventComponent) channel0Events[0]; - assertEquals("myevent2", probeEvent.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); - assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); - assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); - assertEquals("0x0", probeEvent.getOffset()); - assertNull(null, probeEvent.getAddress()); - assertEquals("init_post", probeEvent.getSymbol()); - - // ------------------------------------------------------------------------ - // enable event (dynamic probe) on session - // ------------------------------------------------------------------------ - eventsDialogStub.setIsDynamicProbe(true); - eventsDialogStub.setDynamicProbe("init_post:0x1000"); - eventsDialogStub.setProbeEventName("myevent3"); - - fFacility.executeCommand(session, "enableEventOnSession"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(7, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); - - probeEvent = (TraceProbeEventComponent) channel0Events[0]; - assertEquals("myevent3", probeEvent.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); - assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); - assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); - assertEquals("0x1000", probeEvent.getOffset()); - assertNull(null, probeEvent.getAddress()); - assertEquals("init_post", probeEvent.getSymbol()); - - // ------------------------------------------------------------------------ - // enable event (dynamic function probe) on session - // ------------------------------------------------------------------------ - eventsDialogStub.setIsDynamicProbe(false); - eventsDialogStub.setDynamicProbe(null); - eventsDialogStub.setProbeEventName(null); - eventsDialogStub.setIsFunctionProbe(true); - eventsDialogStub.setFunctionEventName("myevent4"); - eventsDialogStub.setFunctionProbe("create_dev"); - - fFacility.executeCommand(session, "enableEventOnSession"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(8, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); - - probeEvent = (TraceProbeEventComponent) channel0Events[0]; - assertEquals("myevent4", probeEvent.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); - // Changed for Bug fix 419454 to function event which was introduced by LTTng 2.2 - assertEquals(TraceEventType.FUNCTION, probeEvent.getEventType()); - assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); - assertEquals("0x0", probeEvent.getOffset()); - assertNull(null, probeEvent.getAddress()); - assertEquals("create_dev", probeEvent.getSymbol()); - - // ------------------------------------------------------------------------ - // enable event (dynamic function probe) on domain - // ------------------------------------------------------------------------ - eventsDialogStub.setIsFunctionProbe(true); - eventsDialogStub.setFunctionEventName("myevent5"); - eventsDialogStub.setFunctionProbe("create_dev:0x2000"); - - fFacility.executeCommand(domains[0], "enableEventOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(9, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); - - probeEvent = (TraceProbeEventComponent) channel0Events[0]; - assertEquals("myevent5", probeEvent.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); - assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); - assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); - assertEquals("0x2000", probeEvent.getOffset()); - assertNull(null, probeEvent.getAddress()); - assertEquals("create_dev", probeEvent.getSymbol()); - - // ------------------------------------------------------------------------ - // enable event (dynamic function probe) on channel - // ------------------------------------------------------------------------ - eventsDialogStub.setIsFunctionProbe(true); - eventsDialogStub.setFunctionEventName("myevent"); - eventsDialogStub.setFunctionProbe("create_dev:0x2000"); - - fFacility.executeCommand(channels[0], "enableEventOnChannel"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[0]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(2, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); - - probeEvent = (TraceProbeEventComponent) channel0Events[0]; - assertEquals("myevent", probeEvent.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); - assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); - assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); - assertEquals("0x2000", probeEvent.getOffset()); - assertNull(null, probeEvent.getAddress()); - assertEquals("create_dev", probeEvent.getSymbol()); - - // ------------------------------------------------------------------------ - // Add Context on domain - // ------------------------------------------------------------------------ - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - AddContextDialogStub addContextStub = new AddContextDialogStub(); - List contexts = new ArrayList<>(); - contexts.add("prio"); - contexts.add("perf:branch-misses"); - contexts.add("perf:cache-misses"); - addContextStub.setContexts(contexts); - TraceControlDialogFactory.getInstance().setAddContextDialog(addContextStub); - - fFacility.executeCommand(domains[0], "addContextOnDomain"); - // Currently there is nothing to verify because the list commands don't show any context information - // However, the execution of the command make sure that the correct service command line is build and executed. - - // ------------------------------------------------------------------------ - // Add Context on channel - // ------------------------------------------------------------------------ - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - //Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[0]; - - try { - // The setContext() verifies that the contexts set are part of the available contexts - // The available contexts are set by the command handler addContextOnDomain above. - // So we indirectly test here that the parsing and setting of available contexts were - // done correctly above. - addContextStub.setContexts(contexts); - } catch (IllegalArgumentException e) { - fail("Exception caught - unknown context"); - } - - fFacility.executeCommand(channel, "addContextOnChannel"); - // Currently there is nothing to verify because the list commands don't show any context information - // However, the execution of the command make sure that the correct service command line is build and executed. - - // ------------------------------------------------------------------------ - // Add Context on event - // ------------------------------------------------------------------------ - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - //Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - - channel0Events = channel.getChildren(); - - event = (TraceEventComponent) channel0Events[6]; - - fFacility.executeCommand(event, "addContextOnEvent"); - // Currently there is nothing to verify because the list commands don't show any context information - // However, the execution of the command make sure that the correct service command line is build and executed. - - // ------------------------------------------------------------------------ - // Calibrate - // ------------------------------------------------------------------------ - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - fFacility.executeCommand(domains[0], "calibrate"); - // There is nothing to verify here. - // However, the execution of the command make sure that the correct service command line is build and executed. - - // ------------------------------------------------------------------------ - // refresh - // ------------------------------------------------------------------------ - fFacility.executeCommand(node, "refresh"); - groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - assertEquals(3, groups[0].getChildren().length); // provider - assertEquals(1, groups[1].getChildren().length); // sessions - assertEquals(1, groups[1].getChildren()[0].getChildren().length); // domains - assertEquals(3, groups[1].getChildren()[0].getChildren()[0].getChildren().length); // channels - assertEquals(2, groups[1].getChildren()[0].getChildren()[0].getChildren()[0].getChildren().length); // events (of channel[0]) - - // Initialize session handling scenario - fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); - - session = (TraceSessionComponent)groups[1].getChildren()[0]; - - // ------------------------------------------------------------------------ - // start session - // ------------------------------------------------------------------------ - fFacility.startSession(session); - assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); - - // ------------------------------------------------------------------------ - // stop session - // ------------------------------------------------------------------------ - fFacility.stopSession(session); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - - // ------------------------------------------------------------------------ - // Destroy session - // ------------------------------------------------------------------------ - - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - //------------------------------------------------------------------------- - // Disconnect node - //------------------------------------------------------------------------- - fFacility.executeCommand(node, "disconnect"); - assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); - - //------------------------------------------------------------------------- - // Delete node - //------------------------------------------------------------------------- - - fFacility.executeCommand(node, "delete"); - assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length); - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java deleted file mode 100644 index 12e41ce3be..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java +++ /dev/null @@ -1,360 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.*; - -import java.io.File; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.BaseEventPropertySource; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.KernelProviderPropertySource; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TargetNodePropertySource; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceChannelPropertySource; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceDomainPropertySource; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceEventPropertySource; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceProbeEventPropertySource; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceSessionPropertySource; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.UstProviderPropertySource; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.eclipse.ui.views.properties.IPropertySource; -import org.junit.After; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class TraceControlPropertiesTest contains tests for the all - * property class. - */ -public class TraceControlPropertiesTest { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private static final String DIRECTORY = "testfiles"; - private static final String TEST_STREAM = "ListInfoTest.cfg"; - private static final String SCEN_LIST_INFO_TEST = "ListInfoTest"; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - TraceControlTestFacility.getInstance().waitForJobs(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * This will fail the test - */ - @Test - public void testComponentProperties() throws Exception { - - TestRemoteSystemProxy proxy = new TestRemoteSystemProxy(); - - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(DIRECTORY + File.separator + TEST_STREAM), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - proxy.setTestFile(testfile.getAbsolutePath()); - proxy.setScenario(SCEN_LIST_INFO_TEST); - - ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, proxy); - - root.addChild(node); - node.connect(); - - TraceControlTestFacility.getInstance().waitForJobs(); - - // ------------------------------------------------------------------------ - // Verify Node Properties (adapter) - // ------------------------------------------------------------------------ - Object adapter = node.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof TargetNodePropertySource); - - TargetNodePropertySource source = (TargetNodePropertySource)adapter; - - assertNull(source.getEditableValue()); - assertFalse(source.isPropertySet(TargetNodePropertySource.TARGET_NODE_NAME_PROPERTY_ID)); - assertNotNull(source.getPropertyDescriptors()); - - assertEquals("myNode", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_NAME_PROPERTY_ID)); - assertEquals("LOCALHOST", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_ADDRESS_PROPERTY_ID)); - assertEquals(TargetNodeState.CONNECTED.name(), source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_STATE_PROPERTY_ID)); - assertEquals("2.1.0", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_VERSION_PROPERTY_ID)); - assertNull(source.getPropertyValue("test")); - - adapter = node.getAdapter(IChannelInfo.class); - assertNull(adapter); - - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - ITraceControlComponent[] providers = groups[0].getChildren(); - - assertNotNull(providers); - assertEquals(3, providers.length); - - // ------------------------------------------------------------------------ - // Verify Kernel Provider Properties (adapter) - // ------------------------------------------------------------------------ - KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0]; - - adapter = kernelProvider.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof KernelProviderPropertySource); - - KernelProviderPropertySource kernelSource = (KernelProviderPropertySource)adapter; - assertNotNull(kernelSource.getPropertyDescriptors()); - - assertEquals("Kernel", kernelSource.getPropertyValue(KernelProviderPropertySource.KERNEL_PROVIDER_NAME_PROPERTY_ID)); - - // ------------------------------------------------------------------------ - // Verify UST Provider Properties (adapter) - // ------------------------------------------------------------------------ - UstProviderComponent ustProvider = (UstProviderComponent) providers[1]; - - adapter = ustProvider.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof UstProviderPropertySource); - - UstProviderPropertySource ustSource = (UstProviderPropertySource)adapter; - assertNotNull(ustSource.getPropertyDescriptors()); - - assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustSource.getPropertyValue(UstProviderPropertySource.UST_PROVIDER_NAME_PROPERTY_ID)); - assertEquals(String.valueOf(9379), ustSource.getPropertyValue(UstProviderPropertySource.UST_PROVIDER_PID_PROPERTY_ID)); - - // ------------------------------------------------------------------------ - // Verify Base Event Properties (adapter) - // ------------------------------------------------------------------------ - ITraceControlComponent[] events = ustProvider.getChildren(); - assertNotNull(events); - assertEquals(2, events.length); - - BaseEventComponent baseEventInfo = (BaseEventComponent) events[0]; - assertNotNull(baseEventInfo); - - adapter = baseEventInfo.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof BaseEventPropertySource); - - BaseEventPropertySource baseSource = (BaseEventPropertySource)adapter; - assertNotNull(baseSource.getPropertyDescriptors()); - - assertEquals("ust_tests_hello:tptest_sighandler", baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_NAME_PROPERTY_ID)); - assertEquals(TraceEventType.TRACEPOINT.name(), baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_TYPE_PROPERTY_ID)); - assertEquals(TraceLogLevel.TRACE_DEBUG_MODULE.name(), baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_LOGLEVEL_PROPERTY_ID)); - - baseEventInfo = (BaseEventComponent) events[1]; - assertNotNull(baseEventInfo); - - adapter = baseEventInfo.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof BaseEventPropertySource); - baseSource = (BaseEventPropertySource)adapter; - assertNotNull(baseSource.getPropertyDescriptors()); - assertEquals("doublefield=float;floatfield=float;stringfield=string", baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_FIELDS_PROPERTY_ID)); - - // ------------------------------------------------------------------------ - // Verify Session Properties (adapter) - // ------------------------------------------------------------------------ - ITraceControlComponent[] sessions = groups[1].getChildren(); - assertNotNull(sessions); - assertEquals(2, sessions.length); - - TraceSessionComponent session = (TraceSessionComponent)sessions[1]; - - adapter = session.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof TraceSessionPropertySource); - - TraceSessionPropertySource sessionSource = (TraceSessionPropertySource)adapter; - assertNotNull(sessionSource.getPropertyDescriptors()); - - assertEquals("mysession", sessionSource.getPropertyValue(TraceSessionPropertySource.TRACE_SESSION_NAME_PROPERTY_ID)); - assertEquals("/home/user/lttng-traces/mysession-20120129-084256", sessionSource.getPropertyValue(TraceSessionPropertySource.TRACE_SESSION_PATH_PROPERTY_ID)); - assertEquals(TraceSessionState.ACTIVE.name(), sessionSource.getPropertyValue(TraceSessionPropertySource.TRACE_SESSION_STATE_PROPERTY_ID)); - - // ------------------------------------------------------------------------ - // Verify Domain Provider Properties (adapter) - // ------------------------------------------------------------------------ - ITraceControlComponent[] domains = session.getChildren(); - assertNotNull(domains); - assertEquals(2, domains.length); - - TraceDomainComponent domain = (TraceDomainComponent) domains[0]; - adapter = domain.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof TraceDomainPropertySource); - - TraceDomainPropertySource domainSource = (TraceDomainPropertySource)adapter; - assertNotNull(domainSource.getPropertyDescriptors()); - - assertEquals("Kernel", domainSource.getPropertyValue(TraceDomainPropertySource.TRACE_DOMAIN_NAME_PROPERTY_ID)); - assertEquals(BufferType.BUFFER_SHARED.getInName(), domainSource.getPropertyValue(TraceDomainPropertySource.BUFFER_TYPE_PROPERTY_ID)); - - ITraceControlComponent[] channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(2, channels.length); - - // ------------------------------------------------------------------------ - // Verify Channel Properties (adapter) - // ------------------------------------------------------------------------ - assertTrue(channels[0] instanceof TraceChannelComponent); - TraceChannelComponent channel = (TraceChannelComponent) channels[0]; - - adapter = channel.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof TraceChannelPropertySource); - - TraceChannelPropertySource channelSource = (TraceChannelPropertySource)adapter; - assertNotNull(channelSource.getPropertyDescriptors()); - - assertEquals("channel0", channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_NAME_PROPERTY_ID)); - assertEquals(String.valueOf(4), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID)); - assertEquals(TraceEnablement.ENABLED.name(), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_STATE_PROPERTY_ID)); - assertEquals(String.valueOf(false), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID)); - assertEquals("splice()", channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID)); - assertEquals(String.valueOf(200), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_READ_TIMER_PROPERTY_ID)); - assertEquals(String.valueOf(262144), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID)); - assertEquals(String.valueOf(0), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID)); - - // ------------------------------------------------------------------------ - // Verify Event Properties (adapter) - // ------------------------------------------------------------------------ - ITraceControlComponent[] channel0Events = channel.getChildren(); - assertNotNull(channel0Events); - assertEquals(5, channel0Events.length); - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - TraceEventComponent event = (TraceEventComponent) channel0Events[0]; - - adapter = event.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof TraceEventPropertySource); - - TraceEventPropertySource eventSource = (TraceEventPropertySource)adapter; - assertNotNull(eventSource.getPropertyDescriptors()); - - assertEquals("block_rq_remap", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID)); - assertEquals(TraceLogLevel.TRACE_EMERG.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); - assertEquals(TraceEventType.TRACEPOINT.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID)); - assertEquals(TraceEnablement.ENABLED.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID)); - - // ------------------------------------------------------------------------ - // Verify Probe Event Properties (adapter) - // ------------------------------------------------------------------------ - assertTrue(channel0Events[2] instanceof TraceProbeEventComponent); - - TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[2]; - - adapter = probeEvent.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof TraceProbeEventPropertySource); - - TraceProbeEventPropertySource probeEventSource = (TraceProbeEventPropertySource)adapter; - assertNotNull(probeEventSource.getPropertyDescriptors()); - assertEquals(4, probeEventSource.getPropertyDescriptors().length); - - assertEquals("myevent2", probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID)); - assertEquals(TraceEventType.PROBE.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID)); - assertEquals(TraceEnablement.ENABLED.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID)); - assertEquals("0xc0101340", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID)); - - assertTrue(channel0Events[3] instanceof TraceProbeEventComponent); - - probeEvent = (TraceProbeEventComponent) channel0Events[3]; - - adapter = probeEvent.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof TraceProbeEventPropertySource); - - probeEventSource = (TraceProbeEventPropertySource)adapter; - assertNotNull(probeEventSource.getPropertyDescriptors()); - assertEquals(5, probeEventSource.getPropertyDescriptors().length); - - assertEquals("myevent0", probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID)); - assertEquals(TraceEventType.PROBE.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID)); - assertEquals(TraceEnablement.ENABLED.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID)); - assertEquals("0x0", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID)); - assertEquals("init_post", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID)); - - //------------------------------------------------------------------------- - // Verify Filter of UST event - //------------------------------------------------------------------------- - event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[0]; - adapter = event.getAdapter(IPropertySource.class); - assertEquals("with filter", event.getFilterExpression()); - - //------------------------------------------------------------------------- - // Verify Log Level Type of UST events (> LTTng 2.4) - //------------------------------------------------------------------------- - event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[0]; - adapter = event.getAdapter(IPropertySource.class); - eventSource = (TraceEventPropertySource) adapter; - assertEquals("== TRACE_DEBUG_LINE", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); - - event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[1]; - adapter = event.getAdapter(IPropertySource.class); - eventSource = (TraceEventPropertySource) adapter; - assertEquals("<= TRACE_INFO", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); - - event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[2]; - adapter = event.getAdapter(IPropertySource.class); - eventSource = (TraceEventPropertySource) adapter; - assertEquals("TRACE_DEBUG_SYSTEM", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); - - //------------------------------------------------------------------------- - // Delete node - //------------------------------------------------------------------------- - node.disconnect(); - node.getParent().removeChild(node); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTests.java deleted file mode 100644 index 569de1d086..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTests.java +++ /dev/null @@ -1,220 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceSessionPropertySource; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.eclipse.ui.views.properties.IPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertySource; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class TraceControlSnapshotSessionTests contains Snapshot - * session test cases for support of LTTng Tools 2.3. - */ -public class TraceControlSnapshotSessionTests { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private static final String TEST_STREAM = "CreateSessionTest2.cfg"; - private static final String SCEN_CREATE_SESSION = "ScenCreateSession"; - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private TraceControlTestFacility fFacility; - private TestRemoteSystemProxy fProxy; - private String fTestFile; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fFacility = TraceControlTestFacility.getInstance(); - fFacility.init(); - fProxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestFile = testfile.getAbsolutePath(); - } - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - fFacility.waitForJobs(); - fFacility.dispose(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * This will fail the test - */ - @Test - public void testTraceSessionTree() throws Exception { - - fProxy.setTestFile(fTestFile); - fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); - - ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); - - root.addChild(node); - fFacility.waitForJobs(); - - fFacility.executeCommand(node, "connect"); - int i = 0; - while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { - i++; - fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); - } - - // Get provider groups - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - // Initialize dialog implementations for command execution - // --- snapshot session --- - CreateSessionDialogStub sessionDialog = new CreateSessionDialogStub(); - sessionDialog.setSnapshot(true); - - TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialog); - TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); - TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); - - // Initialize scenario - fProxy.setScenario(SCEN_CREATE_SESSION); - - // ------------------------------------------------------------------------ - // Create session - // ------------------------------------------------------------------------ - TraceSessionComponent session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals("mysession", session.getName()); - assertTrue(session.isSnapshotSession()); - assertNotNull(session.getSnapshotInfo()); - assertEquals("snapshot-1", session.getSnapshotInfo().getName()); - assertEquals("/home/user/lttng-traces/mysession-20130913-141651", session.getSnapshotInfo().getSnapshotPath()); - assertEquals(1, session.getSnapshotInfo().getId()); - - // ------------------------------------------------------------------------ - // Start session - // ------------------------------------------------------------------------ - fFacility.startSession(session); - assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); - - // verify properties - Object adapter = session.getAdapter(IPropertySource.class); - assertNotNull(adapter); - assertTrue(adapter instanceof TraceSessionPropertySource); - - TraceSessionPropertySource sessionSource = (TraceSessionPropertySource)adapter; - IPropertyDescriptor[] descriptors = sessionSource.getPropertyDescriptors(); - assertNotNull(descriptors); - - Map map = new HashMap<>(); - map.put(TraceSessionPropertySource.TRACE_SESSION_NAME_PROPERTY_ID, "mysession"); - map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_NAME_PROPERTY_ID, "snapshot-1"); - map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_PATH_PROPERTY_ID, "/home/user/lttng-traces/mysession-20130913-141651"); - map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_ID_PROPERTY_ID, "1"); - map.put(TraceSessionPropertySource.TRACE_SESSION_STATE_PROPERTY_ID, TraceSessionState.ACTIVE.name()); - - for (int j = 0; j < descriptors.length; j++) { - String expected = map.get(descriptors[j].getId()); - assertNotNull(expected); - assertEquals(expected, sessionSource.getPropertyValue(descriptors[j].getId()).toString()); - } - - // ------------------------------------------------------------------------ - // Record snapshot - // ------------------------------------------------------------------------ - fFacility.executeCommand(session, "snapshot"); - - // ------------------------------------------------------------------------ - // Stop snapshot - // ------------------------------------------------------------------------ - fFacility.stopSession(session); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - - // ------------------------------------------------------------------------ - // Destroy session - // ------------------------------------------------------------------------ - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - //------------------------------------------------------------------------- - // Disconnect node - //------------------------------------------------------------------------- - fFacility.executeCommand(node, "disconnect"); - assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); - - //------------------------------------------------------------------------- - // Delete node - //------------------------------------------------------------------------- - - fFacility.executeCommand(node, "delete"); - - assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTestFacility.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTestFacility.java deleted file mode 100644 index ace1759e56..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTestFacility.java +++ /dev/null @@ -1,286 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 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: - * Bernd Hufmann - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.NotEnabledException; -import org.eclipse.core.commands.NotHandledException; -import org.eclipse.core.commands.common.NotDefinedException; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.handlers.IHandlerService; - -/** - * Singleton class to facilitate the test cases. Creates UML2SD view and loader objects as well as provides - * utility methods for interacting with the loader/view. - */ -@SuppressWarnings("javadoc") -public class TraceControlTestFacility { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - public final static int WAIT_FOR_JOBS_DELAY = 50; - public final static int GUI_REFESH_DELAY = 500; - - public final static String DIRECTORY = "testfiles"; - public final static String COMMAND_CATEGORY_PREFIX = "org.eclipse.linuxtools.internal.lttng2.ui.commands.control."; - public final static String SCEN_INIT_TEST = "Initialize"; - public final static String SCEN_SCENARIO_SESSION_HANDLING = "SessionHandling"; - public final static String SCEN_SCENARIO_SESSION_HANDLING_WITH_PATH = "SessionHandlingWithPath"; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - private static TraceControlTestFacility fInstance = null; - private ControlView fControlView = null; - private boolean fIsInitialized = false; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - private TraceControlTestFacility() { - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - public static TraceControlTestFacility getInstance() { - if (fInstance == null) { - fInstance = new TraceControlTestFacility(); - } - return fInstance; - } - - /** - * Initial the test facility. - */ - public void init() { - - if (!fIsInitialized) { - - IViewPart view; - try { - - view = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow() - .getActivePage() - .findView("org.eclipse.ui.internal.introview"); - - if (view != null) { - PlatformUI.getWorkbench() - .getActiveWorkbenchWindow() - .getActivePage().hideView(view); - } - - view = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow() - .getActivePage() - .showView(ControlView.ID); - - } catch (PartInitException e) { - throw new RuntimeException(e); - } - - fControlView = (ControlView) view; - - delay(3000); - fIsInitialized = true; - } - } - - - /** - * Disposes the facility (and GUI) - */ - public void dispose() { - if (fIsInitialized) { - waitForJobs(); - - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(fControlView); - fIsInitialized = false; - } - } - - /** - * Creates a delay for given time. - * @param waitTimeMillis - time in milli seconds - */ - public void delay(long waitTimeMillis) { - Display display = Display.getCurrent(); - if (display != null) { - long endTimeMillis = System.currentTimeMillis() + waitTimeMillis; - while(System.currentTimeMillis() < endTimeMillis) { - if (!display.readAndDispatch()) { - // We do not use Display.sleep because it might never wake up - // if there is no user interaction - try { - Thread.sleep(Math.min(waitTimeMillis, 10)); - } catch (final InterruptedException e) { - // Ignored - } - } - display.update(); - } - } else { - try { - Thread.sleep(waitTimeMillis); - } catch (InterruptedException e) { - // Ignored - } - } - } - - /** - * Waits for all Eclipse jobs to finish - */ - public void waitForJobs() { - while (!Job.getJobManager().isIdle()) { - delay(WAIT_FOR_JOBS_DELAY); - } - } - - /** - * @return current control view - */ - public ControlView getControlView() { - return fControlView; - } - - /** - * Executes an Eclipse command with command ID after selecting passed component - * @param component - component to select in the tree - * @param commandId - command ID - * @throws ExecutionException - * @throws NotDefinedException - * @throws NotEnabledException - * @throws NotHandledException - */ - public void executeCommand(ITraceControlComponent component, String commandId) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { - setSelection(component); - executeCommand(commandId); - } - - /** - * Executes an Eclipse command with command ID after selecting passed components - * @param components - array of components to select in the tree - * @param commandId - command ID - * @throws ExecutionException - * @throws NotDefinedException - * @throws NotEnabledException - * @throws NotHandledException - */ - public void executeCommand(ITraceControlComponent[] components, String commandId) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { - setSelection(components); - executeCommand(commandId); - } - - /** - * Executes an Eclipse command with command ID - * @param commandId - * @throws ExecutionException - * @throws NotDefinedException - * @throws NotEnabledException - * @throws NotHandledException - */ - public void executeCommand(String commandId) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { - IHandlerService handlerService = (IHandlerService) fControlView.getSite().getService(IHandlerService.class); - handlerService.executeCommand(COMMAND_CATEGORY_PREFIX + commandId, null); - waitForJobs(); - } - - /** - * Selects passed component - * @param component - component to select in the tree - * @param commandId - command ID - */ - public void setSelection(ITraceControlComponent component) { - fControlView.setSelection(component); - // Selection is done in own job - waitForJobs(); - } - - - /** - * Selects passed components - * @param components - array of component to select in the tree - * @param commandId - command ID - */ - public void setSelection(ITraceControlComponent[] components) { - fControlView.setSelection(components); - - // Selection is done in own job - waitForJobs(); - } - - /** - * Creates session on passed session group. - * @param group - session group - * @return - trace session group if it's successful else null - * @throws ExecutionException - * @throws NotDefinedException - * @throws NotEnabledException - * @throws NotHandledException - */ - public TraceSessionComponent createSession(ITraceControlComponent group) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { - executeCommand(group, "createSession"); - - ITraceControlComponent[] sessions = group.getChildren(); - if ((sessions == null) || (sessions.length == 0)) { - return null; - } - return (TraceSessionComponent)sessions[0]; - } - - /** - * Destroys a given session. - * @param session - session to destroy - * @throws ExecutionException - * @throws NotDefinedException - * @throws NotEnabledException - * @throws NotHandledException - */ - public void destroySession(TraceSessionComponent session) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { - executeCommand(session, "destroySession"); - } - - /** - * Starts a given session - * @param session - session to start - * @throws ExecutionException - * @throws NotDefinedException - * @throws NotEnabledException - * @throws NotHandledException - */ - public void startSession(TraceSessionComponent session) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { - executeCommand(session, "start"); - } - - /** - * Stops a given session - * @param session - session to stop - * @throws ExecutionException - * @throws NotDefinedException - * @throws NotEnabledException - * @throws NotHandledException - */ - public void stopSession(TraceSessionComponent session) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { - executeCommand(session, "stop"); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelNoProvidersTest.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelNoProvidersTest.java deleted file mode 100644 index 76397a0950..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelNoProvidersTest.java +++ /dev/null @@ -1,169 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlService; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.eclipse.swt.graphics.Image; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class TraceControlTreeModelNoProvidersTest verifies that the - * Tracer Control can handle the case where no kernel provider and only UST - * provider are available. - */ -public class TraceControlTreeModelNoProvidersTest { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private static final String TEST_STREAM = "ListInfoTest.cfg"; - private static final String SCEN_LIST_INFO_TEST = "ListInfoTestNoKernel"; - private static final String TARGET_NODE_NAME = "myNode"; - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private TestRemoteSystemProxy fProxy; - private String fTestFile; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fProxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestFile = testfile.getAbsolutePath(); - } - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - TraceControlTestFacility.getInstance().waitForJobs(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * This will fail the test - */ - @Test - public void testTraceControlComponents() throws Exception { - - fProxy.setTestFile(fTestFile); - fProxy.setScenario(SCEN_LIST_INFO_TEST); - - ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent(TARGET_NODE_NAME, root, host, fProxy); - - root.addChild(node); - node.connect(); - - TraceControlTestFacility.getInstance().waitForJobs(); - - // ------------------------------------------------------------------------ - // Verify Parameters of TargetNodeComponent - // ------------------------------------------------------------------------ - assertEquals("LOCALHOST", node.getHostName()); // assigned in createLocalHost() above - assertEquals("LOCALHOST", node.getToolTip()); // assigned in createLocalHost() above - Image connectedImage = node.getImage(); - assertNotNull(connectedImage); - assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); - assertNotNull(node.getControlService()); - ILttngControlService service = node.getControlService(); - assertTrue(service instanceof LTTngControlService); - node.setControlService(service); - assertTrue(node.getControlService() instanceof LTTngControlService); - - assertTrue(node.isPassiveCommunicationsListener()); - - // ------------------------------------------------------------------------ - // Verify Children of TargetNodeComponent - // ------------------------------------------------------------------------ - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - assertTrue(groups[0] instanceof TraceProviderGroup); - assertTrue(groups[1] instanceof TraceSessionGroup); - - // Check for kernel provider - TraceProviderGroup providerGroup = (TraceProviderGroup) groups[0]; - assertFalse(providerGroup.hasKernelProvider()); - - assertEquals("Provider", providerGroup.getName()); - assertEquals("Sessions", groups[1].getName()); - - // ------------------------------------------------------------------------ - // Verify TraceProviderGroup - // ------------------------------------------------------------------------ - ITraceControlComponent[] providers = groups[0].getChildren(); - - assertNotNull(providers); - assertEquals(1, providers.length); - assertTrue(providers[0] instanceof UstProviderComponent); - - // disconnect - node.disconnect(); - assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); - assertNotNull(node.getImage()); - assertNotSame(connectedImage, node.getImage()); - - node.getParent().removeChild(node); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelTest.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelTest.java deleted file mode 100644 index e932107845..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelTest.java +++ /dev/null @@ -1,701 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlService; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.eclipse.swt.graphics.Image; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class TraceControlTreeModelTest contains tests for the tree - * component classes. - */ -public class TraceControlTreeModelTest { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private static final String TEST_STREAM = "ListInfoTest.cfg"; - private static final String SCEN_LIST_INFO_TEST = "ListInfoTest"; - private static final String TARGET_NODE_NAME = "myNode"; - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private TestRemoteSystemProxy fProxy; - private String fTestFile; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fProxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestFile = testfile.getAbsolutePath(); - } - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - TraceControlTestFacility.getInstance().waitForJobs(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * This will fail the test - */ - @Test - public void testTraceControlComponents() throws Exception { - - fProxy.setTestFile(fTestFile); - fProxy.setScenario(SCEN_LIST_INFO_TEST); - - ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent(TARGET_NODE_NAME, root, host, fProxy); - - root.addChild(node); - node.connect(); - - TraceControlTestFacility.getInstance().waitForJobs(); - - // ------------------------------------------------------------------------ - // Verify Parameters of TargetNodeComponent - // ------------------------------------------------------------------------ - assertEquals("LOCALHOST", node.getHostName()); // assigned in createLocalHost() above - assertEquals("LOCALHOST", node.getToolTip()); // assigned in createLocalHost() above - Image connectedImage = node.getImage(); - assertNotNull(connectedImage); - assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); - assertNotNull(node.getControlService()); - ILttngControlService service = node.getControlService(); - assertTrue(service instanceof LTTngControlService); - node.setControlService(service); - assertTrue(node.getControlService() instanceof LTTngControlService); - - assertTrue(node.isPassiveCommunicationsListener()); - - // ------------------------------------------------------------------------ - // Verify Children of TargetNodeComponent - // ------------------------------------------------------------------------ - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - assertTrue(groups[0] instanceof TraceProviderGroup); - assertTrue(groups[1] instanceof TraceSessionGroup); - - assertEquals("Provider", groups[0].getName()); - assertEquals("Sessions", groups[1].getName()); - - // ------------------------------------------------------------------------ - // Verify TraceProviderGroup - // ------------------------------------------------------------------------ - ITraceControlComponent[] providers = groups[0].getChildren(); - - assertNotNull(providers); - assertEquals(3, providers.length); - - // ------------------------------------------------------------------------ - // Verify KernelProviderComponent - // ------------------------------------------------------------------------ - KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0]; - - // ------------------------------------------------------------------------ - // Verify event info (kernel provider) - // ------------------------------------------------------------------------ - ITraceControlComponent[] events = kernelProvider.getChildren(); - assertNotNull(events); - assertEquals(3, events.length); - - BaseEventComponent baseEventInfo = (BaseEventComponent) events[0]; - assertNotNull(baseEventInfo); - assertEquals("sched_kthread_stop", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - baseEventInfo = (BaseEventComponent) events[1]; - assertEquals("sched_kthread_stop_ret", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - baseEventInfo = (BaseEventComponent) events[2]; - assertEquals("sched_wakeup_new", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - // ------------------------------------------------------------------------ - // Verify UstProviderComponent - // ------------------------------------------------------------------------ - UstProviderComponent ustProvider = (UstProviderComponent) providers[1]; - assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustProvider.getName()); - assertEquals(9379, ustProvider.getPid()); - - // ------------------------------------------------------------------------ - // Verify event info (UST provider) - // ------------------------------------------------------------------------ - events = ustProvider.getChildren(); - assertNotNull(events); - assertEquals(2, events.length); - - baseEventInfo = (BaseEventComponent) events[0]; - assertNotNull(baseEventInfo); - assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_MODULE, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - baseEventInfo = (BaseEventComponent) events[1]; - assertEquals("ust_tests_hello:tptest", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_INFO, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - // ------------------------------------------------------------------------ - // Verify UstProviderComponent - // ------------------------------------------------------------------------ - ustProvider = (UstProviderComponent) providers[2]; - assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=4852]", ustProvider.getName()); - assertEquals(4852, ustProvider.getPid()); - - // verify getters and setter - verifyUstProviderGettersSetters(ustProvider); - - // ------------------------------------------------------------------------ - // Verify event info (UST provider) - // ------------------------------------------------------------------------ - events = ustProvider.getChildren(); - assertNotNull(events); - assertEquals(2, events.length); - - baseEventInfo = (BaseEventComponent) events[0]; - assertNotNull(baseEventInfo); - assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_WARNING, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - baseEventInfo = (BaseEventComponent) events[1]; - assertEquals("ust_tests_hello:tptest", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - // verify getters and setters - verifyBaseEventGettersSetters(baseEventInfo); - - // ------------------------------------------------------------------------ - // Verify TraceSessionGroup - // ------------------------------------------------------------------------ - ITraceControlComponent[] sessions = groups[1].getChildren(); - assertNotNull(sessions); - assertEquals(2, sessions.length); - for (int i = 0; i < sessions.length; i++) { - assertTrue(sessions[i] instanceof TraceSessionComponent); - } - assertEquals("mysession1", sessions[0].getName()); - assertEquals("mysession", sessions[1].getName()); - - // ------------------------------------------------------------------------ - // Verify TraceSessionComponent - // ------------------------------------------------------------------------ - TraceSessionComponent session = (TraceSessionComponent)sessions[1]; - assertEquals("mysession", session.getName()); - assertEquals("/home/user/lttng-traces/mysession-20120129-084256", session.getSessionPath()); - assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); - - // Verify setters and setters - verifySessionGetterSetters(session); - - ITraceControlComponent[] domains = session.getChildren(); - assertNotNull(domains); - assertEquals(2, domains.length); - - // ------------------------------------------------------------------------ - // Verify Kernel domain - // ------------------------------------------------------------------------ - assertEquals("Kernel", domains[0].getName()); - ITraceControlComponent[] channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(2, channels.length); - - // Verify setters and setters - verifyDomainGettersSetters((TraceDomainComponent) domains[0]); - - // ------------------------------------------------------------------------ - // Verify Kernel's channel0 - // ------------------------------------------------------------------------ - assertTrue(channels[0] instanceof TraceChannelComponent); - TraceChannelComponent channel = (TraceChannelComponent) channels[0]; - assertEquals("channel0", channel.getName()); - assertEquals(4, channel.getNumberOfSubBuffers()); - assertEquals("splice()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); - assertEquals(false, channel.isOverwriteMode()); - assertEquals(200, channel.getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channel.getState()); - assertEquals(262144, channel.getSubBufferSize()); - assertEquals(0, channel.getSwitchTimer()); - - // ------------------------------------------------------------------------ - // Verify event info (kernel, channel0) - // ------------------------------------------------------------------------ - ITraceControlComponent[] channel0Events = channel.getChildren(); - assertNotNull(channel0Events); - assertEquals(5, channel0Events.length); - assertTrue(channel0Events[0] instanceof TraceEventComponent); - assertTrue(channel0Events[1] instanceof TraceEventComponent); - assertTrue(channel0Events[2] instanceof TraceProbeEventComponent); - assertTrue(channel0Events[3] instanceof TraceProbeEventComponent); - assertTrue(channel0Events[4] instanceof TraceEventComponent); - - TraceEventComponent event = (TraceEventComponent) channel0Events[0]; - assertEquals("block_rq_remap", event.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - event = (TraceEventComponent) channel0Events[1]; - assertEquals("block_bio_remap", event.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.DISABLED, event.getState()); - - TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[2]; - assertEquals("myevent2", probeEvent.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); - assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); - assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); - assertEquals("0xc0101340", probeEvent.getAddress()); - assertNull(probeEvent.getOffset()); - assertNull(probeEvent.getSymbol()); - - // verify getters and setter - verifyProbeEventGettersSetters(probeEvent); - - probeEvent = (TraceProbeEventComponent) channel0Events[3]; - assertEquals("myevent0", probeEvent.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); - assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); - assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); - assertNull(probeEvent.getAddress()); - assertEquals("0x0", probeEvent.getOffset()); - assertEquals("init_post", probeEvent.getSymbol()); - - event = (TraceEventComponent) channel0Events[4]; - assertEquals("syscalls", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.SYSCALL, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Verify Kernel's channel1 - // ------------------------------------------------------------------------ - assertEquals("channel1", channels[1].getName()); - channel = (TraceChannelComponent) channels[1]; - assertEquals(4, channel.getNumberOfSubBuffers()); - assertEquals("splice()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); - assertEquals(true, channel.isOverwriteMode()); - assertEquals(400, channel.getReadTimer()); - assertEquals(TraceEnablement.DISABLED, channel.getState()); - assertEquals(524288, channel.getSubBufferSize()); - assertEquals(100, channel.getSwitchTimer()); - - // ------------------------------------------------------------------------ - // Verify event info (kernel, channel1) - // ------------------------------------------------------------------------ - ITraceControlComponent[] channel1Events = channels[1].getChildren(); - assertEquals(0, channel1Events.length); - - // ------------------------------------------------------------------------ - // Verify domain UST global - // ------------------------------------------------------------------------ - assertEquals("UST global", domains[1].getName()); - - ITraceControlComponent[] ustChannels = domains[1].getChildren(); - - for (int i = 0; i < ustChannels.length; i++) { - assertTrue(ustChannels[i] instanceof TraceChannelComponent); - } - - // ------------------------------------------------------------------------ - // Verify UST global's mychannel1 - // ------------------------------------------------------------------------ - channel = (TraceChannelComponent) ustChannels[0]; - assertEquals("mychannel1", channel.getName()); - assertEquals(8, channel.getNumberOfSubBuffers()); - assertEquals("mmap()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); - assertEquals(true, channel.isOverwriteMode()); - assertEquals(100, channel.getReadTimer()); - assertEquals(TraceEnablement.DISABLED, channel.getState()); - assertEquals(8192, channel.getSubBufferSize()); - assertEquals(200, channel.getSwitchTimer()); - - // verify getters and setters - verifyChannelGettersSetters(channel); - - // ------------------------------------------------------------------------ - // Verify event info (UST global, mychannel1) - // ------------------------------------------------------------------------ - ITraceControlComponent[] ustEvents = channel.getChildren(); - assertEquals(0, ustEvents.length); - - // ------------------------------------------------------------------------ - // Verify UST global's channel0 - // ------------------------------------------------------------------------ - channel = (TraceChannelComponent) ustChannels[1]; - assertEquals("channel0", channel.getName()); - assertEquals(4, channel.getNumberOfSubBuffers()); - assertEquals("mmap()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); - assertEquals(false, channel.isOverwriteMode()); - assertEquals(200, channel.getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channel.getState()); - assertEquals(4096, channel.getSubBufferSize()); - assertEquals(0, channel.getSwitchTimer()); - - // ------------------------------------------------------------------------ - // Verify event info (UST global, channel0) - // ------------------------------------------------------------------------ - ustEvents = channel.getChildren(); - assertEquals(4, ustEvents.length); - - event = (TraceEventComponent) ustEvents[0]; - assertEquals("ust_tests_hello:tptest_sighandler", event.getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, event.getLogLevel()); - assertEquals(LogLevelType.LOGLEVEL_ONLY, event.getLogLevelType()); - assertEquals(LogLevelType.LOGLEVEL_ONLY.getShortName(), event.getLogLevelType().getShortName()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.DISABLED, event.getState()); - - event = (TraceEventComponent) ustEvents[1]; - assertEquals("ust_tests_hello:tptest_sighandler1", event.getName()); - assertEquals(TraceLogLevel.TRACE_INFO, event.getLogLevel()); - assertEquals(LogLevelType.LOGLEVEL, event.getLogLevelType()); - assertEquals(LogLevelType.LOGLEVEL.getShortName(), event.getLogLevelType().getShortName()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.DISABLED, event.getState()); - - event = (TraceEventComponent) ustEvents[2]; - assertEquals("ust_tests_hello:tptest_sighandler2", event.getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_SYSTEM, event.getLogLevel()); - assertEquals(LogLevelType.LOGLEVEL_NONE, event.getLogLevelType()); - assertEquals(LogLevelType.LOGLEVEL_NONE.getShortName(), event.getLogLevelType().getShortName()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.DISABLED, event.getState()); - - event = (TraceEventComponent) ustEvents[3]; - assertEquals("*", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // verify getters and setters - verifyEventGettersSetters(event); - - // disconnect - node.disconnect(); - assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); - assertNotNull(node.getImage()); - assertNotSame(connectedImage, node.getImage()); - - node.getParent().removeChild(node); - } - - private static void verifySessionGetterSetters(TraceSessionComponent session) { - // save original values - String name = session.getName(); - String origPath = session.getSessionPath(); - TraceSessionState origState = session.getSessionState(); - - // test cases - session.setName("newName"); - assertEquals("newName", session.getName()); - - session.setSessionPath("/home/user/tmp"); - assertEquals("/home/user/tmp", session.getSessionPath()); - - session.setSessionState(TraceSessionState.INACTIVE); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - Image inactiveImage = session.getImage(); - assertNotNull(inactiveImage); - - session.setSessionState("active"); - assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); - - Image activeImage = session.getImage(); - assertNotNull(activeImage); - assertNotSame(activeImage, inactiveImage); - - ITraceControlComponent[] children = session.getChildren(); - TraceDomainComponent[] domains = session.getDomains(); - - assertEquals(children.length, domains.length); - - for (int i = 0; i < domains.length; i++) { - assertEquals(domains[i].getName(), children[i].getName()); - } - - // restore original values - session.setName(name); - session.setSessionPath(origPath); - session.setSessionState(origState); - } - - private static void verifyDomainGettersSetters(TraceDomainComponent domain) { - // save original values - boolean isKernel = domain.isKernel(); - - domain.setIsKernel(false); - assertFalse(domain.isKernel()); - domain.setIsKernel(true); - assertTrue(domain.isKernel()); - - ITraceControlComponent[] children = domain.getChildren(); - TraceChannelComponent[] channels = domain.getChannels(); - - assertEquals(children.length, channels.length); - - for (int i = 0; i < channels.length; i++) { - assertEquals(channels[i].getName(), children[i].getName()); - } - - String nodeName = domain.getTargetNode().getName(); - assertEquals(TARGET_NODE_NAME, nodeName); - - // restore original values - domain.setIsKernel(isKernel); - } - - private static void verifyBaseEventGettersSetters(BaseEventComponent event) { - // save original values - String name = event.getName(); - TraceLogLevel level = event.getLogLevel(); - TraceEventType type = event.getEventType(); - - // test cases - event.setName("newName"); - assertEquals("newName", event.getName()); - - event.setLogLevel(TraceLogLevel.TRACE_INFO); - assertEquals(TraceLogLevel.TRACE_INFO, event.getLogLevel()); - event.setLogLevel("TRACE_ALERT"); - assertEquals(TraceLogLevel.TRACE_ALERT, event.getLogLevel()); - - event.setEventType(TraceEventType.UNKNOWN); - assertEquals(TraceEventType.UNKNOWN, event.getEventType()); - event.setEventType("tracepoint"); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - - // restore original values - event.setName(name); - event.setLogLevel(level); - event.setEventType(type); - } - - private static void verifyEventGettersSetters(TraceEventComponent event) { - // save original values - String name = event.getName(); - TraceLogLevel level = event.getLogLevel(); - TraceEventType type = event.getEventType(); - TraceEnablement state = event.getState(); - - // test cases - event.setName("newName"); - assertEquals("newName", event.getName()); - - event.setLogLevel(TraceLogLevel.TRACE_INFO); - assertEquals(TraceLogLevel.TRACE_INFO, event.getLogLevel()); - event.setLogLevel("TRACE_ALERT"); - assertEquals(TraceLogLevel.TRACE_ALERT, event.getLogLevel()); - - event.setEventType(TraceEventType.UNKNOWN); - assertEquals(TraceEventType.UNKNOWN, event.getEventType()); - event.setEventType("tracepoint"); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - - event.setState("disabled"); - assertEquals(TraceEnablement.DISABLED, event.getState()); - - Image disabledImage = event.getImage(); - assertNotNull(disabledImage); - - event.setState(TraceEnablement.ENABLED); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - Image enabledImage = event.getImage(); - assertNotNull(enabledImage); - assertNotSame(enabledImage, disabledImage); - - // restore original values - event.setName(name); - event.setLogLevel(level); - event.setEventType(type); - event.setState(state); - } - - private static void verifyProbeEventGettersSetters(TraceProbeEventComponent event) { - // save original values - String address = event.getAddress(); - String offset = event.getOffset(); - String symbol = event.getSymbol(); - - // test cases - event.setAddress("0xffff1234"); - assertEquals("0xffff1234", event.getAddress()); - - event.setOffset("0x1234"); - assertEquals("0x1234", event.getOffset()); - - event.setSymbol("init"); - assertEquals("init", event.getSymbol()); - - // restore original values - event.setAddress(address); - event.setOffset(offset); - event.setSymbol(symbol); - } - - private static void verifyChannelGettersSetters(TraceChannelComponent channel) { - // save original values - String name = channel.getName(); - int nbSubBuffers = channel.getNumberOfSubBuffers(); - TraceChannelOutputType type = channel.getOutputType(); - boolean mode = channel.isOverwriteMode(); - long readTimer = channel.getReadTimer(); - TraceEnablement state = channel.getState(); - long subBufferSize = channel.getSubBufferSize(); - long switchTimer = channel.getSwitchTimer(); - - // test cases - channel.setName("newName"); - assertEquals("newName", channel.getName()); - - channel.setNumberOfSubBuffers(2); - assertEquals(2, channel.getNumberOfSubBuffers()); - - channel.setOutputType("splice()"); - assertEquals("splice()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); - - channel.setOverwriteMode(false); - assertEquals(false, channel.isOverwriteMode()); - - channel.setReadTimer(250); - assertEquals(250, channel.getReadTimer()); - - channel.setState("enabled"); - assertEquals(TraceEnablement.ENABLED, channel.getState()); - - Image enabledImage = channel.getImage(); - assertNotNull(enabledImage); - channel.setState(TraceEnablement.DISABLED); - assertEquals(TraceEnablement.DISABLED, channel.getState()); - - Image disabledImage = channel.getImage(); - assertNotNull(disabledImage); - assertNotSame(enabledImage, disabledImage); - - channel.setSubBufferSize(1024); - assertEquals(1024, channel.getSubBufferSize()); - - channel.setSwitchTimer(1000); - assertEquals(1000, channel.getSwitchTimer()); - - // restore original values - channel.setName(name); - channel.setNumberOfSubBuffers(nbSubBuffers); - channel.setOutputType(type); - channel.setOverwriteMode(mode); - channel.setReadTimer(readTimer); - channel.setState(state); - channel.setSubBufferSize(subBufferSize); - channel.setSwitchTimer(switchTimer); - } - - private static void verifyUstProviderGettersSetters(UstProviderComponent ustProvider) { - // save original values - String name = ustProvider.getName(); - int pid = ustProvider.getPid(); - - // test cases - ustProvider.setName("newName"); - assertEquals("newName", ustProvider.getName()); - - ustProvider.setPid(9876); - assertEquals(9876, ustProvider.getPid()); - - // restore original values - ustProvider.setName(name); - ustProvider.setPid(pid); - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstProviderTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstProviderTests.java deleted file mode 100644 index 8d7b0666e9..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstProviderTests.java +++ /dev/null @@ -1,296 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.*; - -import java.io.File; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class TraceControlUstProviderTests contains UST provider - * handling test cases. - */ -public class TraceControlUstProviderTests { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private static final String TEST_STREAM = "CreateTreeTest.cfg"; - private static final String SCEN_SCENARIO2_TEST = "Scenario2"; - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private TraceControlTestFacility fFacility; - private TestRemoteSystemProxy fProxy; - private String fTestFile; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fFacility = TraceControlTestFacility.getInstance(); - fFacility.init(); - fProxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestFile = testfile.getAbsolutePath(); - } - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - fFacility.waitForJobs(); - fFacility.dispose(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * This will fail the test - */ - @Test - public void testUstProviderTree() throws Exception { - - fProxy.setTestFile(fTestFile); - fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); - - ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); - root.addChild(node); - - fFacility.waitForJobs(); - - fFacility.executeCommand(node, "connect"); - - int i = 0; - while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { - i++; - fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); - } - - // Verify that node is connected - assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); - - // Get provider groups - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - // Get kernel provider - ITraceControlComponent[] providers = groups[0].getChildren(); - KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0]; - - // Get kernel provider events and select 2 events - ITraceControlComponent[] events = kernelProvider.getChildren(); - assertNotNull(events); - assertEquals(3, events.length); - - BaseEventComponent baseEventInfo0 = (BaseEventComponent) events[0]; - BaseEventComponent baseEventInfo1 = (BaseEventComponent) events[1]; - - // Initialize dialog implementations for command execution - TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); - TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); - TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); - - // ------------------------------------------------------------------------ - // Create session - // ------------------------------------------------------------------------ - // Initialize session handling scenario - fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING_WITH_PATH); - - CreateSessionDialogStub sessionDialogStub = new CreateSessionDialogStub(); - sessionDialogStub.setSessionPath("/home/user/temp"); - TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub); - - TraceSessionComponent session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals("mysession", session.getName()); - assertEquals("/home/user/temp", session.getSessionPath()); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - - // ------------------------------------------------------------------------ - // Enable Channel on UST global domain - // ------------------------------------------------------------------------ - fProxy.setScenario(SCEN_SCENARIO2_TEST); - EnableChannelDialogStub channelDialogStub = new EnableChannelDialogStub(); - channelDialogStub.setIsKernel(false); - channelDialogStub.getChannelInfo().setOverwriteMode(false); - channelDialogStub.getChannelInfo().setSwitchTimer(200); - channelDialogStub.getChannelInfo().setReadTimer(100); - channelDialogStub.getChannelInfo().setNumberOfSubBuffers(2); - TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelDialogStub); - - fFacility.executeCommand(session, "enableChannelOnSession"); - - // Verify that UST domain was created - ITraceControlComponent[] domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - assertEquals("UST global", domains[0].getName()); - - // Verify that channel was created with correct data - ITraceControlComponent[]channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(1, channels.length); - - assertTrue(channels[0] instanceof TraceChannelComponent); - TraceChannelComponent channel = (TraceChannelComponent) channels[0]; - assertEquals("mychannel", channel.getName()); - assertEquals(2, channel.getNumberOfSubBuffers()); - assertEquals("mmap()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); - assertEquals(false, channel.isOverwriteMode()); - assertEquals(100, channel.getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channel.getState()); - assertEquals(16384, channel.getSubBufferSize()); - assertEquals(200, channel.getSwitchTimer()); - - // ------------------------------------------------------------------------ - // Enable event on default channel on created session above - // ------------------------------------------------------------------------ - // Get first UST provider - UstProviderComponent ustProvider = (UstProviderComponent) providers[1]; - assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustProvider.getName()); - assertEquals(9379, ustProvider.getPid()); - - // Get events - events = ustProvider.getChildren(); - assertNotNull(events); - assertEquals(2, events.length); - - baseEventInfo0 = (BaseEventComponent) events[0]; - baseEventInfo1 = (BaseEventComponent) events[1]; - - ITraceControlComponent[] ustSelection = { baseEventInfo0, baseEventInfo1 }; - - fFacility.executeCommand(ustSelection, "assign.event"); - - // verify that events were created under the channel - // Note that domain and channel has to be re-read because the tree is re-created - - domains = session.getChildren(); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - - ITraceControlComponent[] ustEvents = channels[0].getChildren(); - assertEquals(2, ustEvents.length); - - TraceEventComponent event = (TraceEventComponent) ustEvents[0]; - assertEquals("ust_tests_hello:tptest_sighandler", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - event = (TraceEventComponent) ustEvents[1]; - assertEquals("ust_tests_hello:tptest", ustEvents[1].getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Disable event components - // ------------------------------------------------------------------------ - fFacility.executeCommand(event, "disableEvent"); - - assertEquals(TraceEnablement.DISABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Enable event component - // ------------------------------------------------------------------------ - fFacility.executeCommand(event, "enableEvent"); - - // Verify event state - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Destroy session - // ------------------------------------------------------------------------ - - // Initialize session handling scenario - fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); - - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - //------------------------------------------------------------------------- - // Disconnect node - //------------------------------------------------------------------------- - fFacility.executeCommand(node, "disconnect"); - assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); - - //------------------------------------------------------------------------- - // Delete node - //------------------------------------------------------------------------- - fFacility.executeCommand(node, "delete"); - assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests.java deleted file mode 100644 index 5fa6c7e54a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests.java +++ /dev/null @@ -1,548 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.*; - -import java.io.File; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableEventsDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class TraceControlUstSessionTests contains UST - * session/channel/event handling test cases. - */ -public class TraceControlUstSessionTests { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private static final String TEST_STREAM = "CreateTreeTest.cfg"; - private static final String SCEN_SCENARIO4_TEST = "Scenario4"; - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private TraceControlTestFacility fFacility; - private TestRemoteSystemProxy fProxy; - private String fTestFile; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fFacility = TraceControlTestFacility.getInstance(); - fFacility.init(); - fProxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestFile = testfile.getAbsolutePath(); - } - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - fFacility.waitForJobs(); - fFacility.dispose(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * This will fail the test - */ - @Test - public void testTraceSessionTree() throws Exception { - - fProxy.setTestFile(fTestFile); - fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); - - ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); - - root.addChild(node); - fFacility.waitForJobs(); - - fFacility.executeCommand(node, "connect"); - int i = 0; - while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { - i++; - fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); - } - - // Get provider groups - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - // Initialize dialog implementations for command execution - TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); - TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); - TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); - - // Initialize session handling scenario - fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); - - // ------------------------------------------------------------------------ - // Create session - // ------------------------------------------------------------------------ - TraceSessionComponent session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals("mysession", session.getName()); - assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath()); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - - // Initialize scenario - fProxy.setScenario(SCEN_SCENARIO4_TEST); - - // ------------------------------------------------------------------------ - // Enable default channel on created session above - // ------------------------------------------------------------------------ - EnableChannelDialogStub channelStub = new EnableChannelDialogStub(); - channelStub.setIsKernel(false); - TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub); - - fFacility.executeCommand(session, "enableChannelOnSession"); - - // Verify that Kernel domain was created - ITraceControlComponent[] domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - assertEquals("UST global", domains[0].getName()); - assertEquals("Domain buffer Type", BufferType.BUFFER_TYPE_UNKNOWN, ((TraceDomainComponent)domains[0]).getBufferType()); - - // Verify that channel was created with correct data - ITraceControlComponent[] channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(1, channels.length); - - assertTrue(channels[0] instanceof TraceChannelComponent); - TraceChannelComponent channel = (TraceChannelComponent) channels[0]; - assertEquals("mychannel", channel.getName()); - assertEquals(4, channel.getNumberOfSubBuffers()); - assertEquals("mmap()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); - assertEquals(true, channel.isOverwriteMode()); - assertEquals(200, channel.getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channel.getState()); - assertEquals(16384, channel.getSubBufferSize()); - assertEquals(100, channel.getSwitchTimer()); - - // ------------------------------------------------------------------------ - // Enable channel on domain - // ------------------------------------------------------------------------ - ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo(); - info.setName("mychannel2"); - info.setOverwriteMode(false); - info.setSubBufferSize(32768); - info.setNumberOfSubBuffers(2); - info.setSwitchTimer(100); - info.setReadTimer(200); - channelStub.setChannelInfo(info); - - fFacility.executeCommand(domains[0], "enableChannelOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(2, channels.length); - - assertTrue(channels[1] instanceof TraceChannelComponent); - channel = (TraceChannelComponent) channels[1]; - assertEquals("mychannel2", channel.getName()); - assertEquals(2, channel.getNumberOfSubBuffers()); - assertEquals("mmap()", channel.getOutputType().getInName()); - assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); - assertEquals(false, channel.isOverwriteMode()); - assertEquals(200, channel.getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channel.getState()); - assertEquals(32768, channel.getSubBufferSize()); - assertEquals(100, channel.getSwitchTimer()); - - // ------------------------------------------------------------------------ - // Enable event (tracepoint) on session and default channel - // ------------------------------------------------------------------------ - EnableEventsDialogStub eventsDialogStub = new EnableEventsDialogStub(); - eventsDialogStub.setIsTracePoints(true); - List events = new ArrayList<>(); - events.add("ust_tests_hello:tptest_sighandler"); - eventsDialogStub.setNames(events); - eventsDialogStub.setIsKernel(false); - TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub); - - fFacility.executeCommand(session, "enableEventOnSession"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(3, channels.length); - - assertTrue(channels[2] instanceof TraceChannelComponent); - channel = (TraceChannelComponent) channels[2]; - assertEquals("channel0", channel.getName()); - // No need to check parameters of default channel because that has been done in other tests - - ITraceControlComponent[] channel0Events = channel.getChildren(); - assertEquals(1, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - TraceEventComponent event = (TraceEventComponent) channel0Events[0]; - assertEquals("ust_tests_hello:tptest_sighandler", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); // TODO - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Enable event (tracepoint) on domain and default channel - // ------------------------------------------------------------------------ - events.clear(); - events.add("ust_tests_hello:tptest"); - eventsDialogStub.setNames(events); - - fFacility.executeCommand(domains[0], "enableEventOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(2, channel0Events.length); - - assertTrue(channel0Events[1] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[1]; - assertEquals("ust_tests_hello:tptest", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); // TODO - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Enable event (all tracepoints) on specific channel - // ------------------------------------------------------------------------ - events.clear(); - eventsDialogStub.setNames(events); - eventsDialogStub.setIsAllTracePoints(true); - - fFacility.executeCommand(channels[1], "enableEventOnChannel"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[1]; - // No need to check parameters of default channel because that has been done in other tests - - channel = (TraceChannelComponent) channels[1]; - - channel0Events = channel.getChildren(); - assertEquals(1, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("*", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Enable event (wildcard) on specific channel - // ------------------------------------------------------------------------ - events.clear(); - eventsDialogStub.setIsTracePoints(false); - eventsDialogStub.setIsAllTracePoints(false); - eventsDialogStub.setIsWildcard(true); - eventsDialogStub.setWildcard("ust*"); - - fFacility.executeCommand(channels[0], "enableEventOnChannel"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[0]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(1, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("ust*", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Enable event (wildcard) on domain - // ------------------------------------------------------------------------ - events.clear(); - eventsDialogStub.setIsTracePoints(false); - eventsDialogStub.setIsAllTracePoints(false); - eventsDialogStub.setIsWildcard(true); - eventsDialogStub.setWildcard("ust*"); - - fFacility.executeCommand(domains[0], "enableEventOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[0]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(1, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("ust*", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Enable event (wildcard) on session - // ------------------------------------------------------------------------ - events.clear(); - eventsDialogStub.setIsTracePoints(false); - eventsDialogStub.setIsAllTracePoints(false); - eventsDialogStub.setIsWildcard(true); - eventsDialogStub.setWildcard("ust*"); - - fFacility.executeCommand(domains[0], "enableEventOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(4, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("u*", event.getName()); - assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Enable event (loglevel) on domain - // ------------------------------------------------------------------------ - events.clear(); - eventsDialogStub.setIsWildcard(false); - eventsDialogStub.setIsLogLevel(true); - eventsDialogStub.setLogLevelEventName("myevent1"); - eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL); - eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_WARNING); - - fFacility.executeCommand(domains[0], "enableEventOnDomain"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(5, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("myevent1", event.getName()); - assertEquals(TraceLogLevel.TRACE_WARNING, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Enable event (loglevel) on session - // ------------------------------------------------------------------------ - eventsDialogStub.setLogLevelEventName("myevent2"); - eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY); - eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION); - - fFacility.executeCommand(session, "enableEventOnSession"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[2]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(6, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("myevent2", event.getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Enable event (loglevel) on channel - // ------------------------------------------------------------------------ - eventsDialogStub.setLogLevelEventName("myevent0"); - eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY); - eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION); - - fFacility.executeCommand(channels[0], "enableEventOnChannel"); - - // Get Kernel domain component instance - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - channel = (TraceChannelComponent) channels[0]; - // No need to check parameters of default channel because that has been done in other tests - - channel0Events = channel.getChildren(); - assertEquals(2, channel0Events.length); - - assertTrue(channel0Events[0] instanceof TraceEventComponent); - - event = (TraceEventComponent) channel0Events[0]; - assertEquals("myevent0", event.getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); - assertEquals(TraceEnablement.ENABLED, event.getState()); - - // ------------------------------------------------------------------------ - // Destroy session - // ------------------------------------------------------------------------ - // Initialize session handling scenario - fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); - - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals("Session components still exist.", 0, groups[1].getChildren().length); - - //------------------------------------------------------------------------- - // Disconnect node - //------------------------------------------------------------------------- - fFacility.executeCommand(node, "disconnect"); - assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); - - //------------------------------------------------------------------------- - // Delete node - //------------------------------------------------------------------------- - - fFacility.executeCommand(node, "delete"); - - assertEquals("Node not deleted.", 0, fFacility.getControlView().getTraceControlRoot().getChildren().length); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests2.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests2.java deleted file mode 100644 index 6f13022303..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests2.java +++ /dev/null @@ -1,309 +0,0 @@ -/********************************************************************** - * Copyright (c) 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class TraceControlUstSessionTests contains UST - * session/channel/event handling test cases for LTTng 2.2. - */ -public class TraceControlUstSessionTests2 { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private static final String TEST_STREAM = "CreateTreeTest2.cfg"; - private static final String SCEN_SCEN_PER_UID_TEST = "ScenPerUidTest"; - private static final String SCEN_SCEN_PER_PID_TEST = "ScenPerPidTest"; - private static final String SCEN_SCEN_BUF_SIZE_TEST = "ScenBufSizeTest"; - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private TraceControlTestFacility fFacility; - private TestRemoteSystemProxy fProxy; - private String fTestFile; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fFacility = TraceControlTestFacility.getInstance(); - fFacility.init(); - fProxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestFile = testfile.getAbsolutePath(); - } - - /** - * Perform post-test clean-up. - */ - @After - public void tearDown() { - fFacility.waitForJobs(); - fFacility.dispose(); - } - - /** - * Run the TraceControlComponent. - * - * @throws Exception - * This will fail the test - */ - @Test - public void testTraceSessionTree() throws Exception { - - fProxy.setTestFile(fTestFile); - fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); - - ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile profile = registry.createSystemProfile("myProfile", true); - IHost host = registry.createLocalHost(profile, "myProfile", "user"); - - TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); - - root.addChild(node); - fFacility.waitForJobs(); - - fFacility.executeCommand(node, "connect"); - int i = 0; - while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { - i++; - fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); - } - - // Get provider groups - ITraceControlComponent[] groups = node.getChildren(); - assertNotNull(groups); - assertEquals(2, groups.length); - - // Initialize dialog implementations for command execution - TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); - TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); - TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); - - // Initialize scenario - fProxy.setScenario(SCEN_SCEN_PER_UID_TEST); - - // ------------------------------------------------------------------------ - // Create session - // ------------------------------------------------------------------------ - TraceSessionComponent session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals("mysession", session.getName()); - - // ------------------------------------------------------------------------ - // Enable default channel on created session above - // ------------------------------------------------------------------------ - EnableChannelDialogStub channelStub = new EnableChannelDialogStub(); - channelStub.setIsKernel(false); - ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo(); - info.setName("mychannel"); - info.setOverwriteMode(false); - info.setSubBufferSize(-1); - info.setNumberOfSubBuffers(-1); - info.setSwitchTimer(-1); - info.setReadTimer(-1); - info.setMaxNumberTraceFiles(-1); - info.setMaxSizeTraceFiles(-1); - info.setBufferType(BufferType.BUFFER_PER_UID); - channelStub.setChannelInfo(info); - - TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub); - - fFacility.executeCommand(session, "enableChannelOnSession"); - - // Verify that UST domain was created - ITraceControlComponent[] domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - assertEquals("UST global", domains[0].getName()); - assertEquals("Domain buffer Type", BufferType.BUFFER_PER_UID, ((TraceDomainComponent)domains[0]).getBufferType()); - - // Verify that channel was created with correct data - ITraceControlComponent[] channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(1, channels.length); - - assertTrue(channels[0] instanceof TraceChannelComponent); - TraceChannelComponent channel = (TraceChannelComponent) channels[0]; - assertEquals("mychannel", channel.getName()); - - // ------------------------------------------------------------------------ - // Destroy session - // ------------------------------------------------------------------------ - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - // ------------------------------------------------------------------------ - // Create session (per-pid buffers) - // ------------------------------------------------------------------------ - - // Initialize scenario - fProxy.setScenario(SCEN_SCEN_PER_PID_TEST); - - session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals("mysession", session.getName()); - - // ------------------------------------------------------------------------ - // Enable default channel on created session above - // ------------------------------------------------------------------------ - info = (ChannelInfo)channelStub.getChannelInfo(); - info.setName("mychannel"); - info.setBufferType(BufferType.BUFFER_PER_PID); - channelStub.setChannelInfo(info); - - fFacility.executeCommand(session, "enableChannelOnSession"); - - // Verify that UST domain was created - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - assertEquals("UST global", domains[0].getName()); - assertEquals("Domain buffer Type", BufferType.BUFFER_PER_PID, ((TraceDomainComponent)domains[0]).getBufferType()); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(1, channels.length); - - assertTrue(channels[0] instanceof TraceChannelComponent); - channel = (TraceChannelComponent) channels[0]; - assertEquals("mychannel", channel.getName()); - - // ------------------------------------------------------------------------ - // Destroy session - // ------------------------------------------------------------------------ - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - // ------------------------------------------------------------------------ - // Create session (configured file size and number of files) - // ------------------------------------------------------------------------ - - // Initialize scenario - fProxy.setScenario(SCEN_SCEN_BUF_SIZE_TEST); - - session = fFacility.createSession(groups[1]); - - // Verify that session was created - assertNotNull(session); - assertEquals("mysession", session.getName()); - - // ------------------------------------------------------------------------ - // Enable default channel on created session above - // ------------------------------------------------------------------------ - info = (ChannelInfo)channelStub.getChannelInfo(); - info.setName("mychannel"); - info.setMaxNumberTraceFiles(10); - info.setMaxSizeTraceFiles(1024); - info.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN); - channelStub.setChannelInfo(info); - - fFacility.executeCommand(session, "enableChannelOnSession"); - - // Verify that UST domain was created - domains = session.getChildren(); - assertNotNull(domains); - assertEquals(1, domains.length); - - assertEquals("UST global", domains[0].getName()); - assertEquals("Domain buffer Type", BufferType.BUFFER_PER_PID, ((TraceDomainComponent)domains[0]).getBufferType()); - - // Verify that channel was created with correct data - channels = domains[0].getChildren(); - assertNotNull(channels); - assertEquals(1, channels.length); - - assertTrue(channels[0] instanceof TraceChannelComponent); - channel = (TraceChannelComponent) channels[0]; - assertEquals("mychannel", channel.getName()); - - // ------------------------------------------------------------------------ - // Destroy session - // ------------------------------------------------------------------------ - fFacility.destroySession(session); - - // Verify that no more session components exist - assertEquals(0, groups[1].getChildren().length); - - //------------------------------------------------------------------------- - // Disconnect node - //------------------------------------------------------------------------- - fFacility.executeCommand(node, "disconnect"); - assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); - - //------------------------------------------------------------------------- - // Delete node - //------------------------------------------------------------------------- - - fFacility.executeCommand(node, "delete"); - - assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/AllTests.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/AllTests.java deleted file mode 100644 index 8c1040009b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.service; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Runner for the service unit tests. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - LTTngControlServiceTest.class, - LTTngControlServiceMiTest.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java deleted file mode 100644 index 32fa19ab62..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java +++ /dev/null @@ -1,148 +0,0 @@ -/********************************************************************** - * 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: - * Jonathan Rajotte - Support of machine interface - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.service; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.net.URL; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceMI; - -/** - * @author ejorajo - * - */ -public class LTTngControlServiceMiTest extends LTTngControlServiceTest { - - private static final String MI_TEST_STREAM = "LTTngServiceMiTest.cfg"; - - @Override - protected ILttngControlService getControlService() { - try { - URL resource = LTTngControlServiceMI.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME); - return new LTTngControlServiceMI(getfShell(), resource); - } catch (ExecutionException e) { - return null; - } - } - - @Override - public void testGetSessionNameGarbage() { - try { - fShell.setScenario(SCEN_GET_SESSION_GARBAGE_OUT); - fService.getSessionNames(new NullProgressMonitor()); - } catch (ExecutionException e) { - // Success. Parsing of garbage result in an ExecutionException - // generated by the XML document parser: Unable to parse the xml - // document. - } - } - - @Override - public void testCreateLiveSession() throws ExecutionException { - fShell.setScenario(SCEN_CREATE_LIVE_SESSION); - - ISessionInfo params = new SessionInfo("mysession"); - params.setLive(true); - params.setStreamedTrace(true); - params.setNetworkUrl("net://127.0.0.1"); - ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); - assertNotNull(sessionInfo); - assertEquals("mysession", sessionInfo.getName()); - assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); - assertTrue(sessionInfo.isStreamedTrace()); - assertTrue(sessionInfo.isLive()); - assertEquals("tcp4://127.0.0.1:5342/ [data: 5343]", sessionInfo.getSessionPath()); - String[] names = fService.getSessionNames(new NullProgressMonitor()); - assertEquals(names[0], "mysession"); - fService.destroySession("mysession", new NullProgressMonitor()); - } - - @Override - protected String getTestStream() { - return MI_TEST_STREAM; - } - - @Override - protected TraceLogLevel getAllEventTraceLogLevel() { - return TraceLogLevel.TRACE_DEBUG; - } - - @Override - public void testGetKernelProviderNoUstVerbose() { - // Verbose mode in machine interface is deactivated. This test is - // ignored. - } - - @Override - public void testCreateSession2_1() { - // 2.1 is not supported by mi. This test is ignored. - } - - @Override - public void testGetKernelProviderNoUst3() { - // Verbose mode in machine interface is deactivated. This test is - // ignored. - } - - @Override - public void testGetKernelProviderNoKernelVerbose() { - // Verbose mode in machine interface is deactivated. This test is - // ignored. - } - - @Override - public void testCreateSessionVerbose2_1() { - // Verbose mode in machine interface is deactivated. This test is - // ignored. - } - - @Override - public void testDestroySessionVerbose() { - // Verbose mode in machine interface is deactivated. This test is - // ignored. - } - - @Override - public void testCreateSessionWithPrompt() { - // TODO Investigate if this case can happen in production. If yes than - // we need to rethinks the MI fetching and parsing. - } - - @Override - public void testAddContext() { - // TODO This does not use mi feature.And currently the context enabling - // is wrong for 2.6. - } - - @Override - public void testAddContextFailure() { - // TODO This does not use mi feature.And currently the context enabling - // is wrong for 2.6. - } - - @Override - public void testCreateSnapshotSession2_5() { - // not applicable for MI - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceTest.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceTest.java deleted file mode 100644 index 0c7d59202d..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceTest.java +++ /dev/null @@ -1,1524 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Alexandre Montplaisir - Port to JUnit4 - * Marc-Andre Laperle - Support for creating a live session - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.control.ui.tests.service; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.CommandShellFactory; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.shells.LTTngToolsFileShell; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlService; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osgi.framework.FrameworkUtil; - -/** - * The class LTTngControlServiceTest contains test for the class - * {@link LTTngControlService}. - */ -@SuppressWarnings("javadoc") -public class LTTngControlServiceTest { - - private static final String DIRECTORY = "testfiles"; - private static final String TEST_STREAM = "LTTngServiceTest.cfg"; - - private static final String SCEN_LTTNG_NOT_INSTALLED = "LttngNotInstalled"; - private static final String SCEN_LTTNG_VERSION = "LttngVersion"; - private static final String SCEN_LTTNG_VERSION_WITH_PROMPT = "LttngVersionWithPrompt"; - private static final String SCEN_LTTNG_UNSUPPORTED_VERSION = "LttngUnsupportedVersion"; - private static final String SCEN_LTTNG_NO_VERSION = "LttngNoVersion"; - private static final String SCEN_NO_SESSION_AVAILABLE = "NoSessionAvailable"; - private static final String SCEN_GET_SESSION_NAMES1 = "GetSessionNames1"; - private static final String SCEN_GET_SESSION_NAME_NOT_EXIST = "GetSessionNameNotExist"; - private static final String SCEN_GET_SESSION_NAME_NOT_EXIST_VERBOSE = "GetSessionNameNotExistVerbose"; - protected static final String SCEN_GET_SESSION_GARBAGE_OUT = "GetSessionGarbageOut"; - private static final String SCEN_GET_SESSION1 = "GetSession1"; - private static final String SCEN_GET_KERNEL_PROVIDER1 = "GetKernelProvider1"; - private static final String SCEN_LIST_WITH_NO_KERNEL1 = "ListWithNoKernel1"; - private static final String SCEN_LIST_WITH_NO_KERNEL2 = "ListWithNoKernel2"; - private static final String SCEN_LIST_WITH_NO_KERNEL_VERBOSE = "ListWithNoKernelVerbose"; - private static final String SCEN_GET_UST_PROVIDER1 = "GetUstProvider1"; - private static final String SCEN_GET_UST_PROVIDER2 = "GetUstProvider2"; - private static final String SCEN_GET_UST_PROVIDER3 = "GetUstProvider3"; - private static final String SCEN_LIST_WITH_NO_UST1 = "ListWithNoUst1"; - private static final String SCEN_LIST_WITH_NO_UST2 = "ListWithNoUst2"; - private static final String SCEN_LIST_WITH_NO_UST3 = "ListWithNoUst3"; - private static final String SCEN_LIST_WITH_NO_UST_VERBOSE = "ListWithNoUstVerbose"; - private static final String SCEN_CREATE_SESSION1 = "CreateSession1"; - private static final String SCEN_CREATE_SESSION_WITH_PROMPT = "CreateSessionWithPrompt"; - private static final String SCEN_CREATE_SESSION_VARIANTS = "CreateSessionVariants"; - private static final String SCEN_DESTROY_SESSION1 = "DestroySession1"; - private static final String SCEN_DESTROY_SESSION_VERBOSE = "DestroySessionVerbose"; - private static final String SCEN_CHANNEL_HANDLING = "ChannelHandling"; - private static final String SCEN_EVENT_HANDLING = "EventHandling"; - private static final String SCEN_CONTEXT_HANDLING = "ContextHandling"; - private static final String SCEN_CONTEXT_ERROR_HANDLING = "ContextErrorHandling"; - private static final String SCEN_CALIBRATE_HANDLING = "CalibrateHandling"; - private static final String SCEN_CREATE_SESSION_2_1 = "CreateSessionLttng2.1"; - private static final String SCEN_CREATE_SESSION_VERBOSE_2_1 = "CreateSessionLttngVerbose2.1"; - private static final String SCEN_CREATE_SNAPSHOT_SESSION = "CreateSessionSnapshot"; - private static final String SCEN_CREATE_SNAPSHOT_SESSION_2_5 = "CreateSessionSnapshot2.5"; - private static final String SCEN_CREATE_STREAMED_SNAPSHOT_SESSION = "CreateSessionStreamedSnapshot"; - private static final String SCEN_CREATE_SNAPSHOT_SESSION_ERRORS = "CreateSessionSnapshotErrors"; - protected static final String SCEN_CREATE_LIVE_SESSION = "CreateSessionLive"; - private static final String SCEN_CREATE_LIVE_SESSION_ERRORS = "CreateSessionLiveErrors"; - - - // ------------------------------------------------------------------------ - // Test data - // ------------------------------------------------------------------------ - - private CommandShellFactory fShellFactory; - private String fTestfile; - protected LTTngToolsFileShell fShell; - protected ILttngControlService fService; - - // ------------------------------------------------------------------------ - // Housekeeping - // ------------------------------------------------------------------------ - - /** - * Perform pre-test initialization. - * - * @throws Exception - * if the initialization fails for some reason - */ - @Before - public void setUp() throws Exception { - fShellFactory = CommandShellFactory.getInstance(); - - URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(getTestDirectory() + File.separator + getTestStream()), null); - File testfile = new File(FileLocator.toFileURL(location).toURI()); - fTestfile = testfile.getAbsolutePath(); - - fShell = fShellFactory.getFileShell(); - fShell.loadScenarioFile(fTestfile); - fService = getControlService(); - if (fService == null) { - throw new Exception("Unable to obtain a valid ControlService"); - } - - ControlPreferences.getInstance().init(Activator.getDefault().getPreferenceStore()); - } - - /** - * @return the string of the test directory to use - */ - protected String getTestDirectory() { - return DIRECTORY; - } - - /** - * @return the LttngCon - */ - protected ILttngControlService getControlService() { - return new LTTngControlService(fShell); - } - - public LTTngToolsFileShell getfShell() { - return fShell; - } - - /** - * @return - */ - protected String getTestStream() { - return TEST_STREAM; - } - - @After - public void tearDown() { - disableVerbose(); - ControlPreferences.getInstance().dispose(); - } - - // ------------------------------------------------------------------------ - // Test Cases - // ------------------------------------------------------------------------ - - @Test - public void testVersion() { - try { - fShell.setScenario(SCEN_LTTNG_VERSION); - ILttngControlService service = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); - assertNotNull(service); - assertEquals("2.1.0", service.getVersionString()); - } catch (ExecutionException e) { - fail("Exeption thrown " + e); - } - } - - @Test - public void testVersionWithPrompt() { - try { - fShell.setScenario(SCEN_LTTNG_VERSION_WITH_PROMPT); - ILttngControlService service = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); - assertNotNull(service); - assertEquals("2.0.0", service.getVersionString()); - } catch (ExecutionException e) { - fail("Exeption thrown " + e); - } - } - - @Test - public void testUnsupportedVersion() { - try { - fShell.setScenario(SCEN_LTTNG_UNSUPPORTED_VERSION); - LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); - fail("No exeption thrown"); - } catch (ExecutionException e) { - // success - } - } - - @Test - public void testNoVersion() { - try { - fShell.setScenario(SCEN_LTTNG_NO_VERSION); - LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); - fail("No exeption thrown"); - } catch (ExecutionException e) { - // success - } - } - - @Test - public void testLttngNotInstalled() { - try { - fShell.setScenario(SCEN_LTTNG_NOT_INSTALLED); - fService.getSessionNames(new NullProgressMonitor()); - fail("No exeption thrown"); - } catch (ExecutionException e) { - // success - } - } - - @Test - public void testGetSessionNames1() { - try { - fShell.setScenario(SCEN_NO_SESSION_AVAILABLE); - String[] result = fService.getSessionNames(new NullProgressMonitor()); - - assertNotNull(result); - assertEquals(0, result.length); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testGetSessionNames2() { - try { - fShell.setScenario(SCEN_GET_SESSION_NAMES1); - String[] result = fService.getSessionNames(new NullProgressMonitor()); - - assertNotNull(result); - assertEquals(2, result.length); - assertEquals("mysession1", result[0]); - assertEquals("mysession", result[1]); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testGetSessionNotExist() { - try { - fShell.setScenario(SCEN_GET_SESSION_NAME_NOT_EXIST); - fService.getSessionNames(new NullProgressMonitor()); - fail("No exeption thrown"); - - } catch (ExecutionException e) { - // success - } - } - - @Test - public void testGetSessionNotExistVerbose() { - try { - enableVerbose(); - fShell.setScenario(SCEN_GET_SESSION_NAME_NOT_EXIST_VERBOSE); - fService.getSessionNames(new NullProgressMonitor()); - fail("No exeption thrown"); - - } catch (ExecutionException e) { - // success - } finally { - disableVerbose(); - } - } - - @Test - public void testGetSessionNameGarbage() { - try { - fShell.setScenario(SCEN_GET_SESSION_GARBAGE_OUT); - String[] result = fService.getSessionNames(new NullProgressMonitor()); - - assertNotNull(result); - assertEquals(0, result.length); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testGetSession1() { - try { - fShell.setScenario(SCEN_GET_SESSION1); - ISessionInfo session = fService.getSession("mysession", new NullProgressMonitor()); - - // Verify Session - assertNotNull(session); - assertEquals("mysession", session.getName()); - assertEquals("/home/user/lttng-traces/mysession-20120129-084256", session.getSessionPath()); - assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); - - IDomainInfo[] domains = session.getDomains(); - assertNotNull(domains); - assertEquals(2, domains.length); - - // Verify Kernel domain - assertEquals("Kernel", domains[0].getName()); - IChannelInfo[] channels = domains[0].getChannels(); - assertNotNull(channels); - assertEquals(2, channels.length); - - // Verify Kernel's channel0 - assertEquals("channel0", channels[0].getName()); - assertEquals(4, channels[0].getNumberOfSubBuffers()); - assertEquals("splice()", channels[0].getOutputType().getInName()); - assertEquals(TraceChannelOutputType.SPLICE, channels[0].getOutputType()); - assertEquals(false, channels[0].isOverwriteMode()); - assertEquals(200, channels[0].getReadTimer()); - assertEquals(TraceEnablement.ENABLED, channels[0].getState()); - assertEquals(262144, channels[0].getSubBufferSize()); - assertEquals(0, channels[0].getSwitchTimer()); - - // Verify event info - IEventInfo[] channel0Events = channels[0].getEvents(); - assertNotNull(channel0Events); - assertEquals(2, channel0Events.length); - assertEquals("block_rq_remap", channel0Events[0].getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[0].getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, channel0Events[0].getEventType()); - assertEquals(TraceEnablement.ENABLED, channel0Events[0].getState()); - - assertEquals("block_bio_remap", channel0Events[1].getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[1].getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, channel0Events[1].getEventType()); - assertEquals(TraceEnablement.DISABLED, channel0Events[1].getState()); - - // Verify Kernel's channel1 - assertEquals("channel1", channels[1].getName()); - assertEquals(4, channels[1].getNumberOfSubBuffers()); - assertEquals("splice()", channels[1].getOutputType().getInName()); - assertEquals(TraceChannelOutputType.SPLICE, channels[1].getOutputType()); - assertEquals(true, channels[1].isOverwriteMode()); - assertEquals(400, channels[1].getReadTimer()); - assertEquals(TraceEnablement.DISABLED, channels[1].getState()); - assertEquals(524288, channels[1].getSubBufferSize()); - assertEquals(100, channels[1].getSwitchTimer()); - - // Verify event info - IEventInfo[] channel1Events = channels[1].getEvents(); - assertEquals(0, channel1Events.length); - - // Verify domain UST global - assertEquals("UST global", domains[1].getName()); - - IChannelInfo[] ustChannels = domains[1].getChannels(); - - // Verify UST global's mychannel1 - assertEquals("mychannel1", ustChannels[0].getName()); - assertEquals(8, ustChannels[0].getNumberOfSubBuffers()); - assertEquals("mmap()", ustChannels[0].getOutputType().getInName()); - assertEquals(TraceChannelOutputType.MMAP, ustChannels[0].getOutputType()); - assertEquals(true, ustChannels[0].isOverwriteMode()); - assertEquals(100, ustChannels[0].getReadTimer()); - assertEquals(TraceEnablement.DISABLED, ustChannels[0].getState()); - assertEquals(8192, ustChannels[0].getSubBufferSize()); - assertEquals(200, ustChannels[0].getSwitchTimer()); - - // Verify event info - IEventInfo[] ustEvents = ustChannels[0].getEvents(); - assertEquals(0, ustEvents.length); - - // Verify UST global's channel0 - assertEquals("channel0", ustChannels[1].getName()); - assertEquals(4, ustChannels[1].getNumberOfSubBuffers()); - assertEquals("mmap()", ustChannels[1].getOutputType().getInName()); - assertEquals(TraceChannelOutputType.MMAP, ustChannels[1].getOutputType()); - assertEquals(false, ustChannels[1].isOverwriteMode()); - assertEquals(200, ustChannels[1].getReadTimer()); - assertEquals(TraceEnablement.ENABLED, ustChannels[1].getState()); - assertEquals(4096, ustChannels[1].getSubBufferSize()); - assertEquals(0, ustChannels[1].getSwitchTimer()); - - // Verify event info - ustEvents = ustChannels[1].getEvents(); - assertEquals(2, ustEvents.length); - - assertEquals("ust_tests_hello:tptest_sighandler", ustEvents[0].getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, ustEvents[0].getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, ustEvents[0].getEventType()); - assertEquals(TraceEnablement.DISABLED, ustEvents[0].getState()); - - assertEquals("*", ustEvents[1].getName()); - assertEquals(getAllEventTraceLogLevel(), ustEvents[1].getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, ustEvents[1].getEventType()); - assertEquals(TraceEnablement.ENABLED, ustEvents[1].getState()); - - // next session (no detailed information available) - session = fService.getSession("mysession1", new NullProgressMonitor()); - assertNotNull(session); - assertEquals("mysession1", session.getName()); - assertEquals("/home/user/lttng-traces/mysession1-20120203-133225", session.getSessionPath()); - assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); - - domains = session.getDomains(); - assertNotNull(domains); - assertEquals(0, domains.length); - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - /** - * @return - */ - protected TraceLogLevel getAllEventTraceLogLevel() { - return TraceLogLevel.LEVEL_UNKNOWN; - } - - public void testGetKernelProvider() { - try { - fShell.setScenario(SCEN_GET_KERNEL_PROVIDER1); - List events = fService.getKernelProvider(new NullProgressMonitor()); - - // Verify event info - assertNotNull(events); - assertEquals(3, events.size()); - - IBaseEventInfo baseEventInfo = events.get(0); - assertNotNull(baseEventInfo); - assertEquals("sched_kthread_stop", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - baseEventInfo = events.get(1); - assertEquals("sched_kthread_stop_ret", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - baseEventInfo = events.get(2); - assertEquals("sched_wakeup_new", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testGetKernelProviderNoKernel1() { - try { - fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL1); - List events = fService.getKernelProvider(new NullProgressMonitor()); - - // Verify event info - assertNotNull(events); - assertEquals(0, events.size()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testGetKernelProviderNoKernel2() { - try { - fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL2); - List events = fService.getKernelProvider(new NullProgressMonitor()); - - // Verify event info - assertNotNull(events); - assertEquals(0, events.size()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testGetKernelProviderNoKernelVerbose() { - try { - enableVerbose(); - fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL_VERBOSE); - List events = fService.getKernelProvider(new NullProgressMonitor()); - - // Verify event info - assertNotNull(events); - assertEquals(0, events.size()); - - } catch (ExecutionException e) { - fail(e.toString()); - } finally { - disableVerbose(); - } - } - - @Test - public void testGetUstProvider() { - try { - fShell.setScenario(SCEN_GET_UST_PROVIDER1); - List providers = fService.getUstProvider(); - - // Check all providers - assertNotNull(providers); - assertEquals(2, providers.size()); - - //Verify first provider - assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(0).getName()); - assertEquals(9379, providers.get(0).getPid()); - - // Verify event info - IBaseEventInfo[] events = providers.get(0).getEvents(); - assertNotNull(events); - assertEquals(2, events.length); - - IBaseEventInfo baseEventInfo = events[0]; - assertNotNull(baseEventInfo); - assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_MODULE, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - baseEventInfo = events[1]; - assertEquals("ust_tests_hello:tptest", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_INFO, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - //Verify second provider - assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(1).getName()); - assertEquals(4852, providers.get(1).getPid()); - - // Verify event info - events = providers.get(1).getEvents(); - assertNotNull(events); - assertEquals(2, events.length); - - baseEventInfo = events[0]; - assertNotNull(baseEventInfo); - assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_WARNING, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - baseEventInfo = events[1]; - assertEquals("ust_tests_hello:tptest", baseEventInfo.getName()); - assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, baseEventInfo.getLogLevel()); - assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testUstProvider2() { - try { - fShell.setScenario(SCEN_GET_UST_PROVIDER2); - List providers = fService.getUstProvider(); - - assertNotNull(providers); - assertEquals(0, providers.size()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testGetUstProvider3() { - try { - fShell.setScenario(SCEN_GET_UST_PROVIDER3); - // Set version - ((LTTngControlService)fService).setVersion("2.1.0"); - List providers = fService.getUstProvider(); - - // Check all providers - assertNotNull(providers); - assertEquals(2, providers.size()); - - //Verify first provider - assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(0).getName()); - assertEquals(9379, providers.get(0).getPid()); - - // Verify event info - IBaseEventInfo[] events = providers.get(0).getEvents(); - assertNotNull(events); - assertEquals(2, events.length); - - IBaseEventInfo baseEventInfo = events[0]; - assertNotNull(baseEventInfo); - IFieldInfo[] fields = baseEventInfo.getFields(); - assertNotNull(fields); - assertEquals(0, fields.length); - - baseEventInfo = events[1]; - fields = baseEventInfo.getFields(); - assertNotNull(fields); - assertEquals(3, fields.length); - assertEquals("doublefield", fields[0].getName()); - assertEquals("float", fields[0].getFieldType()); - - assertEquals("floatfield", fields[1].getName()); - assertEquals("float", fields[1].getFieldType()); - - assertEquals("stringfield", fields[2].getName()); - assertEquals("string", fields[2].getFieldType()); - - //Verify second provider - assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(1).getName()); - assertEquals(4852, providers.get(1).getPid()); - - // Verify event info - events = providers.get(1).getEvents(); - assertNotNull(events); - assertEquals(2, events.length); - - baseEventInfo = events[0]; - assertNotNull(baseEventInfo); - fields = baseEventInfo.getFields(); - assertNotNull(fields); - assertEquals(0, fields.length); - - baseEventInfo = events[1]; - fields = baseEventInfo.getFields(); - assertNotNull(fields); - assertEquals(3, fields.length); - - assertEquals("doublefield", fields[0].getName()); - assertEquals("float", fields[0].getFieldType()); - - assertEquals("floatfield", fields[1].getName()); - assertEquals("float", fields[1].getFieldType()); - - assertEquals("stringfield", fields[2].getName()); - assertEquals("string", fields[2].getFieldType()); - - // Reset version - ((LTTngControlService)fService).setVersion("2.0.0"); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - - @Test - public void testGetKernelProviderNoUst1() { - try { - fShell.setScenario(SCEN_LIST_WITH_NO_UST1); - List providerList = fService.getUstProvider(new NullProgressMonitor()); - - // Verify Provider info - assertNotNull(providerList); - assertEquals(0, providerList.size()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - - @Test - public void testGetKernelProviderNoUst2() { - try { - // Set version - ((LTTngControlService)fService).setVersion("2.1.0"); - - fShell.setScenario(SCEN_LIST_WITH_NO_UST2); - List providerList = fService.getUstProvider(new NullProgressMonitor()); - - // Verify Provider info - assertNotNull(providerList); - assertEquals(0, providerList.size()); - - // Reset version - ((LTTngControlService)fService).setVersion("2.0.0"); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testGetKernelProviderNoUst3() { - try { - - // Set version - ((LTTngControlService)fService).setVersion("2.1.0"); - - fShell.setScenario(SCEN_LIST_WITH_NO_UST3); - List providerList = fService.getUstProvider(new NullProgressMonitor()); - - // Verify provider info - assertNotNull(providerList); - assertEquals(0, providerList.size()); - - // Reset version - ((LTTngControlService)fService).setVersion("2.0.0"); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testGetKernelProviderNoUstVerbose() { - try { - enableVerbose(); - - // Set version - ((LTTngControlService)fService).setVersion("2.1.0"); - - fShell.setScenario(SCEN_LIST_WITH_NO_UST_VERBOSE); - List providerList = fService.getUstProvider(new NullProgressMonitor()); - - // Verify provider info - assertNotNull(providerList); - assertEquals(0, providerList.size()); - - // Reset version - ((LTTngControlService)fService).setVersion("2.0.0"); - - } catch (ExecutionException e) { - fail(e.toString()); - } finally { - disableVerbose(); - } - } - - - - @Test - public void testCreateSession() { - try { - fShell.setScenario(SCEN_CREATE_SESSION1); - - ISessionInfo info = fService.createSession(new SessionInfo("mysession2"), new NullProgressMonitor()); - assertNotNull(info); - assertEquals("mysession2", info.getName()); - assertNotNull(info.getSessionPath()); - assertTrue(info.getSessionPath().contains("mysession2")); - assertEquals(TraceSessionState.INACTIVE, info.getSessionState()); - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testCreateSessionWithPrompt() { - try { - // First line has the shell prompt before the command output - // This can happen in a real application if the command line is not echoed by the shell. - fShell.setScenario(SCEN_CREATE_SESSION_WITH_PROMPT); - - // First line has no shell prompt before the output - ISessionInfo info = fService.createSession(new SessionInfo("mysession2"), new NullProgressMonitor()); - assertNotNull(info); - assertEquals("mysession2", info.getName()); - assertNotNull(info.getSessionPath()); - assertTrue(info.getSessionPath().contains("mysession2")); - assertEquals(TraceSessionState.INACTIVE, info.getSessionState()); - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testCreateSessionVariants() { - - fShell.setScenario(SCEN_CREATE_SESSION_VARIANTS); - - try { - fService.createSession(new SessionInfo("alreadyExist"), new NullProgressMonitor()); - fail("No exeption thrown"); - } catch (ExecutionException e) { - // success - } - - try { - fService.createSession(new SessionInfo("wrongName"), new NullProgressMonitor()); - fail("No exeption thrown"); - } catch (ExecutionException e) { - // success - } - - try { - ISessionInfo sessionInfo = new SessionInfo("withPath"); - sessionInfo.setSessionPath("/home/user/hallo"); - fService.createSession(sessionInfo, new NullProgressMonitor()); - fail("No exeption thrown"); - } catch (ExecutionException e) { - // success - } - - try { - ISessionInfo info = fService.createSession(new SessionInfo("session with spaces"), new NullProgressMonitor()); - assertNotNull(info); - assertEquals("session with spaces", info.getName()); - assertNotNull(info.getSessionPath()); - assertTrue(info.getSessionPath().contains("session with spaces")); - assertEquals(TraceSessionState.INACTIVE, info.getSessionState()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - - try { - ISessionInfo sessionInfo = new SessionInfo("pathWithSpaces"); - sessionInfo.setSessionPath("/home/user/hallo user/here"); - ISessionInfo info = fService.createSession(sessionInfo, new NullProgressMonitor()); - assertNotNull(info); - assertEquals("pathWithSpaces", info.getName()); - assertNotNull(info.getSessionPath()); - assertTrue(info.getSessionPath().contains("/home/user/hallo user/here")); - assertEquals(TraceSessionState.INACTIVE, info.getSessionState()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testDestroySession() { - try { - fShell.setScenario(SCEN_DESTROY_SESSION1); - fService.destroySession("mysession2", new NullProgressMonitor()); - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testDestroySessionVerbose() { - try { - enableVerbose(); - fShell.setScenario(SCEN_DESTROY_SESSION_VERBOSE); - fService.destroySession("mysession2", new NullProgressMonitor()); - } catch (ExecutionException e) { - fail(e.toString()); - } finally { - disableVerbose(); - } - } - - @Test - public void testCreateChannel() { - try { - ((LTTngControlService)fService).setVersion("2.2.0"); - String sessionName = "mysession2"; - List list = new ArrayList<>(); - String kernelChannel0 = "mychannel0"; - String kernelChannel1 = "mychannel1"; - list.add(kernelChannel0); - list.add(kernelChannel1); - - fShell.setScenario(SCEN_CHANNEL_HANDLING); - - // Create/enable/configure 2 kernel channels - ChannelInfo chanInfo = new ChannelInfo(""); - chanInfo.setOverwriteMode(true); - chanInfo.setSubBufferSize(16384); - chanInfo.setReadTimer(100); - chanInfo.setSwitchTimer(200); - chanInfo.setNumberOfSubBuffers(2); - chanInfo.setMaxNumberTraceFiles(10); - chanInfo.setMaxSizeTraceFiles(0); - fService.enableChannels(sessionName, list, true, chanInfo, new NullProgressMonitor()); - - // Create/enable/configure 1 UST channel - list.clear(); - list.add("ustChannel"); - - chanInfo = new ChannelInfo(""); - chanInfo.setOverwriteMode(true); - chanInfo.setSubBufferSize(32768); - chanInfo.setReadTimer(200); - chanInfo.setSwitchTimer(100); - chanInfo.setNumberOfSubBuffers(1); - chanInfo.setMaxNumberTraceFiles(20); - chanInfo.setMaxSizeTraceFiles(0); - fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor()); - ((LTTngControlService)fService).setVersion("2.0.0"); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testCreateChannelUIDBuffer() { - try { - ((LTTngControlService)fService).setVersion("2.2.0"); - String sessionName = "mysession2"; - List list = new ArrayList<>(); - String USTChannel = "ustChannel"; - list.add(USTChannel); - fShell.setScenario(SCEN_CHANNEL_HANDLING); - - ChannelInfo chanInfo = new ChannelInfo(""); - chanInfo.setOverwriteMode(true); - chanInfo.setSubBufferSize(32768); - chanInfo.setReadTimer(200); - chanInfo.setSwitchTimer(100); - chanInfo.setNumberOfSubBuffers(1); - chanInfo.setMaxNumberTraceFiles(20); - chanInfo.setMaxSizeTraceFiles(0); - chanInfo.setBufferType(BufferType.BUFFER_PER_UID); - fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor()); - ((LTTngControlService)fService).setVersion("2.0.0"); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testCreateChannelPIDBuffer() { - try { - ((LTTngControlService)fService).setVersion("2.2.0"); - String sessionName = "mysession2"; - List list = new ArrayList<>(); - String USTChannel = "ustChannel"; - list.add(USTChannel); - fShell.setScenario(SCEN_CHANNEL_HANDLING); - - - ChannelInfo chanInfo = new ChannelInfo(""); - chanInfo.setOverwriteMode(true); - chanInfo.setSubBufferSize(-1); - chanInfo.setReadTimer(-1); - chanInfo.setSwitchTimer(-1); - chanInfo.setNumberOfSubBuffers(-1); - chanInfo.setMaxNumberTraceFiles(-1); - chanInfo.setMaxSizeTraceFiles(-1); - chanInfo.setBufferType(BufferType.BUFFER_PER_PID); - - fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor()); - ((LTTngControlService)fService).setVersion("2.0.0"); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testDisableChannel() { - try { - - String sessionName = "mysession2"; - List list = new ArrayList<>(); - String kernelChannel0 = "mychannel0"; - String kernelChannel1 = "mychannel1"; - list.add(kernelChannel0); - list.add(kernelChannel1); - - fShell.setScenario(SCEN_CHANNEL_HANDLING); - fService.disableChannels(sessionName, list, true, new NullProgressMonitor()); - - list.clear(); - list.add("ustChannel"); - fService.disableChannels(sessionName, list, false, new NullProgressMonitor()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testEnableChannel() { - try { - - String sessionName = "mysession2"; - List list = new ArrayList<>(); - String kernelChannel0 = "mychannel0"; - String kernelChannel1 = "mychannel1"; - list.add(kernelChannel0); - list.add(kernelChannel1); - - fShell.setScenario(SCEN_CHANNEL_HANDLING); - fService.enableChannels(sessionName, list, true, null, new NullProgressMonitor()); - - // Create/enable/configure 1 UST channel - list.clear(); - list.add("ustChannel"); - - fService.enableChannels(sessionName, list, false, null, new NullProgressMonitor()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testEnableEvents() { - try { - // 1) session name, channel = null, 3 event names, kernel - String sessionName = "mysession2"; - List list = new ArrayList<>(); - String eventName0 = "block_rq_remap"; - String eventName1 = "block_bio_remap"; - String eventName2 = "softirq_entry"; - list.add(eventName0); - list.add(eventName1); - list.add(eventName2); - fShell.setScenario(SCEN_EVENT_HANDLING); - fService.enableEvents(sessionName, null, list, true, null, new NullProgressMonitor()); - - // 2) session name, channel=mychannel, event name= null, kernel - String channelName = "mychannel"; - fService.enableEvents(sessionName, channelName, null, true, null, new NullProgressMonitor()); - - // 3) session name, channel=mychannel, 1 event name, ust, no filter - String ustEventName = "ust_tests_hello:tptest_sighandler"; - list.clear(); - list.add(ustEventName); - fService.enableEvents(sessionName, channelName, list, false, null, new NullProgressMonitor()); - - // 4) session name, channel = mychannel, no event name, ust, with filter - fService.enableEvents(sessionName, channelName, list, false, "intfield==10", new NullProgressMonitor()); - - // 5) session name, channel = mychannel, no event name, ust, no filter - list.clear(); - fService.enableEvents(sessionName, channelName, list, false, null, new NullProgressMonitor()); - - // TODO add test with filters - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testEnableSyscalls() { - try { - // 1) session name, channel = null, 3 event names, kernel - String sessionName = "mysession2"; - String channelName = "mychannel"; - - fShell.setScenario(SCEN_EVENT_HANDLING); - - // 1) session name, channel = null - fService.enableSyscalls(sessionName, null, new NullProgressMonitor()); - - // 2) session name, channel = mychannel - fService.enableSyscalls(sessionName, channelName, new NullProgressMonitor()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testDynamicProbe() { - try { - // 1) session name, channel = null, 3 event names, kernel - String sessionName = "mysession2"; - String channelName = "mychannel"; - String eventName0 = "myevent0"; - String eventName1 = "myevent1"; - String functionProbe = "0xc0101340"; - String dynProbe = "init_post"; - - fShell.setScenario(SCEN_EVENT_HANDLING); - - // 1) session name, channel = null, event name, function probe, probe - fService.enableProbe(sessionName, null, eventName0, true, functionProbe, new NullProgressMonitor()); - - // 2) session name, channel = mychannel - fService.enableProbe(sessionName, channelName, eventName1, false, dynProbe, new NullProgressMonitor()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testEnableLogLevel() { - try { - // 1) session name, channel = null, 3 event names, kernel - String sessionName = "mysession2"; - String channelName = "mychannel"; - String eventName4 = "myevent4"; - String eventName5 = "myevent5"; - - fShell.setScenario(SCEN_EVENT_HANDLING); - - // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG - fService.enableLogLevel(sessionName, null, eventName4, LogLevelType.LOGLEVEL_ONLY, TraceLogLevel.TRACE_DEBUG, null, new NullProgressMonitor()); - - // 2) session name, channel = mychannel, null, loglevel, TRACE_DEBUG_FUNCTION - fService.enableLogLevel(sessionName, channelName, eventName5, LogLevelType.LOGLEVEL, TraceLogLevel.TRACE_DEBUG_FUNCTION, null, new NullProgressMonitor()); - - // TODO add test with filters - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testAddContext() { - try { - // 1) session name, channel = null, 3 event names, kernel - String sessionName = "mysession2"; - String channelName = "mychannel"; - String eventName = "ust_tests_hello:tptest_sighandler"; - List contexts = new ArrayList<>(); - contexts.add("prio"); - contexts.add("pid"); - - fShell.setScenario(SCEN_CONTEXT_HANDLING); - - List availContexts = fService.getContextList(new NullProgressMonitor()); - assertNotNull(availContexts); - assertEquals(12, availContexts.size()); - - // A very "hard-coded" way to verify but it works ... - Set expectedContexts = new HashSet<>(); - expectedContexts.add("pid"); - expectedContexts.add("procname"); - expectedContexts.add("prio"); - expectedContexts.add("nice"); - expectedContexts.add("vpid"); - expectedContexts.add("tid"); - expectedContexts.add("pthread_id"); - expectedContexts.add("vtid"); - expectedContexts.add("ppid"); - expectedContexts.add("vppid"); - expectedContexts.add("perf:cpu-cycles"); - expectedContexts.add("perf:cycles"); - - assertTrue(expectedContexts.containsAll(availContexts)); - - // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG - fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testAddContextFailure() { - - // 1) session name, channel = null, 3 event names, kernel - String sessionName = "mysession2"; - String channelName = "mychannel"; - String eventName = "ust_tests_hello:tptest_sighandler"; - List contexts = new ArrayList<>(); - contexts.add("prio"); - contexts.add("pid"); - fShell.setScenario(SCEN_CONTEXT_ERROR_HANDLING); - try { - fService.getContextList(new NullProgressMonitor()); - fail("No exeption generated"); - } catch (ExecutionException e) { - // success - } - try { - // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG - fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor()); - fail("No exeption generated"); - } catch (ExecutionException e) { - // success - } - } - - @Test - public void testCalibrate() { - try { - fShell.setScenario(SCEN_CALIBRATE_HANDLING); - fService.calibrate(true, new NullProgressMonitor()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testCalibrateFailure() { - try { - fShell.setScenario(SCEN_CALIBRATE_HANDLING); - fService.calibrate(false, new NullProgressMonitor()); - fail("No exeption generated"); - } catch (ExecutionException e) { - // success - } - } - - @Test - public void testCreateSession2_1() { - - try { - fShell.setScenario(SCEN_CREATE_SESSION_2_1); - - ISessionInfo sessionInfo = new SessionInfo("mysession"); - sessionInfo.setNetworkUrl("net://172.0.0.1"); - sessionInfo.setStreamedTrace(true); - ISessionInfo info = fService.createSession(sessionInfo, new NullProgressMonitor()); - assertNotNull(info); - assertEquals("mysession", info.getName()); - assertEquals("net://172.0.0.1", info.getSessionPath()); - assertTrue(info.isStreamedTrace()); - fService.destroySession("mysession", new NullProgressMonitor()); - - sessionInfo = new SessionInfo("mysession"); - sessionInfo.setStreamedTrace(true); - sessionInfo.setNetworkUrl("file:///tmp"); - info = fService.createSession(sessionInfo, new NullProgressMonitor()); - assertNotNull(info); - assertEquals("mysession", info.getName()); - assertEquals("file:///tmp", info.getSessionPath()); - assertTrue(!info.isStreamedTrace()); - fService.destroySession("mysession", new NullProgressMonitor()); - - sessionInfo = new SessionInfo("mysession"); - sessionInfo.setStreamedTrace(true); - sessionInfo.setNetworkUrl("file:///tmp"); - info = fService.createSession(sessionInfo, new NullProgressMonitor()); - assertNotNull(info); - assertEquals("mysession", info.getName()); - assertEquals("file:///tmp", info.getSessionPath()); - assertTrue(!info.isStreamedTrace()); - fService.destroySession("mysession", new NullProgressMonitor()); - - sessionInfo = new SessionInfo("mysession"); - sessionInfo.setStreamedTrace(true); - sessionInfo.setControlUrl("tcp://172.0.0.1"); - sessionInfo.setDataUrl("tcp://172.0.0.1:5343"); - info = fService.createSession(sessionInfo, new NullProgressMonitor()); - assertNotNull(info); - assertEquals("mysession", info.getName()); - assertEquals("", info.getSessionPath()); // the complete network path is not available at this point - assertTrue(info.isStreamedTrace()); - fService.destroySession("mysession", new NullProgressMonitor()); - - sessionInfo = new SessionInfo("mysession"); - sessionInfo.setStreamedTrace(true); - sessionInfo.setNetworkUrl("net://172.0.0.1:1234:2345"); - info = fService.createSession(sessionInfo, new NullProgressMonitor()); - assertNotNull(info); - assertEquals("mysession", info.getName()); - assertEquals("net://172.0.0.1:1234:2345", info.getSessionPath()); - assertTrue(info.isStreamedTrace()); - fService.destroySession("mysession", new NullProgressMonitor()); - - // verbose - enableVerbose(); - sessionInfo = new SessionInfo("mysession"); - sessionInfo.setStreamedTrace(true); - sessionInfo.setNetworkUrl("net://172.0.0.1"); - info = fService.createSession(sessionInfo, new NullProgressMonitor()); - assertNotNull(info); - assertEquals("mysession", info.getName()); - assertEquals("net://172.0.0.1", info.getSessionPath()); - assertTrue(info.isStreamedTrace()); - disableVerbose(); - fService.destroySession("mysession", new NullProgressMonitor()); - - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testCreateSessionVerbose2_1() { - try { - fShell.setScenario(SCEN_CREATE_SESSION_VERBOSE_2_1); - - enableVerbose(); - ISessionInfo sessionInfo = new SessionInfo("mysession"); - sessionInfo.setStreamedTrace(true); - sessionInfo.setNetworkUrl("net://172.0.0.1"); - ISessionInfo info = fService.createSession(sessionInfo, new NullProgressMonitor()); - assertNotNull(info); - assertEquals("mysession", info.getName()); - assertEquals("net://172.0.0.1", info.getSessionPath()); - assertTrue(info.isStreamedTrace()); - fService.destroySession("mysession", new NullProgressMonitor()); - } catch (ExecutionException e) { - fail(e.toString()); - } finally { - disableVerbose(); - } - } - - @Test - public void testCreateSnapshotSession() { - try { - fShell.setScenario(SCEN_CREATE_SNAPSHOT_SESSION); - ISessionInfo params = new SessionInfo("mysession"); - params.setSnapshot(true); - ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); - assertNotNull(sessionInfo); - assertEquals("mysession", sessionInfo.getName()); - assertTrue(sessionInfo.isSnapshotSession()); - assertEquals("", sessionInfo.getSessionPath()); - assertTrue(!sessionInfo.isStreamedTrace()); - - assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); - - String[] names = fService.getSessionNames(new NullProgressMonitor()); - assertEquals(names[0], "mysession"); - - ISnapshotInfo snapshotInfo = fService.getSnapshotInfo("mysession", new NullProgressMonitor()); - assertNotNull(snapshotInfo); - assertEquals("snapshot-1", snapshotInfo.getName()); - assertEquals("/home/user/lttng-traces/mysession-20130913-141651", snapshotInfo.getSnapshotPath()); - assertEquals(1, snapshotInfo.getId()); - assertTrue(!snapshotInfo.isStreamedSnapshot()); - - // we need to set the snapshotInfo to so that the session path is set correctly - sessionInfo.setSnapshotInfo(snapshotInfo); - assertEquals("/home/user/lttng-traces/mysession-20130913-141651", sessionInfo.getSessionPath()); - - fService.recordSnapshot("mysession", new NullProgressMonitor()); - - fService.destroySession("mysession", new NullProgressMonitor()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testCreateSnapshotSession2_5() { - try { - fShell.setScenario(SCEN_CREATE_SNAPSHOT_SESSION_2_5); - ISessionInfo params = new SessionInfo("mysession"); - params.setSnapshot(true); - ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); - assertNotNull(sessionInfo); - assertEquals("mysession", sessionInfo.getName()); - assertTrue(sessionInfo.isSnapshotSession()); - assertEquals("", sessionInfo.getSessionPath()); - assertTrue(!sessionInfo.isStreamedTrace()); - - assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); - - String[] names = fService.getSessionNames(new NullProgressMonitor()); - assertEquals(names[0], "mysession"); - - ISnapshotInfo snapshotInfo = fService.getSnapshotInfo("mysession", new NullProgressMonitor()); - assertNotNull(snapshotInfo); - assertEquals("snapshot-1", snapshotInfo.getName()); - assertEquals("/home/user/lttng-traces/mysession-20130913-141651", snapshotInfo.getSnapshotPath()); - assertEquals(1, snapshotInfo.getId()); - assertTrue(!snapshotInfo.isStreamedSnapshot()); - - // we need to set the snapshotInfo to so that the session path is set correctly - sessionInfo.setSnapshotInfo(snapshotInfo); - assertEquals("/home/user/lttng-traces/mysession-20130913-141651", sessionInfo.getSessionPath()); - - fService.recordSnapshot("mysession", new NullProgressMonitor()); - - fService.destroySession("mysession", new NullProgressMonitor()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - public void testCreateStreamedSnapshotSession() { - try { - fShell.setScenario(SCEN_CREATE_STREAMED_SNAPSHOT_SESSION); - - ISessionInfo params = new SessionInfo("mysession"); - params.setNetworkUrl("net://172.0.0.1"); - ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); - assertNotNull(sessionInfo); - assertEquals("mysession", sessionInfo.getName()); - assertTrue(sessionInfo.isSnapshotSession()); - - assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); - assertTrue(sessionInfo.isStreamedTrace()); - - String[] names = fService.getSessionNames(new NullProgressMonitor()); - assertEquals(names[0], "mysession"); - - ISnapshotInfo snapshotInfo = sessionInfo.getSnapshotInfo(); - assertNotNull(sessionInfo); - assertEquals("snapshot-2", snapshotInfo.getName()); - assertEquals("net4://172.0.0.1:5342/", snapshotInfo.getSnapshotPath()); - assertEquals(2, snapshotInfo.getId()); - assertTrue(snapshotInfo.isStreamedSnapshot()); - - // we need to set the snapshotInfo to so that the session path is set correctly - sessionInfo.setSnapshotInfo(snapshotInfo); - assertEquals("net4://172.0.0.1:5342/", sessionInfo.getSessionPath()); - - fService.recordSnapshot("mysession", new NullProgressMonitor()); - - fService.destroySession("mysession", new NullProgressMonitor()); - - } catch (ExecutionException e) { - fail(e.toString()); - } - } - - @Test - public void testCreateSnapshotSessionErrors() { - try { - fShell.setScenario(SCEN_CREATE_SNAPSHOT_SESSION_ERRORS); - - String[] names = fService.getSessionNames(new NullProgressMonitor()); - assertEquals(names[0], "mysession"); - } catch (ExecutionException e) { - fail(e.toString()); - } - - try { - fService.getSnapshotInfo("blabla", new NullProgressMonitor()); - fail("getSnapshoInfo() didn't fail"); - } catch (ExecutionException e) { - // successful - } - - try { - fService.recordSnapshot("blabla", new NullProgressMonitor()); - fail("getSnapshoInfo() didn't fail"); - } catch (ExecutionException e) { - // successful - } - - try { - fService.recordSnapshot("mysession", new NullProgressMonitor()); - fail("getSnapshoInfo() didn't fail"); - } catch (ExecutionException e) { - // successful - } - } - - @Test - public void testCreateLiveSession() throws ExecutionException { - fShell.setScenario(SCEN_CREATE_LIVE_SESSION); - - ISessionInfo params = new SessionInfo("mysession"); - params.setLive(true); - params.setStreamedTrace(true); - params.setNetworkUrl("net://127.0.0.1"); - ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); - assertNotNull(sessionInfo); - assertEquals("mysession", sessionInfo.getName()); - assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); - assertTrue(sessionInfo.isStreamedTrace()); - assertTrue(sessionInfo.isLive()); - assertEquals("net://127.0.0.1", sessionInfo.getSessionPath()); - String[] names = fService.getSessionNames(new NullProgressMonitor()); - assertEquals(names[0], "mysession"); - fService.destroySession("mysession", new NullProgressMonitor()); - } - - @Test - public void testCreateLiveSessionErrors() { - try { - fShell.setScenario(SCEN_CREATE_LIVE_SESSION_ERRORS); - - ISessionInfo parameters = new SessionInfo("mysession"); - parameters.setLive(true); - parameters.setSnapshot(true); - fService.createSession(parameters, new NullProgressMonitor()); - fail("createSession() didn't fail"); - } catch (ExecutionException e) { - // successful - } - - try { - ISessionInfo parameters = new SessionInfo("mysession"); - parameters.setNetworkUrl("blah"); - parameters.setLive(true); - fService.createSession(parameters, new NullProgressMonitor()); - fail("createSession() didn't fail"); - } catch (ExecutionException e) { - // successful - } - - try { - ISessionInfo parameters = new SessionInfo("mysession"); - parameters.setControlUrl("net://127.0.0.1"); - parameters.setLive(true); - fService.createSession(parameters, new NullProgressMonitor()); - fail("createSession() didn't fail"); - } catch (ExecutionException e) { - // successful - } - } - - private static void enableVerbose() { - // verbose - ControlCommandLogger.init(ControlPreferences.getInstance().getLogfilePath(), false); - ControlPreferences.getInstance().getPreferenceStore().setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, true); - ControlPreferences.getInstance().getPreferenceStore().setDefault(ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE); - } - - private static void disableVerbose() { - ControlPreferences.getInstance().getPreferenceStore().setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, false); - } - - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/AddContextDialogStub.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/AddContextDialogStub.java deleted file mode 100644 index 189964bc10..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/AddContextDialogStub.java +++ /dev/null @@ -1,63 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IAddContextDialog; - -/** - * Add Context dialog stub. - */ -@SuppressWarnings("javadoc") -public class AddContextDialogStub implements IAddContextDialog { - - private Set fAvailableContexts = null; - private List fContexts = null; - - @Override - public int open() { - return 0; - } - - @Override - public void setAvalibleContexts(List contexts) { - fAvailableContexts = new HashSet<>(); - fAvailableContexts.addAll(contexts); - } - - @Override - public List getContexts() { - List ret = new ArrayList<>(); - ret.addAll(fContexts); - return ret; - } - - public void setContexts(List contexts) throws IllegalArgumentException{ - fContexts = new ArrayList<>(); - fContexts.addAll(contexts); - // If availableContexts are null we cannot verify - if (fAvailableContexts != null) { - for (Iterator iterator = fContexts.iterator(); iterator.hasNext();) { - String string = iterator.next(); - if (!fAvailableContexts.contains(string)) { - throw new IllegalArgumentException(); - } - } - } - } -} - diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/CreateSessionDialogStub.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/CreateSessionDialogStub.java deleted file mode 100644 index a3f7be4abc..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/CreateSessionDialogStub.java +++ /dev/null @@ -1,101 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Marc-Andre Laperle - Support for creating a live session - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.ICreateSessionDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; - -/** - * Create session dialog stub implementation. - */ -@SuppressWarnings("javadoc") -public class CreateSessionDialogStub implements ICreateSessionDialog { - - public String fName = "mysession"; - public String fPath = null; - private boolean fIsStreamedTrace = false; - private String fNetworkUrl = null; - private String fControlUrl = null; - private String fDataUrl = null; - private boolean fIsSnapshot; - private boolean fIsLive = false; - private int fLiveDelay = 0; - - @Override - public void initialize(TraceSessionGroup group) { - } - - @Override - public int open() { - return 0; - } - - public void setSessionPath(String path) { - fPath = path; - } - - public void setSessionName(String name) { - fName = name; - } - - public void setStreamedTrace(boolean isStreamedTrace) { - fIsStreamedTrace = isStreamedTrace; - } - - public void setNetworkUrl(String fNetworkUrl) { - this.fNetworkUrl = fNetworkUrl; - } - - public void setControlUrl(String fControlUrl) { - this.fControlUrl = fControlUrl; - } - - public void setDataUrl(String fDataUrl) { - this.fDataUrl = fDataUrl; - } - - public void setSnapshot(boolean isSnapshot) { - fIsSnapshot = isSnapshot; - } - - public void setLive(boolean isLive) { - fIsLive = isLive; - } - - public void setLiveDelay(int liveDelay) { - fLiveDelay = liveDelay; - } - - @Override - public ISessionInfo getParameters() { - ISessionInfo sessionInfo = new SessionInfo(fName); - - if (fIsStreamedTrace) { - sessionInfo.setNetworkUrl(fNetworkUrl); - sessionInfo.setControlUrl(fControlUrl); - sessionInfo.setDataUrl(fDataUrl); - sessionInfo.setStreamedTrace(true); - } else if (fPath != null) { - sessionInfo.setSessionPath(fPath); - } - - sessionInfo.setLive(fIsLive); - sessionInfo.setLiveDelay(fLiveDelay); - sessionInfo.setSnapshot(fIsSnapshot); - - return sessionInfo; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/DestroyConfirmDialogStub.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/DestroyConfirmDialogStub.java deleted file mode 100644 index 88479e2354..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/DestroyConfirmDialogStub.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IConfirmDialog; -import org.eclipse.swt.widgets.Shell; - -/** - * A confirmation dialog stub implementation. - */ -public class DestroyConfirmDialogStub implements IConfirmDialog { - - @Override - public boolean openConfirm(Shell parent, String title, String message) { - return true; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableChannelDialogStub.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableChannelDialogStub.java deleted file mode 100644 index eb96367227..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableChannelDialogStub.java +++ /dev/null @@ -1,93 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IEnableChannelDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; - -/** - * Create channel dialog stub implementation. - */ -@SuppressWarnings("javadoc") -public class EnableChannelDialogStub implements IEnableChannelDialog { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - private TraceDomainComponent fDomain; - private ChannelInfo fChannelInfo; - private boolean fIsKernel; - - // ------------------------------------------------------------------------ - // Constructor - // ------------------------------------------------------------------------ - public EnableChannelDialogStub() { - fChannelInfo = new ChannelInfo("mychannel"); - fChannelInfo.setNumberOfSubBuffers(4); - fChannelInfo.setOverwriteMode(true); - fChannelInfo.setReadTimer(200); - fChannelInfo.setSwitchTimer(100); - fChannelInfo.setSubBufferSize(16384); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - public void setIsKernel(boolean isKernel) { - fIsKernel = isKernel; - } - - @Override - public IChannelInfo getChannelInfo() { - return fChannelInfo; - } - - @Override - public void setDomainComponent(TraceDomainComponent domain) { - fDomain = domain; - if (fDomain != null) { - fIsKernel = fDomain.isKernel(); - } - } - - @Override - public int open() { - return 0; - } - - @Override - public boolean isKernel() { - return fIsKernel; - } - - @Override - public void setHasKernel(boolean hasKernel) { - // Do nothing - } - - public void setChannelInfo(ChannelInfo info) { - fChannelInfo = info; - } - - @Override - public void setTargetNodeComponent(TargetNodeComponent node) { - // Do nothing - } - - public void setBufferType (BufferType bufferType) { - fChannelInfo.setBufferType(bufferType); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java deleted file mode 100644 index b8be180e9e..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java +++ /dev/null @@ -1,234 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IEnableEventsDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; - -/** - * Enable events dialog stub implementation. - */ -@SuppressWarnings("javadoc") -public class EnableEventsDialogStub implements IEnableEventsDialog { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - private boolean fIsKernel; - private boolean fIsTracePoints; - private boolean fIsAllTracePoints; - private boolean fIsSysCalls; - private boolean fIsDynamicProbe; - private String fProbeEventName; - private String fDynamicProbe; - private boolean fIsFunctionProbe; - private String fFunctionEventName; - private String fFunctionProbe; - private boolean fIsWildcard; - private String fWildcard; - private boolean fIsLogLevel; - private String fLogLevelEventName; - private TraceLogLevel fLogLevel; - private LogLevelType fLogLevelType; - private String fFilter; - private List fNames = new ArrayList<>(); - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - public void setIsKernel(boolean isKernel) { - fIsKernel = isKernel; - } - - public void setIsTracePoints(boolean isTracePoints) { - fIsTracePoints = isTracePoints; - } - - public void setIsAllTracePoints(boolean isAllTracePoints) { - fIsAllTracePoints = isAllTracePoints; - } - - public void setIsSysCalls(boolean isSysCalls) { - this.fIsSysCalls = isSysCalls; - } - - public void setIsDynamicProbe(boolean isDynamicProbe) { - fIsDynamicProbe = isDynamicProbe; - } - - public void setProbeEventName(String probeEventName) { - fProbeEventName = probeEventName; - } - - public void setDynamicProbe(String dynamicProbe) { - fDynamicProbe = dynamicProbe; - } - - public void setIsFunctionProbe(boolean isFunctionProbe) { - fIsFunctionProbe = isFunctionProbe; - } - - public void setFunctionEventName(String functionEventName) { - fFunctionEventName = functionEventName; - } - - public void setFunctionProbe(String functionProbe) { - fFunctionProbe = functionProbe; - } - - public void setIsWildcard(boolean isWildcard) { - fIsWildcard = isWildcard; - } - - public void setWildcard(String wildcard) { - fWildcard = wildcard; - } - - public void setIsLogLevel(boolean isLogLevel) { - fIsLogLevel = isLogLevel; - } - - public void setLogLevelEventName(String logLevelEventName) { - fLogLevelEventName = logLevelEventName; - } - - public void setLogLevel(TraceLogLevel logLevel) { - fLogLevel = logLevel; - } - - public void setLogLevelType(LogLevelType logLevelType) { - fLogLevelType = logLevelType; - } - - public void setNames(List names) { - fNames = names; - } - - public void setFilterExpression(String filter) { - fFilter = filter; - } - - @Override - public boolean isTracepoints() { - return fIsTracePoints; - } - - @Override - public boolean isAllTracePoints() { - return fIsAllTracePoints; - } - - @Override - public boolean isSysCalls() { - return fIsSysCalls; - } - - @Override - public boolean isAllSysCalls() { - return fIsSysCalls; - } - - @Override - public List getEventNames() { - return fNames; - } - - @Override - public boolean isDynamicProbe() { - return fIsDynamicProbe; - } - - @Override - public String getProbeEventName() { - return fProbeEventName; - } - - @Override - public String getProbeName() { - return fDynamicProbe; - } - - @Override - public boolean isDynamicFunctionProbe() { - return fIsFunctionProbe; - } - - @Override - public String getFunctionEventName() { - return fFunctionEventName; - } - - @Override - public String getFunction() { - return fFunctionProbe; - } - - @Override - public boolean isWildcard() { - return fIsWildcard; - } - - @Override - public String getWildcard() { - return fWildcard; - } - - @Override - public boolean isLogLevel() { - return fIsLogLevel; - } - - @Override - public LogLevelType getLogLevelType() { - return fLogLevelType; - } - - @Override - public TraceLogLevel getLogLevel() { - return fLogLevel; - } - - @Override - public String getLogLevelEventName() { - return fLogLevelEventName; - } - - @Override - public boolean isKernel() { - return fIsKernel; - } - - @Override - public void setTraceProviderGroup(TraceProviderGroup providerGroup) { - } - - @Override - public void setTraceDomainComponent(TraceDomainComponent domain) { - } - - @Override - public int open() { - return 0; - } - - @Override - public String getFilterExpression() { - return fFilter; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/GetEventInfoDialogStub.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/GetEventInfoDialogStub.java deleted file mode 100644 index 51940fb4f8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/GetEventInfoDialogStub.java +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; - -import java.util.Arrays; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IGetEventInfoDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; - -/** - * Get event information dialog stub implementation. - */ -public class GetEventInfoDialogStub implements IGetEventInfoDialog { - - private TraceSessionComponent[] fSessions; - private String fFilterExpression; - - @Override - public TraceSessionComponent getSession() { - return fSessions[0]; - } - - @Override - public TraceChannelComponent getChannel() { - return null; - } - - @Override - public void setIsKernel(boolean isKernel) { - } - - @Override - public void setSessions(TraceSessionComponent[] sessions) { - if (sessions != null) { - fSessions = Arrays.copyOf(sessions, sessions.length); - return; - } - fSessions = null; - } - - @Override - public String getFilterExpression() { - return fFilterExpression; - } - - @Override - public int open() { - return 0; - } - - /** - * @param filter the filter to set - */ - public void setFilterExpression(String filter) { - fFilterExpression = filter; - } -} - diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/CommandShellFactory.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/CommandShellFactory.java deleted file mode 100644 index f7dc1bdb7f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/CommandShellFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.stubs.service; - -import org.eclipse.linuxtools.internal.lttng2.control.stubs.shells.LTTngToolsFileShell; - -@SuppressWarnings("javadoc") -public class CommandShellFactory { - - public static final int GET_SESSION_NAMES_COMMAND_SHELL = 0; - - private static CommandShellFactory fInstance = null; - - public static CommandShellFactory getInstance() { - if (fInstance == null) { - fInstance = new CommandShellFactory(); - } - return fInstance; - } - -// public ICommandShell getRealShell() { -// ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); -// IHost host = registry.getLocalHost(); -// RemoteSystemProxy proxy = new RemoteSystemProxy(host); -// ICommandShell shell = new LTTngToolsSimulatorShell(proxy); -// return shell; -// } - - public LTTngToolsFileShell getFileShell() { - return new LTTngToolsFileShell(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java deleted file mode 100644 index 19de1fcd39..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java +++ /dev/null @@ -1,118 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.stubs.service; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.Status; -import org.eclipse.linuxtools.internal.lttng2.control.stubs.shells.LTTngToolsFileShell; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; -import org.eclipse.rse.core.model.IRSECallback; -import org.eclipse.rse.core.subsystems.ICommunicationsListener; -import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.services.shells.IShellService; -import org.eclipse.rse.services.terminals.ITerminalService; -import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; - -@SuppressWarnings("javadoc") -public class TestRemoteSystemProxy implements IRemoteSystemProxy { - - private LTTngToolsFileShell fShell = null; - private String fTestFile = null; - private String fScenario = null; - - @Override - public IShellService getShellService() { - return null; - } - - @Override - public ITerminalService getTerminalService() { - return null; - } - - @Override - public ISubSystem getShellServiceSubSystem() { - return null; - } - - @Override - public ISubSystem getTerminalServiceSubSystem() { - return null; - } - @Override - public IFileServiceSubSystem getFileServiceSubSystem() { - return null; - } - - @Override - public void connect(IRSECallback callback) throws ExecutionException { -// System.out.println("in done: proxy connect "); - if (callback != null) { - callback.done(Status.OK_STATUS, null); - } - } - - @Override - public void disconnect() throws ExecutionException { - fShell = null; - } - - @Override - public ICommandShell createCommandShell() throws ExecutionException { - if (fShell == null) { - fShell = CommandShellFactory.getInstance().getFileShell(); - if ((fTestFile != null) && (fScenario != null)) { - try { - fShell.loadScenarioFile(fTestFile); - } catch (Exception e) { - throw new ExecutionException(e.toString()); - } - fShell.setScenario(fScenario); - } - } - return fShell; - } - - @Override - public void addCommunicationListener(ICommunicationsListener listener) { - } - - @Override - public void removeCommunicationListener(ICommunicationsListener listener) { - } - - public void setTestFile(String testFile) { - fTestFile = testFile; - } - - public void setScenario(String scenario) { - fScenario = scenario; - if (fShell != null) { - fShell.setScenario(fScenario); - } - } - - @Override - public int getPort() { - return IRemoteSystemProxy.INVALID_PORT_NUMBER; - } - - @Override - public void setPort(int port) { - } - - @Override - public boolean isLocal() { - return false; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java deleted file mode 100644 index 3f262b6c04..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java +++ /dev/null @@ -1,279 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.stubs.shells; - -import java.io.BufferedReader; -import java.io.DataInputStream; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.CommandResult; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult; - -@SuppressWarnings("javadoc") -public class LTTngToolsFileShell extends TestCommandShell { - - // ------------------------------------------------------------------------ - // CONSTANTS - // ------------------------------------------------------------------------ - private final static String SCENARIO_KEY = ""; - private final static String SCENARIO_END_KEY = ""; - private final static String INPUT_KEY = ""; - private final static String INPUT_END_KEY = ""; - private final static String RESULT_KEY = ""; - private final static String OUTPUT_KEY = ""; - private final static String OUTPUT_END_KEY = ""; - private final static String ERROR_OUTPUT_KEY = ""; - private final static String ERROR_OUTPUT_END_KEY = ""; - private final static String COMMENT_KEY = "#.*"; - - private final static Pattern LTTNG_LIST_SESSION_PATTERN = Pattern.compile("lttng\\s+list\\s+(.+)"); - private final static String LTTNG_LIST_PROVIDER_PATTERN = "lttng\\s+list\\s+(-u|-k)"; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - private String fScenariofile; - private String fScenario; - - private final Map> fScenarioMap = new HashMap<>(); - private final Map fSessionNameMap = new HashMap<>(); - - /** - * Parse a scenario file with the format: - *
-     * <SCENARIO>
-     * ScenarioName
-     *
-     * <COMMAND_INPUT>
-     * Command
-     * </COMAND_INPUT>
-     *
-     * <COMMAND_RESULT>
-     * CommandResult
-     * </COMMAND_RESULT>
-     *
-     * <COMMAND_OUTPUT>
-     * CommandOutput
-     * <COMMAND_ERROR_OUTPUT>
-     * CommandErrorOutput
-     * </COMMAND_ERROR_OUTPUT>
-     * </COMMAND_OUTPUT>
-     *
-     * </SCENARIO>
-     *
-     * Where: ScenarioName - is the scenario name
-     *        Command - the command line string
-     *        CommandResult - the result integer of the command (0 for success, 1 for failure)
-     *        ComandOutput - the command output string (multi-line possible)
-     *        ComandErrorOutput - the command error output string (multi-line possible)
-     *
-     * Note: 1) There can be many scenarios per file
-     *       2) There can be many (Command-CommandResult-CommandOutput) triples per scenario
-     *       3) Lines starting with # will be ignored (comments)
-     * 
-     * @param scenariofile - path to scenario file
-     * @throws Exception
-     */
-    public synchronized void loadScenarioFile(String scenariofile) throws Exception {
-        fScenariofile = scenariofile;
-
-        // clean up map
-        Collection> values = fScenarioMap.values();
-        for (Iterator> iterator = values.iterator(); iterator.hasNext();) {
-            Map map = iterator.next();
-            map.clear();
-        }
-        fScenarioMap.clear();
-
-        // load from file
-
-        // Open the file
-        try (FileInputStream fstream = new FileInputStream(fScenariofile);
-                DataInputStream in = new DataInputStream(fstream);
-                BufferedReader br = new BufferedReader(new InputStreamReader(in));) {
-            String strLine;
-
-            // Read File Line by Line
-
-            // Temporary map for generating instance numbers for lttng list
-            //  commands.
-            // The numbers are per scenario.
-            Map tmpSessionNameMap = new HashMap<>();
-            while ((strLine = br.readLine()) != null) {
-
-                // Ignore comments
-                if (isComment(strLine)) {
-                    continue;
-                }
-
-                if (SCENARIO_KEY.equals(strLine)) {
-                    // scenario start
-
-                    // Ignore comments
-                    strLine = br.readLine();
-                    while (isComment(strLine)) {
-                        strLine = br.readLine();
-                    }
-
-                    String scenario = strLine;
-                    Map commandMap = new HashMap<>();
-                    fScenarioMap.put(scenario, commandMap);
-                    List output = null;
-                    List errorOutput = null;
-                    String input = null;
-                    boolean inOutput = false;
-                    boolean inErrorOutput = false;
-                    int result = 0;
-                    tmpSessionNameMap.clear();
-                    while ((strLine = br.readLine()) != null) {
-                        // Ignore comments
-                        if (isComment(strLine)) {
-                            continue;
-                        }
-
-                        if (SCENARIO_END_KEY.equals(strLine)) {
-                            // Scenario is finished
-                            break;
-                        }
-                        if (INPUT_KEY.equals(strLine)) {
-                            strLine = br.readLine();
-                            // Ignore comments
-                            while (isComment(strLine)) {
-                                strLine = br.readLine();
-                            }
-                            // Read command
-                            input = strLine;
-
-                            // Handle instances of 'lttng list
-                            // ();
-                            errorOutput = new ArrayList<>();
-                        } else if (RESULT_KEY.equals(strLine)) {
-                            strLine = br.readLine();
-                            // Ignore comments
-                            while (isComment(strLine)) {
-                                strLine = br.readLine();
-                            }
-                            // Save result value
-                            result = Integer.parseInt(strLine);
-                        } else if (OUTPUT_END_KEY.equals(strLine)) {
-                            // Save output/result in command map
-                            if (output != null && errorOutput != null) {
-                                commandMap.put(input, new CommandResult(result, output.toArray(new String[output.size()]), errorOutput.toArray(new String[errorOutput.size()])));
-                            }
-                            inOutput = false;
-                        } else if (OUTPUT_KEY.equals(strLine)) {
-                            // first line of output
-                            inOutput = true;
-                        } else if (ERROR_OUTPUT_KEY.equals(strLine)) {
-                            // first line of output
-                            inErrorOutput = true;
-                        } else if (ERROR_OUTPUT_END_KEY.equals(strLine)) {
-                            inErrorOutput = false;
-                        } else if (inOutput) {
-                            while (isComment(strLine)) {
-                                strLine = br.readLine();
-                            }
-                            // lines of output/error output
-                            if (errorOutput != null && inErrorOutput) {
-                                errorOutput.add(strLine);
-                            } else if (output != null) {
-                                output.add(strLine);
-                            }
-                        }
-                        // else {
-                        // if (RESULT_END_KEY.equals(strLine)) {
-                        // nothing to do
-                        // }
-                    }
-                }
-            }
-        }
-    }
-
-    // Set the scenario to consider in executeCommand()
-    public synchronized void setScenario(String scenario) {
-        fScenario = scenario;
-        fSessionNameMap.clear();
-        if (!fScenarioMap.containsKey(fScenario)) {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    @Override
-   public synchronized ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException {
-        Map commands = fScenarioMap.get(fScenario);
-        String fullCommand = command;
-
-        Matcher matcher = LTTNG_LIST_SESSION_PATTERN.matcher(command);
-        if (matcher.matches() && !command.matches(LTTNG_LIST_PROVIDER_PATTERN)) {
-            String sessionName = matcher.group(1).trim();
-            Integer i = fSessionNameMap.get(sessionName);
-            if (i != null) {
-                i++;
-            } else {
-                i = 0;
-            }
-            fSessionNameMap.put(sessionName, i);
-            fullCommand += String.valueOf(i);
-        }
-
-        if (commands.containsKey(fullCommand)) {
-            return commands.get(fullCommand);
-        }
-
-        String[] output = new String[1];
-        output[0] = String.valueOf("Command not found");
-        CommandResult result = new CommandResult(0, null, null);
-        // For verification of setters of class CommandResult
-        result.setOutput(output);
-        result.setErrorOutput(output);
-        result.setResult(1);
-        return result;
-   }
-
-    // ------------------------------------------------------------------------
-    // Helper methods
-    // ------------------------------------------------------------------------
-
-    private static boolean isComment(String line) {
-        if (line == null) {
-            throw new RuntimeException("line is null");
-        }
-        return line.matches(COMMENT_KEY);
-    }
-}
diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java b/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java
deleted file mode 100644
index 998e72eb30..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2012 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:
- *   Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.control.stubs.shells;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.CommandResult;
-import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult;
-import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell;
-
-/**
- * Command shell stub
- */
-public class TestCommandShell implements ICommandShell {
-
-    /** If the shell is connected */
-    protected boolean fIsConnected = false;
-
-    @Override
-    public void connect() throws ExecutionException {
-        fIsConnected = true;
-    }
-
-    @Override
-    public void disconnect() {
-        fIsConnected = false;
-    }
-
-    @Override
-    public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException {
-        return executeCommand(command, monitor, true);
-    }
-
-    @Override
-    public ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException {
-        if (fIsConnected) {
-
-        }
-        return new CommandResult(0, new String[0], new String[0]);
-    }
-}
diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg b/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg
deleted file mode 100644
index 9b06e93148..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg
+++ /dev/null
@@ -1,228 +0,0 @@
-####################################################################
-# Copyright (c) 2012 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: 
-#    Bernd Hufmann - Initial API and implementation
-####################################################################
-####################################################################
-# Scenario: Initialize
-####################################################################
-
-Initialize
-
-lttng version 
-
-
-0
-
-
-lttng version 2.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-lttng list 
-
-
-0
-
-
-Currently no available tracing session
-
-
-
-lttng list -k
-
-
-0
-
-
-Kernel events
--------------
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-
-
-
-
-lttng list -u
-
-
-0
-
-
-UST events:
--------------
-
-PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  with LTTng 2.1 options  
-####################################################################
-##################################################################
-
-CreateSessionFileProto
-
-lttng create mysession -U file:///tmp
-
-
-0
-
-
-Session mysession created.
-Traces will be written in file:///tmp
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: file:///tmp
-
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-##################################################################
-
-CreateSessionControlData
-
-lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
-
-
-0
-
-
-Session mysession created.
-Control URL tcp://172.0.0.1 set for session mysession
-Data URL tcp://172.0.0.1:5343 set for session mysession
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: tcp://172.0.0.1:5342 [data: 5343]
-
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-##################################################################
-
-CreateSessionNetwork
-
-lttng create mysession -U net://172.0.0.1:1234:2345
-
-
-0
-
-
-Session mysession created.
-Traces will be written in net://172.0.0.1:1234:2345
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: net://172.0.0.1:1234 [data: 2345]
-
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession2 destroyed.
-
-
-
-
-##################################################################
-
-CreateSessionNetwork2
-
-lttng create mysession -U net6://[ffff::eeee:dddd:cccc:0]
-
-
-0
-
-
-Session mysession created.
-Traces will be written in net6://[ffff::eeee:dddd:cccc:0]
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path:  net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]
-
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession2 destroyed.
-
-
-
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg b/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg
deleted file mode 100644
index 808a51f369..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg
+++ /dev/null
@@ -1,158 +0,0 @@
-####################################################################
-# Copyright (c) 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: 
-#    Bernd Hufmann - Initial API and implementation
-####################################################################
-####################################################################
-# Scenario: Initialize
-####################################################################
-
-Initialize
-
-lttng version 
-
-
-0
-
-
-lttng version 2.3.0 - Dominus Vobiscum
-
-A very succulent line-up of beers brewed at Microbrasserie Charlevoix. Elaborated starting from special malts and fermented with a Belgian yeast. These beers are refermented in bottle and will make you discover the richness of wheat, amber and triple styles.
-
-Web site: http://lttng.org
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-lttng list 
-
-
-0
-
-
-Currently no available tracing session
-
-
-
-lttng list -k
-
-
-0
-
-
-Kernel events
--------------
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-
-
-
-
-lttng list -u -f 
-
-
-0
-
-
-UST events:
--------------
-
-PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --snapshot" LTTng 2.3
-####################################################################
-
-ScenCreateSession
-
-lttng create mysession --snapshot 
-
-
-0
-
-
-Session mysession created.
-Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
-Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
-
-#------------------------------------------------------------------------------
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive snapshot]
-    Trace path: 
-
-
-#------------------------------------------------------------------------------
-
-lttng snapshot list-output  -s mysession
-
-
-0
-
-
-Snapshot output list for session mysession
-    [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
-
-#------------------------------------------------------------------------------
-
-lttng start mysession
-
-
-0
-
-
-Tracing started for session mysession.
-
-#------------------------------------------------------------------------------
-
-lttng snapshot record  -s mysession
-
-
-0
-
-
-    Snapshot recorded successfully for session mysession
-
-#------------------------------------------------------------------------------
-
-lttng stop mysession
-
-
-0
-
-
-Tracing stopped for session mysession.
-
-#------------------------------------------------------------------------------
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg b/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg
deleted file mode 100644
index b841a5c8b1..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg
+++ /dev/null
@@ -1,528 +0,0 @@
-####################################################################
-# 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:
-#    Jonathan Rajotte - Initial API and implementation
-####################################################################
-####################################################################
-# Scenario: Initialize
-####################################################################
-
-Initialize
-
-lttng --mi xml version 
-
-
-0
-
-
-
-
-  version
-  
-    
-      2.6.0
-      2
-      6
-      
-      0
-      TestMI
-      Lorem ipsum
-      http://lttng.org
-      lttng is free software and under the GPL license and part LGPL
-    
-  
-
-
-
-
-lttng --mi xml list 
-
-
-0
-
-
-
-
-  list
-  
-    
-  
-
-
-
-
-lttng --mi xml list -k
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        KERNEL
-        PER_PID
-        
-          
-            sched_kthread_stop
-            TRACEPOINT
-            true
-            false
-            TRACE_EMERG
-            ALL
-            false
-          
-          
-            sched_kthread_stop_ret
-            TRACEPOINT
-            true
-            false
-            TRACE_EMERG
-            ALL
-            false
-          
-          
-            sched_wakeup_new
-            TRACEPOINT
-            true
-            false
-            TRACE_EMERG
-            ALL
-            false
-          
-        
-      
-    
-  
-
-
-
-
-lttng --mi xml list -u -f 
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        UST
-        PER_PID
-        
-          
-            9379
-            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-            
-              
-                ust_tests_hello:tptest_sighandler
-                TRACEPOINT
-                true
-                false
-                TRACE_DEBUG_MODULE
-                ALL
-                false
-                
-              
-              
-                ust_tests_hello:tptest
-                TRACEPOINT
-                true
-                false
-                TRACE_INFO
-                ALL
-                false
-                
-                  
-                    doublefield
-                    FLOAT
-                    0
-                  
-                  
-                    floatfield
-                    FLOAT
-                    0
-                  
-                  
-                    stringfield
-                    STRING
-                    0
-                  
-                
-              
-            
-          
-          
-            4852
-            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-            
-              
-                ust_tests_hello:tptest_sighandler
-                TRACEPOINT
-                true
-                false
-                TRACE_WARNING
-                ALL
-                false
-                
-              
-              
-                ust_tests_hello:tptest
-                TRACEPOINT
-                true
-                false
-                TRACE_DEBUG_FUNCTION
-                ALL
-                false
-                
-                  
-                    doublefield
-                    FLOAT
-                    0
-                  
-                  
-                    floatfield
-                    FLOAT
-                    0
-                  
-                  
-                    stringfield
-                    STRING
-                    0
-                  
-                
-              
-            
-          
-        
-      
-    
-  
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  with LTTng 2.1 options  
-####################################################################
-##################################################################
-
-CreateSessionFileProto
-
-lttng --mi xml create mysession -U file:///tmp
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      /tmp
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml list mysession
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession
-        /tmp
-        false
-        0
-        0
-        
-      
-    
-  
-
-
-
-
-lttng --mi xml destroy mysession
-
-
-0
-
-
-
-
-  destroy
-  
-    
-      
-        mysession
-        /tmp
-        false
-        0
-        0
-      
-    
-  
-  true
-
-
-
-
-##################################################################
-
-CreateSessionControlData
-
-lttng --mi xml create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      tcp4://172.0.0.1:5342/ [data: 5343]
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml list mysession
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession
-        tcp4://172.0.0.1:5342/ [data: 5343]
-        false
-        0
-        0
-        
-      
-    
-  
-
-
-
-
-lttng --mi xml destroy mysession
-
-
-0
-
-
-
-
-  destroy
-  
-    
-      
-        mysession
-        tcp4://172.0.0.1:5342/ [data: 5343]
-        false
-        0
-        0
-      
-    
-  
-  true
-
-
-
-
-##################################################################
-
-CreateSessionNetwork
-
-lttng --mi xml create mysession -U net://172.0.0.1:1234:2345
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml list mysession
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession
-        tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]
-        false
-        0
-        0
-        
-      
-    
-  
-
-
-
-
-lttng --mi xml destroy mysession
-
-
-0
-
-
-
-
-  destroy
-  
-    
-      
-        mysession
-        tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]
-        false
-        0
-        0
-      
-    
-  
-  true
-
-
-
-
-
-##################################################################
-
-CreateSessionNetwork2
-
-lttng --mi xml create mysession -U net6://[ffff::eeee:dddd:cccc:0]
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml list mysession
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession
-        tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]
-        false
-        0
-        0
-        
-      
-    
-  
-
-
-
-
-lttng --mi xml destroy mysession
-
-
-0
-
-
-
-
-  destroy
-  
-    
-      
-        mysession
-        tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]
-        false
-        0
-        0
-      
-    
-  
-  true
-
-
-
-
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg b/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg
deleted file mode 100644
index f3cc92d8f0..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg
+++ /dev/null
@@ -1,2676 +0,0 @@
-####################################################################
-# Copyright (c) 2012, 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: 
-#    Bernd Hufmann - Initial API and implementation
-####################################################################
-####################################################################
-# Scenario: Initialize
-####################################################################
-
-Initialize
-
-lttng version 
-
-
-0
-
-
-lttng version 2.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-lttng list 
-
-
-0
-
-
-Currently no available tracing session
-
-
-
-lttng list -k
-
-
-0
-
-
-Kernel events
--------------
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-
-
-
-
-lttng list -u
-
-
-0
-
-
-UST events:
--------------
-
-PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-
-
-
-####################################################################
-# Scenario: Create and destroy session
-####################################################################
-
-SessionHandling
-
-
-lttng create mysession
-
-
-0
-
-
-Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20120314-132824
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-lttng start mysession
-
-
-0
-
-
-Tracing started for session mysession.
-
-
-
-lttng stop mysession
-
-
-0
-
-
-Tracing stopped for session mysession.
-
-
-
-
-####################################################################
-# Scenario: Create and destroy session
-####################################################################
-
-SessionHandlingWithPath
-
-
-lttng create mysession -o /home/user/temp
-
-
-0
-
-
-Session mysession created.
-Traces will be written in /home/user/temp
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/temp
-
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-
-
-####################################################################
-# Scenario: Enable events from kernel provider events
-####################################################################
-
-Scenario1
-
-
-
-lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k  -s mysession --tracepoint 
-
-
-0
-
-
-kernel event sched_kthread_stop created in channel channel0
-kernel sched_kthread_stop_ret created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng disable-event sched_kthread_stop_ret,sched_kthread_stop -k  -s mysession -c channel0
-
-
-0
-
-
-kernel event sched_kthread_stop_ret disabled in channel channel0
-kernel event sched_kthread_stop disabled in channel channel0
-
-
-
-lttng enable-event sched_kthread_stop -k  -s mysession -c channel0 --tracepoint 
-
-
-0
-
-
-kernel event sched_kthread_stop enabled in channel channel0
-
-
-
-
-####################################################################
-# Scenario: Enable events from UST provider events
-####################################################################
-
-Scenario2
-
-
-lttng enable-channel mychannel -u  -s mysession --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
-
-
-0
-
-
-UST channel mychannel enabled for session mysession
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/temp
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 16384
-      number of subbufers: 2
-      switch timer interval: 200
-      read timer interval: 100
-      output: mmap()
-
-    Events:
-      None
-
-
-
-
-lttng enable-event ust_tests_hello:tptest_sighandler,ust_tests_hello:tptest -u  -s mysession --tracepoint 
-
-
-0
-
-
-UST event ust_tests_hello:tptest_sighandler in channel channel0
-UST sched_ust_tests_hello:tptest created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/temp
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 16384
-      number of subbufers: 2
-      switch timer interval: 200
-      read timer interval: 100
-      output: mmap()
-
-    Events:
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-      ust_tests_hello:tptest (type: tracepoint) [enabled]
-
-
-
-
-lttng disable-event ust_tests_hello:tptest -u  -s mysession -c mychannel
-
-
-0
-
-
-kernel event ust_tests_hello:tptest in channel mychannel
-
-
-
-lttng enable-event ust_tests_hello:tptest -u  -s mysession -c mychannel --tracepoint 
-
-
-0
-
-
-kernel event ust_tests_hello:tptest enabled in channel mychannel
-
-
-
-
-
-Scenario3
-
-
-lttng enable-channel mychannel -k  -s mysession --overwrite  --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
-
-
-0
-
-
-Kernel channel mychannel enabled for session mysession
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      None
-
-
-
-
-lttng enable-channel mychannel2 -k  -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
-
-
-0
-
-
-Kernel channel mychannel2 enabled for session mysession
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      None
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      None
-
-
-
-
-
-lttng disable-channel mychannel,mychannel2 -k  -s mysession
-
-
-0
-
-
-Kernel channel mychannel disabled for session mysession
-Kernel channel mychannel2 disabled for session mysession
-
-
-
-lttng enable-channel mychannel,mychannel2 -k  -s mysession
-
-
-0
-
-
-Kernel channel mychannel enabled for session mysession
-Kernel channel mychannel2 enabled for session mysession
-
-
-
-lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k  -s mysession --tracepoint 
-
-
-0
-
-
-kernel event sched_kthread_stop created in channel channel0
-kernel sched_kthread_stop_ret created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      None
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      None
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event sched_wakeup_new -k  -s mysession --tracepoint 
-
-
-0
-
-
-kernel event sched_wakeup_new created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      None
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      None
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event  -a  -k  -s mysession -c mychannel2 --tracepoint 
-
-
-0
-
-
-All kernel event sched_kthread_stop created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      None
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event  -a  -k  -s mysession -c mychannel --syscall 
-
-
-0
-
-
-All kernel system calls are enabled in channel mychannel
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event  -a  -k  -s mysession --syscall 
-
-
-0
-
-
-All kernel system calls are enabled in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event  -a  -k  -s mysession --syscall 
-
-
-0
-
-
-All kernel system calls are enabled in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event myevent1 -k  -s mysession --probe 0xc0101280
-
-
-0
-
-
-kernel event myevent1 created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]        
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event myevent2 -k  -s mysession -c channel0 --probe init_post
-
-
-0
-
-
-kernel event myevent2 created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent2 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event myevent3 -k  -s mysession --probe init_post:0x1000
-
-
-0
-
-
-kernel event myevent2 created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent3 (type: probe) [enabled]
-        offset: 0x1000
-        symbol: init_post
-      myevent2 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event myevent4 -k  -s mysession --function create_dev
-
-
-0
-
-
-kernel event myevent4 created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent4 (type: function) [enabled]
-        offset: 0x0
-        symbol: create_dev
-      myevent3 (type: probe) [enabled]
-        offset: 0x1000
-        symbol: init_post
-      myevent2 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event myevent5 -k  -s mysession --function create_dev:0x2000
-
-
-0
-
-
-kernel event myevent5 created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent5 (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev
-      myevent4 (type: function) [enabled]
-        offset: 0x0
-        symbol: create_dev
-      myevent3 (type: probe) [enabled]
-        offset: 0x1000
-        symbol: init_post
-      myevent2 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event myevent -k  -s mysession -c mychannel --function create_dev:0x2000
-
-
-0
-
-
-kernel event myevent created in channel mychannel
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev    
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent5 (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev
-      myevent4 (type: function) [enabled]
-        offset: 0x0
-        symbol: create_dev
-      myevent3 (type: probe) [enabled]
-        offset: 0x1000
-        symbol: init_post
-      myevent2 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng list 
-
-
-0
-
-
-Available tracing sessions:
-  1) mysession (/home/eedbhu/lttng-traces/mysession-20120321-115617) [inactive]
-
-Use lttng list  for more details
-
-
-
-lttng list -k
-
-
-0
-
-
-Kernel events
--------------
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-
-
-
-
-lttng list -u
-
-
-0
-
-
-UST events:
--------------
-
-PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev    
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent5 (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev
-      myevent4 (type: function) [enabled]
-        offset: 0x0
-        symbol: create_dev
-      myevent3 (type: probe) [enabled]
-        offset: 0x1000
-        symbol: init_post
-      myevent2 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng add-context  -h 
-
-
-0
-
-
-usage: lttng add-context -t TYPE
-
-If no channel and no event is given (-c/-e), the context
-will be added to all events and all channels.
-Otherwise the context will be added only to the channel (-c)
-and/or event (-e) indicated.
-Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
-
-Options:
-  -h, --help               Show this help
-      --list-options       Simple listing of options
-  -s, --session NAME       Apply to session name
-  -c, --channel NAME       Apply to channel
-  -e, --event NAME         Apply to event
-  -k, --kernel             Apply to the kernel tracer
-  -u, --userspace          Apply to the user-space tracer
-  -t, --type TYPE          Context type. You can repeat that option on
-                           the command line to specify multiple contexts at once.
-                           (--kernel preempts --userspace)
-                           TYPE can be one of the strings below:
-                               pid, procname, prio, nice, vpid, tid, pthread_id,
-                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles,
-                               perf:stalled-cycles-frontend,
-                               perf:idle-cycles-frontend,
-                               perf:stalled-cycles-backend,
-                               perf:idle-cycles-backend, perf:instructions,
-                               perf:cache-references, perf:cache-misses,
-                               perf:branch-instructions, perf:branches,
-                               perf:branch-misses, perf:bus-cycles,
-                               perf:L1-dcache-loads, perf:L1-dcache-load-misses,
-                               perf:L1-dcache-stores,
-                               perf:L1-dcache-store-misses,
-                               perf:L1-dcache-prefetches,
-                               perf:L1-dcache-prefetch-misses,
-                               perf:L1-icache-loads, perf:L1-icache-load-misses,
-                               perf:L1-icache-stores,
-                               perf:L1-icache-store-misses,
-                               perf:L1-icache-prefetches,
-                               perf:L1-icache-prefetch-misses, perf:LLC-loads,
-                               perf:LLC-load-misses, perf:LLC-stores,
-                               perf:LLC-store-misses, perf:LLC-prefetches,
-                               perf:LLC-prefetch-misses, perf:dTLB-loads,
-                               perf:dTLB-load-misses, perf:dTLB-stores,
-                               perf:dTLB-store-misses, perf:dTLB-prefetches,
-                               perf:dTLB-prefetch-misses, perf:iTLB-loads,
-                               perf:iTLB-load-misses, perf:branch-loads,
-                               perf:branch-load-misses, perf:cpu-clock,
-                               perf:task-clock, perf:page-fault, perf:faults,
-                               perf:major-faults, perf:minor-faults,
-                               perf:context-switches, perf:cs,
-                               perf:cpu-migrations, perf:migrations,
-                               perf:alignment-faults, perf:emulation-faults
-Example:
-This command will add the context information 'prio' and two perf
-counters (hardware branch misses and cache misses), to all events
-in the trace data output:
-# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
-
-
-
-
-lttng add-context  -s mysession -k  -t prio -t perf:branch-misses -t perf:cache-misses
-
-
-0
-
-
-kernel context perf:cache-misses added to all channels
-kernel context perf:branch-misses added to all channels
-kernel context prio added to all channels
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev    
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent5 (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev
-      myevent4 (type: function) [enabled]
-        offset: 0x0
-        symbol: create_dev
-      myevent3 (type: probe) [enabled]
-        offset: 0x1000
-        symbol: init_post
-      myevent2 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng add-context  -h 
-
-
-0
-
-
-usage: lttng add-context -t TYPE
-
-If no channel and no event is given (-c/-e), the context
-will be added to all events and all channels.
-Otherwise the context will be added only to the channel (-c)
-and/or event (-e) indicated.
-Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
-
-Options:
-  -h, --help               Show this help
-      --list-options       Simple listing of options
-  -s, --session NAME       Apply to session name
-  -c, --channel NAME       Apply to channel
-  -e, --event NAME         Apply to event
-  -k, --kernel             Apply to the kernel tracer
-  -u, --userspace          Apply to the user-space tracer
-  -t, --type TYPE          Context type. You can repeat that option on
-                           the command line to specify multiple contexts at once.
-                           (--kernel preempts --userspace)
-                           TYPE can be one of the strings below:
-                               pid, procname, prio, nice, vpid, tid, pthread_id,
-                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles,
-                               perf:stalled-cycles-frontend,
-                               perf:idle-cycles-frontend,
-                               perf:stalled-cycles-backend,
-                               perf:idle-cycles-backend, perf:instructions,
-                               perf:cache-references, perf:cache-misses,
-                               perf:branch-instructions, perf:branches,
-                               perf:branch-misses, perf:bus-cycles,
-                               perf:L1-dcache-loads, perf:L1-dcache-load-misses,
-                               perf:L1-dcache-stores,
-                               perf:L1-dcache-store-misses,
-                               perf:L1-dcache-prefetches,
-                               perf:L1-dcache-prefetch-misses,
-                               perf:L1-icache-loads, perf:L1-icache-load-misses,
-                               perf:L1-icache-stores,
-                               perf:L1-icache-store-misses,
-                               perf:L1-icache-prefetches,
-                               perf:L1-icache-prefetch-misses, perf:LLC-loads,
-                               perf:LLC-load-misses, perf:LLC-stores,
-                               perf:LLC-store-misses, perf:LLC-prefetches,
-                               perf:LLC-prefetch-misses, perf:dTLB-loads,
-                               perf:dTLB-load-misses, perf:dTLB-stores,
-                               perf:dTLB-store-misses, perf:dTLB-prefetches,
-                               perf:dTLB-prefetch-misses, perf:iTLB-loads,
-                               perf:iTLB-load-misses, perf:branch-loads,
-                               perf:branch-load-misses, perf:cpu-clock,
-                               perf:task-clock, perf:page-fault, perf:faults,
-                               perf:major-faults, perf:minor-faults,
-                               perf:context-switches, perf:cs,
-                               perf:cpu-migrations, perf:migrations,
-                               perf:alignment-faults, perf:emulation-faults
-Example:
-This command will add the context information 'prio' and two perf
-counters (hardware branch misses and cache misses), to all events
-in the trace data output:
-# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
-
-
-
-
-lttng add-context  -s mysession -c mychannel -k  -t prio -t perf:branch-misses -t perf:cache-misses
-
-
-0
-
-
-kernel context perf:cache-misses added to channel mychannel
-kernel context perf:branch-misses added to channel mychannel
-kernel context prio added to channel mychannel
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev    
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent5 (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev
-      myevent4 (type: function) [enabled]
-        offset: 0x0
-        symbol: create_dev
-      myevent3 (type: probe) [enabled]
-        offset: 0x1000
-        symbol: init_post
-      myevent2 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng add-context  -h 
-
-
-0
-
-
-usage: lttng add-context -t TYPE
-
-If no channel and no event is given (-c/-e), the context
-will be added to all events and all channels.
-Otherwise the context will be added only to the channel (-c)
-and/or event (-e) indicated.
-Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
-
-Options:
-  -h, --help               Show this help
-      --list-options       Simple listing of options
-  -s, --session NAME       Apply to session name
-  -c, --channel NAME       Apply to channel
-  -e, --event NAME         Apply to event
-  -k, --kernel             Apply to the kernel tracer
-  -u, --userspace          Apply to the user-space tracer
-  -t, --type TYPE          Context type. You can repeat that option on
-                           the command line to specify multiple contexts at once.
-                           (--kernel preempts --userspace)
-                           TYPE can be one of the strings below:
-                               pid, procname, prio, nice, vpid, tid, pthread_id,
-                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles,
-                               perf:stalled-cycles-frontend,
-                               perf:idle-cycles-frontend,
-                               perf:stalled-cycles-backend,
-                               perf:idle-cycles-backend, perf:instructions,
-                               perf:cache-references, perf:cache-misses,
-                               perf:branch-instructions, perf:branches,
-                               perf:branch-misses, perf:bus-cycles,
-                               perf:L1-dcache-loads, perf:L1-dcache-load-misses,
-                               perf:L1-dcache-stores,
-                               perf:L1-dcache-store-misses,
-                               perf:L1-dcache-prefetches,
-                               perf:L1-dcache-prefetch-misses,
-                               perf:L1-icache-loads, perf:L1-icache-load-misses,
-                               perf:L1-icache-stores,
-                               perf:L1-icache-store-misses,
-                               perf:L1-icache-prefetches,
-                               perf:L1-icache-prefetch-misses, perf:LLC-loads,
-                               perf:LLC-load-misses, perf:LLC-stores,
-                               perf:LLC-store-misses, perf:LLC-prefetches,
-                               perf:LLC-prefetch-misses, perf:dTLB-loads,
-                               perf:dTLB-load-misses, perf:dTLB-stores,
-                               perf:dTLB-store-misses, perf:dTLB-prefetches,
-                               perf:dTLB-prefetch-misses, perf:iTLB-loads,
-                               perf:iTLB-load-misses, perf:branch-loads,
-                               perf:branch-load-misses, perf:cpu-clock,
-                               perf:task-clock, perf:page-fault, perf:faults,
-                               perf:major-faults, perf:minor-faults,
-                               perf:context-switches, perf:cs,
-                               perf:cpu-migrations, perf:migrations,
-                               perf:alignment-faults, perf:emulation-faults
-Example:
-This command will add the context information 'prio' and two perf
-counters (hardware branch misses and cache misses), to all events
-in the trace data output:
-# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
-
-
-
-
-lttng add-context  -s mysession -c channel0 -e sched_kthread_stop_ret -k  -t prio -t perf:branch-misses -t perf:cache-misses
-
-
-0
-
-
-kernel context perf:cache-misses added to event sched_kthread_stop_ret channel mychannel
-kernel context perf:branch-misses added to event sched_kthread_stop_ret channel mychannel
-kernel context prio added to channel event sched_kthread_stop_ret mychannel
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev    
-      syscalls (type: syscall) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent5 (type: probe) [enabled]
-        offset: 0x2000
-        symbol: create_dev
-      myevent4 (type: function) [enabled]
-        offset: 0x0
-        symbol: create_dev
-      myevent3 (type: probe) [enabled]
-        offset: 0x1000
-        symbol: init_post
-      myevent2 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      myevent1 (type: probe) [enabled]
-        addr: 0xc0101280
-      syscalls (type: syscall) [enabled]
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-
-
-
-
-lttng calibrate  -k  --function 
-
-
-0
-
-
-Kernel calibration done
-
-
-
-
-
-Scenario4
-
-
-lttng enable-channel mychannel -u  -s mysession --overwrite  --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
-
-
-0
-
-
-UST channel mychannel enabled for session mysession
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      None
-
-
-
-
-lttng enable-channel mychannel2 -u  -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
-
-
-0
-
-
-UST channel mychannel2 enabled for session mysession
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      None
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      None
-
-
-
-
-lttng enable-event ust_tests_hello:tptest_sighandler -u  -s mysession --tracepoint 
-
-
-0
-
-
-UST event ust_tests_hello:tptest_sighandler created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      None
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      None
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event ust_tests_hello:tptest -u  -s mysession --tracepoint 
-
-
-0
-
-
-UST event ust_tests_hello:tptest created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      None
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      None
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-      ust_tests_hello:tptest (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event  -a  -u  -s mysession -c mychannel2 --tracepoint 
-
-
-0
-
-
-All UST events created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      None
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      * (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-      ust_tests_hello:tptest (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event "ust*" -u  -s mysession -c mychannel --tracepoint 
-
-
-0
-
-
-UST event ust* created in channel mychannel
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust* (type: tracepoint) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      * (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-      ust_tests_hello:tptest (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event "ust*" -u  -s mysession --tracepoint 
-
-
-0
-
-
-UST event ust* created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust* (type: tracepoint) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      * (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust* (type: tracepoint) [enabled]
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-      ust_tests_hello:tptest (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event "u*" -u  -s mysession --tracepoint 
-
-
-0
-
-
-UST event u* created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust* (type: tracepoint) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      * (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      u* (type: tracepoint) [enabled]
-      ust* (type: tracepoint) [enabled]
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-      ust_tests_hello:tptest (type: tracepoint) [enabled]
-
-
-
-
-
-lttng enable-event myevent1 -u  -s mysession --loglevel TRACE_WARNING
-
-
-0
-
-
-UST event myevent1 created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust* (type: tracepoint) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      * (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent1 (loglevel <= TRACE_WARNING (4)) (type: tracepoint) [enabled]
-      u* (type: tracepoint) [enabled]
-      ust* (type: tracepoint) [enabled]
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-      ust_tests_hello:tptest (type: tracepoint) [enabled]
-      
-
-
-
-lttng enable-event myevent2 -u  -s mysession --loglevel-only TRACE_DEBUG_FUNCTION
-
-
-0
-
-
-UST event myevent2 created in channel channel0
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust* (type: tracepoint) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      * (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent2 (loglevel == TRACE_DEBUG_FUNCTION (12)) (type: tracepoint) [enabled]
-      myevent1 (loglevel <= TRACE_WARNING (4)) (type: loglevel) [enabled]
-      u* (type: tracepoint) [enabled]
-      ust* (type: tracepoint) [enabled]
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-      ust_tests_hello:tptest (type: tracepoint) [enabled]
-
-
-
-
-lttng enable-event myevent0 -u  -s mysession -c mychannel --loglevel-only TRACE_DEBUG_FUNCTION
-
-
-0
-
-
-UST event myevent0 created in channel mychannel
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 16384
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      myevent0 (loglevel <= TRACE_DEBUG_FUNCTION (12)) (type: tracepoint) [enabled]
-      ust* (type: tracepoint) [enabled]
-
-- mychannel2: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 32768
-      number of subbufers: 2
-      switch timer interval: 100
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      * (type: tracepoint) [enabled]
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      myevent2 (loglevel <= TRACE_DEBUG_FUNCTION (12)) (type: tracepoint) [enabled]
-      myevent1 (loglevel == TRACE_WARNING (4)) (type: loglevel) [enabled]
-      u* (type: tracepoint) [enabled]
-      ust* (type: tracepoint) [enabled]
-      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
-      ust_tests_hello:tptest (type: tracepoint) [enabled]
-
-
-
-
-
-
-
-
diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg b/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg
deleted file mode 100644
index 929dc44a25..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg
+++ /dev/null
@@ -1,323 +0,0 @@
-####################################################################
-# Copyright (c) 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:
-#    Bernd Hufmann - Initial API and implementation
-####################################################################
-####################################################################
-# Scenario: Initialize
-####################################################################
-
-Initialize
-
-lttng version 
-
-
-0
-
-
-lttng version 2.2.0 - Cuda
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-lttng list 
-
-
-0
-
-
-Currently no available tracing session
-
-
-
-lttng list -k
-
-
-0
-
-
-Kernel events
--------------
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-
-
-
-
-lttng list -u -f 
-
-
-0
-
-
-UST events:
--------------
-
-PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-
-
-
-####################################################################
-# Scenario: Session and channel with per-UID UST buffers
-####################################################################
-
-ScenPerUidTest
-
-lttng create mysession
-
-
-0
-
-
-Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20130812-113358
-
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session my destroyed.
-
-
-
-lttng enable-channel mychannel -u  -s mysession --buffers-uid 
-
-
-0
-
-
-UST channel mychannel enabled for session mysession
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20130812-113358
-
-=== Domain: UST global ===
-
-Buffer type: per UID
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 8388608
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 0
-      output: mmap()
-
-    Events:
-      None
-
-
-
-
-
-####################################################################
-# Scenario: Session and channel with per-PID UST buffers
-####################################################################
-
-ScenPerPidTest
-
-lttng create mysession
-
-
-0
-
-
-Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20130812-113358
-
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-lttng enable-channel mychannel -u  -s mysession --buffers-pid 
-
-
-0
-
-
-UST channel mychannel enabled for session mysession
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20130812-113358
-
-=== Domain: UST global ===
-
-Buffer type: per PID
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 8388608
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 0
-      output: mmap()
-
-    Events:
-      None
-
-
-
-
-
-####################################################################
-# Scenario: Session and channel with per-PID UST buffers with option -C -W
-####################################################################
-
-ScenBufSizeTest
-
-lttng create mysession
-
-
-0
-
-
-Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20130812-113358
-
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-lttng enable-channel mychannel -u  -s mysession -C 1024 -W 10
-
-
-0
-
-
-
-Warning: Tracefile size rounded up from (1024) to subbuffer size (8388608)
-
-UST channel mychannel enabled for session mysession
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20130812-113358
-
-=== Domain: UST global ===
-
-Buffer type: per PID
-
-Channels:
--------------
-- mychannel: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 8388608
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 0
-      output: mmap()
-
-    Events:
-      None
-
-
-
-
-
-
-
diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg b/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg
deleted file mode 100644
index f0dc0dea36..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg
+++ /dev/null
@@ -1,2364 +0,0 @@
-####################################################################
-# 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: 
-#    Jonathan Rajotte - Initial API and implementation
-####################################################################
-####################################################################
-# Scenario: Test lttng not installed
-####################################################################
-
-LttngNotInstalled
-
-lttng --mi xml list 
-
-
-1
-
-
-
-Command not found
-
-
-
-
-####################################################################
-# Scenario: Test lttng version
-####################################################################
-
-LttngVersion
-
-lttng version 
-
-
-0
-
-
-lttng version 2.1.0 - Basse Messe
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-####################################################################
-# Scenario: Test lttng version
-# output with prompt
-####################################################################
-
-LttngVersionWithPrompt
-
-lttng version 
-
-
-0
-
-
-Prompt> lttng version 2.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-####################################################################
-# Scenario: Test lttng version (unsupported version)
-####################################################################
-
-LttngUnsupportedVersion
-
-lttng version 
-
-
-0
-
-
-lttng version 200.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-
-####################################################################
-# Scenario: Test lttng version (noversion)
-####################################################################
-
-LttngNoVersion
-
-lttng version 
-
-
-0
-
-
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-####################################################################
-# Scenario: Test no sessions available
-####################################################################
-
-NoSessionAvailable
-
-lttng --mi xml list 
-
-
-0
-
-
-
-list
-
-
-
-####################################################################
-# Scenario: Test get sessions
-####################################################################
-
-GetSessionNames1
-
-lttng --mi xml list 
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession1
-        home/user/lttng-traces/mysession1-20120123-083928
-        false
-        0
-        0
-      
-      
-        mysession
-        home/user/lttng-traces/mysession-20120123-083318
-        false
-        0
-        0
-      
-    
-  
-
-
-
-
-####################################################################
-# Scenario: Test lttng list  where session doesn't exist 
-####################################################################
-
-GetSessionNameNotExist
-
-lttng --mi xml list test
-
-
-1
-
-
-
-list
-
-Error: Session 'test' not found
-Error: Command error
-
-
-
-
-####################################################################
-# Scenario: Test lttng -vvv list  where session doesn't exist
-####################################################################
-
-GetSessionNameNotExistVerbose
-
-lttng --mi xml -vvv  list test
-
-
-1
-
-
-
-list
-
-Error: Session 'test' not found
-Error: Command error
-
-
-
-
-####################################################################
-# Scenario: Test lttng list with garbage output 
-####################################################################
-
-GetSessionGarbageOut
-
-lttng --mi xml list 
-
-
-0
-
-
-asdfaereafsdcv 12333456434&*89**(())(^%$*
-@#$%^&*()@#$%^&*()0834523094578kj;djkfs
-a;sdf094v5u dsafj;sd9
-
-
-
-####################################################################
-# Scenario: Test lttng list  with sample outputs 
-####################################################################
-
-GetSession1
-
-lttng --mi xml list mysession
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession
-        /home/user/lttng-traces/mysession-20120129-084256
-        true
-        0
-        0
-        
-          
-            KERNEL
-            PER_PID
-            
-              
-                channel0
-                true
-                
-                  DISCARD
-                  262144
-                  4
-                  0
-                  200
-                  SPLICE
-                  0
-                  0
-                  0
-                
-                
-                  
-                    block_rq_remap
-                    TRACEPOINT
-                    true
-                    false
-                    TRACE_EMERG
-                    ALL
-                    false
-                  
-                  
-                    block_bio_remap
-                    TRACEPOINT
-                    false
-                    false
-                    TRACE_EMERG
-                    ALL
-                    false
-                  
-                
-              
-              
-                channel1
-                false
-                
-                  OVERWRITE
-                  524288
-                  4
-                  100
-                  400
-                  SPLICE
-                  0
-                  0
-                  4294967295
-                
-                
-              
-            
-          
-          
-            UST
-            PER_UID
-            
-              
-                mychannel1
-                false
-                
-                  OVERWRITE
-                  8192
-                  8
-                  200
-                  100
-                  MMAP
-                  0
-                  0
-                  0
-                
-                
-              
-              
-                channel0
-                true
-                
-                  DISCARD
-                  4096
-                  4
-                  0
-                  200
-                  MMAP
-                  0
-                  0
-                  0
-                
-                
-                  
-                    ust_tests_hello:tptest_sighandler
-                    TRACEPOINT
-                    false
-                    false
-                    TRACE_DEBUG_LINE
-                    ALL
-                    false
-                  
-                  
-                    *
-                    TRACEPOINT
-                    true
-                    false
-                    false
-                  
-                
-              
-            
-          
-        
-      
-    
-  
-
-
-
-lttng --mi xml list mysession1
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession1
-        /home/user/lttng-traces/mysession1-20120203-133225
-        false
-        0
-        0
-        
-      
-    
-  
-
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with sample output 
-####################################################################
-
-GetKernelProvider1
-
-lttng --mi xml list -k
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        KERNEL
-        PER_PID
-        
-          
-            sched_kthread_stop
-            TRACEPOINT
-            true
-            false
-            TRACE_EMERG
-            ALL
-            false
-          
-          
-            sched_kthread_stop_ret
-            TRACEPOINT
-            true
-            false
-            TRACE_EMERG
-            ALL
-            false
-          
-          
-            sched_wakeup_new
-            TRACEPOINT
-            true
-            false
-            TRACE_EMERG
-            ALL
-            false
-          
-	
-      
-    
-  
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel and no session daemon 
-####################################################################
-
-ListWithNoKernel1
-
-lttng --mi xml list -k
-
-
-1
-
-
-Spawning session daemon
-
-Error: Unable to list kernel events
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel and with session daemon 
-####################################################################
-
-ListWithNoKernel2
-
-lttng --mi xml list -k
-
-
-1
-
-
-
-Error: Unable to list kernel events
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with sample output 
-####################################################################
-
-GetUstProvider1
-
-lttng --mi xml list -u -f 
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        UST
-        PER_PID
-        
-          
-            9379
-            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-            
-              
-                ust_tests_hello:tptest_sighandler
-                TRACEPOINT
-                true
-                false
-                TRACE_DEBUG_MODULE
-                ALL
-                false
-                
-              
-              
-                ust_tests_hello:tptest
-                TRACEPOINT
-                true
-                false
-                TRACE_INFO
-                ALL
-                false
-                
-                  
-                    doublefield
-                    FLOAT
-                    0
-                  
-                  
-                    floatfield
-                    FLOAT
-                    0
-                  
-                  
-                    stringfield
-                    STRING
-                    0
-                  
-                
-              
-            
-          
-          
-            4852
-            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-            
-              
-                ust_tests_hello:tptest_sighandler
-                TRACEPOINT
-                true
-                false
-                TRACE_WARNING
-                ALL
-                false
-                
-              
-              
-                ust_tests_hello:tptest
-                TRACEPOINT
-                true
-                false
-                TRACE_DEBUG_FUNCTION
-                ALL
-                false
-                
-                  
-                    doublefield
-                    FLOAT
-                    0
-                  
-                  
-                    floatfield
-                    FLOAT
-                    0
-                  
-                  
-                    stringfield
-                    STRING
-                    0
-                  
-                
-              
-            
-          
-        
-      
-    
-  
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with no UST provider available 
-####################################################################
-
-GetUstProvider2
-
-lttng --mi xml list -u -f 
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        UST
-        PER_PID
-        
-      
-    
-  
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with no UST available (LTTng 2.0.x) 
-####################################################################
-
-ListWithNoUst1
-
-lttng --mi xml list -u -f 
-
-
-1
-
-
-
-list
-
-Error: Unable to list UST event fields: LTTng-UST tracer is not supported. Please rebuild lttng-tools with lttng-ust support enabled.
-Error: Command error
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with no UST available and no session daemon 
-####################################################################
-
-ListWithNoUst2
-
-lttng --mi xml list -u -f 
-
-
-1
-
-
-
-list
-
-Error: Unable to list UST event fields: LTTng-UST tracer is not supported. Please rebuild lttng-tools with lttng-ust support enabled.
-Error: Command error
-
-
-
-####################################################################
-# Scenario: Test "lttng list -" with no kernel and with session daemon 
-####################################################################
-
-ListWithNoUst3
-
-lttng --mi xml list -u -f 
-
-
-1
-
-
-
-list
-
-Error: Unable to list kernel events: Tracing the kernel requires a root lttng-sessiond daemon, as well as "tracing" group membership or root user ID for the lttng client.
-Error: Command Error
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u -f" with sample output (version 2.6.0) 
-####################################################################
-
-GetUstProvider3
-
-lttng --mi xml list -u -f 
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        UST
-        PER_PID
-        
-          
-            9379
-            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-            
-              
-                ust_tests_hello:tptest_sighandler
-                TRACEPOINT
-                true
-                false
-                TRACE_DEBUG_MODULE
-                ALL
-                false
-                
-              
-              
-                ust_tests_hello:tptest
-                TRACEPOINT
-                true
-                false
-                TRACE_INFO
-                ALL
-                false
-                
-                  
-                    doublefield
-                    FLOAT
-                    0
-                  
-                  
-                    floatfield
-                    FLOAT
-                    0
-                  
-                  
-                    stringfield
-                    STRING
-                    0
-                  
-                
-              
-            
-          
-          
-            4852
-            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-            
-              
-                ust_tests_hello:tptest_sighandler
-                TRACEPOINT
-                true
-                false
-                TRACE_WARNING
-                ALL
-                false
-                
-              
-              
-                ust_tests_hello:tptest
-                TRACEPOINT
-                true
-                false
-                TRACE_DEBUG_FUNCTION
-                ALL
-                false
-                
-                  
-                    doublefield
-                    FLOAT
-                    0
-                  
-                  
-                    floatfield
-                    FLOAT
-                    0
-                  
-                  
-                    stringfield
-                    STRING
-                    0
-                  
-                
-              
-            
-          
-        
-      
-    
-  
-
-
-
-####################################################################
-# Scenario: Test "lttng create   
-####################################################################
-
-CreateSession1
-
-lttng --mi xml create mysession2
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession2
-      /home/user/lttng-traces/mysession2-20120209-095418
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create   
-####################################################################
-
-CreateSessionWithPrompt
-
-lttng --mi xml create mysession2
-
-
-0
-
-
-Prompt> Session mysession2 created.
-Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
-
-
-
-####################################################################
-# Scenario: Test "lttng create  with different variants 
-# and errors
-####################################################################
-
-CreateSessionVariants
-
-lttng --mi xml create alreadyExist
-
-
-1
-
-
-
-
-  create
-  
-  false
-
-
-Warning: Session mysession2 already exists
-Error: Session name already exists
-
-
-
-
-lttng --mi xml create "session with spaces"
-
-
-0
-
-
-
-
-  create
-  
-    
-      session with spaces
-      /home/user/lttng-traces/session with spaces-20120209-095418
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml create wrongName
-
-
-0
-
-
-
-
-  create
-  
-    
-      auto
-      /home/user/lttng-traces/auto-20120209-095418
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml create wrongPath -o /home/user/hallo
-
-
-0
-
-
-
-
-  create
-  
-    
-      wrongPath
-      /home/user/lttng-traces/wrongPath-20120209-095418
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml create pathWithSpaces -o "/home/user/hallo user/here"
-
-
-0
-
-
-
-
-  create
-  
-    
-      pathWithSpaces
-      /home/user/hallo user/here/pathWithSpaces-20120209-095418
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-####################################################################
-# Scenario: Test "lttng destroy  
-####################################################################
-
-
-DestroySession1
-
-lttng --mi xml destroy mysession2
-
-
-0
-
-
-
-
-  destroy
-  
-    
-      
-        mysession2
-        /home/user/lttng-traces/mysession2-20140812-160632
-        false
-        0
-        0
-      
-    
-  
-  true
-
-
-
-
-####################################################################
-# Scenario: Test "lttng enable-channel ..." with different inputs 
-####################################################################
-
-
-ChannelHandling
-
-lttng --mi xml enable-channel mychannel0,mychannel1 -k  -s mysession2 --overwrite  --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10
-
-
-0
-
-
-Kernel channel mychannel0 enabled for session mysession2
-Kernel channel mychannel1 enabled for session mysession2
-
-
-
-lttng --mi xml enable-channel mychannel0,mychannel1 -k  -s mysession2 --overwrite  --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
-
-
-0
-
-
-
-
-  enable-channel
-  
-    
-      
-        mychannel0
-        false
-        
-          OVERWRITE
-          16384
-          2
-          200
-          100
-          SPLICE
-          0
-          0
-          4294967295
-        
-        true
-      
-      
-        mychannel1
-        false
-        
-          OVERWRITE
-          16384
-          2
-          200
-          100
-          SPLICE
-          0
-          0
-          4294967295
-        
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
-
-
-0
-
-
-UST channel channel0 enabled for session mysession2
-
-
-
-lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
-
-
-0
-
-
-
-
-  enable-channel
-  
-    
-      
-        ustChannel
-        false
-        
-          OVERWRITE
-          32768
-          2
-          100
-          200
-          MMAP
-          0
-          0
-          4294967295
-        
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid  -C 0 -W 20
-
-
-0
-
-
-UST channel channel0 enabled for session mysession2
-
-
-
-lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --buffers-pid 
-
-
-0
-
-
-
-
-  enable-channel
-  
-    
-      
-        ustChannel
-        false
-        
-          OVERWRITE
-          4096
-          4
-          0
-          0
-          MMAP
-          0
-          0
-          4294967295
-        
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200 --buffers-uid
-
-
-0
-
-
-
-
-  enable-channel
-  
-    
-      
-        ustChannel
-        false
-        
-          OVERWRITE
-          32768
-          2
-          100
-          200
-          MMAP
-          0
-          0
-          4294967295
-        
-        true
-      
-    
-  
-  true
-
-
-
-
-
-lttng --mi xml enable-channel mychannel0,mychannel1 -k  -s mysession2
-
-
-0
-
-
-
-
-  enable-channel
-  
-    
-      
-        mychannel0
-        false
-        
-          DISCARD
-          262144
-          4
-          0
-          200000
-          SPLICE
-          0
-          0
-          4294967295
-        
-        true
-      
-      
-        mychannel1
-        false
-        
-          DISCARD
-          262144
-          4
-          0
-          200000
-          SPLICE
-          0
-          0
-          4294967295
-        
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-channel ustChannel -u  -s mysession2
-
-
-0
-
-
-
-
-  enable-channel
-  
-    
-      
-        ustChannel
-        false
-        
-          DISCARD
-          131072
-          4
-          0
-          0
-          MMAP
-          0
-          0
-          4294967295
-        
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml disable-channel mychannel0,mychannel1 -k  -s mysession2
-
-
-0
-
-
-
-
-  disable-channel
-  
-    
-      
-        mychannel0
-        false
-        true
-      
-      
-        mychannel1
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml disable-channel ustChannel -u  -s mysession2
-
-
-0
-
-
-
-
-  disable-channel
-  
-    
-      
-        ustChannel
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-
-####################################################################
-# Scenario: Test "lttng --mi xml enable-events ..." with different inputs 
-####################################################################
-
-EventHandling
-
-# Tracepoint test cases
- 
-
-lttng --mi xml enable-event block_rq_remap,block_bio_remap,softirq_entry -k  -s mysession2 --tracepoint 
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        block_rq_remap
-        TRACEPOINT
-        true
-        false
-        TRACE_EMERG
-        ALL
-        false
-        true
-      
-      
-        block_bio_remap
-        TRACEPOINT
-        true
-        false
-        TRACE_EMERG
-        ALL
-        false
-        true
-      
-      
-        softirq_entry
-        TRACEPOINT
-        true
-        false
-        TRACE_EMERG
-        ALL
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-event  -a  -k  -s mysession2 -c mychannel --tracepoint 
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        *
-        TRACEPOINT
-        true
-        false
-        TRACE_EMERG
-        ALL
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u  -s mysession2 -c mychannel --tracepoint 
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        ust_tests_hello:tptest_sighandler
-        TRACEPOINT
-        true
-        false
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u  -s mysession2 -c mychannel --tracepoint  --filter 'intfield==10'
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        ust_tests_hello:tptest_sighandler
-        TRACEPOINT
-        true
-        true
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-event  -a  -u  -s mysession2 -c mychannel --tracepoint 
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        *
-        TRACEPOINT
-        true
-        false
-        false
-        true
-      
-    
-  
-  true
-
-
-
-# Syscall test cases
-
-
-lttng --mi xml enable-event  -a  -k  -s mysession2 --syscall 
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        *
-        SYSCALL
-        true
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-event  -a  -k  -s mysession2 -c mychannel --syscall 
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        *
-        SYSCALL
-        true
-        false
-        true
-      
-    
-  
-  true
-
-
-
-# dynamic probe/function probe test cases
-
-
-lttng --mi xml enable-event myevent0 -k  -s mysession2 --function 0xc0101340
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        myevent0
-        FUNCTION
-        false
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-event myevent1 -k  -s mysession2 -c mychannel --probe init_post
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        myevent1
-        PROBE
-        false
-        false
-        0
-        init_post
-        true
-      
-    
-  
-  true
-
-
-
-
-# log level test cases
-
-
-lttng --mi xml enable-event myevent4 -u  -s mysession2 --loglevel-only TRACE_DEBUG
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        myevent4
-        TRACEPOINT
-        true
-        false
-        TRACE_DEBUG
-        SINGLE
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml enable-event myevent5 -u  -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
-
-
-0
-
-
-
-
-  enable-event
-  
-    
-      
-        myevent5
-        TRACEPOINT
-        true
-        false
-        TRACE_DEBUG_FUNCTION
-        RANGE
-        false
-        true
-      
-    
-  
-  true
-
-
-
-
-
-####################################################################
-# Scenario: Test "lttng add-context -h" and lttng --mi xml add-context ..." with different inputs 
-####################################################################
-
-
-ContextHandling
-
-
-lttng --mi xml add-context  -h 
-
-
-0
-
-
-usage: lttng add-context -t TYPE [-k|-u] [OPTIONS]
-
-If no channel is given (-c), the context is added to
-all channels.
-
-Otherwise the context is added only to the channel (-c).
-
-Exactly one domain (-k or -u) must be specified.
-
-Options:
-  -h, --help               Show this help
-      --list-options       Simple listing of options
-  -s, --session NAME       Apply to session name
-  -c, --channel NAME       Apply to channel
-  -k, --kernel             Apply to the kernel tracer
-  -u, --userspace          Apply to the user-space tracer
-
-Context:
-  -t, --type TYPE          Context type. You can repeat that option on
-                           the command line to specify multiple contexts at once.
-                           (--kernel preempts --userspace)
-                           TYPE can be one of the strings below:
-                               pid, procname, prio, nice, vpid, tid, pthread_id,
-                               vtid, ppid, vppid, perf:cpu:cpu-cycles, perf:cpu:cycles
-Note that the vpid, vppid and vtid context types represent the virtual process id,
-virtual parent process id and virtual thread id as seen from the current execution context
-as opposed to the pid, ppid and tid which are kernel internal data structures.
-
-Example:
-This command will add the context information 'prio' and two per-cpu
-perf counters (hardware branch misses and cache misses), to all channels
-in the trace data output:
-# lttng add-context -k -t prio -t perf:cpu:branch-misses -t perf:cpu:cache-misses
-
-
-
-lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
-
-
-0
-
-
-UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
-UST context pid added to event sched_kthread_stop_ret channel mychannel
-
-
-
-
-ContextErrorHandling
-
-
-lttng --mi xml add-context  -h 
-
-
-1
-
-
-usage: lttng add-context -t TYPE
-
-If no channel and no event is given (-c/-e), the context
-will be added to all events and all channels.
-Otherwise the context will be added only to the channel (-c)
-and/or event (-e) indicated.
-Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
-
-Options:
-  -h, --help               Show this help
-      --list-options       Simple listing of options
-  -s, --session NAME       Apply to session name
-  -c, --channel NAME       Apply to channel
-  -e, --event NAME         Apply to event
-  -k, --kernel             Apply to the kernel tracer
-  -u, --userspace          Apply to the user-space tracer
-  -t, --type TYPE          Context type. You can repeat that option on
-                           the command line to specify multiple contexts at once.
-                           (--kernel preempts --userspace)
-                           TYPE can be one of the strings below:
-                               pid, procname, prio, nice, vpid, tid, pthread_id,
-                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
-Example:
-This command will add the context information 'prio' and two perf
-counters (hardware branch misses and cache misses), to all events
-in the trace data output:
-# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
-
-
-
-
-lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
-
-
-1
-
-
-UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
-UST context pid added to event sched_kthread_stop_ret channel mychannel
-
-
-
-
-
-CalibrateHandling
-
-lttng --mi xml calibrate  -k  --function 
-
-
-0
-
-
-
-
-  calibrate
-  
-    
-      FUNCTION
-    
-  
-  true
-
-
-
-
-lttng --mi xml calibrate -u --function 
-
-
-0
-
-
-
-
-  calibrate
-  
-    
-      FUNCTION
-    
-  
-  true
-
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  with LTTng 2.1 options  
-####################################################################
-
-CreateSessionLttng2.1
-
-
-lttng --mi xml create mysession -U net://172.0.0.1
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      tcp4://172.0.0.1:5342/mysession-20140813-095804 [data: 5343]
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml create mysession -U file:///tmp
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      /tmp
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      tcp4://172.0.0.1:5342/ [data: 5343]
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml create mysession -U 172.0.0.1:1234:2345
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      tcp4://172.0.0.1:1234/mysession-20140813-102225 [data: 2345]
-      false
-      0
-      0
-    
-  
-  true
-
-
-
-
-lttng --mi xml destroy mysession
-
-
-0
-
-
-
-
-  destroy
-  
-    
-      
-        mysession
-        /home/user/lttng-traces/mysession-20140818-100114
-        false
-        0
-        0
-      
-    
-  
-  true
-
-
-
-
-lttng --mi xml -vvv  create mysession -U net://172.0.0.1
-
-
-0
-
-
-DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
-DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
-DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
-DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
-Session mysession created.
-Traces will be written in net://172.0.0.1
-DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --snapshot (LTTng 2.3)
-####################################################################
-
-CreateSessionSnapshot
-
-lttng --mi xml create mysession --snapshot 
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      
-      false
-      1
-      4294967295
-    
-  
-  true
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml snapshot list-output  -s mysession
-
-
-0
-
-
-
-
-  snapshot
-  
-    
-      list-output
-      
-        
-          mysession
-          
-            
-              1
-              snapshot-1
-              /home/user/lttng-traces/mysession-20130913-141651
-              
-              0
-            
-          
-        
-      
-    
-  
-  true
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml list 
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession
-        
-        false
-        1
-        4294967295
-      
-    
-  
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml snapshot record  -s mysession
-
-
-0
-
-
-    Snapshot recorded successfully for session mysession
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml destroy mysession
-
-
-0
-
-
-
-
-  destroy
-  
-    
-      
-        mysession
-        /home/user/lttng-traces/mysession-20140818-100114
-        false
-        0
-        0
-      
-    
-  
-  true
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --snapshot -U  (LTTng 2.3)
-####################################################################
-
-CreateSessionStreamedSnapshot
-
-lttng --mi xml create mysession --snapshot -U net://172.0.0.1
-
-
-0
-
-
-Session mysession created.
-Default snapshot output set to: net://172.0.0.1
-Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml snapshot list-output  -s mysession
-
-
-0
-
-
-Snapshot output list for session mysession
-    [2] snapshot-2: net4://172.0.0.1:5342/
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml list 
-
-
-0
-
-
-  1) mysession () [inactive snapshot]
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml snapshot record  -s mysession
-
-
-0
-
-
-    Snapshot recorded successfully for session mysession
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml destroy mysession
-
-
-0
-
-
-
-
-  destroy
-  
-    
-      
-        mysession
-        /home/user/lttng-traces/mysession-20140818-100114
-        false
-        0
-        0
-      
-    
-  
-  true
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --snapshot (LTTng 2.3)
-####################################################################
-
-CreateSessionSnapshotErrors
-
-lttng --mi xml snapshot list-output  -s blabla
-
-
-1
-
-
-
-
-
-  snapshot
-  
-    
-      list-output
-      
-    
-  
-  false
-
-
-
-#------------------------------------------------------------------------------
-#next is not an error case but good to be tested
-
-lttng --mi xml list 
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession
-        
-        true
-        1
-        4294967295
-      
-    
-  
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml snapshot record  -s blabla
-
-
-1
-
-
-
-    Error: Session name not found
-
-
-
-  snapshot
-  
-    
-      record
-      
-    
-  
-  false
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml snapshot record  -s mysession
-
-
-1
-
-
-
-    Error: Session needs to be started once
-
-
-
-  snapshot
-  
-    
-      record
-      
-    
-  
-  false
-
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --live [USEC] (LTTng 2.4)
-####################################################################
-
-CreateSessionLive
-
-lttng --mi xml create mysession --live  -U net://127.0.0.1
-
-
-0
-
-
-
-
-  create
-  
-    
-      mysession
-      tcp4://127.0.0.1:5342/ [data: 5343]
-      false
-      0
-      1000000
-    
-  
-  true
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml list 
-
-
-0
-
-
-
-
-  list
-  
-    
-      
-        mysession
-        tcp4://127.0.0.1:5342/ [data: 5343]
-        false
-        0
-        1000000
-      
-    
-  
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml destroy mysession
-
-
-0
-
-
-
-
-  destroy
-  
-    
-      
-        mysession
-        /home/user/lttng-traces/mysession-20140818-100114
-        false
-        0
-        0
-      
-    
-  
-  true
-
-
-
-
-####################################################################
-# Scenario: Test errors for  "lttng create  --live [USEC] (LTTng 2.4)
-####################################################################
-
-CreateSessionLiveErrors
-
-lttng --mi xml create mysession --live --snapshot
-
-
-1
-
-
-
-Error: Snapshot and live modes are mutually exclusive.
-Error: Command error
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml create mysession --live -U blah
-
-
-1
-
-
-
-Error: URI parse unknown protocol blah
-Error: Unable to parse the URL blah
-Error: Invalid parameter
-
-
-#------------------------------------------------------------------------------
-
-lttng --mi xml create mysession --live -C net://127.0.0.1
-
-
-1
-
-
-
-Error: You need both control and data URL.
-Error: Command error
-
-
-
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg b/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg
deleted file mode 100644
index 5c7dc89b4f..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg
+++ /dev/null
@@ -1,1481 +0,0 @@
-####################################################################
-# Copyright (c) 2012 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: 
-#    Bernd Hufmann - Initial API and implementation
-####################################################################
-####################################################################
-# Scenario: Test lttng not installed
-####################################################################
-
-LttngNotInstalled
-
-lttng list 
-
-
-1
-
-
-
-Command not found
-
-
-
-
-####################################################################
-# Scenario: Test lttng version
-####################################################################
-
-LttngVersion
-
-lttng version 
-
-
-0
-
-
-lttng version 2.1.0 - Basse Messe
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-####################################################################
-# Scenario: Test lttng version
-# output with prompt
-####################################################################
-
-LttngVersionWithPrompt
-
-lttng version 
-
-
-0
-
-
-Prompt> lttng version 2.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-####################################################################
-# Scenario: Test lttng version (unsupported version)
-####################################################################
-
-LttngUnsupportedVersion
-
-lttng version 
-
-
-0
-
-
-lttng version 200.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-
-####################################################################
-# Scenario: Test lttng version (noversion)
-####################################################################
-
-LttngNoVersion
-
-lttng version 
-
-
-0
-
-
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-####################################################################
-# Scenario: Test no sessions available
-####################################################################
-
-NoSessionAvailable
-
-lttng list 
-
-
-0
-
-
-Currently no available tracing session
-
-
-
-####################################################################
-# Scenario: Test get sessions
-####################################################################
-
-GetSessionNames1
-
-lttng list 
-
-
-0
-
-
-Available tracing sessions:
-  1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
-  2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
-
- Use lttng list  for more details
-
-
-
-####################################################################
-# Scenario: Test lttng list  where session doesn't exist 
-####################################################################
-
-GetSessionNameNotExist
-
-lttng list test
-
-
-1
-
-
-Session test not found
-
-Error: Session name not found
-
-
-
-
-####################################################################
-# Scenario: Test lttng -vvv list  where session doesn't exist
-####################################################################
-
-GetSessionNameNotExistVerbose
-
-lttng -vvv  list test
-
-
-1
-
-
-DEBUG2: Session name: test [in cmd_list() at commands/list.c:618]
-DEBUG1: Session count 1 [in list_sessions() at commands/list.c:485]
-
-Error: Session 'test' not found
-Error: Command error
-
-DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
-
-
-
-####################################################################
-# Scenario: Test lttng list with garbage output 
-####################################################################
-
-GetSessionGarbageOut
-
-lttng list 
-
-
-0
-
-
-asdfaereafsdcv 12333456434&*89**(())(^%$*
-@#$%^&*()@#$%^&*()0834523094578kj;djkfs
-a;sdf094v5u dsafj;sd9
-
-
-
-####################################################################
-# Scenario: Test lttng list  with sample outputs 
-####################################################################
-
-GetSession1
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [active]                                                                    
-    Trace path: /home/user/lttng-traces/mysession-20120129-084256
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled]
-
-- channel1: [disabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 524288
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 400
-      output: splice()
-
-    Events:
-      None
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel1: [disabled]
-
-    Attributes:
-     overwrite mode: 1
-     subbufers size: 8192
-      number of subbufers: 8
-      switch timer interval: 200
-      read timer interval: 100
-      output: mmap()
-
-    Events:
-      None
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 4096
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled]
-      * (type: tracepoint) [enabled]
-
-
-
-lttng list mysession1
-
-
-0
-
-
-Tracing session mysession1: [inactive]
-    Trace path: /home/user/lttng-traces/mysession1-20120203-133225
-
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with sample output 
-####################################################################
-
-GetKernelProvider1
-
-lttng list -k
-
-
-0
-
-
-Kernel events
--------------
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel and no session daemon 
-####################################################################
-
-ListWithNoKernel1
-
-lttng list -k
-
-
-1
-
-
-Spawning session daemon
-
-Error: Unable to list kernel events
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel and with session daemon 
-####################################################################
-
-ListWithNoKernel2
-
-lttng list -k
-
-
-1
-
-
-
-Error: Unable to list kernel events
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel, with session daemon and verbose
-####################################################################
-
-ListWithNoKernelVerbose
-
-lttng -vvv  list -k
-
-
-1
-
-
-DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:618]
-DEBUG1: Getting kernel tracing events [in list_kernel_events() at commands/list.c:309]
-
-Error: Unable to list kernel events
-
-DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with sample output 
-####################################################################
-
-GetUstProvider1
-
-lttng list -u
-
-
-0
-
-
-UST events:
--------------
-
-PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
-
-PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with no UST provider available 
-####################################################################
-
-GetUstProvider2
-
-lttng list -u
-
-
-0
-
-
-UST events:
--------------
-None
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with no UST available (LTTng 2.0.x) 
-####################################################################
-
-ListWithNoUst1
-
-lttng list -u
-
-
-1
-
-
-UST events:
--------------
-None
-Segmentation Fault
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with no UST available and no session daemon 
-####################################################################
-
-ListWithNoUst2
-
-lttng list -u -f 
-
-
-1
-
-
-Spawning a session daemon
-
-Error: Unable to list UST events: Listing UST events failed
-Error: Command Error
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with no ust and with session daemon 
-####################################################################
-
-ListWithNoUst3
-
-lttng list -u -f 
-
-
-1
-
-
-
-Error: Unable to list UST events: Listing UST events failed
-Error: Command Error
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u" with no kernel, with session daemon and verbose
-####################################################################
-
-ListWithNoUstVerbose
-
-lttng -vvv  list -u -f 
-
-
-1
-
-
-DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:618]
-DEBUG1: Getting kernel tracing events [in list_kernel_events() at commands/list.c:309]
-Spawning a session daemon
-
-Error: Unable to list UST events: Listing UST events failed
-Error: Command Error
-
-DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -u -f" with sample output (version 2.1.0) 
-####################################################################
-
-GetUstProvider3
-
-lttng list -u -f 
-
-
-0
-
-
-UST events:
--------------
-
-PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
-        field: doublefield (float)
-        field: floatfield (float)
-        field: stringfield (string)
-
-PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-        field: doublefield (float)
-        field: floatfield (float)
-        field: stringfield (string)
-
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create   
-####################################################################
-
-CreateSession1
-
-lttng create mysession2
-
-
-0
-
-
-Session mysession2 created.
-Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
-
-
-
-####################################################################
-# Scenario: Test "lttng create   
-####################################################################
-
-CreateSessionWithPrompt
-
-lttng create mysession2
-
-
-0
-
-
-Prompt> Session mysession2 created.
-Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
-
-
-
-####################################################################
-# Scenario: Test "lttng create  with different variants 
-# and errors
-####################################################################
-
-CreateSessionVariants
-
-lttng create alreadyExist
-
-
-1
-
-
-
-Error: Session name already exist
-
-
-
-
-lttng create "session with spaces"
-
-
-0
-
-
-Session session with spaces created.
-Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418
-
-
-
-lttng create wrongName
-
-
-0
-
-
-Session auto created.
-Traces will be written in /home/user/lttng-traces/auto-20120209-095418
-
-
-
-lttng create wrongPath -o /home/user/hallo
-
-
-0
-
-
-Session wrongPath created.
-Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
-
-
-
-lttng create pathWithSpaces -o "/home/user/hallo user/here"
-
-
-0
-
-
-Session pathWithSpaces created.
-Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418
-
-
-
-####################################################################
-# Scenario: Test "lttng destroy  
-####################################################################
-
-
-DestroySession1
-
-lttng destroy mysession2
-
-
-0
-
-
-Session mysession2 destroyed.
-
-
-
-####################################################################
-# Scenario: Test "lttng -vvv destroy "
-####################################################################
-
-
-DestroySessionVerbose
-
-lttng -vvv  destroy mysession2
-
-
-0
-
-
-DEBUG2: Config file path found: /home/eedbhu [in get_session_name() at utils.c:98]
-DEBUG1: Session name found: mysession2 [in get_session_name() at utils.c:99]
-Session mysession2 destroyed at /home/eedbhu
-
-
-
-
-####################################################################
-# Scenario: Test "lttng enable-channel ..." with different inputs 
-####################################################################
-
-
-ChannelHandling
-
-lttng enable-channel mychannel0,mychannel1 -k  -s mysession2 --overwrite  --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10
-
-
-0
-
-
-Kernel channel mychannel0 enabled for session mysession2
-Kernel channel mychannel1 enabled for session mysession2
-
-
-
-lttng enable-channel mychannel0,mychannel1 -k  -s mysession2 --overwrite  --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
-
-
-0
-
-
-Kernel channel mychannel0 enabled for session mysession2
-Kernel channel mychannel1 enabled for session mysession2
-
-
-
-lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
-
-
-0
-
-
-UST channel channel0 enabled for session mysession2
-
-
-
-lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
-
-
-0
-
-
-UST channel channel0 enabled for session mysession2
-
-
-
-lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid  -C 0 -W 20
-
-
-0
-
-
-UST channel channel0 enabled for session mysession2
-
-
-
-lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --buffers-pid 
-
-
-0
-
-
-UST channel ustChannel enabled for session mysession2
-
-
-
-lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid
-
-
-0
-
-
-UST channel channel0 enabled for session mysession2
-
-
-
-
-lttng enable-channel mychannel0,mychannel1 -k  -s mysession2
-
-
-0
-
-
-Kernel channel mychannel0 enabled for session mysession2
-Kernel channel mychannel1 enabled for session mysession2
-
-
-
-lttng enable-channel ustChannel -u  -s mysession2
-
-
-0
-
-
-UST channel mychannel0 enabled for session mysession2
-
-
-
-lttng disable-channel mychannel0,mychannel1 -k  -s mysession2
-
-
-0
-
-
-Kernel channel mychannel0 disabled for session mysession2
-Kernel channel mychannel1 disabled for session mysession2
-
-
-
-lttng disable-channel ustChannel -u  -s mysession2
-
-
-0
-
-
-UST channel mychannel0 enabled for session mysession2
-
-
-
-
-####################################################################
-# Scenario: Test "lttng enable-events ..." with different inputs 
-####################################################################
-
-EventHandling
-
-# Tracepoint test cases
- 
-
-lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k  -s mysession2 --tracepoint 
-
-
-0
-
-
-kernel event block_rq_remap created in channel channel0
-kernel event block_bio_remap created in channel channel0
-kernel event softirq_entry created in channel channel0
-
-
-
-lttng enable-event  -a  -k  -s mysession2 -c mychannel --tracepoint 
-
-
-0
-
-
-All kernel tracepoints are enabled in channel channel0
-
-
-
-lttng enable-event ust_tests_hello:tptest_sighandler -u  -s mysession2 -c mychannel --tracepoint 
-
-
-0
-
-
-UST event ust_tests_hello:tptest_sighandler created in channel mychannel
-
-
-
-lttng enable-event ust_tests_hello:tptest_sighandler -u  -s mysession2 -c mychannel --tracepoint  --filter 'intfield==10'
-
-
-0
-
-
-UST event ust_tests_hello:tptest_sighandler created in channel mychannel
-
-
-
-lttng enable-event  -a  -u  -s mysession2 -c mychannel --tracepoint 
-
-
-0
-
-
-All UST tracepoints are enabled in channel mychannel
-
-
-# Syscall test cases
-
-
-lttng enable-event  -a  -k  -s mysession2 --syscall 
-
-
-0
-
-
-All kernel system calls are enabled in channel channel0
-
-
-
-lttng enable-event  -a  -k  -s mysession2 -c mychannel --syscall 
-
-
-0
-
-
-All kernel system calls are enabled in channel mychannel
-
-
-# dynamic probe/function probe test cases
-
-
-lttng enable-event myevent0 -k  -s mysession2 --function 0xc0101340
-
-
-0
-
-
-kernel event myevent0 created in channel mychannel
-
-
-
-lttng enable-event myevent1 -k  -s mysession2 -c mychannel --probe init_post
-
-
-0
-
-
-kernel event myevent1 created in channel mychannel
-
-
-# log level test cases
-
-
-lttng enable-event myevent4 -u  -s mysession2 --loglevel-only TRACE_DEBUG
-
-
-0
-
-
-UST event myevent4 created in channel channel0
-
-
-
-lttng enable-event myevent5 -u  -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
-
-
-0
-
-
-UST event myevent5 created in channel mychannel
-
-
-
-
-####################################################################
-# Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs 
-####################################################################
-
-
-ContextHandling
-
-
-lttng add-context  -h 
-
-
-0
-
-
-usage: lttng add-context -t TYPE
-
-If no channel and no event is given (-c/-e), the context
-will be added to all events and all channels.
-Otherwise the context will be added only to the channel (-c)
-and/or event (-e) indicated.
-Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
-
-Options:
-  -h, --help               Show this help
-      --list-options       Simple listing of options
-  -s, --session NAME       Apply to session name
-  -c, --channel NAME       Apply to channel
-  -e, --event NAME         Apply to event
-  -k, --kernel             Apply to the kernel tracer
-  -u, --userspace          Apply to the user-space tracer
-  -t, --type TYPE          Context type. You can repeat that option on
-                           the command line to specify multiple contexts at once.
-                           (--kernel preempts --userspace)
-                           TYPE can be one of the strings below:
-                               pid, procname, prio, nice, vpid, tid, pthread_id,
-                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
-Example:
-This command will add the context information 'prio' and two perf
-counters (hardware branch misses and cache misses), to all events
-in the trace data output:
-# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
-
-
-
-
-lttng add-context  -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
-
-
-0
-
-
-UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
-UST context pid added to event sched_kthread_stop_ret channel mychannel
-
-
-
-
-ContextErrorHandling
-
-
-lttng add-context  -h 
-
-
-1
-
-
-usage: lttng add-context -t TYPE
-
-If no channel and no event is given (-c/-e), the context
-will be added to all events and all channels.
-Otherwise the context will be added only to the channel (-c)
-and/or event (-e) indicated.
-Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
-
-Options:
-  -h, --help               Show this help
-      --list-options       Simple listing of options
-  -s, --session NAME       Apply to session name
-  -c, --channel NAME       Apply to channel
-  -e, --event NAME         Apply to event
-  -k, --kernel             Apply to the kernel tracer
-  -u, --userspace          Apply to the user-space tracer
-  -t, --type TYPE          Context type. You can repeat that option on
-                           the command line to specify multiple contexts at once.
-                           (--kernel preempts --userspace)
-                           TYPE can be one of the strings below:
-                               pid, procname, prio, nice, vpid, tid, pthread_id,
-                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
-Example:
-This command will add the context information 'prio' and two perf
-counters (hardware branch misses and cache misses), to all events
-in the trace data output:
-# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
-
-
-
-
-lttng add-context  -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
-
-
-1
-
-
-UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
-UST context pid added to event sched_kthread_stop_ret channel mychannel
-
-
-
-
-
-CalibrateHandling
-
-lttng calibrate  -k  --function 
-
-
-0
-
-
-Kernel calibration done
-
-
-
-lttng calibrate  -u  --function 
-
-
-1
-
-
-Kernel calibration done
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  with LTTng 2.1 options  
-####################################################################
-
-CreateSessionLttng2.1
-
-
-lttng create mysession -U net://172.0.0.1
-
-
-0
-
-
-Session mysession created.
-Traces will be written in net://172.0.0.1
-
-
-
-lttng create mysession -U file:///tmp
-
-
-0
-
-
-Session mysession created.
-Traces will be written in file:///tmp
-
-
-
-lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
-
-
-0
-
-
-Session mysession created.
-Control URL tcp://172.0.0.1 set for session mysession
-Data URL tcp://172.0.0.1:5343 set for session mysession
-
-
-
-lttng create mysession -U net://172.0.0.1:1234:2345
-
-
-0
-
-
-Session mysession created.
-Traces will be written in net://172.0.0.1:1234:2345
-
-
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-lttng -vvv  create mysession -U net://172.0.0.1
-
-
-0
-
-
-DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
-DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
-DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
-DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
-Session mysession created.
-Traces will be written in net://172.0.0.1
-DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
-
-
-
-
-####################################################################
-# Scenario: Test "lttng -vvv create  with LTTng 2.1 options"
-####################################################################
-
-CreateSessionLttngVerbose2.1
-
-lttng -vvv  create mysession -U net://172.0.0.1
-
-
-0
-
-
-DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
-DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
-DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
-DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
-Session mysession created.
-Traces will be written in net://172.0.0.1
-DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
-
-
-
-lttng -vvv  destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --snapshot (LTTng 2.3)
-####################################################################
-
-CreateSessionSnapshot
-
-lttng create mysession --snapshot 
-
-
-0
-
-
-Session mysession created.
-Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
-Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
-
-#------------------------------------------------------------------------------
-
-lttng snapshot list-output  -s mysession
-
-
-0
-
-
-Snapshot output list for session mysession
-    [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
-
-#------------------------------------------------------------------------------
-
-lttng list 
-
-
-0
-
-
-  1) mysession () [inactive snapshot]
-
-
-#------------------------------------------------------------------------------
-
-lttng snapshot record  -s mysession
-
-
-0
-
-
-    Snapshot recorded successfully for session mysession
-
-#------------------------------------------------------------------------------
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --snapshot -U  (LTTng 2.3)
-####################################################################
-
-CreateSessionStreamedSnapshot
-
-lttng create mysession --snapshot -U net://172.0.0.1
-
-
-0
-
-
-Session mysession created.
-Default snapshot output set to: net://172.0.0.1
-Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
-
-#------------------------------------------------------------------------------
-
-lttng snapshot list-output  -s mysession
-
-
-0
-
-
-Snapshot output list for session mysession
-    [2] snapshot-2: net4://172.0.0.1:5342/
-
-#------------------------------------------------------------------------------
-
-lttng list 
-
-
-0
-
-
-  1) mysession () [inactive snapshot]
-
-
-#------------------------------------------------------------------------------
-
-lttng snapshot record  -s mysession
-
-
-0
-
-
-    Snapshot recorded successfully for session mysession
-
-#------------------------------------------------------------------------------
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --snapshot (LTTng 2.3)
-####################################################################
-
-CreateSessionSnapshotErrors
-
-lttng snapshot list-output  -s blabla
-
-
-1
-
-
-
-Error: Session name not found
-
-
-#------------------------------------------------------------------------------
-#next is not an error case but good to be tested
-
-lttng list 
-
-
-0
-
-
-  1) mysession () [active snapshot]
-
-
-#------------------------------------------------------------------------------
-
-lttng snapshot record  -s blabla
-
-
-1
-
-
-
-    Error: Session name not found
-
-
-#------------------------------------------------------------------------------
-
-lttng snapshot record  -s mysession
-
-
-1
-
-
-
-    Error: Session needs to be started once
-
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --live [USEC] (LTTng 2.4)
-####################################################################
-
-CreateSessionLive
-
-lttng create mysession --live  -U net://127.0.0.1
-
-
-0
-
-
-Session mysession created.
-Traces will be written in net://127.0.0.1
-Live timer set to 1000000 usec
-
-#------------------------------------------------------------------------------
-
-lttng list 
-
-
-0
-
-
-Available tracing sessions:
-  1) mysession (net4://127.0.0.1:5342/ [data: 5343]) [inactive]
-
-Use lttng list  for more details
-
-#------------------------------------------------------------------------------
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
-
-####################################################################
-# Scenario: Test errors for  "lttng create  --live [USEC] (LTTng 2.4)
-####################################################################
-
-CreateSessionLiveErrors
-
-lttng create mysession --live --snapshot
-
-
-1
-
-
-
-Error: Snapshot and live modes are mutually exclusive.
-Error: Command error
-
-
-#------------------------------------------------------------------------------
-
-lttng create mysession --live -U blah
-
-
-1
-
-
-
-Error: URI parse unknown protocol blah
-Error: Unable to parse the URL blah
-Error: Invalid parameter
-
-
-#------------------------------------------------------------------------------
-
-lttng create mysession --live -C net://127.0.0.1
-
-
-1
-
-
-
-Error: You need both control and data URL.
-Error: Command error
-
-
-
-####################################################################
-# Scenario: Test "lttng create  --snapshot (LTTng 2.5)
-####################################################################
-
-CreateSessionSnapshot2.5
-
-lttng create mysession --snapshot 
-
-
-0
-
-
-Session mysession created.
-Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
-Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
-
-#------------------------------------------------------------------------------
-
-lttng snapshot list-output  -s mysession
-
-
-0
-
-
-Snapshot output list for session mysession
-    [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651 (max-size: 0)
-
-#------------------------------------------------------------------------------
-
-lttng list 
-
-
-0
-
-
-  1) mysession () [inactive snapshot]
-
-
-#------------------------------------------------------------------------------
-
-lttng snapshot record  -s mysession
-
-
-0
-
-
-    Snapshot recorded successfully for session mysession
-
-#------------------------------------------------------------------------------
-
-lttng destroy mysession
-
-
-0
-
-
-Session mysession destroyed.
-
-
diff --git a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg b/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg
deleted file mode 100644
index 4329c6f5bc..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg
+++ /dev/null
@@ -1,240 +0,0 @@
-####################################################################
-# Copyright (c) 2012 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: 
-#    Bernd Hufmann - Initial API and implementation
-####################################################################
-####################################################################
-# Scenario: Test lttng list  with sample outputs 
-####################################################################
-
-ListInfoTest
-
-
-lttng version 
-
-
-0
-
-
-lttng version 2.1.0 - Basse Messe
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-lttng list 
-
-
-0
-
-
-Available tracing sessions:
-  1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
-  2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
-
- Use lttng list  for more details
-
-
-
-lttng list mysession
-
-
-0
-
-
-Tracing session mysession: [active]                                                                    
-    Trace path: /home/user/lttng-traces/mysession-20120129-084256
-
-=== Domain: Kernel ===
-
-Channels:
--------------
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 262144
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: splice()
-
-    Events:
-      block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
-      block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled]
-      myevent2 (type: probe) [enabled]
-        addr: 0xc0101340
-      myevent0 (type: probe) [enabled]
-        offset: 0x0
-        symbol: init_post
-      syscalls (type: syscall) [enabled]
-
-- channel1: [disabled]
-
-    Attributes:
-      overwrite mode: 1
-      subbufers size: 524288
-      number of subbufers: 4
-      switch timer interval: 100
-      read timer interval: 400
-      output: splice()
-
-    Events:
-      None
-
-=== Domain: UST global ===
-
-Channels:
--------------
-- mychannel1: [disabled]
-
-    Attributes:
-     overwrite mode: 1
-     subbufers size: 8192
-      number of subbufers: 8
-      switch timer interval: 200
-      read timer interval: 100
-      output: mmap()
-
-    Events:
-      None
-
-- channel0: [enabled]
-
-    Attributes:
-      overwrite mode: 0
-      subbufers size: 4096
-      number of subbufers: 4
-      switch timer interval: 0
-      read timer interval: 200
-      output: mmap()
-
-    Events:
-      ust_tests_hello:tptest_sighandler (loglevel == TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled] [with filter]
-      ust_tests_hello:tptest_sighandler1 (loglevel <= TRACE_INFO (7)) (type: tracepoint) [disabled] [with filter]
-      ust_tests_hello:tptest_sighandler2 (loglevel: TRACE_DEBUG_SYSTEM (8)) (type: tracepoint) [disabled] [with filter]
-      * (type: tracepoint) [enabled]
-
-
-
-lttng list mysession1
-
-
-0
-
-
-Tracing session mysession1: [inactive]
-    Trace path: /home/user/lttng-traces/mysession1-20120203-133225
-
-
-
-
-lttng list -k
-
-
-0
-
-
-Kernel events
--------------
-      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
-
-
-
-
-lttng list -u -f 
-
-
-0
-
-
-UST events:
--------------
-
-PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
-        field: doublefield (float)
-        field: floatfield (float)
-        field: stringfield (string)
-
-PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
-        field: doublefield (float)
-        field: floatfield (float)
-        field: stringfield (string)
-
-
-
-
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel and no session daemon 
-####################################################################
-
-ListInfoTestNoKernel
-
-
-lttng version 
-
-
-0
-
-
-lttng version 2.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-
-
-
-lttng list 
-
-
-0
-
-
-Currently no available tracing session
-
-
-
-lttng list -k
-
-
-1
-
-
-
-Error: Unable to list kernel events
-
-
-
-
-lttng list -u
-
-
-0
-
-
-UST events:
--------------
-
-PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
-    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
-    ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
-
-
-
-
-
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/.classpath b/org.eclipse.linuxtools.lttng2.control.ui/.classpath
deleted file mode 100644
index 098194ca4b..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-	
-	
-	
-	
-
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/.project b/org.eclipse.linuxtools.lttng2.control.ui/.project
deleted file mode 100644
index 6234036160..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-	org.eclipse.linuxtools.lttng2.control.ui
-	
-	
-	
-	
-		
-			org.eclipse.jdt.core.javabuilder
-			
-			
-		
-		
-			org.eclipse.pde.ManifestBuilder
-			
-			
-		
-		
-			org.eclipse.pde.SchemaBuilder
-			
-			
-		
-		
-			org.eclipse.pde.api.tools.apiAnalysisBuilder
-			
-			
-		
-	
-	
-		org.eclipse.pde.PluginNature
-		org.eclipse.jdt.core.javanature
-		org.eclipse.pde.api.tools.apiAnalysisNature
-	
-
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 99f26c0203..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-encoding/=UTF-8
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 5a0ad22d2a..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.core.runtime.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-line.separator=\n
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 9f3662cd78..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,394 +0,0 @@
-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.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
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 4fd0c7006a..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,56 +0,0 @@
-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
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.pde.api.tools.prefs
deleted file mode 100644
index acc3abd47c..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.pde.api.tools.prefs
+++ /dev/null
@@ -1,97 +0,0 @@
-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
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index d92b94fd4b..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,32 +0,0 @@
-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
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.control.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index cbfd1d7bb4..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,44 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 3.1.0.qualifier
-Bundle-Localization: plugin
-Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.control.ui;singleton:=true
-Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.control.ui.Activator
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Require-Bundle: org.eclipse.ui,
- org.eclipse.ui.ide,
- org.eclipse.core.expressions,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.linuxtools.lttng2.control.core;bundle-version="3.1.0",
- org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0",
- org.eclipse.linuxtools.tmf.ui;bundle-version="3.1.0",
- org.eclipse.linuxtools.tmf.ctf.core,
- org.eclipse.tracecompass.ctf.core
-Export-Package: org.eclipse.linuxtools.internal.lttng2.control.ui;x-friends:="org.eclipse.linuxtools.lttng2.control.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.control.ui.relayd;x-internal:=true,
- org.eclipse.linuxtools.internal.lttng2.control.ui.views;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui,org.eclipse.linuxtools.lttng2.control.ui.tests,org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests",
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs;x-friends:="org.eclipse.linuxtools.lttng2.control.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers;x-internal:=true,
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging;x-friends:="org.eclipse.linuxtools.lttng2.control.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages;x-internal:=true,
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.model;x-friends:="org.eclipse.linuxtools.lttng2.control.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl;x-friends:="org.eclipse.linuxtools.lttng2.control.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences;x-friends:="org.eclipse.linuxtools.lttng2.control.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.property;x-friends:="org.eclipse.linuxtools.lttng2.control.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote;x-friends:="org.eclipse.linuxtools.lttng2.control.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.control.ui.views.service;x-friends:="org.eclipse.linuxtools.lttng2.control.ui.tests"
-Import-Package: com.google.common.collect,
- org.eclipse.rse.core,
- org.eclipse.rse.core.model,
- org.eclipse.rse.core.subsystems,
- org.eclipse.rse.services,
- org.eclipse.rse.services.clientserver.messages,
- org.eclipse.rse.services.files,
- org.eclipse.rse.services.shells,
- org.eclipse.rse.services.terminals,
- org.eclipse.rse.subsystems.files.core.servicesubsystem,
- org.eclipse.rse.subsystems.files.core.subsystems
diff --git a/org.eclipse.linuxtools.lttng2.control.ui/about.html b/org.eclipse.linuxtools.lttng2.control.ui/about.html
deleted file mode 100644
index c258ef55d8..0000000000
--- a/org.eclipse.linuxtools.lttng2.control.ui/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-About
-
-
-

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/build.properties b/org.eclipse.linuxtools.lttng2.control.ui/build.properties deleted file mode 100644 index 94af68f058..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# 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 diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/add-context.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/add-context.gif deleted file mode 100644 index 030eade39b..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/add-context.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/add_button.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/add_button.gif deleted file mode 100644 index 252d7ebcb8..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/add_button.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/calibrate.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/calibrate.gif deleted file mode 100644 index c984fba703..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/calibrate.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/connect.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/connect.gif deleted file mode 100644 index 866ad33825..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/connect.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/delete_trace.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/delete_trace.gif deleted file mode 100644 index b6922ac11c..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/delete_trace.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/disable.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/disable.gif deleted file mode 100644 index f6b9f8a590..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/disable.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/disable_event.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/disable_event.gif deleted file mode 100644 index 2966a28163..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/disable_event.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/disconnect.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/disconnect.gif deleted file mode 100644 index ec8a8b01e4..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/disconnect.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/edit.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/edit.gif deleted file mode 100644 index feb8e94a74..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/edit.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/enable.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/enable.gif deleted file mode 100644 index 9cacb96dca..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/enable.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/enable_event.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/enable_event.gif deleted file mode 100644 index 06d007905b..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/enable_event.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/import_trace.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/import_trace.gif deleted file mode 100644 index d38085ad9c..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/import_trace.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/pause_trace.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/pause_trace.gif deleted file mode 100644 index 161e3f594f..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/pause_trace.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/refresh.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/refresh.gif deleted file mode 100644 index 3ca04d06ff..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/refresh.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/snapshot.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/snapshot.gif deleted file mode 100644 index 176830af2d..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/snapshot.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/start_trace.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/start_trace.gif deleted file mode 100644 index d6b3bdcc37..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/start_trace.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/stop_trace.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/stop_trace.gif deleted file mode 100644 index dc47edf069..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/stop_trace.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/target_add.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/target_add.gif deleted file mode 100644 index 114b964325..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/target_add.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/target_delete.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/target_delete.gif deleted file mode 100644 index b853d62333..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/elcl16/target_delete.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/eview16/control_view.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/eview16/control_view.gif deleted file mode 100644 index 0dc862cbd7..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/eview16/control_view.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/channel.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/channel.gif deleted file mode 100644 index e8efe69dc3..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/channel.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/channel_disabled.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/channel_disabled.gif deleted file mode 100644 index 413c1b953e..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/channel_disabled.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/domain.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/domain.gif deleted file mode 100644 index c4a8af4184..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/domain.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/event_disabled.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/event_disabled.gif deleted file mode 100644 index 2966a28163..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/event_disabled.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/event_enabled.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/event_enabled.gif deleted file mode 100644 index 11d3d8da1e..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/event_enabled.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/garland16.png b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/garland16.png deleted file mode 100644 index 74f9751638..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/garland16.png and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/providers.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/providers.gif deleted file mode 100644 index 885b8a69e3..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/providers.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/session_active.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/session_active.gif deleted file mode 100644 index 57a42bca84..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/session_active.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/session_destroyed.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/session_destroyed.gif deleted file mode 100644 index b0adbc3231..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/session_destroyed.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/session_inactive.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/session_inactive.gif deleted file mode 100644 index b6774cb0ef..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/session_inactive.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/sessions.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/sessions.gif deleted file mode 100644 index c69588429f..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/sessions.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/systemlttng2-live.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/systemlttng2-live.gif deleted file mode 100755 index 57c522db6c..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/systemlttng2-live.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/systemlttng2.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/systemlttng2.gif deleted file mode 100755 index fd7b3117f2..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/systemlttng2.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/target_connected.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/target_connected.gif deleted file mode 100644 index def312aa12..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/target_connected.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/target_disconnected.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/target_disconnected.gif deleted file mode 100644 index 2104ab4545..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/target_disconnected.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/targets.gif b/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/targets.gif deleted file mode 100644 index c1e4ee3a59..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.control.ui/icons/obj16/targets.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.control.ui/plugin.properties b/org.eclipse.linuxtools.lttng2.control.ui/plugin.properties deleted file mode 100644 index 81a564ee79..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/plugin.properties +++ /dev/null @@ -1,143 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.control.ui -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Control UI Plug-in - -views.category.name = LTTng -control.view.name = Control -events.view.name = Events -timeframe.view.name = Time Frame -controlflow.view.name = Control Flow -resources.view.name = Resources -statistics.view.name = Statistics -histogram.view.name = Histogram -latency.view.name = Latency View - -project.new.category.name = LTTng -project.new.wizard.name = LTTng Project -project.new.wizard.description = Create a new LTTng project - -project.propertyPage.tracelibPath = LTTng Trace Library Path -action.set.label = LTTng Action Set -action.set.description = LTTng Action Set - -tracetype.category.lttng= LTTng -tracetype.type.kernel = Kernel Trace - -#Commands and Menus -commands.trace.category.name = LTTng Trace Commands -commands.trace.category.description = LTTng Trace Commands -commands.trace.import = Import Trace -commands.trace.import.description = Import an LTTng Trace -commands.trace.open = Open Trace -commands.trace.open.description = Open an LTTng Trace -commands.trace.rename = Rename Trace -commands.trace.rename.description = Rename an LTTng Trace -commands.trace.delete = Delete Trace -commands.trace.delete.description = Delete an LTTng Trace -commands.trace.selectparser = Select Parser - -commands.experiment.category.name = LTTng Experiment Commands -commands.experiment.category.description = LTTng Experiment Commands -commands.experiment.new = New Experiment -commands.experiment.new.description = Create a new LTTng Experiment -commands.experiment.selecttraces = Select Traces -commands.experiment.selecttraces.description = Select LTTng Traces -commands.experiment.open = Open Experiment -commands.experiment.open.description = Open an LTTng Experiment -commands.experiment.rename = Rename Experiment -commands.experiment.rename.description = Rename an LTTng Experiment -commands.experiment.delete = Delete Experiment -commands.experiment.delete.description = Delete an LTTng Experiment - -# LTTng 2.0 trace control commands -trace.control.rse.system.type.name=LTTng (v2.0) -trace.control.rse.system.type.description=LTTng Trace Control (v2.0) - -commands.control.category=LTTng Trace Control Commands -commands.control.category.description=LTTng Trace Control Commands - -commands.control.new=New Connection... -commands.control.new.description=New Connection to Target Node - -commands.control.connect=Connect -commands.control.connect.description=Connect to Target Node - -commands.control.disconnect=Disconnect -commands.control.disconnect.description=Disconnect to Target Node - -commands.control.refresh=Refresh -commands.control.refresh.description=Refresh Node Configuration - -commands.control.delete=Delete -commands.control.delete.description=Delete Target Node - -commands.control.create.session=Create Session... -commands.control.create.session.description=Create a Trace Session - -commands.control.execute.command.script=Execute Command Script... -commands.control.execute.command.script.description=Execute Command Script - -commands.control.destroy.session=Destroy Session... -commands.control.destroy.session.description=Destroy a Trace Session - -commands.control.enable.channelOnSession=Enable Channel... -commands.control.enable.channelOnSession.description=Enable a Trace Channel - -commands.control.enable.channelOnDomain=Enable Channel... -commands.control.enable.channelOnDomain.description=Enable a Trace Channel - -commands.control.enable.channel=Enable Channel -commands.control.enable.channel.description=Enable a Trace Channel - -commands.control.disable.channel=Disable Channel -commands.control.disable.channel.description=Disable a Trace Channel - -commands.control.start=Start -commands.control.start.description=Start Trace Session - -commands.control.stop=Stop -commands.control.stop.description=Stop Trace Session - -commands.control.assign.event=Enable Event... -commands.control.assign.event.description=Assign Event to Session and Channel and Enable Event - -commands.control.enable.event=Enable Event -commands.control.enable.event.description=Enable Event - -commands.control.enable.eventOnChannel=Enable Event... -commands.control.enable.eventOnChannel.description=Enable Event - -commands.control.enable.eventOnDomain=Enable Event (default channel)... -commands.control.enable.eventOnDomain.description=Enable Event on Default Channel - -commands.control.enable.eventOnSession=Enable Event (default channel)... -commands.control.enable.eventOnSession.description=Enable Event on Default Channel - -commands.control.disable.event=Disable Event -commands.control.disable.event.description=Disable Event - -commands.control.add.context=Add Context... -commands.control.add.context.description=Add Context to Channel(s) and/or Event(s) - -commands.control.import=Import... -commands.control.import.description=Import Traces to LTTng Project - -commands.control.calibrate=Calibrate -commands.control.calibrate.description=Quantify LTTng overhead - -commands.control.snapshot=Record Snapshot -commands.control.snapshot.description=Record a snapshot - -preference.page.control.name=LTTng Tracer Control Preferences diff --git a/org.eclipse.linuxtools.lttng2.control.ui/plugin.xml b/org.eclipse.linuxtools.lttng2.control.ui/plugin.xml deleted file mode 100644 index 9240836ca5..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/plugin.xml +++ /dev/null @@ -1,1277 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.control.ui/pom.xml b/org.eclipse.linuxtools.lttng2.control.ui/pom.xml deleted file mode 100644 index 8454fa59ae..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.control.ui - 3.1.0-SNAPSHOT - eclipse-plugin - - Linux Tools LTTng Control UI Plug-in - - - - - org.eclipse.tycho - tycho-source-plugin - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/Activator.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/Activator.java deleted file mode 100644 index 6d09b6bc16..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/Activator.java +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.control.ui; - -import java.net.URL; - -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.linuxtools.internal.lttng2.control.ui.relayd.LttngRelaydConnectionManager; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; -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.linuxtools.lttng2.control.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; - ControlPreferences.getInstance().init(getPreferenceStore()); - // This registers the connection manager with the signal manager - LttngRelaydConnectionManager.getInstance(); - } - - @Override - public void stop(BundleContext context) throws Exception { - ControlPreferences.getInstance().dispose(); - LttngRelaydConnectionManager.getInstance().dispose(); - plugin = null; - super.stop(context); - } - - @Override - protected void initializeImageRegistry(ImageRegistry reg) { - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Gets an image object using given path within plug-in. - * - * @param path path to image file - * - * @return image object - */ - public Image getImageFromPath(String path) { - return getImageDescripterFromPath(path).createImage(); - } - - /** - * Gets an image descriptor using given path within plug-in. - * - * @param path path to image file - * - * @return image descriptor object - */ - public ImageDescriptor getImageDescripterFromPath(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); - } - - /** - * Gets a image object from the image registry based on the given path. - * If the image is not in the registry it will be registered. - * - * @param path to the image file - * @return 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; - } - - /** - * Loads the image in the plug-ins image registry (if necessary) and returns the image - * @param url - URL relative to the Bundle - * @return the image - */ - public Image loadIcon(String url) { - String key = plugin.getBundle().getSymbolicName() + "/" + url; //$NON-NLS-1$ - Image icon = plugin.getImageRegistry().get(key); - if (icon == null) { - URL imageURL = plugin.getBundle().getResource(url); - ImageDescriptor descriptor = ImageDescriptor.createFromURL(imageURL); - icon = descriptor.createImage(); - plugin.getImageRegistry().put(key, 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)); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionInfo.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionInfo.java deleted file mode 100644 index 456dba31e8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionInfo.java +++ /dev/null @@ -1,111 +0,0 @@ -/********************************************************************** - * 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: - * Marc-Andre Laperle - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.relayd; - -/** - * A class that holds information about the relayd connection. - * - * @author Marc-Andre Laperle - * @since 3.1 - */ -public final class LttngRelaydConnectionInfo { - - private final String fHost; - private final int fPort; - private final String fSessionName; - - /** - * Constructs a connection information. - * - * @param host - * the host string - * @param port - * the port number - * @param sessionName - * the session name - */ - public LttngRelaydConnectionInfo(String host, int port, String sessionName) { - fHost = host; - fPort = port; - fSessionName = sessionName; - } - - /** - * Get the host string. - * - * @return the host string - */ - public String getHost() { - return fHost; - } - - /** - * Get the port number. - * - * @return the port number - */ - public int getPort() { - return fPort; - } - - /** - * Get the session name. - * - * @return the session name - */ - public String getSessionName() { - return fSessionName; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((fHost == null) ? 0 : fHost.hashCode()); - result = prime * result + fPort; - result = prime * result + ((fSessionName == null) ? 0 : fSessionName.hashCode()); - return result; - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - LttngRelaydConnectionInfo other = (LttngRelaydConnectionInfo) obj; - if (fHost == null) { - if (other.fHost != null) { - return false; - } - } else if (!fHost.equals(other.fHost)) { - return false; - } - if (fPort != other.fPort) { - return false; - } - if (fSessionName == null) { - if (other.fSessionName != null) { - return false; - } - } else if (!fSessionName.equals(other.fSessionName)) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionManager.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionManager.java deleted file mode 100644 index b71ffa7198..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionManager.java +++ /dev/null @@ -1,149 +0,0 @@ -/********************************************************************** - * 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: - * Marc-Andre Laperle - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.relayd; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler; -import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager; -import org.eclipse.linuxtools.tmf.core.signal.TmfTraceClosedSignal; -import org.eclipse.linuxtools.tmf.core.signal.TmfTraceOpenedSignal; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.CtfConstants; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.eclipse.ui.PlatformUI; - -/** - * Manages relayd connections. When a trace is opened, it creates a connection - * if the trace was started with live support. When a trace is closed, is closes - * the connection. - * - * @author Marc-Andre Laperle - * @since 3.1 - */ -public final class LttngRelaydConnectionManager { - private static LttngRelaydConnectionManager fConnectionManager; - private Map fConnections = new HashMap<>(); - - /** - * Get an instance of the trace manager. - * - * @return The trace manager - */ - public static synchronized LttngRelaydConnectionManager getInstance() { - if (fConnectionManager == null) { - fConnectionManager = new LttngRelaydConnectionManager(); - TmfSignalManager.register(fConnectionManager); - } - return fConnectionManager; - } - - /** - * Get the cosumer for the given relayd connection information. - * - * @param connectionInfo - * the connection information - * - * @return the consumer - */ - public LttngRelaydConsumer getConsumer(final LttngRelaydConnectionInfo connectionInfo) { - if (!fConnections.containsKey(connectionInfo)) { - LttngRelaydConsumer lttngRelaydConsumer = new LttngRelaydConsumer(connectionInfo); - fConnections.put(connectionInfo, lttngRelaydConsumer); - return lttngRelaydConsumer; - } - - return fConnections.get(connectionInfo); - } - - private static LttngRelaydConnectionInfo getEntry(final ITmfTrace trace) throws CoreException { - if (trace instanceof CtfTmfTrace) { - CtfTmfTrace ctfTmfTrace = (CtfTmfTrace) trace; - if (!ctfTmfTrace.isComplete()) { - IResource resource = ctfTmfTrace.getResource(); - String host = resource.getPersistentProperty(CtfConstants.LIVE_HOST); - String port = resource.getPersistentProperty(CtfConstants.LIVE_PORT); - String sessionName = resource.getPersistentProperty(CtfConstants.LIVE_SESSION_NAME); - if (host != null && port != null && sessionName != null && !sessionName.isEmpty()) { - LttngRelaydConnectionInfo entry = new LttngRelaydConnectionInfo(host, Integer.parseInt(port), sessionName); - return entry; - } - } - } - - return null; - } - - /** - * Listen to trace opened so that we can start the relayd job if necessary. - * - * @param signal - * the signal to be processed - */ - @TmfSignalHandler - public void traceOpened(final TmfTraceOpenedSignal signal) { - - try { - LttngRelaydConnectionInfo entry = getEntry(signal.getTrace()); - if (entry != null) { - LttngRelaydConsumer consumer = getConsumer(entry); - consumer.connect(); - consumer.run((CtfTmfTrace) signal.getTrace()); - } - } catch (CoreException e) { - Activator.getDefault().logError(Messages.LttngRelaydConnectionManager_ConnectionError, e); - ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, Messages.LttngRelaydConnectionManager_ConnectionError, new Status(IStatus.WARNING, - Activator.PLUGIN_ID, e.getLocalizedMessage(), e)); - } - } - - /** - * Listen to trace closed so that we can stop the relayd job. - * - * @param signal - * the signal to be processed - */ - @TmfSignalHandler - public void traceClosed(final TmfTraceClosedSignal signal) { - LttngRelaydConnectionInfo entry; - try { - entry = getEntry(signal.getTrace()); - if (entry != null) { - LttngRelaydConsumer comsumer = getConsumer(entry); - if (comsumer != null) { - comsumer.dispose(); - } - fConnections.remove(entry); - } - } catch (CoreException e) { - // Something went wrong with the resource. That's OK, the trace is - // getting closed anyway. - } - } - - /** - * Dispose of all the manager's resources (i.e. its connections). - */ - public void dispose() { - for (LttngRelaydConsumer consumer : fConnections.values()) { - consumer.dispose(); - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConsumer.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConsumer.java deleted file mode 100644 index 47a8e2d8aa..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConsumer.java +++ /dev/null @@ -1,255 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.relayd; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.Socket; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.linuxtools.ctf.core.trace.CTFTrace; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.ILttngRelaydConnector; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.LttngRelaydConnectorFactory; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachReturnCode; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionReturnCode; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.NextIndexReturnCode; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; -import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.tmf.core.signal.TmfTraceRangeUpdatedSignal; -import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTimestamp; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; - -/** - * Consumer of the relay d. - * - * @author Matthew Khouzam - * @since 3.1 - */ -public final class LttngRelaydConsumer { - - private static final int SIGNAL_THROTTLE_NANOSEC = 10_000_000; - private static final String ENCODING_UTF_8 = "UTF-8"; //$NON-NLS-1$ - - private Job fConsumerJob; - private CtfTmfTrace fCtfTmfTrace; - private CTFTrace fCtfTrace; - private long fTimestampEnd; - private AttachSessionResponse fSession; - private Socket fConnection; - private ILttngRelaydConnector fRelayd; - private String fTracePath; - private long fLastSignal = 0; - private final LttngRelaydConnectionInfo fConnectionInfo; - - /** - * Start a lttng consumer. - * - * @param address - * the ip address in string format - * @param port - * the port, an integer - * @param sessionName - * the session name - * @param project - * the default project - */ - LttngRelaydConsumer(final LttngRelaydConnectionInfo connectionInfo) { - fConnectionInfo = connectionInfo; - fTimestampEnd = 0; - } - - /** - * Connects to the relayd at the given address and port then attaches to the - * given session name. - * - * @throws CoreException - * If something goes wrong during the connection - *
    - *
  • - * Connection could not be established (Socket could not be - * opened, etc)
  • - *
  • - * Connection timeout
  • - *
  • - * The session was not found
  • - *
  • - * Could not create viewer session
  • - *
  • - * Invalid trace (no metadata, no streams)
  • - *
- */ - public void connect() throws CoreException { - if (fConnection != null) { - return; - } - - try { - fConnection = new Socket(fConnectionInfo.getHost(), fConnectionInfo.getPort()); - fRelayd = LttngRelaydConnectorFactory.getNewConnector(fConnection); - List sessions = fRelayd.getSessions(); - SessionResponse selectedSession = null; - for (SessionResponse session : sessions) { - String asessionName = nullTerminatedByteArrayToString(session.getSessionName().getBytes()); - - if (asessionName.equals(fConnectionInfo.getSessionName())) { - selectedSession = session; - break; - } - } - - if (selectedSession == null) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_SessionNotFound)); - } - - CreateSessionResponse createSession = fRelayd.createSession(); - if (createSession.getStatus() != CreateSessionReturnCode.LTTNG_VIEWER_CREATE_SESSION_OK) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_CreateViewerSessionError + createSession.getStatus().toString())); - } - - AttachSessionResponse attachedSession = fRelayd.attachToSession(selectedSession); - if (attachedSession.getStatus() != AttachReturnCode.VIEWER_ATTACH_OK) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_AttachSessionError + attachedSession.getStatus().toString())); - } - - String metadata = fRelayd.getMetadata(attachedSession); - if (metadata == null) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_NoMetadata)); - } - - List attachedStreams = attachedSession.getStreamList(); - if (attachedStreams.isEmpty()) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_NoStreams)); - } - - fTracePath = nullTerminatedByteArrayToString(attachedStreams.get(0).getPathName().getBytes()); - - fSession = attachedSession; - } catch (IOException e) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_ErrorConnecting + (e.getMessage() != null ? e.getMessage() : ""))); //$NON-NLS-1$ - } - } - - /** - * Run the consumer operation for a give trace. - * - * @param trace - * the trace - */ - public void run(final CtfTmfTrace trace) { - if (fSession == null) { - return; - } - - fCtfTmfTrace = trace; - fCtfTrace = trace.getCTFTrace(); - fConsumerJob = new Job("RelayD consumer") { //$NON-NLS-1$ - - @Override - protected IStatus run(final IProgressMonitor monitor) { - try { - while (!monitor.isCanceled()) { - List attachedStreams = fSession.getStreamList(); - for (StreamResponse stream : attachedStreams) { - if (stream.getMetadataFlag() != 1) { - IndexResponse indexReply = fRelayd.getNextIndex(stream); - if (indexReply.getStatus() == NextIndexReturnCode.VIEWER_INDEX_OK) { - long nanoTimeStamp = fCtfTrace.timestampCyclesToNanos(indexReply.getTimestampEnd()); - if (nanoTimeStamp > fTimestampEnd) { - CtfTmfTimestamp endTime = new CtfTmfTimestamp(nanoTimeStamp); - TmfTimeRange range = new TmfTimeRange(fCtfTmfTrace.getStartTime(), endTime); - - long currentTime = System.nanoTime(); - if (currentTime - fLastSignal > SIGNAL_THROTTLE_NANOSEC) { - TmfTraceRangeUpdatedSignal signal = new TmfTraceRangeUpdatedSignal(LttngRelaydConsumer.this, fCtfTmfTrace, range); - fCtfTmfTrace.broadcastAsync(signal); - fLastSignal = currentTime; - } - fTimestampEnd = nanoTimeStamp; - } - } else if (indexReply.getStatus() == NextIndexReturnCode.VIEWER_INDEX_HUP) { - // The trace is now complete because the trace session was destroyed - fCtfTmfTrace.setComplete(true); - TmfTraceRangeUpdatedSignal signal = new TmfTraceRangeUpdatedSignal(LttngRelaydConsumer.this, fCtfTmfTrace, new TmfTimeRange(fCtfTmfTrace.getStartTime(), new CtfTmfTimestamp(fTimestampEnd))); - fCtfTmfTrace.broadcastAsync(signal); - return Status.OK_STATUS; - } - } - } - } - } catch (IOException e) { - Activator.getDefault().logError("Error during live trace reading", e); //$NON-NLS-1$ - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_ErrorLiveReading + (e.getMessage() != null ? e.getMessage() : "")); //$NON-NLS-1$ - } - - return Status.OK_STATUS; - } - }; - fConsumerJob.setSystem(true); - fConsumerJob.schedule(); - } - - /** - * Dispose the consumer and it's resources (sockets, etc). - */ - public void dispose() { - try { - if (fConsumerJob != null) { - fConsumerJob.cancel(); - fConsumerJob.join(); - } - if (fConnection != null) { - fConnection.close(); - } - if (fRelayd != null) { - fRelayd.close(); - } - } catch (IOException e) { - // Ignore - } catch (InterruptedException e) { - // Ignore - } - } - - /** - * Once the consumer is connected to the relayd session, it knows the trace - * path. This can be useful to know exactly where the trace is so that it - * can be imported into the workspace and it can be opened. - * - * @return the trace path - */ - public String getTracePath() { - return fTracePath; - } - - private static String nullTerminatedByteArrayToString(final byte[] byteArray) throws UnsupportedEncodingException { - // Find length of null terminated string - int length = 0; - while (length < byteArray.length && byteArray[length] != 0) { - length++; - } - - String asessionName = new String(byteArray, 0, length, ENCODING_UTF_8); - return asessionName; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/Messages.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/Messages.java deleted file mode 100644 index 81e611a742..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/Messages.java +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************************************** - * 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: - * Marc-Andre Laperle - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.relayd; - -import org.eclipse.osgi.util.NLS; - -/** - * Messages for the relayd connection. - * - * @author Marc-Andre Laperle - */ -public final class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.messages"; //$NON-NLS-1$ - - /** - * Error occurred establishing the connection. - */ - public static String LttngRelaydConnectionManager_ConnectionError; - - /** - * Error occurred attaching to the session. - */ - public static String LttngRelaydConsumer_AttachSessionError; - - /** - * Error occurred creating the viewer session. - */ - public static String LttngRelaydConsumer_CreateViewerSessionError; - - /** - * Error occurred connecting to the relayd. - */ - public static String LttngRelaydConsumer_ErrorConnecting; - - /** - * Error (generic) during live reading. - */ - public static String LttngRelaydConsumer_ErrorLiveReading; - - /** - * No metadata for this trace session. - */ - public static String LttngRelaydConsumer_NoMetadata; - - /** - * No streams for this trace session. - */ - public static String LttngRelaydConsumer_NoStreams; - - /** - * The session was not found by the relayd. - */ - public static String LttngRelaydConsumer_SessionNotFound; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/messages.properties b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/messages.properties deleted file mode 100644 index e76b1d2b96..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/messages.properties +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# 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: -# Marc-Andre Laperle - initial API and implementation -############################################################################### - -LttngRelaydConnectionManager_ConnectionError=The connection to the relayd could not be established. The trace cannot be opened in Live mode. -LttngRelaydConsumer_AttachSessionError=Error, could not attach to session, error code: -LttngRelaydConsumer_CreateViewerSessionError=Error, could not create viewer session, error code: -LttngRelaydConsumer_ErrorConnecting=Error connecting to live trace session. -LttngRelaydConsumer_ErrorLiveReading=Error during live trace reading. -LttngRelaydConsumer_NoMetadata=Error, trace has no metadata. -LttngRelaydConsumer_NoStreams=Error, has no streams. -LttngRelaydConsumer_SessionNotFound=Error, live session not found diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/ControlView.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/ControlView.java deleted file mode 100644 index 64f3edd94a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/ControlView.java +++ /dev/null @@ -1,194 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 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 - * Bernd Hufmann - Filled with content - *******************************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponentChangedListener; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlContentProvider; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlLabelProvider; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlRoot; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.ui.part.ViewPart; -import org.eclipse.ui.progress.UIJob; - -/** - *

- * View implementation for Trace Control. - *

- * - * @author Bernd Hufmann - */ -public class ControlView extends ViewPart implements ITraceControlComponentChangedListener { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * View ID. - */ - public static final String ID = "org.eclipse.linuxtools.internal.lttng2.ui.views.control"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The tree viewer. - */ - private TreeViewer fTreeViewer = null; - - /** - * The trace control root node. This provides access to the whole model. - */ - private ITraceControlComponent fRoot = null; - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * Returns the trace control tree node (model) - * - * @return the trace control tree node (model). - */ - public ITraceControlComponent getTraceControlRoot() { - return fRoot; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void createPartControl(Composite parent) { - // Create tree viewer - fTreeViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - ColumnViewerToolTipSupport.enableFor(fTreeViewer); - - fTreeViewer.setContentProvider(new TraceControlContentProvider()); - fTreeViewer.setLabelProvider(new TraceControlLabelProvider()); - - // Create model root - fRoot = new TraceControlRoot(); - fRoot.addComponentListener(this); - fTreeViewer.setInput(fRoot); - - // Create context menu for the tree viewer - createContextMenu(); - - getSite().setSelectionProvider(fTreeViewer); - - RSECorePlugin.getTheSystemRegistry(); // to load RSE - } - - @Override - public void setFocus() { - fTreeViewer.getControl().setFocus(); - } - - @Override - public void componentAdded(ITraceControlComponent parent, ITraceControlComponent component) { - componentChanged(parent); - } - - @Override - public void componentRemoved(ITraceControlComponent parent, ITraceControlComponent component) { - componentChanged(parent); - } - - @Override - public void componentChanged(final ITraceControlComponent component) { - if (fTreeViewer.getTree().isDisposed()) { - return; - } - - UIJob myJob = new UIJob("Refresh") { //$NON-NLS-1$ - @Override - public IStatus runInUIThread(IProgressMonitor monitor) { - if (fTreeViewer.getTree().isDisposed()) { - return Status.OK_STATUS; - } - - fTreeViewer.refresh(component); - - // Change selection needed - final ISelection sel = fTreeViewer.getSelection(); - fTreeViewer.setSelection(null); - fTreeViewer.setSelection(sel); - - // Show component that was changed - fTreeViewer.reveal(component); - - return Status.OK_STATUS; - } - }; - myJob.setUser(false); - myJob.setSystem(true); - myJob.schedule(); - } - - /** - * Sets the selected component in the tree - * @param component - component to select - */ - public void setSelection(ITraceControlComponent component) { - ITraceControlComponent[] components = new ITraceControlComponent[1]; - components[0] = component; - setSelection(components); - } - - /** - * Sets the selected components in the tree - * @param components - array of components to select - */ - public void setSelection(ITraceControlComponent[] components) { - final StructuredSelection selection = new StructuredSelection(components); - UIJob myJob = new UIJob("Select") { //$NON-NLS-1$ - @Override - public IStatus runInUIThread(IProgressMonitor monitor) { - fTreeViewer.setSelection(selection); - return Status.OK_STATUS; - } - }; - myJob.setUser(false); - myJob.schedule(); - } - - // ------------------------------------------------------------------------ - // Helper methods - // ------------------------------------------------------------------------ - /** - * Creates the context sensitive menu. - */ - private void createContextMenu() { - // First we create a menu Manager - final MenuManager menuManager = new MenuManager(); - final Menu menu = menuManager.createContextMenu(fTreeViewer.getTree()); - // Set the MenuManager - fTreeViewer.getTree().setMenu(menu); - getSite().registerContextMenu(menuManager, fTreeViewer); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/AddContextDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/AddContextDialog.java deleted file mode 100644 index d2a0018141..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/AddContextDialog.java +++ /dev/null @@ -1,420 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTreeViewer; -import org.eclipse.jface.viewers.ColumnLabelProvider; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Shell; - -/** - *

- * Dialog box for collecting information about contexts to be added to channels/events. - *

- * - * @author Bernd Hufmann - */ -public class AddContextDialog extends Dialog implements IAddContextDialog { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * The icon file for this dialog box. - */ - public static final String ADD_CONTEXT_ICON_FILE = "icons/elcl16/add-context.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * A tree viewer for displaying and selection of available contexts. - */ - private CheckboxTreeViewer fContextsViewer; - - /** - * A Tree model for the checkbox tree viewer. - */ - private final ContextModel fContextModel = new ContextModel(); - - /** - * The contexts to add. - */ - private final List fSelectedContexts = new ArrayList<>(); - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param shell - a shell for the display of the dialog - */ - public AddContextDialog(Shell shell) { - super(shell); - setShellStyle(SWT.RESIZE | getShellStyle()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public void setAvalibleContexts(List contexts) { - fContextModel.setAvalibleContexts(contexts); - } - - @Override - public List getContexts() { - List ret = new ArrayList<>(); - ret.addAll(fSelectedContexts); - return ret; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.TraceControl_AddContextDialogTitle); - newShell.setImage(Activator.getDefault().loadIcon(ADD_CONTEXT_ICON_FILE)); - } - - @Override - protected Control createDialogArea(Composite parent) { - - // Main dialog panel - Composite dialogComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - dialogComposite.setLayout(layout); - dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - // Contexts list - Group contextGroup = new Group(dialogComposite, SWT.SHADOW_NONE); - contextGroup.setText(Messages.TraceControl_AddContextAvailableContextsLabel); - layout = new GridLayout(1, true); - contextGroup.setLayout(layout); - contextGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); - - fContextsViewer = new CheckboxTreeViewer(contextGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - fContextsViewer.getTree().setToolTipText(Messages.TraceControl_AddContextAvailableContextsTooltip); - - fContextsViewer.setContentProvider(new ContextsContentProvider()); - fContextsViewer.setLabelProvider(new ContextsLabelProvider()); - fContextsViewer.addCheckStateListener(new ContextCheckListener()); - fContextsViewer.setInput(fContextModel); - fContextsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH)); - - getShell().setMinimumSize(new Point(500, 450)); - - return dialogComposite; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ - createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ - } - - @Override - protected void okPressed() { - fSelectedContexts.clear(); - - Object[] checkedElements = fContextsViewer.getCheckedElements(); - for (int i = 0; i < checkedElements.length; i++) { - IContextModelComponent component = (IContextModelComponent)checkedElements[i]; - if (!Messages.TraceControl_AddContextAllLabel.equals(component.getName())) { - fSelectedContexts.add(component.getName()); - } - } - - // validation successful -> call super.okPressed() - super.okPressed(); - } - - // ------------------------------------------------------------------------ - // Helper classes and methods - // ------------------------------------------------------------------------ - /** - * Content provider for the contexts tree - */ - public static final class ContextsContentProvider implements ITreeContentProvider { - - @Override - public void dispose() { - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - @Override - public Object[] getElements(Object inputElement) { - return getChildren(inputElement); - } - - @Override - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof IContextModelComponent) { - return ((IContextModelComponent)parentElement).getChildren(); - } - return null; - } - - @Override - public Object getParent(Object element) { - if (element instanceof IContextModelComponent) { - return ((IContextModelComponent)element).getParent(); - } - return null; - } - - @Override - public boolean hasChildren(Object element) { - if (element instanceof IContextModelComponent) { - return ((IContextModelComponent)element).hasChildren(); - } - return false; - } - } - - /** - * Label provider for the contexts tree - */ - public static final class ContextsLabelProvider extends ColumnLabelProvider { - @Override - public String getText(Object element) { - - if ((element != null) && (element instanceof IContextModelComponent)) { - return ((IContextModelComponent)element).getName(); - } - - return "";//$NON-NLS-1$ - } - } - - /** - * Check state listener for the contexts tree. - */ - public final class ContextCheckListener implements ICheckStateListener { - @Override - public void checkStateChanged(CheckStateChangedEvent event) { - if (event.getChecked()) { - if (event.getElement() instanceof AllContexts) { - fContextsViewer.setSubtreeChecked(event.getElement(), true); - } - } else { - if (event.getElement() instanceof AllContexts) { - fContextsViewer.setSubtreeChecked(event.getElement(), false); - } else { - IContextModelComponent component = (IContextModelComponent) event.getElement(); - fContextsViewer.setChecked(component.getParent(), false); - } - } - } - } - - /** - * Model for the context tree viewer (root component) - */ - public static class ContextModel implements IContextModelComponent { - - private final AllContexts fAllContexts; - - /** - * Constructor - */ - public ContextModel() { - fAllContexts = new AllContexts(this); - } - - /** - * Sets the available contexts - * - * @param contexts - * The contexts to set - */ - public void setAvalibleContexts(List contexts) { - fAllContexts.setAvalibleContexts(contexts); - } - - @Override - public String getName() { - return "root"; //$NON-NLS-1$ - } - - @Override - public Object getParent() { - return null; - } - - @Override - public Object[] getChildren() { - Object[] ret = new Object[1]; - ret[0] = fAllContexts; - return ret; - } - - @Override - public boolean hasChildren() { - return true; - } - } - - /** - * Model element (to select/deselect) all contexts) for the context tree viewer - */ - public static class AllContexts implements IContextModelComponent { - /** - * The available list of contexts. - */ - private List fAvailableContexts; - - private final IContextModelComponent fParent; - - /** - * Constructor - * - * @param parent - * The parent component - */ - public AllContexts(IContextModelComponent parent) { - fParent = parent; - } - - /** - * Sets the available contexts - * - * @param contexts - * The contexts to set - */ - public void setAvalibleContexts(List contexts) { - fAvailableContexts = new ArrayList<>(); - if (contexts != null) { - for (Iterator iterator = contexts.iterator(); iterator.hasNext();) { - String name = iterator.next(); - fAvailableContexts.add(new Context(this, name)); - } - } - } - - @Override - public String getName() { - return Messages.TraceControl_AddContextAllLabel; - } - - @Override - public Object[] getChildren() { - return fAvailableContexts.toArray(); - } - - @Override - public Object getParent() { - return fParent; - } - - @Override - public boolean hasChildren() { - return true; - } - } - - /** - * Model element (the context) for the context tree viewer - */ - public static class Context implements IContextModelComponent { - - private final String fContextName; - private final IContextModelComponent fParent; - - /** - * Constructor - * - * @param parent - * The parent component - * @param name - * The name of this context - */ - public Context(IContextModelComponent parent, String name) { - fParent = parent; - fContextName = name; - } - - @Override - public String getName() { - return fContextName; - } - - @Override - public Object getParent() { - return fParent; - } - - @Override - public Object[] getChildren() { - return null; - } - - @Override - public boolean hasChildren() { - return false; - } - } - - /** - * Interface for the tree model used for the context tree viewer. - */ - public interface IContextModelComponent { - - /** - * @return The name of this component - */ - String getName(); - - /** - * @return The parent component - */ - Object getParent(); - - /** - * @return The array of children of this component - */ - Object[] getChildren(); - - /** - * @return If this component has children or not - */ - boolean hasChildren(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ConfirmDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ConfirmDialog.java deleted file mode 100644 index 088a48ec89..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ConfirmDialog.java +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - - -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.swt.widgets.Shell; - -/** - *

- * Confirmation dialog implementation. - *

- * - * @author Bernd Hufmann - */ - -public class ConfirmDialog implements IConfirmDialog { - - @Override - public boolean openConfirm(Shell parent, String title, String message) { - return MessageDialog.openConfirm(parent, - Messages.TraceControl_DestroyConfirmationTitle, - Messages.TraceControl_DestroyConfirmationMessage); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/CreateSessionDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/CreateSessionDialog.java deleted file mode 100644 index 9453ce7637..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/CreateSessionDialog.java +++ /dev/null @@ -1,1048 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Marc-Andre Laperle - Support for creating a live session - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.TitleAreaDialog; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants; -import org.eclipse.rse.services.clientserver.messages.SystemMessageException; -import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; -import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.events.VerifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - *

- * Dialog box for collecting session creation information. - *

- * - * @author Bernd Hufmann - */ -public class CreateSessionDialog extends TitleAreaDialog implements ICreateSessionDialog { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The icon file for this dialog box. - */ - public static final String CREATE_SESSION_ICON_FILE = "icons/elcl16/add_button.gif"; //$NON-NLS-1$ - - /** - * To indicate that the default value will be used for this field - */ - private static final String DEFAULT_TEXT = "<" + Messages.EnableChannelDialog_DefaultMessage + ">"; //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The default port for the connection to Relayd. This actual value is - * needed because this is not an optional argument to a command; this is - * what is used to connect directly to Relayd from Java through a socket. - * There is also currently no way to know the default value by issuing a - * command. - */ - private static final int DEFAULT_LIVE_PORT = 5344; - - /** - * The default address for the connection to Relayd. Only local is supported - * for now. See above comment for why it's needed. - */ - private static final String DEFAULT_LIVE_URL = "127.0.0.1"; //$NON-NLS-1$ - - /** - * Supported network protocols for streaming - */ - private enum StreamingProtocol { - /** Default network protocol for IPv4 (TCP)*/ - net, - /** Default network protocol for IPv6 (TCP)*/ - net6, - /** File */ - file, - } - - /** - * Supported network protocols for Live tracing - */ - private enum LiveProtocol { - /** Default network protocol for IPv4 (TCP)*/ - net, - /** Default network protocol for IPv6 (TCP)*/ - net6 - } - - private enum StreamingProtocol2 { - /** Default network protocol for IPv4 (TCP)*/ - net, - /** Default network protocol for IPv6 (TCP)*/ - net6, - /** TCP network protocol for IPv4*/ - tcp, - /** TCP network protocol for IPv6*/ - tcp6 } - - /** - * Index of last supported streaming protocol for common URL configuration. - */ - private static final int COMMON_URL_LAST_INDEX = 1; - /** - * Index of default streaming protocol. - */ - private static final int DEFAULT_URL_INDEX = 0; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The dialog composite. - */ - private Composite fDialogComposite = null; - /** - * The text widget for the session name - */ - private Text fSessionNameText = null; - /** - * The label widget for the session path. - */ - private Label fSessionPathLabel = null; - /** - * The text widget for the session path. - */ - private Text fSessionPathText = null; - /** - * The button widget to select a normal session - */ - private Button fNormalModeButton = null; - /** - * The button widget to select a snapshot session - */ - private Button fSnapshotButton = null; - /** - * The group that contains the mutually exclusive mode buttons - */ - private Group fModeButtonGroup = null; - /** - * The button widget to select a live session - */ - private Button fLiveButton = null; - - /** - * The text widget to set a live delay - */ - private Text fLiveDelayText = null; - /** - * The Group for advanced configuration. - */ - private Group fAdvancedGroup = null; - /** - * The button to show advanced options. - */ - private Button fAdvancedButton = null; - /** - * The composite with streaming configuration parameter. - */ - private Composite fStreamingComposite = null; - /** - * The text widget for the trace path. - */ - private Text fTracePathText = null; - /** - * The button to link data protocol/Address with control protocol. - */ - private Button fLinkDataWithControlButton = null; - /** - * The Combo box for channel protocol selection. - */ - private CCombo fControlProtocolCombo = null; - /** - * A selection listener that copies the protocol from control to data when being linked. - */ - private ControlProtocolSelectionListener fCopyProtocolSelectionListener; - /** - * A selection listener updates the control port text depending on the control protocol selected. - */ - private ProtocolComboSelectionListener fControlProtocolSelectionListener; - /** - * A selection listener updates the data port text depending on the data protocol selected. - */ - private ProtocolComboSelectionListener fDataProtocolSelectionListener; - /** - * The text box for the host/IP address of the control channel. - */ - private Text fControlHostAddressText = null; - /** - * A key listener that copies the host address from control to data when being linked. - */ - private CopyModifyListener fControlUrlKeyListener; - /** - * A modify listener that updates the enablement of the dialog. - */ - private UpdateEnablementModifyListener fUpdateEnablementModifyListener; - /** - * The text box for the control port. - */ - private Text fControlPortText = null; - /** - * The Combo box for data protocol selection. - */ - private CCombo fDataProtocolCombo = null; - /** - * The text box for the host/IP address of the data channel. - */ - private Text fDataHostAddressText = null; - /** - * The text box for the data port. - */ - private Text fDataPortText = null; - /** - * The parent where the new node should be added. - */ - private TraceSessionGroup fParent = null; - /** - * The session name string. - */ - private String fSessionName = ""; //$NON-NLS-1$; - /** - * The session path string. - */ - private String fSessionPath = null; - /** - * Flag whether the session is snapshot or not - */ - private boolean fIsSnapshot = false; - /** - * Flag whether the session is live or not - */ - private boolean fIsLive = false; - /** - * The text box for the live address (relayd). - */ - private Text fLiveHostAddressText = null; - /** - * The text box for the live port (relayd). - */ - private Text fLivePortText = null; - /** - * The live delay - */ - private Integer fLiveDelay = 0; - /** - * The live url. - */ - private String fLiveUrl = null; - /** - * The live port. - */ - private Integer fLivePort = 0; - /** - * Flag whether default location (path) shall be used or not - */ - private boolean fIsDefaultPath = true; - /** - * Flag whether the advanced options are enabled or not - */ - private boolean fIsAdvancedEnabled = false; - /** - * The network URL in case control and data is configured together. - * If set, fControlUrl and fDataUrl will be null. - */ - private String fNetworkUrl = null; - /** - * The control URL in case control and data is configured separately. - * If set, fDataUrl will be set too and fNetworkUrl will be null. - */ - private String fControlUrl = null; - /** - * The data URL in case control and data is configured separately. - * If set, fControlUrl will be set too and fNetworkUrl will be null. - */ - private String fDataUrl = null; - /** - * The trace path string. - */ - private String fTracePath = null; - /** - * The Group for advanced configuration of Live mode. - */ - private Group fLiveGroup = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param shell - a shell for the display of the dialog - */ - public CreateSessionDialog(Shell shell) { - super(shell); - setShellStyle(SWT.RESIZE | getShellStyle()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public void initialize(TraceSessionGroup group) { - fParent = group; - fStreamingComposite = null; - fLiveGroup = null; - fLiveButton = null; - fIsLive = false; - fSnapshotButton = null; - fSessionName = ""; //$NON-NLS-1$ - fSessionPath = null; - fIsSnapshot = false; - fIsDefaultPath = true; - fIsAdvancedEnabled = false; - fNetworkUrl = null; - fControlUrl = null; - fDataUrl = null; - } - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.TraceControl_CreateSessionDialogTitle); - newShell.setImage(Activator.getDefault().loadIcon(CREATE_SESSION_ICON_FILE)); - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite dialogAreaa = (Composite) super.createDialogArea(parent); - setTitle(Messages.TraceControl_CreateSessionDialogTitle); - setMessage(Messages.TraceControl_CreateSessionDialogMessage); - - // Main dialog panel - fDialogComposite = new Composite(dialogAreaa, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - fDialogComposite.setLayout(layout); - fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - Group sessionGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); - sessionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - sessionGroup.setLayout(new GridLayout(4, true)); - - fUpdateEnablementModifyListener = new UpdateEnablementModifyListener(); - - Label sessionNameLabel = new Label(sessionGroup, SWT.RIGHT); - sessionNameLabel.setText(Messages.TraceControl_CreateSessionNameLabel); - fSessionNameText = new Text(sessionGroup, SWT.NONE); - fSessionNameText.setToolTipText(Messages.TraceControl_CreateSessionNameTooltip); - fSessionNameText.addModifyListener(fUpdateEnablementModifyListener); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 3; - fSessionNameText.setLayoutData(data); - - fSessionPathLabel = new Label(sessionGroup, SWT.RIGHT); - fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel); - fSessionPathText = new Text(sessionGroup, SWT.NONE); - fSessionPathText.setToolTipText(Messages.TraceControl_CreateSessionPathTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 3; - fSessionPathText.setLayoutData(data); - fSessionPathText.addModifyListener(fUpdateEnablementModifyListener); - - if (fParent.isSnapshotSupported() || fParent.isLiveSupported()) { - fModeButtonGroup = new Group(sessionGroup, SWT.NONE); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 4; - fModeButtonGroup.setLayoutData(data); - fModeButtonGroup.setLayout(new GridLayout(3, true)); - - SelectionAdapter modeChangedListener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (fLiveButton != null) { - if (fLiveButton.getSelection()) { - createAdvancedLiveGroup(); - updateSessionPathEnablement(); - updateProtocolComboItems(); - } else { - disposeLiveGroup(); - updateSessionPathEnablement(); - updateProtocolComboItems(); - } - } - updateEnablement(); - } - }; - - fNormalModeButton = new Button(fModeButtonGroup, SWT.RADIO); - fNormalModeButton.setText(Messages.TraceControl_CreateSessionNormalLabel); - fNormalModeButton.setToolTipText(Messages.TraceControl_CreateSessionNormalTooltip); - fNormalModeButton.setSelection(true); - fNormalModeButton.addSelectionListener(modeChangedListener); - - if (fParent.isSnapshotSupported()) { - fSnapshotButton = new Button(fModeButtonGroup, SWT.RADIO); - fSnapshotButton.setText(Messages.TraceControl_CreateSessionSnapshotLabel); - fSnapshotButton.setToolTipText(Messages.TraceControl_CreateSessionSnapshotTooltip); - fSnapshotButton.addSelectionListener(modeChangedListener); - } - - if (fParent.isLiveSupported()) { - fLiveButton = new Button(fModeButtonGroup, SWT.RADIO); - fLiveButton.setText(Messages.TraceControl_CreateSessionLiveLabel); - fLiveButton.setToolTipText(Messages.TraceControl_CreateSessionLiveTooltip); - fLiveButton.addSelectionListener(modeChangedListener); - } - } - - if (fParent.isNetworkStreamingSupported() || fParent.isLiveSupported()) { - createAdvancedOptionsComposite(); - } - - return fDialogComposite; - } - - private void createAdvancedOptionsComposite() { - - fAdvancedGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); - fAdvancedGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); - fAdvancedGroup.setLayout(new GridLayout(1, true)); - - fAdvancedButton = new Button(fAdvancedGroup, SWT.PUSH); - fAdvancedButton.setText(Messages.TraceControl_CreateSessionConfigureStreamingButtonText + " >>>"); //$NON-NLS-1$ - fAdvancedButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip); - fAdvancedButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (fIsAdvancedEnabled) { - fIsAdvancedEnabled = false; - fAdvancedButton.setText(">>> " + Messages.TraceControl_CreateSessionConfigureStreamingButtonText); //$NON-NLS-1$ - fAdvancedButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip); - - if (fParent.isNetworkStreamingSupported()) { - updateSessionPathEnablement(); - disposeConfigureStreamingComposite(); - } - - if (fParent.isLiveSupported()) { - disposeLiveGroup(); - } - } else { - fIsAdvancedEnabled = true; - fAdvancedButton.setText("<<< " + Messages.TraceControl_CreateSessionNoStreamingButtonText); //$NON-NLS-1$ - fAdvancedButton.setToolTipText(Messages.TraceControl_CreateSessionNoStreamingButtonTooltip); - - if (fParent.isNetworkStreamingSupported()) { - updateSessionPathEnablement(); - createConfigureStreamingComposite(); - } - if (fLiveButton != null && fLiveButton.getSelection()) { - createAdvancedLiveGroup(); - } - } - - updateEnablement(); - getShell().pack(); - } - }); - } - - private void updateSessionPathEnablement() { - if (fIsAdvancedEnabled || fIsLive) { - fSessionPathText.setEnabled(false); - fSessionPathText.setText(""); //$NON-NLS-1$ - fSessionPathLabel.setText(""); //$NON-NLS-1$ - } else { - fSessionPathText.setEnabled(true); - fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel); - } - } - - private void updateProtocolComboItems() { - if (fControlProtocolCombo == null || fControlProtocolCombo.isDisposed()) { - return; - } - - int currentSelection = fControlProtocolCombo.getSelectionIndex() <= COMMON_URL_LAST_INDEX ? - fControlProtocolCombo.getSelectionIndex() : DEFAULT_URL_INDEX; - - fControlProtocolCombo.removeAll(); - Enum>[] values; - if (fIsLive) { - values = LiveProtocol.values(); - } else if (fLinkDataWithControlButton.getSelection()) { - values = StreamingProtocol.values(); - } else { - values = StreamingProtocol2.values(); - } - - String[] controlItems = new String[values.length]; - for (int i = 0; i < controlItems.length; i++) { - controlItems[i] = values[i].name(); - } - fControlProtocolCombo.setItems(controlItems); - fDataProtocolCombo.setItems(controlItems); - - // Set selection - if (currentSelection != -1) { - fControlProtocolCombo.select(currentSelection); - fDataProtocolCombo.select(currentSelection); - } - } - - private void createConfigureStreamingComposite() { - if (fStreamingComposite == null) { - fStreamingComposite = new Group(fAdvancedGroup, SWT.SHADOW_NONE); - GridLayout layout = new GridLayout(1, true); - fStreamingComposite.setLayout(layout); - fStreamingComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - layout = new GridLayout(7, true); - fStreamingComposite.setLayout(layout); - fStreamingComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - Label tracePathLabel = new Label(fStreamingComposite, SWT.RIGHT); - tracePathLabel.setText(Messages.TraceControl_CreateSessionTracePathText); - fTracePathText = new Text(fStreamingComposite, SWT.NONE); - fTracePathText.setToolTipText(Messages.TraceControl_CreateSessionTracePathTooltip); - - // layout widgets - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 6; - fTracePathText.setLayoutData(data); - fTracePathText.addModifyListener(fUpdateEnablementModifyListener); - - fLinkDataWithControlButton = new Button(fStreamingComposite, SWT.CHECK); - fLinkDataWithControlButton.setText(Messages.TraceControl_CreateSessionLinkButtonText); - fLinkDataWithControlButton.setToolTipText(Messages.TraceControl_CreateSessionLinkButtonTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 7; - fLinkDataWithControlButton.setLayoutData(data); - fLinkDataWithControlButton.setSelection(true); - - Label label = new Label(fStreamingComposite, SWT.NONE); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - label.setLayoutData(data); - - label = new Label(fStreamingComposite, SWT.NONE); - label.setText(Messages.TraceControl_CreateSessionProtocolLabelText); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - label.setLayoutData(data); - - label = new Label(fStreamingComposite, SWT.NONE); - label.setText(Messages.TraceControl_CreateSessionAddressLabelText); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 4; - label.setLayoutData(data); - - label = new Label(fStreamingComposite, SWT.NONE); - label.setText(Messages.TraceControl_CreateSessionPortLabelText); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - label.setLayoutData(data); - - label = new Label(fStreamingComposite, SWT.RIGHT); - label.setText(Messages.TraceControl_CreateSessionControlUrlLabel); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - label.setLayoutData(data); - - fControlProtocolCombo = new CCombo(fStreamingComposite, SWT.READ_ONLY); - fControlProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionCommonProtocolTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - fControlProtocolCombo.setLayoutData(data); - fControlProtocolCombo.addModifyListener(fUpdateEnablementModifyListener); - - fControlHostAddressText = new Text(fStreamingComposite, SWT.NONE); - fControlHostAddressText.setToolTipText(Messages.TraceControl_CreateSessionControlAddressTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 4; - fControlHostAddressText.setLayoutData(data); - fControlHostAddressText.addModifyListener(fUpdateEnablementModifyListener); - - fControlPortText = new Text(fStreamingComposite, SWT.NONE); - fControlPortText.setToolTipText(Messages.TraceControl_CreateSessionControlPortTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - fControlPortText.setLayoutData(data); - fControlPortText.addModifyListener(fUpdateEnablementModifyListener); - - label = new Label(fStreamingComposite, SWT.RIGHT); - label.setText(Messages.TraceControl_CreateSessionDataUrlLabel); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - label.setLayoutData(data); - - fDataProtocolCombo = new CCombo(fStreamingComposite, SWT.READ_ONLY); - fDataProtocolCombo.setEnabled(false); - fDataProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionProtocolTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - fDataProtocolCombo.setLayoutData(data); - fDataProtocolCombo.addModifyListener(fUpdateEnablementModifyListener); - - updateProtocolComboItems(); - - fDataHostAddressText = new Text(fStreamingComposite, SWT.NONE); - fDataHostAddressText.setEnabled(false); - fDataHostAddressText.setToolTipText(Messages.TraceControl_CreateSessionDataAddressTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 4; - fDataHostAddressText.setLayoutData(data); - fDataHostAddressText.addModifyListener(fUpdateEnablementModifyListener); - - fDataPortText = new Text(fStreamingComposite, SWT.NONE); - fDataPortText.setEnabled(true); - fDataPortText.setToolTipText(Messages.TraceControl_CreateSessionDataPortTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - fDataPortText.setLayoutData(data); - fDataPortText.addModifyListener(fUpdateEnablementModifyListener); - - fCopyProtocolSelectionListener = new ControlProtocolSelectionListener(); - fControlProtocolSelectionListener = new ProtocolComboSelectionListener(fControlProtocolCombo, fControlPortText); - fDataProtocolSelectionListener = new ProtocolComboSelectionListener(fDataProtocolCombo, fDataPortText); - - fControlProtocolCombo.addSelectionListener(fCopyProtocolSelectionListener); - - fControlUrlKeyListener = new CopyModifyListener(fControlHostAddressText, fDataHostAddressText); - fControlHostAddressText.addModifyListener(fControlUrlKeyListener); - - fControlProtocolCombo.select(DEFAULT_URL_INDEX); - fDataProtocolCombo.select(DEFAULT_URL_INDEX); - - fLinkDataWithControlButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (fLinkDataWithControlButton.getSelection()) { - // Set enablement control data channel inputs - fDataProtocolCombo.setEnabled(false); - fDataHostAddressText.setEnabled(false); - fControlPortText.setEnabled(true); - fDataPortText.setEnabled(true); - - // Update listeners - fControlProtocolCombo.removeSelectionListener(fControlProtocolSelectionListener); - fDataProtocolCombo.removeSelectionListener(fDataProtocolSelectionListener); - fControlProtocolCombo.addSelectionListener(fCopyProtocolSelectionListener); - fControlHostAddressText.addModifyListener(fControlUrlKeyListener); - - updateProtocolComboItems(); - - fDataHostAddressText.setText(fControlHostAddressText.getText()); - - // Update tool tips - fControlProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionCommonProtocolTooltip); - } else { - // Enable data channel inputs - fDataProtocolCombo.setEnabled(true); - fDataHostAddressText.setEnabled(true); - - // Update listeners - fControlProtocolCombo.removeSelectionListener(fCopyProtocolSelectionListener); - fControlProtocolCombo.addSelectionListener(fControlProtocolSelectionListener); - fDataProtocolCombo.addSelectionListener(fDataProtocolSelectionListener); - fControlHostAddressText.removeModifyListener(fControlUrlKeyListener); - - updateProtocolComboItems(); - - // Update tool tips - fDataProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionProtocolTooltip); - fControlProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionProtocolTooltip); - - // Update control/data port enablement and input - if (fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net.name()) || - fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net6.name())) { - fControlPortText.setText(""); //$NON-NLS-1$ - fControlPortText.setEnabled(false); - } else { - fControlPortText.setEnabled(true); - } - - if (fDataProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net.name()) || - fDataProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net6.name())) { - fDataPortText.setText(""); //$NON-NLS-1$ - fDataPortText.setEnabled(false); - } else { - fDataPortText.setEnabled(true); - } - } - } - }); - } - } - - private void createAdvancedLiveGroup() { - if (fLiveGroup == null && fIsAdvancedEnabled) { - GridLayout layout = new GridLayout(7, true); - fLiveGroup = new Group(fAdvancedGroup, SWT.NONE); - fLiveGroup.setLayout(layout); - GridData layoutData = new GridData(GridData.FILL_BOTH); - fLiveGroup.setLayoutData(layoutData); - - Label label = new Label(fLiveGroup, SWT.NONE); - label.setText(Messages.TraceControl_CreateSessionLiveConnectionLabel); - layoutData = new GridData(GridData.FILL_HORIZONTAL); - layoutData.horizontalSpan = 2; - label.setLayoutData(layoutData); - - fLiveHostAddressText = new Text(fLiveGroup, SWT.NONE); - fLiveHostAddressText.setText(DEFAULT_LIVE_URL); - fLiveHostAddressText.setEnabled(false); - fLiveHostAddressText.setToolTipText(Messages.TraceControl_CreateSessionLiveConnectionUrlTooltip); - layoutData = new GridData(GridData.FILL_HORIZONTAL); - layoutData.horizontalSpan = 4; - fLiveHostAddressText.setLayoutData(layoutData); - - fLivePortText = new Text(fLiveGroup, SWT.NONE); - fLivePortText.setText(Integer.toString(DEFAULT_LIVE_PORT)); - fLivePortText.setToolTipText(Messages.TraceControl_CreateSessionLiveConnectionPortTooltip); - layoutData = new GridData(GridData.FILL_HORIZONTAL); - fLivePortText.setLayoutData(layoutData); - - Label liveDelayLabel = new Label(fLiveGroup, SWT.NONE); - layoutData = new GridData(GridData.FILL_HORIZONTAL); - liveDelayLabel.setText(Messages.TraceControl_CreateSessionLiveDelayLabel); - liveDelayLabel.setLayoutData(layoutData); - fLiveDelayText = new Text(fLiveGroup, SWT.NONE); - fLiveDelayText.setText(DEFAULT_TEXT); - fLiveDelayText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - fLiveDelayText.setToolTipText(Messages.TraceControl_CreateSessionLiveDelayTooltip); - fLiveDelayText.addVerifyListener(new VerifyListener() { - @Override - public void verifyText(VerifyEvent e) { - // only numbers and default are allowed. - e.doit = e.text.matches("[0-9]*") || e.text.matches(DEFAULT_TEXT); //$NON-NLS-1$ - updateEnablement(); - } - }); - fLiveDelayText.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent event) { - updateEnablement(); - } - }); - - fLiveDelayText.addFocusListener(new FocusListener() { - - @Override - public void focusLost(FocusEvent e) { - Text focusLostWidget = (Text) e.widget; - if (focusLostWidget.getText().isEmpty()) { - focusLostWidget.setText(DEFAULT_TEXT); - focusLostWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - } - } - - @Override - public void focusGained(FocusEvent e) { - Text focusGainedWidget = (Text) e.widget; - if (focusGainedWidget.getText().equals(DEFAULT_TEXT)) { - focusGainedWidget.setText(""); //$NON-NLS-1$ - focusGainedWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_BLACK)); - } - } - }); - - layoutData = new GridData(GridData.FILL_HORIZONTAL); - layoutData.grabExcessHorizontalSpace = true; - layoutData.horizontalSpan = 6; - fLiveDelayText.setLayoutData(layoutData); - getShell().pack(); - } - } - - private void disposeLiveGroup() { - if (fLiveGroup != null) { - fLiveGroup.dispose(); - fLiveGroup = null; - getShell().pack(); - } - } - - private void disposeConfigureStreamingComposite() { - if (fStreamingComposite != null) { - fStreamingComposite.dispose(); - fStreamingComposite = null; - } - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ - createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ - } - - private void updateEnablement() { - validate(); - getButton(IDialogConstants.OK_ID).setEnabled(getErrorMessage() == null); - } - - private void validate() { - // Validate input data - fSessionName = fSessionNameText.getText(); - fSessionPath = fSessionPathText.getText(); - setErrorMessage(null); - - if (fParent.isLiveSupported() && fLiveButton != null) { - fIsLive = fLiveButton.getSelection(); - fLiveDelay = LTTngControlServiceConstants.UNUSED_VALUE; - fLiveUrl = DEFAULT_LIVE_URL; - fLivePort = DEFAULT_LIVE_PORT; - } - - if (!"".equals(fSessionPath)) { //$NON-NLS-1$ - // validate sessionPath - if (!fIsAdvancedEnabled && !fIsLive) { - TargetNodeComponent node = (TargetNodeComponent)fParent.getParent(); - IRemoteSystemProxy proxy = node.getRemoteSystemProxy(); - IFileServiceSubSystem fsss = proxy.getFileServiceSubSystem(); - if (fsss != null) { - try { - IRemoteFile remoteFolder = fsss.getRemoteFileObject(fSessionPath, new NullProgressMonitor()); - - if (remoteFolder == null) { - setErrorMessage(Messages.TraceControl_InvalidSessionPathError + " (" + fSessionPath + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - return; - } - - if (remoteFolder.exists()) { - setErrorMessage(Messages.TraceControl_SessionPathAlreadyExistsError + " (" + fSessionPath + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - return; - } - } catch (SystemMessageException e) { - setErrorMessage(Messages.TraceControl_FileSubSystemError + "\n" + e); //$NON-NLS-1$ - return; - } - } - } - fIsDefaultPath = false; - } - - if (fParent.isSnapshotSupported()) { - fIsSnapshot = fSnapshotButton.getSelection(); - } - - fNetworkUrl = null; - fControlUrl = null; - fDataUrl = null; - - if (fIsAdvancedEnabled && fStreamingComposite != null) { - // Validate input data - - if (fIsLive && fLiveGroup != null) { - String liveDelayText = fLiveDelayText.getText(); - try { - fLiveDelay = liveDelayText.equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.valueOf(liveDelayText); - fLivePort = Integer.valueOf(fLivePortText.getText()); - fLiveUrl = fLiveHostAddressText.getText(); - } catch (NumberFormatException e) { - setErrorMessage(Messages.TraceControl_InvalidLiveDelayError); - return; - } - } - - fTracePath = fTracePathText.getText(); - - if (fControlProtocolCombo.getSelectionIndex() < 0) { - setErrorMessage("Control Protocol Text is empty\n"); //$NON-NLS-1$ - return; - } - - if ("".equals(fControlHostAddressText.getText())) { //$NON-NLS-1$ - setErrorMessage("Control Address Text is empty\n"); //$NON-NLS-1$ - return; - } - - if (!fLinkDataWithControlButton.getSelection()) { - if (fDataProtocolCombo.getSelectionIndex() < 0) { - setErrorMessage("Data Protocol Text is empty\n"); //$NON-NLS-1$ - return; - } - - if ("".equals(fDataHostAddressText.getText())) { //$NON-NLS-1$ - setErrorMessage("Data Address Text is empty\n"); //$NON-NLS-1$ - return; - } - - fControlUrl = getUrlString(fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()), - fControlHostAddressText.getText(), - fControlPortText.getText(), - null, - fTracePath); - - fDataUrl = getUrlString(fDataProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()), - fDataHostAddressText.getText(), - null, - fDataPortText.getText(), - fTracePath); - } else { - fNetworkUrl = getUrlString(fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()), - fControlHostAddressText.getText(), - fControlPortText.getText(), - fDataPortText.getText(), - fTracePath); - } - } - - if (fIsLive && fNetworkUrl == null && fControlUrl == null && fDataUrl == null) { - fNetworkUrl = SessionInfo.DEFAULT_LIVE_NETWORK_URK; - } - - // Check for invalid names - if (!"".equals(fSessionName) && !fSessionName.matches("^[a-zA-Z0-9\\-\\_]{1,}$")) { //$NON-NLS-1$ //$NON-NLS-2$ - setErrorMessage(Messages.TraceControl_InvalidSessionNameError + " (" + fSessionName + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - return; - } - - // Check if node with name already exists in parent - if(fParent.containsChild(fSessionName)) { - setErrorMessage(Messages.TraceControl_SessionAlreadyExistsError + " (" + fSessionName + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - return; - } - } - - private static String getUrlString(String proto, String host, String ctrlPort, String dataPort, String sessionPath) { - //proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH] - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append(proto); - stringBuilder.append("://"); //$NON-NLS-1$ - stringBuilder.append(host); - - if ((ctrlPort != null) && (!"".equals(ctrlPort))) { //$NON-NLS-1$ - stringBuilder.append(":"); //$NON-NLS-1$ - stringBuilder.append(ctrlPort); - } - - if ((dataPort != null) && (!"".equals(dataPort))) { //$NON-NLS-1$ - stringBuilder.append(":"); //$NON-NLS-1$ - stringBuilder.append(dataPort); - } - - if ((sessionPath != null) && (!"".equals(sessionPath))) { //$NON-NLS-1$ - stringBuilder.append("/"); //$NON-NLS-1$ - stringBuilder.append(sessionPath); - } - return stringBuilder.toString(); - } - - private static class CopyModifyListener implements ModifyListener { - private Text fSource; - private Text fDestination; - - public CopyModifyListener(Text source, Text destination) { - fSource = source; - fDestination = destination; - } - - @Override - public void modifyText(ModifyEvent e) { - fDestination.setText(fSource.getText()); - } - } - - private class ControlProtocolSelectionListener extends SelectionAdapter { - - @Override - public void widgetSelected(SelectionEvent e) { - fDataProtocolCombo.select(fControlProtocolCombo.getSelectionIndex()); - if (fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.file.name())) { - fControlPortText.setText(""); //$NON-NLS-1$ - fDataPortText.setText(""); //$NON-NLS-1$ - fControlPortText.setEnabled(false); - fDataPortText.setEnabled(false); - } else { - fControlPortText.setEnabled(true); - fDataPortText.setEnabled(true); - } - } - } - - private class ProtocolComboSelectionListener extends SelectionAdapter { - - private CCombo fCombo; - private Text fPortText; - - public ProtocolComboSelectionListener(CCombo combo, Text portText) { - fCombo = combo; - fPortText = portText; - } - - @Override - public void widgetSelected(SelectionEvent e) { - if (fCombo.getItem(fCombo.getSelectionIndex()).equals(StreamingProtocol.net.name()) || - fCombo.getItem(fCombo.getSelectionIndex()).equals(StreamingProtocol.net6.name())) { - fPortText.setText(""); //$NON-NLS-1$ - fPortText.setEnabled(false); - } else { - fPortText.setEnabled(true); - } - } - } - - @Override - public ISessionInfo getParameters() { - ISessionInfo sessionInfo = new SessionInfo(fSessionName); - - boolean isStreaming = (fIsAdvancedEnabled && fStreamingComposite != null) || fIsLive; - if (isStreaming) { - sessionInfo.setNetworkUrl(fNetworkUrl); - sessionInfo.setControlUrl(fControlUrl); - sessionInfo.setDataUrl(fDataUrl); - sessionInfo.setStreamedTrace(true); - } else if (!fIsDefaultPath) { - sessionInfo.setSessionPath(fSessionPath); - } - - sessionInfo.setLive(fIsLive); - sessionInfo.setLiveUrl(fLiveUrl); - sessionInfo.setLivePort(fLivePort); - sessionInfo.setLiveDelay(fLiveDelay); - sessionInfo.setSnapshot(fIsSnapshot); - - return sessionInfo; - } - - private final class UpdateEnablementModifyListener implements ModifyListener { - @Override - public void modifyText(ModifyEvent e) { - updateEnablement(); - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableChannelDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableChannelDialog.java deleted file mode 100644 index 649e90af47..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableChannelDialog.java +++ /dev/null @@ -1,595 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Simon Delisle - Updated for support of LTTng Tools 2.2 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.events.VerifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - *

- * Dialog box for collecting channel information when enabling a channel (which will be created). - *

- * - * @author Bernd Hufmann - */ -public class EnableChannelDialog extends Dialog implements IEnableChannelDialog { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The icon file for this dialog box. - */ - public static final String ENABLE_CHANNEL_ICON_FILE = "icons/elcl16/add_button.gif"; //$NON-NLS-1$ - - /** - * To indicate that the default value will be used for this field - */ - private static final String DEFAULT_TEXT = "<" + Messages.EnableChannelDialog_DefaultMessage + ">"; //$NON-NLS-1$ //$NON-NLS-2$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The text widget for the channel name - */ - private Text fChannelNameText = null; - /** - * The discard mode of the channel. - */ - private Button fDiscardModeButton = null; - /** - * The overwrite mode of the channel. - */ - private Button fOverwriteModeButton = null; - /** - * The sub-buffer size of the channel. - */ - private Text fSubBufferSizeText = null; - /** - * The number of sub-buffers of the channel. - */ - private Text fNumberOfSubBuffersText = null; - /** - * The switch timer interval of the channel. - */ - private Text fSwitchTimerText = null; - /** - * The read timer interval of the channel. - */ - private Text fReadTimerText = null; - /** - * Radio button for selecting kernel domain. - */ - private Button fKernelButton = null; - /** - * Radio button for selecting UST domain. - */ - private Button fUstButton = null; - /** - * The parent domain component where the channel node should be added. - * Null in case of creation on session level. - */ - private TraceDomainComponent fDomain = null; - /** - * The target node component - */ - private TargetNodeComponent fTargetNodeComponent = null; - /** - * Common verify listener for numeric text input. - */ - private VerifyListener fVerifyListener = null; - /** - * Common focus listener - */ - private FocusListener fFocusListener = null; - /** - * Output channel information. - */ - private IChannelInfo fChannelInfo = null; - /** - * Output domain information. True in case of Kernel domain. False for UST. - */ - private boolean fIsKernel; - /** - * Flag which indicates whether Kernel domain is available or not - */ - private boolean fHasKernel; - /** - * Maximum size of trace files of the channel. - */ - private Text fMaxSizeTraceText = null; - /** - * Maximum number of trace files of the channel. - */ - private Text fMaxNumberTraceText = null; - /** - * CheckBox for selecting shared buffers (kernel onlyu). - */ - private Button fSharedBuffersButton = null; - /** - * CheckBox for selecting per UID buffers. - */ - private Button fPIDBuffersButton = null; - /** - * CheckBox for selecting per UID buffers. - */ - private Button fUIDBuffersButton = null; - /** - * CheckBox to configure metadata channel - */ - private Button fMetadataChannelButton = null; - /** - * Previous channel name - */ - private String fPreviousChannelName = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param shell - a shell for the display of the dialog - */ - public EnableChannelDialog(Shell shell) { - super(shell); - fIsKernel = true; - - // Common verify listener - fVerifyListener = new VerifyListener() { - @Override - public void verifyText(VerifyEvent e) { - // only numbers and default are allowed. - e.doit = e.text.matches("[0-9]*") || e.text.matches(DEFAULT_TEXT); //$NON-NLS-1$ - } - }; - - // Common focus listener - fFocusListener = new FocusListener() { - - @Override - public void focusLost(FocusEvent e) { - Text focusLostWidget = (Text) e.widget; - if (focusLostWidget.getText().isEmpty()) { - focusLostWidget.setText(DEFAULT_TEXT); - focusLostWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - } - } - - @Override - public void focusGained(FocusEvent e) { - Text focusGainedWidget = (Text) e.widget; - if (focusGainedWidget.getText().equals(DEFAULT_TEXT)) { - focusGainedWidget.setText(""); //$NON-NLS-1$ - focusGainedWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_BLACK)); - } - } - }; - - setShellStyle(SWT.RESIZE | getShellStyle()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public IChannelInfo getChannelInfo() { - return fChannelInfo; - } - - @Override - public void setDomainComponent(TraceDomainComponent domain) { - fDomain = domain; - if (fDomain != null) { - fIsKernel = fDomain.isKernel(); - } else { - fIsKernel = true; - } - } - - @Override - public boolean isKernel() { - return fIsKernel; - } - - @Override - public void setHasKernel(boolean hasKernel) { - if (fDomain != null) { - fIsKernel = fDomain.isKernel(); - } else { - fIsKernel = hasKernel; - } - - fHasKernel = hasKernel; - } - - @Override - public void setTargetNodeComponent(TargetNodeComponent node) { - fTargetNodeComponent = node; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.TraceControl_EnableChannelDialogTitle); - newShell.setImage(Activator.getDefault().loadIcon(ENABLE_CHANNEL_ICON_FILE)); - } - - @Override - protected Control createDialogArea(Composite parent) { - - int numColumn = 2; - if (fTargetNodeComponent.isBufferTypeConfigSupported()) { - numColumn = 3; - } - - // Main dialog panel - Composite dialogComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - dialogComposite.setLayout(layout); - - Composite commonModeGroup = new Composite(dialogComposite, SWT.NONE); - layout = new GridLayout(3, true); - commonModeGroup.setLayout(layout); - - Label channelNameLabel = new Label(commonModeGroup, SWT.RIGHT); - channelNameLabel.setText(Messages.TraceControl_EnableChannelNameLabel); - fChannelNameText = new Text(commonModeGroup, SWT.NONE); - fChannelNameText.setToolTipText(Messages.TraceControl_EnableChannelNameTooltip); - - Label subBufferSizeLabel = new Label(commonModeGroup, SWT.RIGHT); - subBufferSizeLabel.setText(Messages.TraceControl_SubBufferSizePropertyName); - fSubBufferSizeText = new Text(commonModeGroup, SWT.NONE); - fSubBufferSizeText.setToolTipText(Messages.TraceControl_EnableChannelSubBufferSizeTooltip); - fSubBufferSizeText.addVerifyListener(fVerifyListener); - fSubBufferSizeText.addFocusListener(fFocusListener); - fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - - Label numSubBufferLabel = new Label(commonModeGroup, SWT.RIGHT); - numSubBufferLabel.setText(Messages.TraceControl_NbSubBuffersPropertyName); - fNumberOfSubBuffersText = new Text(commonModeGroup, SWT.NONE); - fNumberOfSubBuffersText.setToolTipText(Messages.TraceControl_EnableChannelNbSubBuffersTooltip); - fNumberOfSubBuffersText.addVerifyListener(fVerifyListener); - fNumberOfSubBuffersText.addFocusListener(fFocusListener); - - Label switchTimerLabel = new Label(commonModeGroup, SWT.RIGHT); - switchTimerLabel.setText(Messages.TraceControl_SwitchTimerPropertyName); - fSwitchTimerText = new Text(commonModeGroup, SWT.NONE); - fSwitchTimerText.setToolTipText(Messages.TraceControl_EnableChannelSwitchTimerTooltip); - fSwitchTimerText.addVerifyListener(fVerifyListener); - fSwitchTimerText.addFocusListener(fFocusListener); - - Label readTimerLabel = new Label(commonModeGroup, SWT.RIGHT); - readTimerLabel.setText(Messages.TraceControl_ReadTimerPropertyName); - fReadTimerText = new Text(commonModeGroup, SWT.NONE); - fReadTimerText.setToolTipText(Messages.TraceControl_EnableChannelReadTimerTooltip); - fReadTimerText.addVerifyListener(fVerifyListener); - fReadTimerText.addFocusListener(fFocusListener); - - if (fTargetNodeComponent.isTraceFileRotationSupported()) { - Label maxSizeTraceFilesLabel = new Label(commonModeGroup, SWT.RIGHT); - maxSizeTraceFilesLabel.setText(Messages.TraceControl_MaxSizeTraceFilesPropertyName); - fMaxSizeTraceText = new Text(commonModeGroup, SWT.NONE); - fMaxSizeTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxSizeTraceFilesTooltip); - fMaxSizeTraceText.addVerifyListener(fVerifyListener); - fMaxSizeTraceText.addFocusListener(fFocusListener); - - Label maxNumTraceFilesLabel = new Label(commonModeGroup, SWT.RIGHT); - maxNumTraceFilesLabel.setText(Messages.TraceControl_MaxNumTraceFilesPropertyName); - fMaxNumberTraceText = new Text(commonModeGroup, SWT.NONE); - fMaxNumberTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxNumTraceFilesTooltip); - fMaxNumberTraceText.addVerifyListener(fVerifyListener); - fMaxNumberTraceText.addFocusListener(fFocusListener); - } - - if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) { - fMetadataChannelButton = new Button(commonModeGroup, SWT.CHECK); - fMetadataChannelButton.setText(Messages.TraceControl_ConfigureMetadataChannelName); - fMetadataChannelButton.setSelection(false); - - fMetadataChannelButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (fMetadataChannelButton.getSelection()) { - fPreviousChannelName = fChannelNameText.getText(); - fChannelNameText.setText("metadata"); //$NON-NLS-1$ - fChannelNameText.setEnabled(false); - } else { - fChannelNameText.setText(fPreviousChannelName); - fChannelNameText.setEnabled(true); - } - } - }); - } - Group discardModeGroup = new Group(dialogComposite, SWT.SHADOW_NONE); - discardModeGroup.setText(Messages.TraceControl_EnableChannelDiscardModeGroupName); - layout = new GridLayout(numColumn, true); - discardModeGroup.setLayout(layout); - - fDiscardModeButton = new Button(discardModeGroup, SWT.RADIO); - fDiscardModeButton.setText(Messages.TraceControl_EnableChannelDiscardModeLabel); - fDiscardModeButton.setToolTipText(Messages.TraceControl_EnableChannelDiscardModeTooltip); - fDiscardModeButton.setSelection(true); - - fOverwriteModeButton = new Button(discardModeGroup, SWT.RADIO); - fOverwriteModeButton.setText(Messages.TraceControl_EnableChannelOverwriteModeLabel); - fOverwriteModeButton.setToolTipText(Messages.TraceControl_EnableChannelOverwriteModeTooltip); - fOverwriteModeButton.setSelection(false); - - Group domainGroup = new Group(dialogComposite, SWT.SHADOW_NONE); - domainGroup.setText(Messages.TraceControl_DomainDisplayName); - layout = new GridLayout(numColumn, true); - domainGroup.setLayout(layout); - - fKernelButton = new Button(domainGroup, SWT.RADIO); - fKernelButton.setText(Messages.TraceControl_KernelDomainDisplayName); - fKernelButton.setSelection(fIsKernel); - fUstButton = new Button(domainGroup, SWT.RADIO); - fUstButton.setText(Messages.TraceControl_UstDisplayName); - fUstButton.setSelection(!fIsKernel); - - if (fTargetNodeComponent.isBufferTypeConfigSupported()) { - Group bufferTypeGroup = new Group(dialogComposite, SWT.SHADOW_NONE); - bufferTypeGroup.setText(Messages.TraceControl_BufferTypeDisplayName); - layout = new GridLayout(numColumn, true); - bufferTypeGroup.setLayout(layout); - - GridData data = new GridData(GridData.FILL, GridData.BEGINNING, false, false); - data.horizontalSpan = 3; - bufferTypeGroup.setLayoutData(data); - - fSharedBuffersButton = new Button(bufferTypeGroup, SWT.RADIO); - fSharedBuffersButton.setText(Messages.TraceControl_SharedBuffersDisplayName); - fSharedBuffersButton.setSelection(fIsKernel); - fSharedBuffersButton.setEnabled(false); - - fPIDBuffersButton = new Button(bufferTypeGroup, SWT.RADIO); - fPIDBuffersButton.setText(Messages.TraceControl_PerPidBuffersDisplayName); - fPIDBuffersButton.setToolTipText(Messages.TraceControl_PerPidBuffersTooltip); - fPIDBuffersButton.setSelection(false); - - fUIDBuffersButton = new Button(bufferTypeGroup, SWT.RADIO); - fUIDBuffersButton.setText(Messages.TraceControl_PerUidBuffersDisplayName); - fUIDBuffersButton.setToolTipText(Messages.TraceControl_PerPidBuffersTooltip); - fUIDBuffersButton.setSelection(false); - - fUIDBuffersButton.setEnabled(!fIsKernel); - fPIDBuffersButton.setEnabled(!fIsKernel); - - // Update buffers type buttons depending on UST or Kernel - fUstButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (fUstButton.getSelection()) { - fSharedBuffersButton.setSelection(false); - fPIDBuffersButton.setSelection(false); - fUIDBuffersButton.setSelection(false); - fPIDBuffersButton.setEnabled(true); - fUIDBuffersButton.setEnabled(true); - } else { - fSharedBuffersButton.setSelection(true); - fPIDBuffersButton.setSelection(false); - fUIDBuffersButton.setSelection(false); - fPIDBuffersButton.setEnabled(false); - fUIDBuffersButton.setEnabled(false); - } - } - }); - } - - if ((fDomain != null) || (!fHasKernel)) { - fKernelButton.setEnabled(false); - fUstButton.setEnabled(false); - - if (fTargetNodeComponent.isBufferTypeConfigSupported()) { - fSharedBuffersButton.setEnabled(false); - fUIDBuffersButton.setEnabled(!fHasKernel); - fPIDBuffersButton.setEnabled(!fHasKernel); - setBufferTypeButtonSelection(); - } - } - - // layout widgets - GridData data = new GridData(GridData.FILL, GridData.BEGINNING, false, false); - data.horizontalSpan = 3; - discardModeGroup.setLayoutData(data); - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - fDiscardModeButton.setLayoutData(data); - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - fOverwriteModeButton.setLayoutData(data); - - data = new GridData(GridData.FILL, GridData.BEGINNING, false, false); - data.horizontalSpan = 3; - domainGroup.setLayoutData(data); - - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - fKernelButton.setLayoutData(data); - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - fUstButton.setLayoutData(data); - if (fTargetNodeComponent.isBufferTypeConfigSupported()) { - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - fSharedBuffersButton.setLayoutData(data); - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - fPIDBuffersButton.setLayoutData(data); - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - fUIDBuffersButton.setLayoutData(data); - } - - if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) { - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - data.horizontalSpan = numColumn; - fMetadataChannelButton.setLayoutData(data); - } - - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - - fChannelNameText.setLayoutData(data); - fSubBufferSizeText.setLayoutData(data); - fNumberOfSubBuffersText.setLayoutData(data); - fSwitchTimerText.setLayoutData(data); - fReadTimerText.setLayoutData(data); - if (fTargetNodeComponent.isTraceFileRotationSupported()) { - fMaxNumberTraceText.setLayoutData(data); - fMaxSizeTraceText.setLayoutData(data); - } - - setDefaults(); - - return dialogComposite; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - createButton(parent, IDialogConstants.DETAILS_ID, "&Default", true); //$NON-NLS-1$ - createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ - createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ - } - - @Override - protected void okPressed() { - // Set channel information - ChannelInfo channelInfo = new ChannelInfo(fChannelNameText.getText()); - channelInfo.setSubBufferSize(fSubBufferSizeText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Long.parseLong(fSubBufferSizeText.getText())); - channelInfo.setNumberOfSubBuffers(fNumberOfSubBuffersText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.parseInt(fNumberOfSubBuffersText.getText())); - channelInfo.setSwitchTimer(fSwitchTimerText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Long.parseLong(fSwitchTimerText.getText())); - channelInfo.setReadTimer(fReadTimerText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Long.parseLong(fReadTimerText.getText())); - channelInfo.setOverwriteMode(fOverwriteModeButton.getSelection()); - if (fTargetNodeComponent.isTraceFileRotationSupported()) { - channelInfo.setMaxSizeTraceFiles(fMaxSizeTraceText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.parseInt(fMaxSizeTraceText.getText())); - channelInfo.setMaxNumberTraceFiles(fMaxNumberTraceText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.parseInt(fMaxNumberTraceText.getText())); - } - if (fTargetNodeComponent.isBufferTypeConfigSupported()) { - if (fSharedBuffersButton.getSelection()) { - channelInfo.setBufferType(BufferType.BUFFER_SHARED); - } else if (fPIDBuffersButton.getSelection()) { - channelInfo.setBufferType(BufferType.BUFFER_PER_PID); - } else if (fUIDBuffersButton.getSelection()) { - channelInfo.setBufferType(BufferType.BUFFER_PER_UID); - } else { - channelInfo.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN); - } - } - - fIsKernel = fKernelButton.getSelection(); - - // Check for invalid names - if (!channelInfo.getName().matches("^[a-zA-Z0-9\\-\\_]{1,}$")) { //$NON-NLS-1$ - MessageDialog.openError(getShell(), - Messages.TraceControl_EnableChannelDialogTitle, - Messages.TraceControl_InvalidChannelNameError + " (" + channelInfo.getName() + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - return; - } - - // Check for duplicate names - if (fDomain != null && fDomain.containsChild(channelInfo.getName())) { - MessageDialog.openError(getShell(), - Messages.TraceControl_EnableChannelDialogTitle, - Messages.TraceControl_ChannelAlreadyExistsError + " (" + channelInfo.getName() + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - return; - } - - fChannelInfo = channelInfo; - - // validation successful -> call super.okPressed() - super.okPressed(); - } - - @Override - protected void buttonPressed(int buttonId) { - if (buttonId == IDialogConstants.DETAILS_ID) { - setDefaults(); - return; - } - super.buttonPressed(buttonId); - } - - // ------------------------------------------------------------------------ - // Helper methods - // ------------------------------------------------------------------------ - - /** - * Sets default value depending on Kernel or UST - */ - private void setDefaults() { - fSwitchTimerText.setText(DEFAULT_TEXT); - fSwitchTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - fReadTimerText.setText(DEFAULT_TEXT); - fReadTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - fOverwriteModeButton.setSelection(IChannelInfo.DEFAULT_OVERWRITE_MODE); - if (fTargetNodeComponent.isTraceFileRotationSupported()) { - fMaxSizeTraceText.setText(DEFAULT_TEXT); - fMaxSizeTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - fMaxNumberTraceText.setText(DEFAULT_TEXT); - fMaxNumberTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - } - fSubBufferSizeText.setText(DEFAULT_TEXT); - fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - fNumberOfSubBuffersText.setText(DEFAULT_TEXT); - fNumberOfSubBuffersText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); - if (fTargetNodeComponent.isBufferTypeConfigSupported()) { - setBufferTypeButtonSelection(); - } - } - - private void setBufferTypeButtonSelection() { - if ((fDomain != null) && fDomain.getBufferType() != null) { - switch (fDomain.getBufferType()) { - case BUFFER_PER_PID: - fPIDBuffersButton.setSelection(true); - break; - case BUFFER_PER_UID: - fUIDBuffersButton.setSelection(true); - break; - case BUFFER_SHARED: - fSharedBuffersButton.setSelection(true); - break; - //$CASES-OMITTED$ - default: - break; - } - } - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java deleted file mode 100644 index 15351276e0..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java +++ /dev/null @@ -1,436 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.List; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Shell; - -/** - *

- * Dialog box for collecting information events to be enabled. - *

- * - * @author Bernd Hufmann - */ -public class EnableEventsDialog extends Dialog implements IEnableEventsDialog { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * The icon file for this dialog box. - */ - public static final String ENABLE_EVENT_ICON_FILE = "icons/elcl16/enable_event.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The dialog composite. - */ - private Composite fDialogComposite; - /** - * The composite with widgets for collecting information about kernel events. - */ - private EnableKernelEventComposite fKernelComposite; - /** - * The composite with widgets for collecting information about UST events. - */ - private EnableUstEventsComposite fUstComposite; - /** - * Radio button for selecting kernel domain. - */ - private Button fKernelButton; - /** - * Radio button for selecting UST domain. - */ - private Button fUstButton; - /** - * The referenced trace provider group containing the kernel provider and UST - * provider component which contains a list of available tracepoints. - */ - private TraceProviderGroup fProviderGroup; - /** - * The parent domain component where the channel node should be added. - * Null in case the domain is not known (i.e. on session level). - */ - private TraceDomainComponent fDomain; - /** - * Output domain information. True in case of Kernel domain. False for UST. - */ - private boolean fIsKernel; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param shell - a shell for the display of the dialog - */ - public EnableEventsDialog(Shell shell) { - super(shell); - setShellStyle(SWT.RESIZE | getShellStyle()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public boolean isTracepoints() { - if (fIsKernel) { - return fKernelComposite.isTracepoints(); - } - return fUstComposite.isTracepoints(); - } - - @Override - public boolean isAllTracePoints() { - if (fIsKernel) { - return fKernelComposite.isAllTracePoints(); - } - return fUstComposite.isAllTracePoints(); - } - - @Override - public boolean isSysCalls() { - if (fIsKernel) { - return fKernelComposite.isSysCalls(); - } - return false; - } - - @Override - public boolean isAllSysCalls() { - if (fIsKernel) { - return fKernelComposite.isSysCalls(); - } - return false; - } - - @Override - public List getEventNames() { - if (fIsKernel) { - return fKernelComposite.getEventNames(); - } - return fUstComposite.getEventNames(); - } - - @Override - public boolean isDynamicProbe() { - if (fIsKernel) { - return fKernelComposite.isDynamicProbe(); - } - return false; - } - - @Override - public String getProbeName() { - if (fIsKernel) { - return fKernelComposite.getProbeName(); - } - return null; - } - - @Override - public String getProbeEventName() { - if (fIsKernel) { - return fKernelComposite.getProbeEventName(); - } - return null; - } - - @Override - public boolean isDynamicFunctionProbe() { - if (fIsKernel) { - return fKernelComposite.isDynamicFunctionProbe(); - } - return false; - } - - @Override - public String getFunctionEventName() { - if (fIsKernel) { - return fKernelComposite.getFunctionEventName(); - } - return null; - } - - @Override - public String getFunction() { - if (fIsKernel) { - return fKernelComposite.getFunction(); - } - return null; - } - - @Override - public boolean isWildcard() { - if (!fIsKernel) { - return fUstComposite.isWildcard(); - } - return false; - } - - @Override - public String getWildcard() { - if (!fIsKernel) { - return fUstComposite.getWildcard(); - } - return null; - } - - @Override - public boolean isLogLevel() { - if (!fIsKernel) { - return fUstComposite.isLogLevel(); - } - return false; - } - - @Override - public LogLevelType getLogLevelType() { - if (!fIsKernel) { - return fUstComposite.getLogLevelType(); - } - return null; - } - - @Override - public TraceLogLevel getLogLevel() { - if (!fIsKernel) { - return fUstComposite.getLogLevel(); - } - return null; - } - - @Override - public String getLogLevelEventName() { - if (!fIsKernel) { - return fUstComposite.getLogLevelEventName(); - } - return null; - } - - @Override - public boolean isKernel() { - return fIsKernel; - } - - @Override - public void setTraceProviderGroup(TraceProviderGroup providerGroup) { - fProviderGroup = providerGroup; - } - - @Override - public void setTraceDomainComponent(TraceDomainComponent domain) { - fDomain = domain; - if (fDomain != null) { - fIsKernel = fDomain.isKernel(); - } else { - fIsKernel = fProviderGroup != null ? fProviderGroup.hasKernelProvider() : true; - } - } - - @Override - public String getFilterExpression() { - if (!fIsKernel) { - return fUstComposite.getFilterExpression(); - } - return null; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.TraceControl_EnableEventsDialogTitle); - newShell.setImage(Activator.getDefault().loadIcon(ENABLE_EVENT_ICON_FILE)); - } - - @Override - protected Control createDialogArea(Composite parent) { - - // Main dialog panel - fDialogComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - fDialogComposite.setLayout(layout); - fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - // ------------------------------------------------------------------------ - // Domain Group - // ------------------------------------------------------------------------ - Group domainGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); - domainGroup.setText(Messages.TraceControl_DomainDisplayName); - layout = new GridLayout(2, true); - domainGroup.setLayout(layout); - - fKernelButton = new Button(domainGroup, SWT.RADIO); - fKernelButton.setText(Messages.TraceControl_KernelDomainDisplayName); - fKernelButton.setSelection(fIsKernel); - fUstButton = new Button(domainGroup, SWT.RADIO); - fUstButton.setText(Messages.TraceControl_UstDisplayName); - fUstButton.setSelection(!fIsKernel); - - if ((fDomain != null) || ((fProviderGroup != null) && (!fProviderGroup.hasKernelProvider()))) { - fKernelButton.setEnabled(false); - fUstButton.setEnabled(false); - } - - // layout widgets - GridData data = new GridData(GridData.FILL_HORIZONTAL); - domainGroup.setLayoutData(data); - - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - fKernelButton.setLayoutData(data); - data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - fUstButton.setLayoutData(data); - - // ------------------------------------------------------------------------ - // Kernel or UST event data group - // ------------------------------------------------------------------------ - fUstComposite = null; - fKernelComposite = null; - if (fIsKernel) { - createKernelComposite(); - fUstComposite = null; - } else { - createUstComposite(); - } - - fKernelButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (fKernelButton.getSelection()) { - disposeUstComposite(); - createKernelComposite(); - fDialogComposite.layout(); - } - } - }); - - fUstButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (fUstButton.getSelection()) { - disposeKernelComposite(); - createUstComposite(); - fDialogComposite.layout(); - } - } - }); - - getShell().setMinimumSize(new Point(500, 650)); - - return fDialogComposite; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ - createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ - } - - @Override - protected void okPressed() { - fIsKernel = fKernelButton.getSelection(); - - // Validate kernel composite in case of kernel domain - if (fKernelComposite != null && !fKernelComposite.isValid()) { - return; - } - - // Validate UST composite in case of UST domain - if (fUstComposite != null && !fUstComposite.isValid()) { - return; - } - - // validation successful -> call super.okPressed() - super.okPressed(); - } - - // ------------------------------------------------------------------------ - // Helper methods - // ------------------------------------------------------------------------ - - /** - * Creates the kernel composite (if not existing) - */ - private void createKernelComposite() { - if (fKernelComposite == null) { - fKernelComposite = new EnableKernelEventComposite(fDialogComposite, SWT.NONE, fProviderGroup); - GridLayout layout = new GridLayout(1, true); - fKernelComposite.setLayout(layout); - fKernelComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - fKernelComposite.createContent(); - } - } - - /** - * Disposes the kernel composite (if existing) - */ - private void disposeKernelComposite() { - if (fKernelComposite != null) { - fKernelComposite.dispose(); - fKernelComposite = null; - } - } - - /** - * Creates the UST composite (if not existing) - */ - private void createUstComposite() { - if (fUstComposite == null) { - fUstComposite = new EnableUstEventsComposite(fDialogComposite, SWT.NONE, fProviderGroup); - GridLayout layout = new GridLayout(1, true); - fUstComposite.setLayout(layout); - fUstComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - fUstComposite.createContent(); - } - } - - /** - * Disposes the UST composite (if existing) - */ - private void disposeUstComposite() { - if (fUstComposite != null) { - fUstComposite.dispose(); - fUstComposite = null; - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java deleted file mode 100644 index 7dc6300752..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java +++ /dev/null @@ -1,601 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Marc-Andre Laperle - Add filtering textbox - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTreeViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlContentProvider; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlLabelProvider; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.FilteredTree; -import org.eclipse.ui.dialogs.PatternFilter; - -/** - *

- * A composite for collecting information about kernel events to be enabled. - *

- * - * @author Bernd Hufmann - */ -public class EnableKernelEventComposite extends Composite implements IEnableKernelEvents { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - private enum KernelGroupEnum { TRACEPOINTS, SYSCALLS, PROBE, FUNCTION } - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * A button to enable/disable the tracepoints group - */ - private Button fTracepointsActivateButton; - /** - * A tree viewer for displaying and selection of available tracepoints. - */ - private CheckboxTreeViewer fTracepointsViewer; - /** - * A button to enable/disable the syscalls group - */ - private Button fSysCallsActivateButton; - /** - * A button to enable or disable the dynamic probe group. - */ - private Button fProbeActivateButton; - /** - * The text field for the event name for the dynamic probe. - */ - private Text fProbeEventNameText; - /** - * The text field for the dynamic probe. - */ - private Text fProbeText; - /** - * A button to enable or disable the dynamic function probe group. - */ - private Button fFunctionActivateButton; - /** - * The text field for the event name for the dynamic probe. - */ - private Text fFunctionEventNameText; - /** - * The text field for the dynamic function entry/return probe. - */ - private Text fFunctionText; - /** - * The referenced trace provider group containing the kernel provider - * component which contains a list of available tracepoints. - */ - private final TraceProviderGroup fProviderGroup; - /** - * The flag indicating that tracepoints are selected. - */ - private boolean fIsTracepoints; - /** - * The flag indicating that all tracepoints are selected. - */ - private boolean fIsAllTracepoints; - /** - * The flag indicating that syscalls are selected. - */ - private boolean fIsSysCalls; - /** - * The list of tracepoints to be enabled. - */ - private List fSelectedEvents; - /** - * The flag indicating that dynamic probe is selected. - */ - private boolean fIsDynamicProbe; - /** - * The event name of the dynamic probe. - */ - private String fProbeEventName; - /** - * The dynamic probe. - */ - private String fProbeString; - /** - * The flag indicating that the dynamic function probe is selected. - */ - private boolean fIsDynamicFunctionProbe; - /** - * The event name of the dynamic function entry/return probe. - */ - private String fFunctionEventName; - /** - * The dynamic function entry/return probe. - */ - private String fFunctionString; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * - * @param parent - * The parent composite - * @param style - * The index of the style for this event composite - * @param providerGroup - * The trace provider group - */ - public EnableKernelEventComposite(Composite parent, int style, TraceProviderGroup providerGroup) { - super(parent, style); - fProviderGroup = providerGroup; - } - - // ------------------------------------------------------------------------ - // Acessors - // ------------------------------------------------------------------------ - - @Override - public boolean isTracepoints() { - return fIsTracepoints; - } - - @Override - public boolean isAllTracePoints() { - return fIsAllTracepoints; - } - - @Override - public boolean isSysCalls() { - return fIsSysCalls; - } - - @Override - public boolean isAllSysCalls() { - return fIsSysCalls; - } - - @Override - public List getEventNames() { - return new ArrayList<>(fSelectedEvents); - } - - @Override - public boolean isDynamicProbe() { - return fIsDynamicProbe; - } - - @Override - public String getProbeName() { - return fProbeString; - } - - @Override - public String getProbeEventName() { - return fProbeEventName; - } - - @Override - public boolean isDynamicFunctionProbe() { - return fIsDynamicFunctionProbe; - } - - @Override - public String getFunctionEventName() { - return fFunctionEventName; - } - - @Override - public String getFunction() { - return fFunctionString; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Creates the composite content - */ - public void createContent() { - - // Tracepoints Group - createTracepointsGroup(); - - // Syscalls Group - createSysCallsGroup(); - - // Dynamic Probe Group - createDynamicProbeGroup(); - - // Dynamic Function Probe Group - createDynamicFunctionPropeGroup(); - - // Set default enablements - setKernelEnablements(KernelGroupEnum.TRACEPOINTS); - } - - /** - * Validates the kernel composite input data. - * @return true if configured data is valid and can be retrieved. - */ - public boolean isValid() { - fIsTracepoints = fTracepointsActivateButton.getSelection(); - fIsSysCalls = fSysCallsActivateButton.getSelection(); - fIsDynamicProbe = fProbeActivateButton.getSelection(); - fIsDynamicFunctionProbe = fFunctionActivateButton.getSelection(); - - // initialize tracepoint fields - fIsAllTracepoints = false; - fSelectedEvents = new ArrayList<>(); - - if (fIsTracepoints) { - List comps = fProviderGroup.getChildren(KernelProviderComponent.class); - fIsAllTracepoints = fTracepointsViewer.getChecked(comps.get(0)); - - Object[] checkedElements = fTracepointsViewer.getCheckedElements(); - for (int i = 0; i < checkedElements.length; i++) { - ITraceControlComponent component = (ITraceControlComponent)checkedElements[i]; - if (component instanceof BaseEventComponent) { - fSelectedEvents.add(component.getName()); - } - } - } - - if (fIsDynamicProbe) { - String temp = fProbeEventNameText.getText(); - if (temp.isEmpty() || - fProbeText.getText().matches("\\s*") || //$NON-NLS-1$ - (!temp.matches("^[\\s]{0,}$") && !temp.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$ - MessageDialog.openError(getShell(), - Messages.TraceControl_EnableEventsDialogTitle, - Messages.TraceControl_InvalidProbeNameError + " (" + temp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - - return false; - } - - fProbeEventName = temp; - // fProbeString will be validated by lttng-tools - fProbeString = fProbeText.getText(); - } - - // initialize function string - fFunctionEventName = null; - fFunctionString = null; - if (fIsDynamicFunctionProbe) { - String functionTemp = fFunctionEventNameText.getText(); - if (functionTemp.isEmpty() || - functionTemp.matches("\\s*") || //$NON-NLS-1$ - (!functionTemp.matches("^[\\s]{0,}$") && !functionTemp.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$ - MessageDialog.openError(getShell(), - Messages.TraceControl_EnableEventsDialogTitle, - Messages.TraceControl_InvalidProbeNameError + " (" + functionTemp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - - return false; - } - - fFunctionEventName = functionTemp; - // fFunctionString will be validated by lttng-tools - fFunctionString = fFunctionText.getText(); - } - - return true; - } - - /** - * Creates tracepoints group. - */ - private void createTracepointsGroup() { - - GridLayout layout; - GridData data; - Group tpMainGroup = new Group(this, SWT.SHADOW_NONE); - tpMainGroup.setText(Messages.TraceControl_EnableEventsTracepointGroupName); - layout = new GridLayout(2, false); - tpMainGroup.setLayout(layout); - data = new GridData(GridData.FILL_BOTH); - tpMainGroup.setLayoutData(data); - - Composite buttonComposite = new Composite(tpMainGroup, SWT.NONE); - layout = new GridLayout(1, true); - buttonComposite.setLayout(layout); - data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); - buttonComposite.setLayoutData(data); - - fTracepointsActivateButton = new Button(buttonComposite, SWT.RADIO); - fTracepointsActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); - data = new GridData(GridData.FILL_HORIZONTAL); - fTracepointsActivateButton.setLayoutData(data); - fTracepointsActivateButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setKernelEnablements(KernelGroupEnum.TRACEPOINTS); - } - }); - - Group tracepointsGroup = new Group(tpMainGroup, SWT.SHADOW_NONE); - layout = new GridLayout(1, true); - tracepointsGroup.setLayout(layout); - data = new GridData(GridData.FILL_BOTH); - tracepointsGroup.setLayoutData(data); - - new FilteredTree(tracepointsGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, new PatternFilter(), true) { - @Override - protected TreeViewer doCreateTreeViewer(Composite aparent, int style) { - fTracepointsViewer = new CheckboxTreeViewer(aparent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - fTracepointsViewer.getTree().setToolTipText(Messages.TraceControl_EnableEventsTracepointTreeTooltip); - - fTracepointsViewer.setContentProvider(new KernelContentProvider()); - fTracepointsViewer.setLabelProvider(new KernelLabelProvider()); - fTracepointsViewer.addCheckStateListener(new KernelCheckListener()); - fTracepointsViewer.setInput(fProviderGroup); - - fTracepointsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH)); - return fTracepointsViewer; - } - }; - } - - /** - * Creates syscalls group. - */ - private void createSysCallsGroup() { - GridLayout layout; - GridData data; - Group sysCallsMainGroup = new Group(this, SWT.SHADOW_NONE); - sysCallsMainGroup.setText(Messages.TraceControl_EnableEventsSyscallName); - sysCallsMainGroup.setToolTipText(Messages.TraceControl_EnableEventsSyscallTooltip); - layout = new GridLayout(2, false); - sysCallsMainGroup.setLayout(layout); - data = new GridData(GridData.FILL_HORIZONTAL); - sysCallsMainGroup.setLayoutData(data); - - Composite buttonComposite = new Composite(sysCallsMainGroup, SWT.NONE); - layout = new GridLayout(1, false); - buttonComposite.setLayout(layout); - data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); - buttonComposite.setLayoutData(data); - - fSysCallsActivateButton = new Button(buttonComposite, SWT.RADIO); - fSysCallsActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); - fSysCallsActivateButton.setToolTipText(Messages.TraceControl_EnableEventsSyscallTooltip); - fSysCallsActivateButton.setSelection(false); - data = new GridData(GridData.FILL_HORIZONTAL); - fSysCallsActivateButton.setLayoutData(data); - fSysCallsActivateButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setKernelEnablements(KernelGroupEnum.SYSCALLS); - } - }); - } - - /** - * Creates dynamic probe group. - */ - private void createDynamicProbeGroup() { - GridLayout layout; - GridData data; - Group probeMainGroup = new Group(this, SWT.SHADOW_NONE); - probeMainGroup.setText(Messages.TraceControl_EnableEventsProbeGroupName); - layout = new GridLayout(2, false); - probeMainGroup.setLayout(layout); - data = new GridData(GridData.FILL_HORIZONTAL); - probeMainGroup.setLayoutData(data); - - Composite buttonComposite = new Composite(probeMainGroup, SWT.NONE); - layout = new GridLayout(1, false); - buttonComposite.setLayout(layout); - data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); - buttonComposite.setLayoutData(data); - - fProbeActivateButton = new Button(buttonComposite, SWT.RADIO); - fProbeActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); - fProbeActivateButton.setSelection(false); - data = new GridData(GridData.FILL_HORIZONTAL); - fProbeActivateButton.setLayoutData(data); - fProbeActivateButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setKernelEnablements(KernelGroupEnum.PROBE); - } - }); - - Group probeGroup = new Group(probeMainGroup, SWT.SHADOW_NONE); - layout = new GridLayout(4, true); - probeGroup.setLayout(layout); - probeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Label probeNameLabel = new Label(probeGroup, SWT.LEFT); - probeNameLabel.setText(Messages.TraceControl_EnableEventsEventNameLabel); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 1; - probeNameLabel.setLayoutData(data); - - fProbeEventNameText = new Text(probeGroup, SWT.LEFT); - fProbeEventNameText.setToolTipText(Messages.TraceControl_EnableEventsProbeEventNameTooltip); - - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 3; - fProbeEventNameText.setLayoutData(data); - - Label probeLabel = new Label(probeGroup, SWT.LEFT); - probeLabel.setText(Messages.TraceControl_EnableEventsProbeNameLabel); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 1; - probeLabel.setLayoutData(data); - - fProbeText = new Text(probeGroup, SWT.LEFT); - fProbeText.setToolTipText(Messages.TraceControl_EnableEventsProbeNameTooltip); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 3; - fProbeText.setLayoutData(data); - } - - /** - * Creates dynamic function entry/return probe group. - */ - private void createDynamicFunctionPropeGroup() { - GridLayout layout; - GridData data; - Group functionMainGroup = new Group(this, SWT.SHADOW_NONE); - functionMainGroup.setText(Messages.TraceControl_EnableEventsFucntionGroupName); - layout = new GridLayout(2, false); - functionMainGroup.setLayout(layout); - data = new GridData(GridData.FILL_HORIZONTAL); - functionMainGroup.setLayoutData(data); - - Composite buttonComposite = new Composite(functionMainGroup, SWT.NONE); - layout = new GridLayout(1, false); - buttonComposite.setLayout(layout); - data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); - buttonComposite.setLayoutData(data); - - fFunctionActivateButton = new Button(buttonComposite, SWT.RADIO); - fFunctionActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); - fFunctionActivateButton.setSelection(false); - data = new GridData(GridData.FILL_HORIZONTAL); - fFunctionActivateButton.setLayoutData(data); - fFunctionActivateButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setKernelEnablements(KernelGroupEnum.FUNCTION); - } - }); - - Group functionGroup = new Group(functionMainGroup, SWT.SHADOW_NONE); - layout = new GridLayout(4, true); - functionGroup.setLayout(layout); - functionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Label functionNameLabel = new Label(functionGroup, SWT.LEFT); - functionNameLabel.setText(Messages.TraceControl_EnableEventsEventNameLabel); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 1; - functionNameLabel.setLayoutData(data); - - fFunctionEventNameText = new Text(functionGroup, SWT.LEFT); - fFunctionEventNameText.setToolTipText(Messages.TraceControl_EnableEventsFunctionEventNameTooltip); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 3; - fFunctionEventNameText.setLayoutData(data); - - Label functionLabel = new Label(functionGroup, SWT.LEFT); - functionLabel.setText(Messages.TraceControl_EnableEventsFunctionNameLabel); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 1; - functionLabel.setLayoutData(data); - - fFunctionText = new Text(functionGroup, SWT.LEFT); - fFunctionText.setToolTipText(Messages.TraceControl_EnableEventsProbeNameTooltip); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 3; - fFunctionText.setLayoutData(data); - } - - /** - * Enable/selects widgets depending on the group specified. - * @param group - group to enable. - */ - private void setKernelEnablements(KernelGroupEnum group) { - fTracepointsActivateButton.setSelection(group == KernelGroupEnum.TRACEPOINTS); - fTracepointsViewer.getTree().setEnabled(group == KernelGroupEnum.TRACEPOINTS); - - fSysCallsActivateButton.setSelection(group == KernelGroupEnum.SYSCALLS); - - fProbeActivateButton.setSelection(group == KernelGroupEnum.PROBE); - fProbeEventNameText.setEnabled(group == KernelGroupEnum.PROBE); - fProbeText.setEnabled(group == KernelGroupEnum.PROBE); - - fFunctionActivateButton.setSelection(group == KernelGroupEnum.FUNCTION); - fFunctionEventNameText.setEnabled(group == KernelGroupEnum.FUNCTION); - fFunctionText.setEnabled(group == KernelGroupEnum.FUNCTION); - } - - // ------------------------------------------------------------------------ - // Local classes - // ------------------------------------------------------------------------ - /** - * Content provider for the tracepoints tree. - */ - public static final class KernelContentProvider extends TraceControlContentProvider { - @Override - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof TraceProviderGroup) { - List children = ((ITraceControlComponent)parentElement).getChildren(KernelProviderComponent.class); - return children.toArray(new ITraceControlComponent[children.size()]); - } - if (parentElement instanceof ITraceControlComponent) { - return ((ITraceControlComponent)parentElement).getChildren(); - } - return new Object[0]; - } - } - - /** - * Content label for the tracepoints tree. - */ - public static final class KernelLabelProvider extends TraceControlLabelProvider { - @Override - public Image getImage(Object element) { - return null; - } - @Override - public String getText(Object element) { - if ((element != null) && (element instanceof KernelProviderComponent)) { - return Messages.TraceControl_EnableEventsTracepointTreeAllLabel; - } - return super.getText(element); - } - } - - /** - * Check state listener for the tracepoints tree. - */ - public final class KernelCheckListener implements ICheckStateListener { - @Override - public void checkStateChanged(CheckStateChangedEvent event) { - if (event.getChecked()) { - if (event.getElement() instanceof KernelProviderComponent) { - fTracepointsViewer.setSubtreeChecked(event.getElement(), true); - } - } else { - if (event.getElement() instanceof KernelProviderComponent) { - fTracepointsViewer.setSubtreeChecked(event.getElement(), false); - } else { - ITraceControlComponent component = (ITraceControlComponent) event.getElement(); - fTracepointsViewer.setChecked(component.getParent(), false); - } - } - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java deleted file mode 100644 index af21af6aae..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java +++ /dev/null @@ -1,637 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Marc-Andre Laperle - Add filtering textbox - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTreeViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlContentProvider; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlLabelProvider; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.FilteredTree; -import org.eclipse.ui.dialogs.PatternFilter; - -/** - *

- * A composite for collecting information about UST events to be enabled. - *

- * - * @author Bernd Hufmann - */ -public class EnableUstEventsComposite extends Composite implements IEnableUstEvents { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - private enum GroupEnum { TRACEPOINTS, WILDCARD, LOGLEVEL } - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * A button to enable/disable the tracepoints group - */ - private Button fTracepointsActivateButton; - /** - * A tree viewer for diplaying and selection of available tracepoints. - */ - private CheckboxTreeViewer fTracepointsViewer; - /** - * A button to enable/disable the wildcard group - */ - private Button fWildcardActivateButton; - /** - * A Text field for the event's wildcard. - */ - private Text fWildcardText; - /** - * A button to enable/disable the log level group - */ - private Button fLogLevelActivateButton; - /** - * A Text field for the event name for the log level enablement. - */ - private Text fLogLevelEventNameText; - /** - * A Combo box for selecting the log level. - */ - private CCombo fLogLevelCombo; - /** - * A button for selecting the log level (range 0 to level). - */ - private Button fLogLevelButton; - /** - * A button for selecting the specified log level only. - */ - private Button fLogLevelOnlyButton; - /** - * The filter text - */ - private Text fFilterText; - - /** - * The referenced trace provider group containing the UST providers - * component which contains a list of available tracepoints. - */ - private final TraceProviderGroup fProviderGroup; - /** - * The flag indicating that tracepoints are selected. - */ - private boolean fIsTracepoints; - /** - * The flag indicating that all tracepoints (across providers) are selected. - */ - private boolean fIsAllTracepoints; - /** - * The list of tracepoints to be enabled. - */ - private List fSelectedEvents; - /** - * The flag indicating that all wildcard are selected.. - */ - private boolean fIsWildcard; - /** - * The wildcard if wildcard is selected. - */ - private String fWildcard; - /** - *The flag indicating that all log level are selected. - */ - private boolean fIsLogLevel; - /** - * The event name for the log level enablement. - */ - private String fLogLevelEventName; - /** - * The type of the log level (loglevel or loglevel-only) - */ - private LogLevelType fLogLevelType; - /** - * The actual selected log level. - */ - private TraceLogLevel fLogLevel; - /** - * The filter expression - */ - private String fFilterExpression; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param parent - a parent composite - * @param style - a composite style - * @param providerGroup - the trace provider group - */ - public EnableUstEventsComposite(Composite parent, int style, TraceProviderGroup providerGroup) { - super(parent, style); - fProviderGroup = providerGroup; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public boolean isTracepoints() { - return fIsTracepoints; - } - - @Override - public boolean isAllTracePoints() { - return fIsAllTracepoints; - } - - @Override - public List getEventNames() { - return new ArrayList<>(fSelectedEvents); - } - - @Override - public boolean isWildcard() { - return fIsWildcard; - } - - @Override - public String getWildcard() { - return fWildcard; - } - - @Override - public boolean isLogLevel() { - return fIsLogLevel; - } - - @Override - public LogLevelType getLogLevelType() { - return fLogLevelType; - } - - @Override - public TraceLogLevel getLogLevel() { - return fLogLevel; - } - - @Override - public String getLogLevelEventName() { - return fLogLevelEventName; - } - - @Override - public String getFilterExpression() { - return fFilterExpression; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Create the contents of this event composite - */ - public void createContent() { - - // Tracepoints Group - createTracepointsGroup(); - - // Wildcard Group - createWildCardGroup(); - - // Log Level Group - createLogLevelGroup(); - - // Filter Group - createFilterGroup(); - - // Set default enablements - setEnablements(GroupEnum.TRACEPOINTS); - } - - /** - * Validates the UST composite input data. - * - * @return true if configured data is valid and can be retrieved. - */ - public boolean isValid() { - - fIsTracepoints = fTracepointsActivateButton.getSelection(); - fIsWildcard = fWildcardActivateButton.getSelection(); - fIsLogLevel = fLogLevelActivateButton.getSelection(); - - // initialize tracepoint fields - fIsAllTracepoints = false; - fSelectedEvents = new ArrayList<>(); - if (fIsTracepoints) { - fIsAllTracepoints = fTracepointsViewer.getChecked(fProviderGroup); - Set set = new HashSet<>(); - Object[] checkedElements = fTracepointsViewer.getCheckedElements(); - for (int i = 0; i < checkedElements.length; i++) { - ITraceControlComponent component = (ITraceControlComponent)checkedElements[i]; - if (!set.contains(component.getName()) && (component instanceof BaseEventComponent)) { - set.add(component.getName()); - fSelectedEvents.add(component.getName()); - } - } - } - - // initialize log level event name string - fLogLevelType = LogLevelType.LOGLEVEL_NONE; - fLogLevelEventName = null; - - if (fIsLogLevel) { - if (fLogLevelButton.getSelection()) { - fLogLevelType = LogLevelType.LOGLEVEL; - } else if (fLogLevelOnlyButton.getSelection()) { - fLogLevelType = LogLevelType.LOGLEVEL_ONLY; - } - - String temp = fLogLevelEventNameText.getText(); - if (temp.isEmpty() || - temp.matches("\\s*") || //$NON-NLS-1$ - (!temp.matches("^[\\s]{0,}$") && !temp.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$ - MessageDialog.openError(getShell(), - Messages.TraceControl_EnableEventsDialogTitle, - Messages.TraceControl_InvalidLogLevelEventNameError + " (" + temp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - - return false; - } - - fLogLevelEventName = temp; - - TraceLogLevel[] levels = TraceLogLevel.values(); - int id = fLogLevelCombo.getSelectionIndex(); - - if (id < 0) { - MessageDialog.openError(getShell(), - Messages.TraceControl_EnableEventsDialogTitle, - Messages.TraceControl_InvalidLogLevel + " (" + temp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - - return false; - } - fLogLevel = levels[id]; - } - - // initialize wildcard with null - fWildcard = null; - if (fIsWildcard) { - String tempWildcard = fWildcardText.getText(); - if (tempWildcard.isEmpty() || - tempWildcard.matches("\\s*") || //$NON-NLS-1$ - (!tempWildcard.matches("^[\\s]{0,}$") && !tempWildcard.matches("^[a-zA-Z0-9\\-\\_\\*]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$ - MessageDialog.openError(getShell(), - Messages.TraceControl_EnableEventsDialogTitle, - Messages.TraceControl_InvalidWildcardError + " (" + tempWildcard + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - - return false; - } - - fWildcard = tempWildcard; - } - - // initialize filter with null - fFilterExpression = null; - if (fProviderGroup.isEventFilteringSupported()) { - String tempFilter = fFilterText.getText(); - - if(!tempFilter.isEmpty() && !tempFilter.matches("\\s*")) { //$NON-NLS-1$ - fFilterExpression = tempFilter; - } - } - - // validation successful -> call super.okPressed() - return true; - } - - // ------------------------------------------------------------------------ - // Helper methods - // ------------------------------------------------------------------------ - - /** - * Creates tracepoints group. - */ - private void createTracepointsGroup() { - Group tpMainGroup = new Group(this, SWT.SHADOW_NONE); - tpMainGroup.setText(Messages.TraceControl_EnableEventsTracepointGroupName); - GridLayout layout = new GridLayout(2, false); - tpMainGroup.setLayout(layout); - GridData data = new GridData(GridData.FILL_BOTH); - tpMainGroup.setLayoutData(data); - - Composite buttonComposite = new Composite(tpMainGroup, SWT.NONE); - layout = new GridLayout(1, true); - buttonComposite.setLayout(layout); - data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); - buttonComposite.setLayoutData(data); - - fTracepointsActivateButton = new Button(buttonComposite, SWT.RADIO); - fTracepointsActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); - data = new GridData(GridData.FILL_HORIZONTAL); - fTracepointsActivateButton.setLayoutData(data); - fTracepointsActivateButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setEnablements(GroupEnum.TRACEPOINTS); - } - }); - - Group tpGroup = new Group(tpMainGroup, SWT.SHADOW_NONE); - layout = new GridLayout(1, true); - tpGroup.setLayout(layout); - data = new GridData(GridData.FILL_BOTH); - tpGroup.setLayoutData(data); - new FilteredTree(tpGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, new PatternFilter(), true) { - @Override - protected TreeViewer doCreateTreeViewer(Composite aparent, int style) { - fTracepointsViewer = new CheckboxTreeViewer(aparent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - fTracepointsViewer.getTree().setToolTipText(Messages.TraceControl_EnableEventsTracepointTreeTooltip); - fTracepointsViewer.setContentProvider(new UstContentProvider()); - - fTracepointsViewer.setLabelProvider(new UstLabelProvider()); - fTracepointsViewer.addCheckStateListener(new UstCheckStateListener()); - - fTracepointsViewer.setInput(fProviderGroup.getParent()); - fTracepointsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH)); - return fTracepointsViewer; - } - }; - } - - /** - * Creates wildcard group. - */ - private void createWildCardGroup() { - Group wildcardMainGroup = new Group(this, SWT.SHADOW_NONE); - wildcardMainGroup.setText(Messages.TraceControl_EnableEventsWildcardGroupName); - GridLayout layout = new GridLayout(2, false); - wildcardMainGroup.setLayout(layout); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - wildcardMainGroup.setLayoutData(data); - - Composite buttonComposite = new Composite(wildcardMainGroup, SWT.NONE); - layout = new GridLayout(1, false); - buttonComposite.setLayout(layout); - data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); - buttonComposite.setLayoutData(data); - - fWildcardActivateButton = new Button(buttonComposite, SWT.RADIO); - fWildcardActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); - fWildcardActivateButton.setSelection(false); - data = new GridData(GridData.FILL_HORIZONTAL); - fWildcardActivateButton.setLayoutData(data); - fWildcardActivateButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setEnablements(GroupEnum.WILDCARD); - } - }); - - Group wildcardGroup = new Group(wildcardMainGroup, SWT.SHADOW_NONE); - layout = new GridLayout(3, true); - wildcardGroup.setLayout(layout); - data = new GridData(GridData.FILL_HORIZONTAL); - wildcardGroup.setLayoutData(data); - - Label wildcardLabel = new Label(wildcardGroup, SWT.LEFT); - wildcardLabel.setText(Messages.TraceControl_EnableEventsWildcardLabel); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - wildcardLabel.setLayoutData(data); - - fWildcardText = new Text(wildcardGroup, SWT.LEFT); - fWildcardText.setToolTipText(Messages.TraceControl_EnableEventsWildcardTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - fWildcardText.setLayoutData(data); - } - - /** - * Creates log level group. - */ - private void createLogLevelGroup() { - Group logLevelMainGroup = new Group(this, SWT.SHADOW_NONE); - logLevelMainGroup.setText(Messages.TraceControl_EnableEventsLogLevelGroupName); - GridLayout layout = new GridLayout(2, false); - logLevelMainGroup.setLayout(layout); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - logLevelMainGroup.setLayoutData(data); - - Composite buttonComposite = new Composite(logLevelMainGroup, SWT.NONE); - layout = new GridLayout(1, false); - buttonComposite.setLayout(layout); - data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); - buttonComposite.setLayoutData(data); - - fLogLevelActivateButton = new Button(buttonComposite, SWT.RADIO); - fLogLevelActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); - fLogLevelActivateButton.setSelection(false); - data = new GridData(GridData.FILL_HORIZONTAL); - fLogLevelActivateButton.setLayoutData(data); - fLogLevelActivateButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setEnablements(GroupEnum.LOGLEVEL); - } - }); - - Group logLevelGroup = new Group(logLevelMainGroup, SWT.SHADOW_NONE); - layout = new GridLayout(3, true); - logLevelGroup.setLayout(layout); - logLevelGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Label logLevelEventNameLabel = new Label(logLevelGroup, SWT.LEFT); - logLevelEventNameLabel.setText(Messages.TraceControl_EnableEventsEventNameLabel); - - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 1; - logLevelEventNameLabel.setLayoutData(data); - - fLogLevelEventNameText = new Text(logLevelGroup, SWT.LEFT); - fLogLevelEventNameText.setToolTipText(Messages.TraceControl_EnableEventsLoglevelEventNameTooltip); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 2; - fLogLevelEventNameText.setLayoutData(data); - - TraceLogLevel[] levels = TraceLogLevel.values(); - - String[] levelNames = new String[levels.length - 1]; - int k = 0; - for (int i = 0; i < levels.length; i++) { - if (levels[i] != TraceLogLevel.LEVEL_UNKNOWN) { - levelNames[k++] = levels[i].getInName(); - } - } - - fLogLevelCombo = new CCombo(logLevelGroup, SWT.READ_ONLY); - fLogLevelCombo.setItems(levelNames); - fLogLevelCombo.setToolTipText(Messages.TraceControl_EnableEventsLogLevelTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 4; - fLogLevelCombo.setLayoutData(data); - - fLogLevelButton = new Button(logLevelGroup, SWT.RADIO); - fLogLevelButton.setText(Messages.TraceControl_EnableEventsLogLevelTypeName); - fLogLevelButton.setToolTipText(Messages.TraceControl_EnableEventsLogLevelTypeTooltip); - data = new GridData(GridData.FILL_BOTH); - fLogLevelButton.setLayoutData(data); - fLogLevelButton.setSelection(true); - - fLogLevelOnlyButton = new Button(logLevelGroup, SWT.RADIO); - fLogLevelOnlyButton.setText(Messages.TraceControl_EnableEventsLogLevelOnlyTypeName); - fLogLevelOnlyButton.setToolTipText(Messages.TraceControl_EnableEventsLogLevelOnlyTypeTooltip); - data = new GridData(GridData.FILL_BOTH); - fLogLevelButton.setLayoutData(data); - } - - void createFilterGroup() { - if (fProviderGroup.isEventFilteringSupported()) { - Group filterMainGroup = new Group(this, SWT.SHADOW_NONE); - filterMainGroup.setText(Messages.TraceControl_EnableEventsFilterGroupName); - GridLayout layout = new GridLayout(3, false); - filterMainGroup.setLayout(layout); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - filterMainGroup.setLayoutData(data); - - fFilterText = new Text(filterMainGroup, SWT.LEFT); - fFilterText.setToolTipText(Messages.TraceControl_EnableEventsFilterTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - fFilterText.setLayoutData(data); - } - } - - /** - * Enable/selects widgets depending on the group specified. - * @param group - group to enable. - */ - private void setEnablements(GroupEnum group) { - - // Enable/disable trace point items - fTracepointsActivateButton.setSelection(group == GroupEnum.TRACEPOINTS); - fTracepointsViewer.getTree().setEnabled(group == GroupEnum.TRACEPOINTS); - - // Enable/disable wildcard items - fWildcardActivateButton.setSelection(group == GroupEnum.WILDCARD); - fWildcardText.setEnabled(group == GroupEnum.WILDCARD); - - // Enable/disable log level items - fLogLevelActivateButton.setSelection(group == GroupEnum.LOGLEVEL); - fLogLevelEventNameText.setEnabled(group == GroupEnum.LOGLEVEL); - fLogLevelCombo.setEnabled(group == GroupEnum.LOGLEVEL); - fLogLevelButton.setEnabled(group == GroupEnum.LOGLEVEL); - fLogLevelOnlyButton.setEnabled(group == GroupEnum.LOGLEVEL); - } - - // ------------------------------------------------------------------------ - // Local classes - // ------------------------------------------------------------------------ - /** - * Content provider for the tracepoints tree. - */ - public static final class UstContentProvider extends TraceControlContentProvider { - @Override - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof TargetNodeComponent) { - List children = ((ITraceControlComponent)parentElement).getChildren(TraceProviderGroup.class); - return children.toArray(new ITraceControlComponent[children.size()]); - } - if (parentElement instanceof TraceProviderGroup) { - List children = ((ITraceControlComponent)parentElement).getChildren(UstProviderComponent.class); - return children.toArray(new ITraceControlComponent[children.size()]); - } - if (parentElement instanceof ITraceControlComponent) { - return ((ITraceControlComponent)parentElement).getChildren(); - } - return new Object[0]; - } - } - - /** - * Content label for the tracepoints tree. - */ - public static final class UstLabelProvider extends TraceControlLabelProvider { - @Override - public Image getImage(Object element) { - return null; - } - @Override - public String getText(Object element) { - if ((element != null) && (element instanceof TraceProviderGroup)) { - return Messages.TraceControl_EnableEventsTracepointTreeAllLabel; - } - - if ((element != null) && (element instanceof UstProviderComponent)) { - return Messages.TraceControl_EnableEventsTracepointTreeAllLabel + " - " + ((UstProviderComponent)element).getName(); //$NON-NLS-1$ - } - return super.getText(element); - } - } - - /** - * Check state listener for the tracepoints tree. - */ - public final class UstCheckStateListener implements ICheckStateListener { - @Override - public void checkStateChanged(CheckStateChangedEvent event) { - if (event.getChecked()) { - if (event.getElement() instanceof TraceProviderGroup) { - fTracepointsViewer.setSubtreeChecked(event.getElement(), true); - } - if (event.getElement() instanceof UstProviderComponent) { - fTracepointsViewer.setSubtreeChecked(event.getElement(), true); - } - } else { - if (event.getElement() instanceof TraceProviderGroup) { - fTracepointsViewer.setSubtreeChecked(event.getElement(), true); - } - if (event.getElement() instanceof UstProviderComponent) { - ITraceControlComponent component = (ITraceControlComponent) event.getElement(); - fTracepointsViewer.setSubtreeChecked(event.getElement(), false); - fTracepointsViewer.setChecked(component.getParent(), false); - } else { - ITraceControlComponent component = (ITraceControlComponent) event.getElement(); - fTracepointsViewer.setChecked(component.getParent(), false); - fTracepointsViewer.setChecked(component.getParent().getParent(), false); - } - } - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/GetEventInfoDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/GetEventInfoDialog.java deleted file mode 100644 index 2ec434aeb0..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/GetEventInfoDialog.java +++ /dev/null @@ -1,281 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.Arrays; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - *

- * Dialog box for collecting information about the events to enable. - *

- * - * @author Bernd Hufmann - */ -public class GetEventInfoDialog extends Dialog implements IGetEventInfoDialog { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The icon file for this dialog box. - */ - public static final String TARGET_NEW_CONNECTION_ICON_FILE = "icons/elcl16/enable_event.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The session combo box. - */ - private CCombo fSessionsCombo = null; - /** - * The channel combo box. - */ - private CCombo fChannelsCombo = null; - /** - * The filter text - */ - private Text fFilterText; - /** - * The list of available sessions. - */ - private TraceSessionComponent[] fSessions; - /** - * True for kernel, false for UST. - */ - private boolean fIsKernel; - /** - * Index in session array (selected session). - */ - private int fSessionIndex = 0; - /** - * The Channel where the events should be enabled. - */ - private TraceChannelComponent fChannel; - /** - * List of available channels of the selected session. - */ - private TraceChannelComponent[] fChannels; - /** - * The filter expression - */ - private String fFilterExpression; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor of dialog box. - * @param shell - the shell for the dialog box - */ - public GetEventInfoDialog(Shell shell) { - super(shell); - setShellStyle(SWT.RESIZE | getShellStyle()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public TraceSessionComponent getSession() { - return fSessions[fSessionIndex]; - } - - @Override - public TraceChannelComponent getChannel() { - return fChannel; - } - - @Override - public void setIsKernel(boolean isKernel) { - fIsKernel = isKernel; - } - - @Override - public void setSessions(TraceSessionComponent[] sessions) { - fSessions = Arrays.copyOf(sessions, sessions.length); - } - - @Override - public String getFilterExpression() { - return fFilterExpression; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.TraceControl_EnableEventsDialogTitle); - newShell.setImage(Activator.getDefault().loadIcon(TARGET_NEW_CONNECTION_ICON_FILE)); - } - - @Override - protected Control createDialogArea(Composite parent) { - - // Main dialog panel - Composite dialogComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - dialogComposite.setLayout(layout); - dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - Group sessionsGroup = new Group(dialogComposite, SWT.SHADOW_NONE); - sessionsGroup.setText(Messages.TraceControl_EnableEventsSessionGroupName); - layout = new GridLayout(1, true); - sessionsGroup.setLayout(layout); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - sessionsGroup.setLayoutData(data); - - fSessionsCombo = new CCombo(sessionsGroup, SWT.READ_ONLY); - fSessionsCombo.setToolTipText(Messages.TraceControl_EnableEventsSessionsTooltip); - fSessionsCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - String items[] = new String[fSessions.length]; - for (int i = 0; i < items.length; i++) { - items[i] = String.valueOf(fSessions[i].getName()); - } - - fSessionsCombo.setItems(items); - fSessionsCombo.setEnabled(fSessions.length > 0); - - Group channelsGroup = new Group(dialogComposite, SWT.SHADOW_NONE); - channelsGroup.setText(Messages.TraceControl_EnableEventsChannelGroupName); - layout = new GridLayout(1, true); - channelsGroup.setLayout(layout); - data = new GridData(GridData.FILL_HORIZONTAL); - channelsGroup.setLayoutData(data); - - fChannelsCombo = new CCombo(channelsGroup, SWT.READ_ONLY); - fChannelsCombo.setToolTipText(Messages.TraceControl_EnableEventsChannelsTooltip); - fChannelsCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - fChannelsCombo.setEnabled(false); - - fSessionsCombo.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - fSessionIndex = fSessionsCombo.getSelectionIndex(); - - if (fSessionIndex >= 0) { - TraceDomainComponent domain = null; - TraceDomainComponent[] domains = fSessions[fSessionIndex].getDomains(); - for (int i = 0; i < domains.length; i++) { - - if (domains[i].isKernel() == fIsKernel) { - domain = domains[i]; - break; - } - } - - if (domain != null) { - fChannels = domain.getChannels(); - String selectionItems[] = new String[fChannels.length]; - for (int i = 0; i < selectionItems.length; i++) { - selectionItems[i] = String.valueOf(fChannels[i].getName()); - } - fChannelsCombo.setItems(selectionItems); - fChannelsCombo.setEnabled(fChannels.length > 0); - } else { - fChannelsCombo.setItems(new String[0]); - fChannelsCombo.setEnabled(false); - fChannels = null; - } - fChannelsCombo.getParent().getParent().layout(); - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - // take first session to test whether events filtering is supported or not - if (fSessions[0].isEventFilteringSupported() && !fIsKernel) { - Group filterMainGroup = new Group(dialogComposite, SWT.SHADOW_NONE); - filterMainGroup.setText(Messages.TraceControl_EnableEventsFilterGroupName); - layout = new GridLayout(2, false); - filterMainGroup.setLayout(layout); - data = new GridData(GridData.FILL_HORIZONTAL); - filterMainGroup.setLayoutData(data); - - fFilterText = new Text(filterMainGroup, SWT.LEFT); - fFilterText.setToolTipText(Messages.TraceControl_EnableEventsFilterTooltip); - data = new GridData(GridData.FILL_HORIZONTAL); - fFilterText.setLayoutData(data); - } - - getShell().setMinimumSize(new Point(300, 200)); - - return dialogComposite; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ - createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ - } - - @Override - protected void okPressed() { - - if (fSessionsCombo.getSelectionIndex() < 0) { - MessageDialog.openError(getShell(), - Messages.TraceControl_EnableEventsDialogTitle, - Messages.TraceControl_EnableEventsNoSessionError); - return; - } - - fSessionIndex = fSessionsCombo.getSelectionIndex(); - - // if no channel is available or no channel is selected use default channel indicated by fChannel=null - fChannel = null; - if ((fChannels != null) && (fChannelsCombo.getSelectionIndex() >= 0)) { - fChannel = fChannels[fChannelsCombo.getSelectionIndex()]; - } - - // initialize filter with null - fFilterExpression = null; - if (fSessions[0].isEventFilteringSupported() && !fIsKernel) { - String tempFilter = fFilterText.getText(); - - if(!tempFilter.isEmpty() && !tempFilter.matches("\\s*")) { //$NON-NLS-1$ - fFilterExpression = tempFilter; - } - } - - super.okPressed(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IAddContextDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IAddContextDialog.java deleted file mode 100644 index b65c3ba29f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IAddContextDialog.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.List; - -/** - *

- * Interface for providing information about contexts to be added to channels/events. - *

- * - * @author Bernd Hufmann - */ -public interface IAddContextDialog { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * Sets the available contexts to choose from. - * @param contexts - a list of available contexts. - */ - void setAvalibleContexts(List contexts); - - /** - * @return array of contexts to be added - */ - List getContexts(); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * @return returns the open return value - */ - int open(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IConfirmDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IConfirmDialog.java deleted file mode 100644 index 4c36519cee..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IConfirmDialog.java +++ /dev/null @@ -1,38 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.swt.widgets.Shell; - -/** - *

- * Interface for a confirmation dialog. - *

- * - * @author Bernd Hufmann - */ -public interface IConfirmDialog { - - /** - * Open a confirmation dialog - * - * @param parent - * The parent shell - * @param title - * The title of the dialog window - * @param message - * The message in the dialog window - * @return If the user clicked OK (true) or Cancel (false) - */ - boolean openConfirm(Shell parent, String title, String message); - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ICreateSessionDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ICreateSessionDialog.java deleted file mode 100644 index c2c914755b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ICreateSessionDialog.java +++ /dev/null @@ -1,52 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; - -/** - *

- * Interface for create session dialog. - *

- * - * @author Bernd Hufmann - */ -public interface ICreateSessionDialog { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * Get the parameters necessary for the creation of a LTTng session - * - * @return the parameters - */ - ISessionInfo getParameters(); - - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * Initializes the dialog box. - * @param group - the session group - */ - void initialize(TraceSessionGroup group); - - /** - * @return the open return value - */ - int open(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableChannelDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableChannelDialog.java deleted file mode 100644 index b0aad194fc..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableChannelDialog.java +++ /dev/null @@ -1,65 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; - -/** - *

- * Interface for the enable channel dialog when domain is known. - *

- * - * @author Bernd Hufmann - */ -public interface IEnableChannelDialog { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return the configuration info for the new channel. - */ - IChannelInfo getChannelInfo(); - - /** - * Sets the domain component - * @param domain - the trace domain component - */ - void setDomainComponent(TraceDomainComponent domain); - - /** - * Set the targent node component - * @param node - the node component - */ - void setTargetNodeComponent(TargetNodeComponent node); - - /** - * @return true for Kernel domain. False for UST. - */ - boolean isKernel(); - - /** - * Sets the whether dialog is for Kernel or UST - * @param isKernel true for kernel domain else UST - */ - void setHasKernel(boolean isKernel); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * @return the open return value - */ - int open(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableEventsDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableEventsDialog.java deleted file mode 100644 index 90ac9b4cf5..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableEventsDialog.java +++ /dev/null @@ -1,53 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; - -/** - *

- * Interface for providing information about Kernel or UST events to be enabled. - *

- * - * @author Bernd Hufmann - */ -public interface IEnableEventsDialog extends IEnableKernelEvents, IEnableUstEvents { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return the session the events shall be enabled. - */ - boolean isKernel(); - - /** - * Sets the trace provider group. - * @param providerGroup - a trace provider group - */ - void setTraceProviderGroup(TraceProviderGroup providerGroup); - - /** - * Sets the trace domain component. - * @param domain - a domain of the events (null if not known) - */ - void setTraceDomainComponent(TraceDomainComponent domain); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * @return returns the open return value - */ - int open(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java deleted file mode 100644 index 66a8f59f8f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java +++ /dev/null @@ -1,84 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.List; - -/** - *

- * Interface for providing information about kernel events to be enabled. - *

- * - * @author Bernd Hufmann - */ -public interface IEnableKernelEvents { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * @return a flag whether the tracepoints shall be configured. - */ - boolean isTracepoints(); - - /** - * @return a flag indicating whether all tracepoints shall be enabled or not. - */ - boolean isAllTracePoints(); - - /** - * @return a flag whether the syscalls shall be configured. - */ - boolean isSysCalls(); - - /** - * @return a flag indicating whether syscalls shall be enabled or not. - */ - boolean isAllSysCalls(); - - /** - * @return a list of event names to be enabled. - */ - List getEventNames(); - - /** - * @return a flag whether the dynamic probe shall be configured. - */ - boolean isDynamicProbe(); - - /** - * @return event name of the dynamic probe (or null if no dynamic probe). - */ - String getProbeEventName(); - - /** - * @return the dynamic probe (or null if no dynamic probe). - */ - String getProbeName(); - - /** - * @return a flag whether the dynamic function entry/return probe shall be configured. - */ - boolean isDynamicFunctionProbe(); - - /** - * @return event name of the dynamic function entry/exit probe (or null if no dynamic probe). - */ - String getFunctionEventName(); - - /** - * @return the dynamic function entry/exit probe (or null if no dynamic probe). - */ - String getFunction(); - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableUstEvents.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableUstEvents.java deleted file mode 100644 index dfe72fb63d..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableUstEvents.java +++ /dev/null @@ -1,83 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; - -/** - *

- * Interface for providing information about UST events to be enabled. - *

- * - * @author Bernd Hufmann - */ -public interface IEnableUstEvents { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * @return a flag whether the tracepoints shall be configured. - */ - boolean isTracepoints(); - - /** - * @return a flag indicating whether all tracepoints shall be enabled or not. - */ - boolean isAllTracePoints(); - - /** - * @return a list of event names to be enabled. - */ - List getEventNames(); - - /** - * @return a flag whether events using wildcards should be enabled - */ - boolean isWildcard(); - - /** - * @return a wildcard - */ - String getWildcard(); - - /** - * @return a flag whether events using log levels should be enabled - */ - boolean isLogLevel(); - - /** - * @return a log level type (loglevel or loglevel-only) - */ - LogLevelType getLogLevelType(); - - /** - * @return a log level - */ - TraceLogLevel getLogLevel(); - - /** - * @return a event name for the log level enable action - */ - String getLogLevelEventName(); - - /** - * @return a filter expression - */ - String getFilterExpression(); - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IGetEventInfoDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IGetEventInfoDialog.java deleted file mode 100644 index c61a7fe878..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IGetEventInfoDialog.java +++ /dev/null @@ -1,65 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; - -/** - *

- * Interface for a dialog box for collecting information about the events to enable. - *

- * - * @author Bernd Hufmann - */ -public interface IGetEventInfoDialog { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return the session the events shall be enabled. - */ - TraceSessionComponent getSession(); - - /** - * @return the channel the events shall be enabled. Null for default channel. - */ - TraceChannelComponent getChannel(); - - /** - * Sets flag about domain. - * @param isKernel - true for kernel, false for UST - */ - void setIsKernel(boolean isKernel); - - /** - * Sets available session. - * @param sessions - a array of available sessions. - */ - void setSessions(TraceSessionComponent[] sessions); - - /** - * Returns the filter expression. - * @return the filter expression or null for no filtering - */ - String getFilterExpression(); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * @return returns the open return value - */ - int open(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportConfirmationDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportConfirmationDialog.java deleted file mode 100644 index 59884073c1..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportConfirmationDialog.java +++ /dev/null @@ -1,49 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -/** - *

- * Interface for dialog box for updating file import information. - *

- * - * @author Bernd Hufmann - */ -public interface IImportConfirmationDialog { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @param name old trace name. - */ - void setTraceName(String name); - - /** - * @return the new trace name if not overwrite. - */ - String getNewTraceName(); - - /** - * - * @return true to overwrite existing trace. - */ - boolean isOverwrite(); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * @return the open return value - */ - int open(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportDialog.java deleted file mode 100644 index 170b021033..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportDialog.java +++ /dev/null @@ -1,63 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; - -/** - *

- * Interface for import traces dialog. - *

- * - * @author Bernd Hufmann - */ -public interface IImportDialog { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return a list of trace paths to import. - */ - List getTracePathes(); - - /** - * @return the project to import the traces to - */ - IProject getProject(); - - /** - * Sets the session containing the traces to import - * @param session The trace session - */ - void setSession(TraceSessionComponent session); - - /** - * Sets the default project name to use - * - * @param defaultProject - * the name of the default project to use - */ - void setDefaultProject(String defaultProject); - - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * @return the open return value - */ - int open(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/INewConnectionDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/INewConnectionDialog.java deleted file mode 100644 index 1bdb9a2019..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/INewConnectionDialog.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.rse.core.model.IHost; - -/** - *

- * Interface for connection information dialog. - *

- * - * @author Bernd Hufmann - */ -public interface INewConnectionDialog { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return the connection name (alias). - */ - String getConnectionName(); - - /** - * @return the host name (IP address or DNS name) - */ - String getHostName(); - - /** - * @return port of IP connection to be used - */ - int getPort(); - - /** - * Sets the trace control root - * @param parent - the trace control parent - */ - void setTraceControlParent(ITraceControlComponent parent); - - /** - * Sets the available hosts to select. - * @param hosts - the available hosts - */ - void setHosts(IHost[] hosts); - - /** - * Set the port of the IP connection to be used. - * @param port - the IP port to set - */ - void setPort(int port); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * @return returns the open return value - */ - int open(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ISelectCommandScriptDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ISelectCommandScriptDialog.java deleted file mode 100644 index 15dd52e9f3..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ISelectCommandScriptDialog.java +++ /dev/null @@ -1,32 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.List; - -/** - * Interface for dialog for selecting a command script. - * - * @author Bernd Hufmann - * - */ -public interface ISelectCommandScriptDialog { - /** - * @return a list of command - */ - List getCommands(); - - /** - * @return the open return value - */ - int open(); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportConfirmationDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportConfirmationDialog.java deleted file mode 100644 index d58d8234d3..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportConfirmationDialog.java +++ /dev/null @@ -1,200 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - *

- * Dialog box for collecting session creation information. - *

- * - * @author Bernd Hufmann - */ -public class ImportConfirmationDialog extends Dialog implements IImportConfirmationDialog { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The icon file for this dialog box. - */ - public static final String IMPORT_ICON_FILE = "icons/elcl16/import_trace.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The radio button for selecting the overwrite action - */ - private Button fOverwriteButton = null; - /** - * The radio button for selecting the renaming action - */ - private Button fRenameButton = null; - /** - * The text widget for the session name - */ - private Text fNewTraceNameText = null; - /** - * The trace name which already exists in the project - */ - private String fTraceName = null; - /** - * The session name string. - */ - private String fNewTraceName = null; - /** - * Flag whether default location (path) shall be used or not - */ - private boolean fIsOverride = true; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param shell - a shell for the display of the dialog - */ - public ImportConfirmationDialog(Shell shell) { - super(shell); - setShellStyle(SWT.RESIZE | getShellStyle()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public void setTraceName(String name) { - fTraceName = name; - } - - @Override - public String getNewTraceName() { - return fNewTraceName; - } - - @Override - public boolean isOverwrite() { - return fIsOverride; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.TraceControl_ImportDialogConfirmationTitle); - newShell.setImage(Activator.getDefault().loadIcon(IMPORT_ICON_FILE)); - } - - @Override - protected Control createDialogArea(Composite parent) { - - // Main dialog panel - Composite dialogComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - dialogComposite.setLayout(layout); - dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - Label sessionNameLabel = new Label(dialogComposite, SWT.RIGHT); - sessionNameLabel.setText(Messages.TraceControl_ImportDialogTraceAlreadyExistError + ": " + fTraceName); //$NON-NLS-1$ - - fOverwriteButton = new Button(dialogComposite, SWT.RADIO); - fOverwriteButton.setText(Messages.TraceControl_ImportDialogConfirmationOverwriteLabel); - - fOverwriteButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - fNewTraceNameText.setEnabled(false); - fNewTraceNameText.setText(fTraceName); - } - }); - - fRenameButton = new Button(dialogComposite, SWT.RADIO); - fRenameButton.setText(Messages.TraceControl_ImportDialogConfirmationRenameLabel); - - fRenameButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - fNewTraceNameText.setEnabled(true); - } - }); - - fNewTraceNameText = new Text(dialogComposite, SWT.NONE); - fNewTraceNameText.setToolTipText(Messages.TraceControl_ImportDialogConfirmationNewNameLabel); - fNewTraceNameText.setText(fTraceName); - - // Default - fOverwriteButton.setSelection(true); - fNewTraceNameText.setEnabled(false); - - - // layout widgets - GridData data = new GridData(GridData.FILL_HORIZONTAL); - - fNewTraceNameText.setLayoutData(data); - - getShell().setMinimumSize(new Point(300, 150)); - - return dialogComposite; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ - createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ - } - - @Override - protected void okPressed() { - - fIsOverride = fOverwriteButton.getSelection(); - - if (fIsOverride) { - // new name is old name - fNewTraceName = fTraceName; - } else { - fNewTraceName = fNewTraceNameText.getText(); - } - - // Check for invalid names - if (!fNewTraceName.matches("^[a-zA-Z0-9\\-\\_]{1,}$")) { //$NON-NLS-1$ - MessageDialog.openError(getShell(), - Messages.TraceControl_ImportDialogConfirmationTitle, - Messages.TraceControl_InvalidTraceNameError + " (" + fNewTraceName + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ - return; - } - - // validation successful -> call super.okPressed() - super.okPressed(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportDialog.java deleted file mode 100644 index 70a9f3cc60..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportDialog.java +++ /dev/null @@ -1,453 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Added handling of streamed traces - * Marc-Andre Laperle - Use common method to get opened tmf projects - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTreeViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.window.Window; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; -import org.eclipse.linuxtools.tmf.ui.project.model.TmfTracesFolder; -import org.eclipse.linuxtools.tmf.ui.project.model.TraceUtils; -import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType; -import org.eclipse.rse.services.clientserver.messages.SystemMessageException; -import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; -import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.model.WorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** - *

- * Dialog box for collecting trace import information. - *

- * - * @author Bernd Hufmann - */ -public class ImportDialog extends Dialog implements IImportDialog { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** The icon file for this dialog box. */ - public static final String IMPORT_ICON_FILE = "icons/elcl16/import_trace.gif"; //$NON-NLS-1$ - - /** Parent directory for UST traces */ - public static final String UST_PARENT_DIRECTORY = "ust"; //$NON-NLS-1$ - - /** Name of metadata file of trace */ - public static final String METADATA_FILE_NAME = "metadata"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The dialog composite. - */ - private Composite fDialogComposite = null; - /** - * The checkbox tree viewer for selecting available traces - */ - private CheckboxTreeViewer fFolderViewer; - /** - * The combo box for selecting a project. - */ - private CCombo fCombo; - /** - * The overwrite button - */ - private Button fOverwriteButton; - /** - * List of available LTTng 2.0 projects - */ - private List fProjects; - /** - * The parent where the new node should be added. - */ - private TraceSessionComponent fSession = null; - /** - * The name of the default project name - */ - private String fDefaultProjectName = null; - /** - * List of traces to import - */ - private final List fTraces = new ArrayList<>(); - /** - * Selection index in project combo box. - */ - private int fProjectIndex; - /** - * Flag to indicate that something went wrong when creating the dialog box. - */ - private boolean fIsError = false; - /** - * Children of the remote folder (can be null) - */ - private Object[] fFolderChildren = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param shell - a shell for the display of the dialog - */ - public ImportDialog(Shell shell) { - super(shell); - setShellStyle(SWT.RESIZE | getShellStyle()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public List getTracePathes() { - List retList = new ArrayList<>(); - retList.addAll(fTraces); - return retList; - } - - @Override - public IProject getProject() { - return fProjects.get(fProjectIndex); - } - - @Override - public void setSession(TraceSessionComponent session) { - fSession = session; - } - - @Override - public void setDefaultProject(String defaultProject) { - fDefaultProjectName = defaultProject; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.TraceControl_ImportDialogTitle); - newShell.setImage(Activator.getDefault().loadIcon(IMPORT_ICON_FILE)); - } - - @Override - protected Control createDialogArea(Composite parent) { - - // Main dialog panel - fDialogComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - fDialogComposite.setLayout(layout); - fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - try { - createRemoteComposite(); - } catch (SystemMessageException e) { - createErrorComposite(parent, e.fillInStackTrace()); - return fDialogComposite; - } - return fDialogComposite; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - Button selectAllButton = createButton(parent, IDialogConstants.SELECT_ALL_ID, Messages.TraceControl_ImportDialog_SelectAll, true); - selectAllButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setFolderChildrenChecked(true); - } - }); - - Button deselectAllButton = createButton(parent, IDialogConstants.DESELECT_ALL_ID, Messages.TraceControl_ImportDialog_DeselectAll, true); - deselectAllButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setFolderChildrenChecked(false); - } - }); - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); - createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - updateOKButtonEnablement(); - } - - @Override - protected void okPressed() { - if (!fIsError) { - - // Validate input data - fTraces.clear(); - - fProjectIndex = fCombo.getSelectionIndex(); - - if (fProjectIndex < 0) { - MessageDialog.openError(getShell(), - Messages.TraceControl_ImportDialogTitle, - Messages.TraceControl_ImportDialogNoProjectSelectedError); - return; - } - - IProject project = fProjects.get(fProjectIndex); - IFolder traceFolder = project.getFolder(TmfTracesFolder.TRACES_FOLDER_NAME); - - if (!traceFolder.exists()) { - // Invalid LTTng 2.0 project - MessageDialog.openError(getShell(), - Messages.TraceControl_ImportDialogTitle, - Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTracesFolder.TRACES_FOLDER_NAME + ")"); //$NON-NLS-1$//$NON-NLS-2$ - return; - } - - boolean overwriteAll = fOverwriteButton.getSelection(); - - Object[] checked = fFolderViewer.getCheckedElements(); - for (int i = 0; i < checked.length; i++) { - IRemoteFile file = (IRemoteFile) checked[i]; - if (!file.isDirectory() && file.getName().equals(METADATA_FILE_NAME)) { - IRemoteFile trace = file.getParentRemoteFile(); - IRemoteFile parent = trace.getParentRemoteFile(); - - String path = fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getSnapshotPath() : fSession.getSessionPath(); - path = getUnifiedPath(path); - IPath sessionParentPath = new Path(path).removeLastSegments(1); - IPath traceParentPath = new Path(parent.getAbsolutePath()); - - IPath relativeTracePath = traceParentPath.makeRelativeTo(sessionParentPath); - - IFolder destinationFolder = traceFolder.getFolder(new Path(relativeTracePath.toOSString())); - - ImportFileInfo info = new ImportFileInfo(trace, trace.getName(), destinationFolder, overwriteAll); - IFolder folder = destinationFolder.getFolder(trace.getName()); - - // Verify if trace directory already exists (and not overwrite) - if (folder.exists() && !overwriteAll) { - - // Ask user for overwrite or new name - IImportConfirmationDialog conf = TraceControlDialogFactory.getInstance().getImportConfirmationDialog(); - conf.setTraceName(trace.getName()); - - // Don't add trace to list if dialog was cancelled. - if (conf.open() == Window.OK) { - info.setOverwrite(conf.isOverwrite()); - if (!conf.isOverwrite()) { - info.setLocalTraceName(conf.getNewTraceName()); - } - fTraces.add(info); - } - } else { - fTraces.add(info); - } - } - } - - if (fTraces.isEmpty()) { - MessageDialog.openError(getShell(), - Messages.TraceControl_ImportDialogTitle, - Messages.TraceControl_ImportDialogNoTraceSelectedError); - return; - } - } - - // validation successful -> call super.okPressed() - super.okPressed(); - } - - // ------------------------------------------------------------------------ - // Helper methods and classes - // ------------------------------------------------------------------------ - - /** - * Helper class for the contents of a folder in a tracing project - * - * @author Bernd Hufmann - */ - public static class FolderContentProvider extends WorkbenchContentProvider { - @Override - public Object[] getChildren(Object o) { - if (o instanceof IRemoteFile) { - IRemoteFile element = (IRemoteFile) o; - // For our purpose, we need folders + files - if (!element.isDirectory()) { - return new Object[0]; - } - } - return super.getChildren(o); - } - } - - /** - * Creates a dialog composite with an error message which can be used - * when an exception occurred during creation time of the dialog box. - * @param parent - a parent composite - * @param e - a error causing exception - */ - private void createErrorComposite(Composite parent, Throwable e) { - fIsError = true; - fDialogComposite.dispose(); - - fDialogComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - fDialogComposite.setLayout(layout); - fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - Text errorText = new Text(fDialogComposite, SWT.MULTI); - StringBuffer error = new StringBuffer(); - error.append(Messages.TraceControl_ImportDialogCreationError); - error.append(System.getProperty("line.separator")); //$NON-NLS-1$ - error.append(System.getProperty("line.separator")); //$NON-NLS-1$ - error.append(e.toString()); - errorText.setText(error.toString()); - errorText.setLayoutData(new GridData(GridData.FILL_BOTH)); - } - - private void createRemoteComposite() throws SystemMessageException{ - Group contextGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); - contextGroup.setText(Messages.TraceControl_ImportDialogTracesGroupName); - GridLayout layout = new GridLayout(1, true); - contextGroup.setLayout(layout); - contextGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); - - IRemoteSystemProxy proxy = fSession.getTargetNode().getRemoteSystemProxy(); - - IFileServiceSubSystem fsss = proxy.getFileServiceSubSystem(); - - final String path = fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getSnapshotPath() : fSession.getSessionPath(); - final IRemoteFile remoteFolder = fsss.getRemoteFileObject(path, new NullProgressMonitor()); - // make sure that remote directory is read and not cached - remoteFolder.markStale(true, true); - - fFolderViewer = new CheckboxTreeViewer(contextGroup, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - GridData data = new GridData(GridData.FILL_BOTH); - Tree tree = fFolderViewer.getTree(); - tree.setLayoutData(data); - tree.setFont(fDialogComposite.getFont()); - tree.setToolTipText(Messages.TraceControl_ImportDialogTracesTooltip); - - fFolderViewer.setContentProvider(new FolderContentProvider()); - fFolderViewer.setLabelProvider(new WorkbenchLabelProvider()); - - fFolderViewer.addCheckStateListener(new ICheckStateListener() { - @Override - public void checkStateChanged(CheckStateChangedEvent event) { - Object elem = event.getElement(); - if (elem instanceof IRemoteFile) { - IRemoteFile element = (IRemoteFile) elem; - if (!element.isDirectory()) { - // A trick to keep selection of a file in sync with the directory - boolean p = fFolderViewer.getChecked((element.getParentRemoteFile())); - fFolderViewer.setChecked(element, p); - } else { - fFolderViewer.setSubtreeChecked(event.getElement(), event.getChecked()); - if (!event.getChecked()) { - fFolderViewer.setChecked(element.getParentRemoteFile(), false); - } - } - updateOKButtonEnablement(); - } - } - }); - fFolderViewer.setInput(remoteFolder); - - fFolderChildren = remoteFolder.getContents(RemoteChildrenContentsType.getInstance()); - // children can be null if there the path doesn't exist. This happens when a trace - // session hadn't been started and no output was created. - setFolderChildrenChecked(true); - - Group projectGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); - projectGroup.setText(Messages.TraceControl_ImportDialogProjectsGroupName); - layout = new GridLayout(1, true); - projectGroup.setLayout(layout); - projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - fProjects = new ArrayList<>(); - List projectNames = new ArrayList<>(); - - for (IProject project : TraceUtils.getOpenedTmfProjects()) { - fProjects.add(project); - projectNames.add(project.getName()); - } - - fCombo = new CCombo(projectGroup, SWT.READ_ONLY); - fCombo.setToolTipText(Messages.TraceControl_ImportDialogProjectsTooltip); - fCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1)); - fCombo.setItems(projectNames.toArray(new String[projectNames.size()])); - - if (fDefaultProjectName != null) { - int select = projectNames.indexOf(fDefaultProjectName); - fCombo.select(select); - } - - Group overrideGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); - layout = new GridLayout(1, true); - overrideGroup.setLayout(layout); - overrideGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - fOverwriteButton = new Button(overrideGroup, SWT.CHECK); - fOverwriteButton.setText(Messages.TraceControl_ImportDialogOverwriteButtonText); - getShell().setMinimumSize(new Point(500, 400)); - } - - private void setFolderChildrenChecked(boolean isChecked) { - if (fFolderChildren != null) { - for (Object child : fFolderChildren) { - fFolderViewer.setSubtreeChecked(child, isChecked); - } - } - updateOKButtonEnablement(); - } - - private void updateOKButtonEnablement() { - Object[] checked = fFolderViewer.getCheckedElements(); - Button okButton = getButton(IDialogConstants.OK_ID); - if (okButton != null) { - okButton.setEnabled(checked.length > 0); - } - } - - private static String getUnifiedPath(String path) { - // Use Path class to remove unnecessary slashes - return new Path(path).removeTrailingSeparator().toString(); - } - } diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportFileInfo.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportFileInfo.java deleted file mode 100644 index 73db884387..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportFileInfo.java +++ /dev/null @@ -1,127 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; - -/** - *

- * Helper class for storing information about a remote file to import. - *

- * - * @author Bernd Hufmann - */ -public class ImportFileInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Remote file reference - */ - private IRemoteFile fRemoteFile; - /** - * Local Trace Name - */ - private String fLocalTraceName; - /** - * Global overwrite flag - */ - private boolean fIsOverwrite; - /** - * Destination folder to import the trace to (full workspace path) - */ - private IFolder fDestinationFolder; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Standard constructor - * - * @param file - * A remote file reference - * @param traceName - * A trace name - * @param destinationFolder - * The destination folder (full workspace path) - * @param isOverwrite - * global overwrite flag - */ - public ImportFileInfo(IRemoteFile file, String traceName, IFolder destinationFolder, boolean isOverwrite) { - fRemoteFile = file; - fLocalTraceName = traceName; - fDestinationFolder = destinationFolder; - fIsOverwrite = isOverwrite; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return name of traces after importing - */ - public String getLocalTraceName() { - return fLocalTraceName; - } - - /** - * Sets the local trace name - * - * @param importTraceName - * - local name of trace to set (name after importing) - */ - public void setLocalTraceName(String importTraceName) { - this.fLocalTraceName = importTraceName; - } - /** - * @return true if local trace should be overwritten if a trace with the same name already exists. - */ - public boolean isOverwrite() { - return fIsOverwrite; - } - /** - * Sets the overwrite flag. - * @param isOverwrite If the Overwrite checkbox is checked or not - */ - public void setOverwrite(boolean isOverwrite) { - this.fIsOverwrite = isOverwrite; - } - - /** - * @return the remote file implementation. - */ - public IRemoteFile getImportFile() { - return fRemoteFile; - } - - /** - * Sets the remote file implementation - * - * @param remoteFile - * The remote file implementation. - */ - public void setRemoteFile(IRemoteFile remoteFile) { - fRemoteFile = remoteFile; - } - - /** - * Returns the destination folder to import the trace to (full workspace path). - * - * @return destination folder - */ - public IFolder getDestinationFolder() { - return fDestinationFolder; - } -} - diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/NewConnectionDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/NewConnectionDialog.java deleted file mode 100644 index 24c6f74f55..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/NewConnectionDialog.java +++ /dev/null @@ -1,321 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.util.Arrays; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.events.VerifyListener; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - *

- * Dialog box for connection information. - *

- * - * @author Bernd Hufmann - */ -public class NewConnectionDialog extends Dialog implements INewConnectionDialog { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The icon file for this dialog box. - */ - public static final String TARGET_NEW_CONNECTION_ICON_FILE = "icons/elcl16/target_add.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The host combo box. - */ - private CCombo fExistingHostsCombo = null; - /** - * The check box button for enabling/disabling the text input. - */ - private Button fButton = null; - /** - * The text widget for the node name (alias) - */ - private Text fConnectionNameText = null; - /** - * The text widget for the node address (IP or DNS name) - */ - private Text fHostNameText = null; - /** - * The text widget for the IP port - */ - private Text fPortText = null; - /** - * The parent where the new node should be added. - */ - private ITraceControlComponent fParent; - /** - * The node name (alias) string. - */ - private String fConnectionName = null; - /** - * The node address (IP or DNS name) string. - */ - private String fHostName = null; - /** - * The IP port of the connection. - */ - private int fPort = IRemoteSystemProxy.INVALID_PORT_NUMBER; - /** - * Input list of existing RSE hosts available for selection. - */ - private IHost[] fExistingHosts = new IHost[0]; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * - * @param shell - * The shell - */ - public NewConnectionDialog(Shell shell) { - super(shell); - setShellStyle(SWT.RESIZE | getShellStyle()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getConnectionName() { - return fConnectionName; - } - - @Override - public String getHostName() { - return fHostName; - } - - @Override - public int getPort() { - return fPort; - } - - @Override - public void setTraceControlParent(ITraceControlComponent parent) { - fParent = parent; - } - - @Override - public void setHosts(IHost[] hosts) { - if (hosts != null) { - fExistingHosts = Arrays.copyOf(hosts, hosts.length); - } - } - - @Override - public void setPort(int port) { - fPort = port; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.TraceControl_NewDialogTitle); - newShell.setImage(Activator.getDefault().loadIcon(TARGET_NEW_CONNECTION_ICON_FILE)); - } - - @Override - protected Control createDialogArea(Composite parent) { - - // Main dialog panel - Composite dialogComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - dialogComposite.setLayout(layout); - dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - // Existing connections group - Group comboGroup = new Group(dialogComposite, SWT.SHADOW_NONE); - comboGroup.setText(Messages.TraceControl_NewNodeExistingConnectionGroupName); - layout = new GridLayout(2, true); - comboGroup.setLayout(layout); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - comboGroup.setLayoutData(data); - - fExistingHostsCombo = new CCombo(comboGroup, SWT.READ_ONLY); - fExistingHostsCombo.setToolTipText(Messages.TraceControl_NewNodeComboToolTip); - fExistingHostsCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1)); - - String items[] = new String[fExistingHosts.length]; - for (int i = 0; i < items.length; i++) { - items[i] = String.valueOf(fExistingHosts[i].getAliasName() + " - " + fExistingHosts[i].getHostName()); //$NON-NLS-1$ - } - - fExistingHostsCombo.setItems(items); - fExistingHostsCombo.setEnabled(fExistingHosts.length > 0); - - // Node information grop - Group textGroup = new Group(dialogComposite, SWT.SHADOW_NONE); - layout = new GridLayout(3, true); - textGroup.setLayout(layout); - data = new GridData(GridData.FILL_HORIZONTAL); - textGroup.setLayoutData(data); - - fButton = new Button(textGroup, SWT.CHECK); - fButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1)); - fButton.setText(Messages.TraceControl_NewNodeEditButtonName); - fButton.setEnabled(fExistingHosts.length > 0); - - Label connectionNameLabel = new Label(textGroup, SWT.RIGHT); - connectionNameLabel.setText(Messages.TraceControl_NewNodeConnectionNameLabel); - fConnectionNameText = new Text(textGroup, SWT.NONE); - fConnectionNameText.setToolTipText(Messages.TraceControl_NewNodeConnectionNameTooltip); - fConnectionNameText.setEnabled(fExistingHosts.length == 0); - - Label hostNameLabel = new Label(textGroup, SWT.RIGHT); - hostNameLabel.setText(Messages.TraceControl_NewNodeHostNameLabel); - fHostNameText = new Text(textGroup, SWT.NONE); - fHostNameText.setToolTipText(Messages.TraceControl_NewNodeHostNameTooltip); - fHostNameText.setEnabled(fExistingHosts.length == 0); - - Label portLabel = new Label(textGroup, SWT.RIGHT); - portLabel.setText(Messages.TraceControl_NewNodePortLabel); - fPortText = new Text(textGroup, SWT.NONE); - fPortText.setToolTipText(Messages.TraceControl_NewNodePortTooltip); - fPortText.setEnabled(fExistingHosts.length == 0); - fPortText.addVerifyListener(new VerifyListener() { - @Override - public void verifyText(VerifyEvent e) { - // only numbers are allowed. - e.doit = e.text.matches("[0-9]*"); //$NON-NLS-1$ - } - }); - - fButton.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - if (fButton.getSelection()) { - fExistingHostsCombo.deselectAll(); - fExistingHostsCombo.setEnabled(false); - fConnectionNameText.setEnabled(true); - fHostNameText.setEnabled(true); - fPortText.setEnabled(true); - } else { - fExistingHostsCombo.setEnabled(true); - fConnectionNameText.setEnabled(false); - fHostNameText.setEnabled(false); - fPortText.setEnabled(false); - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - fExistingHostsCombo.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - int index = fExistingHostsCombo.getSelectionIndex(); - fConnectionNameText.setText(fExistingHosts[index].getAliasName()); - fHostNameText.setText(fExistingHosts[index].getHostName()); - fPortText.setText(""); //$NON-NLS-1$ - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - // layout widgets - data = new GridData(GridData.FILL_HORIZONTAL); - fHostNameText.setText("666.666.666.666"); //$NON-NLS-1$ - Point minSize = fHostNameText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); - int widthHint = minSize.x + 5; - data.widthHint = widthHint; - data.horizontalSpan = 2; - fConnectionNameText.setLayoutData(data); - - data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = widthHint; - data.horizontalSpan = 2; - fHostNameText.setLayoutData(data); - - data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = widthHint; - data.horizontalSpan = 2; - fPortText.setLayoutData(data); - - fHostNameText.setText(""); //$NON-NLS-1$ - - return dialogComposite; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ - createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ - } - - @Override - protected void okPressed() { - // Validate input data - fConnectionName = fConnectionNameText.getText(); - fHostName = fHostNameText.getText(); - fPort = (fPortText.getText().length() > 0) ? Integer.parseInt(fPortText.getText()) : IRemoteSystemProxy.INVALID_PORT_NUMBER; - - if (!"".equals(fHostName)) { //$NON-NLS-1$ - // If no node name is specified use the node address as name - if ("".equals(fConnectionName)) { //$NON-NLS-1$ - fConnectionName = fHostName; - } - // Check if node with name already exists in parent - if(fParent.containsChild(fConnectionName)) { - MessageDialog.openError(getShell(), - Messages.TraceControl_NewDialogTitle, - Messages.TraceControl_AlreadyExistsError + " (" + fConnectionName + ")"); //$NON-NLS-1$//$NON-NLS-2$ - return; - } - } - else { - return; - } - // validation successful -> call super.okPressed() - super.okPressed(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/OpenCommandScriptDialog.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/OpenCommandScriptDialog.java deleted file mode 100644 index 7c1f422577..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/OpenCommandScriptDialog.java +++ /dev/null @@ -1,269 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.tmf.core.io.BufferedRandomAccessFile; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Shell; - -import com.google.common.collect.ImmutableList; - -/** - *

- * Dialog box for selecting a command script. It parses the script and - * provides a list of shell commands to be executed. - *

- * - * @author Bernd Hufmann - */ -public class OpenCommandScriptDialog extends Dialog implements ISelectCommandScriptDialog { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The icon file for this dialog box. - */ - public static final String CREATE_SESSION_ICON_FILE = "icons/elcl16/add_button.gif"; //$NON-NLS-1$ - - // Dialog settings constants - private static final String DIALOG_SETTINGS_SECTION = "OpenCommandScriptDialog"; //$NON-NLS-1$ - private static final String FILE_NAME_ID = "STORE_FILE_NAME_ID"; //$NON-NLS-1$ - private static final int COMBO_HISTORY_LENGTH = 5; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // Dialog attributes - private Control fControl = null; - private Composite fDialogComposite = null; - private Button fBrowseButton; - private Label fFileNameLabel = null; - private Combo fFileNameCombo = null; - - // Output list of commands - private List fCommands = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param shell - a shell for the display of the dialog - */ - public OpenCommandScriptDialog(Shell shell) { - super(shell); - setShellStyle(SWT.RESIZE | getShellStyle()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - @NonNull public List getCommands() { - if (fCommands != null) { - return fCommands; - } - return new ArrayList<>(); - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected Control createContents(Composite parent) { - fControl = super.createContents(parent); - - /* set the shell minimum size */ - Point clientArea = fControl.computeSize(SWT.DEFAULT, SWT.DEFAULT); - Rectangle trim = getShell().computeTrim(0, 0, clientArea.x, clientArea.y); - getShell().setMinimumSize(trim.width, trim.height); - - return fControl; - } - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.TraceControl_ExecuteScriptDialogTitle); - newShell.setImage(Activator.getDefault().loadIcon(CREATE_SESSION_ICON_FILE)); - } - - @Override - protected Control createDialogArea(Composite parent) { - - // Main dialog panel - fDialogComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(1, true); - fDialogComposite.setLayout(layout); - fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - Group sessionGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); - sessionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - sessionGroup.setLayout(new GridLayout(6, true)); - - fFileNameLabel = new Label(sessionGroup, SWT.RIGHT); - fFileNameLabel.setText(Messages.TraceControl_ExecuteScriptSelectLabel); - fFileNameCombo = new Combo(sessionGroup, SWT.BORDER); - - fBrowseButton = new Button(sessionGroup, SWT.PUSH); - fBrowseButton.setText(Messages.TraceControl_ExecuteScriptBrowseText); - fBrowseButton.addListener(SWT.Selection, new Listener() { - @Override - public void handleEvent(Event event) { - handleFilePathBrowseButtonPressed(SWT.OPEN); - } - }); - - // layout widgets - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - data.grabExcessHorizontalSpace = false; - fFileNameLabel.setLayoutData(data); - - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 4; - fFileNameCombo.setLayoutData(data); - - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 1; - - // Initialize a empty list - fCommands = new ArrayList<>(); - - restoreWidgetValues(); - - return fDialogComposite; - } - - private void restoreWidgetValues() { - IDialogSettings workbenchSettings = Activator.getDefault().getDialogSettings(); - IDialogSettings settings = workbenchSettings.getSection(DIALOG_SETTINGS_SECTION); - if (settings == null) { - settings = workbenchSettings.addNewSection(DIALOG_SETTINGS_SECTION); - } - String[] fileNames = settings.getArray(FILE_NAME_ID); - if ((fileNames != null) && (fileNames.length != 0)) { - for (int i = 0; i < fileNames.length; i++) { - fFileNameCombo.add(fileNames[i]); - } - } - } - - private void saveWidgetValues() { - IDialogSettings workbenchSettings = Activator.getDefault().getDialogSettings(); - IDialogSettings settings = workbenchSettings.getSection(DIALOG_SETTINGS_SECTION); - if (settings != null) { - // update file names history - String[] fileNames = settings.getArray(FILE_NAME_ID); - if (fileNames == null) { - fileNames = new String[0]; - } - - fileNames = addToHistory(fileNames, fFileNameCombo.getText().trim()); - settings.put(FILE_NAME_ID, fileNames); - } - } - - /** - * Adds an entry to a history, while taking care of duplicate history items - * and excessively long histories. The assumption is made that all histories - * should be of length COMBO_HISTORY_LENGTH. - * - * @param history the current history - * @param newEntry the entry to add to the history - */ - private static String[] addToHistory(String[] history, String newEntry) { - List list = new ArrayList<>(Arrays.asList(history)); - list.remove(newEntry); - list.add(0, newEntry); - - // since only one new item was added, we can be over the limit - // by at most one item - if (list.size() > COMBO_HISTORY_LENGTH) { - list.remove(COMBO_HISTORY_LENGTH); - } - String[] r = new String[list.size()]; - list.toArray(r); - return r; - } - - private void handleFilePathBrowseButtonPressed(int fileDialogStyle) { - FileDialog dialog = new FileDialog(getShell(), fileDialogStyle | SWT.SHEET); - dialog.setFilterExtensions(new String[] { "*.*", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$ - dialog.setText(Messages.TraceControl_ExecuteScriptDialogTitle); - String selectedFileName = dialog.open(); - if (selectedFileName != null) { - fFileNameCombo.setText(selectedFileName); - } - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); - createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - } - - @Override - protected void okPressed() { - // Validate input data - String sessionPath = fFileNameCombo.getText(); - - if (!"".equals(sessionPath)) { //$NON-NLS-1$ - - ImmutableList.Builder builder = new ImmutableList.Builder<>(); - try (BufferedRandomAccessFile rafile = new BufferedRandomAccessFile(sessionPath, "r")) { //$NON-NLS-1$ - String line = rafile.getNextLine(); - while (line != null) { - builder.add(line); - line = rafile.getNextLine(); - } - } catch (IOException e) { - ErrorDialog.openError(getShell(), null, null, new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, e.getLocalizedMessage(), e)); - return; - } - saveWidgetValues(); - fCommands = builder.build(); - super.okPressed(); - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/TraceControlDialogFactory.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/TraceControlDialogFactory.java deleted file mode 100644 index 58364d2471..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/TraceControlDialogFactory.java +++ /dev/null @@ -1,282 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; - -import org.eclipse.ui.PlatformUI; - -/** - *

- * Factory for generating dialog boxes. It allows to overwrite the dialog implementation. - * Useful also for testing purposes. - *

- * - * @author Bernd Hufmann - * - */ -public final class TraceControlDialogFactory { - - // ------------------------------------------------------------------------ - // Members - // ------------------------------------------------------------------------ - - /** - * The factory instance. - */ - private static TraceControlDialogFactory fInstance; - - /** - * The new connection dialog reference. - */ - private INewConnectionDialog fNewConnectionDialog; - - /** - * The enable channel dialog - */ - private IEnableChannelDialog fEnableChannelDialog; - - /** - * The create session dialog. - */ - private ICreateSessionDialog fCreateSessionDialog; - - /** - * The command script selection dialog. - */ - private ISelectCommandScriptDialog fCommandScriptDialog; - - /** - * The enable events dialog. - */ - private IEnableEventsDialog fEnableEventsDialog; - - /** - * The get event info dialog. - */ - private IGetEventInfoDialog fGetEventInfoDialog; - - /** - * The confirmation dialog implementation. - */ - private IConfirmDialog fConfirmDialog; - - /** - * The add context dialog implementation. - */ - private IAddContextDialog fAddContextDialog; - - /** - * The import dialog implementation. - */ - private IImportDialog fImportDialog; - - /** - * The import confirmation dialog. - */ - private IImportConfirmationDialog fImportConfirmationDialog; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor for R4EUIDialogFactory. - */ - private TraceControlDialogFactory() { - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * @return TraceControlDialogFactory instance - */ - public static synchronized TraceControlDialogFactory getInstance() { - if (fInstance == null) { - fInstance = new TraceControlDialogFactory(); - } - return fInstance; - } - - /** - * @return new connection dialog - */ - public INewConnectionDialog getNewConnectionDialog() { - if (fNewConnectionDialog == null) { - fNewConnectionDialog = new NewConnectionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); - } - return fNewConnectionDialog; - } - - /** - * Sets a new connection dialog implementation. - * @param newConnectionDialog - new connection dialog implementation - */ - public void setNewConnectionDialog(INewConnectionDialog newConnectionDialog) { - fNewConnectionDialog = newConnectionDialog; - } - - /** - * @return enable channel dialog - */ - public IEnableChannelDialog getEnableChannelDialog() { - if (fEnableChannelDialog == null) { - fEnableChannelDialog = new EnableChannelDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); - } - return fEnableChannelDialog; - } - - /** - * Sets a enable channel dialog implementation. - * @param createEnableDialog - a create channel dialog implementation - */ - public void setEnableChannelDialog(IEnableChannelDialog createEnableDialog) { - fEnableChannelDialog = createEnableDialog; - } - - /** - * @return create session dialog implementation - */ - public ICreateSessionDialog getCreateSessionDialog() { - if (fCreateSessionDialog == null) { - fCreateSessionDialog = new CreateSessionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); - } - return fCreateSessionDialog; - } - - /** - * @return command script selection dialog implementation - */ - public ISelectCommandScriptDialog getCommandScriptDialog() { - if (fCommandScriptDialog == null) { - fCommandScriptDialog = new OpenCommandScriptDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); - } - return fCommandScriptDialog; - } - - /** - * Sets a create session dialog implementation. - * @param createSessionDialog - a create session implementation. - */ - public void setCreateSessionDialog(ICreateSessionDialog createSessionDialog) { - fCreateSessionDialog = createSessionDialog; - } - - /** - * @return enable events dialog implementation. - */ - public IEnableEventsDialog getEnableEventsDialog() { - if (fEnableEventsDialog == null) { - fEnableEventsDialog = new EnableEventsDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); - } - return fEnableEventsDialog; - } - - /** - * Sets a enable events dialog implementation. - * @param enableEventsDialog - a enable events dialog implementation. - */ - public void setEnableEventsDialog(IEnableEventsDialog enableEventsDialog) { - fEnableEventsDialog = enableEventsDialog; - } - - /** - * @return get events info dialog implementation. - */ - public IGetEventInfoDialog getGetEventInfoDialog() { - if (fGetEventInfoDialog == null) { - fGetEventInfoDialog = new GetEventInfoDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); - } - return fGetEventInfoDialog; - } - - /** - * Sets a get events info dialog implementation. - * @param getEventInfoDialog - a get events info dialog implementation - */ - public void setGetEventInfoDialog(IGetEventInfoDialog getEventInfoDialog) { - fGetEventInfoDialog = getEventInfoDialog; - } - - /** - * @return the confirmation dialog implementation - */ - public IConfirmDialog getConfirmDialog() { - if (fConfirmDialog == null) { - fConfirmDialog = new ConfirmDialog(); - } - return fConfirmDialog; - } - - /** - * Sets the confirmation dialog implementation - * @param confirmDialog - a confirmation dialog implementation - */ - public void setConfirmDialog(IConfirmDialog confirmDialog) { - fConfirmDialog = confirmDialog; - } - - /** - * @return the add context dialog implementation - */ - public IAddContextDialog getAddContextDialog() { - if (fAddContextDialog == null) { - fAddContextDialog = new AddContextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); - } - return fAddContextDialog; - } - - /** - * Sets the add context dialog information - * @param addContextDialog - a add context dialog implementation - */ - public void setAddContextDialog(IAddContextDialog addContextDialog) { - fAddContextDialog = addContextDialog; - } - - /** - * @return the import dialog implementation - */ - public IImportDialog getImportDialog() { - if (fImportDialog == null) { - fImportDialog = new ImportDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); - } - return fImportDialog; - } - - /** - * Sets the import dialog implementation. - * @param importDialog - a import dialog implementation - */ - public void setImportDialog(IImportDialog importDialog) { - fImportDialog = importDialog; - } - - /** - * @return the import confirmation dialog implementation. - */ - public IImportConfirmationDialog getImportConfirmationDialog() { - if (fImportConfirmationDialog == null) { - fImportConfirmationDialog = new ImportConfirmationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); - } - return fImportConfirmationDialog; - } - - /** - * Sets the import confirmation dialog implementation. - * @param confirmDialog - a import confirmation dialog implementation. - */ - public void setImportConfirmationDialog(IImportConfirmationDialog confirmDialog) { - fImportConfirmationDialog = confirmDialog; - } -} - diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnChannelHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnChannelHandler.java deleted file mode 100644 index fc3d28a4a3..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnChannelHandler.java +++ /dev/null @@ -1,90 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to add contexts to a given channel and all of its events. - *

- * - * @author Bernd Hufmann - */ -public class AddContextOnChannelHandler extends BaseAddContextHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void addContexts(CommandParameter param, List contextNames, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof ChannelCommandParameter) { - TraceChannelComponent channel = ((ChannelCommandParameter)param).getChannel(); - channel.addContexts(contextNames, monitor); - } - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceChannelComponent channel = null; - TraceSessionComponent session = null; - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceChannelComponent) { - // Add only if corresponding TraceSessionComponents is inactive and not destroyed - TraceChannelComponent tmpChannel = (TraceChannelComponent) element; - session = tmpChannel.getSession(); - if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) { - channel = tmpChannel; - } - } - } - } - - boolean isEnabled = (channel != null); - fLock.lock(); - try { - fParam = null; - if(isEnabled) { - fParam = new ChannelCommandParameter(session, channel); - } - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnDomainHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnDomainHandler.java deleted file mode 100644 index d7df3133ed..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnDomainHandler.java +++ /dev/null @@ -1,98 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to add contexts to all channels and all events. - *

- * - * @author Bernd Hufmann - */ -public class AddContextOnDomainHandler extends BaseAddContextHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void addContexts(CommandParameter param, List contextNames, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof DomainCommandParameter) { - TraceDomainComponent domain = ((DomainCommandParameter)param).getDomain(); - domain.addContexts(contextNames, monitor); - } - } - - @Override - public boolean isEnabled() { - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceDomainComponent domain = null; - TraceSessionComponent session = null; - - // Check if one domain is selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceDomainComponent) { - TraceDomainComponent tmpDomain = (TraceDomainComponent) element; - session = (TraceSessionComponent) tmpDomain.getParent(); - - // Add only TraceDomainComponent whose TraceSessionComponent parent is inactive and not destroyed - if ((session.getSessionState() == TraceSessionState.INACTIVE) && (!session.isDestroyed())) { - domain = tmpDomain; - } - } - } - } - - boolean isEnabled = domain != null; - - fLock.lock(); - try { - fParam = null; - if (isEnabled) { - fParam = new DomainCommandParameter(session, domain); - } - } finally { - fLock.unlock(); - } - - return isEnabled; - } - - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnEventHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnEventHandler.java deleted file mode 100644 index 62edf0a39f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnEventHandler.java +++ /dev/null @@ -1,90 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to add contexts to a given event. - *

- * - * @author Bernd Hufmann - */ -public class AddContextOnEventHandler extends BaseAddContextHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void addContexts(CommandParameter param, List contextNames, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof EventCommandParameter) { - TraceEventComponent event = ((EventCommandParameter)param).getEvent(); - event.addContexts(contextNames, monitor); - } - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceEventComponent event = null; - TraceSessionComponent session = null; - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceEventComponent) { - // Add only if corresponding TraceSessionComponents is inactive and not destroyed - TraceEventComponent tmpEvent = (TraceEventComponent) element; - session = tmpEvent.getSession(); - if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) { - event = tmpEvent; - } - } - } - } - - boolean isEnabled = (event != null); - fLock.lock(); - try { - fParam = null; - if(isEnabled) { - fParam = new EventCommandParameter(session, event); - } - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AssignEventHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AssignEventHandler.java deleted file mode 100644 index 39ba8fefad..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AssignEventHandler.java +++ /dev/null @@ -1,253 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IGetEventInfoDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to assign events to a session and channel and enable/configure them. - * This is done on the trace provider level. - *

- * - * @author Bernd Hufmann - */ -public class AssignEventHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The command execution parameter. - */ - private Parameter fParam; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - fLock.lock(); - try { - // Make a copy for thread safety - final Parameter param = new Parameter(fParam); - - // Open dialog box to retrieve the session and channel where the events should be enabled in. - final IGetEventInfoDialog dialog = TraceControlDialogFactory.getInstance().getGetEventInfoDialog(); - dialog.setIsKernel(param.isKernel()); - dialog.setSessions(param.getSessions()); - - if (dialog.open() != Window.OK) { - return null; - } - - Job job = new Job(Messages.TraceControl_EnableEventsJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - - Exception error = null; - - try { - List eventNames = new ArrayList<>(); - List events = param.getEvents(); - // Create list of event names - for (Iterator iterator = events.iterator(); iterator.hasNext();) { - BaseEventComponent baseEvent = iterator.next(); - eventNames.add(baseEvent.getName()); - } - - TraceChannelComponent channel = dialog.getChannel(); - if (channel == null) { - // enable events on default channel (which will be created by lttng-tools) - dialog.getSession().enableEvents(eventNames, param.isKernel(), dialog.getFilterExpression(), monitor); - } else { - channel.enableEvents(eventNames, dialog.getFilterExpression(), monitor); - } - - } catch (ExecutionException e) { - error = e; - } - - // refresh in all cases - refresh(new CommandParameter(dialog.getSession())); - - if (error != null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_EnableEventsFailure, error); - } - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - - return null; - } - - @Override - public boolean isEnabled() { - ArrayList events = new ArrayList<>(); - TraceSessionComponent[] sessions = null; - Boolean isKernel = null; - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - // Check if one or more session are selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof BaseEventComponent) { - BaseEventComponent event = (BaseEventComponent) element; - ITraceControlComponent provider = event.getParent(); - - // check for kernel or UST provider - boolean temp = false; - if (provider instanceof KernelProviderComponent) { - temp = true; - } else if (provider instanceof UstProviderComponent) { - temp = false; - } else { - return false; - } - if (isKernel == null) { - isKernel = Boolean.valueOf(temp); - } else { - // don't mix events from Kernel and UST provider - if (isKernel.booleanValue() != temp) { - return false; - } - } - - // Add BaseEventComponents - events.add(event); - - if (sessions == null) { - TargetNodeComponent root = (TargetNodeComponent)event.getParent().getParent().getParent(); - sessions = root.getSessions(); - } - } - } - } - - boolean isEnabled = ((!events.isEmpty()) && (sessions != null) && (sessions.length > 0)); - - // To avoid compiler warnings check for null even if isKernel is always not null when used below - if (isKernel == null) { - return false; - } - - fLock.lock(); - try { - fParam = null; - if(isEnabled) { - fParam = new Parameter(sessions, events, isKernel); - } - } finally { - fLock.unlock(); - } - return isEnabled; - } - - /** - * Class containing parameter for the command execution. - */ - private static final class Parameter { - - /** - * The list of event components the command is to be executed on. - */ - private final List fEvents; - - /** - * The list of available sessions. - */ - final private TraceSessionComponent[] fSessions; - - /** - * Flag for indicating Kernel or UST. - */ - private final boolean fIsKernel; - - /** - * Constructor - * - * @param sessions - a array of trace sessions - * @param events - a lists of events to enable - * @param isKernel - domain (true for kernel or UST) - */ - public Parameter(TraceSessionComponent[] sessions, List events, boolean isKernel) { - fSessions = Arrays.copyOf(sessions, sessions.length); - fEvents = new ArrayList<>(); - fEvents.addAll(events); - fIsKernel = isKernel; - } - - /** - * Copy constructor - * @param other - a parameter to copy - */ - public Parameter(Parameter other) { - this(other.fSessions, other.fEvents, other.fIsKernel); - } - - public TraceSessionComponent[] getSessions() { - return fSessions; - } - - public List getEvents() { - return fEvents; - } - - public boolean isKernel() { - return fIsKernel; - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseAddContextHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseAddContextHandler.java deleted file mode 100644 index bba85505b6..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseAddContextHandler.java +++ /dev/null @@ -1,132 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.window.Window; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IAddContextDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.progress.UIJob; - -/** - *

- * Base command handler implementation to add contexts. - *

- * - * @author Bernd Hufmann - */ -public abstract class BaseAddContextHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The command execution parameter. - */ - protected CommandParameter fParam = null; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Adds contexts to channel(s) and/or event(s) - * - * @param param - * - a parameter instance with data for the command execution - * @param contextNames - * - list contexts to add - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If something goes wrong - */ - public abstract void addContexts(CommandParameter param, List contextNames, IProgressMonitor monitor) throws ExecutionException; - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - if (window == null) { - return false; - } - fLock.lock(); - try { - // Make a copy for thread safety - final CommandParameter param = fParam.clone(); - - UIJob getJob = new UIJob(Messages.TraceControl_GetContextJob) { - @Override - public IStatus runInUIThread(IProgressMonitor monitor) { - - try { - final List availableContexts = param.getSession().getContextList(monitor); - final IAddContextDialog dialog = TraceControlDialogFactory.getInstance().getAddContextDialog(); - dialog.setAvalibleContexts(availableContexts); - - if ((dialog.open() != Window.OK) || (dialog.getContexts().isEmpty())) { - return Status.OK_STATUS; - } - - Job addJob = new Job(Messages.TraceControl_AddContextJob) { - @Override - protected IStatus run(IProgressMonitor monitor2) { - Exception error = null; - - try { - List contextNames = dialog.getContexts(); - addContexts(param, contextNames, monitor2); - - } catch (ExecutionException e) { - error = e; - } - - // get session configuration in all cases - refresh(param); - - if (error != null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_AddContextFailure, error); - } - return Status.OK_STATUS; - } - }; - addJob.setUser(true); - addJob.schedule(); - } catch (ExecutionException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_GetContextFailure, e); - } - - return Status.OK_STATUS; - } - }; - getJob.setUser(false); - getJob.schedule(); - - } finally { - fLock.unlock(); - } - return null; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseControlViewHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseControlViewHandler.java deleted file mode 100644 index 8f36de1e6f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseControlViewHandler.java +++ /dev/null @@ -1,94 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.concurrent.locks.ReentrantLock; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - *

- * Abstract Command handler implementation for all control view handlers. - *

- * - * @author Bernd Hufmann - */ -public abstract class BaseControlViewHandler extends AbstractHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The synchronization lock. - */ - protected final ReentrantLock fLock = new ReentrantLock(); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * @return returns the workbench page for the Control View - */ - protected IWorkbenchPage getWorkbenchPage() { - // Check if we are closing down - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window == null) { - return null; - } - - // Check if we are in the Project View - IWorkbenchPage page = window.getActivePage(); - if (page == null) { - return null; - } - - IWorkbenchPart part = page.getActivePart(); - if (!(part instanceof ControlView)) { - return null; - } - return page; - } - - /** - * Refreshes the session information based on given session (in CommandParameter) - * @param param - command parameter containing the session to refresh - */ - protected void refresh(final CommandParameter param) { - Job job = new Job(Messages.TraceControl_RetrieveNodeConfigurationJob) { - - @Override - protected IStatus run(IProgressMonitor monitor) { - try { - param.getSession().getConfigurationFromNode(monitor); - } catch (ExecutionException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ListSessionFailure, e); - } - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableChannelHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableChannelHandler.java deleted file mode 100644 index 0b3f65d9a2..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableChannelHandler.java +++ /dev/null @@ -1,124 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.window.Window; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IEnableChannelDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; - -/** - *

- * Base implementation of a command handler to enable a trace channel. - *

- * - * @author Bernd Hufmann - */ -abstract class BaseEnableChannelHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - protected CommandParameter fParam; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Enables channels with given names which are part of this domain. If a - * given channel doesn't exists it creates a new channel with the given - * parameters (or default values if given parameter is null). - * - * @param param - * - a parameter instance with data for the command execution - * @param channelNames - * - a list of channel names to enable on this domain - * @param info - * - channel information to set for the channel (use null for - * default) - * @param isKernel - * - a flag for indicating kernel or UST. - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If something goes wrong when enabling the channel - */ - public abstract void enableChannel(CommandParameter param, - List channelNames, IChannelInfo info, boolean isKernel, - IProgressMonitor monitor) throws ExecutionException; - - /** - * @param param - a parameter instance with data for the command execution - * @return returns the relevant domain (null if domain is not known) - */ - public abstract TraceDomainComponent getDomain(CommandParameter param); - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - fLock.lock(); - try { - final CommandParameter param = fParam.clone(); - - final IEnableChannelDialog dialog = TraceControlDialogFactory.getInstance().getEnableChannelDialog(); - dialog.setTargetNodeComponent(param.getSession().getTargetNode()); - dialog.setDomainComponent(getDomain(param)); - dialog.setHasKernel(param.getSession().hasKernelProvider()); - - if (dialog.open() != Window.OK) { - return null; - } - - Job job = new Job(Messages.TraceControl_CreateChannelStateJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - Exception error = null; - - List channelNames = new ArrayList<>(); - channelNames.add(dialog.getChannelInfo().getName()); - - try { - enableChannel(param, channelNames, dialog.getChannelInfo(), dialog.isKernel(), monitor); - } catch (ExecutionException e) { - error = e; - } - - // refresh in all cases - refresh(param); - - if (error != null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateChannelStateFailure, error); - } - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - return null; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java deleted file mode 100644 index d4a39e90f7..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java +++ /dev/null @@ -1,227 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.window.Window; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IEnableEventsDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - *

- * Base command handler implementation to enable events. - *

- * - * @author Bernd Hufmann - */ -public abstract class BaseEnableEventHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The command execution parameter. - */ - protected CommandParameter fParam = null; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Enables a list of events for given parameters. - * - * @param param - * - a parameter instance with data for the command execution - * @param eventNames - * - list of event names - * @param isKernel - * - true if kernel domain else false - * @param filterExpression - * - a filter expression - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails for some reason - */ - public abstract void enableEvents(CommandParameter param, List eventNames, boolean isKernel, String filterExpression, IProgressMonitor monitor) throws ExecutionException; - - /** - * Enables all syscall events. - * - * @param param - * - a parameter instance with data for the command execution - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails for some reason - */ - public abstract void enableSyscalls(CommandParameter param, IProgressMonitor monitor) throws ExecutionException; - - /** - * Enables a dynamic probe. - * - * @param param - * - a parameter instance with data for the command execution - * @param eventName - * - a event name - * @param isFunction - * - true for dynamic function entry/return probe else false - * @param probe - * - a dynamic probe information - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails for some reason - */ - public abstract void enableProbe(CommandParameter param, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException; - - /** - * Enables events using log level - * - * @param param - * - a parameter instance with data for the command execution - * @param eventName - * - a event name - * @param logLevelType - * - a log level type - * @param level - * - a log level - * @param filterExpression - * - a filter expression - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails for some reason - */ - public abstract void enableLogLevel(CommandParameter param, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExpression, IProgressMonitor monitor) throws ExecutionException; - - /** - * @param param - * - a parameter instance with data for the command execution - * @return returns the relevant domain (null if domain is not known) - */ - public abstract TraceDomainComponent getDomain(CommandParameter param); - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - if (window == null) { - return false; - } - fLock.lock(); - try { - // Make a copy for thread safety - final CommandParameter param = fParam.clone(); - - TargetNodeComponent node = param.getSession().getTargetNode(); - List providers = node.getChildren(TraceProviderGroup.class); - - final IEnableEventsDialog dialog = TraceControlDialogFactory.getInstance().getEnableEventsDialog(); - dialog.setTraceProviderGroup((TraceProviderGroup)providers.get(0)); - dialog.setTraceDomainComponent(getDomain(param)); - - if (dialog.open() != Window.OK) { - return null; - } - - Job job = new Job(Messages.TraceControl_ChangeEventStateJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - Exception error = null; - - try { - String filter = dialog.getFilterExpression(); - - // Enable tracepoint events - if (dialog.isTracepoints()) { - if (dialog.isAllTracePoints()) { - enableEvents(param, null, dialog.isKernel(), filter, monitor); - } else { - List eventNames = dialog.getEventNames(); - if (!eventNames.isEmpty()) { - enableEvents(param, eventNames, dialog.isKernel(), filter, monitor); - } - } - } - - // Enable syscall events - if (dialog.isAllSysCalls()) { - enableSyscalls(param, monitor); - } - - // Enable dynamic probe - if (dialog.isDynamicProbe() && (dialog.getProbeEventName() != null) && (dialog.getProbeName() != null)) { - enableProbe(param, dialog.getProbeEventName(), false, dialog.getProbeName(), monitor); - } - - // Enable dynamic function probe - if (dialog.isDynamicFunctionProbe() && (dialog.getFunctionEventName() != null) && (dialog.getFunction() != null)) { - enableProbe(param, dialog.getFunctionEventName(), true, dialog.getFunction(), monitor); - } - - // Enable event using a wildcard - if (dialog.isWildcard()) { - List eventNames = dialog.getEventNames(); - eventNames.add(dialog.getWildcard()); - - if (!eventNames.isEmpty()) { - enableEvents(param, eventNames, dialog.isKernel(), filter, monitor); - } - } - - // Enable events using log level - if (dialog.isLogLevel()) { - enableLogLevel(param, dialog.getLogLevelEventName(), dialog.getLogLevelType(), dialog.getLogLevel(), filter, monitor); - } - - } catch (ExecutionException e) { - error = e; - } - - // refresh in all cases - refresh(param); - - if (error != null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeEventStateFailure, error); - } - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - return null; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseNodeHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseNodeHandler.java deleted file mode 100644 index e3f234c631..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseNodeHandler.java +++ /dev/null @@ -1,70 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to delete a target host. - *

- * - * @author Bernd Hufmann - */ -public abstract class BaseNodeHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The target node component the command is to be executed on. - */ - protected TargetNodeComponent fTargetNode = null; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public boolean isEnabled() { - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TargetNodeComponent node = null; - // Check if the node component is selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - Object element = ((StructuredSelection) selection).getFirstElement(); - node = (element instanceof TargetNodeComponent) ? (TargetNodeComponent) element : null; - } - boolean isEnabled = node != null; - fLock.lock(); - try { - if (isEnabled) { - fTargetNode = node; - } - } finally { - fLock.unlock(); - } - return isEnabled; - } - - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CalibrateHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CalibrateHandler.java deleted file mode 100644 index 521c2ee86a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CalibrateHandler.java +++ /dev/null @@ -1,132 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - *

- * Command handler implementation to execute command calibrate to quantify LTTng overhead. - *

- * - * @author Bernd Hufmann - */ -public class CalibrateHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The command execution parameter. - */ - protected DomainCommandParameter fParam = null; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - if (window == null) { - return false; - } - fLock.lock(); - try { - // Make a copy for thread safety - final DomainCommandParameter param = fParam.clone(); - - Job addJob = new Job(Messages.TraceControl_AddCalibrateJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - try { - param.getDomain().calibrate(monitor); - } catch (ExecutionException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_AddCalibrateFailure, e); - } - - return Status.OK_STATUS; - } - }; - addJob.setUser(true); - addJob.schedule(); - - } finally { - fLock.unlock(); - } - return Status.OK_STATUS; - } - - @Override - public boolean isEnabled() { - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceDomainComponent domain = null; - TraceSessionComponent session = null; - - // Check if one domain is selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceDomainComponent) { - TraceDomainComponent tmpDomain = (TraceDomainComponent) element; - session = (TraceSessionComponent) tmpDomain.getParent(); - - // Add only TraceDomainComponent whose TraceSessionComponent parent is not destroyed - if ((!session.isDestroyed())) { - domain = tmpDomain; - } - } - } - } - - boolean isEnabled = domain != null; - - fLock.lock(); - try { - fParam = null; - if (isEnabled) { - fParam = new DomainCommandParameter(session, domain); - } - } finally { - fLock.unlock(); - } - - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeChannelStateHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeChannelStateHandler.java deleted file mode 100644 index 125f06378a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeChannelStateHandler.java +++ /dev/null @@ -1,303 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - *

- * Abstract command handler implementation to enable or disabling a trace channel. - *

- * - * @author Bernd Hufmann - */ -public abstract class ChangeChannelStateHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The command execution parameter. - */ - protected Parameter fParam; - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return the new state to set - */ - protected abstract TraceEnablement getNewState(); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * Changes the state of the given channels. - * @param domain - the domain of the channels. - * @param channelNames - a list of channel names - * @param monitor - a progress monitor - * @throws ExecutionException If the command fails - */ - protected abstract void changeState(TraceDomainComponent domain, List channelNames, IProgressMonitor monitor) throws ExecutionException; - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - fLock.lock(); - try { - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - if (window == null) { - return false; - } - - final Parameter param = new Parameter(fParam); - - Job job = new Job(Messages.TraceControl_ChangeChannelStateJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - Exception error = null; - - TraceSessionComponent session = null; - - try { - TraceDomainComponent kernelDomain = param.getKernelDomain(); - List kernelChannels = param.getKernelChannels(); - - if (kernelDomain != null) { - session = (TraceSessionComponent)kernelDomain.getParent(); - List channelNames = new ArrayList<>(); - for (Iterator iterator = kernelChannels.iterator(); iterator.hasNext();) { - // Enable all selected channels which are disabled - TraceChannelComponent channel = iterator.next(); - channelNames.add(channel.getName()); - } - - changeState(kernelDomain, channelNames, monitor); - - for (Iterator iterator = kernelChannels.iterator(); iterator.hasNext();) { - // Enable all selected channels which are disabled - TraceChannelComponent channel = iterator.next(); - channel.setState(getNewState()); - } - } - - TraceDomainComponent ustDomain = param.getUstDomain(); - List ustChannels = param.getUstChannels(); - if (ustDomain != null) { - if (session == null) { - session = (TraceSessionComponent)ustDomain.getParent(); - } - - List channelNames = new ArrayList<>(); - for (Iterator iterator = ustChannels.iterator(); iterator.hasNext();) { - // Enable all selected channels which are disabled - TraceChannelComponent channel = iterator.next(); - channelNames.add(channel.getName()); - } - - changeState(ustDomain, channelNames, monitor); - - for (Iterator iterator = ustChannels.iterator(); iterator.hasNext();) { - // Enable all selected channels which are disabled - TraceChannelComponent channel = iterator.next(); - channel.setState(getNewState()); - } - } - } catch (ExecutionException e) { - error = e; - } - - // In all cases notify listeners - if (session != null) { - session.fireComponentChanged(session); - } - - if (error != null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeChannelStateFailure, error); - } - - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - - return null; - } - - @Override - public boolean isEnabled() { - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceDomainComponent kernelDomain = null; - TraceDomainComponent ustDomain = null; - List kernelChannels = new ArrayList<>(); - List ustChannels = new ArrayList<>(); - - // Check if one or more session are selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - String sessionName = null; - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - - if (element instanceof TraceChannelComponent) { - - // Add only TraceChannelComponents that are disabled - TraceChannelComponent channel = (TraceChannelComponent) element; - if (sessionName == null) { - sessionName = String.valueOf(channel.getSessionName()); - } - - // Enable command only for channels of same session - if (!sessionName.equals(channel.getSessionName())) { - kernelChannels.clear(); - ustChannels.clear(); - break; - } - - if ((channel.getState() != getNewState())) { - if (channel.isKernel()) { - kernelChannels.add(channel); - if (kernelDomain == null) { - kernelDomain = (TraceDomainComponent) channel.getParent(); - } - } else { - ustChannels.add(channel); - if (ustDomain == null) { - ustDomain = (TraceDomainComponent) channel.getParent(); - } - } - } - } - } - } - - boolean isEnabled = (!kernelChannels.isEmpty() || !ustChannels.isEmpty()); - fLock.lock(); - try { - if (isEnabled) { - fParam = new Parameter(kernelDomain, ustDomain, kernelChannels, ustChannels); - } - } finally { - fLock.unlock(); - } - - return isEnabled; - } - - /** - * Class containing parameter for the command execution. - */ - protected static class Parameter { - /** - * Kernel domain component reference. - */ - protected final TraceDomainComponent fKernelDomain; - /** - * UST domain component reference. - */ - protected final TraceDomainComponent fUstDomain; - /** - * The list of kernel channel components the command is to be executed on. - */ - protected final List fKernelChannels; - /** - * The list of UST channel components the command is to be executed on. - */ - protected final List fUstChannels; - - /** - * Constructor - * @param kernelDomain - a kernel domain component - * @param ustDomain - a UST domain component - * @param kernelChannels - list of available kernel channels - * @param ustChannels - list of available UST channels - */ - public Parameter(TraceDomainComponent kernelDomain, TraceDomainComponent ustDomain, List kernelChannels, List ustChannels) { - fKernelDomain = kernelDomain; - fUstDomain = ustDomain; - fKernelChannels = new ArrayList<>(); - fKernelChannels.addAll(kernelChannels); - fUstChannels = new ArrayList<>(); - fUstChannels.addAll(ustChannels); - } - - /** - * Copy constructor - * @param other a parameter to copy - */ - public Parameter(Parameter other) { - this(other.fKernelDomain, other.fUstDomain, other.fKernelChannels, other.fUstChannels); - } - - /** - * @return the kernel domain component. - */ - public TraceDomainComponent getKernelDomain() { - return fKernelDomain; - } - - /** - * @return the UST domain component. - */ - public TraceDomainComponent getUstDomain() { - return fUstDomain; - } - - /** - * @return the list of kernel channel components. - */ - public List getKernelChannels() { - return fKernelChannels; - } - - /** - * @return the list of UST channel components. - */ - public List getUstChannels() { - return fUstChannels; - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeEventStateHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeEventStateHandler.java deleted file mode 100644 index 72c53c103e..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeEventStateHandler.java +++ /dev/null @@ -1,261 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - *

- * Base Command handler implementation to enable or disabling a trace channel. - *

- * - * @author Bernd Hufmann - */ -public abstract class ChangeEventStateHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The command execution parameter. - */ - protected Parameter fParam; - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return the new state to set - */ - protected abstract TraceEnablement getNewState(); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * Change the state - * @param channel - channel of events to be enabled - * @param eventNames - list event names - * @param monitor - a progress monitor - * @throws ExecutionException If the command fails - */ - protected abstract void changeState(TraceChannelComponent channel, List eventNames, IProgressMonitor monitor) throws ExecutionException; - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - if (window == null) { - return false; - } - - fLock.lock(); - try { - - final Parameter param = new Parameter(fParam); - - Job job = new Job(Messages.TraceControl_ChangeChannelStateJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - Exception error = null; - - TraceSessionComponent session = null; - - try { - boolean isAll = false; - if (param.getChannel() != null) { - session = param.getChannel().getSession(); - List eventNames = new ArrayList<>(); - List events = param.getEvents(); - - for (Iterator iterator = events.iterator(); iterator.hasNext();) { - // Enable/disable all selected channels which are disabled - TraceEventComponent traceEvent = iterator.next(); - - // Workaround for wildcard handling in lttng-tools - if ("*".equals(traceEvent.getName())) { //$NON-NLS-1$ - isAll = true; - } else { - eventNames.add(traceEvent.getName()); - } - } - if (isAll) { - changeState(param.getChannel(), null, monitor); - } - - if (!eventNames.isEmpty()) { - changeState(param.getChannel(), eventNames, monitor); - } - - for (Iterator iterator = events.iterator(); iterator.hasNext();) { - // Enable all selected channels which are disabled - TraceEventComponent ev = iterator.next(); - ev.setState(getNewState()); - } - } - } catch (ExecutionException e) { - error = e; - } - - if (session != null) { - // In all cases notify listeners - session.fireComponentChanged(session); - } - - if (error != null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeEventStateFailure, error); - } - - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - // Check if one or more session are selected - ISelection selection = page.getSelection(ControlView.ID); - - TraceChannelComponent channel = null; - List events = new ArrayList<>(); - - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - String sessionName = null; - String channelName = null; - - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - - if (element instanceof TraceEventComponent) { - - TraceEventComponent event = (TraceEventComponent) element; - if (sessionName == null) { - sessionName = String.valueOf(event.getSessionName()); - } - - if (channel == null) { - channel = (TraceChannelComponent)event.getParent(); - } - - if (channelName == null) { - channelName = event.getChannelName(); - } - - // Enable command only for events of same session, same channel and domain - if ((!sessionName.equals(event.getSessionName())) || - (!channelName.equals(event.getChannelName())) || - (channel.isKernel() != event.isKernel())) { - events.clear(); - break; - } - - if ((event.getState() != getNewState())) { - events.add(event); - } - } - } - } - boolean isEnabled = !events.isEmpty(); - - fLock.lock(); - try { - fParam = null; - if (isEnabled) { - fParam = new Parameter(channel, events); - } - } finally { - fLock.unlock(); - } - return isEnabled; - } - - /** - * Class containing parameter for the command execution. - */ - protected static class Parameter { - /** - * Channel component reference. - */ - private final TraceChannelComponent fChannel; - /** - * The list of kernel channel components the command is to be executed on. - */ - private final List fEvents = new ArrayList<>(); - - /** - * Constructor - * @param channel - a channel component - * @param events - a list of event components - */ - public Parameter(TraceChannelComponent channel, List events) { - fChannel = channel; - fEvents.addAll(events); - } - - /** - * Copy constructor - * @param other - a parameter to copy - */ - public Parameter(Parameter other) { - this(other.fChannel, other.fEvents); - } - - /** - * @return the trace channel component. - */ - public TraceChannelComponent getChannel() { - return fChannel; - } - - /** - * @return a list of trace event components. - */ - public List getEvents() { - return fEvents; - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeSessionStateHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeSessionStateHandler.java deleted file mode 100644 index eb43ece9aa..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeSessionStateHandler.java +++ /dev/null @@ -1,157 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - *

- * Abstract command handler implementation to start or stop one or more trace sessions. - *

- * - * @author Bernd Hufmann - */ -public abstract class ChangeSessionStateHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The list of session components the command is to be executed on. - */ - protected List fSessions = new ArrayList<>(); - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * @return new required state. - */ - public abstract TraceSessionState getNewState(); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Performs the state change on given session. - * - * @param session - * - a session which state is to be changed - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public abstract void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException; - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - if (window == null) { - return false; - } - - fLock.lock(); - try { - - final List sessions = new ArrayList<>(); - sessions.addAll(fSessions); - - Job job = new Job(Messages.TraceControl_ChangeSessionStateJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - try { - for (Iterator iterator = sessions.iterator(); iterator.hasNext();) { - - // Start all selected sessions - TraceSessionComponent session = iterator.next(); - changeState(session, monitor); - - // Set Session state - session.setSessionState(getNewState()); - session.fireComponentChanged(session); - } - } catch (ExecutionException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeSessionStateFailure, e); - } - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - List sessions = new ArrayList<>(0); - - // Check if one or more session are selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceSessionComponent) { - // Add only TraceSessionComponents that are inactive and not destroyed - TraceSessionComponent session = (TraceSessionComponent) element; - if ((session.getSessionState() != getNewState()) && (!session.isDestroyed())) { - sessions.add(session); - } - } - } - } - boolean isEnabled = !sessions.isEmpty(); - fLock.lock(); - try { - fSessions = null; - if (isEnabled) { - fSessions = sessions; - } - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChannelCommandParameter.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChannelCommandParameter.java deleted file mode 100644 index fc0f7638e5..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChannelCommandParameter.java +++ /dev/null @@ -1,66 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; - -/** - * Class containing parameter for the command execution. - * - * @author Bernd Hufmann - */ -public class ChannelCommandParameter extends CommandParameter { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - private TraceChannelComponent fChannel; - - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param session - a trace session component. - * @param channel - a trace channel component - */ - public ChannelCommandParameter(TraceSessionComponent session, TraceChannelComponent channel) { - super(session); - fChannel = channel; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * @return the trace channel component - */ - public TraceChannelComponent getChannel() { - return fChannel; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public ChannelCommandParameter clone() { - ChannelCommandParameter clone = (ChannelCommandParameter) super.clone(); - clone.fChannel = fChannel; - return clone; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CommandParameter.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CommandParameter.java deleted file mode 100644 index a469561380..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CommandParameter.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; - -/** - * Class containing parameter for the command execution. - * - * @author Bernd Hufmann - */ -public class CommandParameter implements Cloneable { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The trace session component. - */ - private TraceSessionComponent fSession; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param session a trace session component. - */ - public CommandParameter(TraceSessionComponent session) { - fSession = session; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * @return the session component. - */ - public TraceSessionComponent getSession() { - return fSession; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public CommandParameter clone() { - CommandParameter clone = null; - try { - clone = (CommandParameter) super.clone(); - clone.fSession = fSession; - } catch (CloneNotSupportedException e) { - } - return clone; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ConnectHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ConnectHandler.java deleted file mode 100644 index b779adaab5..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ConnectHandler.java +++ /dev/null @@ -1,53 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; - -/** - *

- * Command handler implementation to connect to a target host. - *

- * - * @author Bernd Hufmann - */ -public class ConnectHandler extends BaseNodeHandler { - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - fLock.lock(); - try { - fTargetNode.connect(); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - boolean isEnabled = false; - fLock.lock(); - try { - isEnabled = (super.isEnabled() && (fTargetNode.getTargetNodeState() == TargetNodeState.DISCONNECTED)); - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CreateSessionHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CreateSessionHandler.java deleted file mode 100644 index 866670017a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CreateSessionHandler.java +++ /dev/null @@ -1,118 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.ICreateSessionDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to create a trace session. - *

- * - * @author Bernd Hufmann - */ -public class CreateSessionHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The trace session group the command is to be executed on. - */ - private TraceSessionGroup fSessionGroup = null; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - fLock.lock(); - try { - final TraceSessionGroup sessionGroup = fSessionGroup; - - // Open dialog box for the node name and address - final ICreateSessionDialog dialog = TraceControlDialogFactory.getInstance().getCreateSessionDialog(); - dialog.initialize(sessionGroup); - - if (dialog.open() != Window.OK) { - return null; - } - - Job job = new Job(Messages.TraceControl_CreateSessionJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - try { - sessionGroup.createSession(dialog.getParameters(), monitor); - } catch (ExecutionException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateSessionFailure, e); - } - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceSessionGroup sessionGroup = null; - - // Check if the session group project is selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - Object element = ((StructuredSelection) selection).getFirstElement(); - sessionGroup = (element instanceof TraceSessionGroup) ? (TraceSessionGroup) element : null; - } - - boolean isEnabled = sessionGroup != null; - fLock.lock(); - try { - fSessionGroup = null; - if(isEnabled) { - fSessionGroup = sessionGroup; - } - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DeleteHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DeleteHandler.java deleted file mode 100644 index b9437e5838..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DeleteHandler.java +++ /dev/null @@ -1,57 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; - -/** - *

- * Command handler implementation to delete a target host. - *

- * - * @author Bernd Hufmann - */ -public class DeleteHandler extends BaseNodeHandler { - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - fLock.lock(); - try { - ITraceControlComponent root = fTargetNode.getParent(); - fTargetNode.removeAllChildren(); - fTargetNode.deregister(); - root.removeChild(fTargetNode); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - boolean isEnabled = false; - fLock.lock(); - try { - isEnabled = (super.isEnabled() && (fTargetNode.getTargetNodeState() == TargetNodeState.DISCONNECTED)); - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DestroySessionHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DestroySessionHandler.java deleted file mode 100644 index 2735d930e3..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DestroySessionHandler.java +++ /dev/null @@ -1,129 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IConfirmDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - *

- * Command handler implementation to destroy one or more trace sessions. - *

- * - * @author Bernd Hufmann - */ -public class DestroySessionHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The list of session components the command is to be executed on. - */ - private final List fSessions = new ArrayList<>(); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - if (window == null) { - return false; - } - // Get user confirmation - IConfirmDialog dialog = TraceControlDialogFactory.getInstance().getConfirmDialog(); - if (!dialog.openConfirm(window.getShell(), - Messages.TraceControl_DestroyConfirmationTitle, - Messages.TraceControl_DestroyConfirmationMessage)) { - - return null; - } - - Job job = new Job(Messages.TraceControl_DestroySessionJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - try { - // Make a copy of the list of sessions to avoid ConcurrentModificationException when iterating - // over fSessions, since fSessions is modified in another thread triggered by the tree viewer refresh - // after removing a session. - TraceSessionComponent[] sessions = fSessions.toArray(new TraceSessionComponent[fSessions.size()]); - - for (int i = 0; i < sessions.length; i++) { - // Destroy all selected sessions - TraceSessionComponent session = sessions[i]; - TraceSessionGroup sessionGroup = (TraceSessionGroup)session.getParent(); - sessionGroup.destroySession(session, monitor); - } - } catch (ExecutionException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_DestroySessionFailure, e); - } - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - - return null; - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - fSessions.clear(); - - // Check if one or more session are selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceSessionComponent) { - // Add only TraceSessionComponents that are inactive and not destroyed - TraceSessionComponent session = (TraceSessionComponent) element; - if ((session.getSessionState() == TraceSessionState.INACTIVE) && (!session.isDestroyed())) { - fSessions.add((TraceSessionComponent)element); - } - } - } - } - return !fSessions.isEmpty(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableChannelHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableChannelHandler.java deleted file mode 100644 index cc1337fe12..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableChannelHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; - -/** - *

- * Command handler implementation to disable one or more trace channels per session and domain. - *

- * - * @author Bernd Hufmann - */ -public class DisableChannelHandler extends ChangeChannelStateHandler { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - protected TraceEnablement getNewState() { - return TraceEnablement.DISABLED; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void changeState(TraceDomainComponent domain, List channelNames, IProgressMonitor monitor) throws ExecutionException { - domain.disableChannels(channelNames, monitor); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableEventHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableEventHandler.java deleted file mode 100644 index 8503b8b76c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableEventHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; - -/** - *

- * Command handler implementation to disable one or more events session, domain and channel. - *

- * - * @author Bernd Hufmann - */ -public class DisableEventHandler extends ChangeEventStateHandler { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - protected TraceEnablement getNewState() { - return TraceEnablement.DISABLED; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void changeState(TraceChannelComponent channel, List eventNames, IProgressMonitor monitor) throws ExecutionException{ - channel.disableEvent(eventNames, monitor); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisconnectHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisconnectHandler.java deleted file mode 100644 index 24c0db0329..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisconnectHandler.java +++ /dev/null @@ -1,53 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; - -/** - *

- * Command handler implementation to disconnect from a target host. - *

- * - * @author Bernd Hufmann - */ -public class DisconnectHandler extends BaseNodeHandler { - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - fLock.lock(); - try { - fTargetNode.disconnect(); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - boolean isEnabled = false; - fLock.lock(); - try { - isEnabled = super.isEnabled() && (fTargetNode.getTargetNodeState() == TargetNodeState.CONNECTED); - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DomainCommandParameter.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DomainCommandParameter.java deleted file mode 100644 index f233c55572..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DomainCommandParameter.java +++ /dev/null @@ -1,66 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; - -/** - * Class containing parameter for the command execution. - * - * @author Bernd Hufmann - */ -public class DomainCommandParameter extends CommandParameter { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - private TraceDomainComponent fDomain; - - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param session - a trace session component. - * @param domain - a trace domain component - */ - public DomainCommandParameter(TraceSessionComponent session, TraceDomainComponent domain) { - super(session); - fDomain = domain; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * @return the trace domain component - */ - public TraceDomainComponent getDomain() { - return fDomain; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public DomainCommandParameter clone() { - DomainCommandParameter clone = (DomainCommandParameter) super.clone(); - clone.fDomain = fDomain; - return clone; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelHandler.java deleted file mode 100644 index 4c44129966..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; - -/** - *

- * Command handler implementation to enable one or more trace channels per session and domain. - *

- * - * @author Bernd Hufmann - */ -public class EnableChannelHandler extends ChangeChannelStateHandler { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - protected TraceEnablement getNewState() { - return TraceEnablement.ENABLED; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void changeState(TraceDomainComponent domain, List channelNames, IProgressMonitor monitor) throws ExecutionException { - domain.enableChannels(channelNames, null, monitor); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnDomainHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnDomainHandler.java deleted file mode 100644 index a718662837..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnDomainHandler.java +++ /dev/null @@ -1,105 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to enable a trace channel for known domain. - *

- * - * @author Bernd Hufmann - */ -public class EnableChannelOnDomainHandler extends BaseEnableChannelHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void enableChannel(CommandParameter param, List channelNames, IChannelInfo info, boolean isKernel, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof DomainCommandParameter) { - ((DomainCommandParameter)param).getDomain().enableChannels(channelNames, info, monitor); - } - } - - @Override - public TraceDomainComponent getDomain(CommandParameter param) { - if (param instanceof DomainCommandParameter) { - return ((DomainCommandParameter)param).getDomain(); - } - return null; - } - - @Override - public boolean isEnabled() { - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceDomainComponent domain = null; - TraceSessionComponent session = null; - - // Check if one domain is selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceDomainComponent) { - TraceDomainComponent tmpDomain = (TraceDomainComponent) element; - session = (TraceSessionComponent) tmpDomain.getParent(); - - // Add only TraceDomainComponent whose TraceSessionComponent parent is inactive and not destroyed - if ((session.getSessionState() == TraceSessionState.INACTIVE) && (!session.isDestroyed())) { - domain = tmpDomain; - } - } - } - } - - boolean isEnabled = domain != null; - - fLock.lock(); - try { - fParam = null; - if (isEnabled) { - fParam = new DomainCommandParameter(session, domain); - } - } finally { - fLock.unlock(); - } - - return isEnabled; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnSessionHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnSessionHandler.java deleted file mode 100644 index 1f22ff788d..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnSessionHandler.java +++ /dev/null @@ -1,94 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to enable a trace channel for unknown domain - * (on session level). - *

- * - * @author Bernd Hufmann - */ -public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - @Override - public void enableChannel(CommandParameter param, List channelNames, IChannelInfo info, boolean isKernel, IProgressMonitor monitor) throws ExecutionException { - param.getSession().enableChannels(channelNames, info, isKernel, monitor); - } - - @Override - public TraceDomainComponent getDomain(CommandParameter param) { - return null; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceSessionComponent session = null; - // Check if one session is selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceSessionComponent) { - // Add only TraceSessionComponents that are inactive and not destroyed - TraceSessionComponent tmpSession = (TraceSessionComponent) element; - if ((tmpSession.getSessionState() == TraceSessionState.INACTIVE) && (!tmpSession.isDestroyed())) { - session = tmpSession; - } - } - } - } - boolean isEnabled = session != null; - - fLock.lock(); - try { - fParam = null; - if (isEnabled) { - fParam = new CommandParameter(session); - } - } finally { - fLock.unlock(); - } - - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventHandler.java deleted file mode 100644 index fc59ad9714..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; - -/** - *

- * Command handler implementation to enable one or more events session, domain and channel. - *

- * - * @author Bernd Hufmann - */ -public class EnableEventHandler extends ChangeEventStateHandler { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - protected TraceEnablement getNewState() { - return TraceEnablement.ENABLED; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - protected void changeState(TraceChannelComponent channel, List eventNames, IProgressMonitor monitor) throws ExecutionException{ - channel.enableEvents(eventNames, monitor); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnChannelHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnChannelHandler.java deleted file mode 100644 index 538c2b4c3c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnChannelHandler.java +++ /dev/null @@ -1,122 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to enable events for a known channel. - *

- * - * @author Bernd Hufmann - */ -public class EnableEventOnChannelHandler extends BaseEnableEventHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void enableEvents(CommandParameter param, List eventNames, boolean isKernel, String filterExression, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof ChannelCommandParameter) { - ((ChannelCommandParameter)param).getChannel().enableEvents(eventNames, filterExression, monitor); - } - } - - @Override - public void enableSyscalls(CommandParameter param, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof ChannelCommandParameter) { - ((ChannelCommandParameter)param).getChannel().enableSyscalls(monitor); - } - } - - @Override - public void enableProbe(CommandParameter param, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof ChannelCommandParameter) { - ((ChannelCommandParameter)param).getChannel().enableProbe(eventName, isFunction, probe, monitor); - } - } - - @Override - public void enableLogLevel(CommandParameter param, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExression, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof ChannelCommandParameter) { - ((ChannelCommandParameter)param).getChannel().enableLogLevel(eventName, logLevelType, level, filterExression, monitor); - } - } - - @Override - public TraceDomainComponent getDomain(CommandParameter param) { - if (param instanceof ChannelCommandParameter) { - return (TraceDomainComponent) ((ChannelCommandParameter)param).getChannel().getParent(); - } - return null; - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceChannelComponent channel = null; - TraceSessionComponent session = null; - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceChannelComponent) { - // Add only if corresponding TraceSessionComponents is inactive and not destroyed - TraceChannelComponent tmpChannel = (TraceChannelComponent) element; - session = tmpChannel.getSession(); - if(!session.isDestroyed()) { - channel = tmpChannel; - } - } - } - } - - boolean isEnabled = (channel != null); - fLock.lock(); - try { - fParam = null; - if(isEnabled) { - fParam = new ChannelCommandParameter(session, channel); - } - } finally { - fLock.unlock(); - } - return isEnabled; - } -} - diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnDomainHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnDomainHandler.java deleted file mode 100644 index 1abb3fcea1..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnDomainHandler.java +++ /dev/null @@ -1,118 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to enable events for a known domain and default channel 'channel0' - * (which will be created if doesn't exist). - *

- * - * @author Bernd Hufmann - */ -public class EnableEventOnDomainHandler extends BaseEnableEventHandler { - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void enableEvents(CommandParameter param, List eventNames, boolean isKernel, String filterExression, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof DomainCommandParameter) { - ((DomainCommandParameter)param).getDomain().enableEvents(eventNames, monitor); - } - } - - @Override - public void enableSyscalls(CommandParameter param, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof DomainCommandParameter) { - ((DomainCommandParameter)param).getDomain().enableSyscalls(monitor); - } - } - - @Override - public void enableProbe(CommandParameter param, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof DomainCommandParameter) { - ((DomainCommandParameter)param).getDomain().enableProbe(eventName, isFunction, probe, monitor); - } - } - - @Override - public void enableLogLevel(CommandParameter param, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExression, IProgressMonitor monitor) throws ExecutionException { - if (param instanceof DomainCommandParameter) { - ((DomainCommandParameter)param).getDomain().enableLogLevel(eventName, logLevelType, level, filterExression, monitor); - } - } - - @Override - public TraceDomainComponent getDomain(CommandParameter param) { - if (param instanceof DomainCommandParameter) { - return ((DomainCommandParameter)param).getDomain(); - } - return null; - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceDomainComponent domain = null; - TraceSessionComponent session = null; - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceDomainComponent) { - // Add only if corresponding TraceSessionComponents is inactive and not destroyed - TraceDomainComponent tmpDomain = (TraceDomainComponent) element; - session = tmpDomain.getSession(); - if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) { - domain = tmpDomain; - } - } - } - } - - boolean isEnabled = (domain != null); - fLock.lock(); - try { - fParam = null; - if(isEnabled) { - fParam = new DomainCommandParameter(session, domain); - } - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnSessionHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnSessionHandler.java deleted file mode 100644 index dc4c89b86c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnSessionHandler.java +++ /dev/null @@ -1,109 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to enable events for a known session and default channel 'channel0' - * (which will be created if doesn't exist). - *

- * - * @author Bernd Hufmann - */ -public class EnableEventOnSessionHandler extends BaseEnableEventHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - //------------------------------------------------------------------------- - // Operations - // ------------------------------------------------------------------------ - - @Override - public void enableEvents(CommandParameter param, List eventNames, boolean isKernel, String filterExpression, IProgressMonitor monitor) throws ExecutionException { - param.getSession().enableEvents(eventNames, isKernel, filterExpression, monitor); - } - - @Override - public void enableSyscalls(CommandParameter param, IProgressMonitor monitor) throws ExecutionException { - param.getSession().enableSyscalls(monitor); - } - - @Override - public void enableProbe(CommandParameter param, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException { - param.getSession().enableProbe(eventName, isFunction, probe, monitor); - } - - @Override - public void enableLogLevel(CommandParameter param, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExpression, IProgressMonitor monitor) throws ExecutionException { - param.getSession().enableLogLevel(eventName, logLevelType, level, filterExpression, monitor); - } - - @Override - public TraceDomainComponent getDomain(CommandParameter param) { - return null; - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceSessionComponent session = null; - // Check if one session is selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceSessionComponent) { - // Add only if corresponding TraceSessionComponents is inactive and not destroyed - TraceSessionComponent tmpSession = (TraceSessionComponent) element; - if(tmpSession.getSessionState() == TraceSessionState.INACTIVE && !tmpSession.isDestroyed()) { - session = tmpSession; - } - } - } - } - boolean isEnabled = (session != null); - fLock.lock(); - try { - fParam = null; - if(isEnabled) { - fParam = new CommandParameter(session); - } - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EventCommandParameter.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EventCommandParameter.java deleted file mode 100644 index 411e061e07..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EventCommandParameter.java +++ /dev/null @@ -1,65 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; - -/** - * Class containing parameter for a command execution. - * - * @author Bernd Hufmann - */ -public class EventCommandParameter extends CommandParameter { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - private TraceEventComponent fEvent; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param session - a trace session component. - * @param event - a trace event component - */ - public EventCommandParameter(TraceSessionComponent session, TraceEventComponent event) { - super(session); - fEvent = event; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * @return the trace event component - */ - public TraceEventComponent getEvent() { - return fEvent; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public EventCommandParameter clone() { - EventCommandParameter clone = (EventCommandParameter) super.clone(); - clone.fEvent = fEvent; - return clone; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ExecuteCommandScriptHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ExecuteCommandScriptHandler.java deleted file mode 100644 index 1db9731470..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ExecuteCommandScriptHandler.java +++ /dev/null @@ -1,116 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.ISelectCommandScriptDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to execute commands of a command script. - *

- * - * @author Bernd Hufmann - */ -public class ExecuteCommandScriptHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The trace session group the command is to be executed on. - */ - private TraceSessionGroup fSessionGroup = null; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - fLock.lock(); - try { - final TraceSessionGroup sessionGroup = fSessionGroup; - - // Open dialog box for the node name and address - final ISelectCommandScriptDialog dialog = TraceControlDialogFactory.getInstance().getCommandScriptDialog(); - - if (dialog.open() != Window.OK) { - return null; - } - - Job job = new Job(Messages.TraceControl_ExecuteScriptJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - try { - sessionGroup.executeCommands(monitor, dialog.getCommands()); - } catch (ExecutionException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateSessionFailure, e); - } - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TraceSessionGroup sessionGroup = null; - - // Check if the session group project is selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - Object element = ((StructuredSelection) selection).getFirstElement(); - sessionGroup = (element instanceof TraceSessionGroup) ? (TraceSessionGroup) element : null; - } - - boolean isEnabled = sessionGroup != null; - fLock.lock(); - try { - fSessionGroup = null; - if(isEnabled) { - fSessionGroup = sessionGroup; - } - } finally { - fLock.unlock(); - } - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ImportHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ImportHandler.java deleted file mode 100644 index 99ea37c732..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ImportHandler.java +++ /dev/null @@ -1,390 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of streamed traces - * Patrick Tasse - Add support for source location - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubMonitor; -import org.eclipse.core.runtime.URIUtil; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.dialogs.MessageDialogWithToggle; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.LttngRelaydConnectionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.LttngRelaydConnectionManager; -import org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.LttngRelaydConsumer; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IImportDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.ImportFileInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.internal.tmf.ui.project.wizards.importtrace.ImportTraceWizard; -import org.eclipse.linuxtools.tmf.core.TmfCommonConstants; -import org.eclipse.linuxtools.tmf.core.project.model.TmfTraceImportException; -import org.eclipse.linuxtools.tmf.core.project.model.TraceTypeHelper; -import org.eclipse.linuxtools.tmf.ctf.core.CtfConstants; -import org.eclipse.linuxtools.tmf.ui.project.model.TmfOpenTraceHelper; -import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectElement; -import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectRegistry; -import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement; -import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceFolder; -import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceTypeUIUtils; -import org.eclipse.linuxtools.tmf.ui.project.model.TmfTracesFolder; -import org.eclipse.linuxtools.tmf.ui.project.model.TraceUtils; -import org.eclipse.rse.services.clientserver.messages.SystemMessageException; -import org.eclipse.rse.services.files.IFileService; -import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; -import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - *

- * Command handler implementation to import traces from a (remote) session to a - * tracing project. - *

- * - * @author Bernd Hufmann - */ -public class ImportHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** Name of default project to import traces to */ - public static final String DEFAULT_REMOTE_PROJECT_NAME = "Remote"; //$NON-NLS-1$ - - /** The preference key to remeber whether or not the user wants the notification shown next time **/ - private static final String NOTIFY_IMPORT_STREAMED_PREF_KEY = "NOTIFY_IMPORT_STREAMED"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The command parameter - */ - protected CommandParameter fParam; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - if (window == null) { - return false; - } - - fLock.lock(); - try { - final CommandParameter param = fParam.clone(); - - // create default project - IProject project = TmfProjectRegistry.createProject(DEFAULT_REMOTE_PROJECT_NAME, null, null); - - if (param.getSession().isLiveTrace()) { - importLiveTrace(new LttngRelaydConnectionInfo(param.getSession().getLiveUrl(), param.getSession().getLivePort(), param.getSession().getName()), project); - return null; - } else if (param.getSession().isStreamedTrace()) { - - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - String notify = store.getString(NOTIFY_IMPORT_STREAMED_PREF_KEY); - if (!MessageDialogWithToggle.ALWAYS.equals(notify)) { - MessageDialogWithToggle.openInformation(window.getShell(), null, Messages.TraceControl_ImportDialogStreamedTraceNotification, Messages.TraceControl_ImportDialogStreamedTraceNotificationToggle, false, store, NOTIFY_IMPORT_STREAMED_PREF_KEY); - } - - // Streamed trace - TmfProjectElement projectElement = TmfProjectRegistry.getProject(project, true); - TmfTraceFolder traceFolder = projectElement.getTracesFolder(); - - ImportTraceWizard wizard = new ImportTraceWizard(); - wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(traceFolder)); - WizardDialog dialog = new WizardDialog(window.getShell(), wizard); - dialog.open(); - return null; - } - - // Remote trace - final IImportDialog dialog = TraceControlDialogFactory.getInstance().getImportDialog(); - dialog.setSession(param.getSession()); - dialog.setDefaultProject(DEFAULT_REMOTE_PROJECT_NAME); - - if (dialog.open() != Window.OK) { - return null; - } - - Job job = new Job(Messages.TraceControl_ImportJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - - MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, Messages.TraceControl_ImportFailure, null); - List traces = dialog.getTracePathes(); - IProject selectedProject = dialog.getProject(); - for (Iterator iterator = traces.iterator(); iterator.hasNext();) { - try { - - if (monitor.isCanceled()) { - status.add(Status.CANCEL_STATUS); - break; - } - - ImportFileInfo remoteFile = iterator.next(); - - downloadTrace(remoteFile, selectedProject, monitor); - - // Set trace type - IFolder traceFolder = remoteFile.getDestinationFolder(); - - IResource file = traceFolder.findMember(remoteFile.getLocalTraceName()); - - if (file != null) { - TraceTypeHelper helper = null; - - try { - helper = TmfTraceTypeUIUtils.selectTraceType(file.getLocation().toOSString(), null, null); - } catch (TmfTraceImportException e) { - // the trace did not match any trace type - } - - if (helper != null) { - status.add(TmfTraceTypeUIUtils.setTraceType(file, helper)); - } - - try { - final String scheme = "sftp"; //$NON-NLS-1$ - String host = remoteFile.getImportFile().getHost().getName(); - int port = remoteFile.getImportFile().getParentRemoteFileSubSystem().getConnectorService().getPort(); - String path = remoteFile.getImportFile().getAbsolutePath(); - if (file instanceof IFolder) { - path += IPath.SEPARATOR; - } - URI uri = new URI(scheme, null, host, port, path, null, null); - String sourceLocation = URIUtil.toUnencodedString(uri); - file.setPersistentProperty(TmfCommonConstants.SOURCE_LOCATION, sourceLocation); - } catch (URISyntaxException e) { - } - } - } catch (ExecutionException e) { - status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ImportFailure, e)); - } catch (CoreException e) { - status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ImportFailure, e)); - } - } - return status; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - // Check if one or more session are selected - ISelection selection = page.getSelection(ControlView.ID); - TraceSessionComponent session = null; - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceSessionComponent) { - // Add only TraceSessionComponents that are inactive and not - // destroyed - TraceSessionComponent tmpSession = (TraceSessionComponent) element; - if ((tmpSession.isSnapshotSession() || tmpSession.isLiveTrace() || (tmpSession.getSessionState() == TraceSessionState.INACTIVE)) && (!tmpSession.isDestroyed())) { - session = tmpSession; - } - } - } - } - boolean isEnabled = session != null; - - fLock.lock(); - try { - fParam = null; - if (isEnabled) { - fParam = new CommandParameter(session); - } - } finally { - fLock.unlock(); - } - return isEnabled; - } - - // ------------------------------------------------------------------------ - // Helper methods - // ------------------------------------------------------------------------ - - /** - * Downloads a trace from the remote host to the given project. - * - * @param trace - * - trace information of trace to import - * @param project - * - project to import to - * @param monitor - * - a progress monitor - * @throws ExecutionException - */ - private static void downloadTrace(ImportFileInfo trace, IProject project, IProgressMonitor monitor) - throws ExecutionException { - try { - IRemoteFileSubSystem fsss = trace.getImportFile().getParentRemoteFileSubSystem(); - - IFolder traceFolder = project.getFolder(TmfTracesFolder.TRACES_FOLDER_NAME); - if (!traceFolder.exists()) { - throw new ExecutionException(Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTracesFolder.TRACES_FOLDER_NAME + ")"); //$NON-NLS-1$//$NON-NLS-2$ - } - - IFolder destinationFolder = trace.getDestinationFolder(); - TraceUtils.createFolder(destinationFolder, monitor); - - String traceName = trace.getLocalTraceName(); - IFolder folder = destinationFolder.getFolder(traceName); - if (folder.exists()) { - if (!trace.isOverwrite()) { - throw new ExecutionException(Messages.TraceControl_ImportDialogTraceAlreadyExistError + ": " + traceName); //$NON-NLS-1$ - } - } else { - folder.create(true, true, null); - } - - IRemoteFile[] sources = fsss.list(trace.getImportFile(), IFileService.FILE_TYPE_FILES, new NullProgressMonitor()); - SubMonitor subMonitor = SubMonitor.convert(monitor, sources.length); - subMonitor.beginTask(Messages.TraceControl_DownloadTask, sources.length); - - for (int i = 0; i < sources.length; i++) { - if (subMonitor.isCanceled()) { - monitor.setCanceled(true); - return; - } - String destination = folder.getLocation().addTrailingSeparator().append(sources[i].getName()).toOSString(); - subMonitor.setTaskName(Messages.TraceControl_DownloadTask + ' ' + traceName + '/' + sources[i].getName()); - fsss.download(sources[i], destination, null, subMonitor.newChild(1)); - } - } catch (SystemMessageException e) { - throw new ExecutionException(e.toString(), e); - } catch (CoreException e) { - throw new ExecutionException(e.toString(), e); - } - } - - private static void importLiveTrace(final LttngRelaydConnectionInfo connectionInfo, final IProject project) { - Job job = new Job(Messages.TraceControl_ImportJob) { - - @Override - protected IStatus run(final IProgressMonitor monitor) { - try { - // We initiate the connection first so that we can retrieve the trace path - LttngRelaydConsumer lttngRelaydConsumer = LttngRelaydConnectionManager.getInstance().getConsumer(connectionInfo); - try { - lttngRelaydConsumer.connect(); - } catch (CoreException e) { - new Status(IStatus.ERROR, Activator.PLUGIN_ID, org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.Messages.LttngRelaydConnectionManager_ConnectionError, e); - } - initializeTraceResource(connectionInfo, lttngRelaydConsumer.getTracePath(), project); - return Status.OK_STATUS; - } catch (CoreException | TmfTraceImportException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ImportHandler_LiveTraceInitError, e); - } - } - - }; - job.setSystem(true); - job.schedule(); - } - - - private static void initializeTraceResource(final LttngRelaydConnectionInfo connectionInfo, final String tracePath, final IProject project) throws CoreException, TmfTraceImportException { - IFolder folder = project.getFolder(TmfTracesFolder.TRACES_FOLDER_NAME); - IFolder traceFolder = folder.getFolder(connectionInfo.getSessionName()); - Path location = new Path(tracePath); - IStatus result = ResourcesPlugin.getWorkspace().validateLinkLocation(folder, location); - if (result.isOK()) { - traceFolder.createLink(location, IResource.REPLACE, new NullProgressMonitor()); - } else { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, result.getMessage())); - } - - TraceTypeHelper selectedTraceType = TmfTraceTypeUIUtils.selectTraceType(location.toOSString(), null, null); - // No trace type was determined. - TmfTraceTypeUIUtils.setTraceType(traceFolder, selectedTraceType); - - final TmfProjectElement projectElement = TmfProjectRegistry.getProject(project, true); - final TmfTraceFolder tracesFolder = projectElement.getTracesFolder(); - final List traces = tracesFolder.getTraces(); - TmfTraceElement found = null; - for (TmfTraceElement candidate : traces) { - if (candidate.getName().equals(connectionInfo.getSessionName())) { - found = candidate; - } - } - - if (found == null) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ImportHandler_LiveTraceElementError)); - } - - // Properties used to be able to reopen a trace in live mode - traceFolder.setPersistentProperty(CtfConstants.LIVE_HOST, connectionInfo.getHost()); - traceFolder.setPersistentProperty(CtfConstants.LIVE_PORT, Integer.toString(connectionInfo.getPort())); - traceFolder.setPersistentProperty(CtfConstants.LIVE_SESSION_NAME, connectionInfo.getSessionName()); - - final TmfTraceElement finalTrace = found; - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - TmfOpenTraceHelper.openTraceFromElement(finalTrace); - } - }); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java deleted file mode 100644 index 04bfccea7a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java +++ /dev/null @@ -1,197 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson and others - * - * 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: - * Bernd Hufmann - Initial API and implementation - * Anna Dushistova(Montavista) - [382684] Allow reusing already defined connections that have Files and Shells subsystems - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.ArrayList; -import java.util.Arrays; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.window.Window; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.INewConnectionDialog; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; -import org.eclipse.rse.core.IRSESystemType; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - *

- * Command handler for creation new connection for trace control. - *

- * - * @author Bernd Hufmann - */ -public class NewConnectionHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * The trace control system type defined for LTTng version 2.0 and later. - */ - public static final String TRACE_CONTROL_SYSTEM_TYPE = "org.eclipse.linuxtools.internal.lttng2.ui.control.systemType"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The parent trace control component the new node will be added to. - */ - private ITraceControlComponent fRoot = null; - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - assert (fRoot != null); - - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window == null) { - return false; - } - - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - - // get system type definition for LTTng 2.x connection - IRSESystemType sysType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(TRACE_CONTROL_SYSTEM_TYPE); - - // get all hosts for this system type - IHost[] hosts = getSuitableHosts(); - - // Open dialog box for the node name and address - final INewConnectionDialog dialog = TraceControlDialogFactory.getInstance().getNewConnectionDialog(); - dialog.setTraceControlParent(fRoot); - dialog.setHosts(hosts); - dialog.setPort(IRemoteSystemProxy.INVALID_PORT_NUMBER); - - if (dialog.open() != Window.OK) { - return null; - } - - String hostName = dialog.getConnectionName(); - String hostAddress = dialog.getHostName(); - int port = dialog.getPort(); - - // get the singleton RSE registry - IHost host = null; - - for (int i = 0; i < hosts.length; i++) { - if (hosts[i].getAliasName().equals(hostName)) { - host = hosts[i]; - break; - } - } - - if (host == null) { - // if there's no host then we will create it - try { - // create the host object as an SSH Only connection - host = registry.createHost( - sysType, //System Type Name - hostName, //Connection name - hostAddress, //IP Address - "Connection to Host"); //description //$NON-NLS-1$ - } - catch (Exception e) { - MessageDialog.openError(window.getShell(), - Messages.TraceControl_EclipseCommandFailure, - Messages.TraceControl_NewNodeCreationFailure + " (" + hostName + ", " + hostAddress + ")" + ":\n" + e.toString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - return null; - } - } - - if (host != null) { - fLock.lock(); - try { - // successful creation of host - TargetNodeComponent node = null; - if (!fRoot.containsChild(hostName)) { - node = new TargetNodeComponent(hostName, fRoot, host); - node.setPort(port); - fRoot.addChild(node); - } - else { - node = (TargetNodeComponent)fRoot.getChild(hostName); - } - - node.connect(); - } finally { - fLock.unlock(); - } - } - return null; - } - - private static IHost[] getSuitableHosts() { - // need shells and files - ArrayList result = new ArrayList<>(); - ArrayList shellConnections = new ArrayList<>( - Arrays.asList(RSECorePlugin.getTheSystemRegistry() - .getHostsBySubSystemConfigurationCategory("shells"))); //$NON-NLS-1$ - - for (IHost connection : shellConnections) { - ISubSystem[] subSystems = connection.getSubSystems(); - for (int i = 0; i < subSystems.length; i++) { - if (subSystems[i] instanceof IFileServiceSubSystem) { - result.add(connection); - break; - } - } - } - - return result.toArray(new IHost[result.size()]); - } - - @Override - public boolean isEnabled() { - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - ITraceControlComponent root = null; - - // no need to verify part because it has been already done in getWorkbenchPage() - IWorkbenchPart part = page.getActivePart(); - root = ((ControlView) part).getTraceControlRoot(); - - boolean isEnabled = root != null; - - fLock.lock(); - try { - fRoot = null; - if (isEnabled) { - fRoot = root; - } - } finally { - fLock.unlock(); - } - - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/RefreshHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/RefreshHandler.java deleted file mode 100644 index ba28a4de72..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/RefreshHandler.java +++ /dev/null @@ -1,105 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.Iterator; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to refresh node configuration. - *

- * - * @author Bernd Hufmann - */ -public class RefreshHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The node component reference. - */ - private TargetNodeComponent fNode; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - fLock.lock(); - try { - fNode.refresh(); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - TargetNodeComponent node = null; - // Check if one or more session are selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceControlComponent) { - TraceControlComponent component = (TraceControlComponent) element; - boolean isConnected = component.getTargetNodeState() == TargetNodeState.CONNECTED; - if (isConnected) { - while ((component != null) && component.getClass() != TargetNodeComponent.class) { - component = (TraceControlComponent) component.getParent(); - } - if (component != null) { - node = (TargetNodeComponent) component; - } - } - } - } - } - - boolean isEnabled = node != null; - - fLock.lock(); - try { - fNode = null; - if (isEnabled) { - fNode = node; - } - } finally { - fLock.unlock(); - } - - return isEnabled; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/SnaphshotHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/SnaphshotHandler.java deleted file mode 100644 index 25b52c4089..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/SnaphshotHandler.java +++ /dev/null @@ -1,130 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.ui.IWorkbenchPage; - -/** - *

- * Command handler implementation to record a snapshot. - *

- * - * @author Bernd Hufmann - */ -public class SnaphshotHandler extends BaseControlViewHandler { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The list of session components the command is to be executed on. - */ - protected List fSessions = new ArrayList<>(); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - fLock.lock(); - try { - // Make a copy for thread safety - final List sessions = new ArrayList<>(); - sessions.addAll(fSessions); - - Job job = new Job(Messages.TraceControl_RecordSnapshotJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null); - for (Iterator iterator = sessions.iterator(); iterator.hasNext();) { - try { - // record snapshot for all selected sessions sequentially - TraceSessionComponent session = iterator.next(); - session.recordSnapshot(monitor); - if (monitor.isCanceled()) { - status.add(Status.CANCEL_STATUS); - break; - } - } catch (ExecutionException e) { - status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_RecordSnapshotFailure, e)); - } - } - return status; - } - }; - job.setUser(true); - job.schedule(); - } finally { - fLock.unlock(); - } - return null; - } - - @Override - public boolean isEnabled() { - // Get workbench page for the Control View - IWorkbenchPage page = getWorkbenchPage(); - if (page == null) { - return false; - } - - List sessions = new ArrayList<>(0); - - // Check if one session is selected - ISelection selection = page.getSelection(ControlView.ID); - if (selection instanceof StructuredSelection) { - StructuredSelection structered = ((StructuredSelection) selection); - for (Iterator iterator = structered.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - if (element instanceof TraceSessionComponent) { - // Add only if corresponding TraceSessionComponent is an active snapshot session and not destroyed - TraceSessionComponent session = (TraceSessionComponent) element; - if(session.isSnapshotSession() && - session.getSessionState() == TraceSessionState.ACTIVE && - !session.isDestroyed()) { - sessions.add(session); - } - } - } - } - boolean isEnabled = !sessions.isEmpty(); - fLock.lock(); - try { - fSessions = null; - if (isEnabled) { - fSessions = sessions; - } - } finally { - fLock.unlock(); - } - return isEnabled; - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StartHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StartHandler.java deleted file mode 100644 index 841cce33f4..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StartHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; - -/** - *

- * Command handler implementation to start one or more trace sessions. - *

- * - * @author Bernd Hufmann - */ -public class StartHandler extends ChangeSessionStateHandler { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public TraceSessionState getNewState() { - return TraceSessionState.ACTIVE; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException { - session.startSession(monitor); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StopHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StopHandler.java deleted file mode 100644 index fc44dd676a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StopHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; - -/** - *

- * Command handler implementation to stop one or more trace sessions. - *

- * - * @author Bernd Hufmann - */ -public class StopHandler extends ChangeSessionStateHandler { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public TraceSessionState getNewState() { - return TraceSessionState.INACTIVE; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException { - session.stopSession(monitor); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/XmlMiValidationErrorHandler.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/XmlMiValidationErrorHandler.java deleted file mode 100644 index 6f6f5f7f7b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/XmlMiValidationErrorHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/********************************************************************** - * 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: - * Jonathan Rajotte - Initial implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceMI; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -/** - *

- * Error handler for xml xsd validation while using machine interface mode - * in {@link LTTngControlServiceMI}. - *

- * - * @author Jonathan Rajotte - */ -public class XmlMiValidationErrorHandler implements ErrorHandler { - - @Override - public void error(SAXParseException e) throws SAXException { - Activator.getDefault().logError(Messages.TraceControl_XmlValidationError, e); - throw new SAXException(Messages.TraceControl_XmlValidationError, e); - } - - @Override - public void fatalError(SAXParseException e) throws SAXException { - Activator.getDefault().logError(Messages.TraceControl_XmlValidationError, e); - throw new SAXException(Messages.TraceControl_XmlValidationError, e); - } - - @Override - public void warning(SAXParseException e) throws SAXException { - Activator.getDefault().logWarning(Messages.TraceControl_XmlValidationWarning, e); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/logging/ControlCommandLogger.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/logging/ControlCommandLogger.java deleted file mode 100644 index c308483c0b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/logging/ControlCommandLogger.java +++ /dev/null @@ -1,117 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging; - -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.IOException; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; - -/** - *

- * Class to log control commands. - *

- * - * @author Bernd Hufmann - */ -final public class ControlCommandLogger { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The bufferd writer reference - */ - private static BufferedWriter fTraceLog = null; - - // ------------------------------------------------------------------------ - // Constructor - // ------------------------------------------------------------------------ - private ControlCommandLogger() { - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * Initializes the logger class and opens the log file with the given parameter. - * @param filename - file name of logger output - * @param append - true to open log file in append mode else false (overwrite) - */ - public static void init(String filename, boolean append) { - if (fTraceLog != null) { - close(); - } - fTraceLog = openLogFile(filename, append); - } - - /** - * Closes the log file if open. - */ - public static void close() { - if (fTraceLog == null) { - return; - } - - try { - fTraceLog.close(); - fTraceLog = null; - } catch (IOException e) { - Activator.getDefault().logWarning("Can't close log file of the trace control", e); //$NON-NLS-1$ - } - } - - /** - * Logs a message to the log file. - * @param msg - message (e.g. command or command result) to log - */ - @SuppressWarnings("nls") - public static void log(String msg) { - long currentTime = System.currentTimeMillis(); - StringBuilder message = new StringBuilder("["); - message.append(currentTime / 1000); - message.append("."); - message.append(String.format("%1$03d", currentTime % 1000)); - message.append("] "); - message.append(msg); - if (fTraceLog != null) { - try { - fTraceLog.write(message.toString()); - fTraceLog.newLine(); - fTraceLog.flush(); - } catch (IOException e) { - Activator.getDefault().logError("Can't log message in log file of the tracer control", e); //$NON-NLS-1$ - } - } - } - - // ------------------------------------------------------------------------ - // Helper methods - // ------------------------------------------------------------------------ - /** - * Opens the trace log file with given name in the workspace root directory - * @param filename - file name of logger output - * @param append - true to open log file in append mode else false (overwrite) - * @return the buffer writer class or null if not successful - */ - private static BufferedWriter openLogFile(String filename, boolean append) { - BufferedWriter outfile = null; - try { - outfile = new BufferedWriter(new FileWriter(filename, append)); - } catch (IOException e) { - Activator.getDefault().logError("Can't open log file for logging of tracer control commands: " + filename, e); //$NON-NLS-1$ - } - return outfile; - } -} - diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/Messages.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/Messages.java deleted file mode 100644 index fd5210fa2c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/Messages.java +++ /dev/null @@ -1,343 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Jonathan Rajotte - Updated for basic support of LTTng 2.6 machine interface - *******************************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages; - -import org.eclipse.osgi.util.NLS; - -/** - * Messages file for the trace control package. - * - * @author Bernd Hufmann - */ -@SuppressWarnings("javadoc") -public final class Messages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.messages"; //$NON-NLS-1$ - - public static String EnableChannelDialog_DefaultMessage; - - public static String ImportHandler_LiveTraceElementError; - - public static String ImportHandler_LiveTraceInitError; - - // Failures - public static String TraceControl_ConnectionFailure; - public static String TraceControl_DisconnectionFailure; - public static String TraceControl_ExecutionCancelled; - public static String TraceControl_ExecutionFailure; - public static String TraceControl_ExecutionTimeout; - public static String TraceControl_ShellNotConnected; - - public static String TraceControl_CommandShellError; - public static String TraceControl_CommandError; - public static String TraceControl_UnexpectedCommandOutputFormat; - public static String TraceControl_UnexpectedNameError; - public static String TraceControl_UnexpectedPathError; - public static String TraceControl_UnexpectedNumberOfElementError; - public static String TraceControl_UnexpectedValueError; - - public static String TraceControl_UnsupportedVersionError; - public static String TraceControl_GettingVersionError; - - // Xml parsing related failures - public static String TraceControl_InvalidSchemaError; - public static String TraceControl_XmlDocumentBuilderError; - public static String TraceControl_XmlParsingError; - public static String TraceControl_XmlValidationError; - public static String TraceControl_XmlValidationWarning; - - // Xml machine interface failures - public static String TraceControl_MiInvalidNumberOfElementError; - public static String TraceControl_MiInvalidProviderError; - public static String TraceControl_MiMissingRequiredError; - public static String TraceControl_MiInvalidElementError; - public static String TraceControl_MiIllegalValueError; - - // Commands - public static String TraceControl_ErrorTitle; - public static String TraceControl_RetrieveNodeConfigurationJob; - public static String TraceControl_RetrieveNodeConfigurationFailure; - public static String TraceControl_ListSessionFailure; - public static String TraceControl_EclipseCommandFailure; - public static String TraceControl_NewNodeCreationFailure; - public static String TraceControl_CreateSessionJob; - public static String TraceControl_CreateSessionFailure; - - public static String TraceControl_DestroySessionJob; - public static String TraceControl_DestroySessionFailure; - public static String TraceControl_DestroyConfirmationTitle; - public static String TraceControl_DestroyConfirmationMessage; - - public static String TraceControl_ImportJob; - public static String TraceControl_DownloadTask; - public static String TraceControl_ImportFailure; - - public static String TraceControl_ChangeSessionStateJob; - public static String TraceControl_ChangeSessionStateFailure; - - public static String TraceControl_CreateChannelStateJob; - public static String TraceControl_CreateChannelStateFailure; - - public static String TraceControl_ChangeChannelStateJob; - public static String TraceControl_ChangeChannelStateFailure; - public static String TraceControl_ChangeEventStateJob; - public static String TraceControl_ChangeEventStateFailure; - - public static String TraceControl_EnableEventsJob; - public static String TraceControl_EnableEventsFailure; - public static String TraceControl_DisableEventsJob; - - public static String TraceControl_GetContextJob; - public static String TraceControl_GetContextFailure; - - public static String TraceControl_AddContextJob; - public static String TraceControl_AddContextFailure; - - public static String TraceControl_AddCalibrateJob; - public static String TraceControl_AddCalibrateFailure; - - public static String TraceControl_RecordSnapshotJob; - public static String TraceControl_RecordSnapshotFailure; - - // Dialogs - public static String TraceControl_NewDialogTitle; - public static String TraceControl_NewNodeExistingConnectionGroupName; - public static String TraceControl_NewNodeEditButtonName; - public static String TraceControl_NewNodeComboToolTip; - public static String TraceControl_NewNodeConnectionNameLabel; - public static String TraceControl_NewNodeConnectionNameTooltip; - public static String TraceControl_NewNodeHostNameLabel; - public static String TraceControl_NewNodeHostNameTooltip; - public static String TraceControl_NewNodePortLabel; - public static String TraceControl_NewNodePortTooltip; - public static String TraceControl_AlreadyExistsError; - - public static String TraceControl_CreateSessionDialogTitle; - public static String TraceControl_CreateSessionDialogMessage; - public static String TraceControl_CreateSessionNameLabel; - public static String TraceControl_CreateSessionNameTooltip; - public static String TraceControl_CreateSessionPathLabel; - public static String TraceControl_CreateSessionPathTooltip; - public static String TraceControl_CreateSessionNormalLabel; - public static String TraceControl_CreateSessionNormalTooltip; - public static String TraceControl_CreateSessionSnapshotLabel; - public static String TraceControl_CreateSessionSnapshotTooltip; - public static String TraceControl_CreateSessionLiveLabel; - public static String TraceControl_CreateSessionLiveTooltip; - - public static String TraceControl_CreateSessionConfigureStreamingButtonText; - public static String TraceControl_CreateSessionConfigureStreamingButtonTooltip; - public static String TraceControl_CreateSessionNoStreamingButtonText; - public static String TraceControl_CreateSessionNoStreamingButtonTooltip; - public static String TraceControl_CreateSessionTracePathText; - public static String TraceControl_CreateSessionTracePathTooltip; - public static String TraceControl_CreateSessionLinkButtonText; - public static String TraceControl_CreateSessionLinkButtonTooltip; - public static String TraceControl_CreateSessionProtocolLabelText; - public static String TraceControl_CreateSessionAddressLabelText; - public static String TraceControl_CreateSessionPortLabelText; - public static String TraceControl_CreateSessionControlUrlLabel; - public static String TraceControl_CreateSessionDataUrlLabel; - public static String TraceControl_CreateSessionCommonProtocolTooltip; - public static String TraceControl_CreateSessionControlAddressTooltip; - public static String TraceControl_CreateSessionControlPortTooltip; - public static String TraceControl_CreateSessionProtocolTooltip; - public static String TraceControl_CreateSessionDataAddressTooltip; - public static String TraceControl_CreateSessionDataPortTooltip; - public static String TraceControl_CreateSessionNoConsumertText; - public static String TraceControl_CreateSessionNoConsumertTooltip; - public static String TraceControl_CreateSessionDisableConsumertText; - public static String TraceControl_CreateSessionDisableConsumertTooltip; - public static String TraceControl_CreateSessionLiveConnectionLabel; - public static String TraceControl_CreateSessionLiveConnectionUrlTooltip; - public static String TraceControl_CreateSessionLiveConnectionPortTooltip; - public static String TraceControl_CreateSessionLiveDelayLabel; - public static String TraceControl_CreateSessionLiveDelayTooltip; - - public static String TraceControl_InvalidSessionNameError; - public static String TraceControl_SessionAlreadyExistsError; - public static String TraceControl_SessionPathAlreadyExistsError; - public static String TraceControl_InvalidSessionPathError; - public static String TraceControl_InvalidLiveDelayError; - public static String TraceControl_FileSubSystemError; - - public static String TraceControl_EnableChannelDialogTitle; - public static String TraceControl_EnableChannelNameLabel; - public static String TraceControl_EnableChannelNameTooltip; - public static String TraceControl_EnableChannelSubBufferSizeTooltip; - public static String TraceControl_EnableChannelNbSubBuffersTooltip; - public static String TraceControl_EnableChannelSwitchTimerTooltip; - public static String TraceControl_EnableChannelReadTimerTooltip; - public static String TraceControl_EnableChannelOutputTypeTooltip; - public static String TraceControl_EnableChannelDiscardModeGroupName; - public static String TraceControl_EnableChannelDiscardModeLabel; - public static String TraceControl_EnableChannelDiscardModeTooltip; - public static String TraceControl_EnableChannelOverwriteModeLabel; - public static String TraceControl_EnableChannelOverwriteModeTooltip; - public static String TraceControl_EnbleChannelMaxSizeTraceFilesTooltip; - public static String TraceControl_EnbleChannelMaxNumTraceFilesTooltip; - - public static String TraceControl_InvalidChannelNameError; - public static String TraceControl_ChannelAlreadyExistsError; - - public static String TraceControl_EnableEventsDialogTitle; - public static String TraceControl_EnableEventsSessionGroupName; - public static String TraceControl_EnableEventsChannelGroupName; - public static String TraceControl_EnableEventsSessionsTooltip; - public static String TraceControl_EnableEventsChannelsTooltip; - public static String TraceControl_EnableEventsNoSessionError; - public static String TraceControl_EnableEventsNoChannelError; - - public static String TraceControl_EnableGroupSelectionName; - public static String TraceControl_EnableEventsTracepointGroupName; - public static String TraceControl_EnableEventsTracepointTreeTooltip; - public static String TraceControl_EnableEventsTracepointTreeAllLabel; - public static String TraceControl_EnableEventsSyscallName; - public static String TraceControl_EnableEventsSyscallTooltip; - public static String TraceControl_EnableEventsProbeGroupName; - public static String TraceControl_EnableEventsEventNameLabel; - public static String TraceControl_EnableEventsProbeEventNameTooltip; - public static String TraceControl_EnableEventsProbeNameLabel; - public static String TraceControl_EnableEventsProbeNameTooltip; - public static String TraceControl_EnableEventsFucntionGroupName; - public static String TraceControl_EnableEventsFunctionEventNameTooltip; - public static String TraceControl_EnableEventsFunctionNameLabel; - - public static String TraceControl_EnableEventsWildcardGroupName; - public static String TraceControl_EnableEventsWildcardLabel; - public static String TraceControl_EnableEventsWildcardTooltip; - public static String TraceControl_EnableEventsLogLevelGroupName; - public static String TraceControl_EnableEventsLogLevelTypeName; - public static String TraceControl_EnableEventsLogLevelTypeTooltip; - public static String TraceControl_EnableEventsLogLevelOnlyTypeName; - public static String TraceControl_EnableEventsLogLevelOnlyTypeTooltip; - public static String TraceControl_EnableEventsLogLevelTooltip; - public static String TraceControl_EnableEventsLoglevelEventNameTooltip; - public static String TraceControl_EnableEventsFilterGroupName; - public static String TraceControl_EnableEventsFilterTooltip; - - public static String TraceControl_InvalidProbeNameError; - public static String TraceControl_InvalidWildcardError; - public static String TraceControl_InvalidLogLevelEventNameError; - public static String TraceControl_InvalidLogLevel; - - public static String TraceControl_AddContextDialogTitle; - public static String TraceControl_AddContextAvailableContextsLabel; - public static String TraceControl_AddContextAvailableContextsTooltip; - public static String TraceControl_AddContextAllLabel; - - public static String TraceControl_ImportDialogStreamedTraceNotification; - public static String TraceControl_ImportDialogStreamedTraceNotificationToggle; - public static String TraceControl_ImportDialogTitle; - public static String TraceControl_ImportDialogTracesGroupName; - public static String TraceControl_ImportDialogTracesTooltip; - public static String TraceControl_ImportDialogProjectsGroupName; - public static String TraceControl_ImportDialogProjectsTooltip; - public static String TraceControl_ImportDialogOverwriteButtonText; - public static String TraceControl_ImportDialogCreationError; - public static String TraceControl_ImportDialogNoProjectSelectedError; - public static String TraceControl_ImportDialogInvalidTracingProject; - public static String TraceControl_ImportDialogNoTraceSelectedError; - public static String TraceControl_ImportDialog_SelectAll; - public static String TraceControl_ImportDialog_DeselectAll; - - public static String TraceControl_ImportDialogConfirmationTitle; - public static String TraceControl_ImportDialogConfirmationOverwriteLabel; - public static String TraceControl_ImportDialogConfirmationRenameLabel; - public static String TraceControl_ImportDialogConfirmationNewNameLabel; - public static String TraceControl_InvalidTraceNameError; - public static String TraceControl_ImportDialogTraceAlreadyExistError; - - // Tree structure strings - public static String TraceControl_KernelDomainDisplayName; - public static String TraceControl_UstDisplayName; - public static String TraceControl_UstGlobalDomainDisplayName; - public static String TraceControl_UnknownDomainDisplayName; - public static String TraceControl_JULDomainDisplayName; - public static String TraceControl_AllSessionsDisplayName; - public static String TraceControl_SessionDisplayName; - public static String TraceControl_DomainDisplayName; - public static String TraceControl_BufferTypeDisplayName; - public static String TraceControl_ChannelDisplayName; - public static String TraceControl_EventDisplayName; - public static String TraceControl_ProviderDisplayName; - public static String TraceControl_KernelProviderDisplayName; - public static String TraceControl_SharedBuffersDisplayName; - public static String TraceControl_PerPidBuffersDisplayName; - public static String TraceControl_PerPidBuffersTooltip; - public static String TraceControl_PerUidBuffersDisplayName; - public static String TraceControl_PerUidBuffersTooltip; - - // Property names - public static String TraceControl_SessionNamePropertyName; - public static String TraceControl_EventNamePropertyName; - public static String TraceControl_EventTypePropertyName; - public static String TraceControl_LogLevelPropertyName; - public static String TraceControl_FieldsPropertyName; - public static String TraceControl_FilterPropertyName; - public static String TraceControl_StatePropertyName; - public static String TraceControl_VersionPropertyName; - public static String TraceControl_DomainNamePropertyName; - public static String TraceControl_BufferTypePropertyName; - public static String TraceControl_ChannelNamePropertyName; - public static String TraceControl_OverwriteModePropertyName; - public static String TraceControl_SubBufferSizePropertyName; - public static String TraceControl_NbSubBuffersPropertyName; - public static String TraceControl_SwitchTimerPropertyName; - public static String TraceControl_ReadTimerPropertyName; - public static String TraceControl_OutputTypePropertyName; - public static String TraceControl_HostNamePropertyName; - public static String TraceControl_HostAddressPropertyName; - public static String TraceControl_SessionPathPropertyName; - public static String TraceControl_SnapshotPathPropertyName; - public static String TraceControl_SnapshotNamePropertyName; - public static String TraceControl_SnapshotIdPropertyName; - public static String TraceControl_ProviderNamePropertyName; - public static String TraceControl_ProcessIdPropertyName; - public static String TraceControl_ProbeAddressPropertyName; - public static String TraceControl_ProbeOffsetPropertyName; - public static String TraceControl_ProbeSymbolPropertyName; - public static String TraceControl_MaxSizeTraceFilesPropertyName; - public static String TraceControl_MaxNumTraceFilesPropertyName; - public static String TraceControl_ConfigureMetadataChannelName; - - // Preferences - public static String TraceControl_TracingGroupPreference; - public static String TraceControl_LoggingPreference; - public static String TraceControl_LogfilePath; - public static String TraceControl_AppendLogfilePreference; - public static String TraceControl_CommandTimeout; - - public static String TraceControl_VerboseLevelsPreference; - public static String TraceControl_VerboseLevelNonePreference; - public static String TraceControl_VerboseLevelVerbosePreference; - public static String TraceControl_VerboseLevelVeryVerbosePreference; - public static String TraceControl_VerboseLevelVeryVeryVerbosePreference; - - public static String TraceControl_ExecuteScriptJob; - public static String TraceControl_ExecuteScriptError; - - public static String TraceControl_ExecuteScriptDialogTitle; - public static String TraceControl_ExecuteScriptBrowseText; - public static String TraceControl_ExecuteScriptSelectLabel; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/messages.properties b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/messages.properties deleted file mode 100644 index f826ea3789..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/messages.properties +++ /dev/null @@ -1,321 +0,0 @@ -############################################################################### -# Copyright (c) 2012, 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: -# Bernd Hufmann - initial API and implementation -# Jonathan Rajotte - updated for basic support of LTTng 2.6 machine interface -############################################################################### - -EnableChannelDialog_DefaultMessage=Default -ImportHandler_LiveTraceElementError=Could not find trace element -ImportHandler_LiveTraceInitError=Error initializing live trace. -TraceControl_ConnectionFailure=Connecting to host failed -TraceControl_DisconnectionFailure=Disconnection from host failed -TraceControl_ExecutionCancelled=Command Execution cancelled -TraceControl_ExecutionFailure=Command Execution failed -TraceControl_ExecutionTimeout=Command Execution timed-out -TraceControl_ShellNotConnected=Command shell not connected -TraceControl_CommandShellError=Could not create HostShellProcessAdapter -TraceControl_CommandError=Command failed! Command: -TraceControl_UnexpectedCommandOutputFormat=Unexpected command output -TraceControl_UnexpectedNameError=Unexpected session name returned -TraceControl_UnexpectedPathError=Unexpected session path returned -TraceControl_UnexpectedNumberOfElementError=Unexpected number of elements {0} returned -TraceControl_UnexpectedValueError=Unexpected value. Returned {0} Expected: {1} - -TraceControl_UnsupportedVersionError=Unsupported LTTng Tracer Control version -TraceControl_GettingVersionError=Could not get version of LTTng Tracer Control - -# Xml parsing related failures -TraceControl_InvalidSchemaError=Could not open/validate xsd Schema -TraceControl_XmlDocumentBuilderError=Unable to create the xml document builder -TraceControl_XmlParsingError=Unable to parse the xml document -TraceControl_XmlValidationError=Could not validate the xml response -TraceControl_XmlValidationWarning=Xml validation warning - -# Xml machine interface failures -TraceControl_MiInvalidNumberOfElementError=Invalid number of element -TraceControl_MiInvalidProviderError=Invalid provider data -TraceControl_MiMissingRequiredError=Missing required data -TraceControl_MiIllegalValueError=Invalid value - -# Commands -TraceControl_MiInvalidElementError=Invalid xml data - -TraceControl_ErrorTitle=Error -TraceControl_ListSessionFailure=List sessions failed -TraceControl_RetrieveNodeConfigurationJob=Retrieving Target Node Configuration... -TraceControl_RetrieveNodeConfigurationFailure=Error retrieving node configuration -TraceControl_EclipseCommandFailure=Command failed -TraceControl_NewNodeCreationFailure=Creation of new connection failed -TraceControl_CreateSessionJob=Creating Session... -TraceControl_CreateSessionFailure=Command to create session failed - -TraceControl_DestroySessionJob=Destroying Session... -TraceControl_DestroySessionFailure=Command to destroy session failed -TraceControl_DestroyConfirmationTitle=Destroy Confirmation -TraceControl_DestroyConfirmationMessage=Do you want to delete all selected sessions? - -TraceControl_ImportJob=Importing Traces... -TraceControl_DownloadTask=Downloading -TraceControl_ImportFailure=Command to import traces failed - -TraceControl_ChangeSessionStateJob=Changing Session State... -TraceControl_ChangeSessionStateFailure=Command to change session state failed... - -TraceControl_CreateChannelStateJob=Enabling (creating) channel... -TraceControl_CreateChannelStateFailure=Command to enable channel failed - -TraceControl_ChangeChannelStateJob=Changing State of Channels... -TraceControl_ChangeChannelStateFailure=Command to change state of channels failed -TraceControl_ChangeEventStateJob=Changing State of Events... -TraceControl_ChangeEventStateFailure=Command to change state of events failed - -TraceControl_EnableEventsJob=Enabling Events... -TraceControl_EnableEventsFailure=Command to enable events failed -TraceControl_DisableEventsJob=Disabling Events... - -TraceControl_GetContextJob=Getting Available Contexts... -TraceControl_GetContextFailure=Command to get available contexts failed - -TraceControl_AddContextJob=Adding Contexts... -TraceControl_AddContextFailure=Command to add contexts failed - -TraceControl_AddCalibrateJob=Calibrating... -TraceControl_AddCalibrateFailure=Command to calibrate failed - -TraceControl_RecordSnapshotJob=Record snapshot... -TraceControl_RecordSnapshotFailure=Command to snapshot record failed - -# Dialogs -TraceControl_NewDialogTitle=New Connection -TraceControl_NewNodeExistingConnectionGroupName=Existing Connections -TraceControl_NewNodeEditButtonName=Edit connection information -TraceControl_NewNodeComboToolTip=List of existing connections (connection name - host name) -TraceControl_NewNodeConnectionNameLabel=Connection Name -TraceControl_NewNodeConnectionNameTooltip=Alias to be displayed for node to connect to. -TraceControl_NewNodeHostNameLabel=Host Name -TraceControl_NewNodeHostNameTooltip=IP Address or DNS name of node to connect to. -TraceControl_NewNodePortLabel=Port Number -TraceControl_NewNodePortTooltip=IP Port Number to be used for the connection. Leave empty for default port. -TraceControl_AlreadyExistsError=Node name already exists in Control View - -TraceControl_CreateSessionDialogTitle=Create Session -TraceControl_CreateSessionDialogMessage=Configure the new tracing session -TraceControl_CreateSessionNameLabel=Session Name -TraceControl_CreateSessionNameTooltip=The name of the session to be created. -TraceControl_CreateSessionPathLabel=Session Path -TraceControl_CreateSessionPathTooltip=The session path (keep empty for default location) -TraceControl_CreateSessionNormalLabel=Normal Mode -TraceControl_CreateSessionNormalTooltip=Configure session in normal mode -TraceControl_CreateSessionSnapshotLabel=Snapshot Mode -TraceControl_CreateSessionSnapshotTooltip=Configure session in snapshot mode -TraceControl_CreateSessionLiveLabel=Live Mode -TraceControl_CreateSessionLiveTooltip=Configure session in live mode - - -TraceControl_CreateSessionConfigureStreamingButtonText=Advanced -TraceControl_CreateSessionConfigureStreamingButtonTooltip=Configure advanced options -TraceControl_CreateSessionNoStreamingButtonText=Basic -TraceControl_CreateSessionNoStreamingButtonTooltip=Use basic options -TraceControl_CreateSessionTracePathText=Trace Path -TraceControl_CreateSessionTracePathTooltip=The trace path (keep empty for default location) -TraceControl_CreateSessionLinkButtonText=Use same protocol and address for data and control -TraceControl_CreateSessionLinkButtonTooltip=Use the same protocol and address for the data and control connection -TraceControl_CreateSessionProtocolLabelText=Protocol -TraceControl_CreateSessionAddressLabelText=Address -TraceControl_CreateSessionPortLabelText=Port -TraceControl_CreateSessionControlUrlLabel=Control URL -TraceControl_CreateSessionDataUrlLabel=Data URL -TraceControl_CreateSessionCommonProtocolTooltip=file - Local file system full path\n\ -net or net6 - Default network transport layer which is TCP for both control and data channel. -TraceControl_CreateSessionControlAddressTooltip=IP Address or DNS name used for control channel.\n\ -NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732) -TraceControl_CreateSessionControlPortTooltip=The control port (default: 5342). -TraceControl_CreateSessionProtocolTooltip=file - Local file system full path\n\ -net or net6 - Default network transport layer which is TCP\n\ -tcp or tcp6 - TCP network transport -TraceControl_CreateSessionDataAddressTooltip=IP Address or DNS name used for data channel.\n\ -NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732) -TraceControl_CreateSessionDataPortTooltip=The data port (default: 5343). -TraceControl_CreateSessionNoConsumertText=No Consumer -TraceControl_CreateSessionNoConsumertTooltip=Don't activate a consumer for this session. -TraceControl_CreateSessionDisableConsumertText=Disable Consumer -TraceControl_CreateSessionDisableConsumertTooltip=Disable consumer for this session. -TraceControl_CreateSessionLiveConnectionLabel=Live Connection -TraceControl_CreateSessionLiveDelayLabel=Live Delay -TraceControl_CreateSessionLiveDelayTooltip=The delay in micro seconds before the data is flushed and streamed -TraceControl_CreateSessionLiveConnectionUrlTooltip=The URL for the live connection (Relayd) -TraceControl_CreateSessionLiveConnectionPortTooltip=The port for the live connection (Relayd) - -TraceControl_InvalidSessionNameError=The session name is invalid -TraceControl_SessionAlreadyExistsError=The session name already exists -TraceControl_SessionPathAlreadyExistsError=Session path already exists -TraceControl_InvalidSessionPathError=The session path is invalid -TraceControl_InvalidLiveDelayError=Live Delay must be a valid positive number -TraceControl_FileSubSystemError=File subsystem error in session creation dialog. - -TraceControl_EnableChannelDialogTitle=Enable Channel -TraceControl_EnableChannelNameLabel=Channel Name -TraceControl_EnableChannelNameTooltip=The name of the channel to be enabled. -TraceControl_EnableChannelSubBufferSizeTooltip=The sub-buffers size of the channel. Needs to be a power of 2 for kernel and ust tracers (Only for versions prior to 2.2.0). -TraceControl_EnableChannelNbSubBuffersTooltip=The number of sub-buffers of the channel. Needs to be a power of 2 for kernel and ust tracers (Only for versions prior to 2.2.0). -TraceControl_EnableChannelSwitchTimerTooltip=The Switch subbuffer timer interval in usec (default: 0). Needs to be a power of 2 for kernel and ust tracers (Only for versions prior to 2.2.0). -TraceControl_EnableChannelReadTimerTooltip=The Read timer interval in usec. -TraceControl_EnableChannelOutputTypeTooltip=The output type of the channel. -TraceControl_EnableChannelDiscardModeGroupName=Discard Mode -TraceControl_EnableChannelDiscardModeLabel=Discard -TraceControl_EnableChannelDiscardModeTooltip=Discard event when subbuffers are full -TraceControl_EnableChannelOverwriteModeLabel=Overwrite -TraceControl_EnableChannelOverwriteModeTooltip=Flight recorder mode : overwrites events when subbuffers are full -TraceControl_EnbleChannelMaxSizeTraceFilesTooltip=Maximum size of each tracefile within a stream (in bytes). 0 means unlimited -TraceControl_EnbleChannelMaxNumTraceFilesTooltip=Used in conjunction with the maximum size of trace files option, this will limit the number of files created to the specified count. 0 means unlimited - -TraceControl_InvalidChannelNameError=The channel name is invalid or empty -TraceControl_ChannelAlreadyExistsError=Channel already exists - -TraceControl_EnableEventsDialogTitle=Enable Events -TraceControl_EnableEventsSessionGroupName=Session List -TraceControl_EnableEventsChannelGroupName=Channel List -TraceControl_EnableEventsSessionsTooltip=List of available sessions. -TraceControl_EnableEventsChannelsTooltip=List of available channels of selected session.\nIf no channel is available default channel will be created. -TraceControl_EnableEventsNoSessionError=No session from session list is selected. -TraceControl_EnableEventsNoChannelError=No channel from channel list is selected. - -TraceControl_EnableGroupSelectionName=Select -TraceControl_EnableEventsTracepointGroupName=Tracepoint Events -TraceControl_EnableEventsTracepointTreeTooltip=List of available kernel tracepoint events -TraceControl_EnableEventsTracepointTreeAllLabel=All -TraceControl_EnableEventsSyscallName=All Syscalls -TraceControl_EnableEventsSyscallTooltip=Enable all Syscalls -TraceControl_EnableEventsProbeGroupName=Dynamic Probe -TraceControl_EnableEventsEventNameLabel=Event Name -TraceControl_EnableEventsProbeEventNameTooltip=The name of the event for enabling a dynamic probe -TraceControl_EnableEventsProbeNameLabel=Probe -TraceControl_EnableEventsProbeNameTooltip=[addr | symbol | symbol+offset]\nAddr and offset can be octal (0NNN...),\ndecimal (NNN...) or hexadecimal (0xNNN...) -TraceControl_EnableEventsFucntionGroupName=Dynamic Function Entry/Return Probe -TraceControl_EnableEventsFunctionEventNameTooltip=The name of the event for enabling a dynamic function entry/return probe -TraceControl_EnableEventsFunctionNameLabel=Function - -TraceControl_EnableEventsWildcardGroupName=Wildcard -TraceControl_EnableEventsWildcardLabel=Wildcard -TraceControl_EnableEventsWildcardTooltip=The wild card string of event names -TraceControl_EnableEventsLogLevelGroupName=Log Level -TraceControl_EnableEventsLogLevelTypeName=loglevel -TraceControl_EnableEventsLogLevelTypeTooltip=The tracepoint log level range from 0 to loglevel -TraceControl_EnableEventsLogLevelOnlyTypeName=loglevel-only -TraceControl_EnableEventsLogLevelOnlyTypeTooltip=The tracepoint log level (only this loglevel) -TraceControl_EnableEventsLogLevelTooltip=The available log levels -TraceControl_EnableEventsLoglevelEventNameTooltip=Event name for enabling log levels -TraceControl_EnableEventsFilterGroupName=Filter Expression -TraceControl_EnableEventsFilterTooltip=Filter expression on event field. - -TraceControl_InvalidProbeNameError=The probe name is invalid or empty -TraceControl_InvalidWildcardError=The wild card name is invalid or empty -TraceControl_InvalidLogLevelEventNameError=The event name for log level is invalid or empty -TraceControl_InvalidLogLevel=No log level selected - -TraceControl_AddContextDialogTitle=Add Contexts -TraceControl_AddContextAvailableContextsLabel=Contexts -TraceControl_AddContextAvailableContextsTooltip=Available Contexts -TraceControl_AddContextAllLabel=All Contexts - -TraceControl_ImportDialogStreamedTraceNotification=You are importing a trace generated by a streamed session. By default the traces will be outputed to ~/lttng-traces/hostname/sessionname but the location can vary. -TraceControl_ImportDialogStreamedTraceNotificationToggle=Do not warn me again -TraceControl_ImportDialogTitle=Import Traces -TraceControl_ImportDialogTracesGroupName=Available Traces -TraceControl_ImportDialogTracesTooltip=The available traces of current session to import -TraceControl_ImportDialogProjectsGroupName=Available Projects -TraceControl_ImportDialogProjectsTooltip=The available projects to select from -TraceControl_ImportDialogOverwriteButtonText=Overwrite existing trace without warning -TraceControl_ImportDialogCreationError=Dialog box cannot be created -TraceControl_ImportDialogNoProjectSelectedError=No tracing project selected or available -TraceControl_ImportDialogInvalidTracingProject=Invalid tracing project. Missing directory -TraceControl_ImportDialogNoTraceSelectedError=No trace selected or available - -TraceControl_ImportDialogConfirmationTitle=Import Confirmation Dialog -TraceControl_ImportDialogConfirmationOverwriteLabel=Overwrite -TraceControl_ImportDialogConfirmationRenameLabel=Rename -TraceControl_ImportDialogConfirmationNewNameLabel=New Trace Name -TraceControl_InvalidTraceNameError=Invalid trace name -TraceControl_ImportDialogTraceAlreadyExistError=Trace already exists in project -TraceControl_ImportDialog_SelectAll=Select All -TraceControl_ImportDialog_DeselectAll=Deselect All - - -# Tree structure strings -TraceControl_KernelDomainDisplayName=Kernel -TraceControl_JULDomainDisplayName=JUL -TraceControl_UstGlobalDomainDisplayName=UST global -TraceControl_UstDisplayName=UST -TraceControl_UnknownDomainDisplayName=Unknown domain -TraceControl_AllSessionsDisplayName=Sessions -TraceControl_SessionDisplayName=Session -TraceControl_DomainDisplayName=Domain -TraceControl_BufferTypeDisplayName = Buffer Type -TraceControl_ChannelDisplayName=Channel -TraceControl_EventDisplayName=Event -TraceControl_ProviderDisplayName=Provider -TraceControl_KernelProviderDisplayName=Kernel -TraceControl_SharedBuffersDisplayName=Global shared buffers -TraceControl_PerPidBuffersDisplayName=Per PID buffers -TraceControl_PerPidBuffersTooltip=Configure per PID buffers (UST only) -TraceControl_PerUidBuffersDisplayName=Per UID buffers -TraceControl_PerUidBuffersTooltip=Configure per UID buffers (UST only) - -# Property names -TraceControl_SessionNamePropertyName=Session Name -TraceControl_EventNamePropertyName=Event Name -TraceControl_EventTypePropertyName=Event Type -TraceControl_LogLevelPropertyName=Log Level -TraceControl_FieldsPropertyName=Fields -TraceControl_FilterPropertyName=Filter -TraceControl_StatePropertyName=State -TraceControl_VersionPropertyName=Version -TraceControl_DomainNamePropertyName=Domain Name -TraceControl_BufferTypePropertyName=Buffer type -TraceControl_ChannelNamePropertyName=Channel Name -TraceControl_OverwriteModePropertyName=Overwrite Mode -TraceControl_SubBufferSizePropertyName=Sub Buffer Size -TraceControl_NbSubBuffersPropertyName=Number of Sub Buffers -TraceControl_SwitchTimerPropertyName=Switch Timer Interval -TraceControl_ReadTimerPropertyName=Read Timer Interval -TraceControl_OutputTypePropertyName=Output Type -TraceControl_HostNamePropertyName=Connection Name -TraceControl_HostAddressPropertyName=Host Name -TraceControl_SessionPathPropertyName=Session Path -TraceControl_SnapshotPathPropertyName=Snapshot Path -TraceControl_SnapshotNamePropertyName=Snapshot Name -TraceControl_SnapshotIdPropertyName=Snapshot ID -TraceControl_ProviderNamePropertyName=Provider Name -TraceControl_ProcessIdPropertyName=Process ID -TraceControl_ProbeAddressPropertyName=Address -TraceControl_ProbeOffsetPropertyName=Offset -TraceControl_ProbeSymbolPropertyName=Symbol -TraceControl_MaxSizeTraceFilesPropertyName=Maximum size of trace files -TraceControl_MaxNumTraceFilesPropertyName=Maximum number of trace files -TraceControl_ConfigureMetadataChannelName=Configure metadata channel - -# Preferences -TraceControl_TracingGroupPreference=&Tracing Group -TraceControl_LoggingPreference=&Logging -TraceControl_LogfilePath=Log file -TraceControl_CommandTimeout=Command Timeout (in seconds) -TraceControl_AppendLogfilePreference=&Append -TraceControl_VerboseLevelsPreference=&Verbose Level -TraceControl_VerboseLevelNonePreference=None -TraceControl_VerboseLevelVerbosePreference=Level 1 -TraceControl_VerboseLevelVeryVerbosePreference=Level 2 -TraceControl_VerboseLevelVeryVeryVerbosePreference=Level 3 - -TraceControl_ExecuteScriptJob=Executing command script -TraceControl_ExecuteScriptError=Error executing command script - -TraceControl_ExecuteScriptDialogTitle=Select command script -TraceControl_ExecuteScriptBrowseText=Browse... -TraceControl_ExecuteScriptSelectLabel=Select Script diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponent.java deleted file mode 100644 index 0a6dacf2d0..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponent.java +++ /dev/null @@ -1,192 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model; - -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.swt.graphics.Image; - -/** - *

- * Interface for trace control components that can be displayed in the - * trace control tree viewer. - *

- * - * @author Bernd Hufmann - */ -public interface ITraceControlComponent extends IAdaptable { - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * @return the name of the component - */ - String getName(); - /** - * Sets the name of the component to the given value. - * @param name - name to set - */ - void setName(String name); - - /** - * @return the image representing the component. - */ - Image getImage(); - /** - * Sets the image path of the component. - * @param path - path to the image location - */ - void setImage(String path); - /** - * Sets the image the component. - * @param image - image to the image location - */ - void setImage(Image image); - - /** - * @return tool tip with information about the component. - */ - String getToolTip(); - /** - * Sets the tool tip with information about the component. - * @param toolTip - the tool tip to set. - */ - void setToolTip(String toolTip); - - /** - * @return the node's connection state - */ - TargetNodeState getTargetNodeState(); - /** - * Sets the node's connection state. - * @param state - the state to set - */ - void setTargetNodeState(TargetNodeState state); - - /** - * @return returns the parent component. - */ - ITraceControlComponent getParent(); - /** - * Sets the parent component. - * @param parent - the parent to set. - */ - void setParent(ITraceControlComponent parent); - - /** - * @return the children components - */ - ITraceControlComponent[] getChildren(); - /** - * Sets the children components. - * @param children - the children to set. - */ - void setChildren(List children); - /** - * Returns the child component with given name. - * @param name - name of child to find. - * @return child component or null. - */ - ITraceControlComponent getChild(String name); - /** - * Gets children for given class type. - * @param clazz - a class type to get - * @return list of trace control components matching given class type. - */ - List getChildren(Class clazz); - - /** - * @return the LTTng control service implementation. - */ - ILttngControlService getControlService(); - - /** - * Sets the LTTng control service implementation. - * @param service - the service to set. - */ - void setControlService(ILttngControlService service); - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * Dispose any resource. - */ - void dispose(); - - /** - * Adds a child component. - * @param component - child to add. - */ - void addChild(ITraceControlComponent component); - - /** - * Removes the given child component. - * @param component - the child to remove. - */ - void removeChild(ITraceControlComponent component); - - /** - * Removes all children. - */ - void removeAllChildren(); - - /** - * Checks if child with given name exists. - * @param name - child name to search for. - * @return - true if exists else false. - */ - boolean containsChild(String name); - - /** - * Checks for children. - * @return true if one or more children exist else false - */ - boolean hasChildren(); - - /** - * Adds a component listener for notification of component changes. - * @param listener - listener interface implementation to add. - */ - void addComponentListener(ITraceControlComponentChangedListener listener); - - /** - * Removes a component listener for notification of component changes. - * @param listener - listener interface implementation to remove. - */ - void removeComponentListener(ITraceControlComponentChangedListener listener); - - /** - * Notifies listeners about the addition of a child. - * @param parent - the parent where the child was added. - * @param component - the child that was added. - */ - void fireComponentAdded(ITraceControlComponent parent, ITraceControlComponent component); - - /** - * Notifies listeners about the removal of a child. - * @param parent - the parent where the child was removed. - * @param component - the child that was removed. - */ - void fireComponentRemoved(ITraceControlComponent parent, ITraceControlComponent component); - - /** - * Notifies listeners about the change of a component. - * @param component - the component that was changed. - */ - void fireComponentChanged(ITraceControlComponent component); -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponentChangedListener.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponentChangedListener.java deleted file mode 100644 index 5e60557cea..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponentChangedListener.java +++ /dev/null @@ -1,42 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model; - -/** - *

- * Listener interface a class can implement to be notified about changes - * of components - *

- * - * @author Bernd Hufmann - */ -public interface ITraceControlComponentChangedListener { - /** - * Interface for notifications about the addition of a component. - * @param parent - the parent where the child was added. - * @param component - the child that was added. - */ - void componentAdded(ITraceControlComponent parent, ITraceControlComponent component); - - /** - * Interface for notifications about the removal of a child. - * @param parent - the parent where the child was removed. - * @param component - the child that was removed. - */ - void componentRemoved(ITraceControlComponent parent, ITraceControlComponent component); - /** - * NInterface for notifications about the change of a component. - * @param component - the component that was changed. - */ - void componentChanged(ITraceControlComponent component); -} - diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/BaseEventComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/BaseEventComponent.java deleted file mode 100644 index 8459b3f900..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/BaseEventComponent.java +++ /dev/null @@ -1,165 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.BaseEventPropertySource; -import org.eclipse.ui.views.properties.IPropertySource; - -/** - *

- * Implementation of the base trace event component. - *

- * - * @author Bernd Hufmann - */ -public class BaseEventComponent extends TraceControlComponent { - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Path to icon file for this component. - */ - public static final String TRACE_EVENT_ICON_FILE_ENABLED = "icons/obj16/event_enabled.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The Event information implementation. - */ - private IBaseEventInfo fEventInfo; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public BaseEventComponent(String name, ITraceControlComponent parent) { - super(name, parent); - setImage(TRACE_EVENT_ICON_FILE_ENABLED); - fEventInfo = new EventInfo(name); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * Sets the event information. - * @param eventInfo - the event info to set. - */ - public void setEventInfo(IBaseEventInfo eventInfo) { - fEventInfo = eventInfo; - } - - /** - * @return the event type. - */ - public TraceEventType getEventType() { - return fEventInfo.getEventType(); - } - - /** - * Sets the event type to the given value. - * @param type - type to set. - */ - public void setEventType(TraceEventType type) { - fEventInfo.setEventType(type); - } - - /** - * Sets the event type to the value specified by the give name. - * @param typeName - the type name. - */ - public void setEventType(String typeName) { - fEventInfo.setEventType(typeName); - } - - /** - * @return the trace event log level - */ - public TraceLogLevel getLogLevel() { - return fEventInfo.getLogLevel(); - } - - /** - * Sets the trace event log level to the given level - * @param level - event log level to set - */ - public void setLogLevel(TraceLogLevel level) { - fEventInfo.setLogLevel(level); - } - - /** - * Sets the trace event log level to the level specified by the given name. - * @param levelName - event log level name - */ - public void setLogLevel(String levelName) { - fEventInfo.setLogLevel(levelName); - } - - /** - * @return a String containing pairs if field name and data type - */ - public String getFieldString() { - IFieldInfo[] fields = fEventInfo.getFields(); - if ((fields != null) && (fields.length > 0)) { - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < fields.length; i++) { - buffer.append(fields[i].getName()); - buffer.append("="); //$NON-NLS-1$ - buffer.append(fields[i].getFieldType()); - if (i != fields.length-1) { - buffer.append(";"); //$NON-NLS-1$ - } - } - return buffer.toString(); - } - return null; - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == IPropertySource.class) { - return new BaseEventPropertySource(this); - } - return null; - } - - /** - * @return target node component. - */ - public TargetNodeComponent getTargetNode() { - return (TargetNodeComponent) getParent().getParent(); - } - - /** - * @return if provider kernel or UST - */ - public boolean isKernel() { - return getParent() instanceof KernelProviderComponent; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/KernelProviderComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/KernelProviderComponent.java deleted file mode 100644 index 803b60df98..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/KernelProviderComponent.java +++ /dev/null @@ -1,82 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.KernelProviderPropertySource; -import org.eclipse.ui.views.properties.IPropertySource; - -/** - *

- * Implementation of the Kernel provider component. - *

- * - * @author Bernd Hufmann - */ -public class KernelProviderComponent extends TraceControlComponent { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * Path to icon file for this component. - */ - public static final String KERNEL_PROVIDER_ICON_FILE = "icons/obj16/targets.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public KernelProviderComponent(String name, ITraceControlComponent parent) { - super(name, parent); - setToolTip(Messages.TraceControl_ProviderDisplayName); - setImage(KERNEL_PROVIDER_ICON_FILE); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * Sets the events information for this component. - * @param eventInfos - events information to set. - */ - public void setEventInfo(List eventInfos) { - for (Iterator iterator = eventInfos.iterator(); iterator.hasNext();) { - IBaseEventInfo baseEventInfo = iterator.next(); - BaseEventComponent component = new BaseEventComponent(baseEventInfo.getName(), this); - component.setEventInfo(baseEventInfo); - addChild(component); - } - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == IPropertySource.class) { - return new KernelProviderPropertySource(this); - } - return null; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java deleted file mode 100644 index 1f3ccb7b8b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java +++ /dev/null @@ -1,455 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TargetNodePropertySource; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.RemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceFactory; -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.IRSECallback; -import org.eclipse.rse.core.model.ISystemRegistry; -import org.eclipse.rse.core.subsystems.CommunicationsEvent; -import org.eclipse.rse.core.subsystems.ICommunicationsListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.views.properties.IPropertySource; - -/** - *

- * Implementation of the trace node component. - *

- * - * @author Bernd Hufmann - */ -public class TargetNodeComponent extends TraceControlComponent implements ICommunicationsListener { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * Path to icon file for this component (state connected). - */ - public static final String TARGET_NODE_CONNECTED_ICON_FILE = "icons/obj16/target_connected.gif"; //$NON-NLS-1$ - /** - * Path to icon file for this component (state disconnected). - */ - public static final String TARGET_NODE_DISCONNECTED_ICON_FILE = "icons/obj16/target_disconnected.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The node connection state. - */ - private TargetNodeState fState = TargetNodeState.DISCONNECTED; - /** - * The image to be displayed in state disconnected. - */ - private Image fDisconnectedImage = null; - /** - * The connection implementation. - */ - private IHost fHost = null; - /** - * The remote proxy implementation. - */ - private IRemoteSystemProxy fRemoteProxy = null; - /** - * The control service for LTTng specific commands. - */ - private ILttngControlService fService = null; - /** - * The command shell for issuing commands. - */ - private ICommandShell fShell = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param name - the name of the component - * @param parent - the parent of the component - * @param host - the host connection implementation - * @param proxy - the remote proxy implementation - */ - public TargetNodeComponent(String name, ITraceControlComponent parent, IHost host, IRemoteSystemProxy proxy) { - super(name, parent); - setImage(TARGET_NODE_CONNECTED_ICON_FILE); - fDisconnectedImage = Activator.getDefault().loadIcon(TARGET_NODE_DISCONNECTED_ICON_FILE); - fHost = host; - fRemoteProxy = proxy; - setToolTip(fHost.getHostName()); - } - - /** - * Constructor (using default proxy) - * @param name - the name of the component - * @param parent - the parent of the component - * @param host - the host connection implementation - */ - public TargetNodeComponent(String name, ITraceControlComponent parent, IHost host) { - this(name, parent, host, new RemoteSystemProxy(host)); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public Image getImage() { - if (fState == TargetNodeState.CONNECTED) { - return super.getImage(); - } - return fDisconnectedImage; - } - - @Override - public TargetNodeState getTargetNodeState() { - return fState; - } - - @Override - public void setTargetNodeState(TargetNodeState state) { - fState = state; - fireComponentChanged(TargetNodeComponent.this); - } - - @Override - public ILttngControlService getControlService() { - return fService; - } - - @Override - public void setControlService(ILttngControlService service) { - fService = service; - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == IPropertySource.class) { - return new TargetNodePropertySource(this); - } - return null; - } - - /** - * @return remote host name - */ - public String getHostName() { - return fHost.getHostName(); - } - - /** - * @return remote system proxy implementation - */ - public IRemoteSystemProxy getRemoteSystemProxy() { - return fRemoteProxy; - } - - /** - * @return port of IP connection (shell) to be used - */ - public int getPort() { - return fRemoteProxy.getPort(); - } - - /** - * Sets the port of the IP connections of the shell - * @param port - the IP port to set - */ - public void setPort(int port) { - fRemoteProxy.setPort(port); - } - - /** - * @return all available sessions. - */ - public TraceSessionComponent[] getSessions() { - List compenents = getChildren(TraceSessionGroup.class); - if (compenents.size() > 0) { - TraceSessionGroup group = (TraceSessionGroup)compenents.get(0); - List sessions = group.getChildren(TraceSessionComponent.class); - return sessions.toArray(new TraceSessionComponent[sessions.size()]); - } - return new TraceSessionComponent[0]; - } - - /** - * @return node version - */ - public String getNodeVersion() { - // Control service is null during connection to node - if (getControlService() != null) { - return getControlService().getVersionString(); - } - return ""; //$NON-NLS-1$ - } - - /** - * Returns if node supports filtering of events - * @return true if node supports filtering else false - */ - public boolean isEventFilteringSupported() { - return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$ - } - - /** - * Returns if node supports networks streaming or not - * @return true if node supports filtering else false - * - */ - public boolean isNetworkStreamingSupported() { - return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$ - } - - /** - * Returns if node supports configuring buffer type or not - * @return true if node supports buffer type configuration else false - */ - public boolean isBufferTypeConfigSupported() { - return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$ - } - - /** - * Returns if node supports trace file rotation or not - * @return true if node supports trace file rotation else false - */ - public boolean isTraceFileRotationSupported() { - return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$ - } - - /** - * Returns if node supports periodical flush for metadata or not - * @return true if node supports periodical flush for metadata else false - */ - public boolean isPeriodicalMetadataFlushSupported() { - return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$ - } - /** - * Returns if node supports snapshots or not - * @return true if it supports snapshots else false - * - */ - public boolean isSnapshotSupported() { - return getControlService().isVersionSupported("2.3.0"); //$NON-NLS-1$ - } - /** - * Returns if node supports live or not - * @return true if it supports live else false - * - */ - public boolean isLiveSupported() { - return getControlService().isVersionSupported("2.4.0"); //$NON-NLS-1$; - } - /** - * Returns if node supports adding contexts on event - * @return true if it supports adding contexts on events else false - * - */ - public boolean isContextOnEventSupported() { - return !getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$ - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void communicationsStateChange(CommunicationsEvent e) { - if (e.getState() == CommunicationsEvent.AFTER_DISCONNECT || - e.getState() == CommunicationsEvent.CONNECTION_ERROR) { - handleDisconnected(); - } if ((e.getState() == CommunicationsEvent.AFTER_CONNECT) && (fState != TargetNodeState.CONNECTING)) { - handleConnected(); - } - } - - @Override - public boolean isPassiveCommunicationsListener() { - return true; - } - - @Override - public void dispose() { - fRemoteProxy.removeCommunicationListener(this); - } - - /** - * Method to connect this node component to the remote target node. - */ - public void connect() { - if (fState == TargetNodeState.DISCONNECTED) { - try { - setTargetNodeState(TargetNodeState.CONNECTING); - fRemoteProxy.connect(new IRSECallback() { - @Override - public void done(IStatus status, Object result) { - // Note: result might be null! - if(status.isOK()) { - handleConnected(); - } else { - handleDisconnected(); - } - } - }); - } catch (Exception e) { - setTargetNodeState(TargetNodeState.DISCONNECTED); - Activator.getDefault().logError(Messages.TraceControl_ConnectionFailure + " (" + getName() + "). \n", e); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - } - - /** - * Method to disconnect this node component to the remote target node. - */ - public void disconnect() { - if (fState == TargetNodeState.CONNECTED) { - try { - setTargetNodeState(TargetNodeState.DISCONNECTING); - fRemoteProxy.disconnect(); - } catch (Exception e) { - Activator.getDefault().logError(Messages.TraceControl_DisconnectionFailure + " (" + getName() + "). \n", e); //$NON-NLS-1$ //$NON-NLS-2$ - } finally { - handleDisconnected(); - } - } - } - - /** - * Retrieves the trace configuration from the target node and populates the - * information in the tree model. The execution is done in a own job. - */ - public void getConfigurationFromNode() { - Job job = new Job(Messages.TraceControl_RetrieveNodeConfigurationJob) { - @Override - protected IStatus run(IProgressMonitor monitor) { - - try { - // Get provider information from node - TraceProviderGroup providerGroup = new TraceProviderGroup(Messages.TraceControl_ProviderDisplayName, TargetNodeComponent.this); - addChild(providerGroup); - providerGroup.getProviderFromNode(monitor); - - // Get session information from node - TraceSessionGroup sessionGroup = new TraceSessionGroup(Messages.TraceControl_AllSessionsDisplayName, TargetNodeComponent.this); - addChild(sessionGroup); - sessionGroup.getSessionsFromNode(monitor); - } catch (ExecutionException e) { - removeAllChildren(); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_RetrieveNodeConfigurationFailure, e); - } - - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } - - /** - * Refresh the node configuration - */ - public void refresh() { - removeAllChildren(); - getConfigurationFromNode(); - } - - /** - * Deregisters host from registry. - */ - public void deregister() { - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - // Don't remove local host because it cannot be recreated by - // LTTng NewConnection Dialog - if (!fRemoteProxy.isLocal()) { - registry.deleteHost(fHost); - } - } - - // ------------------------------------------------------------------------ - // Helper function - // ------------------------------------------------------------------------ - - /** - * @return returns the control service for LTTng specific commands. - * @throws ExecutionException - */ - private ILttngControlService createControlService() throws ExecutionException { - if (fShell == null) { - fShell = fRemoteProxy.createCommandShell(); - fRemoteProxy.addCommunicationListener(this); - } - fService = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); - return fService; - } - - /** - * Handles the connected event. - */ - private void handleConnected() { - setTargetNodeState(TargetNodeState.CONNECTED); - try { - createControlService(); - getConfigurationFromNode(); - } catch (final ExecutionException e) { - // Disconnect only if no control service, otherwise stay connected. - if (getControlService() == null) { - disconnect(); - } - - // Notify user - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - ErrorDialog er = new ErrorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), - Messages.TraceControl_ErrorTitle, Messages.TraceControl_RetrieveNodeConfigurationFailure, - new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e), - IStatus.ERROR); - er.open(); - } - }); - Activator.getDefault().logError(Messages.TraceControl_RetrieveNodeConfigurationFailure + " (" + getName() + "). \n", e); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /** - * Handles the disconnected event. - */ - private void handleDisconnected() { - removeAllChildren(); - setTargetNodeState(TargetNodeState.DISCONNECTED); - fShell = null; - fService = null; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java deleted file mode 100644 index 7316a456de..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java +++ /dev/null @@ -1,387 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceChannelPropertySource; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.views.properties.IPropertySource; - - -/** - *

- * Implementation of the trace channel component. - *

- * - * @author Bernd Hufmann - */ -public class TraceChannelComponent extends TraceControlComponent { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * Path to icon file for this component (state enabled). - */ - public static final String TRACE_CHANNEL_ICON_FILE_ENABLED = "icons/obj16/channel.gif"; //$NON-NLS-1$ - /** - * Path to icon file for this component (state disabled). - */ - public static final String TRACE_CHANNEL_ICON_FILE_DISABLED = "icons/obj16/channel_disabled.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The channel information. - */ - private IChannelInfo fChannelInfo = null; - /** - * The image to be displayed in disabled state. - */ - private Image fDisabledImage = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public TraceChannelComponent(String name, ITraceControlComponent parent) { - super(name, parent); - setImage(TRACE_CHANNEL_ICON_FILE_ENABLED); - setToolTip(Messages.TraceControl_ChannelDisplayName); - fChannelInfo = new ChannelInfo(name); - fDisabledImage = Activator.getDefault().loadIcon(TRACE_CHANNEL_ICON_FILE_DISABLED); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public Image getImage() { - if (fChannelInfo.getState() == TraceEnablement.DISABLED) { - return fDisabledImage; - } - return super.getImage(); - } - - /** - * Sets the channel information. - * - * @param channelInfo - * The channel info to assign to this component - */ - public void setChannelInfo(IChannelInfo channelInfo) { - fChannelInfo = channelInfo; - IEventInfo[] events = fChannelInfo.getEvents(); - List eventComponents = new ArrayList<>(); - for (int i = 0; i < events.length; i++) { - TraceEventComponent event = null; - if (events[i].getClass() == ProbeEventInfo.class) { - event = new TraceProbeEventComponent(events[i].getName(), this); - } else { - event = new TraceEventComponent(events[i].getName(), this); - } - - eventComponents.add(event); - event.setEventInfo(events[i]); - } - if (!eventComponents.isEmpty()) { - setChildren(eventComponents); - } - } - - /** - * @return the overwrite mode value. - */ - public boolean isOverwriteMode() { - return fChannelInfo.isOverwriteMode(); - } - /** - * Sets the overwrite mode value to the given mode. - * @param mode - mode to set. - */ - public void setOverwriteMode(boolean mode){ - fChannelInfo.setOverwriteMode(mode); - } - /** - * @return the sub-buffer size. - */ - public long getSubBufferSize() { - return fChannelInfo.getSubBufferSize(); - } - /** - * Sets the sub-buffer size to the given value. - * @param bufferSize - size to set to set. - */ - public void setSubBufferSize(long bufferSize) { - fChannelInfo.setSubBufferSize(bufferSize); - } - /** - * @return the number of sub-buffers. - */ - public int getNumberOfSubBuffers() { - return fChannelInfo.getNumberOfSubBuffers(); - } - /** - * Sets the number of sub-buffers to the given value. - * @param numberOfSubBuffers - value to set. - */ - public void setNumberOfSubBuffers(int numberOfSubBuffers) { - fChannelInfo.setNumberOfSubBuffers(numberOfSubBuffers); - } - /** - * @return the switch timer interval. - */ - public long getSwitchTimer() { - return fChannelInfo.getSwitchTimer(); - } - /** - * Sets the switch timer interval to the given value. - * @param timer - timer value to set. - */ - public void setSwitchTimer(long timer) { - fChannelInfo.setSwitchTimer(timer); - } - /** - * @return the read timer interval. - */ - public long getReadTimer() { - return fChannelInfo.getReadTimer(); - } - /** - * Sets the read timer interval to the given value. - * @param timer - timer value to set.. - */ - public void setReadTimer(long timer) { - fChannelInfo.setReadTimer(timer); - } - /** - * @return the output type. - */ - public TraceChannelOutputType getOutputType() { - return fChannelInfo.getOutputType(); - } - /** - * Sets the output type to the given value. - * @param type - type to set. - */ - public void setOutputType(TraceChannelOutputType type) { - fChannelInfo.setOutputType(type); - } - /** - * Sets the output type to the given value. - * @param type - type to set. - */ - public void setOutputType(String type) { - fChannelInfo.setOutputType(type); - } - - /** - * @return the channel state (enabled or disabled). - */ - public TraceEnablement getState() { - return fChannelInfo.getState(); - } - /** - * Sets the channel state (enablement) to the given value. - * @param state - state to set. - */ - public void setState(TraceEnablement state) { - fChannelInfo.setState(state); - } - /** - * Sets the channel state (enablement) to the value specified by the given name. - * @param stateName - state to set. - */ - public void setState(String stateName) { - fChannelInfo.setState(stateName); - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == IPropertySource.class) { - return new TraceChannelPropertySource(this); - } - return null; - } - - /** - * @return session name from parent - */ - public String getSessionName() { - return ((TraceDomainComponent)getParent()).getSessionName(); - } - - /** - * @return session from parent - */ - public TraceSessionComponent getSession() { - return ((TraceDomainComponent)getParent()).getSession(); - } - - /** - * @return if domain is kernel or UST - */ - public boolean isKernel() { - return ((TraceDomainComponent)getParent()).isKernel(); - } - - /** - * @return the parent target node - */ - public TargetNodeComponent getTargetNode() { - return ((TraceDomainComponent)getParent()).getTargetNode(); - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Enables a list of events with no additional parameters. - * - * @param eventNames - * - a list of event names to enabled. - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableEvents(List eventNames, IProgressMonitor monitor) throws ExecutionException { - enableEvents(eventNames, null, monitor); - } - - /** - * Enables a list of events with no additional parameters. - * - * @param eventNames - * - a list of event names to enabled. - * @param filterExpression - * - a filter expression - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableEvents(List eventNames, String filterExpression, IProgressMonitor monitor) throws ExecutionException { - getControlService().enableEvents(getSessionName(), getName(), eventNames, isKernel(), filterExpression, monitor); - } - - /** - * Enables all syscalls (for kernel domain) - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableSyscalls(IProgressMonitor monitor) throws ExecutionException { - getControlService().enableSyscalls(getSessionName(), getName(), monitor); - } - - /** - * Enables a dynamic probe (for kernel domain) - * - * @param eventName - * - event name for probe - * @param isFunction - * - true for dynamic function entry/return probe else false - * @param probe - * - the actual probe - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableProbe(String eventName, boolean isFunction, String probe, - IProgressMonitor monitor) throws ExecutionException { - getControlService().enableProbe(getSessionName(), getName(), eventName, isFunction, probe, monitor); - } - - /** - * Enables events using log level. - * - * @param eventName - * - a event name - * @param logLevelType - * - a log level type - * @param level - * - a log level - * @param filterExpression - * - a filter expression - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableLogLevel(String eventName, LogLevelType logLevelType, - TraceLogLevel level, String filterExpression, IProgressMonitor monitor) - throws ExecutionException { - getControlService().enableLogLevel(getSessionName(), getName(), eventName, logLevelType, level, filterExpression, monitor); - } - - /** - * Enables a list of events with no additional parameters. - * - * @param eventNames - * - a list of event names to enabled. - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void disableEvent(List eventNames, IProgressMonitor monitor) - throws ExecutionException { - getControlService().disableEvent(getParent().getParent().getName(), - getName(), eventNames, isKernel(), monitor); - } - - /** - * Add contexts to given channels and or events - * - * @param contexts - * - a list of contexts to add - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void addContexts(List contexts, IProgressMonitor monitor) - throws ExecutionException { - getControlService().addContexts(getSessionName(), getName(), null, - isKernel(), contexts, monitor); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlComponent.java deleted file mode 100644 index 532b47235b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlComponent.java +++ /dev/null @@ -1,333 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.ListenerList; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponentChangedListener; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; -import org.eclipse.swt.graphics.Image; - -/** - *

- * Base implementation for trace control component. - *

- * - * @author Bernd Hufmann - */ -public class TraceControlComponent implements ITraceControlComponent { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The name of the component - */ - private String fName = ""; //$NON-NLS-1$ - /** - * The image to be displayed for the component. - */ - private Image fImage = null; - /** - * The tool tip to be displayed for the component. - */ - private String fToolTip = null; - /** - * The parent component. - */ - private ITraceControlComponent fParent = null; - /** - * The list if children components. - */ - private final List fChildren = new ArrayList<>(); - /** - * The list of listeners to be notified about changes. - */ - private final ListenerList fListeners = new ListenerList(); - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param name - the name of the component. - */ - public TraceControlComponent(String name) { - this(name, null); - } - - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent component. - */ - public TraceControlComponent(String name, ITraceControlComponent parent) { - fName = name; - fParent = parent; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getName() { - return fName; - } - - @Override - public void setName(String name) { - fName = name; - } - - @Override - public Image getImage() { - return fImage; - } - - @Override - public void setImage(String path) { - fImage = Activator.getDefault().loadIcon(path); - } - - @Override - public void setImage(Image image) { - fImage = image; - } - - @Override - public String getToolTip() { - return fToolTip; - } - - @Override - public void setToolTip(String toolTip) { - fToolTip = toolTip; - } - - @Override - public TargetNodeState getTargetNodeState() { - if (getParent() != null) { - return getParent().getTargetNodeState(); - } - return TargetNodeState.DISCONNECTED; - } - - @Override - public void setTargetNodeState(TargetNodeState state) { - if (getParent() != null) { - getParent().setTargetNodeState(state); - } - } - - @Override - public ITraceControlComponent getParent() { - return fParent; - } - - @Override - public void setParent(ITraceControlComponent parent) { - fParent = parent; - } - - @Override - public ITraceControlComponent[] getChildren() { - return fChildren.toArray(new ITraceControlComponent[fChildren.size()]); - } - - @Override - public void setChildren(List children) { - for (Iterator iterator = children.iterator(); iterator.hasNext();) { - ITraceControlComponent traceControlComponent = iterator.next(); - fChildren.add(traceControlComponent); - fireComponentChanged(this); - } - } - - @Override - public ITraceControlComponent getChild(String name) { - ITraceControlComponent child = null; - for (int i = 0; i < fChildren.size(); i++) { - if (fChildren.get(i).getName().equals(name)) { - child = fChildren.get(i); - break; - } - } - return child; - } - - @Override - public List getChildren(Class clazz) { - List list = new ArrayList<>(); - - for (Iterator iterator = fChildren.iterator(); iterator.hasNext();) { - ITraceControlComponent child = iterator.next(); - if (child.getClass() == clazz) { - list.add(child); - } - } - return list; - } - - @Override - public ILttngControlService getControlService() { - if (getParent() != null) { - return getParent().getControlService(); - } - return null; - } - - @Override - public void setControlService(ILttngControlService service) { - if (getParent() != null) { - getParent().setControlService(service); - } - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void dispose() { - // default implementation - } - - @Override - public void addChild(ITraceControlComponent component) { - if (component != null) { - fChildren.add(component); - } - fireComponentAdded(this, component); - } - - @Override - public void removeChild(ITraceControlComponent component) { - if (component != null) { - fChildren.remove(component); - component.dispose(); - } - fireComponentRemoved(this, component); - } - - @Override - public void removeAllChildren() { - for (Iterator iterator = fChildren.iterator(); iterator.hasNext();) { - ITraceControlComponent child = iterator.next(); - child.removeAllChildren(); - } - fChildren.clear(); -// fireCompenentChanged(this); - } - - @Override - public boolean containsChild(String name) { - boolean retValue = false; - for (int i = 0; i < fChildren.size(); i++) { - if (fChildren.get(i).getName().equals(name)) { - retValue = true; - break; - } - } - return retValue; - } - - @Override - public boolean hasChildren() { - return !fChildren.isEmpty(); - } - - @Override - public void addComponentListener(ITraceControlComponentChangedListener listener) { - if (fParent != null) { - fParent.addComponentListener(listener); - } else { - fListeners.add(listener); - } - } - - @Override - public void removeComponentListener(ITraceControlComponentChangedListener listener) { - if (fParent != null) { - fParent.removeComponentListener(listener); - } else { - fListeners.remove(listener); - } - } - - @Override - public void fireComponentAdded(ITraceControlComponent parent, ITraceControlComponent component) { - if (component == null) { - return; - } - - if (fParent != null) { - fParent.fireComponentAdded(parent, component); - } else { - Object[] listeners = fListeners.getListeners(); - for (int i = 0; i < listeners.length; i++) { - ITraceControlComponentChangedListener listener = (ITraceControlComponentChangedListener) listeners[i]; - listener.componentAdded(parent, component); - } - } - } - - @Override - public void fireComponentRemoved(ITraceControlComponent parent, ITraceControlComponent component) { - if (component == null) { - return; - } - - if (fParent != null) { - fParent.fireComponentRemoved(parent, component); - } else { - Object[] listeners = fListeners.getListeners(); - for (int i = 0; i < listeners.length; i++) { - ITraceControlComponentChangedListener listener = (ITraceControlComponentChangedListener) listeners[i]; - listener.componentRemoved(parent, component); - } - } - } - - @Override - public void fireComponentChanged(ITraceControlComponent component) { - if (component == null) { - return; - } - - if (fParent != null) { - fParent.fireComponentChanged(component); - } else { - Object[] listeners = fListeners.getListeners(); - for (int i = 0; i < listeners.length; i++) { - ITraceControlComponentChangedListener listener = (ITraceControlComponentChangedListener) listeners[i]; - listener.componentChanged(component); - } - } - } - - @Override - public Object getAdapter(Class adapter) { - return null; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlContentProvider.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlContentProvider.java deleted file mode 100644 index 72ea1a5ed1..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlContentProvider.java +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; - -/** - *

- * Tree content provider implementation for trace control view. - *

- * - * @author Bernd Hufmann - */ -public class TraceControlContentProvider implements ITreeContentProvider { - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void dispose() { - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - @Override - public Object[] getElements(Object inputElement) { - return getChildren(inputElement); - } - - @Override - public Object[] getChildren(Object parentElement) { - - if (parentElement instanceof ITraceControlComponent) { - return ((ITraceControlComponent)parentElement).getChildren(); - } - return new Object[0]; - } - - @Override - public Object getParent(Object element) { - if (element instanceof ITraceControlComponent) { - return ((ITraceControlComponent)element).getParent(); - } - return null; - } - - @Override - public boolean hasChildren(Object element) { - if (element instanceof ITraceControlComponent) { - return ((ITraceControlComponent)element).hasChildren(); - } - return false; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlLabelProvider.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlLabelProvider.java deleted file mode 100644 index 2364fb56ea..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlLabelProvider.java +++ /dev/null @@ -1,54 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import org.eclipse.jface.viewers.ColumnLabelProvider; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.swt.graphics.Image; - -/** - *

- * Label provider for trace control tree viewer. - *

- * - * @author Bernd Hufmann - */ -public class TraceControlLabelProvider extends ColumnLabelProvider { - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Image getImage(Object element) { - if ((element != null) && (element instanceof ITraceControlComponent)) { - return ((ITraceControlComponent) element).getImage(); - } - return null; - } - - @Override - public String getText(Object element) { - if ((element != null) && (element instanceof ITraceControlComponent)) { - return ((ITraceControlComponent) element).getName(); - } - return "";//$NON-NLS-1$ - } - - @Override - public String getToolTipText(Object element) { - if ((element != null) && (element instanceof ITraceControlComponent)) { - return ((ITraceControlComponent) element).getToolTip(); - } - return null; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlPropertyTester.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlPropertyTester.java deleted file mode 100644 index 0d49b3a9be..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlPropertyTester.java +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************** - * Copyright (c) 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import org.eclipse.core.expressions.PropertyTester; - -/** - * - * Property Tester Implementation for Trace Control Components. - * - * @author Bernd Hufmann - */ -public class TraceControlPropertyTester extends PropertyTester { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - private static final String ADD_CONTEXT_SUPPORT_PROPERTY = "isAddContextOnEventSupported"; //$NON-NLS-1$ - - - @Override - public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { - - // Check if node supports adding contexts on event level. - if (ADD_CONTEXT_SUPPORT_PROPERTY.equals(property)) { - if ((receiver != null) && (receiver instanceof TraceEventComponent)) { - TraceEventComponent event = (TraceEventComponent) receiver; - TargetNodeComponent node = event.getTargetNode(); - return node.isContextOnEventSupported(); - } - } - return false; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlRoot.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlRoot.java deleted file mode 100644 index a02c54349a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlRoot.java +++ /dev/null @@ -1,42 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - - -/** - *

- * Root element in trace control tree. - *

- * - * @author Bernd Hufmann - */ -public class TraceControlRoot extends TraceControlComponent { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The name of the root component - */ - public static final String TRACE_CONTROL_ROOT_NAME = "trace_control_root"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Default constructor - */ - public TraceControlRoot() { - super(TRACE_CONTROL_ROOT_NAME); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceDomainComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceDomainComponent.java deleted file mode 100644 index d233d95e2c..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceDomainComponent.java +++ /dev/null @@ -1,299 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceDomainPropertySource; -import org.eclipse.ui.views.properties.IPropertySource; - -/** - *

- * Implementation of the trace domain component. - *

- * - * @author Bernd Hufmann - */ -public class TraceDomainComponent extends TraceControlComponent { - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Path to icon file for this component. - */ - public static final String TRACE_DOMAIN_ICON_FILE = "icons/obj16/domain.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The domain information. - */ - private IDomainInfo fDomainInfo = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public TraceDomainComponent(String name, ITraceControlComponent parent) { - super(name, parent); - setImage(TRACE_DOMAIN_ICON_FILE); - setToolTip(Messages.TraceControl_DomainDisplayName); - fDomainInfo = new DomainInfo(name); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * Sets the domain information. - * @param domainInfo - the domain information to set. - */ - public void setDomainInfo(IDomainInfo domainInfo) { - fDomainInfo = domainInfo; - IChannelInfo[] channels = fDomainInfo.getChannels(); - for (int i = 0; i < channels.length; i++) { - TraceChannelComponent channel = new TraceChannelComponent(channels[i].getName(), this); - channel.setChannelInfo(channels[i]); - addChild(channel); - } - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == IPropertySource.class) { - return new TraceDomainPropertySource(this); - } - return null; - } - - /** - * @return session name from parent - */ - public String getSessionName() { - return ((TraceSessionComponent)getParent()).getName(); - } - - /** - * @return session from parent - */ - public TraceSessionComponent getSession() { - return (TraceSessionComponent)getParent(); - } - - /** - * @return true if domain is kernel, false for UST - */ - public boolean isKernel() { - return fDomainInfo.isKernel(); - } - - /** - * Sets whether domain is Kernel domain or UST - * @param isKernel true for kernel, false for UST - */ - public void setIsKernel(boolean isKernel) { - fDomainInfo.setIsKernel(isKernel); - } - - /** - * @return returns all available channels for this domain. - */ - public TraceChannelComponent[] getChannels() { - List channels = getChildren(TraceChannelComponent.class); - return channels.toArray(new TraceChannelComponent[channels.size()]); - } - - /** - * @return the parent target node - */ - public TargetNodeComponent getTargetNode() { - return ((TraceSessionComponent)getParent()).getTargetNode(); - } - - /** - * @return the buffer type - */ - public BufferType getBufferType(){ - return fDomainInfo.getBufferType(); - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Retrieves the session configuration from the node. - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void getConfigurationFromNode(IProgressMonitor monitor) throws ExecutionException { - TraceSessionComponent session = (TraceSessionComponent) getParent(); - session.getConfigurationFromNode(monitor); - } - - /** - * Enables channels with given names which are part of this domain. If a - * given channel doesn't exists it creates a new channel with the given - * parameters (or default values if given parameter is null). - * - * @param channelNames - * - a list of channel names to enable on this domain - * @param info - * - channel information to set for the channel (use null for - * default) - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableChannels(List channelNames, IChannelInfo info, - IProgressMonitor monitor) throws ExecutionException { - getControlService().enableChannels(getParent().getName(), channelNames, - isKernel(), info, monitor); - } - - /** - * Disables channels with given names which are part of this domain. - * - * @param channelNames - * - a list of channel names to enable on this domain - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void disableChannels(List channelNames, - IProgressMonitor monitor) throws ExecutionException { - getControlService().disableChannels(getParent().getName(), - channelNames, isKernel(), monitor); - } - - /** - * Enables a list of events with no additional parameters. - * - * @param eventNames - * - a list of event names to enabled. - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableEvents(List eventNames, IProgressMonitor monitor) - throws ExecutionException { - getControlService().enableEvents(getSessionName(), null, eventNames, - isKernel(), null, monitor); - } - - /** - * Enables all syscalls (for kernel domain) - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - - public void enableSyscalls(IProgressMonitor monitor) - throws ExecutionException { - getControlService().enableSyscalls(getSessionName(), null, monitor); - } - - /** - * Enables a dynamic probe (for kernel domain) - * - * @param eventName - * - event name for probe - * @param isFunction - * - true for dynamic function entry/return probe else false - * @param probe - * - the actual probe - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableProbe(String eventName, boolean isFunction, String probe, - IProgressMonitor monitor) throws ExecutionException { - getControlService().enableProbe(getSessionName(), null, eventName, - isFunction, probe, monitor); - } - - /** - * Enables events using log level. - * - * @param eventName - * - a event name - * @param logLevelType - * - a log level type - * @param level - * - a log level - * @param filterExpression - * - a filter expression - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableLogLevel(String eventName, LogLevelType logLevelType, - TraceLogLevel level, String filterExpression, IProgressMonitor monitor) - throws ExecutionException { - getControlService().enableLogLevel(getSessionName(), null, eventName, - logLevelType, level, filterExpression, monitor); - } - - /** - * Add contexts to given channels and or events - * - * @param contexts - * - a list of contexts to add - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void addContexts(List contexts, IProgressMonitor monitor) - throws ExecutionException { - getControlService().addContexts(getSessionName(), null, null, - isKernel(), contexts, monitor); - } - - /** - * Executes calibrate command to quantify LTTng overhead. - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void calibrate(IProgressMonitor monitor) throws ExecutionException { - getControlService().calibrate(isKernel(), monitor); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceEventComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceEventComponent.java deleted file mode 100644 index 531a507cb0..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceEventComponent.java +++ /dev/null @@ -1,264 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceEventPropertySource; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.views.properties.IPropertySource; - - -/** - *

- * Implementation of the trace channel component. - *

- * - * @author Bernd Hufmann - */ -public class TraceEventComponent extends TraceControlComponent { - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Path to icon file for this component (enabled state). - */ - public static final String TRACE_EVENT_ICON_FILE_ENABLED = "icons/obj16/event_enabled.gif"; //$NON-NLS-1$ - /** - * Path to icon file for this component (disabled state). - */ - public static final String TRACE_EVENT_ICON_FILE_DISABLED = "icons/obj16/event_disabled.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The event information. - */ - protected IEventInfo fEventInfo = null; - /** - * The image to be displayed when in disabled state. - */ - private Image fDisabledImage = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public TraceEventComponent(String name, ITraceControlComponent parent) { - super(name, parent); - setImage(TRACE_EVENT_ICON_FILE_ENABLED); - setToolTip(Messages.TraceControl_EventDisplayName); - fEventInfo = new EventInfo(name); - fDisabledImage = Activator.getDefault().loadIcon(TRACE_EVENT_ICON_FILE_DISABLED); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public Image getImage() { - if (fEventInfo.getState() == TraceEnablement.DISABLED) { - return fDisabledImage; - } - return super.getImage(); - } - - /** - * Sets the event information. - * @param eventInfo - the event information to set. - */ - public void setEventInfo(IEventInfo eventInfo) { - fEventInfo = eventInfo; - } - - /** - * @return the trace event type - */ - public TraceEventType getEventType() { - return fEventInfo.getEventType(); - } - - /** - * Sets the trace event type to the given type - * @param type - type to set - */ - public void setEventType(TraceEventType type) { - fEventInfo.setEventType(type); - } - - /** - * Sets the trace event type to the type specified by the given name. - * @param typeName - event type name - */ - public void setEventType(String typeName) { - fEventInfo.setEventType(typeName); - } - - /** - * @return the event state (enabled or disabled). - */ - public TraceEnablement getState() { - return fEventInfo.getState(); - } - - /** - * Sets the event state (enablement) to the given value. - * @param state - state to set. - */ - public void setState(TraceEnablement state) { - fEventInfo.setState(state); - } - - /** - * Sets the event state (enablement) to the value specified by the given name. - * @param stateName - state to set. - */ - public void setState(String stateName) { - fEventInfo.setState(stateName); - } - - /** - * @return the trace event log level - */ - public TraceLogLevel getLogLevel() { - return fEventInfo.getLogLevel(); - } - - /** - * Sets the trace event log level to the given level - * @param level - event log level to set - */ - public void setLogLevel(TraceLogLevel level) { - fEventInfo.setLogLevel(level); - } - - /** - * Sets the trace event log level to the level specified by the given name. - * @param levelName - event log level name - */ - public void setLogLevel(String levelName) { - fEventInfo.setLogLevel(levelName); - } - - /** - * Returns filter expression. - * @return filter expression - */ - public String getFilterExpression() { - return fEventInfo.getFilterExpression(); - } - - /** - * Sets the filter expression. - * @param filter The filter expression to set - */ - public void setFilterExpression(String filter) { - fEventInfo.setFilterExpression(filter); - } - - /** - * Returns the log level type - * @return event log level type - */ - public LogLevelType getLogLevelType() { - return fEventInfo.getLogLevelType(); - } - - /** - * Sets the trace event log level type to the given level type - * @param levelType - event log level type to set - */ - public void setLogLevelType(LogLevelType levelType) { - fEventInfo.setLogLevelType(levelType); - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == IPropertySource.class) { - return new TraceEventPropertySource(this); - } - return null; - } - - /** - * @return target node component. - */ - public TargetNodeComponent getTargetNode() { - return ((TraceChannelComponent)getParent()).getTargetNode(); - } - - /** - * @return session name from parent - */ - public String getSessionName() { - return ((TraceChannelComponent)getParent()).getSessionName(); - } - - /** - * @return session from parent - */ - public TraceSessionComponent getSession() { - return ((TraceChannelComponent)getParent()).getSession(); - } - - /** - * @return channel name from parent - */ - public String getChannelName() { - return getParent().getName(); - } - - /** - * @return if domain is kernel or UST - */ - public boolean isKernel() { - return ((TraceChannelComponent)getParent()).isKernel(); - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Add contexts to given channels and or events - * - * @param contexts - * - a list of contexts to add - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void addContexts(List contexts, IProgressMonitor monitor) - throws ExecutionException { - getControlService().addContexts(getSessionName(), getChannelName(), - getName(), isKernel(), contexts, monitor); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProbeEventComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProbeEventComponent.java deleted file mode 100644 index a473be2478..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProbeEventComponent.java +++ /dev/null @@ -1,121 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceProbeEventPropertySource; -import org.eclipse.ui.views.properties.IPropertySource; - - -/** - *

- * Implementation of the trace channel component. - *

- * - * @author Bernd Hufmann - */ -public class TraceProbeEventComponent extends TraceEventComponent { - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public TraceProbeEventComponent(String name, ITraceControlComponent parent) { - super(name, parent); - fEventInfo = new ProbeEventInfo(name); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * Sets the event information. - * @param eventInfo - the event information to set. - */ - @Override - public void setEventInfo(IEventInfo eventInfo) { - if (eventInfo instanceof ProbeEventInfo) { - fEventInfo = eventInfo; - return; - } - throw new IllegalArgumentException("Invalid type passed. Only class of type ProbeEventInfo allowed:\n" + eventInfo.getClass()); //$NON-NLS-1$ - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == IPropertySource.class) { - return new TraceProbeEventPropertySource(this); - } - return null; - } - /** - * @return the address of the probe. (null if Symbol is used) - */ - public String getAddress() { - return getEventInfo().getAddress(); - } - /** - * Sets the address of the probe. - * @param address - a address - */ - public void setAddress(String address) { - getEventInfo().setAddress(address); - } - /** - * @return the offset applied to the symbol. - */ - public String getOffset() { - return getEventInfo().getOffset(); - } - /** - * Sets the offset applied to the symbol. (valid if symbol is used) - * @param offset - a offset - */ - public void setOffset(String offset) { - getEventInfo().setOffset(offset); - } - /** - * @return the symbol name. (null if address is used) - */ - public String getSymbol() { - return getEventInfo().getSymbol(); - } - /** - * Sets the symbol name. - * @param symbol - a symbol name (null if address is used) - */ - public void setSymbol(String symbol) { - getEventInfo().setSymbol(symbol); - } - - // ------------------------------------------------------------------------ - // Helper methods - // ------------------------------------------------------------------------ - private ProbeEventInfo getEventInfo() { - return (ProbeEventInfo) fEventInfo; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProviderGroup.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProviderGroup.java deleted file mode 100644 index 5fd9bc24b8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProviderGroup.java +++ /dev/null @@ -1,108 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; - -/** - *

- * Implementation of the trace provider group. - *

- * - * @author Bernd Hufmann - */ -public class TraceProviderGroup extends TraceControlComponent { - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Path to icon file for this component. - */ - public static final String TRACE_PROVIDERS_ICON_FILE = "icons/obj16/providers.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public TraceProviderGroup(String name, ITraceControlComponent parent) { - super(name, parent); - setImage(TRACE_PROVIDERS_ICON_FILE); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Gets the provider information from the target node. - * @param monitor - a progress monitor - * @throws ExecutionException If the command fails - */ - public void getProviderFromNode(IProgressMonitor monitor) throws ExecutionException { - - List eventInfos = getControlService().getKernelProvider(monitor); - - if (!eventInfos.isEmpty()) { - KernelProviderComponent component = new KernelProviderComponent(Messages.TraceControl_KernelProviderDisplayName, this); - addChild(component); - component.setEventInfo(eventInfos); - } - - List allProviders = getControlService().getUstProvider(monitor); - - for (Iterator iterator = allProviders.iterator(); iterator.hasNext();) { - IUstProviderInfo ustProviderInfo = iterator.next(); - UstProviderComponent ustComponent = new UstProviderComponent(ustProviderInfo.getName(), this); - addChild(ustComponent); - ustComponent.setUstProvider(ustProviderInfo); - } - } - - /** - * Returns whether the kernel provider is available or not - * @return true if kernel provide is available or false - */ - public boolean hasKernelProvider() { - List kernelList = getChildren(KernelProviderComponent.class); - return !kernelList.isEmpty(); - } - - /** - * Returns if node supports filtering of events - * @return true if node supports filtering else false - */ - public boolean isEventFilteringSupported() { - return ((TargetNodeComponent)getParent()).isEventFilteringSupported(); - } -} - diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java deleted file mode 100644 index eee0d7840a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java +++ /dev/null @@ -1,473 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Marc-Andre Laperle - Support for opening a live session - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceSessionPropertySource; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.views.properties.IPropertySource; - -/** - *

- * Implementation of the trace session component. - *

- * - * @author Bernd Hufmann - */ -public class TraceSessionComponent extends TraceControlComponent { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Path to icon file for this component (inactive state). - */ - public static final String TRACE_SESSION_ICON_FILE_INACTIVE = "icons/obj16/session_inactive.gif"; //$NON-NLS-1$ - /** - * Path to icon file for this component (active state). - */ - public static final String TRACE_SESSION_ICON_FILE_ACTIVE = "icons/obj16/session_active.gif"; //$NON-NLS-1$ - /** - * Path to icon file for this component (destroyed state). - */ - public static final String TRACE_SESSION_ICON_FILE_DESTROYED = "icons/obj16/session_destroyed.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The session information. - */ - private ISessionInfo fSessionInfo = null; - /** - * A flag to indicate if session has been destroyed. - */ - private boolean fIsDestroyed = false; - /** - * The image to be displayed in state active. - */ - private Image fActiveImage = null; - /** - * The image to be displayed in state destroyed - */ - private Image fDestroyedImage = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public TraceSessionComponent(String name, ITraceControlComponent parent) { - super(name, parent); - setImage(TRACE_SESSION_ICON_FILE_INACTIVE); - setToolTip(Messages.TraceControl_SessionDisplayName); - fSessionInfo = new SessionInfo(name); - fActiveImage = Activator.getDefault().loadIcon(TRACE_SESSION_ICON_FILE_ACTIVE); - fDestroyedImage = Activator.getDefault().loadIcon(TRACE_SESSION_ICON_FILE_DESTROYED); - } - - /** - * Constructor - * - * @param sessionInfo - * the session information used to create the session - * @param parent - * the parent of this component. - */ - public TraceSessionComponent(ISessionInfo sessionInfo, ITraceControlComponent parent) { - this(sessionInfo.getName(), parent); - copyLiveInfo(sessionInfo); - } - - private void copyLiveInfo(ISessionInfo sessionInfo) { - // Since we can't retrieve this information from the node, we copy it over - fSessionInfo.setLive(sessionInfo.isLive()); - fSessionInfo.setLiveDelay(sessionInfo.getLiveDelay()); - fSessionInfo.setLivePort(sessionInfo.getLivePort()); - fSessionInfo.setLiveUrl(sessionInfo.getLiveUrl()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public Image getImage() { - if (fIsDestroyed) { - return fDestroyedImage; - } - - if (fSessionInfo.getSessionState() == TraceSessionState.INACTIVE) { - return super.getImage(); - } - - return fActiveImage; - } - - /** - * @return the whether the session is destroyed or not. - */ - public boolean isDestroyed() { - return fIsDestroyed; - } - - /** - * Sets the session destroyed state to the given value. - * @param destroyed - value to set. - */ - public void setDestroyed(boolean destroyed) { - fIsDestroyed = destroyed; - } - - /** - * @return the session state state (active or inactive). - */ - public TraceSessionState getSessionState() { - return fSessionInfo.getSessionState(); - } - - /** - * Sets the session state to the given value. - * @param state - state to set. - */ - public void setSessionState(TraceSessionState state) { - fSessionInfo.setSessionState(state); - } - - /** - * Sets the event state to the value specified by the given name. - * @param stateName - state to set. - */ - public void setSessionState(String stateName) { - fSessionInfo.setSessionState(stateName); - } - - /** - * @return path string where session is located. - */ - public String getSessionPath() { - return fSessionInfo.getSessionPath(); - } - - /** - * Sets the path string (where session is located) to the given value. - * @param sessionPath - session path to set. - */ - public void setSessionPath(String sessionPath) { - fSessionInfo.setSessionPath(sessionPath); - } - - /** - * Returns if session is streamed over network - * @return true if streamed over network else false - */ - public boolean isStreamedTrace() { - return fSessionInfo.isStreamedTrace(); - } - - /** - * Sets whether the trace is streamed or not - * @param isStreamedTrace true if streamed over network else false - */ - public void setIsStreamedTrace(boolean isStreamedTrace) { - fSessionInfo.setStreamedTrace(isStreamedTrace); - } - - /** - * Returns whether the session is snapshot session or not - * @return true if it is snapshot session else false - */ - public boolean isSnapshotSession() { - return fSessionInfo.isSnapshotSession(); - } - - /** - * Gets the snapshot information if available whether the session is a snapshot session or not - * @return the snapshot information or null if it is not a snapshot session - */ - public ISnapshotInfo getSnapshotInfo() { - return fSessionInfo.getSnapshotInfo(); - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == IPropertySource.class) { - return new TraceSessionPropertySource(this); - } - return null; - } - - /** - * @return all available domains of this session. - */ - public TraceDomainComponent[] getDomains() { - List sessions = getChildren(TraceDomainComponent.class); - return sessions.toArray(new TraceDomainComponent[sessions.size()]); - } - - /** - * @return the parent target node - */ - public TargetNodeComponent getTargetNode() { - return ((TraceSessionGroup)getParent()).getTargetNode(); - } - - /** - * Returns whether the kernel provider is available or not - * @return true if kernel provide is available or false - */ - public boolean hasKernelProvider() { - List providerGroups = getTargetNode().getChildren(TraceProviderGroup.class); - return (!providerGroups.isEmpty() ? ((TraceProviderGroup) providerGroups.get(0)).hasKernelProvider() : false); - } - - /** - * Returns if node supports filtering of events - * @return true if node supports filtering else false - */ - public boolean isEventFilteringSupported() { - return ((TargetNodeComponent)getParent().getParent()).isEventFilteringSupported(); - } - - /** - * Returns if node supports snapshots or not - * @return true if it supports snapshots else false - * - */ - public boolean isSnapshotSupported() { - return ((TargetNodeComponent)getParent().getParent()).isSnapshotSupported(); - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Retrieves the session configuration from the node. - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void getConfigurationFromNode(IProgressMonitor monitor) - throws ExecutionException { - removeAllChildren(); - ISessionInfo oldSessionInfo = fSessionInfo; - fSessionInfo = getControlService().getSession(getName(), monitor); - copyLiveInfo(oldSessionInfo); - - IDomainInfo[] domains = fSessionInfo.getDomains(); - for (int i = 0; i < domains.length; i++) { - TraceDomainComponent domainComponent = new TraceDomainComponent( - domains[i].getName(), this); - addChild(domainComponent); - domainComponent.setDomainInfo(domains[i]); - } - } - - /** - * Starts the session. - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void startSession(IProgressMonitor monitor) - throws ExecutionException { - getControlService().startSession(getName(), monitor); - } - - /** - * Starts the session. - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void stopSession(IProgressMonitor monitor) throws ExecutionException { - getControlService().stopSession(getName(), monitor); - } - - /** - * Enables channels with given names which are part of this domain. If a - * given channel doesn't exists it creates a new channel with the given - * parameters (or default values if given parameter is null). - * - * @param channelNames - * - a list of channel names to enable on this domain - * @param info - * - channel information to set for the channel (use null for - * default) - * @param isKernel - * - a flag for indicating kernel or UST. - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableChannels(List channelNames, IChannelInfo info, - boolean isKernel, IProgressMonitor monitor) - throws ExecutionException { - getControlService().enableChannels(getName(), channelNames, isKernel, - info, monitor); - } - - /** - * Enables a list of events with no additional parameters. - * - * @param eventNames - * - a list of event names to enabled. - * @param isKernel - * - a flag for indicating kernel or UST. - * @param filterExpression - * - a filter expression - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableEvents(List eventNames, boolean isKernel, - String filterExpression, IProgressMonitor monitor) throws ExecutionException { - getControlService().enableEvents(getName(), null, eventNames, isKernel, - filterExpression, monitor); - } - - /** - * Enables all syscalls (for kernel domain) - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableSyscalls(IProgressMonitor monitor) - throws ExecutionException { - getControlService().enableSyscalls(getName(), null, monitor); - } - - /** - * Enables a dynamic probe (for kernel domain) - * - * @param eventName - * - event name for probe - * @param isFunction - * - true for dynamic function entry/return probe else false - * @param probe - * - the actual probe - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableProbe(String eventName, boolean isFunction, String probe, - IProgressMonitor monitor) throws ExecutionException { - getControlService().enableProbe(getName(), null, eventName, isFunction, - probe, monitor); - } - - /** - * Enables events using log level. - * - * @param eventName - * - a event name - * @param logLevelType - * - a log level type - * @param level - * - a log level - * @param filterExpression - * - a filter expression - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void enableLogLevel(String eventName, LogLevelType logLevelType, - TraceLogLevel level, String filterExpression, IProgressMonitor monitor) - throws ExecutionException { - getControlService().enableLogLevel(getName(), null, eventName, - logLevelType, level, null, monitor); - } - - /** - * Gets all available contexts to be added to channels/events. - * - * @param monitor - * The monitor that will indicate the progress - * @return the list of available contexts - * @throws ExecutionException - * If the command fails - */ - public List getContextList(IProgressMonitor monitor) - throws ExecutionException { - return getControlService().getContextList(monitor); - } - - /** - * Records a snapshot. - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void recordSnapshot(IProgressMonitor monitor) throws ExecutionException { - getControlService().recordSnapshot(getName(), monitor); - } - - /** - * Returns if session is live. - * @return true if session if live else false - */ - public boolean isLiveTrace() { - return fSessionInfo.isLive(); - } - - /** - * Get the live URL. - * - * @return the live URL - */ - public String getLiveUrl() { - return fSessionInfo.getLiveUrl(); - } - - /** - * Get the live port. - * - * @return the live port - */ - public Integer getLivePort() { - return fSessionInfo.getLivePort(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionGroup.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionGroup.java deleted file mode 100644 index 6e4a3cf0cf..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionGroup.java +++ /dev/null @@ -1,174 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; - -/** - *

- * Implementation of the trace session group. - *

- * - * @author Bernd Hufmann - */ -public class TraceSessionGroup extends TraceControlComponent { - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Path to icon file for this component. - */ - public static final String TRACE_SESSIONS_ICON_FILE = "icons/obj16/sessions.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public TraceSessionGroup(String name, ITraceControlComponent parent) { - super(name, parent); - setImage(TRACE_SESSIONS_ICON_FILE); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - /** - * @return the parent target node - */ - public TargetNodeComponent getTargetNode() { - return (TargetNodeComponent)getParent(); - } - - /** - * Returns if node supports networks streaming or not - * @return true if node supports filtering else false - */ - public boolean isNetworkStreamingSupported() { - return getTargetNode().isNetworkStreamingSupported(); - } - /** - * Returns if node supports snapshots or not - * @return true if it supports snapshots else false - * - */ public boolean isSnapshotSupported() { - return getTargetNode().isSnapshotSupported(); - } - - /** - * Returns if node supports live or not - * - * @return true if it supports live else false - */ - public boolean isLiveSupported() { - return getTargetNode().isLiveSupported(); - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * Retrieves the sessions information from the node. - * - * @throws ExecutionException - * If the command fails - */ - public void getSessionsFromNode() throws ExecutionException { - getSessionsFromNode(new NullProgressMonitor()); - } - - /** - * Retrieves the sessions information from the node. - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void getSessionsFromNode(IProgressMonitor monitor) - throws ExecutionException { - String[] sessionNames = getControlService().getSessionNames(monitor); - for (int i = 0; i < sessionNames.length; i++) { - TraceSessionComponent session = new TraceSessionComponent( - sessionNames[i], this); - addChild(session); - session.getConfigurationFromNode(monitor); - } - } - - /** - * Creates a session with given session name and location. - * - * @param sessionInf - * the session information used to create the session - * - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void createSession(ISessionInfo sessionInf, IProgressMonitor monitor) throws ExecutionException { - ISessionInfo sessionInfo = getControlService().createSession(sessionInf, monitor); - - if (sessionInfo != null) { - TraceSessionComponent session = new TraceSessionComponent(sessionInfo, TraceSessionGroup.this); - addChild(session); - session.getConfigurationFromNode(monitor); - } - } - - /** - * Command to execute a list of commands - * @param monitor - * - a progress monitor - * @param commands - * - a list of commands to execute - * @throws ExecutionException - * If the command fails - */ - public void executeCommands(IProgressMonitor monitor, List commands) throws ExecutionException { - getControlService().runCommands(monitor, commands); - getTargetNode().refresh(); - } - - /** - * Destroys a session with given session name. - * - * @param session - * - a session component to destroy - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - public void destroySession(TraceSessionComponent session, - IProgressMonitor monitor) throws ExecutionException { - getControlService().destroySession(session.getName(), monitor); - session.removeAllChildren(); - removeChild(session); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/UstProviderComponent.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/UstProviderComponent.java deleted file mode 100644 index 2149f725fe..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/UstProviderComponent.java +++ /dev/null @@ -1,104 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.UstProviderPropertySource; -import org.eclipse.ui.views.properties.IPropertySource; - -/** - *

- * Implementation of the UST provider component. - *

- * - * @author Bernd Hufmann - */ -public class UstProviderComponent extends TraceControlComponent { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Path to icon file for this component. - */ - public static final String USTL_PROVIDER_ICON_FILE = "icons/obj16/targets.gif"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The UST provider information. - */ - private IUstProviderInfo fProviderInfo = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - the name of the component. - * @param parent - the parent of this component. - */ - public UstProviderComponent(String name, ITraceControlComponent parent) { - super(name, parent); - setImage(USTL_PROVIDER_ICON_FILE); - setToolTip(Messages.TraceControl_ProviderDisplayName); - fProviderInfo = new UstProviderInfo(name); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * Sets the UST provider information to the given value. - * @param providerInfo - the provider information to set - */ - public void setUstProvider(IUstProviderInfo providerInfo) { - fProviderInfo = providerInfo; - IBaseEventInfo[] events = providerInfo.getEvents(); - for (int i = 0; i < events.length; i++) { - BaseEventComponent component = new BaseEventComponent(events[i].getName(), this); - component.setEventInfo(events[i]); - addChild(component); - } - setName(getName() + " [PID=" + fProviderInfo.getPid() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * @return the process ID of the UST provider. - */ - public int getPid() { - return fProviderInfo.getPid(); - } - - /** - * Sets the process ID of the UST provider to the given value. - * @param pid - process ID to set - */ - public void setPid(int pid) { - fProviderInfo.setPid(pid); - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == IPropertySource.class) { - return new UstProviderPropertySource(this); - } - return null; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferenceInitializer.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferenceInitializer.java deleted file mode 100644 index 5531645c1e..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferenceInitializer.java +++ /dev/null @@ -1,38 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; - -/** - *

- * A class to initialize the preferences. - *

- * - * @author Bernd Hufmann - */ -public class ControlPreferenceInitializer extends AbstractPreferenceInitializer { - - @Override - public void initializeDefaultPreferences() { - final IPreferenceStore store = ControlPreferences.getInstance().getPreferenceStore(); - - //Set default User ID if none already stored in preferences - store.setDefault(ControlPreferences.TRACE_CONTROL_TRACING_GROUP_PREF, ControlPreferences.TRACE_CONTROL_DEFAULT_TRACING_GROUP); - store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF, false); - store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_FILE_PATH_PREF, ControlPreferences.TRACE_CONTROL_DEFAULT_LOG_PATH); - store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, false); - store.setDefault(ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_NONE); - store.setDefault(ControlPreferences.TRACE_CONTROL_COMMAND_TIMEOUT_PREF, ControlPreferences.TRACE_CONTROL_DEFAULT_TIMEOUT_VALUE); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferencePage.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferencePage.java deleted file mode 100644 index 1cea6a322d..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferencePage.java +++ /dev/null @@ -1,151 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.IntegerFieldEditor; -import org.eclipse.jface.preference.RadioGroupFieldEditor; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -/** - *

- * Preference page implementation for configuring LTTng tracer control preferences. - *

- * - * @author Bernd Hufmann - */ -public class ControlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - private RadioGroupFieldEditor fVerboseLevel; - private BooleanFieldEditor fIsAppend; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - */ - public ControlPreferencePage() { - super(FieldEditorPreferencePage.GRID); - - // Set the preference store for the preference page. - IPreferenceStore store = ControlPreferences.getInstance().getPreferenceStore(); - setPreferenceStore(store); - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void init(IWorkbench workbench) { - } - - @Override - protected void createFieldEditors() { - - StringFieldEditor tracingGroup = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_TRACING_GROUP_PREF, Messages.TraceControl_TracingGroupPreference, getFieldEditorParent()); - addField(tracingGroup); - - BooleanFieldEditor logCommand = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, Messages.TraceControl_LoggingPreference, getFieldEditorParent()); - addField(logCommand); - - StringFieldEditor logfile = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_FILE_PATH_PREF, Messages.TraceControl_LogfilePath, getFieldEditorParent()); - addField(logfile); - - fIsAppend = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF, Messages.TraceControl_AppendLogfilePreference, getFieldEditorParent()); - addField(fIsAppend); - - fVerboseLevel = new RadioGroupFieldEditor ( - ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF, - Messages.TraceControl_VerboseLevelsPreference, - 4, - new String[][] { - { - Messages.TraceControl_VerboseLevelNonePreference, - ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_NONE, - }, - { - Messages.TraceControl_VerboseLevelVerbosePreference, - ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE - }, - { - Messages.TraceControl_VerboseLevelVeryVerbosePreference, - ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE - }, - { - Messages.TraceControl_VerboseLevelVeryVeryVerbosePreference, - ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE - } - }, - getFieldEditorParent(), - true); - - addField(fVerboseLevel); - - Boolean enabled = ControlPreferences.getInstance().isLoggingEnabled(); - fVerboseLevel.setEnabled(enabled, getFieldEditorParent()); - fIsAppend.setEnabled(enabled, getFieldEditorParent()); - logfile.setEnabled(false, getFieldEditorParent()); - - IntegerFieldEditor commandTimeout = new IntegerFieldEditor(ControlPreferences.TRACE_CONTROL_COMMAND_TIMEOUT_PREF, Messages.TraceControl_CommandTimeout, getFieldEditorParent()); - commandTimeout.setValidRange(ControlPreferences.TRACE_CONTROL_MIN_TIMEOUT_VALUE, ControlPreferences.TRACE_CONTROL_MAX_TIMEOUT_VALUE); - addField(commandTimeout); - } - - @Override - public void propertyChange(PropertyChangeEvent event) { - - if (event.getProperty().equals(FieldEditor.VALUE)) { - if (event.getSource() instanceof FieldEditor) { - FieldEditor editor = (FieldEditor) event.getSource(); - if (editor.getPreferenceName().equals(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF)) { - Boolean enabled = (Boolean)event.getNewValue(); - fVerboseLevel.setEnabled(enabled, getFieldEditorParent()); - fIsAppend.setEnabled(enabled, getFieldEditorParent()); - } - } - } - super.propertyChange(event); - } - - @Override - protected void performDefaults() { - super.performDefaults(); - fVerboseLevel.setEnabled(false, getFieldEditorParent()); - fIsAppend.setEnabled(false, getFieldEditorParent()); - } - - @Override - public boolean performOk() { - boolean ret = super.performOk(); - // open or close log file - if (ControlPreferences.getInstance().isLoggingEnabled()) { - ControlCommandLogger.init(ControlPreferences.getInstance().getLogfilePath(), ControlPreferences.getInstance().isAppend()); - } else { - ControlCommandLogger.close(); - } - return ret; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferences.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferences.java deleted file mode 100644 index 8d0c8d0b2f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferences.java +++ /dev/null @@ -1,215 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences; - -import java.io.File; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; - -/** - *

- * Singleton class to access LTTng tracer control preferences. - *

- * - * @author Bernd Hufmann - */ -public class ControlPreferences { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Trace control log file - */ - public static final String TRACE_CONTROL_LOG_FILENAME = "lttng_tracer_control.log"; //$NON-NLS-1$ - - // Preference strings - /** - * The tracing group preference - */ - public static final String TRACE_CONTROL_TRACING_GROUP_PREF = "trace.control.tracing.group"; //$NON-NLS-1$ - /** - * The log commands preference - */ - public static final String TRACE_CONTROL_LOG_COMMANDS_PREF = "trace.control.log.commands"; //$NON-NLS-1$ - /** - * The log append preference - */ - public static final String TRACE_CONTROL_LOG_APPEND_PREF = "trace.control.log.append"; //$NON-NLS-1$ - /** - * The log file path preference - */ - public static final String TRACE_CONTROL_LOG_FILE_PATH_PREF = "trace.control.log.path"; //$NON-NLS-1$ - /** - * The verbose level preference - */ - public static final String TRACE_CONTROL_VERBOSE_LEVEL_PREF = "trace.control.verbose.level"; //$NON-NLS-1$ - /** - * The command time-out preference - */ - public static final String TRACE_CONTROL_COMMAND_TIMEOUT_PREF = "trace.control.command.timeout"; //$NON-NLS-1$ - /** - * The verbose level value for none - */ - public static final String TRACE_CONTROL_VERBOSE_LEVEL_NONE = "trace.control.verbose.level.none"; //$NON-NLS-1$ - /** - * The verbose level value for level 1 (-v) - */ - public static final String TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE = "trace.control.verbose.level.v"; //$NON-NLS-1$ - /** - * The verbose level value for level 2 (-vv) - */ - public static final String TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE = "trace.control.verbose.level.vv"; //$NON-NLS-1$ - /** - * The verbose level value for level 3 (-vvv) - */ - public static final String TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE = "trace.control.verbose.level.vvv"; //$NON-NLS-1$ - /** - * The default tracing group - */ - public static final String TRACE_CONTROL_DEFAULT_TRACING_GROUP = "tracing"; //$NON-NLS-1$ - /** - * The default tracing log file name with absolute path - */ - public static final String TRACE_CONTROL_DEFAULT_LOG_PATH = System.getProperty("user.home") + File.separator + TRACE_CONTROL_LOG_FILENAME; //$NON-NLS-1$ - /** - * Default timeout value used for executing commands, in seconds - */ - public static final int TRACE_CONTROL_DEFAULT_TIMEOUT_VALUE = 15; - /** - * Minimum timeout value used for executing commands, in seconds - */ - public static final int TRACE_CONTROL_MIN_TIMEOUT_VALUE = 5; - /** - * Maximum timeout value used for executing commands, in seconds - */ - public static final int TRACE_CONTROL_MAX_TIMEOUT_VALUE = 600; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The trace control preferences singleton instance. - */ - private static ControlPreferences fInstance = null; - /** - * The preference store reference - */ - private IPreferenceStore fPreferenceStore = null; - - // ------------------------------------------------------------------------ - // Constructor - // ------------------------------------------------------------------------ - /** - * Private constructor - */ - private ControlPreferences() { - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * Returns the trace control preferences singleton instance - * - * @return the trace control preferences singleton instance - */ - public static synchronized ControlPreferences getInstance() { - if (fInstance == null) { - fInstance = new ControlPreferences(); - } - return fInstance; - } - - /** - * @return the preference store - */ - public IPreferenceStore getPreferenceStore() { - return fPreferenceStore; - } - - /** - * @return true if tracing group is set to default - */ - public boolean isDefaultTracingGroup() { - return fPreferenceStore.getString(TRACE_CONTROL_TRACING_GROUP_PREF).equals(fPreferenceStore.getDefaultString(TRACE_CONTROL_TRACING_GROUP_PREF)); - } - - /** - * @return value of tracing group preference - */ - public String getTracingGroup() { - return fPreferenceStore.getString(TRACE_CONTROL_TRACING_GROUP_PREF); - } - - /** - * @return whether is logging is enabled - */ - public boolean isLoggingEnabled() { - return fPreferenceStore.getBoolean(TRACE_CONTROL_LOG_COMMANDS_PREF); - } - - /** - * @return whether an existing log file will appended or not - */ - public boolean isAppend() { - return fPreferenceStore.getBoolean(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF); - } - - /** - * @return verbose level preference - */ - public String getVerboseLevel() { - return fPreferenceStore.getString(TRACE_CONTROL_VERBOSE_LEVEL_PREF); - } - - /** - * @return absolute log file path - */ - public String getLogfilePath() { - return fPreferenceStore.getString(TRACE_CONTROL_LOG_FILE_PATH_PREF); - } - - /** - * @return command timeout value - */ - public int getCommandTimeout() { - return fPreferenceStore.getInt(TRACE_CONTROL_COMMAND_TIMEOUT_PREF); - } - - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - /** - * Initializes the control preferences (e.g. enable open log file) - * - * @param preferenceStore - * The preference store to assign - */ - public void init(IPreferenceStore preferenceStore) { - fPreferenceStore = preferenceStore; - - if (fPreferenceStore.getBoolean(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF)) { - ControlCommandLogger.init(getLogfilePath(), isAppend()); - } - } - - /** - * Disposes any resource (e.g. close log file). - */ - public void dispose() { - ControlCommandLogger.close(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BaseEventPropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BaseEventPropertySource.java deleted file mode 100644 index 846bc0989b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BaseEventPropertySource.java +++ /dev/null @@ -1,124 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; -import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertyDescriptor; - -/** - *

- * Property source implementation for the base event component. - *

- * - * @author Bernd Hufmann - */ -public class BaseEventPropertySource extends BasePropertySource { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * The base event 'name' property ID. - */ - public static final String BASE_EVENT_NAME_PROPERTY_ID = "base.event.name"; //$NON-NLS-1$ - /** - * The base event 'type' property ID. - */ - public static final String BASE_EVENT_TYPE_PROPERTY_ID = "base.event.type"; //$NON-NLS-1$ - /** - * The base event 'log level' property ID. - */ - public static final String BASE_EVENT_LOGLEVEL_PROPERTY_ID = "base.event.loglevel"; //$NON-NLS-1$ - /** - * The base event 'fields' property ID. - */ - public static final String BASE_EVENT_FIELDS_PROPERTY_ID = "base.event.fields"; //$NON-NLS-1$ - /** - * The base event 'name' property name. - */ - public static final String BASE_EVENT_NAME_PROPERTY_NAME = Messages.TraceControl_EventNamePropertyName; - /** - * The base event 'type' property name. - */ - public static final String BASE_EVENT_TYPE_PROPERTY_NAME = Messages.TraceControl_EventTypePropertyName; - /** - * The base event 'log level' property name. - */ - public static final String BASE_EVENT_LOGLEVEL_PROPERTY_NAME = Messages.TraceControl_LogLevelPropertyName; - /** - * The base event 'fields' property name. - */ - public static final String BASE_EVENT_FIELDS_PROPERTY_NAME = Messages.TraceControl_FieldsPropertyName; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The base event component which this property source is for. - */ - private final BaseEventComponent fBaseEvent; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param component - the base event component - */ - public BaseEventPropertySource(BaseEventComponent component) { - fBaseEvent = component; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IPropertyDescriptor[] getPropertyDescriptors() { - List list = new ArrayList<> (); - list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_NAME_PROPERTY_ID, BASE_EVENT_NAME_PROPERTY_NAME)); - list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_TYPE_PROPERTY_ID, BASE_EVENT_TYPE_PROPERTY_NAME)); - if (fBaseEvent.getLogLevel() != TraceLogLevel.LEVEL_UNKNOWN) { - list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_LOGLEVEL_PROPERTY_ID, BASE_EVENT_LOGLEVEL_PROPERTY_NAME)); - } - if (fBaseEvent.getFieldString() != null) { - list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_FIELDS_PROPERTY_ID, BASE_EVENT_FIELDS_PROPERTY_NAME)); - } - return list.toArray(new IPropertyDescriptor[list.size()]); - } - - @Override - public Object getPropertyValue(Object id) { - if(BASE_EVENT_NAME_PROPERTY_ID.equals(id)) { - return fBaseEvent.getName(); - } - if (BASE_EVENT_TYPE_PROPERTY_ID.equals(id)) { - return fBaseEvent.getEventType().name(); - } - if (BASE_EVENT_LOGLEVEL_PROPERTY_ID.equals(id)) { - return fBaseEvent.getLogLevel().name(); - } - if (BASE_EVENT_FIELDS_PROPERTY_ID.equals(id)) { - return fBaseEvent.getFieldString(); - } - return null; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BasePropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BasePropertySource.java deleted file mode 100644 index e5c7cede5f..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BasePropertySource.java +++ /dev/null @@ -1,53 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import org.eclipse.ui.views.properties.IPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertySource; - -/** - *

- * Base property source implementation. - *

- * - * @author Bernd Hufmann - */ -public abstract class BasePropertySource implements IPropertySource { - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public Object getEditableValue() { - return null; - } - - @Override - public abstract IPropertyDescriptor[] getPropertyDescriptors(); - - @Override - public abstract Object getPropertyValue(Object id); - - @Override - public boolean isPropertySet(Object id) { - return false; - } - - @Override - public void resetPropertyValue(Object id) { - } - - @Override - public void setPropertyValue(Object id, Object value) { - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/KernelProviderPropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/KernelProviderPropertySource.java deleted file mode 100644 index 00ae10c824..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/KernelProviderPropertySource.java +++ /dev/null @@ -1,80 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; -import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertyDescriptor; - -/** - *

- * Property source implementation for the kernl provider component. - *

- * - * @author Bernd Hufmann - */ -public class KernelProviderPropertySource extends BasePropertySource { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * The kernel provider 'name' property ID. - */ - public static final String KERNEL_PROVIDER_NAME_PROPERTY_ID = "ust.provider.name"; //$NON-NLS-1$ - /** - * The kernel provider 'name' property name. - */ - public static final String KERNEL_PROVIDER_NAME_PROPERTY_NAME = Messages.TraceControl_ProviderNamePropertyName; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The kernel provider component which this property source is for. - */ - private KernelProviderComponent fProvider; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param component - the kernel provider component - */ - public KernelProviderPropertySource(KernelProviderComponent component) { - fProvider = component; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IPropertyDescriptor[] getPropertyDescriptors() { - return new IPropertyDescriptor[] { - new ReadOnlyTextPropertyDescriptor(KERNEL_PROVIDER_NAME_PROPERTY_ID, KERNEL_PROVIDER_NAME_PROPERTY_NAME)}; - } - - @Override - public Object getPropertyValue(Object id) { - if(KERNEL_PROVIDER_NAME_PROPERTY_ID.equals(id)) { - return fProvider.getName(); - } - return null; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TargetNodePropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TargetNodePropertySource.java deleted file mode 100644 index e552bb919e..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TargetNodePropertySource.java +++ /dev/null @@ -1,113 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; -import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertyDescriptor; - -/** - *

- * Property source implementation for the target node component. - *

- * - * @author Bernd Hufmann - */ -public class TargetNodePropertySource extends BasePropertySource { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The node name property ID. - */ - public static final String TARGET_NODE_NAME_PROPERTY_ID = "target.node.name"; //$NON-NLS-1$ - /** - * The node address property ID. - */ - public static final String TARGET_NODE_ADDRESS_PROPERTY_ID = "target.node.address"; //$NON-NLS-1$ - /** - * The state property ID. - */ - public static final String TARGET_NODE_STATE_PROPERTY_ID = "target.node.state"; //$NON-NLS-1$ - /** - * The node version property ID. - */ - public static final String TARGET_NODE_VERSION_PROPERTY_ID = "target.node.version"; //$NON-NLS-1$ - - /** - * The node name property name. - */ - public static final String TARGET_NODE_NAME_PROPERTY_NAME = Messages.TraceControl_HostNamePropertyName; - /** - * The node address property name. - */ - public static final String TARGET_NODE_ADDRESS_PROPERTY_NAME = Messages.TraceControl_HostAddressPropertyName; - /** - * The state address property name. - */ - public static final String TARGET_NODE_STATE_PROPERTY_NAME = Messages.TraceControl_StatePropertyName; - /** - * The node version property name. - */ - public static final String TARGET_NODE_VERSION_PROPERTY_NAME = Messages.TraceControl_VersionPropertyName; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The node component which this property source is for. - */ - private final TargetNodeComponent fTargetNode; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param component - the node component - */ - public TargetNodePropertySource(TargetNodeComponent component) { - fTargetNode = component; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IPropertyDescriptor[] getPropertyDescriptors() { - return new IPropertyDescriptor[] { - new ReadOnlyTextPropertyDescriptor(TARGET_NODE_NAME_PROPERTY_ID, TARGET_NODE_NAME_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TARGET_NODE_ADDRESS_PROPERTY_ID, TARGET_NODE_ADDRESS_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TARGET_NODE_STATE_PROPERTY_ID, TARGET_NODE_STATE_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TARGET_NODE_VERSION_PROPERTY_ID, TARGET_NODE_VERSION_PROPERTY_NAME)}; - } - - @Override - public Object getPropertyValue(Object id) { - if(TARGET_NODE_NAME_PROPERTY_ID.equals(id)) { - return fTargetNode.getName(); - } - if (TARGET_NODE_ADDRESS_PROPERTY_ID.equals(id)) { - return fTargetNode.getHostName(); - } - if (TARGET_NODE_STATE_PROPERTY_ID.equals(id)) { - return fTargetNode.getTargetNodeState().name(); - } - if (TARGET_NODE_VERSION_PROPERTY_ID.equals(id)) { - return fTargetNode.getNodeVersion(); - } - return null; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java deleted file mode 100644 index 790a6dd01e..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java +++ /dev/null @@ -1,161 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; -import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertyDescriptor; - -/** - *

- * Property source implementation for the trace channel component. - *

- * - * @author Bernd Hufmann - */ -public class TraceChannelPropertySource extends BasePropertySource { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The trace channel 'name' property ID. - */ - public static final String TRACE_CHANNEL_NAME_PROPERTY_ID = "trace.channel.name"; //$NON-NLS-1$ - /** - * The trace channel 'state' ID. - */ - public static final String TRACE_CHANNEL_STATE_PROPERTY_ID = "trace.channel.state"; //$NON-NLS-1$ - /** - * The trace channel 'overwrite mode' property ID. - */ - public static final String TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID = "trace.channel.overwrite.mode"; //$NON-NLS-1$ - /** - * The trace channel 'sub-buffer size' property ID. - */ - public static final String TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID = "trace.channel.subbuffer.size"; //$NON-NLS-1$ - /** - * The trace channel 'number of sub-buffers' property ID. - */ - public static final String TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID = "trace.channel.no.subbuffers"; //$NON-NLS-1$ - /** - * The trace channel 'switch timer interval' property ID. - */ - public static final String TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID = "trace.channel.switch.timer"; //$NON-NLS-1$ - /** - * The trace channel 'read timer interval' property ID. - */ - public static final String TRACE_CHANNEL_READ_TIMER_PROPERTY_ID = "trace.channel.read.timer"; //$NON-NLS-1$ - /** - * The trace channel 'output type' property ID. - */ - public static final String TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID = "trace.channel.output.type"; //$NON-NLS-1$ - /** - * The trace channel 'name' property name. - */ - public static final String TRACE_CHANNEL_NAME_PROPERTY_NAME = Messages.TraceControl_ChannelNamePropertyName; - /** - * The trace channel 'state' property name. - */ - public static final String TRACE_CHANNEL_STATE_PROPERTY_NAME = Messages.TraceControl_StatePropertyName; - /** - * The trace channel 'overwrite mode' property name. - */ - public static final String TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_NAME = Messages.TraceControl_OverwriteModePropertyName; - /** - * The trace channel 'sub-buffer size' property name. - */ - public static final String TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_NAME = Messages.TraceControl_SubBufferSizePropertyName; - /** - * The trace channel 'sub-buffer size' property name. - */ - public static final String TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_NAME = Messages.TraceControl_NbSubBuffersPropertyName; - /** - * The trace channel 'switch timer interval' property name. - */ - public static final String TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_NAME = Messages.TraceControl_SwitchTimerPropertyName; - /** - * The trace channel 'read timer interval' property name. - */ - public static final String TRACE_CHANNEL_READ_TIMER_PROPERTY_NAME = Messages.TraceControl_ReadTimerPropertyName; - /** - * The trace channel 'output type' property name. - */ - public static final String TRACE_CHANNEL_OUTPUT_TYPEPROPERTY_NAME = Messages.TraceControl_OutputTypePropertyName; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The channel component which this property source is for. - */ - private final TraceChannelComponent fChannel; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param component - the channel component - */ - public TraceChannelPropertySource(TraceChannelComponent component) { - fChannel = component; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IPropertyDescriptor[] getPropertyDescriptors() { - return new IPropertyDescriptor[] { - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NAME_PROPERTY_ID, TRACE_CHANNEL_NAME_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_STATE_PROPERTY_ID, TRACE_CHANNEL_STATE_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID, TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID, TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID, TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID, TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_READ_TIMER_PROPERTY_ID, TRACE_CHANNEL_READ_TIMER_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID, TRACE_CHANNEL_OUTPUT_TYPEPROPERTY_NAME)}; - } - - @Override - public Object getPropertyValue(Object id) { - if(TRACE_CHANNEL_NAME_PROPERTY_ID.equals(id)) { - return fChannel.getName(); - } - if (TRACE_CHANNEL_STATE_PROPERTY_ID.equals(id)) { - return fChannel.getState().name(); - } - if(TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID.equals(id)) { - return String.valueOf(fChannel.isOverwriteMode()); - } - if(TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID.equals(id)) { - return String.valueOf(fChannel.getSubBufferSize()); - } - if(TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID.equals(id)) { - return String.valueOf(fChannel.getNumberOfSubBuffers()); - } - if(TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID.equals(id)) { - return String.valueOf(fChannel.getSwitchTimer()); - } - if(TRACE_CHANNEL_READ_TIMER_PROPERTY_ID.equals(id)) { - return String.valueOf(fChannel.getReadTimer()); - } - if(TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID.equals(id)) { - return fChannel.getOutputType().getInName(); - } - return null; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceDomainPropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceDomainPropertySource.java deleted file mode 100644 index 630fe7f064..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceDomainPropertySource.java +++ /dev/null @@ -1,99 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; -import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertyDescriptor; - -/** - *

- * Property source implementation for the trace domain component. - *

- * - * @author Bernd Hufmann - */ -public class TraceDomainPropertySource extends BasePropertySource { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** - * The trace domain 'name' property ID. - */ - public static final String TRACE_DOMAIN_NAME_PROPERTY_ID = "trace.domain.name"; //$NON-NLS-1$ - /** - * The trace domain 'name' property name. - */ - public static final String TRACE_DOMAIN_NAME_PROPERTY_NAME = Messages.TraceControl_DomainNamePropertyName; - /** - * The domain 'buffer type' property ID. - */ - public static final String BUFFER_TYPE_PROPERTY_ID = "trace.domain.bufferType"; //$NON-NLS-1$ - /** - * The domain 'buffer type' property name. - */ - public static final String BUFER_TYPE_PROPERTY_NAME = Messages.TraceControl_BufferTypePropertyName; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The trace domain component which this property source is for. - */ - private final TraceDomainComponent fDomain; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param component - the trace domain component - */ - public TraceDomainPropertySource(TraceDomainComponent component) { - fDomain = component; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IPropertyDescriptor[] getPropertyDescriptors() { - if (fDomain.getBufferType() == BufferType.BUFFER_TYPE_UNKNOWN) { - return new IPropertyDescriptor[] { - new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME) }; - } - - return new IPropertyDescriptor[] { - new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(BUFFER_TYPE_PROPERTY_ID, BUFER_TYPE_PROPERTY_NAME) }; - } - - @Override - public Object getPropertyValue(Object id) { - if(BUFFER_TYPE_PROPERTY_ID.equals(id)){ - return fDomain.getBufferType().getInName(); - } - - if(TRACE_DOMAIN_NAME_PROPERTY_ID.equals(id)) { - return fDomain.getName(); - } - return null; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceEventPropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceEventPropertySource.java deleted file mode 100644 index e7cc8f5889..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceEventPropertySource.java +++ /dev/null @@ -1,145 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertyDescriptor; - -/** - *

- * Property source implementation for the trace event component. - *

- * - * @author Bernd Hufmann - */ -public class TraceEventPropertySource extends BasePropertySource { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The trace event 'name' property ID. - */ - public static final String TRACE_EVENT_NAME_PROPERTY_ID = "trace.event.name"; //$NON-NLS-1$ - /** - * The trace event 'type' property ID. - */ - public static final String TRACE_EVENT_TYPE_PROPERTY_ID = "trace.event.type"; //$NON-NLS-1$ - /** - * The trace event 'log level' property ID. - */ - public static final String TRACE_EVENT_LOGLEVEL_PROPERTY_ID = "trace.event.loglevel"; //$NON-NLS-1$ - /** - * The trace event 'state' property ID. - */ - public static final String TRACE_EVENT_STATE_PROPERTY_ID = "trace.event.state"; //$NON-NLS-1$ - /** - * The trace event 'filter' property ID. - */ - public static final String TRACE_EVENT_FILTER_PROPERTY_ID = "trace.event.filter"; //$NON-NLS-1$ - - /** - * The trace event 'name' property name. - */ - public static final String TRACE_EVENT_NAME_PROPERTY_NAME = Messages.TraceControl_EventNamePropertyName; - /** - * The trace event 'type' property name. - */ - public static final String TRACE_EVENT_TYPE_PROPERTY_NAME = Messages.TraceControl_EventTypePropertyName; - /** - * The trace event 'log level' property name. - */ - public static final String TRACE_EVENT_LOGLEVEL_PROPERTY_NAME = Messages.TraceControl_LogLevelPropertyName; - /** - * The trace event 'state' property name. - */ - public static final String TRACE_EVENT_STATE_PROPERTY_NAME = Messages.TraceControl_StatePropertyName; - /** - * The trace event 'filter' property name. - */ - public static final String TRACE_EVENT_FILTER_PROPERTY_NAME = Messages.TraceControl_FilterPropertyName; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The event component which this property source is for. - */ - protected final TraceEventComponent fEvent; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param component - the base event component - */ - public TraceEventPropertySource(TraceEventComponent component) { - fEvent = component; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IPropertyDescriptor[] getPropertyDescriptors() { - List list = new ArrayList<> (); - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_NAME_PROPERTY_ID, TRACE_EVENT_NAME_PROPERTY_NAME)); - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_TYPE_PROPERTY_ID, TRACE_EVENT_TYPE_PROPERTY_NAME)); - list.add( new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_STATE_PROPERTY_ID, TRACE_EVENT_STATE_PROPERTY_NAME)); - if (fEvent.getLogLevel() != TraceLogLevel.LEVEL_UNKNOWN) { - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_LOGLEVEL_PROPERTY_ID, TRACE_EVENT_LOGLEVEL_PROPERTY_NAME)); - } - if (fEvent.getFilterExpression() != null) { - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_FILTER_PROPERTY_ID, TRACE_EVENT_FILTER_PROPERTY_NAME)); - } - return list.toArray(new IPropertyDescriptor[list.size()]); - } - - @Override - public Object getPropertyValue(Object id) { - if(TRACE_EVENT_NAME_PROPERTY_ID.equals(id)) { - return fEvent.getName(); - } - if (TRACE_EVENT_TYPE_PROPERTY_ID.equals(id)) { - return fEvent.getEventType().name(); - } - if (TRACE_EVENT_LOGLEVEL_PROPERTY_ID.equals(id)) { - StringBuffer buffer = new StringBuffer(); - if (fEvent.getLogLevelType() != LogLevelType.LOGLEVEL_NONE) { - buffer.append(fEvent.getLogLevelType().getShortName()).append(' '); - } - buffer.append(fEvent.getLogLevel().name()); - return buffer.toString(); - } - if (TRACE_EVENT_STATE_PROPERTY_ID.equals(id)) { - return fEvent.getState().name(); - } - if (TRACE_EVENT_FILTER_PROPERTY_ID.equals(id)) { - return fEvent.getFilterExpression(); - } - - return null; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceProbeEventPropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceProbeEventPropertySource.java deleted file mode 100644 index 759d43b7d2..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceProbeEventPropertySource.java +++ /dev/null @@ -1,124 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent; -import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertyDescriptor; - -/** - *

- * Property source implementation for the trace probe event component. - *

- * - * @author Bernd Hufmann - */ -public class TraceProbeEventPropertySource extends TraceEventPropertySource { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The trace event 'probe address' property ID. - */ - public static final String TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID = "trace.event.probe.address"; //$NON-NLS-1$ - /** - * The trace event 'probe offset' property ID. - */ - public static final String TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID = "trace.event.probe.offset"; //$NON-NLS-1$ - /** - * The trace event 'probe symbol' property ID. - */ - public static final String TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID = "trace.event.probe.symbol"; //$NON-NLS-1$ - /** - * The trace event 'probe address' property name. - */ - public static final String TRACE_EVENT_PROBE_ADDRESS_PROPERTY_NAME = Messages.TraceControl_ProbeAddressPropertyName; - /** - * The trace event 'probe offset' property ID. - */ - public static final String TRACE_EVENT_PROBE_OFFSET_PROPERTY_NAME = Messages.TraceControl_ProbeOffsetPropertyName; - /** - * The trace event 'probe symbol' property ID. - */ - public static final String TRACE_EVENT_PROBE_SYMBOL_PROPERTY_NAME = Messages.TraceControl_ProbeSymbolPropertyName; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * - * @param component - * A trace event component - */ - public TraceProbeEventPropertySource(TraceEventComponent component) { - super(component); - if (component.getClass() != TraceProbeEventComponent.class) { - throw new IllegalArgumentException("Invalid type passed. Only class of type TraceProbeEventComponent allowed:\n" + component.getClass()); //$NON-NLS-1$ - } - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IPropertyDescriptor[] getPropertyDescriptors() { - IPropertyDescriptor[] superProperties = super.getPropertyDescriptors(); - - List superList = Arrays.asList(superProperties); - ArrayList list = new ArrayList<>(); - list.addAll(superList); - - if (fEvent instanceof TraceProbeEventComponent) { - TraceProbeEventComponent event = (TraceProbeEventComponent) fEvent; - if (event.getAddress() != null) { - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID, TRACE_EVENT_PROBE_ADDRESS_PROPERTY_NAME)); - } - - if (event.getOffset() != null) { - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID, TRACE_EVENT_PROBE_OFFSET_PROPERTY_NAME)); - } - - if (event.getSymbol() != null) { - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID, TRACE_EVENT_PROBE_SYMBOL_PROPERTY_NAME)); - } - } - return list.toArray(new IPropertyDescriptor[list.size()]); - } - - @Override - public Object getPropertyValue(Object id) { - if(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID.equals(id)) { - return ((TraceProbeEventComponent)fEvent).getAddress(); - } - if (TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID.equals(id)) { - return ((TraceProbeEventComponent)fEvent).getOffset(); - } - if (TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID.equals(id)) { - return ((TraceProbeEventComponent)fEvent).getSymbol(); - } - return super.getPropertyValue(id); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceSessionPropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceSessionPropertySource.java deleted file mode 100644 index 0ccb10ec38..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceSessionPropertySource.java +++ /dev/null @@ -1,147 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; -import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertyDescriptor; - -/** - *

- * Property source implementation for the trace session component. - *

- * - * @author Bernd Hufmann - */ -public class TraceSessionPropertySource extends BasePropertySource { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The trace session name property ID. - */ - public static final String TRACE_SESSION_NAME_PROPERTY_ID = "trace.session.name"; //$NON-NLS-1$ - /** - * The trace session path property ID. - */ - public static final String TRACE_SESSION_PATH_PROPERTY_ID = "trace.session.path"; //$NON-NLS-1$ - /** - * The trace session state ID. - */ - public static final String TRACE_SESSION_STATE_PROPERTY_ID = "trace.session.state"; //$NON-NLS-1$ - /** - * The trace snapshot path property ID. - */ - public static final String TRACE_SNAPSHOT_PATH_PROPERTY_ID = "trace.snapshot.path"; //$NON-NLS-1$ - /** - * The snapshot name property. - */ - public static final String TRACE_SNAPSHOT_NAME_PROPERTY_ID = "trace.snapshot.name"; //$NON-NLS-1$ - /** - * The snapshot ID property. - */ - public static final String TRACE_SNAPSHOT_ID_PROPERTY_ID = "trace.snapshot.id"; //$NON-NLS-1$ - - /** - * The trace session name property name. - */ - public static final String TRACE_SESSION_NAME_PROPERTY_NAME = Messages.TraceControl_SessionNamePropertyName; - /** - * The trace session path property name. - */ - public static final String TRACE_SESSION_PATH_PROPERTY_NAME = Messages.TraceControl_SessionPathPropertyName; - /** - * The trace session state property name. - */ - public static final String TRACE_SESSION_STATE_PROPERTY_NAME = Messages.TraceControl_StatePropertyName; - /** - * The snapshot path property name. - */ - public static final String TRACE_SNAPSHOT_PATH_PROPERTY_NAME = Messages.TraceControl_SnapshotPathPropertyName; - /** - * The trace snapshot name property name. - */ - public static final String TRACE_SNAPSHOT_NAME_PROPERTY_NAME = Messages.TraceControl_SnapshotNamePropertyName; - /** - * The trace snapshot ID property name. - */ - public static final String TRACE_SNAPSHOT_ID_PROPERTY_NAME = Messages.TraceControl_SnapshotIdPropertyName; - - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The session component which this property source is for. - */ - private final TraceSessionComponent fSession; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param component - the session component - */ - public TraceSessionPropertySource(TraceSessionComponent component) { - fSession = component; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IPropertyDescriptor[] getPropertyDescriptors() { - List list = new ArrayList<>(); - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SESSION_NAME_PROPERTY_ID, TRACE_SESSION_NAME_PROPERTY_NAME)); - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SESSION_STATE_PROPERTY_ID, TRACE_SESSION_STATE_PROPERTY_NAME)); - if (fSession.isSnapshotSession()) { - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SNAPSHOT_NAME_PROPERTY_ID, TRACE_SNAPSHOT_NAME_PROPERTY_NAME)); - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SNAPSHOT_PATH_PROPERTY_ID, TRACE_SNAPSHOT_PATH_PROPERTY_NAME)); - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SNAPSHOT_ID_PROPERTY_ID, TRACE_SNAPSHOT_ID_PROPERTY_NAME)); - } else { - list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SESSION_PATH_PROPERTY_ID, TRACE_SESSION_PATH_PROPERTY_NAME)); - } - return(list.toArray(new IPropertyDescriptor[list.size()])); - } - - @Override - public Object getPropertyValue(Object id) { - if(TRACE_SESSION_NAME_PROPERTY_ID.equals(id)) { - return fSession.getName(); - } - if(TRACE_SESSION_PATH_PROPERTY_ID.equals(id)) { - return fSession.getSessionPath(); - } - if (TRACE_SESSION_STATE_PROPERTY_ID.equals(id)) { - return fSession.getSessionState().name(); - } - if (TRACE_SNAPSHOT_PATH_PROPERTY_ID.equals(id)) { - return (fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getSnapshotPath() : ""); //$NON-NLS-1$ - } - if (TRACE_SNAPSHOT_NAME_PROPERTY_ID.equals(id)) { - return (fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getName() : ""); //$NON-NLS-1$ - } - if (TRACE_SNAPSHOT_ID_PROPERTY_ID.equals(id)) { - return (fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getId() : ""); //$NON-NLS-1$ - } - return null; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/UstProviderPropertySource.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/UstProviderPropertySource.java deleted file mode 100644 index bd2ad61e27..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/UstProviderPropertySource.java +++ /dev/null @@ -1,91 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; -import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertyDescriptor; - -/** - *

- * Property source implementation for the UST provider component. - *

- * - * @author Bernd Hufmann - */ -public class UstProviderPropertySource extends BasePropertySource { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * The UST provider 'name' property ID. - */ - public static final String UST_PROVIDER_NAME_PROPERTY_ID = "ust.provider.name"; //$NON-NLS-1$ - /** - * The UST provider 'PID' property ID. - */ - public static final String UST_PROVIDER_PID_PROPERTY_ID = "ust.provider.pid"; //$NON-NLS-1$ - /** - * The UST provider 'name' property name. - */ - public static final String UST_PROVIDER_NAME_PROPERTY_NAME = Messages.TraceControl_ProviderNamePropertyName; - /** - * The UST provider 'type' property name. - */ - public static final String UST_PROVIDER_PID_PROPERTY_NAME = Messages.TraceControl_ProcessIdPropertyName; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The UST provider component which this property source is for. - */ - private UstProviderComponent fUstProvider; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param component - the UST provider component - */ - public UstProviderPropertySource(UstProviderComponent component) { - fUstProvider = component; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IPropertyDescriptor[] getPropertyDescriptors() { - return new IPropertyDescriptor[] { - new ReadOnlyTextPropertyDescriptor(UST_PROVIDER_NAME_PROPERTY_ID, UST_PROVIDER_NAME_PROPERTY_NAME), - new ReadOnlyTextPropertyDescriptor(UST_PROVIDER_PID_PROPERTY_ID, UST_PROVIDER_PID_PROPERTY_NAME)}; - } - - @Override - public Object getPropertyValue(Object id) { - if(UST_PROVIDER_NAME_PROPERTY_ID.equals(id)) { - return fUstProvider.getName(); - } - if (UST_PROVIDER_PID_PROPERTY_ID.equals(id)) { - return String.valueOf(fUstProvider.getPid()); - } - return null; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandResult.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandResult.java deleted file mode 100644 index 9b7c0b545d..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandResult.java +++ /dev/null @@ -1,102 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; - -import java.util.Arrays; - -/** - *

- * Class containing command result of remote command execution. - *

- * - * @author Bernd Hufmann - */ -public class CommandResult implements ICommandResult { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The result of the command. 0 if successful else > 0 - */ - private int fResult; - - /** - * The output as String array. - */ - private String[] fOutput = new String[0]; - private String[] fErrorOutput = new String[0]; - - // ------------------------------------------------------------------------ - // Constructor - // ------------------------------------------------------------------------ - - /** - * Constructor - * - * @param result - * The result of the command - * @param output - * The output, as an array of strings - * @param errorOutput - * THe error output as an array of strings - */ - public CommandResult(int result, String[] output, String[] errorOutput) { - fResult = result; - if (output != null) { - fOutput = Arrays.copyOf(output, output.length); - } - if (errorOutput != null) { - fErrorOutput = Arrays.copyOf(errorOutput, errorOutput.length); - } - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public int getResult() { - return fResult; - } - - @Override - public void setResult(int result) { - fResult = result; - } - - @Override - public String[] getOutput() { - return Arrays.copyOf(fOutput, fOutput.length); - } - - @Override - public void setOutput(String[] output) { - fOutput = new String[0]; - if (output != null) { - fOutput = Arrays.copyOf(output, output.length); - } - } - - @Override - public String[] getErrorOutput() { - return Arrays.copyOf(fErrorOutput, fErrorOutput.length); - } - - @Override - public void setErrorOutput(String[] output) { - fErrorOutput = new String[0]; - if (output != null) { - fErrorOutput = Arrays.copyOf(output, output.length); - } - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java deleted file mode 100644 index ea6cfa7ce8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java +++ /dev/null @@ -1,335 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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 Tasse - Initial API and implementation - * Bernd Hufmann - Updated using Executor Framework - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Random; -import java.util.concurrent.Callable; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.FutureTask; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; -import org.eclipse.rse.services.shells.HostShellProcessAdapter; -import org.eclipse.rse.services.shells.IHostShell; -import org.eclipse.rse.services.shells.IShellService; - -/** - *

- * Implementation of remote command execution using RSE's shell service. - *

- * - * @author Patrick Tasse - * @author Bernd Hufmann - */ -public class CommandShell implements ICommandShell { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - - /** Sub-string to be echo'ed when running command in shell, used to indicate that the command has finished running */ - public static final String DONE_MARKUP_STRING = "--RSE:donedonedone:--"; //$NON-NLS-1$ - - /** Sub-string to be echoed when running a command in shell. */ - public static final String BEGIN_END_TAG = "BEGIN-END-TAG:"; //$NON-NLS-1$ - - /** Command delimiter for shell */ - public static final String CMD_DELIMITER = "\n"; //$NON-NLS-1$ - - /** Shell "echo" command */ - public static final String SHELL_ECHO_CMD = " echo "; //$NON-NLS-1$ - - /** Default command separator */ - public static final char CMD_SEPARATOR = ';'; - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - private IRemoteSystemProxy fProxy = null; - private IHostShell fHostShell = null; - private BufferedReader fInputBufferReader = null; - private BufferedReader fErrorBufferReader = null; - private final ExecutorService fExecutor = Executors.newFixedThreadPool(1); - private boolean fIsConnected = false; - private final Random fRandom = new Random(System.currentTimeMillis()); - private int fReturnValue; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Create a new command shell - * - * @param proxy - * The RSE proxy for this shell - */ - public CommandShell(IRemoteSystemProxy proxy) { - fProxy = proxy; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void connect() throws ExecutionException { - IShellService shellService = fProxy.getShellService(); - Process p = null; - try { - String[] env = new String[0]; - - if (fProxy.isLocal()) { - env = shellService.getHostEnvironment(); - } - - fHostShell = shellService.launchShell("", env, new NullProgressMonitor()); //$NON-NLS-1$ - p = new HostShellProcessAdapter(fHostShell); - } catch (Exception e) { - throw new ExecutionException(Messages.TraceControl_CommandShellError, e); - } - fInputBufferReader = new BufferedReader(new InputStreamReader(p.getInputStream())); - fErrorBufferReader = new BufferedReader(new InputStreamReader(p.getErrorStream())); - fIsConnected = true; - } - - @Override - public void disconnect() { - fIsConnected = false; - try { - fInputBufferReader.close(); - fErrorBufferReader.close(); - } catch (IOException e) { - // ignore - } - } - - @Override - public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException { - return executeCommand(command, monitor, true); - } - - @Override - public ICommandResult executeCommand(final String command, final IProgressMonitor monitor, final boolean checkReturnValue) throws ExecutionException { - if (fIsConnected) { - FutureTask future = new FutureTask<>(new Callable() { - @Override - public CommandResult call() throws IOException, CancellationException { - final ArrayList result = new ArrayList<>(); - final ArrayList errorResult = new ArrayList<>(); - - synchronized (fHostShell) { - // Initialize return value which will be updated in isAliasEchoResult() - fReturnValue = 0; - - int startAlias = fRandom.nextInt(); - int endAlias = fRandom.nextInt(); - fHostShell.writeToShell(formatShellCommand(command, startAlias, endAlias)); - - String nextLine; - boolean isStartFound = false; - while ((nextLine = fInputBufferReader.readLine()) != null) { - - if (monitor.isCanceled()) { - flushInput(); - throw new CancellationException(); - } - - // check if line contains echoed start alias - if (isAliasEchoResult(nextLine, startAlias, true)) { - isStartFound = true; - continue; - } - - // check if line contains is the end mark-up. This will retrieve also - // the return value of the actual command. - if (isAliasEchoResult(nextLine, endAlias, false)) { - break; - } - - // Ignore line if - // 1) start hasn't been found or - // 2) line is an echo of the command or - // 3) line is an echo of the end mark-up - if (!isStartFound || - isCommandEcho(nextLine, command) || - nextLine.contains(getEchoResult(endAlias))) - { - continue; - } - - // Now it's time add to the result - result.add(nextLine); - } - - // Read any left over output - flushInput(); - - // Read error stream output when command failed. - if (fReturnValue != 0) { - while(fErrorBufferReader.ready()) { - if ((nextLine = fErrorBufferReader.readLine()) != null) { - errorResult.add(nextLine); - } - } - // Workaround if error stream is not available and stderr output is written - // in standard output above. This is true for the SshTerminalShell implementation. - if (errorResult.isEmpty()) { - errorResult.addAll(result); - } - } - } - return new CommandResult(fReturnValue, result.toArray(new String[result.size()]), errorResult.toArray(new String[errorResult.size()])); - } - }); - - fExecutor.execute(future); - - try { - return future.get(ControlPreferences.getInstance().getCommandTimeout(), TimeUnit.SECONDS); - } catch (java.util.concurrent.ExecutionException ex) { - throw new ExecutionException(Messages.TraceControl_ExecutionFailure, ex); - } catch (InterruptedException ex) { - throw new ExecutionException(Messages.TraceControl_ExecutionCancelled, ex); - } catch (TimeoutException ex) { - throw new ExecutionException(Messages.TraceControl_ExecutionTimeout, ex); - } - } - throw new ExecutionException(Messages.TraceControl_ShellNotConnected, null); - } - - // ------------------------------------------------------------------------ - // Helper methods - // ------------------------------------------------------------------------ - /** - * Flushes the buffer reader - * @throws IOException - */ - private void flushInput() throws IOException { - char[] cbuf = new char[1]; - while (fInputBufferReader.ready()) { - if (fInputBufferReader.read(cbuf, 0, 1) == -1) { - break; - } - } - } - - /** - * Format the command to be sent into the shell command with start and end marker strings. - * The start marker is need to know when the actual command output starts. The end marker - * string is needed so we can tell that end of output has been reached. - * - * @param cmd The actual command - * @param startAlias The command alias for start marker - * @param endAlias The command alias for end marker - * @return formatted command string - */ - private static String formatShellCommand(String cmd, int startAlias, int endAlias) { - if (cmd == null || cmd.equals("")) { //$NON-NLS-1$ - return cmd; - } - StringBuffer formattedCommand = new StringBuffer(); - // Make multi-line command. - // Wrap actual command with start marker and end marker to wrap actual command. - formattedCommand.append(getEchoCmd(startAlias)); - formattedCommand.append(CMD_DELIMITER); - formattedCommand.append(cmd); - formattedCommand.append(CMD_DELIMITER); - formattedCommand.append(getEchoCmd(endAlias)); - formattedCommand.append(CMD_DELIMITER); - return formattedCommand.toString(); - } - - /** - * Creates a echo command line in the format: echo $? - * - * @param alias The command alias integer to be included in the echoed message. - * @return the echo command line - */ - private static String getEchoCmd(int alias) { - return SHELL_ECHO_CMD + getEchoResult(alias) + "$?"; //$NON-NLS-1$ - } - - /** - * Creates the expected result for a given command alias: - * $? - * - * @param alias The command alias integer to be included in the echoed message. - * @return the expected echo result - */ - private static String getEchoResult(int alias) { - return BEGIN_END_TAG + String.valueOf(alias) + DONE_MARKUP_STRING; - } - - /** - * Verifies if given command line contains a command alias echo result. - * - * @param line The output line to test. - * @param alias The command alias - * @param checkReturnValue true to retrieve command result (previous command) false - * @return true if output line is a command alias echo result else false - */ - private boolean isAliasEchoResult(String line, int alias, boolean checkReturnValue) { - String expected = getEchoResult(alias); - if (line.startsWith(expected)) { - if (!checkReturnValue) { - try { - int k = Integer.valueOf(line.substring(expected.length())); - fReturnValue = k; - } catch (NumberFormatException e) { - // do nothing - } - } - return true; - } - int index = line.indexOf(expected); - if ((index > 0) && (line.indexOf(SHELL_ECHO_CMD) == -1)) { - return true; - } - - return false; - } - - /** - * Verifies if output line is an echo of the given command line. If the - * output line is longer then the maximum line lengths (e.g. for ssh), the - * shell adds a line break character. This method takes this in - * consideration by comparing the command line without any whitespaces. - * - * @param line - * The output line to verify - * @param cmd - * The command executed - * @return true if it's an echoed command line else - * false - */ - @SuppressWarnings("nls") - private static boolean isCommandEcho(String line, String cmd) { - String s1 = line.replaceAll("\\s",""); - String s2 = cmd.replaceAll("\\s",""); - s2 = s2.replaceAll("(\\*)", "(\\\\*)"); - String patternStr = ".*(" + s2 +")$"; - return s1.matches(patternStr); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandResult.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandResult.java deleted file mode 100644 index be1d2abe33..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandResult.java +++ /dev/null @@ -1,64 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - *********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; - -/** - *

- * Interface for providing command execution result. - *

- * - * @author Bernd Hufmann - */ -public interface ICommandResult { - /** - * The result of the command. - * - * @return 0 if successful else >0 - */ - int getResult(); - - /** - * Sets the command result value. - * - * @param result - * The integer result to set - */ - void setResult(int result); - - /** - * @return returns the command output. - */ - String[] getOutput(); - - /** - * Sets the command output. - * - * @param output - * The output (as an array of Strings) to assign - */ - void setOutput(String[] output); - - /** - * The error output of the command. - * - * @return returns the command error output. - */ - String[] getErrorOutput(); - - /** - * Sets the command output. - * - * @param output - * The output (as an array of Strings) to assign - */ - void setErrorOutput(String[] output); -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java deleted file mode 100644 index ea0417c9fb..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - *

- * Interface for a command shell implementation - *

- * - * @author Bernd Hufmann - */ -public interface ICommandShell { - - /** - * Method to connect the command shell. - * - * @throws ExecutionException - * If the command fails - */ - void connect() throws ExecutionException; - - /** - * Method to disconnect the command shell. - */ - void disconnect(); - - /** - * Method to execute a command on the command shell. - * - * @param command - * - the command to executed - * @param monitor - * - a progress monitor - * @return the command result - * @throws ExecutionException - * If the command fails - */ - ICommandResult executeCommand(String command, - IProgressMonitor monitor) throws ExecutionException; - - /** - * Method to execute a command on the command shell. - * - * @param command - * - the command to executed - * @param monitor - * - a progress monitor - * @param checkReturnValue - * - flag to indicate that the command result should be checked. - * If false the command result will be always 0. - * @return the command result - * @throws ExecutionException - * If the command fails - */ - ICommandResult executeCommand(final String command, - final IProgressMonitor monitor, final boolean checkReturnValue) - throws ExecutionException; - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java deleted file mode 100644 index c91d82a006..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java +++ /dev/null @@ -1,140 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.rse.core.model.IRSECallback; -import org.eclipse.rse.core.subsystems.ICommunicationsListener; -import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.services.shells.IShellService; -import org.eclipse.rse.services.terminals.ITerminalService; -import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; - -/** - *

- * Remote System Proxy interface. - *

- * - * @author Bernd Hufmann - */ -public interface IRemoteSystemProxy { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Invalid port number for IP based connections. - */ - static final int INVALID_PORT_NUMBER = -1; - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - /** - * Find the first shell service. - * - * @return shell service object, or null if not found. - */ - IShellService getShellService(); - - /** - * Find the first terminal service. - * - * @return shell service object, or null if not found. - */ - ITerminalService getTerminalService(); - - /** - * Find the first IShellServiceSubSystem service. - * - * @return shell service subsystem, or null if not found. - */ - ISubSystem getShellServiceSubSystem(); - - /** - * Find the first ITerminalServiceSubSystem service. - * - * @return shell service subsystem, or null if not found. - */ - ISubSystem getTerminalServiceSubSystem(); - - /** - * Finds the File Service Subsystem. - * - * @return file service subsystem, or null if not found. - */ - IFileServiceSubSystem getFileServiceSubSystem(); - - /** - * @return port of IP connection to be used - */ - int getPort(); - - /** - * Sets the port of the IP connection. - * @param port - the IP port to set - */ - void setPort(int port); - - /** - * Connects the shell service sub system. - * - * @param callback - * - call-back method being called when connection was finished - * @throws ExecutionException - * If the connection fails - */ - void connect(IRSECallback callback) throws ExecutionException; - - /** - * Disconnects from the shell service sub system. - * - * @throws ExecutionException - * If the disconnect command fails - */ - void disconnect() throws ExecutionException; - - /** - * Creates a command shell. - * - * @return the command shell implementation - * @throws ExecutionException - * If the command fails - */ - ICommandShell createCommandShell() throws ExecutionException; - - /** - * Method to add a communication listener to the connector service defined - * for the given connection. - * - * @param listener - * - listener to add - */ - void addCommunicationListener(ICommunicationsListener listener); - - /** - * Method to remove a communication listener from the connector service - * defined for the given connection. - * - * @param listener - * - listener to remove - */ - void removeCommunicationListener(ICommunicationsListener listener); - - /** - * Checks whether the local host connector service is used or not. - * - * @return true if local connection else - * - */ - public boolean isLocal(); -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java deleted file mode 100644 index 8ddc210ea5..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java +++ /dev/null @@ -1,203 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Status; -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.IRSECallback; -import org.eclipse.rse.core.subsystems.ICommunicationsListener; -import org.eclipse.rse.core.subsystems.IConnectorService; -import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.services.IService; -import org.eclipse.rse.services.shells.IShellService; -import org.eclipse.rse.services.terminals.ITerminalService; -import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; - -/** - *

- * RemoteSystemProxy implementation. - *

- * - * @author Bernd Hufmann - */ -public class RemoteSystemProxy implements IRemoteSystemProxy { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - private final IHost fHost; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * - * @param host - * The host of this proxy - */ - public RemoteSystemProxy(IHost host) { - fHost = host; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public IShellService getShellService() { - ISubSystem ss = getShellServiceSubSystem(); - if (ss != null) { - return (IShellService)ss.getSubSystemConfiguration().getService(fHost).getAdapter(IShellService.class); - } - return null; - } - - @Override - public ITerminalService getTerminalService() { - ISubSystem ss = getTerminalServiceSubSystem(); - if (ss != null) { - return (ITerminalService)ss.getSubSystemConfiguration().getService(fHost).getAdapter(ITerminalService.class); - } - return null; - } - - @Override - public ISubSystem getShellServiceSubSystem() { - if (fHost == null) { - return null; - } - ISubSystem[] subSystems = fHost.getSubSystems(); - IShellService ssvc = null; - for (int i = 0; subSystems != null && i < subSystems.length; i++) { - IService svc = subSystems[i].getSubSystemConfiguration().getService(fHost); - if (svc!=null) { - ssvc = (IShellService)svc.getAdapter(IShellService.class); - if (ssvc != null) { - return subSystems[i]; - } - } - } - return null; - } - - @Override - public ISubSystem getTerminalServiceSubSystem() { - if (fHost == null) { - return null; - } - ISubSystem[] subSystems = fHost.getSubSystems(); - ITerminalService ssvc = null; - for (int i = 0; subSystems != null && i < subSystems.length; i++) { - IService svc = subSystems[i].getSubSystemConfiguration().getService(fHost); - if (svc!=null) { - ssvc = (ITerminalService)svc.getAdapter(ITerminalService.class); - if (ssvc != null) { - return subSystems[i]; - } - } - } - return null; - } - - @Override - public IFileServiceSubSystem getFileServiceSubSystem() { - if (fHost == null) { - return null; - } - ISubSystem[] subSystems = fHost.getSubSystems(); - for (int i = 0; subSystems != null && i < subSystems.length; i++) { - if (subSystems[i] instanceof IFileServiceSubSystem) { - return (IFileServiceSubSystem)subSystems[i]; - } - } - return null; - } - - @Override - public int getPort() { - if (getShellServiceSubSystem() != null) { - return getShellServiceSubSystem().getConnectorService().getPort(); - } - return IRemoteSystemProxy.INVALID_PORT_NUMBER; - } - - @Override - public void setPort(int port) { - if ((getShellServiceSubSystem() != null) && (port > 0)) { - getShellServiceSubSystem().getConnectorService().setPort(port); - } - } - - @Override - public void connect(IRSECallback callback) throws ExecutionException { - ISubSystem shellSubSystem = getShellServiceSubSystem(); - if (shellSubSystem != null) { - if (!shellSubSystem.isConnected()) { - try { - shellSubSystem.connect(false, callback); - } catch (OperationCanceledException e) { - callback.done(Status.CANCEL_STATUS, null); - } - catch (Exception e) { - throw new ExecutionException(e.toString(), e); - } - } else { - callback.done(Status.OK_STATUS, null); - } - } - } - - @Override - public void disconnect() throws ExecutionException { - ISubSystem shellSubSystem = getShellServiceSubSystem(); - if (shellSubSystem != null) { - try { - shellSubSystem.disconnect(); - } catch (Exception e) { - throw new ExecutionException(e.toString(), e); - } - } - } - - @Override - public ICommandShell createCommandShell() throws ExecutionException { - ICommandShell shell = new CommandShell(this); - shell.connect(); - return shell; - } - - @Override - public void addCommunicationListener(ICommunicationsListener listener) { - IConnectorService[] css = fHost.getConnectorServices(); - for (IConnectorService cs : css) { - cs.addCommunicationsListener(listener); - } - } - - @Override - public void removeCommunicationListener(ICommunicationsListener listener) { - IConnectorService[] css = fHost.getConnectorServices(); - for (IConnectorService cs : css) { - cs.removeCommunicationsListener(listener); - } - } - - @Override - public boolean isLocal() { - return fHost.getSystemType().isLocal(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/ILttngControlService.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/ILttngControlService.java deleted file mode 100644 index 1cb020c914..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/ILttngControlService.java +++ /dev/null @@ -1,402 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; - - -/** -*

-* Interface for LTTng trace control command service. -*

-* -* @author Bernd Hufmann -*/ -public interface ILttngControlService { - - /** - * @return the LTTng version object - */ - LttngVersion getVersion(); - - /** - * @return the version string - */ - String getVersionString(); - - /** - * Checks if given version is supported by this ILTTngControlService implementation. - * - * @param version The version to check - * @return true if version is supported else false - */ - boolean isVersionSupported(String version); - - /** - * Retrieves the existing sessions names from the node. - * - * @param monitor - * - a progress monitor - * @return an array with session names. - * @throws ExecutionException - * If the command fails - */ - String[] getSessionNames(IProgressMonitor monitor) - throws ExecutionException; - - /** - * Retrieves the session information with the given name the node. - * - * @param sessionName - * - the session name - * @param monitor - * - a progress monitor - * @return session information - * @throws ExecutionException - * If the command fails - */ - ISessionInfo getSession(String sessionName, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Retrieves the snapshot output information from the node - * @param sessionName - * - the session name - * @param monitor - * - a progress monitor - * @return snapshot output information - * @throws ExecutionException - * if command fails - */ - ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Retrieves the kernel provider information (i.e. the kernel events) - * - * @param monitor - * - a progress monitor - * @return the list of existing kernel events. - * @throws ExecutionException - * If the command fails - */ - List getKernelProvider(IProgressMonitor monitor) - throws ExecutionException; - - /** - * Retrieves the UST provider information from the node. - * - * @return - the UST provider information. - * @throws ExecutionException - * If the command fails - */ - public List getUstProvider() throws ExecutionException; - - /** - * Retrieves the UST provider information from the node. - * - * @param monitor - * - a progress monitor - * @return the UST provider information. - * @throws ExecutionException - * If the command fails - */ - List getUstProvider(IProgressMonitor monitor) - throws ExecutionException; - - /** - * Creates a session with given session name and location. - * - * @param sessionInfo - * the session information used to create the session - * @param monitor - * - a progress monitor - * - * @return the session information - * @throws ExecutionException - * If the command fails - */ - ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException; - - /** - * Destroys a session with given session name. - * - * @param sessionName - * - a session name to destroy - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void destroySession(String sessionName, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Starts a session with given session name. - * - * @param sessionName - * - a session name to start - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void startSession(String sessionName, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Stops a session with given session name. - * - * @param sessionName - * - a session name to stop - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void stopSession(String sessionName, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Enables a list of channels for given session and given channel - * information (configuration). - * - * @param sessionName - * - a session name to create - * @param channelNames - * - a list of channel names to be enabled - * @param isKernel - * - a flag to indicate Kernel or UST (true for Kernel, false for - * UST) - * @param info - * - channel information used for creation of a channel (or null - * for default) - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void enableChannels(String sessionName, List channelNames, - boolean isKernel, IChannelInfo info, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Disables a list of channels for given session and given channel - * information (configuration). - * - * @param sessionName - * - a session name to create - * @param channelNames - * - a list of channel names to be enabled - * @param isKernel - * - a flag to indicate Kernel or UST (true for Kernel, false for - * UST) - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void disableChannels(String sessionName, List channelNames, - boolean isKernel, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Enables a list of events with no additional parameters. - * - * @param sessionName - * - a session name - * @param channelName - * - a channel name or null for default channel - * @param eventNames - * - a list of event names to be enabled, or null (list of size = - * 0)for all events . - * @param isKernel - * - a flag for indicating kernel or UST. - * @param filterExpression - * - a filter expression - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void enableEvents(String sessionName, String channelName, - List eventNames, boolean isKernel, String filterExpression, - IProgressMonitor monitor) - throws ExecutionException; - - - /** - * Enables all syscall events. - * - * @param sessionName - * - a session name - * @param channelName - * - a channel name or null for default channel - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void enableSyscalls(String sessionName, String channelName, - IProgressMonitor monitor) throws ExecutionException; - - /** - * Enables a dynamic probe or dynamic function entry/return probe. - * - * @param sessionName - * - a session name - * @param channelName - * - a channel name or null for default channel - * @param eventName - * - a event name - * @param isFunction - * - true for dynamic function entry/return probe else false - * @param probe - * - a dynamic probe information - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void enableProbe(String sessionName, String channelName, - String eventName, boolean isFunction, String probe, - IProgressMonitor monitor) throws ExecutionException; - - /** - * Enables events using log level - * - * @param sessionName - * - a session name - * @param channelName - * - a channel name (null for default channel) - * @param eventName - * - a event name - * @param logLevelType - * - a log level type - * @param level - * - a log level - * @param filterExpression - * - a filter expression - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void enableLogLevel(String sessionName, String channelName, - String eventName, LogLevelType logLevelType, TraceLogLevel level, - String filterExpression, - IProgressMonitor monitor) throws ExecutionException; - - /** - * Disables a list of events with no additional parameters. - * - * @param sessionName - * - a session name - * @param channelName - * - a channel name (null for default channel) - * @param eventNames - * - a list of event names to enabled. - * @param isKernel - * - a flag for indicating kernel or UST. - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void disableEvent(String sessionName, String channelName, - List eventNames, boolean isKernel, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Gets all available context names to be added to channels/events. - * - * @param monitor - * The progress monitor - * @return the list of available contexts - * @throws ExecutionException - * If the command fails - */ - List getContextList(IProgressMonitor monitor) - throws ExecutionException; - - /** - * Add contexts to given channels and or events - * - * @param sessionName - * - a session name - * @param channelName - * - a channel name (null for all channels) - * @param eventName - * - a event name (null for all events) - * @param isKernel - * - a flag for indicating kernel or UST. - * @param contexts - * - a list of name of contexts to add - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void addContexts(String sessionName, String channelName, - String eventName, boolean isKernel, List contexts, - IProgressMonitor monitor) throws ExecutionException; - - /** - * Executes calibrate command to quantify LTTng overhead. - * - * @param isKernel - * - a flag for indicating kernel or UST. - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void calibrate(boolean isKernel, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Records a snapshot. - * - * @param sessionName - * - a session name - * @param monitor - * - a progress monitor - * @throws ExecutionException - * If the command fails - */ - void recordSnapshot(String sessionName, IProgressMonitor monitor) - throws ExecutionException; - - /** - * Executes a list of commands - * - * @param monitor - * - a progress monitor - * @param commands - * - array of commands - * @throws ExecutionException - * If a command fails - */ - void runCommands(IProgressMonitor monitor, List commands) - throws ExecutionException; -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java deleted file mode 100644 index 75a87ab013..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java +++ /dev/null @@ -1,1579 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Simon Delisle - Updated for support of LTTng Tools 2.2 - * Marc-Andre Laperle - Support for creating a live session - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; - -/** - *

- * Service for sending LTTng trace control commands to remote host. - *

- * - * @author Bernd Hufmann - */ -public class LTTngControlService implements ILttngControlService { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The command shell implementation - */ - private final ICommandShell fCommandShell; - - /** - * The version string. - */ - private LttngVersion fVersion = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * - * @param shell - * - the command shell implementation to use - */ - public LTTngControlService(ICommandShell shell) { - fCommandShell = shell; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getVersionString() { - if (fVersion == null) { - return "Unknown"; //$NON-NLS-1$ - } - return fVersion.toString(); - } - - @Override - public LttngVersion getVersion() { - return fVersion; - } - - /** - * Sets the version of the LTTng 2.0 control service. - * - * @param version - * - a version to set - */ - public void setVersion(String version) { - fVersion = new LttngVersion(version); - } - - /** - * Sets the version of the LTTng 2.x control service. - * - * @param version - * - a version to set - */ - public void setVersion(LttngVersion version) { - fVersion = version; - } - - @Override - public boolean isVersionSupported(String version) { - LttngVersion tmp = new LttngVersion(version); - return (fVersion != null && fVersion.compareTo(tmp) >= 0) ? true : false; - } - - /** - * Returns the command shell implementation. - * - * @return the command shell implementation - */ - protected ICommandShell getCommandShell() { - return fCommandShell; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST); - - ICommandResult result = executeCommand(command.toString(), monitor); - - // Output: - // Available tracing sessions: - // 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) - // [inactive] - // 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) - // [inactive] - // - // Use lttng list for more details - - ArrayList retArray = new ArrayList<>(); - int index = 0; - while (index < result.getOutput().length) { - String line = result.getOutput()[index]; - Matcher matcher = LTTngControlServiceConstants.SESSION_PATTERN.matcher(line); - if (matcher.matches()) { - retArray.add(matcher.group(2).trim()); - } - index++; - } - return retArray.toArray(new String[retArray.size()]); - } - - /** - * Check if there is a pattern to be ignored into a sequence of string - * - * @param input - * an arrays of string - * @param pattern - * the pattern to search for - * @return if the pattern exist into the array of string - */ - protected boolean ignoredPattern(String[] input, Pattern pattern) { - for (String line : input) { - Matcher matcher = pattern.matcher(line); - if (matcher.matches()) { - return true; - } - } - return false; - } - - @Override - public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, sessionName); - ICommandResult result = executeCommand(command.toString(), monitor); - - int index = 0; - - // Output: - // Tracing session mysession2: [inactive] - // Trace path: /home/eedbhu/lttng-traces/mysession2-20120123-110330 - ISessionInfo sessionInfo = new SessionInfo(sessionName); - - while (index < result.getOutput().length) { - // Tracing session mysession2: [inactive] - // Trace path: /home/eedbhu/lttng-traces/mysession2-20120123-110330 - // - // === Domain: Kernel === - // - String line = result.getOutput()[index]; - Matcher matcher = LTTngControlServiceConstants.TRACE_SESSION_PATTERN.matcher(line); - if (matcher.matches()) { - sessionInfo.setSessionState(matcher.group(2)); - index++; - continue; - } - - matcher = LTTngControlServiceConstants.TRACE_SNAPSHOT_SESSION_PATTERN.matcher(line); - if (matcher.matches()) { - sessionInfo.setSessionState(matcher.group(2)); - // real name will be set later - ISnapshotInfo snapshotInfo = new SnapshotInfo(""); //$NON-NLS-1$ - sessionInfo.setSnapshotInfo(snapshotInfo); - index++; - continue; - } - - if (!sessionInfo.isSnapshotSession()) { - matcher = LTTngControlServiceConstants.TRACE_NETWORK_PATH_PATTERN.matcher(line); - if (matcher.matches()) { - sessionInfo.setStreamedTrace(true); - } - - matcher = LTTngControlServiceConstants.TRACE_SESSION_PATH_PATTERN.matcher(line); - if (matcher.matches()) { - sessionInfo.setSessionPath(matcher.group(1).trim()); - index++; - continue; - } - } - - matcher = LTTngControlServiceConstants.DOMAIN_KERNEL_PATTERN.matcher(line); - if (matcher.matches()) { - // Create Domain - IDomainInfo domainInfo = new DomainInfo(Messages.TraceControl_KernelDomainDisplayName); - - // set kernel flag - domainInfo.setIsKernel(true); - - // in domain kernel - ArrayList channels = new ArrayList<>(); - index = parseDomain(result.getOutput(), index, channels, domainInfo); - - if (channels.size() > 0) { - // add domain - sessionInfo.addDomain(domainInfo); - - // set channels - domainInfo.setChannels(channels); - } - continue; - } - - matcher = LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(line); - if (matcher.matches()) { - IDomainInfo domainInfo = new DomainInfo(Messages.TraceControl_UstGlobalDomainDisplayName); - - // set kernel flag - domainInfo.setIsKernel(false); - - // in domain UST - ArrayList channels = new ArrayList<>(); - index = parseDomain(result.getOutput(), index, channels, domainInfo); - - if (channels.size() > 0) { - // add domain - sessionInfo.addDomain(domainInfo); - - // set channels - domainInfo.setChannels(channels); - } - continue; - } - index++; - } - - if (sessionInfo.isSnapshotSession()) { - ISnapshotInfo snapshot = getSnapshotInfo(sessionName, monitor); - sessionInfo.setSnapshotInfo(snapshot); - } - - return sessionInfo; - } - - @Override - public ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName); - ICommandResult result = executeCommand(command.toString(), monitor); - - int index = 0; - - // Output: - // [1] snapshot-1: /home/user/lttng-traces/my-20130909-114431 - // or - // [3] snapshot-3: net4://172.0.0.1/ - ISnapshotInfo snapshotInfo = new SnapshotInfo(""); //$NON-NLS-1$ - - while (index < result.getOutput().length) { - String line = result.getOutput()[index]; - Matcher matcher = LTTngControlServiceConstants.LIST_SNAPSHOT_OUTPUT_PATTERN.matcher(line); - if (matcher.matches()) { - snapshotInfo.setId(Integer.valueOf(matcher.group(1))); - snapshotInfo.setName(matcher.group(2)); - snapshotInfo.setSnapshotPath(matcher.group(3)); - - Matcher matcher2 = LTTngControlServiceConstants.SNAPSHOT_NETWORK_PATH_PATTERN.matcher(snapshotInfo.getSnapshotPath()); - if (matcher2.matches()) { - snapshotInfo.setStreamedSnapshot(true); - } - - index++; - break; - } - index++; - } - - return snapshotInfo; - } - - @Override - public List getKernelProvider(IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_KERNEL); - ICommandResult result = executeCommand(command.toString(), monitor, false); - - List events = new ArrayList<>(); - - if (result.getErrorOutput() != null) { - // Ignore the following 2 cases: - // Spawning a session daemon - // Error: Unable to list kernel events - // or: - // Error: Unable to list kernel events - // - if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN)) { - return events; - } - } - - if (isError(result)) { - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // Kernel events: - // ------------- - // sched_kthread_stop (type: tracepoint) - getProviderEventInfo(result.getOutput(), 0, events); - return events; - } - - @Override - public List getUstProvider() throws ExecutionException { - return getUstProvider(new NullProgressMonitor()); - } - - @Override - public List getUstProvider(IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_UST); - - if (isVersionSupported("2.1.0")) { //$NON-NLS-1$ - command.append(LTTngControlServiceConstants.OPTION_FIELDS); - } - - ICommandResult result = executeCommand(command.toString(), monitor, false); - List allProviders = new ArrayList<>(); - - // Workaround for versions 2.0.x which causes a segmentation fault for - // this command - // if LTTng Tools is compiled without UST support. - if (!isVersionSupported("2.1.0") && (result.getResult() != 0)) { //$NON-NLS-1$ - return allProviders; - } - - if (result.getErrorOutput() != null) { - // Ignore the following 2 cases: - // Spawning a session daemon - // Error: Unable to list UST events: Listing UST events failed - // or: - // Error: Unable to list UST events: Listing UST events failed - // - if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) { - return allProviders; - } - } - - if (isError(result)) { - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // Note that field print-outs exists for version >= 2.1.0 - // - // UST events: - // ------------- - // - // PID: 3635 - Name: - // /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello - // ust_tests_hello:tptest_sighandler (loglevel: TRACE_EMERG0) (type: - // tracepoint) - // ust_tests_hello:tptest (loglevel: TRACE_EMERG0) (type: tracepoint) - // field: doublefield (float) - // field: floatfield (float) - // field: stringfield (string) - // - // PID: 6459 - Name: - // /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello - // ust_tests_hello:tptest_sighandler (loglevel: TRACE_EMERG0) (type: - // tracepoint) - // ust_tests_hello:tptest (loglevel: TRACE_EMERG0) (type: tracepoint) - // field: doublefield (float) - // field: floatfield (float) - // field: stringfield (string) - - IUstProviderInfo provider = null; - - int index = 0; - while (index < result.getOutput().length) { - String line = result.getOutput()[index]; - Matcher matcher = LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line); - if (matcher.matches()) { - provider = new UstProviderInfo(matcher.group(2).trim()); - provider.setPid(Integer.valueOf(matcher.group(1).trim())); - List events = new ArrayList<>(); - index = getProviderEventInfo(result.getOutput(), ++index, events); - provider.setEvents(events); - allProviders.add(provider); - } else { - index++; - } - } - return allProviders; - } - - @Override - public ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { - if (sessionInfo.isStreamedTrace()) { - return createStreamedSession(sessionInfo, monitor); - } - - StringBuffer command = prepareSessionCreationCommand(sessionInfo); - - ICommandResult result = executeCommand(command.toString(), monitor); - - // Session myssession2 created. - // Traces will be written in - // /home/user/lttng-traces/myssession2-20120209-095418 - String[] output = result.getOutput(); - - // Get and session name and path - String name = null; - String path = null; - - int index = 0; - while (index < output.length) { - String line = output[index]; - Matcher nameMatcher = LTTngControlServiceConstants.CREATE_SESSION_NAME_PATTERN.matcher(line); - Matcher pathMatcher = LTTngControlServiceConstants.CREATE_SESSION_PATH_PATTERN.matcher(line); - if (nameMatcher.matches()) { - name = String.valueOf(nameMatcher.group(1).trim()); - } else if (pathMatcher.matches()) { - path = String.valueOf(pathMatcher.group(1).trim()); - } - index++; - } - - // Verify session name - if ((name == null) || (!"".equals(sessionInfo.getName()) && !name.equals(sessionInfo.getName()))) { //$NON-NLS-1$ - // Unexpected name returned - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ - Messages.TraceControl_UnexpectedNameError + ": " + name); //$NON-NLS-1$ - } - - sessionInfo.setName(name); - // Verify session path - if (!sessionInfo.isSnapshotSession() && - ((path == null) || ((sessionInfo.getSessionPath() != null) && (!path.contains(sessionInfo.getSessionPath()))))) { - // Unexpected path - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ - Messages.TraceControl_UnexpectedPathError + ": " + name); //$NON-NLS-1$ - } - - if (sessionInfo.isSnapshotSession()) { - // Make it a snapshot session - content of snapshot info need to - // set afterwards using getSession() or getSnapshotInfo() - sessionInfo.setSnapshotInfo(new SnapshotInfo("")); //$NON-NLS-1$ - } else { - sessionInfo.setSessionPath(path); - } - - return sessionInfo; - - } - - /** - * Basic generation of command for session creation - * - * @param sessionInfo - * the session to create - * @return the basic command for command creation - */ - protected StringBuffer prepareSessionCreationCommand(ISessionInfo sessionInfo) { - String newName = formatParameter(sessionInfo.getName()); - String newPath = formatParameter(sessionInfo.getSessionPath()); - - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION, newName); - - if (newPath != null && !"".equals(newPath)) { //$NON-NLS-1$ - command.append(LTTngControlServiceConstants.OPTION_OUTPUT_PATH); - command.append(newPath); - } - - if (sessionInfo.isSnapshotSession()) { - command.append(LTTngControlServiceConstants.OPTION_SNAPSHOT); - } - return command; - } - - private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { - - StringBuffer command = prepareStreamedSessionCreationCommand(sessionInfo); - - ICommandResult result = executeCommand(command.toString(), monitor); - - // Verify output - String[] output = result.getOutput(); - - // Get and session name and path - String name = null; - String path = null; - - int index = 0; - while (index < output.length) { - String line = output[index]; - Matcher nameMatcher = LTTngControlServiceConstants.CREATE_SESSION_NAME_PATTERN.matcher(line); - Matcher pathMatcher = LTTngControlServiceConstants.CREATE_SESSION_PATH_PATTERN.matcher(line); - - if (nameMatcher.matches()) { - name = String.valueOf(nameMatcher.group(1).trim()); - } else if (pathMatcher.matches() && (sessionInfo.getNetworkUrl() != null)) { - path = String.valueOf(pathMatcher.group(1).trim()); - } - index++; - } - - // Verify session name - if ((name == null) || (!"".equals(sessionInfo.getName()) && !name.equals(sessionInfo.getName()))) { //$NON-NLS-1$ - // Unexpected name returned - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ - Messages.TraceControl_UnexpectedNameError + ": " + name); //$NON-NLS-1$ - } - - sessionInfo.setName(name); - - sessionInfo.setStreamedTrace(true); - - // Verify session path - if (sessionInfo.getNetworkUrl() != null) { - if (!sessionInfo.isSnapshotSession() && (path == null)) { - // Unexpected path - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ - Messages.TraceControl_UnexpectedPathError + ": " + name); //$NON-NLS-1$ - } - - if (sessionInfo.isSnapshotSession()) { - sessionInfo.setStreamedTrace(false); - } else { - sessionInfo.setSessionPath(path); - // Check file protocol - Matcher matcher = LTTngControlServiceConstants.TRACE_FILE_PROTOCOL_PATTERN.matcher(path); - if (matcher.matches()) { - sessionInfo.setStreamedTrace(false); - } - } - } - - // When using controlUrl and dataUrl the full session path is not known - // yet and will be set later on when listing the session - - return sessionInfo; - } - - /** - * Basic generation of command for streamed session creation - * - * @param sessionInfo - * the session to create - * @return the basic command for command creation - */ - protected StringBuffer prepareStreamedSessionCreationCommand(ISessionInfo sessionInfo) { - String newName = formatParameter(sessionInfo.getName()); - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION, newName); - - if (sessionInfo.isSnapshotSession()) { - command.append(LTTngControlServiceConstants.OPTION_SNAPSHOT); - } else if (sessionInfo.isLive()) { - command.append(LTTngControlServiceConstants.OPTION_LIVE); - if (sessionInfo.getLiveDelay() != LTTngControlServiceConstants.UNUSED_VALUE) { - command.append(sessionInfo.getLiveDelay()); - } - } - - if (sessionInfo.getNetworkUrl() != null) { - command.append(LTTngControlServiceConstants.OPTION_NETWORK_URL); - command.append(sessionInfo.getNetworkUrl()); - } else { - command.append(LTTngControlServiceConstants.OPTION_CONTROL_URL); - command.append(sessionInfo.getControlUrl()); - - command.append(LTTngControlServiceConstants.OPTION_DATA_URL); - command.append(sessionInfo.getDataUrl()); - } - return command; - } - - @Override - public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { - String newName = formatParameter(sessionName); - - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName); - - ICommandResult result = executeCommand(command.toString(), monitor, false); - String[] errorOutput = result.getErrorOutput(); - - boolean isError = isError(result); - if (isError && (errorOutput != null)) { - if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { - isError = false; - - } - } - - if (isError) { - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // Session destroyed - } - - @Override - public void startSession(String sessionName, IProgressMonitor monitor) throws ExecutionException { - - String newSessionName = formatParameter(sessionName); - - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_START_SESSION, newSessionName); - - executeCommand(command.toString(), monitor); - - // Session started - } - - @Override - public void stopSession(String sessionName, IProgressMonitor monitor) throws ExecutionException { - String newSessionName = formatParameter(sessionName); - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_STOP_SESSION, newSessionName); - - executeCommand(command.toString(), monitor); - - // Session stopped - - } - - @Override - public void enableChannels(String sessionName, List channelNames, boolean isKernel, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException { - - // no channels to enable - if (channelNames.isEmpty()) { - return; - } - - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_CHANNEL); - - for (Iterator iterator = channelNames.iterator(); iterator.hasNext();) { - String channel = iterator.next(); - command.append(channel); - if (iterator.hasNext()) { - command.append(','); - } - } - - if (isKernel) { - command.append(LTTngControlServiceConstants.OPTION_KERNEL); - } else { - command.append(LTTngControlServiceConstants.OPTION_UST); - } - - String newSessionName = formatParameter(sessionName); - command.append(LTTngControlServiceConstants.OPTION_SESSION); - command.append(newSessionName); - - if (info != null) { - // --discard Discard event when buffers are full (default) - - // --overwrite Flight recorder mode - if (info.isOverwriteMode()) { - command.append(LTTngControlServiceConstants.OPTION_OVERWRITE); - } - // --subbuf-size SIZE Subbuffer size in bytes - // (default: 4096, kernel default: 262144) - if (info.getSubBufferSize() != LTTngControlServiceConstants.UNUSED_VALUE) { - command.append(LTTngControlServiceConstants.OPTION_SUB_BUFFER_SIZE); - command.append(String.valueOf(info.getSubBufferSize())); - } - - // --num-subbuf NUM Number of subbufers - if (info.getNumberOfSubBuffers() != LTTngControlServiceConstants.UNUSED_VALUE) { - command.append(LTTngControlServiceConstants.OPTION_NUM_SUB_BUFFERS); - command.append(String.valueOf(info.getNumberOfSubBuffers())); - } - - // --switch-timer USEC Switch timer interval in usec - if (info.getSwitchTimer() != LTTngControlServiceConstants.UNUSED_VALUE) { - command.append(LTTngControlServiceConstants.OPTION_SWITCH_TIMER); - command.append(String.valueOf(info.getSwitchTimer())); - } - - // --read-timer USEC Read timer interval in usec - if (info.getReadTimer() != LTTngControlServiceConstants.UNUSED_VALUE) { - command.append(LTTngControlServiceConstants.OPTION_READ_TIMER); - command.append(String.valueOf(info.getReadTimer())); - } - - if (isVersionSupported("2.2.0")) { //$NON-NLS-1$ - // --buffers-uid Every application sharing the same UID use the - // same buffers --buffers-pid Buffers are allocated per PID - if (!isKernel) { - if (info.getBufferType() == BufferType.BUFFER_PER_PID) { - command.append(LTTngControlServiceConstants.OPTION_PER_PID_BUFFERS); - - } else if (info.getBufferType() == BufferType.BUFFER_PER_UID) { - command.append(LTTngControlServiceConstants.OPTION_PER_UID_BUFFERS); - } - } - - // -C SIZE Maximum size of trace files in bytes - if (info.getMaxSizeTraceFiles() != LTTngControlServiceConstants.UNUSED_VALUE) { - command.append(LTTngControlServiceConstants.OPTION_MAX_SIZE_TRACE_FILES); - command.append(String.valueOf(info.getMaxSizeTraceFiles())); - } - - // -W NUM Maximum number of trace files - if (info.getMaxNumberTraceFiles() != LTTngControlServiceConstants.UNUSED_VALUE) { - command.append(LTTngControlServiceConstants.OPTION_MAX_TRACE_FILES); - command.append(String.valueOf(info.getMaxNumberTraceFiles())); - } - } - } - - executeCommand(command.toString(), monitor); - - } - - @Override - public void disableChannels(String sessionName, List channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException { - - // no channels to enable - if (channelNames.isEmpty()) { - return; - } - - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_CHANNEL); - - for (Iterator iterator = channelNames.iterator(); iterator.hasNext();) { - String channel = iterator.next(); - command.append(channel); - if (iterator.hasNext()) { - command.append(','); - } - } - - if (isKernel) { - command.append(LTTngControlServiceConstants.OPTION_KERNEL); - } else { - command.append(LTTngControlServiceConstants.OPTION_UST); - } - - String newSessionName = formatParameter(sessionName); - command.append(LTTngControlServiceConstants.OPTION_SESSION); - command.append(newSessionName); - - executeCommand(command.toString(), monitor); - } - - @Override - public void enableEvents(String sessionName, String channelName, List eventNames, boolean isKernel, String filterExpression, IProgressMonitor monitor) throws ExecutionException { - - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT); - - if (eventNames == null || eventNames.isEmpty()) { - command.append(LTTngControlServiceConstants.OPTION_ALL); - } else { - - StringBuffer eventNameParameter = new StringBuffer(); - for (Iterator iterator = eventNames.iterator(); iterator.hasNext();) { - String event = iterator.next(); - eventNameParameter.append(event); - if (iterator.hasNext()) { - eventNameParameter.append(','); - } - } - command.append(formatParameter(eventNameParameter.toString())); - } - - if (isKernel) { - command.append(LTTngControlServiceConstants.OPTION_KERNEL); - } else { - command.append(LTTngControlServiceConstants.OPTION_UST); - } - - String newSessionName = formatParameter(sessionName); - - command.append(LTTngControlServiceConstants.OPTION_SESSION); - command.append(newSessionName); - - if (channelName != null) { - command.append(LTTngControlServiceConstants.OPTION_CHANNEL); - command.append(channelName); - } - - command.append(LTTngControlServiceConstants.OPTION_TRACEPOINT); - - if (filterExpression != null) { - command.append(LTTngControlServiceConstants.OPTION_FILTER); - command.append('\''); - command.append(filterExpression); - command.append('\''); - } - - executeCommand(command.toString(), monitor); - - } - - @Override - public void enableSyscalls(String sessionName, String channelName, IProgressMonitor monitor) throws ExecutionException { - - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT); - - command.append(LTTngControlServiceConstants.OPTION_ALL); - command.append(LTTngControlServiceConstants.OPTION_KERNEL); - - String newSessionName = formatParameter(sessionName); - - command.append(LTTngControlServiceConstants.OPTION_SESSION); - command.append(newSessionName); - - if (channelName != null) { - command.append(LTTngControlServiceConstants.OPTION_CHANNEL); - command.append(channelName); - } - - command.append(LTTngControlServiceConstants.OPTION_SYSCALL); - - executeCommand(command.toString(), monitor); - } - - @Override - public void enableProbe(String sessionName, String channelName, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT); - - command.append(eventName); - command.append(LTTngControlServiceConstants.OPTION_KERNEL); - - String newSessionName = formatParameter(sessionName); - command.append(LTTngControlServiceConstants.OPTION_SESSION); - command.append(newSessionName); - - if (channelName != null) { - command.append(LTTngControlServiceConstants.OPTION_CHANNEL); - command.append(channelName); - } - if (isFunction) { - command.append(LTTngControlServiceConstants.OPTION_FUNCTION_PROBE); - } else { - command.append(LTTngControlServiceConstants.OPTION_PROBE); - } - - command.append(probe); - - executeCommand(command.toString(), monitor); - } - - @Override - public void enableLogLevel(String sessionName, String channelName, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExpression, IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT); - - command.append(eventName); - command.append(LTTngControlServiceConstants.OPTION_UST); - - String newSessionName = formatParameter(sessionName); - command.append(LTTngControlServiceConstants.OPTION_SESSION); - command.append(newSessionName); - - if (channelName != null) { - command.append(LTTngControlServiceConstants.OPTION_CHANNEL); - command.append(channelName); - } - - if (logLevelType == LogLevelType.LOGLEVEL) { - command.append(LTTngControlServiceConstants.OPTION_LOGLEVEL); - } else if (logLevelType == LogLevelType.LOGLEVEL_ONLY) { - command.append(LTTngControlServiceConstants.OPTION_LOGLEVEL_ONLY); - - } else { - return; - } - command.append(level.getInName()); - - executeCommand(command.toString(), monitor); - } - - @Override - public void disableEvent(String sessionName, String channelName, List eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_EVENT); - - if (eventNames == null) { - command.append(LTTngControlServiceConstants.OPTION_ALL); - } else { - // no events to disable - if (eventNames.isEmpty()) { - return; - } - - StringBuffer eventNameParameter = new StringBuffer(); - for (Iterator iterator = eventNames.iterator(); iterator.hasNext();) { - String event = iterator.next(); - eventNameParameter.append(event); - if (iterator.hasNext()) { - eventNameParameter.append(','); - } - } - command.append(formatParameter(eventNameParameter.toString())); - } - - if (isKernel) { - command.append(LTTngControlServiceConstants.OPTION_KERNEL); - } else { - command.append(LTTngControlServiceConstants.OPTION_UST); - } - - String newSessionName = formatParameter(sessionName); - command.append(LTTngControlServiceConstants.OPTION_SESSION); - command.append(newSessionName); - - if (channelName != null) { - command.append(LTTngControlServiceConstants.OPTION_CHANNEL); - command.append(channelName); - } - - executeCommand(command.toString(), monitor); - } - - @Override - public List getContextList(IProgressMonitor monitor) throws ExecutionException { - - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT, LTTngControlServiceConstants.OPTION_HELP); - - ICommandResult result = executeCommand(command.toString(), monitor); - - String[] output = result.getOutput(); - - List contexts = new ArrayList<>(0); - - int index = 0; - boolean inList = false; - while (index < output.length) { - String line = result.getOutput()[index]; - - Matcher startMatcher = LTTngControlServiceConstants.ADD_CONTEXT_HELP_CONTEXTS_INTRO.matcher(line); - Matcher endMatcher = LTTngControlServiceConstants.ADD_CONTEXT_HELP_CONTEXTS_END_LINE.matcher(line); - - if (startMatcher.matches()) { - inList = true; - } else if (endMatcher.matches()) { - break; - } else if (inList == true) { - String[] tmp = line.split(","); //$NON-NLS-1$ - for (int i = 0; i < tmp.length; i++) { - contexts.add(tmp[i].trim()); - } - } - index++; - } - return contexts; - } - - @Override - public void addContexts(String sessionName, String channelName, String eventName, boolean isKernel, List contextNames, IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT); - - String newSessionName = formatParameter(sessionName); - command.append(LTTngControlServiceConstants.OPTION_SESSION); - command.append(newSessionName); - - if (channelName != null) { - command.append(LTTngControlServiceConstants.OPTION_CHANNEL); - command.append(channelName); - } - - if (eventName != null) { - command.append(LTTngControlServiceConstants.OPTION_EVENT); - command.append(eventName); - } - - if (isKernel) { - command.append(LTTngControlServiceConstants.OPTION_KERNEL); - } else { - command.append(LTTngControlServiceConstants.OPTION_UST); - } - - for (Iterator iterator = contextNames.iterator(); iterator.hasNext();) { - String context = iterator.next(); - command.append(LTTngControlServiceConstants.OPTION_CONTEXT_TYPE); - command.append(context); - } - - executeCommand(command.toString(), monitor); - - } - - @Override - public void calibrate(boolean isKernel, IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CALIBRATE); - - if (isKernel) { - command.append(LTTngControlServiceConstants.OPTION_KERNEL); - } else { - command.append(LTTngControlServiceConstants.OPTION_UST); - } - - command.append(LTTngControlServiceConstants.OPTION_FUNCTION_PROBE); - - executeCommand(command.toString(), monitor); - } - - @Override - public void recordSnapshot(String sessionName, IProgressMonitor monitor) - throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_RECORD_SNAPSHOT); - - String newSessionName = formatParameter(sessionName); - command.append(LTTngControlServiceConstants.OPTION_SESSION); - command.append(newSessionName); - - executeCommand(command.toString(), monitor); - } - - @Override - public void runCommands(IProgressMonitor monitor, List commands) throws ExecutionException { - for (String command : commands) { - if (monitor.isCanceled()) { - return; - } - - if (command.isEmpty() || command.startsWith("#")) { //$NON-NLS-1$ - continue; - } - executeCommand(command, monitor); - } - } - - // ------------------------------------------------------------------------ - // Helper methods - // ------------------------------------------------------------------------ - - /** - * Checks if command result is an error result. - * - * @param result - * - the command result to check - * @return true if error else false - */ - protected boolean isError(ICommandResult result) { - // Check return code and length of returned strings - - if ((result.getResult()) != 0) { - return true; - } - - // Look for error pattern - int index = 0; - while (index < result.getErrorOutput().length) { - String line = result.getErrorOutput()[index]; - Matcher matcher = LTTngControlServiceConstants.ERROR_PATTERN.matcher(line); - if (matcher.matches()) { - return true; - } - index++; - } - - return false; - } - - /** - * Formats the output string as single string. - * - * @param result - * - output array - * @return - the formatted output - */ - public static String formatOutput(ICommandResult result) { - if ((result == null) || ((result.getOutput() == null || result.getOutput().length == 0) && (result.getErrorOutput() == null || result.getErrorOutput().length == 0))) { - return ""; //$NON-NLS-1$ - } - String[] output = result.getOutput(); - String[] errorOutput = result.getErrorOutput(); - StringBuffer ret = new StringBuffer(); - ret.append("Error Ouptut:\n"); //$NON-NLS-1$ - for (int i = 0; i < errorOutput.length; i++) { - ret.append(errorOutput[i]).append("\n"); //$NON-NLS-1$ - } - ret.append("Return Value: "); //$NON-NLS-1$ - ret.append(result.getResult()); - ret.append("\n"); //$NON-NLS-1$ - for (int i = 0; i < output.length; i++) { - ret.append(output[i]).append("\n"); //$NON-NLS-1$ - } - return ret.toString(); - } - - /** - * Parses the domain information. - * - * @param output - * - a command output array - * @param currentIndex - * - current index in command output array - * @param channels - * - list for returning channel information - * @param domainInfo - * - The domain information - * @return the new current index in command output array - */ - protected int parseDomain(String[] output, int currentIndex, List channels, IDomainInfo domainInfo) { - int index = currentIndex; - - // if kernel set the buffer type to shared - if (domainInfo.isKernel()) { - domainInfo.setBufferType(BufferType.BUFFER_SHARED); - } - - // Channels: - // ------------- - // - channnel1: [enabled] - // - // Attributes: - // overwrite mode: 0 - // subbufers size: 262144 - // number of subbufers: 4 - // switch timer interval: 0 - // read timer interval: 200 - // output: splice() - - while (index < output.length) { - String line = output[index]; - - if (isVersionSupported("2.2.0")) { //$NON-NLS-1$ - Matcher bufferTypeMatcher = LTTngControlServiceConstants.BUFFER_TYPE_PATTERN.matcher(line); - if (bufferTypeMatcher.matches()) { - String bufferTypeString = getAttributeValue(line); - if (BufferType.BUFFER_PER_PID.getInName().equals(bufferTypeString)) { - domainInfo.setBufferType(BufferType.BUFFER_PER_PID); - } else if (BufferType.BUFFER_PER_UID.getInName().equals(bufferTypeString)) { - domainInfo.setBufferType(BufferType.BUFFER_PER_UID); - } else { - domainInfo.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN); - } - } - } else { - domainInfo.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN); - } - Matcher outerMatcher = LTTngControlServiceConstants.CHANNELS_SECTION_PATTERN.matcher(line); - Matcher noKernelChannelMatcher = LTTngControlServiceConstants.DOMAIN_NO_KERNEL_CHANNEL_PATTERN.matcher(line); - Matcher noUstChannelMatcher = LTTngControlServiceConstants.DOMAIN_NO_UST_CHANNEL_PATTERN.matcher(line); - if (outerMatcher.matches()) { - IChannelInfo channelInfo = null; - while (index < output.length) { - String subLine = output[index]; - - Matcher innerMatcher = LTTngControlServiceConstants.CHANNEL_PATTERN.matcher(subLine); - if (innerMatcher.matches()) { - channelInfo = new ChannelInfo(""); //$NON-NLS-1$ - // get channel name - channelInfo.setName(innerMatcher.group(1)); - - // get channel enablement - channelInfo.setState(innerMatcher.group(2)); - - // set BufferType - channelInfo.setBufferType(domainInfo.getBufferType()); - - // add channel - channels.add(channelInfo); - - } else if (LTTngControlServiceConstants.OVERWRITE_MODE_ATTRIBUTE.matcher(subLine).matches()) { - String value = getAttributeValue(subLine); - if (channelInfo != null) { - channelInfo.setOverwriteMode(!LTTngControlServiceConstants.OVERWRITE_MODE_ATTRIBUTE_FALSE.equals(value)); - } - } else if (LTTngControlServiceConstants.SUBBUFFER_SIZE_ATTRIBUTE.matcher(subLine).matches()) { - if (channelInfo != null) { - channelInfo.setSubBufferSize(Long.valueOf(getAttributeValue(subLine))); - } - - } else if (LTTngControlServiceConstants.NUM_SUBBUFFERS_ATTRIBUTE.matcher(subLine).matches()) { - if (channelInfo != null) { - channelInfo.setNumberOfSubBuffers(Integer.valueOf(getAttributeValue(subLine))); - } - - } else if (LTTngControlServiceConstants.SWITCH_TIMER_ATTRIBUTE.matcher(subLine).matches()) { - if (channelInfo != null) { - channelInfo.setSwitchTimer(Long.valueOf(getAttributeValue(subLine))); - } - - } else if (LTTngControlServiceConstants.READ_TIMER_ATTRIBUTE.matcher(subLine).matches()) { - if (channelInfo != null) { - channelInfo.setReadTimer(Long.valueOf(getAttributeValue(subLine))); - } - - } else if (LTTngControlServiceConstants.OUTPUT_ATTRIBUTE.matcher(subLine).matches()) { - if (channelInfo != null) { - channelInfo.setOutputType(getAttributeValue(subLine)); - } - - } else if (LTTngControlServiceConstants.EVENT_SECTION_PATTERN.matcher(subLine).matches()) { - List events = new ArrayList<>(); - index = parseEvents(output, index, events); - if (channelInfo != null) { - channelInfo.setEvents(events); - } - // we want to stay at the current index to be able to - // exit the domain - continue; - } else if (LTTngControlServiceConstants.DOMAIN_KERNEL_PATTERN.matcher(subLine).matches()) { - return index; - - } else if (LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(subLine).matches()) { - return index; - } - index++; - } - } else if (noKernelChannelMatcher.matches() || noUstChannelMatcher.matches()) { - // domain indicates that no channels were found -> return - index++; - return index; - } - index++; - } - return index; - } - - /** - * Parses the event information within a domain. - * - * @param output - * - a command output array - * @param currentIndex - * - current index in command output array - * @param events - * - list for returning event information - * @return the new current index in command output array - */ - protected int parseEvents(String[] output, int currentIndex, List events) { - int index = currentIndex; - - while (index < output.length) { - String line = output[index]; - if (LTTngControlServiceConstants.CHANNEL_PATTERN.matcher(line).matches()) { - // end of channel - return index; - } else if (LTTngControlServiceConstants.DOMAIN_KERNEL_PATTERN.matcher(line).matches()) { - // end of domain - return index; - } else if (LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(line).matches()) { - // end of domain - return index; - } - - Matcher matcher = LTTngControlServiceConstants.EVENT_PATTERN.matcher(line); - Matcher matcher2 = LTTngControlServiceConstants.WILDCARD_EVENT_PATTERN.matcher(line); - - if (matcher.matches()) { - IEventInfo eventInfo = new EventInfo(matcher.group(1).trim()); - eventInfo.setLogLevelType(matcher.group(2).trim()); - eventInfo.setLogLevel(matcher.group(3).trim()); - eventInfo.setEventType(matcher.group(4).trim()); - eventInfo.setState(matcher.group(5)); - String filter = matcher.group(6); - if (filter != null) { - // remove '[' and ']' - filter = filter.substring(1, filter.length() - 1); - eventInfo.setFilterExpression(filter); - } - events.add(eventInfo); - index++; - } else if (matcher2.matches()) { - IEventInfo eventInfo = new EventInfo(matcher2.group(1).trim()); - eventInfo.setLogLevel(TraceLogLevel.LEVEL_UNKNOWN); - eventInfo.setEventType(matcher2.group(2).trim()); - eventInfo.setState(matcher2.group(3)); - String filter = matcher2.group(4); - if (filter != null) { - // remove '[' and ']' - filter = filter.substring(1, filter.length() - 1); - eventInfo.setFilterExpression(filter); - } - - if ((eventInfo.getEventType() == TraceEventType.PROBE) || - (eventInfo.getEventType() == TraceEventType.FUNCTION)) { - IProbeEventInfo probeEvent = new ProbeEventInfo(eventInfo.getName()); - probeEvent.setLogLevel(eventInfo.getLogLevel()); - probeEvent.setEventType(eventInfo.getEventType()); - probeEvent.setState(eventInfo.getState()); - - // Overwrite eventinfo - eventInfo = probeEvent; - - // myevent2 (type: probe) [enabled] - // addr: 0xc0101340 - // myevent0 (type: function) [enabled] - // offset: 0x0 - // symbol: init_post - index++; - while (index < output.length) { - String probeLine = output[index]; - // parse probe - Matcher addrMatcher = LTTngControlServiceConstants.PROBE_ADDRESS_PATTERN.matcher(probeLine); - Matcher offsetMatcher = LTTngControlServiceConstants.PROBE_OFFSET_PATTERN.matcher(probeLine); - Matcher symbolMatcher = LTTngControlServiceConstants.PROBE_SYMBOL_PATTERN.matcher(probeLine); - if (addrMatcher.matches()) { - String addr = addrMatcher.group(2).trim(); - probeEvent.setAddress(addr); - } else if (offsetMatcher.matches()) { - String offset = offsetMatcher.group(2).trim(); - probeEvent.setOffset(offset); - } else if (symbolMatcher.matches()) { - String symbol = symbolMatcher.group(2).trim(); - probeEvent.setSymbol(symbol); - } else if ((LTTngControlServiceConstants.EVENT_PATTERN.matcher(probeLine).matches()) || (LTTngControlServiceConstants.WILDCARD_EVENT_PATTERN.matcher(probeLine).matches())) { - break; - } else if (LTTngControlServiceConstants.CHANNEL_PATTERN.matcher(probeLine).matches()) { - break; - } else if (LTTngControlServiceConstants.DOMAIN_KERNEL_PATTERN.matcher(probeLine).matches()) { - // end of domain - break; - } else if (LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(probeLine).matches()) { - // end of domain - break; - } - index++; - } - events.add(eventInfo); - } else { - events.add(eventInfo); - index++; - continue; - } - } else { - index++; - } - } - - return index; - } - - /** - * Parses a line with attributes: : - * - * @param line - * - attribute line to parse - * @return the attribute value as string - */ - protected String getAttributeValue(String line) { - String[] temp = line.split("\\: "); //$NON-NLS-1$ - return temp[1]; - } - - /** - * Parses the event information within a provider. - * - * @param output - * - a command output array - * @param currentIndex - * - current index in command output array - * @param events - * - list for returning event information - * @return the new current index in command output array - */ - protected int getProviderEventInfo(String[] output, int currentIndex, List events) { - int index = currentIndex; - IBaseEventInfo eventInfo = null; - while (index < output.length) { - String line = output[index]; - Matcher matcher = LTTngControlServiceConstants.PROVIDER_EVENT_PATTERN.matcher(line); - if (matcher.matches()) { - // sched_kthread_stop (loglevel: TRACE_EMERG0) (type: - // tracepoint) - eventInfo = new BaseEventInfo(matcher.group(1).trim()); - eventInfo.setLogLevel(matcher.group(2).trim()); - eventInfo.setEventType(matcher.group(3).trim()); - events.add(eventInfo); - index++; - } else if (LTTngControlServiceConstants.EVENT_FIELD_PATTERN.matcher(line).matches()) { - if (eventInfo != null) { - List fields = new ArrayList<>(); - index = getFieldInfo(output, index, fields); - eventInfo.setFields(fields); - } else { - index++; - } - } - else if (LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line).matches()) { - return index; - } else { - index++; - } - } - return index; - } - - /** - * Parse a field's information. - * - * @param output - * A command output array - * @param currentIndex - * The current index in the command output array - * @param fields - * List for returning the field information - * @return The new current index in the command output array - */ - protected int getFieldInfo(String[] output, int currentIndex, List fields) { - int index = currentIndex; - IFieldInfo fieldInfo = null; - while (index < output.length) { - String line = output[index]; - Matcher matcher = LTTngControlServiceConstants.EVENT_FIELD_PATTERN.matcher(line); - if (matcher.matches()) { - // field: content (string) - fieldInfo = new FieldInfo(matcher.group(2).trim()); - fieldInfo.setFieldType(matcher.group(3).trim()); - fields.add(fieldInfo); - } else if (LTTngControlServiceConstants.PROVIDER_EVENT_PATTERN.matcher(line).matches()) { - return index; - } else if (LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line).matches()) { - return index; - } - index++; - } - return index; - } - - /** - * Formats a command parameter for the command execution i.e. adds quotes at - * the beginning and end if necessary. - * - * @param parameter - * - parameter to format - * @return formated parameter - */ - protected String formatParameter(String parameter) { - if (parameter != null) { - StringBuffer newString = new StringBuffer(); - newString.append(parameter); - - if (parameter.contains(" ") || parameter.contains("*")) { //$NON-NLS-1$ //$NON-NLS-2$ - newString.insert(0, "\""); //$NON-NLS-1$ - newString.append("\""); //$NON-NLS-1$ - } - return newString.toString(); - } - return null; - } - - /** - * @param strings - * array of string that makes up a command line - * @return string buffer with created command line - */ - protected StringBuffer createCommand(String... strings) { - StringBuffer command = new StringBuffer(); - command.append(LTTngControlServiceConstants.CONTROL_COMMAND); - command.append(getTracingGroupOption()); - command.append(getVerboseOption()); - for (String string : strings) { - command.append(string); - } - return command; - } - - /** - * @return the tracing group option if configured in the preferences - */ - protected String getTracingGroupOption() { - if (!ControlPreferences.getInstance().isDefaultTracingGroup() && !ControlPreferences.getInstance().getTracingGroup().equals("")) { //$NON-NLS-1$ - return LTTngControlServiceConstants.OPTION_TRACING_GROUP + ControlPreferences.getInstance().getTracingGroup(); - } - return ""; //$NON-NLS-1$ - } - - /** - * @return the verbose option as configured in the preferences - */ - protected String getVerboseOption() { - if (ControlPreferences.getInstance().isLoggingEnabled()) { - String level = ControlPreferences.getInstance().getVerboseLevel(); - if (ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE.equals(level)) { - return LTTngControlServiceConstants.OPTION_VERBOSE; - } - if (ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE.equals(level)) { - return LTTngControlServiceConstants.OPTION_VERY_VERBOSE; - } - if (ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE.equals(level)) { - return LTTngControlServiceConstants.OPTION_VERY_VERY_VERBOSE; - } - } - return ""; //$NON-NLS-1$ - } - - /** - * Method that logs the command and command result if logging is enabled as - * well as forwards the command execution to the shell. - * - * @param command - * - the command to execute - * @param monitor - * - a progress monitor - * @return the command result - * @throws ExecutionException - * If the command fails - */ - protected ICommandResult executeCommand(String command, - IProgressMonitor monitor) throws ExecutionException { - return executeCommand(command, monitor, true); - } - - /** - * Method that logs the command and command result if logging is enabled as - * well as forwards the command execution to the shell. - * - * @param command - * - the command to execute - * @param monitor - * - a progress monitor - * @param checkForError - * - true to verify command result, else false - * @return the command result - * @throws ExecutionException - * in case of error result - */ - protected ICommandResult executeCommand(String command, - IProgressMonitor monitor, boolean checkForError) - throws ExecutionException { - if (ControlPreferences.getInstance().isLoggingEnabled()) { - ControlCommandLogger.log(command); - } - - ICommandResult result = fCommandShell.executeCommand( - command.toString(), monitor); - - if (ControlPreferences.getInstance().isLoggingEnabled()) { - ControlCommandLogger.log(formatOutput(result)); - } - - if (checkForError && isError(result)) { - throw new ExecutionException(Messages.TraceControl_CommandError - + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ - } - - return result; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java deleted file mode 100644 index bd5856e92d..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java +++ /dev/null @@ -1,456 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Simon Delisle - Updated for support of LTTng Tools 2.2 - * Marc-Andre Laperle - Support for creating a live session - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; - -import java.util.regex.Pattern; - -/** - *

- * Constants for LTTng Control Service. - *

- * - * @author Bernd Hufmann - */ -public interface LTTngControlServiceConstants { - - // ------------------------------------------------------------------------ - // Version constants - // ------------------------------------------------------------------------ - /** - * Pattern to match the LTTng toolchain version 2.x.y. - */ - static final Pattern VERSION_2_PATTERN = Pattern.compile("(2\\.\\d+\\.\\d+).*"); //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Unused value - */ - static final int UNUSED_VALUE = -1; - /** - * String representation of numerical true element - */ - static final String TRUE_NUMERICAL = "1"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // LTTng Machine Interface constants - // ------------------------------------------------------------------------ - - /** - * Name of the XSD to validate against the xml machine interface - * output from LTTng - */ - static final String MI_XSD_FILENAME = "mi_lttng.xsd"; //$NON-NLS-1$ - // ------------------------------------------------------------------------ - // Command constants - // ------------------------------------------------------------------------ - /** - * The lttng tools command. - */ - static final String CONTROL_COMMAND = "lttng"; //$NON-NLS-1$ - /** - * The lttng tools machine interface command. - */ - static final String CONTROL_COMMAND_MI = CONTROL_COMMAND + " --mi"; //$NON-NLS-1$ - /** - * The lttng tools XML machine interface command. - */ - static final String CONTROL_COMMAND_MI_XML = CONTROL_COMMAND_MI + " xml"; //$NON-NLS-1$ - /** - * Command: lttng version. - */ - static final String COMMAND_VERSION = " version "; //$NON-NLS-1$ - /** - * Command: lttng list. - */ - static final String COMMAND_LIST = " list "; //$NON-NLS-1$ - /** - * Command to list kernel tracer information. - */ - static final String COMMAND_LIST_KERNEL = COMMAND_LIST + "-k"; //$NON-NLS-1$ - /** - * Command to list user space trace information. - */ - static final String COMMAND_LIST_UST = COMMAND_LIST + "-u"; //$NON-NLS-1$ - /** - * Command to create a session. - */ - static final String COMMAND_CREATE_SESSION = " create "; //$NON-NLS-1$ - /** - * Command to destroy a session. - */ - static final String COMMAND_DESTROY_SESSION = " destroy "; //$NON-NLS-1$ - /** - * Command to destroy a session. - */ - static final String COMMAND_START_SESSION = " start "; //$NON-NLS-1$ - /** - * Command to destroy a session. - */ - static final String COMMAND_STOP_SESSION = " stop "; //$NON-NLS-1$ - /** - * Command to enable a channel. - */ - static final String COMMAND_ENABLE_CHANNEL = " enable-channel "; //$NON-NLS-1$ - /** - * Command to disable a channel. - */ - static final String COMMAND_DISABLE_CHANNEL = " disable-channel "; //$NON-NLS-1$ - /** - * Command to enable a event. - */ - static final String COMMAND_ENABLE_EVENT = " enable-event "; //$NON-NLS-1$ - /** - * Command to disable a event. - */ - static final String COMMAND_DISABLE_EVENT = " disable-event "; //$NON-NLS-1$ - /** - * Command to add a context to channels and/or events - */ - static final String COMMAND_ADD_CONTEXT = " add-context "; //$NON-NLS-1$ - /** - * Command to execute calibrate command to quantify LTTng overhead - */ - static final String COMMAND_CALIBRATE = " calibrate "; //$NON-NLS-1$ - /** - * Command to execute calibrate command to quantify LTTng overhead - */ - static final String COMMAND_LIST_SNAPSHOT_OUTPUT = " snapshot list-output "; //$NON-NLS-1$ - /** - * Command to execute calibrate command to quantify LTTng overhead - */ - static final String COMMAND_RECORD_SNAPSHOT = " snapshot record "; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Command line options constants - // ------------------------------------------------------------------------ - /** - * Command line option to add tracing group of user. - */ - static final String OPTION_TRACING_GROUP = " -g "; //$NON-NLS-1$ - /** - * Command line option for verbose output. - */ - static final String OPTION_VERBOSE = " -v "; //$NON-NLS-1$ - /** - * Command line option for verbose output. - */ - static final String OPTION_VERY_VERBOSE = " -vv "; //$NON-NLS-1$ - /** - * Command line option for verbose output. - */ - static final String OPTION_VERY_VERY_VERBOSE = " -vvv "; //$NON-NLS-1$ - /** - * Command line option for output path. - */ - static final String OPTION_OUTPUT_PATH = " -o "; //$NON-NLS-1$ - /** - * Command line option for output path. - */ - static final String OPTION_SNAPSHOT = " --snapshot "; //$NON-NLS-1$ - /** - * Command line option for live - */ - static final String OPTION_LIVE = " --live "; //$NON-NLS-1$ - /** - * Command line option for kernel tracer. - */ - static final String OPTION_KERNEL = " -k "; //$NON-NLS-1$ - /** - * Command line option for UST tracer. - */ - static final String OPTION_UST = " -u "; //$NON-NLS-1$ - /** - * Command line option for specifying a session. - */ - static final String OPTION_SESSION = " -s "; //$NON-NLS-1$ - /** - * Command line option for specifying a channel. - */ - static final String OPTION_CHANNEL = " -c "; //$NON-NLS-1$ - /** - * Command line option for specifying a event. - */ - static final String OPTION_EVENT = " -e "; //$NON-NLS-1$ - /** - * Command line option for specifying all events. - */ - static final String OPTION_ALL = " -a "; //$NON-NLS-1$ - /** - * Command line option for specifying a context. - */ - static final String OPTION_CONTEXT_TYPE = " -t "; //$NON-NLS-1$ - /** - * Command line option for specifying tracepoint events. - */ - static final String OPTION_TRACEPOINT = " --tracepoint "; //$NON-NLS-1$ - /** - * Command line option for specifying syscall events. - */ - static final String OPTION_SYSCALL = " --syscall "; //$NON-NLS-1$ - /** - * Command line option for specifying a dynamic probe. - */ - static final String OPTION_PROBE = " --probe "; //$NON-NLS-1$ - /** - * Command line option for specifying a dynamic function entry/return probe. - */ - static final String OPTION_FUNCTION_PROBE = " --function "; //$NON-NLS-1$ - /** - * Command line option for specifying a log level range. - */ - static final String OPTION_LOGLEVEL = " --loglevel "; //$NON-NLS-1$ - /** - * Command line option for specifying a specific log level. - */ - static final String OPTION_LOGLEVEL_ONLY = " --loglevel-only "; //$NON-NLS-1$ - /** - * Optional command line option for configuring a channel's overwrite mode. - */ - static final String OPTION_OVERWRITE = " --overwrite "; //$NON-NLS-1$ - /** - * Optional command line option for configuring a channel's number of sub buffers. - */ - static final String OPTION_NUM_SUB_BUFFERS = " --num-subbuf "; //$NON-NLS-1$ - /** - * Optional command line option for configuring a channel's sub buffer size. - */ - static final String OPTION_SUB_BUFFER_SIZE = " --subbuf-size "; //$NON-NLS-1$ - /** - * Optional command line option for configuring a channel's switch timer interval. - */ - static final String OPTION_SWITCH_TIMER = " --switch-timer "; //$NON-NLS-1$ - /** - * Optional command line option for configuring a channel's read timer interval. - */ - static final String OPTION_READ_TIMER = " --read-timer "; //$NON-NLS-1$ - /** - * Command line option for printing the help of a specif command - */ - static final String OPTION_HELP = " -h "; //$NON-NLS-1$ - /** - * Command line option for listing the fields of UST tracepoints - */ - static final String OPTION_FIELDS = " -f "; //$NON-NLS-1$ - /** - * Command line option for configuring event's filter - */ - static final String OPTION_FILTER = " --filter "; //$NON-NLS-1$ - /** - * Command line option for configuring the streaming network URL (common for control and data channel). - */ - static final String OPTION_NETWORK_URL = " -U "; //$NON-NLS-1$ - /** - * Command line option for configuring the streaming control URL. - */ - static final String OPTION_CONTROL_URL = " -C "; //$NON-NLS-1$ - /** - * Command line option for configuring the streaming data URL. - */ - static final String OPTION_DATA_URL = " -D "; //$NON-NLS-1$ - /** - * Command line option for per UID buffers - */ - static final String OPTION_PER_UID_BUFFERS = " --buffers-uid "; //$NON-NLS-1$ - /** - * Command line option for per PID buffers - */ - static final String OPTION_PER_PID_BUFFERS = " --buffers-pid "; //$NON-NLS-1$ - /** - * Command line option for maximum size of trace files - */ - static final String OPTION_MAX_SIZE_TRACE_FILES = " -C "; //$NON-NLS-1$ - /** - * Command line option for maximum trace files - */ - static final String OPTION_MAX_TRACE_FILES = " -W "; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Parsing constants - // ------------------------------------------------------------------------ - /** - * Pattern to match the version. - */ - static final Pattern VERSION_PATTERN = Pattern.compile(".*lttng\\s+version\\s+(\\d+\\.\\d+\\.\\d+).*"); //$NON-NLS-1$ - /** - * Pattern to match for error output - */ - static final Pattern ERROR_PATTERN = Pattern.compile("\\s*Error\\:.*"); //$NON-NLS-1$ - /** - * Pattern to match for session information (lttng list) - */ - static final Pattern SESSION_PATTERN = Pattern.compile("\\s+(\\d+)\\)\\s+(.*)\\s+\\((.*)\\)\\s+\\[(active|inactive).*\\].*"); //$NON-NLS-1$ - /** - * Pattern to match for session information (lttng list ) - */ - static final Pattern TRACE_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\].*"); //$NON-NLS-1$ - /** - * Pattern to match for snapshot session information (lttng list ) - */ - static final Pattern TRACE_SNAPSHOT_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\s*snapshot\\].*"); //$NON-NLS-1$ - /** - * Pattern to match for session path information (lttng list ) - */ - static final Pattern TRACE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(.*)"); //$NON-NLS-1$ - /** - * Pattern to match session path for network tracing (lttng list ) - * Note: file for protocol is not considered as network trace since local consumer will be used. - */ - static final Pattern TRACE_NETWORK_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$ - /** - * Pattern to match session path for network tracing - * Note: file for protocol is not considered as network trace since local consumer will be used. - */ - static final Pattern TRACE_NETWORK_PATTERN = Pattern.compile("\\s*(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$ - /** - * Sub-pattern to pattern TRACE_NETWORK_PATH_PATTERN to match file protocol - */ - static final Pattern TRACE_FILE_PROTOCOL_PATTERN = Pattern.compile("(file)\\:\\/\\/(.*)"); //$NON-NLS-1$ - /** - * Pattern to match for kernel domain information (lttng list ) - */ - static final Pattern DOMAIN_KERNEL_PATTERN = Pattern.compile("=== Domain: Kernel ==="); //$NON-NLS-1$ - /** - * Pattern to match for ust domain information (lttng list ) - */ - static final Pattern DOMAIN_UST_GLOBAL_PATTERN = Pattern.compile("=== Domain: UST global ==="); //$NON-NLS-1$ - /** - * Pattern to match for matching warning about no kernel channel - */ - static final Pattern DOMAIN_NO_KERNEL_CHANNEL_PATTERN = Pattern.compile("\\s*Warning\\:\\s+No kernel\\s+channel.*"); //$NON-NLS-1$ - /** - * Pattern to match for matching warning about no UST channel - */ - static final Pattern DOMAIN_NO_UST_CHANNEL_PATTERN = Pattern.compile("\\s*Error\\:\\s+UST\\s+channel\\s+not\\s+found.*"); //$NON-NLS-1$ - /** - * Pattern to match for buffer type (lttng list ) - */ - static final Pattern BUFFER_TYPE_PATTERN = Pattern.compile("\\s*Buffer\\s+type\\:.*"); //$NON-NLS-1$ - /** - * Pattern to match for channels section (lttng list ) - */ - static final Pattern CHANNELS_SECTION_PATTERN = Pattern.compile("\\s*Channels\\:"); //$NON-NLS-1$ - /** - * Pattern to match for channel information (lttng list ) - */ - static final Pattern CHANNEL_PATTERN = Pattern.compile("\\s*-\\s+(.*)\\:\\s+\\[(enabled|disabled)\\]"); //$NON-NLS-1$ - /** - * Pattern to match for events section information (lttng list ) - */ - static final Pattern EVENT_SECTION_PATTERN = Pattern.compile("\\s*Events\\:"); //$NON-NLS-1$ - /** - * Pattern to match for event information (lttng list ) - */ - static final Pattern EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(loglevel\\s*(:|<=|==)\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$ - /** - * Pattern to match a wildcarded event information (lttng list ) - */ - static final Pattern WILDCARD_EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$ - /** - * Pattern to match a probe address information (lttng list ) - */ - static final Pattern PROBE_ADDRESS_PATTERN = Pattern.compile("\\s+(addr)\\:\\s+(0x[0-9a-fA-F]{1,16})"); //$NON-NLS-1$ - /** - * Pattern to match a probe OFFSET information (lttng list ) - */ - static final Pattern PROBE_OFFSET_PATTERN = Pattern.compile("\\s+(offset)\\:\\s+(0x[0-9a-fA-F]{1,16})"); //$NON-NLS-1$ - /** - * Pattern to match a probe SYMBOL information (lttng list ) - */ - static final Pattern PROBE_SYMBOL_PATTERN = Pattern.compile("\\s+(symbol)\\:\\s+(.+)"); //$NON-NLS-1$ - /** - * Pattern to match for channel (overwite mode) information (lttng list ) - */ - static final Pattern OVERWRITE_MODE_ATTRIBUTE = Pattern.compile("\\s+overwrite\\s+mode\\:.*"); //$NON-NLS-1$ - /** - * Pattern to match indicating false for overwrite mode - */ - static final String OVERWRITE_MODE_ATTRIBUTE_FALSE = "0"; //$NON-NLS-1$ - /** - * Pattern to match indicating false for overwrite mode in machine interface mode - */ - static final String OVERWRITE_MODE_ATTRIBUTE_FALSE_MI = "DISCARD"; //$NON-NLS-1$ - /** - * Pattern to match for channel (sub-buffer size) information (lttng list ) - */ - static final Pattern SUBBUFFER_SIZE_ATTRIBUTE = Pattern.compile("\\s+subbufers\\s+size\\:.*"); //$NON-NLS-1$ - /** - * Pattern to match for channel (number of sub-buffers) information (lttng list ) - */ - static final Pattern NUM_SUBBUFFERS_ATTRIBUTE = Pattern.compile("\\s+number\\s+of\\s+subbufers\\:.*"); //$NON-NLS-1$ - /** - * Pattern to match for channel (switch timer) information (lttng list ) - */ - static final Pattern SWITCH_TIMER_ATTRIBUTE = Pattern.compile("\\s+switch\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$ - /** - * Pattern to match for channel (read timer) information (lttng list ) - */ - static final Pattern READ_TIMER_ATTRIBUTE = Pattern.compile("\\s+read\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$ - /** - * Pattern to match for channel (output type) information (lttng list ) - */ - static final Pattern OUTPUT_ATTRIBUTE = Pattern.compile("\\s+output\\:.*"); //$NON-NLS-1$ - /** - * Pattern to match for provider information (lttng list -k/-u) - */ - static final Pattern PROVIDER_EVENT_PATTERN = Pattern.compile("\\s*(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)"); //$NON-NLS-1$ - /** - * Pattern to match event fields - */ - static final Pattern EVENT_FIELD_PATTERN = Pattern.compile("\\s*(field:)\\s+(.*)\\s+\\((.*)\\)"); //$NON-NLS-1$ - /** - * Pattern to match for UST provider information (lttng list -u) - */ - static final Pattern UST_PROVIDER_PATTERN = Pattern.compile("\\s*PID\\:\\s+(\\d+)\\s+-\\s+Name\\:\\s+(.*)"); //$NON-NLS-1$ - /** - * Pattern to match for session information (lttng create ) - */ - static final Pattern CREATE_SESSION_NAME_PATTERN = Pattern.compile(".*Session\\s+(.*)\\s+created\\."); //$NON-NLS-1$ - /** - * Pattern to match for session path information (lttng create ) - */ - static final Pattern CREATE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Traces\\s+will\\s+be\\s+written\\s+in\\s+(.*).*"); //$NON-NLS-1$ - /** - * Pattern to match for session command output for "session name not found". - */ - static final Pattern SESSION_NOT_FOUND_ERROR_PATTERN = Pattern.compile("\\s*Error:\\s+Session\\s+name\\s.*not\\s+found"); //$NON-NLS-1$ - /** - * Pattern to match introduction line of context list. - */ - static final Pattern ADD_CONTEXT_HELP_CONTEXTS_INTRO = Pattern.compile("\\s*TYPE can\\s+be\\s+one\\s+of\\s+the\\s+strings\\s+below.*"); //$NON-NLS-1$ - /** - * Pattern to match introduction line of context list. - */ - static final Pattern ADD_CONTEXT_HELP_CONTEXTS_END_LINE = Pattern.compile("\\s*Example.*"); //$NON-NLS-1$ - /** - * Pattern to match error line if no kernel tracer is available or installed. - */ - static final Pattern LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN = Pattern.compile("\\s*Error:\\s+Unable\\s+to\\s+list\\s+kernel\\s+events.*"); //$NON-NLS-1$; - /** - * Pattern to match error line if no ust tracer is available or installed. - */ - static final Pattern LIST_UST_NO_UST_PROVIDER_PATTERN = Pattern.compile(".*Unable\\s*to\\s*list\\s*UST\\s*event.*"); //$NON-NLS-1$; - /** - * Pattern to match for list snapshot information (lttng snapshot list-output) - */ - static final Pattern LIST_SNAPSHOT_OUTPUT_PATTERN = Pattern.compile("\\s+\\[(\\d+)\\]\\s+(\\S*)\\:\\s+(\\S*)(.*)"); //$NON-NLS-1$ - /** - * Pattern to match snapshot path for network tracing (lttng list ) - * Note: file for protocol is not considered as network trace since local consumer will be used. - */ - static final Pattern SNAPSHOT_NETWORK_PATH_PATTERN = Pattern.compile("(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$ - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java deleted file mode 100644 index 2ac956b86a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java +++ /dev/null @@ -1,148 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 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: - * Bernd Hufmann - Initial API and implementation - * Jonathan Rajotte - machine interface support - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; - -import java.util.regex.Matcher; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; - -/** - * Factory to create LTTngControlService instances depending on the version of - * the LTTng Trace Control installed on the remote host. - * - * @author Bernd Hufmann - */ -public class LTTngControlServiceFactory { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The singleton instance. - */ - private static LTTngControlServiceFactory fInstance = null; - - // ------------------------------------------------------------------------ - // Constructor - // ------------------------------------------------------------------------ - /** - * Constructor - */ - private LTTngControlServiceFactory() { - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return the LTTngControlServiceFactory singleton instance. - */ - public static synchronized LTTngControlServiceFactory getInstance() { - if (fInstance == null) { - fInstance = new LTTngControlServiceFactory(); - } - return fInstance; - } - - // ------------------------------------------------------------------------ - // Factory method - // ------------------------------------------------------------------------ - /** - * Gets the LTTng Control Service implementation based on the version of the - * remote LTTng Tools. - * - * @param shell - * - the shell implementation to pass to the service - * @return - LTTng Control Service implementation - * @throws ExecutionException - * If the command fails - */ - public ILttngControlService getLttngControlService(ICommandShell shell) throws ExecutionException { - // get the version - boolean machineInterfaceMode = true; - String command = LTTngControlServiceConstants.CONTROL_COMMAND + LTTngControlServiceConstants.COMMAND_VERSION; - String commandMi = LTTngControlServiceConstants.CONTROL_COMMAND_MI_XML + LTTngControlServiceConstants.COMMAND_VERSION; - - // Logging - if (ControlPreferences.getInstance().isLoggingEnabled()) { - ControlCommandLogger.log(commandMi); - } - - ICommandResult result = null; - - // Looking for a machine interface on LTTng side - try { - result = shell.executeCommand(commandMi, new NullProgressMonitor()); - } catch (ExecutionException e) { - throw new ExecutionException(Messages.TraceControl_GettingVersionError, e); - } - - // Output logging - if (ControlPreferences.getInstance().isLoggingEnabled()) { - ControlCommandLogger.log(LTTngControlService.formatOutput(result)); - } - - if (result.getResult() != 0) { - machineInterfaceMode = false; - // Fall back if no machine interface is present - - // Logging - if (ControlPreferences.getInstance().isLoggingEnabled()) { - ControlCommandLogger.log(command); - } - - try { - result = shell.executeCommand(command, new NullProgressMonitor()); - } catch (ExecutionException e) { - throw new ExecutionException(Messages.TraceControl_GettingVersionError + ": " + e); //$NON-NLS-1$ - } - - // Output logging - if (ControlPreferences.getInstance().isLoggingEnabled()) { - ControlCommandLogger.log(LTTngControlService.formatOutput(result)); - } - } - - - if ((result != null) && (result.getResult() == 0) && (result.getOutput().length >= 1)) { - if (machineInterfaceMode) { - LTTngControlServiceMI service = new LTTngControlServiceMI(shell, LTTngControlService.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME)); - service.setVersion(result.getOutput()); - return service; - } - int index = 0; - while (index < result.getOutput().length) { - String line = result.getOutput()[index]; - Matcher versionMatcher = LTTngControlServiceConstants.VERSION_PATTERN.matcher(line); - if (versionMatcher.matches()) { - String version = versionMatcher.group(1).trim(); - Matcher matcher = LTTngControlServiceConstants.VERSION_2_PATTERN.matcher(version); - if (matcher.matches()) { - LTTngControlService service = new LTTngControlService(shell); - service.setVersion(version); - return service; - } - throw new ExecutionException(Messages.TraceControl_UnsupportedVersionError + ": " + version); //$NON-NLS-1$ - } - index++; - } - } - throw new ExecutionException(Messages.TraceControl_GettingVersionError); - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java deleted file mode 100644 index 8bb18a5613..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java +++ /dev/null @@ -1,953 +0,0 @@ -/********************************************************************** - * 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: - * Jonathan Rajotte - Initial support for machine interface lttng 2.6 - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; - -import java.io.IOException; -import java.io.StringReader; -import java.math.BigInteger; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceDomainType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.XmlMiValidationErrorHandler; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult; -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; -import org.eclipse.osgi.util.NLS; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Service for sending LTTng trace control commands to remote host via machine - * interface mode. - * - * @author Jonathan Rajotte - */ -public class LTTngControlServiceMI extends LTTngControlService { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - private final DocumentBuilder fDocumentBuilder; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * - * @param shell - * the command shell implementation to use - * @param xsdUrl - * the xsd schema file for validation - * @throws ExecutionException - * if the creation of the Schema and DocumentBuilder objects - * fails - */ - public LTTngControlServiceMI(ICommandShell shell, URL xsdUrl) throws ExecutionException { - super(shell); - - DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); - docBuilderFactory.setValidating(false); - - // TODO: Add xsd validation for machine interface via mi_lttng.xsd from LTTng - try { - fDocumentBuilder = docBuilderFactory.newDocumentBuilder(); - } catch (ParserConfigurationException e) { - throw new ExecutionException(Messages.TraceControl_XmlDocumentBuilderError, e); - } - - fDocumentBuilder.setErrorHandler(new XmlMiValidationErrorHandler()); - - } - - /** - * Generate a Document object from an array of String. - * - * @param xmlStrings - * array of strings representing an xml input - * @return Document generated from strings input - * @throws ExecutionException - * when parsing has failed - */ - private Document getDocumentFromStrings(String[] xmlStrings) throws ExecutionException { - StringBuilder concatenedString = new StringBuilder(); - for (String string : xmlStrings) { - concatenedString.append(string); - } - InputSource stream = new InputSource(new StringReader(concatenedString.toString())); - - Document document; - try { - document = fDocumentBuilder.parse(stream); - } catch (SAXException | IOException e) { - throw new ExecutionException(Messages.TraceControl_XmlParsingError, e); - } - return document; - - } - - /** - * Parse, populate and set the internal LTTngVersion variable - * - * @param xmlOutput - * the mi xml output of lttng version - * @throws ExecutionException - * when xml extraction fail - */ - public void setVersion(String[] xmlOutput) throws ExecutionException { - Document doc = getDocumentFromStrings(xmlOutput); - NodeList element = doc.getElementsByTagName(MIStrings.VERSION); - int major = 0; - int minor = 0; - int patchLevel = 0; - String license = ""; //$NON-NLS-1$ - String commit = ""; //$NON-NLS-1$ - String name = ""; //$NON-NLS-1$ - String description = ""; //$NON-NLS-1$ - String url = ""; //$NON-NLS-1$ - String fullVersion = ""; //$NON-NLS-1$ - if (element.getLength() == 1) { - NodeList child = element.item(0).getChildNodes(); - // Get basic information - for (int i = 0; i < child.getLength(); i++) { - Node node = child.item(i); - switch (node.getNodeName()) { - case MIStrings.VERSION_MAJOR: - major = Integer.parseInt(node.getTextContent()); - break; - case MIStrings.VERSION_MINOR: - minor = Integer.parseInt(node.getTextContent()); - break; - case MIStrings.VERSION_PATCH_LEVEL: - patchLevel = Integer.parseInt(node.getTextContent()); - break; - case MIStrings.VERSION_COMMIT: - commit = node.getTextContent(); - break; - case MIStrings.VERSION_DESCRIPTION: - description = node.getTextContent(); - break; - case MIStrings.VERSION_LICENSE: - license = node.getTextContent(); - break; - case MIStrings.VERSION_NAME: - name = node.getTextContent(); - break; - case MIStrings.VERSION_STR: - fullVersion = node.getTextContent(); - break; - case MIStrings.VERSION_WEB: - url = node.getTextContent(); - break; - default: - break; - } - } - setVersion(new LttngVersion(major, minor, patchLevel, license, commit, name, description, url, fullVersion)); - } else { - throw new ExecutionException(Messages.TraceControl_UnsupportedVersionError); - } - } - - @Override - public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST); - ICommandResult result = executeCommand(command.toString(), monitor); - - Document doc = getDocumentFromStrings(result.getOutput()); - - NodeList elements = doc.getElementsByTagName(MIStrings.NAME); - - ArrayList retArray = new ArrayList<>(); - for (int i = 0; i < elements.getLength(); i++) { - Node node = elements.item(i); - if (node.getParentNode().getNodeName().equalsIgnoreCase(MIStrings.SESSION)) { - retArray.add(node.getTextContent()); - } - } - return retArray.toArray(new String[retArray.size()]); - } - - @Override - public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, sessionName); - ICommandResult result = executeCommand(command.toString(), monitor); - - ISessionInfo sessionInfo = new SessionInfo(sessionName); - Document document = getDocumentFromStrings(result.getOutput()); - - NodeList sessionsNode = document.getElementsByTagName(MIStrings.SESSION); - // There should be only one session - if (sessionsNode.getLength() != 1) { - throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); - } - - // Populate session information - Node rawSession = sessionsNode.item(0); - parseSession(sessionInfo, rawSession); - - // Fetch the snapshot info - if (sessionInfo.isSnapshotSession()) { - ISnapshotInfo snapshot = getSnapshotInfo(sessionName, monitor); - sessionInfo.setSnapshotInfo(snapshot); - } - - return sessionInfo; - } - - /** - * @param sessionInfo - * @param rawSession - * @throws ExecutionException - */ - private void parseSession(ISessionInfo sessionInfo, Node rawSession) throws ExecutionException { - if (!rawSession.getNodeName().equalsIgnoreCase(MIStrings.SESSION)) { - throw new ExecutionException(Messages.TraceControl_MiInvalidElementError); - } - NodeList rawSessionInfos = rawSession.getChildNodes(); - for (int i = 0; i < rawSessionInfos.getLength(); i++) { - Node rawInfo = rawSessionInfos.item(i); - switch (rawInfo.getNodeName()) { - case MIStrings.NAME: - sessionInfo.setName(rawInfo.getTextContent()); - break; - case MIStrings.PATH: - sessionInfo.setSessionPath(rawInfo.getTextContent()); - break; - case MIStrings.ENABLED: - sessionInfo.setSessionState(rawInfo.getTextContent()); - break; - case MIStrings.SNAPSHOT_MODE: - if (rawInfo.getTextContent().equals(LTTngControlServiceConstants.TRUE_NUMERICAL)) { - // real name will be set later - ISnapshotInfo snapshotInfo = new SnapshotInfo(""); //$NON-NLS-1$ - sessionInfo.setSnapshotInfo(snapshotInfo); - } - break; - case MIStrings.LIVE_TIMER_INTERVAL: - // TODO : live mode not supported yet in TMF:lttng-control - break; - case MIStrings.DOMAINS: - // Extract the domains node - NodeList rawDomains = rawInfo.getChildNodes(); - IDomainInfo domain = null; - for (int j = 0; j < rawDomains.getLength(); j++) { - if (rawDomains.item(j).getNodeName().equalsIgnoreCase(MIStrings.DOMAIN)) { - domain = parseDomain(rawDomains.item(j)); - sessionInfo.addDomain(domain); - } - } - break; - default: - break; - } - } - - if (!sessionInfo.isSnapshotSession()) { - Matcher matcher = LTTngControlServiceConstants.TRACE_NETWORK_PATTERN.matcher(sessionInfo.getSessionPath()); - if (matcher.matches()) { - sessionInfo.setStreamedTrace(true); - } - } - } - - /** - * Parse a raw domain XML node to a IDomainInfo object - * - * @param rawDomain - * a domain xml node - * @return a populated {@link DomainInfo} object - * @throws ExecutionException - * when missing required xml element (type) - */ - protected IDomainInfo parseDomain(Node rawDomain) throws ExecutionException { - IDomainInfo domain = null; - // Get the type - Node rawType = getFirstOf(rawDomain.getChildNodes(), MIStrings.TYPE); - if (rawType == null) { - throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); - } - String rawTypeString = rawType.getTextContent().toLowerCase(); - TraceDomainType domainType = TraceDomainType.valueOfString(rawTypeString); - switch (domainType) { - case KERNEL: - domain = new DomainInfo(Messages.TraceControl_KernelProviderDisplayName); - domain.setIsKernel(true); - break; - case UST: - domain = new DomainInfo(Messages.TraceControl_UstGlobalDomainDisplayName); - domain.setIsKernel(false); - break; - case JUL: - /** - * TODO: Support for JUL JUL substructure and semantic is not the - * same as a regular UST or Kernel Domain There is no channel under - * JUL domain only events. The channel is activated in UST Channel - */ - domain = new DomainInfo(Messages.TraceControl_JULDomainDisplayName); - domain.setIsKernel(false); - break; - case UNKNOWN: - domain = new DomainInfo(Messages.TraceControl_UnknownDomainDisplayName); - domain.setIsKernel(false); - break; - default: - throw new ExecutionException(Messages.TraceControl_MiInvalidElementError); - } - - NodeList rawInfos = rawDomain.getChildNodes(); - for (int i = 0; i < rawInfos.getLength(); i++) { - Node rawInfo = rawInfos.item(i); - switch (rawInfo.getNodeName()) { - case MIStrings.BUFFER_TYPE: - BufferType bufferType = BufferType.valueOfString(rawInfo.getTextContent()); - domain.setBufferType(bufferType); - break; - case MIStrings.CHANNELS: - ArrayList channels = new ArrayList<>(); - parseChannels(rawInfo.getChildNodes(), channels); - if (channels.size() > 0) { - domain.setChannels(channels); - } - break; - default: - break; - } - } - - return domain; - } - - /** - * Parse a list of raw channel XML node into an ArrayList of IChannelInfo - * - * @param rawChannes - * List of raw channel XML node - * @param channels - * the parsed channels list - * @throws ExecutionException - * when missing required xml element (type) - */ - private static void parseChannels(NodeList rawChannels, ArrayList channels) throws ExecutionException { - IChannelInfo channel = null; - for (int i = 0; i < rawChannels.getLength(); i++) { - Node rawChannel = rawChannels.item(i); - if (rawChannel.getNodeName().equalsIgnoreCase(MIStrings.CHANNEL)) { - channel = new ChannelInfo(""); //$NON-NLS-1$ - - // Populate the channel - NodeList rawInfos = rawChannel.getChildNodes(); - Node rawInfo = null; - for (int j = 0; j < rawInfos.getLength(); j++) { - rawInfo = rawInfos.item(j); - switch (rawInfo.getNodeName()) { - case MIStrings.NAME: - channel.setName(rawInfo.getTextContent()); - break; - case MIStrings.ENABLED: - channel.setState(TraceEnablement.valueOfString(rawInfo.getTextContent())); - break; - case MIStrings.EVENTS: - List events = new ArrayList<>(); - getEventInfo(rawInfo.getChildNodes(), events); - channel.setEvents(events); - break; - case MIStrings.ATTRIBUTES: - NodeList rawAttributes = rawInfo.getChildNodes(); - for (int k = 0; k < rawAttributes.getLength(); k++) { - Node attribute = rawAttributes.item(k); - switch (attribute.getNodeName()) { - case MIStrings.OVERWRITE_MODE: - channel.setOverwriteMode(!LTTngControlServiceConstants.OVERWRITE_MODE_ATTRIBUTE_FALSE_MI.equalsIgnoreCase(attribute.getTextContent())); - break; - case MIStrings.SUBBUF_SIZE: - channel.setSubBufferSize(Long.valueOf(attribute.getTextContent())); - break; - case MIStrings.NUM_SUBBUF: - channel.setNumberOfSubBuffers(Integer.valueOf(attribute.getTextContent())); - break; - case MIStrings.SWITCH_TIMER_INTERVAL: - channel.setSwitchTimer(Long.valueOf(attribute.getTextContent())); - break; - case MIStrings.READ_TIMER_INTERVAL: - channel.setReadTimer(Long.valueOf(attribute.getTextContent())); - break; - case MIStrings.OUTPUT_TYPE: - channel.setOutputType(attribute.getTextContent()); - break; - case MIStrings.TRACEFILE_SIZE: - channel.setMaxSizeTraceFiles(Integer.parseInt(attribute.getTextContent())); - break; - case MIStrings.TRACEFILE_COUNT: - channel.setMaxNumberTraceFiles(Integer.parseInt(attribute.getTextContent())); - break; - case MIStrings.LIVE_TIMER_INTERVAL: - // TODO: currently not supported by tmf - break; - default: - break; - } - } - break; - default: - break; - } - } - channels.add(channel); - } - } - - } - - @Override - public ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) throws ExecutionException { - // TODO A session can have multiple snapshot output. This need to be - // supported in the future. - // Currently the SessionInfo object does not support multiple snashot - // output. - // For now only keep the last one. - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName); - ICommandResult result = executeCommand(command.toString(), monitor); - Document doc = getDocumentFromStrings(result.getOutput()); - NodeList rawSnapshotsOutputs = doc.getElementsByTagName(MIStrings.SNAPSHOT_OUTPUTS); - - ISnapshotInfo snapshotInfo = new SnapshotInfo(""); //$NON-NLS-1$ - - // TODO: tmf does not have a notion of a ctrl url. - for (int i = 0; i < rawSnapshotsOutputs.getLength(); i++) { - NodeList rawSnapshotOutput = rawSnapshotsOutputs.item(i).getChildNodes(); - for (int j = 0; j < rawSnapshotOutput.getLength(); j++) { - Node rawInfo = rawSnapshotOutput.item(j); - switch (rawInfo.getNodeName()) { - case MIStrings.ID: - snapshotInfo.setId(Integer.parseInt(rawInfo.getTextContent())); - break; - case MIStrings.NAME: - snapshotInfo.setName(rawInfo.getTextContent()); - break; - case MIStrings.SNAPSHOT_CTRL_URL: - // The use of the ctrl_url for the snapshot path is to assure - // basic support. Refactoring is necessary in lttng and - // tmf side. - // See http://bugs.lttng.org/issues/828 (+comment) - snapshotInfo.setSnapshotPath(rawInfo.getTextContent()); - break; - default: - break; - } - } - } - - // Check if the snapshot output is Streamed - Matcher matcher2 = LTTngControlServiceConstants.TRACE_NETWORK_PATTERN.matcher(snapshotInfo.getSnapshotPath()); - if (matcher2.matches()) { - snapshotInfo.setStreamedSnapshot(true); - } - - return snapshotInfo; - } - - @Override - public List getKernelProvider(IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_KERNEL); - ICommandResult result = executeCommand(command.toString(), monitor, false); - List events = new ArrayList<>(); - - if (isError(result) && result.getErrorOutput() != null) { - // Ignore the following 2 cases: - // Spawning a session daemon - // Error: Unable to list kernel events - // or: - // Error: Unable to list kernel events - if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN)) { - return events; - } - throw new ExecutionException(Messages.TraceControl_CommandError + LTTngControlServiceConstants.COMMAND_LIST_KERNEL); - } - - Document document = getDocumentFromStrings(result.getOutput()); - NodeList rawEvents = document.getElementsByTagName(MIStrings.EVENT); - getBaseEventInfo(rawEvents, events); - return events; - } - - @Override - public List getUstProvider(IProgressMonitor monitor) throws ExecutionException { - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_UST); - // Get the field to - command.append(LTTngControlServiceConstants.OPTION_FIELDS); - - // Execute - ICommandResult result = executeCommand(command.toString(), monitor, false); - List allProviders = new ArrayList<>(); - - if (isError(result) && result.getErrorOutput() != null) { - // Ignore the following 2 cases: - // Spawning a session daemon - // Error: Unable to list UST events: Listing UST events failed - // or: - // Error: Unable to list UST events: Listing UST events failed - if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) { - return allProviders; - } - throw new ExecutionException(Messages.TraceControl_CommandError + LTTngControlServiceConstants.COMMAND_LIST_UST); - } - - Document document = getDocumentFromStrings(result.getOutput()); - NodeList rawProviders = document.getElementsByTagName(MIStrings.PID); - - IUstProviderInfo providerInfo = null; - - for (int i = 0; i < rawProviders.getLength(); i++) { - Node provider = rawProviders.item(i); - Node name = getFirstOf(provider.getChildNodes(), MIStrings.NAME); - if (name == null) { - throw new ExecutionException(Messages.TraceControl_MiInvalidProviderError); - } - providerInfo = new UstProviderInfo(name.getTextContent()); - - // Populate provider - NodeList infos = provider.getChildNodes(); - for (int j = 0; j < infos.getLength(); j++) { - Node info = infos.item(j); - switch (info.getNodeName()) { - case MIStrings.PID_ID: - providerInfo.setPid(Integer.parseInt(info.getTextContent())); - break; - case MIStrings.EVENTS: - List events = new ArrayList<>(); - NodeList rawEvents = info.getChildNodes(); - getBaseEventInfo(rawEvents, events); - providerInfo.setEvents(events); - break; - default: - break; - } - } - allProviders.add(providerInfo); - } - - return allProviders; - } - - @Override - public ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { - if (sessionInfo.isStreamedTrace()) { - return createStreamedSession(sessionInfo, monitor); - } - - StringBuffer command = prepareSessionCreationCommand(sessionInfo); - - ICommandResult result = executeCommand(command.toString(), monitor); - - Document document = getDocumentFromStrings(result.getOutput()); - NodeList sessions = document.getElementsByTagName(MIStrings.SESSION); - - // Number of session should be equal to 1 - if (sessions.getLength() != 1) { - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" //$NON-NLS-1$//$NON-NLS-2$ - + NLS.bind(Messages.TraceControl_UnexpectedNumberOfElementError, MIStrings.SESSION) + " " + sessions.getLength()); //$NON-NLS-1$ - } - - // Fetch a session from output - ISessionInfo outputSession = new SessionInfo(""); //$NON-NLS-1$ - parseSession(outputSession, sessions.item(0)); - - // Verify session name - if ((outputSession.getName().equals("")) || (!"".equals(sessionInfo.getName()) && !outputSession.getName().equals(sessionInfo.getName()))) { //$NON-NLS-1$ //$NON-NLS-2$ - // Unexpected name returned - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ - Messages.TraceControl_UnexpectedNameError + ": " + outputSession.getName()); //$NON-NLS-1$ - } - - // Verify session path - if (!sessionInfo.isSnapshotSession() && - ((outputSession.getSessionPath() == null) || ((sessionInfo.getSessionPath() != null) && (!outputSession.getSessionPath().contains(sessionInfo.getSessionPath()))))) { - // Unexpected path - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ - Messages.TraceControl_UnexpectedPathError + ": " + outputSession.getName()); //$NON-NLS-1$ - } - - if (sessionInfo.isSnapshotSession()) { - // Make it a snapshot session - content of snapshot info need to - // set afterwards using getSession() or getSnapshotInfo() - outputSession.setSnapshotInfo(new SnapshotInfo("")); //$NON-NLS-1$ - } - - return outputSession; - } - - private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { - - StringBuffer command = prepareStreamedSessionCreationCommand(sessionInfo); - - ICommandResult result = executeCommand(command.toString(), monitor); - - Document document = getDocumentFromStrings(result.getOutput()); - NodeList sessions = document.getElementsByTagName(MIStrings.SESSION); - - // Number of session should be equal to 1 - if (sessions.getLength() != 1) { - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" //$NON-NLS-1$//$NON-NLS-2$ - + NLS.bind(Messages.TraceControl_UnexpectedNumberOfElementError, MIStrings.SESSION) + " " + sessions.getLength()); //$NON-NLS-1$ - } - - // Fetch a session from output - ISessionInfo outputSession = new SessionInfo(""); //$NON-NLS-1$ - parseSession(outputSession, sessions.item(0)); - - // Verify session name - if ((outputSession.getName().equals("")) || (!"".equals(sessionInfo.getName()) && !outputSession.getName().equals(sessionInfo.getName()))) { //$NON-NLS-1$ //$NON-NLS-2$ - // Unexpected name returned - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ - Messages.TraceControl_UnexpectedNameError + ": " + outputSession.getName()); //$NON-NLS-1$ - } - - sessionInfo.setName(outputSession.getName()); - sessionInfo.setStreamedTrace(true); - - // Verify session path - if (sessionInfo.getNetworkUrl() != null) { - if (!sessionInfo.isSnapshotSession() && (outputSession.getSessionPath() == null)) { - // Unexpected path - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ - Messages.TraceControl_UnexpectedPathError + ": " + outputSession.getName()); //$NON-NLS-1$ - } - - if (sessionInfo.isSnapshotSession()) { - sessionInfo.setStreamedTrace(false); - } else { - sessionInfo.setSessionPath(outputSession.getSessionPath()); - // Check file protocol - Matcher matcher = LTTngControlServiceConstants.TRACE_FILE_PROTOCOL_PATTERN.matcher(outputSession.getSessionPath()); - if (matcher.matches()) { - sessionInfo.setStreamedTrace(false); - } - } - } - - // When using controlUrl and dataUrl the full session path is not known - // yet - // and will be set later on when listing the session - return sessionInfo; - - } - - @Override - public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { - String newName = formatParameter(sessionName); - - StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName); - - ICommandResult result = executeCommand(command.toString(), monitor, false); - String[] errorOutput = result.getErrorOutput(); - - if (isError(result) && (errorOutput != null)) { - // Don't treat this as an error - if (ignoredPattern(errorOutput, LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { - return; - - } - throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // Check for action effect - Document doc = getDocumentFromStrings(result.getOutput()); - NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); - if (sessions.getLength() != 1) { - throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); - } - - Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); - if (rawSessionName == null) { - throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); - } - - // Validity check - if (!rawSessionName.getTextContent().equals(sessionName)) { - throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); - } - } - - /** - * @param strings - * array of string that make up a command line - * @return string buffer with created command line - */ - @Override - protected StringBuffer createCommand(String... strings) { - StringBuffer command = new StringBuffer(); - command.append(LTTngControlServiceConstants.CONTROL_COMMAND_MI_XML); - command.append(getTracingGroupOption()); - for (String string : strings) { - command.append(string); - } - return command; - } - - /** - * @param xmlBaseEvents - * a Node list of base xml event element - * @param events - * list of event generated by the parsing of the xml event - * element - * @throws ExecutionException - * when a raw event is not a complete/valid xml event - */ - private static void getBaseEventInfo(NodeList xmlBaseEvents, List events) throws ExecutionException { - IBaseEventInfo eventInfo = null; - for (int i = 0; i < xmlBaseEvents.getLength(); i++) { - NodeList rawInfos = xmlBaseEvents.item(i).getChildNodes(); - // Search for name - if (xmlBaseEvents.item(i).getNodeName().equalsIgnoreCase(MIStrings.EVENT)) { - Node rawName = getFirstOf(rawInfos, MIStrings.NAME); - if (rawName == null) { - throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); - } - eventInfo = new BaseEventInfo(rawName.getTextContent()); - - // Populate the event - for (int j = 0; j < rawInfos.getLength(); j++) { - Node infoNode = rawInfos.item(j); - switch (infoNode.getNodeName()) { - case MIStrings.TYPE: - eventInfo.setEventType(infoNode.getTextContent()); - break; - case MIStrings.LOGLEVEL: - eventInfo.setLogLevel(infoNode.getTextContent()); - break; - case MIStrings.EVENT_FIELDS: - List fields = new ArrayList<>(); - getFieldInfo(infoNode.getChildNodes(), fields); - eventInfo.setFields(fields); - break; - default: - break; - } - } - events.add(eventInfo); - } - } - } - - /** - * @param xmlBaseEvents - * a Node list of xml event element linked to a session - * @param events - * list of event generated by the parsing of the xml event - * element - * @throws ExecutionException - * when a raw event is not a complete/valid xml event - */ - static void getEventInfo(NodeList xmlEvents, List events) throws ExecutionException { - IEventInfo eventInfo = null; - for (int i = 0; i < xmlEvents.getLength(); i++) { - NodeList rawInfos = xmlEvents.item(i).getChildNodes(); - // Search for name - if (xmlEvents.item(i).getNodeName().equalsIgnoreCase(MIStrings.EVENT)) { - Node rawName = getFirstOf(rawInfos, MIStrings.NAME); - if (rawName == null) { - throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); - } - - eventInfo = new EventInfo(rawName.getTextContent()); - - // Basic information - for (int j = 0; j < rawInfos.getLength(); j++) { - Node infoNode = rawInfos.item(j); - switch (infoNode.getNodeName()) { - case MIStrings.TYPE: - eventInfo.setEventType(infoNode.getTextContent()); - break; - case MIStrings.LOGLEVEL_TYPE: - eventInfo.setLogLevelType(LogLevelType.valueOfString(infoNode.getTextContent())); - break; - case MIStrings.LOGLEVEL: - eventInfo.setLogLevel(TraceLogLevel.valueOfString(infoNode.getTextContent())); - break; - case MIStrings.ENABLED: - eventInfo.setState(TraceEnablement.valueOfString(infoNode.getTextContent())); - break; - case MIStrings.FILTER: - // TODO - // See bug 334 http://bugs.lttng.org/issues/334 from - // LTTng - // For now we emulate the non-mi behavior and simply put - // "with filter" - eventInfo.setFilterExpression("with filter"); //$NON-NLS-1$ - break; - case MIStrings.EXCLUSION: - // TODO: Currently not supported by tmf - // ExclusionS element is ignored - break; - default: - break; - } - } - - boolean isProbeFunction = (eventInfo.getEventType().equals(TraceEventType.PROBE)) || (eventInfo.getEventType().equals(TraceEventType.FUNCTION)); - if (isProbeFunction) { - IProbeEventInfo probeEvent = new ProbeEventInfo(eventInfo); - eventInfo = probeEvent; - - Node rawDataNode = null; - switch (probeEvent.getEventType()) { - case FUNCTION: - case PROBE: { - // get attributes - Node rawAttributes = getFirstOf(rawInfos, MIStrings.ATTRIBUTES); - if (rawAttributes == null) { - throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); - } - rawDataNode = getFirstOf(rawAttributes.getChildNodes(), MIStrings.PROBE_ATTRIBUTES); - break; - } - case SYSCALL: - case TRACEPOINT: - case UNKNOWN: - default: - throw new ExecutionException(Messages.TraceControl_MiInvalidElementError); - } - - if (rawDataNode == null) { - throw new ExecutionException(Messages.TraceControl_MiInvalidElementError); - } - - // Extract info - NodeList rawDatas = rawDataNode.getChildNodes(); - for (int j = 0; j < rawDatas.getLength(); j++) { - Node rawData = rawDatas.item(j); - switch (rawData.getNodeName()) { - case MIStrings.SYMBOL_NAME: - probeEvent.setSymbol(rawData.getTextContent()); - break; - case MIStrings.ADDRESS: - probeEvent.setAddress(String.format("%#016x", new BigInteger(rawData.getTextContent()))); //$NON-NLS-1$ - break; - case MIStrings.OFFSET: - probeEvent.setOffset(String.format("%#016x", new BigInteger(rawData.getTextContent()))); //$NON-NLS-1$ - break; - default: - break; - } - } - } - - // Syscalls does not have name. - // Let put one to make sure this is user friendly via UI - if (eventInfo.getEventType().equals(TraceEventType.SYSCALL)) { - eventInfo.setName(TraceEventType.SYSCALL.getInName()); - } - - // Add the event - events.add(eventInfo); - } - } - } - - /** - * @param fieldsList - * a list of xml event_field element - * @param fields - * a list of field generated by xml parsing - * @throws ExecutionException - * when parsing fail or required elements are missing - */ - private static void getFieldInfo(NodeList fieldsList, List fields) throws ExecutionException { - IFieldInfo fieldInfo = null; - for (int i = 0; i < fieldsList.getLength(); i++) { - Node field = fieldsList.item(i); - if (field.getNodeName().equalsIgnoreCase(MIStrings.EVENT_FIELD)) { - // Get name - Node name = getFirstOf(field.getChildNodes(), MIStrings.NAME); - if (name == null) { - throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); - } - fieldInfo = new FieldInfo(name.getTextContent()); - - // Populate the field information - NodeList infos = field.getChildNodes(); - for (int j = 0; j < infos.getLength(); j++) { - Node info = infos.item(j); - switch (info.getNodeName()) { - case MIStrings.TYPE: - fieldInfo.setFieldType(info.getTextContent()); - break; - default: - break; - } - } - fields.add(fieldInfo); - } - } - } - - /** - * Retrieve the fist instance of a given node with tag name equal to tagName - * parameter - * - * @param nodeList - * the list of Node to search against - * @param tagName - * the tag name of the desired node - * @return the first occurrence of a node with a tag name equals to tagName - */ - private static Node getFirstOf(NodeList nodeList, String tagName) { - Node node = null; - for (int i = 0; i < nodeList.getLength(); i++) { - if (nodeList.item(i).getNodeName() == tagName) { - node = nodeList.item(i); - break; - } - } - return node; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LttngVersion.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LttngVersion.java deleted file mode 100644 index f992efb19e..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LttngVersion.java +++ /dev/null @@ -1,152 +0,0 @@ -/********************************************************************** - * 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: - * Bernd Hufmann - Initial API and implementation - * Jonathan Rajotte - Machine interface support and new information - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; - -import org.osgi.framework.Version; - -/** - * A version implementation with a special compareTo implementation to bypass - * problems of older implementation of org.osgi.framework.Version. - * - * @author Bernd Hufmann - */ -public class LttngVersion extends Version { - - private final String fLicense; - private final String fCommit; - private final String fName; - private final String fDescription; - private final String fUrl; - private final String fFullVersion; - - /** - * Constructor - * - * @param version - * The version string - */ - public LttngVersion(String version) { - super(version); - fLicense = ""; //$NON-NLS-1$ - fCommit = ""; //$NON-NLS-1$ - fName = ""; //$NON-NLS-1$ - fDescription = ""; //$NON-NLS-1$ - fUrl = ""; //$NON-NLS-1$ - fFullVersion = ""; //$NON-NLS-1$ - } - - /** - * @param major - * major version number - * @param minor - * minor version number - * @param micro - * micro version number - * @param license - * licence text of LTTng - * @param commit - * current git commit information about LTTng - * @param name - * name of the version - * @param description - * description of the version - * @param url - * url to website - * @param fullVersion - * complete string representation of the version - */ - public LttngVersion(int major, int minor, int micro, String license, String commit, String name, String description, String url, String fullVersion) { - super(major, minor, micro); - fLicense = license; - fCommit = commit; - fName = name; - fDescription = description; - fUrl = url; - fFullVersion = fullVersion; - } - - /** - * Special compareTo method to fix problem of older implementations of - * org.osgi.framework.Version where {@code Version.compareTo} takes an - * {@code Object} instead a {@code Version} as argument. - * - * @param other - * - Other version to compare - * @return a negative integer, zero, or a positive integer if this version - * is less than, equal to, or greater than the specified - * {@code LttngVersion} object. - */ - public int compareTo(LttngVersion other) { - if (other == this) { // quicktest - return 0; - } - int result = getMajor() - other.getMajor(); - if (result != 0) { - return result; - } - - result = getMinor() - other.getMinor(); - if (result != 0) { - return result; - } - - result = getMicro() - other.getMicro(); - if (result != 0) { - return result; - } - return getQualifier().compareTo(other.getQualifier()); - } - - /** - * @return String representing the lttng license - */ - public String getLicense() { - return fLicense; - } - - /** - * @return commit id of lttng - */ - public String getCommit() { - return fCommit; - } - - /** - * @return name of lttng version - */ - public String getName() { - return fName; - } - - /** - * @return full description of lttng - */ - public String getDescription() { - return fDescription; - } - - /** - * @return url of lttng - */ - public String getUrl() { - return fUrl; - } - - /** - * @return the full_version - */ - public String getFullVersion() { - return fFullVersion; - } -} diff --git a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/MIStrings.java b/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/MIStrings.java deleted file mode 100644 index 3d79248ec7..0000000000 --- a/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/MIStrings.java +++ /dev/null @@ -1,576 +0,0 @@ -/******************************************************************************* - * 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: - * Jonathan Rajotte Julien - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; - -import org.eclipse.jdt.annotation.NonNullByDefault; - -/** - * Non-externalized strings for use with the LTTng Control services. This - * nformation is extracted from mi_lttng.xsd from lttng-tool libmi. - * - * @author Jonathan Rajotte - */ -@SuppressWarnings("nls") -@NonNullByDefault -public interface MIStrings { - - /** - * Represent the command_action xml element - */ - String COMMAND_ACTION = "snapshot_action"; - - /** - * Represent the command_add_context xml element - */ - String COMMAND_ADD_CONTEXT = "add-context"; - - /** - * Represent the command_calibrate xml element - */ - String COMMAND_CALIBRATE = "calibrate"; - - /** - * Represent the command_create xml element - */ - String COMMAND_CREATE = "create"; - - /** - * Represent the command_destroy xml element - */ - String COMMAND_DESTROY = "destroy"; - - /** - * Represent the command_disable_channel xml element - */ - String COMMAND_DISABLE_CHANNEL = "disable-channel"; - - /** - * Represent the command_disable_event xml element - */ - String COMMAND_DISABLE_EVENT = "disable-event"; - - /** - * Represent the command_enable_channels xml element - */ - String COMMAND_ENABLE_CHANNELS = "enable-channel"; - - /** - * Represent the command_enable_event xml element - */ - String COMMAND_ENABLE_EVENT = "enable-event"; - - /** - * Represent the command_list xml element - */ - String COMMAND_LIST = "list"; - - /** - * Represent the command_load xml element - */ - String COMMAND_LOAD = "load"; - - /** - * Represent the command_name xml element - */ - String COMMAND_NAME = "name"; - - /** - * Represent the command_output xml element - */ - String COMMAND_OUTPUT = "output"; - - /** - * Represent the command_save xml element - */ - String COMMAND_SAVE = "save"; - - /** - * Represent the command_set_session xml element - */ - String COMMAND_SET_SESSION = "set-session"; - - /** - * Represent the command_snapshot xml element - */ - String COMMAND_SNAPSHOT = "snapshot"; - - /** - * Represent the command_snapshot_add xml element - */ - String COMMAND_SNAPSHOT_ADD = "add_snapshot"; - - /** - * Represent the command_snapshot_del xml element - */ - String COMMAND_SNAPSHOT_DEL = "del_snapshot"; - - /** - * Represent the command_snapshot_list xml element - */ - String COMMAND_SNAPSHOT_LIST = "list_snapshot"; - - /** - * Represent the command_snapshot_record xml element - */ - String COMMAND_SNAPSHOT_RECORD = "record_snapshot"; - - /** - * Represent the command_start xml element - */ - String COMMAND_START = "start"; - - /** - * Represent the command_stop xml element - */ - String COMMAND_STOP = "stop"; - - /** - * Represent the command_success xml element - */ - String COMMAND_SUCCESS = "success"; - - /** - * Represent the command_version xml element - */ - String COMMAND_VERSION = "version"; - - /** - * Represent the version xml element - */ - String VERSION = "version"; - - /** - * Represent the version_commit xml element - */ - String VERSION_COMMIT = "commit"; - - /** - * Represent the version_description xml element - */ - String VERSION_DESCRIPTION = "description"; - - /** - * Represent the version_license xml element - */ - String VERSION_LICENSE = "license"; - - /** - * Represent the version_major xml element - */ - String VERSION_MAJOR = "major"; - - /** - * Represent the version_minor xml element - */ - String VERSION_MINOR = "minor"; - - /** - * Represent the version_patch_level xml element - */ - String VERSION_PATCH_LEVEL = "patchLevel"; - - /** - * Represent the version_str xml element - */ - String VERSION_STR = "string"; - - /** - * Represent the version_web xml element - */ - String VERSION_WEB = "url"; - - /** - * Represent the version_name xml element - */ - String VERSION_NAME = "name"; - /* String related to a lttng_event_field */ - - /** - * Represent the event_field xml element - */ - String EVENT_FIELD = "event_field"; - - /** - * Represent the event_fields xml element - */ - String EVENT_FIELDS = "event_fields"; - - /** - * Represent the perf_counter_context xml element - */ - String PERF_COUNTER_CONTEXT = "perf_counter_context"; - - // ------------------------------------------------------------------------ - // String related to pid - // ------------------------------------------------------------------------/ - - /** - * Represent the pids xml element - */ - String PIDS = "pids"; - - /** - * Represent the pid xml element - */ - String PID = "pid"; - - /** - * Represent the pid_id xml element - */ - String PID_ID = "id"; - - // ------------------------------------------------------------------------ - // String related to save command - // ------------------------------------------------------------------------ - /** - * Represent the save xml element - */ - String SAVE = "save"; - - // ------------------------------------------------------------------------ - // String related to load command - // ------------------------------------------------------------------------ - /** - * Represent the load xml element - */ - String LOAD = "load"; - - // ------------------------------------------------------------------------ - // String related to general element of mi_lttng - // ------------------------------------------------------------------------ - /** - * Represent the empty xml element - */ - String EMPTY = ""; - - /** - * Represent the id xml element - */ - String ID = "id"; - - /** - * Represent the nowrite xml element - */ - String NOWRITE = "nowrite"; - - /** - * Represent the success xml element - */ - String SUCCESS = "success"; - - /** - * Represent the type_enum xml element - */ - String TYPE_ENUM = "ENUM"; - - /** - * Represent the type_float xml element - */ - String TYPE_FLOAT = "FLOAT"; - - /** - * Represent the type_integer xml element - */ - String TYPE_INTEGER = "INTEGER"; - - /** - * Represent the type_other xml element - */ - String TYPE_OTHER = "OTHER"; - - /** - * Represent the type_string xml element - */ - String TYPE_STRING = "STRING"; - - // ------------------------------------------------------------------------ - // String related to lttng_calibrate - // ------------------------------------------------------------------------ - /** - * Represent the calibrate xml element - */ - String CALIBRATE = "calibrate"; - - /** - * Represent the calibrate_function xml element - */ - String CALIBRATE_FUNCTION = "FUNCTION"; - - // ------------------------------------------------------------------------ - // String related to a lttng_snapshot_output - // ------------------------------------------------------------------------ - /** - * Represent the snapshot_ctrl_url xml element - */ - String SNAPSHOT_CTRL_URL = "ctrl_url"; - - /** - * Represent the snapshot_data_url xml element - */ - String SNAPSHOT_DATA_URL = "data_url"; - - /** - * Represent the snapshot_max_size xml element - */ - - String SNAPSHOT_MAX_SIZE = "max_size"; - - /** - * Represent the snapshot_n_ptr xml element - */ - String SNAPSHOT_N_PTR = "n_ptr"; - - /** - * Represent the snapshot_session_name xml element - */ - String SNAPSHOT_SESSION_NAME = "session_name"; - - /** - * Represent the snapshots xml element - */ - String SNAPSHOTS = "snapshots"; - /** - * Represent the channel xml element - */ - String CHANNEL = "channel"; - - /** - * Represent the channels xml element - */ - String CHANNELS = "channels"; - - /** - * Represent the domain xml element - */ - String DOMAIN = "domain"; - - /** - * Represent the domains xml element - */ - String DOMAINS = "domains"; - - /** - * Represent the event xml element - */ - String EVENT = "event"; - - /** - * Represent the events xml element - */ - String EVENTS = "events"; - - /** - * Represent the context xml element - */ - String CONTEXT = "context"; - - /** - * Represent the contexts xml element - */ - String CONTEXTS = "contexts"; - - /** - * Represent the attributes xml element - */ - String ATTRIBUTES = "attributes"; - - /** - * Represent the exclusion xml element - */ - String EXCLUSION = "exclusion"; - - /** - * Represent the exclusions xml element - */ - String EXCLUSIONS = "exclusions"; - - /** - * Represent the function_attributes xml element - */ - String FUNCTION_ATTRIBUTES = "function_attributes"; - - /** - * Represent the probe_attributes xml element - */ - String PROBE_ATTRIBUTES = "probe_attributes"; - - /** - * Represent the symbol_name xml element - */ - String SYMBOL_NAME = "symbol_name"; - - /** - * Represent the address xml element - */ - String ADDRESS = "address"; - - /** - * Represent the offset xml element - */ - String OFFSET = "offset"; - - /** - * Represent the name xml element - */ - String NAME = "name"; - - /** - * Represent the enabled xml element - */ - String ENABLED = "enabled"; - - /** - * Represent the overwrite_mode xml element - */ - String OVERWRITE_MODE = "overwrite_mode"; - - /** - * Represent the subbuf_size xml element - */ - String SUBBUF_SIZE = "subbuffer_size"; - - /** - * Represent the num_subbuf xml element - */ - String NUM_SUBBUF = "subbuffer_count"; - - /** - * Represent the switch_timer_interval xml element - */ - String SWITCH_TIMER_INTERVAL = "switch_timer_interval"; - - /** - * Represent the read_timer_interval xml element - */ - String READ_TIMER_INTERVAL = "read_timer_interval"; - - /** - * Represent the output xml element - */ - String OUTPUT = "output"; - - /** - * Represent the output_type xml element - */ - String OUTPUT_TYPE = "output_type"; - - /** - * Represent the tracefile_size xml element - */ - String TRACEFILE_SIZE = "tracefile_size"; - - /** - * Represent the tracefile_count xml element - */ - String TRACEFILE_COUNT = "tracefile_count"; - - /** - * Represent the live_timer_interval xml element - */ - String LIVE_TIMER_INTERVAL = "live_timer_interval"; - - /** - * Represent the type xml element - */ - String TYPE = "type"; - - /** - * Represent the buffer_type xml element - */ - String BUFFER_TYPE = "buffer_type"; - - /** - * Represent the session xml element - */ - String SESSION = "session"; - - /** - * Represent the sessions xml element - */ - String SESSIONS = "sessions"; - - /** - * Represent the perf xml element - */ - String PERF = "perf"; - - /** - * Represent the config xml element - */ - String CONFIG = "config"; - - /** - * Represent the started xml element - */ - String STARTED = "started"; - - /** - * Represent the snapshot_mode xml element - */ - String SNAPSHOT_MODE = "snapshot_mode"; - - /** - * Represent the loglevel xml element - */ - String LOGLEVEL = "loglevel"; - - /** - * Represent the loglevel_type xml element - */ - String LOGLEVEL_TYPE = "loglevel_type"; - - /** - * Represent the filter xml element - */ - String FILTER = "filter"; - - /** - * Represent the snapshot_outputs xml element - */ - String SNAPSHOT_OUTPUTS = "snapshot"; - - /** - * Represent the consumer_output xml element - */ - String CONSUMER_OUTPUT = "consumer_output"; - - /** - * Represent the destination xml element - */ - String DESTINATION = "destination"; - - /** - * Represent the path xml element - */ - String PATH = "path"; - - /** - * Represent the net_output xml element - */ - String NET_OUTPUT = "net_output"; - - /** - * Represent the control_uri xml element - */ - String CONTROL_URI = "control_uri"; - - /** - * Represent the data_uri xml element - */ - String DATA_URI = "data_uri"; - - /** - * Represent the max_size xml element - */ - String MAX_SIZE = "max_size"; -} diff --git a/org.eclipse.linuxtools.lttng2.control/.project b/org.eclipse.linuxtools.lttng2.control/.project deleted file mode 100644 index 7fb3b6d83b..0000000000 --- a/org.eclipse.linuxtools.lttng2.control/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.control - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/org.eclipse.linuxtools.lttng2.control/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.control/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.control/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.control/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.control/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.control/build.properties b/org.eclipse.linuxtools.lttng2.control/build.properties deleted file mode 100644 index fc36845ab8..0000000000 --- a/org.eclipse.linuxtools.lttng2.control/build.properties +++ /dev/null @@ -1,16 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -bin.includes = feature.xml,\ - feature.properties,\ - p2.inf -src.includes = sourceTemplateFeature/p2.inf diff --git a/org.eclipse.linuxtools.lttng2.control/feature.properties b/org.eclipse.linuxtools.lttng2.control/feature.properties deleted file mode 100644 index b376c5c5ba..0000000000 --- a/org.eclipse.linuxtools.lttng2.control/feature.properties +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################### -# 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: -# Ericsson - Initial API and implementation -############################################################################### - -featureName=Linux Tools LTTng Tracer Control - -description=Plug-ins to integrate LTTng tracer control into the workbench. \ -Includes the TMF (Tracing and Monitoring Framework) and CTF (Common Trace Format) features. - -featureProvider=Eclipse Linux Tools - -copyright=Copyright 2013 Ericsson - diff --git a/org.eclipse.linuxtools.lttng2.control/feature.xml b/org.eclipse.linuxtools.lttng2.control/feature.xml deleted file mode 100644 index 564f58ab8a..0000000000 --- a/org.eclipse.linuxtools.lttng2.control/feature.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.control/p2.inf b/org.eclipse.linuxtools.lttng2.control/p2.inf deleted file mode 100644 index 23d394a8da..0000000000 --- a/org.eclipse.linuxtools.lttng2.control/p2.inf +++ /dev/null @@ -1,5 +0,0 @@ -instructions.configure=\ -org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:0,name:Linux Tools,enabled:false); \ -org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:1,name:Linux Tools,enabled:false); - -update.matchExp=providedCapabilities.exists(pc | pc.namespace == 'org.eclipse.equinox.p2.iu' && (pc.name == 'org.eclipse.linuxtools.lttng2.feature.group' || pc.name == 'org.eclipse.linuxtools.lttng2.control.feature.group')) diff --git a/org.eclipse.linuxtools.lttng2.control/pom.xml b/org.eclipse.linuxtools.lttng2.control/pom.xml deleted file mode 100644 index 017a4ef010..0000000000 --- a/org.eclipse.linuxtools.lttng2.control/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.control - 3.2.0-SNAPSHOT - eclipse-feature - - Linux Tools LTTng (Linux Tracing Toolkit) Feature - - org.eclipse.linuxtools.lttng2 - - - - - org.eclipse.tycho.extras - tycho-source-feature-plugin - - - source-feature - package - - source-feature - - - - - - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attached-p2-metadata - package - - p2-metadata - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.control/sourceTemplateFeature/p2.inf b/org.eclipse.linuxtools.lttng2.control/sourceTemplateFeature/p2.inf deleted file mode 100644 index 2ba3d5afca..0000000000 --- a/org.eclipse.linuxtools.lttng2.control/sourceTemplateFeature/p2.inf +++ /dev/null @@ -1,5 +0,0 @@ -instructions.configure=\ -org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:0,name:Linux Tools,enabled:false); \ -org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:1,name:Linux Tools,enabled:false); - -update.matchExp=providedCapabilities.exists(pc | pc.namespace == 'org.eclipse.equinox.p2.iu' && (pc.name == 'org.eclipse.linuxtools.lttng2.source.feature.group' || pc.name == 'org.eclipse.linuxtools.lttng2.control.source.feature.group')) diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.classpath b/org.eclipse.linuxtools.lttng2.kernel.core.tests/.classpath deleted file mode 100644 index 4f3836cfa9..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.project b/org.eclipse.linuxtools.lttng2.kernel.core.tests/.project deleted file mode 100644 index da6c23079b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.kernel.core.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f3fc64575b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,393 +0,0 @@ -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=enabled -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 62cfa90dee..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.kernel.core.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 7ccb4bccff..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.kernel.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.linuxtools.tmf.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.core.tests;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.ctf.core, - org.eclipse.linuxtools.tmf.ctf.core.tests, - org.eclipse.linuxtools.lttng2.kernel.core;bundle-version="3.1.0", - org.eclipse.core.resources, - org.eclipse.linuxtools.statesystem.core, - org.eclipse.linuxtools.lttng2.control.core -Export-Package: org.eclipse.linuxtools.lttng2.kernel.core.tests, - org.eclipse.linuxtools.lttng2.kernel.core.tests.analysis;x-internal:=true, - org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync;x-internal:=true, - org.eclipse.linuxtools.lttng2.kernel.core.tests.perf, - org.eclipse.linuxtools.lttng2.kernel.core.tests.perf.analysis;x-internal:=true, - org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider;x-internal:=true -Import-Package: com.google.common.collect, - org.eclipse.test.performance diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/about.html b/org.eclipse.linuxtools.lttng2.kernel.core.tests/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/build.properties b/org.eclipse.linuxtools.lttng2.kernel.core.tests/build.properties deleted file mode 100644 index 34a39c903e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/build.properties +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -source.. = src/,\ - perf/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties -src.includes = about.html -additional.bundles = org.eclipse.jdt.annotation -jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/AllPerfTests.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/AllPerfTests.java deleted file mode 100644 index 09cfb5f109..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/AllPerfTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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 implementation and API - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.perf; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Run all performance test suites. - * - * @author Alexandre Montplaisir - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - org.eclipse.linuxtools.lttng2.kernel.core.tests.perf.analysis.AllPerfTests.class, - org.eclipse.linuxtools.lttng2.kernel.core.tests.perf.event.matching.AllPerfTests.class -}) -public class AllPerfTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AllPerfTests.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AllPerfTests.java deleted file mode 100644 index 44293ef5b7..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AllPerfTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.tests.perf.analysis; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - AnalysisBenchmark.class -}) -public class AllPerfTests { -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AnalysisBenchmark.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AnalysisBenchmark.java deleted file mode 100644 index ae37bf0da1..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AnalysisBenchmark.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * 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 - * Alexandre Montplaisir - Convert to org.eclipse.test.performance test - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.perf.analysis; - -import static org.junit.Assert.fail; -import static org.junit.Assume.assumeTrue; - -import java.io.File; - -import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; -import org.eclipse.linuxtools.lttng2.kernel.core.trace.LttngKernelTrace; -import org.eclipse.linuxtools.tmf.core.analysis.IAnalysisModule; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; -import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestHelper; -import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.eclipse.test.performance.Dimension; -import org.eclipse.test.performance.Performance; -import org.eclipse.test.performance.PerformanceMeter; -import org.junit.Test; - -/** - * This is a test of the time to build a kernel state system - * - * @author Genevieve Bastien - */ -public class AnalysisBenchmark { - - private static final String TEST_ID = "org.eclipse.linuxtools#LTTng kernel analysis"; - private static final int LOOP_COUNT = 25; - - /** - * Run the benchmark with "trace2" - */ - @Test - public void testTrace2() { - runTest(CtfTmfTestTrace.TRACE2, "Trace2"); - } - - private static void runTest(CtfTmfTestTrace testTrace, String testName) { - assumeTrue(testTrace.exists()); - - Performance perf = Performance.getDefault(); - PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + '#' + testName); - perf.tagAsSummary(pm, "LTTng Kernel Analysis: " + testName, Dimension.CPU_TIME); - - if (testTrace == CtfTmfTestTrace.TRACE2) { - /* Do not show all traces in the global summary */ - perf.tagAsGlobalSummary(pm, "LTTng Kernel Analysis: " + testName, Dimension.CPU_TIME); - } - - for (int i = 0; i < LOOP_COUNT; i++) { - try (IAnalysisModule module = new LttngKernelAnalysisModule(); - LttngKernelTrace trace = new LttngKernelTrace()) { - module.setId("test"); - trace.initTrace(null, testTrace.getPath(), CtfTmfEvent.class); - module.setTrace(trace); - - pm.start(); - TmfTestHelper.executeAnalysis(module); - pm.stop(); - - /* - * Delete the supplementary files, so that the next iteration - * rebuilds the state system. - */ - File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(trace)); - for (File file : suppDir.listFiles()) { - file.delete(); - } - - } catch (TmfAnalysisException | TmfTraceException e) { - fail(e.getMessage()); - } - - } - pm.commit(); - testTrace.dispose(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/AllPerfTests.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/AllPerfTests.java deleted file mode 100644 index a275c6a0c0..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/AllPerfTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.tests.perf.event.matching; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - EventMatchingBenchmark.class, - TraceSynchronizationBenchmark.class -}) -public class AllPerfTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/EventMatchingBenchmark.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/EventMatchingBenchmark.java deleted file mode 100644 index 8ccd66ff71..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/EventMatchingBenchmark.java +++ /dev/null @@ -1,120 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.tests.perf.event.matching; - -import static org.junit.Assume.assumeTrue; - -import java.util.Set; - -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfNetworkEventMatching; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.eclipse.test.performance.Dimension; -import org.eclipse.test.performance.Performance; -import org.eclipse.test.performance.PerformanceMeter; -import org.junit.BeforeClass; -import org.junit.Test; - -import com.google.common.collect.ImmutableSet; - -/** - * Benchmark simple event matching, without trace synchronization - * - * @author Geneviève Bastien - */ -public class EventMatchingBenchmark { - - private static final String TEST_ID = "org.eclipse.linuxtools#Event matching#"; - private static final String TIME = " (time)"; - private static final String MEMORY = " (memory usage)"; - private static final String TEST_SUMMARY = "Event matching"; - - /** - * Initialize some data - */ - @BeforeClass - public static void setUp() { - TmfEventMatching.registerMatchObject(new TcpEventMatching()); - TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); - } - - /** - * Run the benchmark with 2 small traces - */ - @Test - public void testSmallTraces() { - assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); - assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); - try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); - CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { - Set traces = ImmutableSet.of((ITmfTrace) trace1, trace2); - runCpuTest(traces, "Match TCP events", 100); - } - } - - /** - * Run the benchmark with 3 bigger traces - */ - @Test - public void testDjangoTraces() { - assumeTrue(CtfTmfTestTrace.DJANGO_CLIENT.exists()); - assumeTrue(CtfTmfTestTrace.DJANGO_DB.exists()); - assumeTrue(CtfTmfTestTrace.DJANGO_HTTPD.exists()); - try (CtfTmfTrace trace1 = CtfTmfTestTrace.DJANGO_CLIENT.getTrace(); - CtfTmfTrace trace2 = CtfTmfTestTrace.DJANGO_DB.getTrace(); - CtfTmfTrace trace3 = CtfTmfTestTrace.DJANGO_HTTPD.getTrace();) { - Set traces = ImmutableSet.of((ITmfTrace) trace1, trace2, trace3); - runCpuTest(traces, "Django traces", 10); - runMemoryTest(traces, "Django traces", 10); - } - } - - private static void runCpuTest(Set testTraces, String testName, int loop_count) { - Performance perf = Performance.getDefault(); - PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + TIME); - perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + TIME, Dimension.CPU_TIME); - - for (int i = 0; i < loop_count; i++) { - TmfNetworkEventMatching traceMatch = new TmfNetworkEventMatching(testTraces); - - pm.start(); - traceMatch.matchEvents(); - pm.stop(); - } - pm.commit(); - - } - - /* Benchmark memory used by the algorithm */ - private static void runMemoryTest(Set testTraces, String testName, int loop_count) { - Performance perf = Performance.getDefault(); - PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + MEMORY); - perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + MEMORY, Dimension.USED_JAVA_HEAP); - - for (int i = 0; i < loop_count; i++) { - TmfNetworkEventMatching traceMatch = new TmfNetworkEventMatching(testTraces); - - System.gc(); - pm.start(); - traceMatch.matchEvents(); - System.gc(); - pm.stop(); - } - pm.commit(); - - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java deleted file mode 100644 index f4ab323eb6..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.tests.perf.event.matching; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assume.assumeTrue; - -import java.util.Arrays; - -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; -import org.eclipse.linuxtools.tmf.core.synchronization.SynchronizationAlgorithm; -import org.eclipse.linuxtools.tmf.core.synchronization.SynchronizationManager; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.eclipse.test.performance.Dimension; -import org.eclipse.test.performance.Performance; -import org.eclipse.test.performance.PerformanceMeter; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Benchmark trace synchronization - * - * @author Geneviève Bastien - */ -public class TraceSynchronizationBenchmark { - - private static final String TEST_ID = "org.eclipse.linuxtools#Trace synchronization#"; - private static final String TIME = " (time)"; - private static final String MEMORY = " (memory usage)"; - private static final String TEST_SUMMARY = "Trace synchronization"; - - /** - * Initialize some data - */ - @BeforeClass - public static void setUp() { - TmfEventMatching.registerMatchObject(new TcpEventMatching()); - TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); - } - - /** - * Run the benchmark with 2 small traces - */ - @Test - public void testSmallTraces() { - assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); - assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); - try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); - CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { - ITmfTrace[] traces = { trace1, trace2 }; - runCpuTest(traces, "Match TCP events", 40); - } - } - - /** - * Run the benchmark with 3 bigger traces - */ - @Test - public void testDjangoTraces() { - assumeTrue(CtfTmfTestTrace.DJANGO_CLIENT.exists()); - assumeTrue(CtfTmfTestTrace.DJANGO_DB.exists()); - assumeTrue(CtfTmfTestTrace.DJANGO_HTTPD.exists()); - try (CtfTmfTrace trace1 = CtfTmfTestTrace.DJANGO_CLIENT.getTrace(); - CtfTmfTrace trace2 = CtfTmfTestTrace.DJANGO_DB.getTrace(); - CtfTmfTrace trace3 = CtfTmfTestTrace.DJANGO_HTTPD.getTrace();) { - ITmfTrace[] traces = { trace1, trace2, trace3 }; - runCpuTest(traces, "Django traces", 10); - runMemoryTest(traces, "Django traces", 10); - } - } - - private static void runCpuTest(ITmfTrace[] testTraces, String testName, int loop_count) { - Performance perf = Performance.getDefault(); - PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + TIME); - perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + TIME, Dimension.CPU_TIME); - - for (int i = 0; i < loop_count; i++) { - pm.start(); - SynchronizationManager.synchronizeTraces(null, Arrays.asList(testTraces), true); - pm.stop(); - } - pm.commit(); - - } - - /* Benchmark memory used by the algorithm */ - private static void runMemoryTest(ITmfTrace[] testTraces, String testName, int loop_count) { - Performance perf = Performance.getDefault(); - PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + MEMORY); - perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + MEMORY, Dimension.USED_JAVA_HEAP); - - for (int i = 0; i < loop_count; i++) { - - System.gc(); - pm.start(); - SynchronizationAlgorithm algo = SynchronizationManager.synchronizeTraces(null, Arrays.asList(testTraces), true); - assertNotNull(algo); - - System.gc(); - pm.stop(); - } - pm.commit(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/plugin.properties b/org.eclipse.linuxtools.lttng2.kernel.core.tests/plugin.properties deleted file mode 100644 index 9d29e7f690..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/plugin.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.kernel.core.tests -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Kernel Analysis Core Tests Plug-in \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/pom.xml b/org.eclipse.linuxtools.lttng2.kernel.core.tests/pom.xml deleted file mode 100644 index 85f8e3c8c7..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.kernel.core.tests - 3.1.0-SNAPSHOT - eclipse-test-plugin - - Linux Tools LTTng Kernel Analysis Core Tests Plug-in - - - - - - src - - **/*.java - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.7 - - - prepare - validate - - - - - - - run - - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - - **/AllTests.* - - false - false - org.eclipse.platform.ide - - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/ActivatorTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/ActivatorTest.java deleted file mode 100644 index e1af96c5f6..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/ActivatorTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 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.linuxtools.lttng2.kernel.core.tests; - -import junit.framework.TestCase; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * ActivatorTest - *

- * Test suite for the Activator class - *

- */ -@SuppressWarnings("javadoc") -public class ActivatorTest extends TestCase { - - // ------------------------------------------------------------------------ - // JUnit - // ------------------------------------------------------------------------ - - @BeforeClass - public static void setUpBeforeClass() { - } - - @AfterClass - public static void tearDownAfterClass() { - } - - /** - * @throws java.lang.Exception - */ - @Before - @Override - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - @Override - public void tearDown() throws Exception { - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#Activator()}. - */ - @Test - public void testActivator() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#getDefault()}. - */ - @Test - public void testGetDefault() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#start(org.osgi.framework.BundleContext)}. - */ - @Test - public void testStartBundleContext() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#stop(org.osgi.framework.BundleContext)}. - */ - @Test - public void testStopBundleContext() { - assertTrue(true); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/AllTests.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/AllTests.java deleted file mode 100644 index 0356df6b3c..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.tests; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Runner for the lttng2.kernel unit tests. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - ActivatorTest.class, - org.eclipse.linuxtools.lttng2.kernel.core.tests.analysis.AllTests.class, - org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider.TestAll.class, - org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync.AllTests.class -}) -public class AllTests { } diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/AllTests.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/AllTests.java deleted file mode 100644 index 4198b6832e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.tests.analysis; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite for org.eclipse.linuxtools.lttng2.kernel.core.analysis package - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - LttngKernelAnalysisTest.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/LttngKernelAnalysisTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/LttngKernelAnalysisTest.java deleted file mode 100644 index e63a907da0..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/LttngKernelAnalysisTest.java +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.tests.analysis; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -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 static org.junit.Assume.assumeTrue; - -import java.util.List; -import java.util.Set; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.LttngStrings; -import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; -import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; -import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestHelper; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -import com.google.common.collect.ImmutableSet; - -/** - * Test the {@link LttngKernelAnalysisModule} class - * - * @author Geneviève Bastien - */ -public class LttngKernelAnalysisTest { - - private ITmfTrace fTrace; - private LttngKernelAnalysisModule fKernelAnalysisModule; - - /** - * Class setup - */ - @BeforeClass - public static void setUpClass() { - assumeTrue(CtfTmfTestTrace.KERNEL.exists()); - } - - /** - * Set-up the test - */ - @Before - public void setUp() { - fKernelAnalysisModule = new LttngKernelAnalysisModule(); - fTrace = CtfTmfTestTrace.KERNEL.getTrace(); - } - - /** - * Dispose test objects - */ - @After - public void tearDown() { - fTrace.dispose(); - fKernelAnalysisModule.dispose(); - } - - /** - * Test the LTTng kernel analysis execution - */ - @Test - public void testAnalysisExecution() { - fKernelAnalysisModule.setId("test"); - try { - fKernelAnalysisModule.setTrace(fTrace); - } catch (TmfAnalysisException e) { - fail(e.getMessage()); - } - // Assert the state system has not been initialized yet - ITmfStateSystem ss = fKernelAnalysisModule.getStateSystem(); - assertNull(ss); - - assertTrue(TmfTestHelper.executeAnalysis(fKernelAnalysisModule)); - - ss = fKernelAnalysisModule.getStateSystem(); - assertNotNull(ss); - - List quarks = ss.getQuarks("*"); - assertFalse(quarks.isEmpty()); - } - - /** - * Test the canExecute method on valid and invalid traces - */ - @Test - public void testCanExecute() { - /* Test with a valid kernel trace */ - assertNotNull(fTrace); - assertTrue(fKernelAnalysisModule.canExecute(fTrace)); - - /* Test with a CTF trace that does not have required events */ - assumeTrue(CtfTmfTestTrace.CYG_PROFILE.exists()); - try (CtfTmfTrace trace = CtfTmfTestTrace.CYG_PROFILE.getTrace();) { - /* - * TODO: This should be false, but for now there is no mandatory - * events in the kernel analysis so it will return true. - */ - assertTrue(fKernelAnalysisModule.canExecute(trace)); - } - } - - /** - * Test for {@link LttngKernelAnalysisModule#getAnalysisRequirements()} - */ - @Test - public void testGetAnalysisRequirements() { - Iterable requirements = fKernelAnalysisModule.getAnalysisRequirements(); - assertNotNull(requirements); - - /* There should be the event and domain type */ - TmfAnalysisRequirement eventReq = null; - TmfAnalysisRequirement domainReq = null; - int numberOfRequirement = 0; - for (TmfAnalysisRequirement requirement : requirements) { - ++numberOfRequirement; - if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_EVENT)) { - eventReq = requirement; - } else if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN)) { - domainReq = requirement; - } - } - assertNotNull(eventReq); - assertNotNull(domainReq); - - /* There should be two requirements */ - assertEquals(2, numberOfRequirement); - - /* Verify the content of the requirements themselves */ - /* Domain should be kernel */ - assertEquals(1, domainReq.getValues().size()); - for (String domain : domainReq.getValues()) { - assertEquals(SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL, domain); - } - - /* Events */ - Set expectedEvents = ImmutableSet.of( - LttngStrings.EXIT_SYSCALL, - LttngStrings.IRQ_HANDLER_ENTRY, - LttngStrings.IRQ_HANDLER_EXIT, - LttngStrings.SOFTIRQ_ENTRY, - LttngStrings.SOFTIRQ_EXIT, - LttngStrings.SOFTIRQ_RAISE, - LttngStrings.SCHED_SWITCH, - LttngStrings.SCHED_PROCESS_FORK, - LttngStrings.SCHED_PROCESS_EXIT, - LttngStrings.SCHED_PROCESS_FREE, - LttngStrings.STATEDUMP_PROCESS_STATE, - LttngStrings.SCHED_WAKEUP, - LttngStrings.SCHED_WAKEUP_NEW, - /* Add the prefix for syscalls */ - LttngStrings.SYSCALL_PREFIX - ); - - assertEquals(14, eventReq.getValues().size()); - for (String event : eventReq.getValues()) { - assertTrue("Unexpected event " + event, expectedEvents.contains(event)); - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/AllTests.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/AllTests.java deleted file mode 100644 index e3d58507f4..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 É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 implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite for org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matching - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - ExperimentSyncTest.class, - MatchAndSyncTest.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/ExperimentSyncTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/ExperimentSyncTest.java deleted file mode 100644 index 1e7b2447b7..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/ExperimentSyncTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 É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 implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assume.assumeTrue; - -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; -import org.eclipse.linuxtools.tmf.core.synchronization.ITmfTimestampTransform; -import org.eclipse.linuxtools.tmf.core.synchronization.SynchronizationAlgorithm; -import org.eclipse.linuxtools.tmf.core.synchronization.TimestampTransformFactory; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.core.trace.TmfExperiment; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Tests for experiment syncing - * - * @author Geneviève Bastien - */ -@SuppressWarnings("nls") -public class ExperimentSyncTest { - - private static final String EXPERIMENT = "MyExperiment"; - private static int BLOCK_SIZE = 1000; - - /** - * Initialize some data - */ - @BeforeClass - public static void setUp() { - TmfEventMatching.registerMatchObject(new TcpEventMatching()); - TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); - } - - /** - * Testing experiment synchronization - */ - @Test - public void testExperimentSync() { - assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); - assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); - try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); - CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { - - ITmfTrace[] traces = { trace1, trace2 }; - TmfExperiment experiment = new TmfExperiment(traces[0].getEventType(), EXPERIMENT, traces, BLOCK_SIZE); - - SynchronizationAlgorithm syncAlgo = experiment.synchronizeTraces(true); - - ITmfTimestampTransform tt1 = syncAlgo.getTimestampTransform(trace1); - ITmfTimestampTransform tt2 = syncAlgo.getTimestampTransform(trace2); - - trace1.setTimestampTransform(tt1); - trace2.setTimestampTransform(tt2); - - assertEquals("TmfTimestampLinear [ slope = 0.9999413783703139011056845831168394, offset = 79796507913179.33347660124688298171 ]", tt1.toString()); - assertEquals(TimestampTransformFactory.getDefaultTransform(), tt2); - - assertEquals(syncAlgo.getTimestampTransform(trace1.getHostId()), trace1.getTimestampTransform()); - assertEquals(syncAlgo.getTimestampTransform(trace2.getHostId()), trace2.getTimestampTransform()); - - } - } - - /** - * Testing synchronization with 3 traces, one of which synchronizes with - * both other - */ - @Test - public void testDjangoExperimentSync() { - assumeTrue(CtfTmfTestTrace.DJANGO_CLIENT.exists()); - assumeTrue(CtfTmfTestTrace.DJANGO_DB.exists()); - assumeTrue(CtfTmfTestTrace.DJANGO_HTTPD.exists()); - try (CtfTmfTrace trace1 = CtfTmfTestTrace.DJANGO_CLIENT.getTrace(); - CtfTmfTrace trace2 = CtfTmfTestTrace.DJANGO_DB.getTrace(); - CtfTmfTrace trace3 = CtfTmfTestTrace.DJANGO_HTTPD.getTrace();) { - ITmfTrace[] traces = { trace1, trace2, trace3 }; - TmfExperiment experiment = new TmfExperiment(traces[0].getEventType(), EXPERIMENT, traces, BLOCK_SIZE); - - SynchronizationAlgorithm syncAlgo = experiment.synchronizeTraces(true); - - ITmfTimestampTransform tt1 = syncAlgo.getTimestampTransform(trace1); - ITmfTimestampTransform tt2 = syncAlgo.getTimestampTransform(trace2); - ITmfTimestampTransform tt3 = syncAlgo.getTimestampTransform(trace3); - - trace1.setTimestampTransform(tt1); - trace2.setTimestampTransform(tt2); - trace3.setTimestampTransform(tt3); - - assertEquals(TimestampTransformFactory.getDefaultTransform(), tt1); - assertEquals("TmfTimestampLinear [ slope = 0.9999996313017589597204633828681240, offset = 498490309972.0038068817738527724192 ]", tt2.toString()); - assertEquals("TmfTimestampLinear [ slope = 1.000000119014882262265342419815932, offset = -166652893534.6189900382736187431134 ]", tt3.toString()); - - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/MatchAndSyncTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/MatchAndSyncTest.java deleted file mode 100644 index e8e7b514ab..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/MatchAndSyncTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 É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 implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfNetworkEventMatching; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.junit.Test; - -/** - * Tests for {@link TcpEventMatching} - * - * @author Geneviève Bastien - */ -@SuppressWarnings("nls") -public class MatchAndSyncTest { - - /** - * Testing the packet matching - */ - @Test - public void testMatching() { - final String cr = System.getProperty("line.separator"); - assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); - assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); - try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); - CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { - - List tracearr = new LinkedList<>(); - tracearr.add(trace1); - tracearr.add(trace2); - - TmfEventMatching.registerMatchObject(new TcpEventMatching()); - TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); - - TmfNetworkEventMatching twoTraceMatch = new TmfNetworkEventMatching(tracearr); - assertTrue(twoTraceMatch.matchEvents()); - - String stats = twoTraceMatch.toString(); - assertEquals("TmfEventMatches [ Number of matches found: 46 ]" + - "Trace 0:" + cr + - " 3 unmatched incoming events" + cr + - " 2 unmatched outgoing events" + cr + - "Trace 1:" + cr + - " 2 unmatched incoming events" + cr + - " 1 unmatched outgoing events" + cr, stats); - - } - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/GenerateTestValues.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/GenerateTestValues.java deleted file mode 100644 index dd85c0e477..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/GenerateTestValues.java +++ /dev/null @@ -1,141 +0,0 @@ -/******************************************************************************* - * 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: - * Alexandre Montplaisir - Initial API and implementation - ******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; - -import java.io.File; -import java.io.FileWriter; -import java.io.PrintWriter; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; - -/** - * Small program to regenerate the values used in "TestValues.java" from the - * current LTTng-kernel state provider. - * - * It will write its output the a file called 'TestValues.java' in your - * temporary files directory. - * - * @author Alexandre Montplaisir - */ -public class GenerateTestValues { - - private static CtfTmfTestTrace testTrace = CtfTmfTestTrace.TRACE2; - private static final long targetTimestamp = 18670067372290L + 1331649577946812237L; - private static final String INDENT = " "; - - /** - * Run the program - * - * @param args - * Command-line arguments, unused. - * @throws Exception - * I'm messing with Exception. Come at me bro! - */ - public static void main(String[] args) throws Exception { - if (!testTrace.exists()) { - System.err.println("Trace files not present."); - return; - } - - /* Prepare the files */ - File logFile = File.createTempFile("TestValues", ".java"); - try (final CtfTmfTrace trace = testTrace.getTrace(); - PrintWriter writer = new PrintWriter(new FileWriter(logFile), true); - /* Build and query the state system */ - TmfStateSystemAnalysisModule module = new TmfStateSystemAnalysisModule() { - @Override - protected ITmfStateProvider createStateProvider() { - return new LttngKernelStateProvider(trace); - } - - @Override - protected String getSsFileName() { - return "test-values"; - } - };) { - module.setTrace(trace); - module.setId("test-values"); - module.schedule(); - module.waitForCompletion(); - ITmfStateSystem ssq = module.getStateSystem(); - if (ssq == null) { - throw new IllegalStateException(); - } - - List fullState = ssq.queryFullState(targetTimestamp); - - /* Start printing the java file's contents */ - writer.println("interface TestValues {"); - writer.println(); - writer.println(INDENT + "static final int size = " + fullState.size() + ";"); - writer.println(); - - /* Print the array contents */ - writer.println(INDENT + "static final long[] startTimes = {"); - for (ITmfStateInterval interval : fullState) { - writer.println(INDENT + INDENT + String.valueOf(interval.getStartTime()) + "L,"); - } - writer.println(INDENT + "};"); - writer.println(); - - writer.println(INDENT + "static final long[] endTimes = {"); - for (ITmfStateInterval interval : fullState) { - writer.println(INDENT + INDENT + String.valueOf(interval.getEndTime()) + "L,"); - } - writer.println(INDENT + "};"); - writer.println(); - - writer.println(INDENT + "static final ITmfStateValue[] values = {"); - for (ITmfStateInterval interval : fullState) { - ITmfStateValue val = interval.getStateValue(); - writer.print(INDENT + INDENT); - - switch (val.getType()) { - case NULL: - writer.println("TmfStateValue.nullValue(),"); - break; - case INTEGER: - writer.println("TmfStateValue.newValueInt(" + val.unboxInt() + "),"); - break; - case LONG: - writer.println("TmfStateValue.newValueLong(" + val.unboxLong() + "),"); - break; - case DOUBLE: - writer.println("TmfStateValue.newValueDouble(" + val.unboxDouble() + "),"); - break; - case STRING: - writer.println("TmfStateValue.newValueString(\"" + val.unboxStr() + "\"),"); - break; - default: - writer.println(val.toString()); - break; - } - } - writer.println(INDENT + "};"); - - writer.println("}"); - writer.println(); - - } - System.exit(0); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/LttngKernelStateProviderTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/LttngKernelStateProviderTest.java deleted file mode 100644 index e6e8074ed0..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/LttngKernelStateProviderTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Ericsson - * Copyright (c) 2010, 2011 École Polytechnique de Montréal - * Copyright (c) 2010, 2011 Alexandre Montplaisir - * - * 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.linuxtools.lttng2.kernel.core.tests.stateprovider; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assume.assumeTrue; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Tests for the {@link LttngKernelStateProvider} - * - * @author Alexandre Montplaisir - */ -public class LttngKernelStateProviderTest { - - private static final CtfTmfTestTrace testTrace = CtfTmfTestTrace.TRACE2; - - private static ITmfStateProvider input; - - /** - * Set-up. - */ - @BeforeClass - public static void initialize() { - assumeTrue(testTrace.exists()); - input = new LttngKernelStateProvider(testTrace.getTrace()); - - } - - /** - * Test loading the state provider. - */ - @Test - public void testOpening() { - long testStartTime; - testStartTime = input.getStartTime(); - assertEquals(testStartTime, StateSystemTest.startTime); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java deleted file mode 100644 index 5e33dcdbd6..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - * 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: - * Alexandre Montplaisir - Initial API and implementation - * Bernd Hufmann - Use state system analysis module instead of factory - ******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.junit.After; -import org.junit.Test; - -/** - * State system tests using a partial history. - * - * @author Alexandre Montplaisir - */ -public class PartialStateSystemTest extends StateSystemTest { - - private static final @NonNull String TEST_FILE_NAME = "test-partial"; - - private File stateFile; - private TestLttngKernelAnalysisModule module; - - @Override - protected ITmfStateSystem initialize() { - stateFile = new File(TmfTraceManager.getSupplementaryFileDir(testTrace.getTrace()) + TEST_FILE_NAME); - if (stateFile.exists()) { - stateFile.delete(); - } - - module = new TestLttngKernelAnalysisModule(TEST_FILE_NAME); - try { - module.setTrace(testTrace.getTrace()); - } catch (TmfAnalysisException e) { - fail(); - } - module.schedule(); - assertTrue(module.waitForCompletion()); - return module.getStateSystem(); - } - - /** - * Class clean-up - */ - @After - public void cleanup() { - if (module != null) { - module.close(); - } - if (stateFile != null) { - stateFile.delete(); - } - } - - /** - * Partial histories cannot get the intervals' end times. The fake value that - * is returned is equal to the query's timestamp. So override this here - * so that {@link #testFullQueryThorough} keeps working. - */ - @Override - protected long getEndTimes(int idx) { - return interestingTimestamp1; - } - - // ------------------------------------------------------------------------ - // Skip tests using single-queries (unsupported in partial history) - // ------------------------------------------------------------------------ - - @Override - @Test(expected = UnsupportedOperationException.class) - public void testSingleQuery1() { - super.testSingleQuery1(); - } - - @Override - @Test(expected = UnsupportedOperationException.class) - public void testRangeQuery1() { - super.testRangeQuery1(); - } - - @Override - @Test(expected = UnsupportedOperationException.class) - public void testRangeQuery2() { - super.testRangeQuery2(); - } - - @Override - @Test(expected = UnsupportedOperationException.class) - public void testRangeQuery3() { - super.testRangeQuery3(); - } - - @Override - @Test(expected = UnsupportedOperationException.class) - public void testSingleQueryInvalidTime1() throws TimeRangeException { - super.testSingleQueryInvalidTime1(); - } - - @Override - @Test(expected = UnsupportedOperationException.class) - public void testSingleQueryInvalidTime2() throws TimeRangeException { - super.testSingleQueryInvalidTime2(); - } - - @Override - @Test(expected = UnsupportedOperationException.class) - public void testRangeQueryInvalidTime1() throws TimeRangeException { - super.testRangeQueryInvalidTime1(); - } - - @Override - @Test(expected = UnsupportedOperationException.class) - public void testRangeQueryInvalidTime2() throws TimeRangeException { - super.testRangeQueryInvalidTime2(); - } - - @NonNullByDefault - private static class TestLttngKernelAnalysisModule extends TmfStateSystemAnalysisModule { - - private final String htFileName; - - /** - * Constructor adding the views to the analysis - * @param htFileName - * The History File Name - */ - public TestLttngKernelAnalysisModule(String htFileName) { - super(); - this.htFileName = htFileName; - } - - @Override - public void setTrace(@Nullable ITmfTrace trace) throws TmfAnalysisException { - if (!(trace instanceof CtfTmfTrace)) { - throw new IllegalStateException("TestLttngKernelAnalysisModule: trace should be of type CtfTmfTrace"); //$NON-NLS-1$ - } - super.setTrace(trace); - } - - @Override - protected ITmfStateProvider createStateProvider() { - return new LttngKernelStateProvider(getTrace()); - } - - @Override - protected StateSystemBackendType getBackendType() { - return StateSystemBackendType.PARTIAL; - } - - @Override - protected String getSsFileName() { - return htFileName; - } - - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java deleted file mode 100644 index a8a0f62db7..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 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 - * Bernd Hufmann - Use state system analysis module instead of factory - ******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.junit.After; -import org.junit.Test; - -/** - * State system tests using a full history back-end and the LTTng kernel state - * input. - * - * @author Alexandre Montplaisir - */ -public class StateSystemFullHistoryTest extends StateSystemTest { - - private static final @NonNull String TEST_FILE_NAME = "test.ht"; - private static final @NonNull String BENCHMARK_FILE_NAME = "test.benchmark.ht"; - - private File stateFile; - private File stateFileBenchmark; - private TestLttngKernelAnalysisModule module; - - @Override - protected ITmfStateSystem initialize() { - stateFile = createStateFile(TEST_FILE_NAME); - stateFileBenchmark = createStateFile(BENCHMARK_FILE_NAME); - - module = new TestLttngKernelAnalysisModule(TEST_FILE_NAME); - try { - module.setTrace(testTrace.getTrace()); - } catch (TmfAnalysisException e) { - fail(); - } - module.schedule(); - assertTrue(module.waitForCompletion()); - return module.getStateSystem(); - } - - /** - * Clean-up - */ - @After - public void cleanup() { - if (module != null) { - module.close(); - } - if (stateFile != null) { - stateFile.delete(); - } - if (stateFileBenchmark != null) { - stateFileBenchmark.delete(); - } - } - - // ------------------------------------------------------------------------ - // Tests specific to a full-history - // ------------------------------------------------------------------------ - - /** - * Rebuild independently so we can benchmark it. Too bad JUnit doesn't allow - * us to @Test the @BeforeClass... - */ - @Test - public void testBuild() { - try (TestLttngKernelAnalysisModule module2 = - new TestLttngKernelAnalysisModule(BENCHMARK_FILE_NAME);) { - try { - module2.setTrace(testTrace.getTrace()); - } catch (TmfAnalysisException e) { - fail(); - } - module2.schedule(); - assertTrue(module2.waitForCompletion()); - ITmfStateSystem ssb2 = module2.getStateSystem(); - - assertNotNull(ssb2); - assertEquals(startTime, ssb2.getStartTime()); - assertEquals(endTime, ssb2.getCurrentEndTime()); - } - } - - /** - * Test re-opening the existing file. - */ - @Test - public void testOpenExistingStateFile() { - /* 'newStateFile' should have already been created */ - try (TestLttngKernelAnalysisModule module2 = new TestLttngKernelAnalysisModule(TEST_FILE_NAME);) { - try { - module2.setTrace(testTrace.getTrace()); - } catch (TmfAnalysisException e) { - fail(); - } - module2.schedule(); - assertTrue(module2.waitForCompletion()); - ITmfStateSystem ssb2 = module2.getStateSystem(); - - assertNotNull(ssb2); - assertEquals(startTime, ssb2.getStartTime()); - assertEquals(endTime, ssb2.getCurrentEndTime()); - } - } - - @NonNullByDefault - private static class TestLttngKernelAnalysisModule extends TmfStateSystemAnalysisModule { - - private final String htFileName; - - /** - * Constructor adding the views to the analysis - * @param htFileName - * The History File Name - */ - public TestLttngKernelAnalysisModule(String htFileName) { - super(); - this.htFileName = htFileName; - } - - @Override - public void setTrace(@Nullable ITmfTrace trace) throws TmfAnalysisException { - if (!(trace instanceof CtfTmfTrace)) { - throw new IllegalStateException("TestLttngKernelAnalysisModule: trace should be of type CtfTmfTrace"); //$NON-NLS-1$ - } - super.setTrace(trace); - } - - @Override - protected ITmfStateProvider createStateProvider() { - return new LttngKernelStateProvider(getTrace()); - } - - @Override - protected StateSystemBackendType getBackendType() { - return StateSystemBackendType.FULL; - } - - @Override - protected String getSsFileName() { - return htFileName; - } - } - - private static File createStateFile(String name) { - File file = new File(TmfTraceManager.getSupplementaryFileDir(testTrace.getTrace()) + name); - if (file.exists()) { - file.delete(); - } - return file; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java deleted file mode 100644 index 80cec1cbd7..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * 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: - * Alexandre Montplaisir - Initial API and implementation - * Bernd Hufmann - Use state system analysis module instead of factory - ******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.junit.After; - -/** - * State system tests using the in-memory back-end. - * - * @author Alexandre Montplaisir - */ -public class StateSystemInMemoryTest extends StateSystemTest { - - private TestLttngKernelAnalysisModule module; - - @Override - protected ITmfStateSystem initialize() { - module = new TestLttngKernelAnalysisModule(); - try { - module.setTrace(testTrace.getTrace()); - } catch (TmfAnalysisException e) { - fail(); - } - module.schedule(); - assertTrue(module.waitForCompletion()); - return module.getStateSystem(); - } - - /** - * Class cleanup - */ - @After - public void cleanup() { - if (module != null) { - module.close(); - } - } - - private static class TestLttngKernelAnalysisModule extends TmfStateSystemAnalysisModule { - - /** - * Constructor adding the views to the analysis - */ - public TestLttngKernelAnalysisModule() { - super(); - } - - @Override - public void setTrace(ITmfTrace trace) throws TmfAnalysisException { - if (!(trace instanceof CtfTmfTrace)) { - throw new IllegalStateException("TestLttngKernelAnalysisModule: trace should be of type CtfTmfTrace"); //$NON-NLS-1$ - } - super.setTrace(trace); - } - - @Override - protected ITmfStateProvider createStateProvider() { - return new LttngKernelStateProvider(getTrace()); - } - - @Override - protected StateSystemBackendType getBackendType() { - return StateSystemBackendType.INMEM; - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java deleted file mode 100644 index 32e1ed23f7..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java +++ /dev/null @@ -1,431 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Ericsson - * Copyright (c) 2010, 2011 École Polytechnique de Montréal - * Copyright (c) 2010, 2011 Alexandre Montplaisir - * - * 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.linuxtools.lttng2.kernel.core.tests.stateprovider; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.junit.Assume.assumeTrue; - -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestRule; -import org.junit.rules.Timeout; - -/** - * Base unit tests for the StateHistorySystem. Extension can be made to test - * different state back-end types or configurations. - * - * @author Alexandre Montplaisir - */ -@SuppressWarnings("javadoc") -public abstract class StateSystemTest { - - /** Timeout the tests after 2 minutes */ - @Rule - public TestRule timeoutRule = new Timeout(120000); - - /** Test trace used for these tests */ - protected static final CtfTmfTestTrace testTrace = CtfTmfTestTrace.TRACE2; - - /** Expected start time of the test trace/state history */ - protected static final long startTime = 1331668247314038062L; - - /** Expected end time of the state history built from the test trace */ - protected static final long endTime = 1331668259054285979L; - - /** Offset in the trace + start time of the trace */ - protected static final long interestingTimestamp1 = 18670067372290L + 1331649577946812237L; - - /** Number of nanoseconds in one second */ - private static final long NANOSECS_PER_SEC = 1000000000L; - - private ITmfStateSystem fixture; - - - /** - * Class set-up - */ - @Before - public void setUp() { - assumeTrue(testTrace.exists()); - fixture = this.initialize(); - assertNotNull(fixture); - } - - protected abstract ITmfStateSystem initialize(); - - @After - public void tearDown() { - if (fixture != null) { - fixture.dispose(); - } - fixture = null; - } - - @Test - public void testFullQuery1() { - List list; - ITmfStateInterval interval; - int quark, valueInt; - String valueStr; - - try { - list = fixture.queryFullState(interestingTimestamp1); - - quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - interval = list.get(quark); - valueInt = interval.getStateValue().unboxInt(); - assertEquals(1397, valueInt); - - quark = fixture.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.EXEC_NAME); - interval = list.get(quark); - valueStr = interval.getStateValue().unboxStr(); - assertEquals("gdbus", valueStr); - - quark = fixture.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.SYSTEM_CALL); - interval = list.get(quark); - valueStr = interval.getStateValue().unboxStr(); - assertTrue(valueStr.equals("sys_poll")); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - @Test - public void testSingleQuery1() { - long timestamp = interestingTimestamp1; - int quark; - ITmfStateInterval interval; - String valueStr; - - try { - quark = fixture.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.EXEC_NAME); - interval = fixture.querySingleState(timestamp, quark); - valueStr = interval.getStateValue().unboxStr(); - assertEquals("gdbus", valueStr); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - /** - * Test a range query (with no resolution parameter, so all intervals) - */ - @Test - public void testRangeQuery1() { - long time1 = interestingTimestamp1; - long time2 = time1 + 1L * NANOSECS_PER_SEC; - int quark; - List intervals; - - try { - quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - intervals = fixture.queryHistoryRange(quark, time1, time2); - assertEquals(487, intervals.size()); /* Number of context switches! */ - assertEquals(1685, intervals.get(100).getStateValue().unboxInt()); - assertEquals(1331668248427681372L, intervals.get(205).getEndTime()); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - /** - * Range query, but with a t2 far off the end of the trace. The result - * should still be valid. - */ - @Test - public void testRangeQuery2() { - List intervals; - - try { - int quark = fixture.getQuarkAbsolute(Attributes.RESOURCES, Attributes.IRQS, "1"); - long ts1 = fixture.getStartTime(); /* start of the trace */ - long ts2 = startTime + 20L * NANOSECS_PER_SEC; /* invalid, but ignored */ - - intervals = fixture.queryHistoryRange(quark, ts1, ts2); - - /* Activity of IRQ 1 over the whole trace */ - assertEquals(65, intervals.size()); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - /** - * Test a range query with a resolution - */ - @Test - public void testRangeQuery3() { - long time1 = interestingTimestamp1; - long time2 = time1 + 1L * NANOSECS_PER_SEC; - long resolution = 1000000; /* One query every millisecond */ - int quark; - List intervals; - - try { - quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - intervals = fixture.queryHistoryRange(quark, time1, time2, resolution, null); - assertEquals(126, intervals.size()); /* Number of context switches! */ - assertEquals(1452, intervals.get(50).getStateValue().unboxInt()); - assertEquals(1331668248815698779L, intervals.get(100).getEndTime()); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - /** - * Ask for a time range outside of the trace's range - */ - @Test(expected = TimeRangeException.class) - public void testFullQueryInvalidTime1() throws TimeRangeException, - StateSystemDisposedException { - long ts = startTime + 20L * NANOSECS_PER_SEC; - fixture.queryFullState(ts); - } - - @Test(expected = TimeRangeException.class) - public void testFullQueryInvalidTime2() throws TimeRangeException, - StateSystemDisposedException { - long ts = startTime - 20L * NANOSECS_PER_SEC; - fixture.queryFullState(ts); - } - - @Test(expected = TimeRangeException.class) - public void testSingleQueryInvalidTime1() throws TimeRangeException { - try { - int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - long ts = startTime + 20L * NANOSECS_PER_SEC; - fixture.querySingleState(ts, quark); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - @Test(expected = TimeRangeException.class) - public void testSingleQueryInvalidTime2() throws TimeRangeException { - try { - int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - long ts = startTime - 20L * NANOSECS_PER_SEC; - fixture.querySingleState(ts, quark); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - @Test(expected = TimeRangeException.class) - public void testRangeQueryInvalidTime1() throws TimeRangeException { - try { - int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - long ts1 = startTime - 20L * NANOSECS_PER_SEC; /* invalid */ - long ts2 = startTime + 1L * NANOSECS_PER_SEC; /* valid */ - fixture.queryHistoryRange(quark, ts1, ts2); - - } catch (AttributeNotFoundException e) { - fail(); - } catch (StateSystemDisposedException e) { - fail(); - } - } - - @Test(expected = TimeRangeException.class) - public void testRangeQueryInvalidTime2() throws TimeRangeException { - try { - int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - long ts1 = startTime - 1L * NANOSECS_PER_SEC; /* invalid */ - long ts2 = startTime + 20L * NANOSECS_PER_SEC; /* invalid */ - fixture.queryHistoryRange(quark, ts1, ts2); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - /** - * Ask for a non-existing attribute - * - * @throws AttributeNotFoundException - */ - @Test(expected = AttributeNotFoundException.class) - public void testQueryInvalidAttribute() throws AttributeNotFoundException { - fixture.getQuarkAbsolute("There", "is", "no", "cow", "level"); - } - - /** - * Query but with the wrong State Value type - */ - @Test(expected = StateValueTypeException.class) - public void testQueryInvalidValuetype1() throws StateValueTypeException { - List list; - ITmfStateInterval interval; - int quark; - - try { - list = fixture.queryFullState(interestingTimestamp1); - quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - interval = list.get(quark); - - /* This is supposed to be an int value */ - interval.getStateValue().unboxStr(); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - @Test(expected = StateValueTypeException.class) - public void testQueryInvalidValuetype2() throws StateValueTypeException { - List list; - ITmfStateInterval interval; - int quark; - - try { - list = fixture.queryFullState(interestingTimestamp1); - quark = fixture.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.EXEC_NAME); - interval = list.get(quark); - - /* This is supposed to be a String value */ - interval.getStateValue().unboxInt(); - - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - fail(); - } - } - - @Test - public void testFullAttributeName() { - try { - int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - String name = fixture.getFullAttributePath(quark); - assertEquals(name, "CPUs/0/Current_thread"); - - } catch (AttributeNotFoundException e) { - fail(); - } - } - - @Test - public void testGetQuarks_begin() { - List list = fixture.getQuarks("*", "1577", Attributes.EXEC_NAME); - - assertEquals(1, list.size()); - } - - @Test - public void testGetQuarks_middle() { - List list = fixture.getQuarks(Attributes.THREADS, "*", Attributes.EXEC_NAME); - - /* Number of different kernel threads in the trace */ - assertEquals(168, list.size()); - } - - @Test - public void testGetQuarks_end() { - List list = fixture.getQuarks(Attributes.THREADS, "1577", "*"); - - /* There should be 4 sub-attributes for each Thread node */ - assertEquals(4, list.size()); - } - - // ------------------------------------------------------------------------ - // Tests verifying the *complete* results of a full queries - // ------------------------------------------------------------------------ - - protected long getStartTimes(int idx) { - return TestValues.startTimes[idx]; - } - - protected long getEndTimes(int idx) { - return TestValues.endTimes[idx]; - } - - protected ITmfStateValue getStateValues(int idx) { - return TestValues.values[idx]; - } - - @Test - public void testFullQueryThorough() { - try { - List state = fixture.queryFullState(interestingTimestamp1); - assertEquals(TestValues.size, state.size()); - - for (int i = 0; i < state.size(); i++) { - /* Test each component of the intervals */ - assertEquals(getStartTimes(i), state.get(i).getStartTime()); - assertEquals(getEndTimes(i), state.get(i).getEndTime()); - assertEquals(i, state.get(i).getAttribute()); - assertEquals(getStateValues(i), state.get(i).getStateValue()); - } - - } catch (StateSystemDisposedException e) { - fail(); - } - } - - @Test - public void testFirstIntervalIsConsidered() { - try { - List list = fixture.queryFullState(1331668248014135800L); - ITmfStateInterval interval = list.get(233); - assertEquals(1331668247516664825L, interval.getStartTime()); - - int valueInt = interval.getStateValue().unboxInt(); - assertEquals(1, valueInt); - - } catch (StateSystemDisposedException e) { - fail(); - } - } - - @Test - public void testParentAttribute() { - String[] path = { "CPUs/0/Current_thread", - "CPUs/0", - "CPUs" }; - try { - int q = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); - for (int i = 0; i < path.length; i++) { - String name = fixture.getFullAttributePath(q); - assertEquals(path[i], name); - q = fixture.getParentAttributeQuark(q); - } - assertEquals(-1, q); - q = fixture.getParentAttributeQuark(q); - assertEquals(-1, q); - } catch (AttributeNotFoundException e) { - fail(); - } - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java deleted file mode 100644 index a6c1d58926..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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 implementation - ******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Runner for the LTTng kernel state system tests. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - LttngKernelStateProviderTest.class, - PartialStateSystemTest.class, - StateSystemFullHistoryTest.class, - StateSystemInMemoryTest.class -}) -public class TestAll { - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestValues.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestValues.java deleted file mode 100644 index 97d469f433..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestValues.java +++ /dev/null @@ -1,2625 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.linuxtools.lttng2.kernel.core.tests.stateprovider; - -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.statesystem.core.statevalue.TmfStateValue; - -/** - * Expected return values of querying test trace #1's state system at time - * "18670067372290L + 1331649577946812237L" - * - * @author Alexandre Montplaisir - */ -interface TestValues { - - static final int size = 863; - - static final long[] startTimes = { - 1331668247314038062L, - 1331668247314038062L, - 1331668248014145796L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247399757985L, - 1331668247316320929L, - 1331668247316334243L, - 1331668247314046266L, - 1331668247314038062L, - 1331668248014183954L, - 1331668247314038062L, - 1331668247327098502L, - 1331668247327098502L, - 1331668247327098502L, - 1331668247327098502L, - 1331668247314038062L, - 1331668247415001807L, - 1331668247415001807L, - 1331668247415001807L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668248013353414L, - 1331668248004935409L, - 1331668247314038062L, - 1331668247314038062L, - 1331668248014184526L, - 1331668248014130616L, - 1331668247314038062L, - 1331668247314038062L, - 1331668248011125682L, - 1331668247314038062L, - 1331668247931793142L, - 1331668247959041965L, - 1331668248011129576L, - 1331668247314038062L, - 1331668247335106720L, - 1331668247335106720L, - 1331668247335106720L, - 1331668247335106720L, - 1331668247931782426L, - 1331668247315274351L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247335112802L, - 1331668247335112802L, - 1331668247335112802L, - 1331668247335112802L, - 1331668247314038062L, - 1331668248004705322L, - 1331668247314038062L, - 1331668248004935409L, - 1331668248004925240L, - 1331668247316553071L, - 1331668247314038062L, - 1331668247399743968L, - 1331668247316925661L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247999256178L, - 1331668247999250697L, - 1331668247318567561L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247999336085L, - 1331668247999327778L, - 1331668247318631139L, - 1331668247314038062L, - 1331668247960265258L, - 1331668247314038062L, - 1331668247903884233L, - 1331668247903869067L, - 1331668247328403934L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247908495390L, - 1331668247908464125L, - 1331668247328921944L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247903840082L, - 1331668247903831313L, - 1331668247329404733L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247960291263L, - 1331668247314038062L, - 1331668247330548245L, - 1331668247314038062L, - 1331668247340039213L, - 1331668247340083580L, - 1331668247966976915L, - 1331668247314038062L, - 1331668248004729173L, - 1331668247314038062L, - 1331668247371137735L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247387196023L, - 1331668247387191465L, - 1331668247376420842L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247400231496L, - 1331668247400218303L, - 1331668247378430187L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247751186217L, - 1331668247314038062L, - 1331668247387136191L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247415047817L, - 1331668247415047817L, - 1331668247415047817L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247400095883L, - 1331668247400085049L, - 1331668247399991225L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247401441000L, - 1331668247401428073L, - 1331668247400779449L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247410754305L, - 1331668247314038062L, - 1331668247519727372L, - 1331668247314038062L, - 1331668247412887695L, - 1331668247314038062L, - 1331668247413704524L, - 1331668247412877246L, - 1331668247410583861L, - 1331668247314038062L, - 1331668247410735104L, - 1331668247410594291L, - 1331668247314038062L, - 1331668247413682702L, - 1331668247410844189L, - 1331668247314038062L, - 1331668247519712481L, - 1331668247411099759L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247924029486L, - 1331668247924012402L, - 1331668247412302666L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247924105876L, - 1331668247924098044L, - 1331668247417574343L, - 1331668247314038062L, - 1331668247314038062L, - 1331668248014184526L, - 1331668248014130616L, - 1331668247417635948L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247928627023L, - 1331668247928621067L, - 1331668247417978805L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247928556625L, - 1331668247928529840L, - 1331668247418470511L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247930341625L, - 1331668247314038062L, - 1331668248014184526L, - 1331668248013793850L, - 1331668247419578477L, - 1331668247314038062L, - 1331668247930328175L, - 1331668247419655652L, - 1331668247314038062L, - 1331668247314038062L, - 1331668248013753736L, - 1331668248013749389L, - 1331668247420382626L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247930579872L, - 1331668247930574368L, - 1331668247420451876L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247926378321L, - 1331668247926367737L, - 1331668247423543945L, - 1331668247314038062L, - 1331668247619316825L, - 1331668247619491008L, - 1331668247314038062L, - 1331668247619505885L, - 1331668247619495072L, - 1331668247434248026L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247434551326L, - 1331668247434546203L, - 1331668247434365352L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247908325947L, - 1331668247908319810L, - 1331668247467380509L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247908677700L, - 1331668247908640244L, - 1331668247467447781L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247869556425L, - 1331668247869544380L, - 1331668247503177108L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247504321893L, - 1331668247504319470L, - 1331668247503423094L, - 1331668247314038062L, - 1331668247314038062L, - 1331668248014183954L, - 1331668248014183954L, - 1331668247512172527L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247539381562L, - 1331668247539369787L, - 1331668247539325848L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247735177820L, - 1331668247735170303L, - 1331668247735128110L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247735168206L, - 1331668247735161964L, - 1331668247735152717L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247775218227L, - 1331668247314038062L, - 1331668247775231079L, - 1331668247775205377L, - 1331668247775191569L, - 1331668247314038062L, - 1331668247775223776L, - 1331668247775218227L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247869483379L, - 1331668247869477795L, - 1331668247869457807L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247941667986L, - 1331668247941650415L, - 1331668247941620894L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - 1331668247314038062L, - }; - - static final long[] endTimes = { - 1331668259054285979L, - 1331668259054285979L, - 1331668248014620024L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054130388L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248014185078L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248014620024L, - 1331668248014620024L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248014548923L, - 1331668248014188534L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248015040151L, - 1331668259054285979L, - 1331668248482983146L, - 1331668248015041609L, - 1331668248015176320L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248483009726L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248015959980L, - 1331668259054285979L, - 1331668248016172023L, - 1331668248016194935L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054136697L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248016556933L, - 1331668248016592456L, - 1331668252511012367L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248016623209L, - 1331668248016645047L, - 1331668252843104826L, - 1331668259054285979L, - 1331668248486545657L, - 1331668259054285979L, - 1331668248502954816L, - 1331668248503000162L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248020364249L, - 1331668248020419523L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248020866943L, - 1331668248020888352L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248531200073L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668257323835062L, - 1331668257323879563L, - 1331668248021867385L, - 1331668259054285979L, - 1331668248175307354L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259051873438L, - 1331668259051879701L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248751061201L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259051838247L, - 1331668259051846351L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668257325265220L, - 1331668257325277639L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668250005943125L, - 1331668259054285979L, - 1331668248014565260L, - 1331668259054285979L, - 1331668250006219013L, - 1331668259054285979L, - 1331668250004649129L, - 1331668250006228246L, - 1331668259054285979L, - 1331668259054285979L, - 1331668250005962644L, - 1331668259054285979L, - 1331668259054285979L, - 1331668250004668081L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248014624125L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248414826115L, - 1331668248414875444L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248420327828L, - 1331668248420342919L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248015353903L, - 1331668248015428919L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248420617453L, - 1331668248420709272L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248421112139L, - 1331668248421137268L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248421291701L, - 1331668259054285979L, - 1331668248014188534L, - 1331668248014188534L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248421940554L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248014548923L, - 1331668248014550770L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248422509298L, - 1331668248422523601L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248424325503L, - 1331668248424394073L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248140683324L, - 1331668248140686546L, - 1331668259054285979L, - 1331668248140727269L, - 1331668248140780012L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251031789570L, - 1331668251031812282L, - 1331668252047037657L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248269586770L, - 1331668248269613258L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248141167328L, - 1331668248141400164L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248141004006L, - 1331668248141028631L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248141324868L, - 1331668248141345677L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248014185078L, - 1331668248014185078L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248539549580L, - 1331668248539579511L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668255234884605L, - 1331668255234905622L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668255234936617L, - 1331668255234941684L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252778982101L, - 1331668259054285979L, - 1331668252779007563L, - 1331668252781320133L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252781341690L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248869653287L, - 1331668248869679933L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248941858743L, - 1331668248941885421L, - 1331668252782929207L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248207116451L, - 1331668248207177650L, - 1331668248207163589L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248207165629L, - 1331668248207212201L, - 1331668248207197204L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248763171129L, - 1331668259054285979L, - 1331668248763179780L, - 1331668259054285979L, - 1331668259054285979L, - 1331668248895005379L, - 1331668248895062414L, - 1331668248895035146L, - 1331668259054285979L, - 1331668259054285979L, - 1331668249000328909L, - 1331668249000373092L, - 1331668249000350716L, - 1331668259054285979L, - 1331668249548101920L, - 1331668259054285979L, - 1331668249947171998L, - 1331668249947269897L, - 1331668249947249018L, - 1331668259054285979L, - 1331668259054285979L, - 1331668249951033184L, - 1331668249951077605L, - 1331668249951058138L, - 1331668259054285979L, - 1331668259054285979L, - 1331668249959079406L, - 1331668259054285979L, - 1331668249959100633L, - 1331668259054285979L, - 1331668259054285979L, - 1331668249970937981L, - 1331668259054285979L, - 1331668249970963407L, - 1331668259054285979L, - 1331668259054285979L, - 1331668250007423753L, - 1331668250007449251L, - 1331668250007428034L, - 1331668259054285979L, - 1331668259054285979L, - 1331668250231124169L, - 1331668250231169946L, - 1331668250231148973L, - 1331668259054285979L, - 1331668259054285979L, - 1331668250326525622L, - 1331668250329519305L, - 1331668250329507458L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251063191270L, - 1331668251063256143L, - 1331668251063222335L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251065026369L, - 1331668251065048462L, - 1331668251065030498L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251065058051L, - 1331668251065091761L, - 1331668251065069765L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251065364590L, - 1331668251065412381L, - 1331668251065407607L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251065462500L, - 1331668251065477027L, - 1331668251065465604L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251065780572L, - 1331668251065836719L, - 1331668251065829440L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251065899750L, - 1331668251065913891L, - 1331668251065902892L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251066057402L, - 1331668251066070617L, - 1331668251066060363L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251066495616L, - 1331668251066520321L, - 1331668251066506338L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251066532840L, - 1331668251066546436L, - 1331668251066535866L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251066658006L, - 1331668251066671812L, - 1331668251066660635L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251066883302L, - 1331668251066906446L, - 1331668251066887423L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251067153808L, - 1331668251067176405L, - 1331668251067157534L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251067407214L, - 1331668251067420770L, - 1331668251067410220L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251067763731L, - 1331668251067818612L, - 1331668251067811009L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251067884367L, - 1331668251067897382L, - 1331668251067887136L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251068275691L, - 1331668251068288692L, - 1331668251068278423L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251068706355L, - 1331668251068719015L, - 1331668251068709290L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251069067645L, - 1331668251069122518L, - 1331668251069116275L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251069178617L, - 1331668251069191305L, - 1331668251069181300L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251069664884L, - 1331668251069684555L, - 1331668251069668097L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251069682852L, - 1331668251069708201L, - 1331668251069690226L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251715054925L, - 1331668259054285979L, - 1331668251715066022L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251803784493L, - 1331668251803827591L, - 1331668251803808547L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251983438636L, - 1331668251983448709L, - 1331668251983441583L, - 1331668259054285979L, - 1331668259054285979L, - 1331668251992993580L, - 1331668251993008591L, - 1331668251992998928L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252022091542L, - 1331668252022091542L, - 1331668252022091542L, - 1331668252022091542L, - 1331668259054285979L, - 1331668252031771660L, - 1331668252031777595L, - 1331668252031773847L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252032463013L, - 1331668252032502964L, - 1331668252032497700L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252032506884L, - 1331668252032559227L, - 1331668252032539402L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252039535067L, - 1331668259054285979L, - 1331668252039537404L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252044008981L, - 1331668252044014257L, - 1331668252044010861L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252044059151L, - 1331668252044064004L, - 1331668252044060420L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252179391423L, - 1331668252184781913L, - 1331668252184772369L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252193425490L, - 1331668252193432385L, - 1331668252193427706L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252253575716L, - 1331668252253592491L, - 1331668252253581852L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252472449352L, - 1331668252472474547L, - 1331668252472458163L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252487295286L, - 1331668252487300925L, - 1331668252487297683L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252495759849L, - 1331668252495766026L, - 1331668252495762178L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252496219924L, - 1331668252496245837L, - 1331668252496228816L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252523291829L, - 1331668252523482082L, - 1331668252523469395L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252764810964L, - 1331668252764829827L, - 1331668252764814570L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252765021775L, - 1331668252765026623L, - 1331668252765023841L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252769399706L, - 1331668259054285979L, - 1331668252769401404L, - 1331668259054285979L, - 1331668252769446847L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252769456141L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252784988923L, - 1331668259054285979L, - 1331668252785262589L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252795062126L, - 1331668259054285979L, - 1331668252795122600L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252828832090L, - 1331668259054285979L, - 1331668252828859292L, - 1331668252828904216L, - 1331668252828866041L, - 1331668259054285979L, - 1331668252829060434L, - 1331668252828992804L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252829505108L, - 1331668259054285979L, - 1331668252829527974L, - 1331668252829719292L, - 1331668252829638887L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252829643060L, - 1331668259054285979L, - 1331668252829660274L, - 1331668259054285979L, - 1331668252829683896L, - 1331668259054285979L, - 1331668252829799248L, - 1331668259054285979L, - 1331668252829802278L, - 1331668259054285979L, - 1331668252829821642L, - 1331668259054285979L, - 1331668252829840961L, - 1331668259054285979L, - 1331668252829859256L, - 1331668259054285979L, - 1331668252829976501L, - 1331668252830107659L, - 1331668252830085595L, - 1331668259054285979L, - 1331668252830154848L, - 1331668252830139534L, - 1331668259054285979L, - 1331668252830212497L, - 1331668252830194969L, - 1331668259054285979L, - 1331668252830382459L, - 1331668252830368625L, - 1331668259054285979L, - 1331668252830526491L, - 1331668252830499169L, - 1331668259054285979L, - 1331668252830576634L, - 1331668252830564658L, - 1331668259054285979L, - 1331668252831112505L, - 1331668252831083126L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252831228714L, - 1331668252831318123L, - 1331668252831301843L, - 1331668259054285979L, - 1331668252831543926L, - 1331668252831527998L, - 1331668259054285979L, - 1331668252831834393L, - 1331668252831817197L, - 1331668259054285979L, - 1331668252832056760L, - 1331668252832046333L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252883172744L, - 1331668252883172744L, - 1331668252883172744L, - 1331668252883172744L, - 1331668259054285979L, - 1331668252885827603L, - 1331668252885827603L, - 1331668252885827603L, - 1331668252885827603L, - 1331668259054285979L, - 1331668252889337098L, - 1331668259054285979L, - 1331668252889396688L, - 1331668252889396688L, - 1331668252889396688L, - 1331668252889396688L, - 1331668252901232798L, - 1331668252901118256L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252901540914L, - 1331668252901540914L, - 1331668252901540914L, - 1331668252901540914L, - 1331668259054285979L, - 1331668252901573889L, - 1331668252901586635L, - 1331668252901577276L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252906764880L, - 1331668252906764880L, - 1331668252906764880L, - 1331668252906764880L, - 1331668259054285979L, - 1331668252912042743L, - 1331668259054285979L, - 1331668252912048618L, - 1331668259054285979L, - 1331668259054285979L, - 1331668252927449371L, - 1331668252927449371L, - 1331668252927449371L, - 1331668252927449371L, - 1331668259054285979L, - 1331668252947156908L, - 1331668252947156908L, - 1331668252947156908L, - 1331668252947156908L, - 1331668259054285979L, - 1331668252947197386L, - 1331668252947197386L, - 1331668252947197386L, - 1331668252947197386L, - 1331668259054285979L, - 1331668253035499713L, - 1331668253035499713L, - 1331668253035499713L, - 1331668253035499713L, - 1331668259054285979L, - 1331668253036766769L, - 1331668253036766769L, - 1331668253036766769L, - 1331668253036766769L, - 1331668259054285979L, - 1331668253037890651L, - 1331668253037890651L, - 1331668253037890651L, - 1331668253037890651L, - 1331668259054285979L, - 1331668253051945128L, - 1331668253051945128L, - 1331668253051945128L, - 1331668253051945128L, - 1331668259054285979L, - 1331668253054627961L, - 1331668253054627961L, - 1331668253054627961L, - 1331668253054627961L, - 1331668259054285979L, - 1331668253057609433L, - 1331668253057609433L, - 1331668253057609433L, - 1331668253057609433L, - 1331668259054285979L, - 1331668253062222314L, - 1331668253062222314L, - 1331668253062222314L, - 1331668253062222314L, - 1331668259054285979L, - 1331668253097239708L, - 1331668253097239708L, - 1331668253097239708L, - 1331668253097239708L, - 1331668259054285979L, - 1331668253097518746L, - 1331668253097518746L, - 1331668253097518746L, - 1331668253097518746L, - 1331668259054285979L, - 1331668253267104284L, - 1331668253267117055L, - 1331668253267107624L, - 1331668259054285979L, - 1331668259054285979L, - 1331668253267342015L, - 1331668253267378405L, - 1331668253267367303L, - 1331668259054285979L, - 1331668259054285979L, - 1331668253278218713L, - 1331668253278218713L, - 1331668253278218713L, - 1331668253278218713L, - 1331668259054285979L, - 1331668253324119756L, - 1331668253324119756L, - 1331668253324119756L, - 1331668253324119756L, - 1331668259054285979L, - 1331668253614347227L, - 1331668253614347227L, - 1331668253614347227L, - 1331668253614347227L, - 1331668259054285979L, - 1331668253619459320L, - 1331668253619459320L, - 1331668253619459320L, - 1331668253619459320L, - 1331668259054285979L, - 1331668253619867625L, - 1331668253619867625L, - 1331668253619867625L, - 1331668253619867625L, - 1331668259054285979L, - 1331668253621486721L, - 1331668253621508851L, - 1331668253621491536L, - 1331668259054285979L, - 1331668259054285979L, - 1331668253622429608L, - 1331668253622429608L, - 1331668253622429608L, - 1331668253622429608L, - 1331668259054285979L, - 1331668253857465365L, - 1331668253857465365L, - 1331668253857465365L, - 1331668253857465365L, - 1331668259054285979L, - 1331668253858125091L, - 1331668253858125091L, - 1331668253858125091L, - 1331668253858125091L, - 1331668259054285979L, - 1331668253910194540L, - 1331668253910194540L, - 1331668253910194540L, - 1331668253910194540L, - 1331668259054285979L, - 1331668253910329721L, - 1331668253910329721L, - 1331668253910329721L, - 1331668253910329721L, - 1331668259054285979L, - 1331668253984922308L, - 1331668253984922308L, - 1331668253984922308L, - 1331668253984922308L, - 1331668259054285979L, - 1331668254004098152L, - 1331668254004098152L, - 1331668254004098152L, - 1331668254004098152L, - 1331668259054285979L, - 1331668254047839900L, - 1331668254047839900L, - 1331668254047839900L, - 1331668254047839900L, - 1331668259054285979L, - 1331668254093066195L, - 1331668254093066195L, - 1331668254093066195L, - 1331668254093066195L, - 1331668259054285979L, - 1331668254106326339L, - 1331668254106326339L, - 1331668254106326339L, - 1331668254106326339L, - 1331668259054285979L, - 1331668255052411647L, - 1331668255052411647L, - 1331668255052411647L, - 1331668255052411647L, - 1331668259054285979L, - 1331668255157088064L, - 1331668255157101973L, - 1331668255157091812L, - 1331668259054285979L, - 1331668259054285979L, - 1331668256244508635L, - 1331668256244508635L, - 1331668256244508635L, - 1331668256244508635L, - 1331668259054285979L, - 1331668257246987050L, - 1331668257247036372L, - 1331668257247027684L, - 1331668259054285979L, - 1331668259054285979L, - 1331668259045096840L, - 1331668259045096840L, - 1331668259045096840L, - 1331668259045096840L, - 1331668259054285979L, - 1331668259052126585L, - 1331668259052126585L, - 1331668259052126585L, - 1331668259052126585L, - 1331668259054285979L, - 1331668259053345550L, - 1331668259054285979L, - 1331668259053349544L, - 1331668259054285979L, - }; - - static final ITmfStateValue[] values = { - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1397), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("lttng-consumerd"), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(5), - TmfStateValue.newValueString("swapper/1"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1432), - TmfStateValue.newValueInt(2), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("lttng-consumerd"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_ppoll"), - TmfStateValue.newValueString("alsa-sink"), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("sys_epoll_wait"), - TmfStateValue.newValueString("lttng-sessiond"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_futex"), - TmfStateValue.newValueString("firefox"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("firefox"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("gnome-terminal"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_select"), - TmfStateValue.newValueString("Xorg"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("metacity"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("kworker/0:1"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("ksoftirqd/0"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_read"), - TmfStateValue.newValueString("rsyslogd"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_futex"), - TmfStateValue.newValueString("rs:main Q:Reg"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("kworker/1:1"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_select"), - TmfStateValue.newValueString("rsyslogd"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_read"), - TmfStateValue.newValueString("bash"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("bamfdaemon"), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("gnome-settings-"), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("unity-2d-shell"), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("unity-2d-panel"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("indicator-multi"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("gdbus"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("dbus-daemon"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("gdbus"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("indicator-appli"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(3), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("gdbus"), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("gdbus"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(5), - TmfStateValue.newValueString("sys_futex"), - TmfStateValue.newValueString("unity-panel-ser"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("hud-service"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("gdbus"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("openvpn"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("firefox"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_futex"), - TmfStateValue.newValueString("thunderbird-bin"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("thunderbird-bin"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("thunderbird-bin"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_futex"), - TmfStateValue.newValueString("thunderbird-bin"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(2), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("gdbus"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_nanosleep"), - TmfStateValue.newValueString("gvfs-afc-volume"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("rtkit-daemon"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("rtkit-daemon"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("thunderbird-bin"), - TmfStateValue.nullValue(), - TmfStateValue.newValueString("sys_poll"), - TmfStateValue.newValueString("thunderbird-bin"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_futex"), - TmfStateValue.newValueString("thunderbird-bin"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.newValueInt(1), - TmfStateValue.newValueString("sys_futex"), - TmfStateValue.newValueString("firefox"), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - TmfStateValue.nullValue(), - }; -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/.classpath b/org.eclipse.linuxtools.lttng2.kernel.core/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/.options b/org.eclipse.linuxtools.lttng2.kernel.core/.options deleted file mode 100644 index eac992d7cb..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/.options +++ /dev/null @@ -1,3 +0,0 @@ -org.eclipse.linuxtools.lttng.core/debug=false -org.eclipse.linuxtools.lttng.core/info=false -org.eclipse.linuxtools.lttng.core/warn=false diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/.project b/org.eclipse.linuxtools.lttng2.kernel.core/.project deleted file mode 100644 index c0a4660e9e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.kernel.core - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 9f3662cd78..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,394 +0,0 @@ -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.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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.pde.prefs deleted file mode 100644 index d92b94fd4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.kernel.core/META-INF/MANIFEST.MF deleted file mode 100644 index fa3410fc2c..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.kernel.core;singleton:=true -Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.tracecompass.ctf.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.ctf.core, - org.eclipse.linuxtools.lttng2.control.core -Export-Package: org.eclipse.linuxtools.internal.lttng2.kernel.core;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui,org.eclipse.linuxtools.lttng2.kernel.core.tests", - org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui,org.eclipse.linuxtools.lttng2.kernel.core.tests", - org.eclipse.linuxtools.lttng2.kernel.core.analysis, - org.eclipse.linuxtools.lttng2.kernel.core.cpuusage, - org.eclipse.linuxtools.lttng2.kernel.core.event.matching, - org.eclipse.linuxtools.lttng2.kernel.core.trace -Import-Package: com.google.common.collect diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/about.html b/org.eclipse.linuxtools.lttng2.kernel.core/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/build.properties b/org.eclipse.linuxtools.lttng2.kernel.core/build.properties deleted file mode 100644 index 244c9d8e3e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/build.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# 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 -############################################################################### - -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/plugin.properties b/org.eclipse.linuxtools.lttng2.kernel.core/plugin.properties deleted file mode 100644 index bfb0525a5d..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/plugin.properties +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################### -# 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 -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.kernel.core -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Kernel Analysis Core Plug-in - -tracetype.type.kernel = LTTng Kernel Trace -analysis.lttngkernel = LTTng Kernel Analysis - -cpuusage.lttng.kernel = CPU usage - diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/plugin.xml b/org.eclipse.linuxtools.lttng2.kernel.core/plugin.xml deleted file mode 100644 index f74134c622..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/plugin.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/pom.xml b/org.eclipse.linuxtools.lttng2.kernel.core/pom.xml deleted file mode 100644 index 4683dcef8f..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.kernel.core - 3.1.0-SNAPSHOT - eclipse-plugin - - Linux Tools LTTng Kernel Analysis Core Plug-in - - - - - - src - - **/*.java - - - - - - org.eclipse.tycho - tycho-source-plugin - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Activator.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Activator.java deleted file mode 100644 index 8629784bc4..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Activator.java +++ /dev/null @@ -1,142 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.core; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; -import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; -import org.osgi.framework.BundleContext; - -/** - * Activator - *

- * 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.linuxtools.lttng2.core"; //$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; - TmfEventMatching.registerMatchObject(new TcpEventMatching()); - TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); - } - - @Override - public void stop(BundleContext context) throws Exception { - plugin = 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)); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Attributes.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Attributes.java deleted file mode 100644 index 1df281e8c8..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Attributes.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.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"; -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/LttngStrings.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/LttngStrings.java deleted file mode 100644 index 044ec9fd29..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/LttngStrings.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.core; - -/** - * This file defines all the known event and field names for LTTng 2.0 kernel - * traces. - * - * Once again, these should not be externalized, since they need to match - * exactly what the tracer outputs. If you want to localize them in a view, you - * should do a mapping in the viewer itself. - * - * @author alexmont - */ -@SuppressWarnings({"javadoc", "nls"}) -public interface LttngStrings { - - /* Event names */ - static final String EXIT_SYSCALL = "exit_syscall"; - static final String IRQ_HANDLER_ENTRY = "irq_handler_entry"; - static final String IRQ_HANDLER_EXIT = "irq_handler_exit"; - static final String SOFTIRQ_ENTRY = "softirq_entry"; - static final String SOFTIRQ_EXIT = "softirq_exit"; - static final String SOFTIRQ_RAISE = "softirq_raise"; - static final String SCHED_SWITCH = "sched_switch"; - static final String SCHED_WAKEUP = "sched_wakeup"; - static final String SCHED_WAKEUP_NEW = "sched_wakeup_new"; - static final String SCHED_PROCESS_FORK = "sched_process_fork"; - static final String SCHED_PROCESS_EXIT = "sched_process_exit"; - static final String SCHED_PROCESS_FREE = "sched_process_free"; - static final String STATEDUMP_PROCESS_STATE = "lttng_statedump_process_state"; - - /* System call names */ - static final String SYSCALL_PREFIX = "sys_"; - static final String COMPAT_SYSCALL_PREFIX = "compat_sys_"; - static final String SYS_CLONE = "sys_clone"; - - /* Field names */ - static final String IRQ = "irq"; - static final String COMM = "comm"; - static final String NAME = "name"; - static final String PID = "pid"; - static final String TID = "tid"; - static final String PPID = "ppid"; - static final String STATUS = "status"; - static final String VEC = "vec"; - static final String PREV_COMM = "prev_comm"; - static final String PREV_TID = "prev_tid"; - static final String PREV_STATE = "prev_state"; - static final String NEXT_COMM = "next_comm"; - static final String NEXT_TID = "next_tid"; - static final String PARENT_TID = "parent_tid"; - static final String CHILD_COMM = "child_comm"; - static final String CHILD_TID = "child_tid"; -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/StateValues.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/StateValues.java deleted file mode 100644 index 53a4efb498..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/StateValues.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.core; - -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.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); -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/TcpEventStrings.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/TcpEventStrings.java deleted file mode 100644 index 2891210aa4..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/TcpEventStrings.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 É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.linuxtools.internal.lttng2.kernel.core; - -/** - * This file defines all the known event and field names used to trace socket - * connection for both the addons module method ( - * {@link org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching} - * ) and the net_data_experimental branch ( - * {@link org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching} - * ). - * - * These events should be eventually mainlined and when this happens, this class - * won't be necessary anymore and they should be moved to {@link LttngStrings} - * class - * - * - * @author Geneviève Bastien - */ -@SuppressWarnings({ "javadoc", "nls" }) -public interface TcpEventStrings { - - /* Event names */ - public static final String INET_CONNECT = "inet_connect"; - public static final String INET_SOCK_CREATE = "inet_sock_create"; - public static final String INET_SOCK_LOCAL_OUT = "inet_sock_local_out"; - public static final String INET_SOCK_LOCAL_IN = "inet_sock_local_in"; - public static final String INET_SOCK_CLONE = "inet_sock_clone"; - public static final String INET_ACCEPT = "inet_accept"; - public static final String INET_SOCK_DELETE = "inet_sock_delete"; - public static final String NETIF_RECEIVE_SKB = "netif_receive_skb"; - public static final String NET_DEV_QUEUE = "net_dev_queue"; - - /* Field names */ - public static final String SEQ = "seq"; - public static final String SK = "sk"; - public static final String OSK = "osk"; - public static final String NSK = "nsk"; - public static final String SPORT = "sport"; - public static final String DPORT = "dport"; - public static final String SADDR = "saddr"; - public static final String DADDR = "daddr"; - public static final String ACKSEQ = "ack_seq"; - public static final String CHECK = "check"; - public static final String WINDOW = "window"; - public static final String FLAGS = "flags"; - public static final String TRANSPORT_FIELDS = "transport_fields"; - public static final String TYPE_TCP = "thtype_tcp"; - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/LttngKernelStateProvider.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/LttngKernelStateProvider.java deleted file mode 100644 index 7bceb2878e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/LttngKernelStateProvider.java +++ /dev/null @@ -1,559 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Ericsson - * Copyright (c) 2010, 2011 École Polytechnique de Montréal - * Copyright (c) 2010, 2011 Alexandre Montplaisir - * - * 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.linuxtools.internal.lttng2.kernel.core.stateprovider; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.LttngStrings; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.StateValues; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.statesystem.core.statevalue.TmfStateValue; -import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; -import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; -import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; - -/** - * 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 { - - /** - * 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 = 4; - - // ------------------------------------------------------------------------ - // Constructor - // ------------------------------------------------------------------------ - - /** - * Instantiate a new state provider plugin. - * - * @param trace - * The LTTng 2.0 kernel trace directory - */ - public LttngKernelStateProvider(ITmfTrace trace) { - super(trace, ITmfEvent.class, "LTTng Kernel"); //$NON-NLS-1$ - } - - // ------------------------------------------------------------------------ - // 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()); - } - - @Override - protected void eventHandle(ITmfEvent event) { - /* - * AbstractStateChangeInput should have already checked for the correct - * class type - */ - - final String eventName = event.getType().getName(); - final long ts = event.getTimestamp().getValue(); - - try { - /* Shortcut for the "current CPU" attribute node */ - final Integer currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(), event.getSource()); - - /* - * 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 Integer currentThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), String.valueOf(thread)); - - /* - * Feed event to the history system if it's known to cause a state - * transition. - */ - switch (eventName) { - - case LttngStrings.EXIT_SYSCALL: - /* Fields: int64 ret */ - { - /* 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; - - case LttngStrings.IRQ_HANDLER_ENTRY: - /* Fields: int32 irq, string name */ - { - Integer irqId = ((Long) event.getContent().getField(LttngStrings.IRQ).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(), irqId.toString()); - value = TmfStateValue.newValueInt(Integer.parseInt(event.getSource())); - 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 LttngStrings.IRQ_HANDLER_EXIT: - /* Fields: int32 irq, int32 ret */ - { - Integer irqId = ((Long) event.getContent().getField(LttngStrings.IRQ).getValue()).intValue(); - - /* Put this IRQ back to inactive in the resource tree */ - quark = ss.getQuarkRelativeAndAdd(getNodeIRQs(), irqId.toString()); - value = TmfStateValue.nullValue(); - ss.modifyAttribute(ts, value, quark); - - /* Set the previous process back to running */ - setProcessToRunning(ts, currentThreadNode); - - /* Set the CPU status back to running or "idle" */ - cpuExitInterrupt(ts, currentCPUNode, currentThreadNode); - } - break; - - case LttngStrings.SOFTIRQ_ENTRY: - /* Fields: int32 vec */ - { - Integer softIrqId = ((Long) event.getContent().getField(LttngStrings.VEC).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(), softIrqId.toString()); - value = TmfStateValue.newValueInt(Integer.parseInt(event.getSource())); - 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 LttngStrings.SOFTIRQ_EXIT: - /* Fields: int32 vec */ - { - Integer softIrqId = ((Long) event.getContent().getField(LttngStrings.VEC).getValue()).intValue(); - - /* Put this SoftIRQ back to inactive (= -1) in the resource tree */ - quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(), softIrqId.toString()); - value = TmfStateValue.nullValue(); - ss.modifyAttribute(ts, value, quark); - - /* Set the previous process back to running */ - setProcessToRunning(ts, currentThreadNode); - - /* Set the CPU status back to "busy" or "idle" */ - cpuExitInterrupt(ts, currentCPUNode, currentThreadNode); - } - break; - - case LttngStrings.SOFTIRQ_RAISE: - /* Fields: int32 vec */ - { - Integer softIrqId = ((Long) event.getContent().getField(LttngStrings.VEC).getValue()).intValue(); - - /* Mark this SoftIRQ as *raised* in the resource tree. - * State value = -2 */ - quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(), softIrqId.toString()); - value = StateValues.SOFT_IRQ_RAISED_VALUE; - ss.modifyAttribute(ts, value, quark); - } - break; - - case LttngStrings.SCHED_SWITCH: - /* - * 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(); - Integer prevTid = ((Long) content.getField(LttngStrings.PREV_TID).getValue()).intValue(); - Long prevState = (Long) content.getField(LttngStrings.PREV_STATE).getValue(); - String nextProcessName = (String) content.getField(LttngStrings.NEXT_COMM).getValue(); - Integer nextTid = ((Long) content.getField(LttngStrings.NEXT_TID).getValue()).intValue(); - - Integer formerThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), prevTid.toString()); - Integer newCurrentThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), 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(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 LttngStrings.SCHED_PROCESS_FORK: - /* Fields: string parent_comm, int32 parent_tid, - * string child_comm, int32 child_tid */ - { - ITmfEventField content = event.getContent(); - // String parentProcessName = (String) event.getFieldValue("parent_comm"); - String childProcessName = (String) content.getField(LttngStrings.CHILD_COMM).getValue(); - // assert ( parentProcessName.equals(childProcessName) ); - - Integer parentTid = ((Long) content.getField(LttngStrings.PARENT_TID).getValue()).intValue(); - Integer childTid = ((Long) content.getField(LttngStrings.CHILD_TID).getValue()).intValue(); - - Integer parentTidNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), parentTid.toString()); - Integer childTidNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), 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(LttngStrings.SYS_CLONE); - } - quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.SYSTEM_CALL); - ss.modifyAttribute(ts, value, quark); - } - break; - - case LttngStrings.SCHED_PROCESS_EXIT: - /* Fields: string comm, int32 tid, int32 prio */ - break; - - case LttngStrings.SCHED_PROCESS_FREE: - /* Fields: string comm, int32 tid, int32 prio */ - /* - * A sched_process_free will always happen after the sched_switch - * that will remove the process from the cpu for the last time. So - * this is when we should delete everything wrt to the process. - */ - { - Integer tid = ((Long) event.getContent().getField(LttngStrings.TID).getValue()).intValue(); - /* - * Remove the process and all its sub-attributes from the - * current state - */ - quark = ss.getQuarkRelativeAndAdd(getNodeThreads(), tid.toString()); - ss.removeAttribute(ts, quark); - } - break; - - case LttngStrings.STATEDUMP_PROCESS_STATE: - /* Fields: - * int32 type, int32 mode, int32 pid, int32 submode, int32 vpid, - * int32 ppid, int32 tid, string name, int32 status, int32 vtid */ - { - ITmfEventField content = event.getContent(); - int tid = ((Long) content.getField(LttngStrings.TID).getValue()).intValue(); - int pid = ((Long) content.getField(LttngStrings.PID).getValue()).intValue(); - int ppid = ((Long) content.getField(LttngStrings.PPID).getValue()).intValue(); - int status = ((Long) content.getField(LttngStrings.STATUS).getValue()).intValue(); - String name = (String) content.getField(LttngStrings.NAME).getValue(); - /* - * "mode" could be interesting too, but it doesn't seem to be - * populated with anything relevant for now. - */ - - int curThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), 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 LttngStrings.SCHED_WAKEUP: - case LttngStrings.SCHED_WAKEUP_NEW: - /* Fields (same fields for both types): - * string comm, int32 pid, int32 prio, int32 success, - * int32 target_cpu */ - { - final int tid = ((Long) event.getContent().getField(LttngStrings.TID).getValue()).intValue(); - final int threadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), 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(LttngStrings.SYSCALL_PREFIX) - || eventName.startsWith(LttngStrings.COMPAT_SYSCALL_PREFIX)) { - /* - * This is a replacement for the old sys_enter event. Now - * syscall names are listed into the event type - */ - - /* 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); - } - } - 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 int getNodeCPUs() { - return ss.getQuarkAbsoluteAndAdd(Attributes.CPUS); - } - - private int getNodeThreads() { - return ss.getQuarkAbsoluteAndAdd(Attributes.THREADS); - } - - private int getNodeIRQs() { - return ss.getQuarkAbsoluteAndAdd(Attributes.RESOURCES, Attributes.IRQS); - } - - private int getNodeSoftIRQs() { - return ss.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 void setProcessToRunning(long ts, int currentThreadNode) - throws AttributeNotFoundException, TimeRangeException, - StateValueTypeException { - int quark; - ITmfStateValue value; - - quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL); - if (ss.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 = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS); - ss.modifyAttribute(ts, value, quark); - } - - /** - * Similar logic as above, but to set the CPU's status when it's coming out - * of an interruption. - */ - private void cpuExitInterrupt(long ts, int currentCpuNode, int currentThreadNode) - throws StateValueTypeException, AttributeNotFoundException, - TimeRangeException { - int quark; - ITmfStateValue value; - - quark = ss.getQuarkRelativeAndAdd(currentCpuNode, Attributes.CURRENT_THREAD); - if (ss.queryOngoingState(quark).unboxInt() > 0) { - /* There was a process on the CPU */ - quark = ss.getQuarkRelative(currentThreadNode, Attributes.SYSTEM_CALL); - if (ss.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 = ss.getQuarkRelativeAndAdd(currentCpuNode, Attributes.STATUS); - ss.modifyAttribute(ts, value, quark); - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/LttngKernelAnalysisModule.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/LttngKernelAnalysisModule.java deleted file mode 100644 index 3d27e7931f..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/LttngKernelAnalysisModule.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.analysis; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.LttngStrings; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; -import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; -import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement; -import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; - -import com.google.common.collect.ImmutableSet; - -/** - * State System Module for lttng kernel traces - * - * @author Geneviève Bastien - * @since 3.0 - */ -public class LttngKernelAnalysisModule 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 REQUIRED_EVENTS = ImmutableSet.of(); - - private static final ImmutableSet OPTIONAL_EVENTS = ImmutableSet.of( - 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 ImmutableSet 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 = ImmutableSet.of(domainReq, eventReq); - } - - @Override - @NonNull - protected ITmfStateProvider createStateProvider() { - return new LttngKernelStateProvider(getTrace()); - } - - @Override - @NonNull - protected String getSsFileName() { - return HISTORY_TREE_FILE_NAME; - } - - @Override - protected String getFullHelpText() { - return Messages.LttngKernelAnalysisModule_Help; - } - - @Override - public Iterable getAnalysisRequirements() { - return REQUIREMENTS; - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/Messages.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/Messages.java deleted file mode 100644 index 01696e2d84..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/Messages.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.analysis; - -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.linuxtools.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() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/messages.properties b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/messages.properties deleted file mode 100644 index 6933aa637e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/messages.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# 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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuStateProvider.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuStateProvider.java deleted file mode 100644 index b6c2b3b5bf..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuStateProvider.java +++ /dev/null @@ -1,141 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.cpuusage; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.LttngStrings; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.statesystem.core.statevalue.TmfStateValue; -import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; -import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; -import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; - -/** - * 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 LttngKernelCpuStateProvider extends AbstractTmfStateProvider { - - private static final int VERSION = 1; - - /* For each CPU, maps the last time a thread was scheduled in */ - private final Map fLastStartTimes = new HashMap<>(); - private final long fTraceStart; - - /** - * Constructor - * - * @param trace - * The trace from which to get the CPU usage - */ - public LttngKernelCpuStateProvider(ITmfTrace trace) { - super(trace, ITmfEvent.class, "LTTng Kernel CPU usage"); //$NON-NLS-1$ - fTraceStart = trace.getStartTime().getValue(); - } - - // ------------------------------------------------------------------------ - // ITmfStateProvider - // ------------------------------------------------------------------------ - - @Override - public int getVersion() { - return VERSION; - } - - @Override - public LttngKernelCpuStateProvider getNewInstance() { - return new LttngKernelCpuStateProvider(this.getTrace()); - } - - @Override - protected void eventHandle(ITmfEvent event) { - final String eventName = event.getType().getName(); - - if (eventName.equals(LttngStrings.SCHED_SWITCH)) { - /* - * 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(); - String cpu = event.getSource(); - - Long prevTid = (Long) content.getField(LttngStrings.PREV_TID).getValue(); - - try { - Integer currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(), cpu); - - /* - * 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 = 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 int getNodeCPUs() { - return ss.getQuarkAbsoluteAndAdd(Attributes.CPUS); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuUsageAnalysis.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuUsageAnalysis.java deleted file mode 100644 index eb6da69f05..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuUsageAnalysis.java +++ /dev/null @@ -1,254 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.core.cpuusage; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; - -/** - * 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() { - return new LttngKernelCpuStateProvider(getTrace()); - } - - @Override - protected StateSystemBackendType getBackendType() { - return StateSystemBackendType.FULL; - } - - @Override - protected boolean executeAnalysis(IProgressMonitor monitor) { - /* - * This analysis depends on the LTTng kernel analysis, so we'll start - * that build at the same time - */ - LttngKernelAnalysisModule module = getTrace().getAnalysisModuleOfClass(LttngKernelAnalysisModule.class, LttngKernelAnalysisModule.ID); - if (module != null) { - module.schedule(); - } - return super.executeAnalysis(monitor); - } - - /** - * 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 getCpuUsageInRange(long start, long end) { - Map map = new HashMap<>(); - Map totalMap = new HashMap<>(); - - ITmfTrace trace = getTrace(); - ITmfStateSystem cpuSs = getStateSystem(); - if (trace == null || cpuSs == null) { - return map; - } - ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysisModule.ID); - 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> 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 kernelEndState = kernelSs.queryFullState(endTime); - List endState = cpuSs.queryFullState(endTime); - List kernelStartState = kernelSs.queryFullState(startTime); - List startState = cpuSs.queryFullState(startTime); - - long countAtStart, countAtEnd; - - for (Entry> entry : tidsPerCpu.entrySet()) { - int cpuNode = entry.getKey(); - List 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 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 map, String key, Long value) { - Long addTo = map.get(key); - if (addTo == null) { - map.put(key, value); - } else { - map.put(key, addTo + value); - } - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpEventMatching.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpEventMatching.java deleted file mode 100644 index 339779b3ad..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpEventMatching.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * 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 implementation and API - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.event.matching; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.TcpEventStrings; -import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; -import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; -import org.eclipse.linuxtools.tmf.core.event.matching.ITmfNetworkMatchDefinition; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching.MatchingType; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfNetworkEventMatching.Direction; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.core.trace.TmfEventTypeCollectionHelper; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; - -import com.google.common.collect.ImmutableSet; - -/** - * Class to match tcp type events. This matching class applies to traces - * obtained with the 'addons' lttng module. This module can be obtained with - * lttng-modules to generate traces at - * https://github.com/giraldeau/lttng-modules/tree/addons - * - * Note: this module only allows to generate traces to be read and analyzed by - * TMF, no code from this module is being used here - * - * @author Geneviève Bastien - * @since 3.0 - */ -public class TcpEventMatching implements ITmfNetworkMatchDefinition { - - private static final ImmutableSet REQUIRED_EVENTS = ImmutableSet.of( - TcpEventStrings.INET_SOCK_LOCAL_IN, - TcpEventStrings.INET_SOCK_LOCAL_OUT); - - private static boolean canMatchPacket(final ITmfEvent event) { - /* Make sure all required fields are present to match with this event */ - ITmfEventField content = event.getContent(); - if ((content.getField(TcpEventStrings.SEQ) != null) && - (content.getField(TcpEventStrings.ACKSEQ) != null) && (content.getField(TcpEventStrings.FLAGS) != null)) { - return true; - } - return false; - } - - @Override - public Direction getDirection(ITmfEvent event) { - String evname = event.getType().getName(); - - if (!canMatchPacket(event)) { - return null; - } - - /* Is the event a tcp socket in or out event */ - if (evname.equals(TcpEventStrings.INET_SOCK_LOCAL_IN)) { - return Direction.IN; - } else if (evname.equals(TcpEventStrings.INET_SOCK_LOCAL_OUT)) { - return Direction.OUT; - } - return null; - } - - /** - * The key to uniquely identify a TCP packet depends on many fields. This - * method computes the key for a given event. - * - * @param event - * The event for which to compute the key - * @return the unique key for this event - */ - @Override - public List getUniqueField(ITmfEvent event) { - List keys = new ArrayList<>(); - - keys.add(event.getContent().getField(TcpEventStrings.SEQ).getValue()); - keys.add(event.getContent().getField(TcpEventStrings.ACKSEQ).getValue()); - keys.add(event.getContent().getField(TcpEventStrings.FLAGS).getValue()); - - return keys; - } - - @Override - public boolean canMatchTrace(ITmfTrace trace) { - if (!(trace instanceof CtfTmfTrace)) { - return false; - } - CtfTmfTrace ktrace = (CtfTmfTrace) trace; - - Set traceEvents = TmfEventTypeCollectionHelper.getEventNames(ktrace.getContainedEventTypes()); - traceEvents.retainAll(REQUIRED_EVENTS); - return !traceEvents.isEmpty(); - } - - @Override - public MatchingType[] getApplicableMatchingTypes() { - MatchingType[] types = { MatchingType.NETWORK }; - return types; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpLttngEventMatching.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpLttngEventMatching.java deleted file mode 100644 index 9c35b41a00..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpLttngEventMatching.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * 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 implementation and API - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.event.matching; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.TcpEventStrings; -import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; -import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; -import org.eclipse.linuxtools.tmf.core.event.TmfEventField; -import org.eclipse.linuxtools.tmf.core.event.matching.ITmfNetworkMatchDefinition; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching.MatchingType; -import org.eclipse.linuxtools.tmf.core.event.matching.TmfNetworkEventMatching.Direction; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.core.trace.TmfEventTypeCollectionHelper; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; - -import com.google.common.collect.ImmutableSet; - -/** - * Class to match tcp type events. This class applies to traces obtained with - * the full network tracepoint data available from an experimental branch of - * lttng-modules. This branch is often rebased on lttng-modules master and is - * available at - * http://git.dorsal.polymtl.ca/~gbastien?p=lttng-modules.git;a=summary - * net_data_experimental branch. - * - * @author Geneviève Bastien - * @since 3.0 - */ -public class TcpLttngEventMatching implements ITmfNetworkMatchDefinition { - - private static final String[] key_seq = { TcpEventStrings.TRANSPORT_FIELDS, TcpEventStrings.TYPE_TCP, TcpEventStrings.SEQ }; - private static final String[] key_ackseq = { TcpEventStrings.TRANSPORT_FIELDS, TcpEventStrings.TYPE_TCP, TcpEventStrings.ACKSEQ }; - private static final String[] key_flags = { TcpEventStrings.TRANSPORT_FIELDS, TcpEventStrings.TYPE_TCP, TcpEventStrings.FLAGS }; - - private static final ImmutableSet REQUIRED_EVENTS = ImmutableSet.of( - TcpEventStrings.NET_DEV_QUEUE, - TcpEventStrings.NETIF_RECEIVE_SKB); - - private static boolean canMatchPacket(final ITmfEvent event) { - TmfEventField field = (TmfEventField) event.getContent(); - - String[] tcp_data = { TcpEventStrings.TRANSPORT_FIELDS, TcpEventStrings.TYPE_TCP }; - ITmfEventField data = field.getSubField(tcp_data); - if (data != null) { - return (data.getValue() != null); - } - return false; - } - - /** - * The key to uniquely identify a TCP packet depends on many fields. This - * method computes the key for a given event. - * - * @param event - * The event for which to compute the key - * @return the unique key for this event - */ - @Override - public List getUniqueField(ITmfEvent event) { - List keys = new ArrayList<>(); - - TmfEventField field = (TmfEventField) event.getContent(); - ITmfEventField data; - - data = field.getSubField(key_seq); - if (data != null) { - keys.add(data.getValue()); - } - data = field.getSubField(key_ackseq); - if (data != null) { - keys.add(data.getValue()); - } - data = field.getSubField(key_flags); - if (data != null) { - keys.add(data.getValue()); - } - - return keys; - } - - @Override - public boolean canMatchTrace(ITmfTrace trace) { - if (!(trace instanceof CtfTmfTrace)) { - return false; - } - CtfTmfTrace ktrace = (CtfTmfTrace) trace; - - Set traceEvents = TmfEventTypeCollectionHelper.getEventNames(ktrace.getContainedEventTypes()); - traceEvents.retainAll(REQUIRED_EVENTS); - return !traceEvents.isEmpty(); - } - - @Override - public Direction getDirection(ITmfEvent event) { - String evname = event.getType().getName(); - - /* Is the event a tcp socket in or out event */ - if (evname.equals(TcpEventStrings.NETIF_RECEIVE_SKB) && canMatchPacket(event)) { - return Direction.IN; - } else if (evname.equals(TcpEventStrings.NET_DEV_QUEUE) && canMatchPacket(event)) { - return Direction.OUT; - } - return null; - } - - @Override - public MatchingType[] getApplicableMatchingTypes() { - MatchingType[] types = { MatchingType.NETWORK }; - return types; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/LttngKernelTrace.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/LttngKernelTrace.java deleted file mode 100644 index 7853e6c2e4..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/LttngKernelTrace.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 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 - * Matthew Khouzam - Improved validation - ******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.trace; - -import java.nio.BufferOverflowException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException; -import org.eclipse.linuxtools.ctf.core.trace.CTFTrace; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator; -import org.eclipse.linuxtools.tmf.core.trace.TraceValidationStatus; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; - -/** - * This is the specification of CtfTmfTrace for use with LTTng 2.x kernel - * traces. - * - * @author Alexandre Montplaisir - * @since 2.0 - */ -public class LttngKernelTrace extends CtfTmfTrace { - - private static final int CONFIDENCE = 100; - - /** - * Default constructor - */ - public LttngKernelTrace() { - super(); - } - - /** - * {@inheritDoc} - *

- * This implementation sets the confidence to 100 if the trace is a valid - * CTF trace in the "kernel" domain. - */ - @Override - public IStatus validate(final IProject project, final String path) { - /* - * Make sure the trace is openable as a CTF trace. We do this here - * instead of calling super.validate() to keep the reference to "temp". - */ - try (CTFTrace temp = new CTFTrace(path);) { - /* Make sure the domain is "kernel" in the trace's env vars */ - String dom = temp.getEnvironment().get("domain"); //$NON-NLS-1$ - if (dom != null && dom.equals("\"kernel\"")) { //$NON-NLS-1$ - return new TraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID); - } - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngKernelTrace_DomainError); - - } catch (CTFReaderException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); - } catch (NullPointerException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); - } catch (final BufferOverflowException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngKernelTrace_TraceReadError + ": " + Messages.LttngKernelTrace_MalformedTrace); //$NON-NLS-1$ - } - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java deleted file mode 100644 index e3372101c0..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.core.trace; - -import org.eclipse.osgi.util.NLS; - -/** - * Message bundle for lttng2.kernel.core.trace - * - * @author Matthew Khouzam - * @since 2.0 - */ -public class Messages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng2.kernel.core.trace.messages"; //$NON-NLS-1$ - - /** - * The domain is not "kernel" - */ - public static String LttngKernelTrace_DomainError; - /** - * Malformed trace (buffer overflow maybe?) - * @since 2.1 - */ - public static String LttngKernelTrace_MalformedTrace; - /** - * Trace read error - * @since 2.1 - */ - public static String LttngKernelTrace_TraceReadError; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/messages.properties b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/messages.properties deleted file mode 100644 index 460105a03e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/messages.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -LttngKernelTrace_DomainError=Domain mismatch, the environment should be 'kernel'. -LttngKernelTrace_MalformedTrace=Buffer overflow exception, trace is malformed -LttngKernelTrace_TraceReadError=Lttng trace read error diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.classpath b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.classpath deleted file mode 100644 index 3bc247511f..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.gitignore b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.gitignore deleted file mode 100644 index 750e145aa2..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -screenshots/ diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.project b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.project deleted file mode 100644 index 897fa3a268..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f3fc64575b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,393 +0,0 @@ -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=enabled -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 62cfa90dee..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 4f2b73efe8..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,28 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests;singleton:=true -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Export-Package: org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests -Require-Bundle: org.apache.log4j, - org.eclipse.core.resources, - org.eclipse.core.runtime, - org.eclipse.linuxtools.lttng2.kernel.core, - org.eclipse.linuxtools.lttng2.kernel.ui, - org.eclipse.linuxtools.lttng2.control.ui, - org.eclipse.linuxtools.tmf.core, - org.eclipse.linuxtools.tmf.core.tests, - org.eclipse.linuxtools.tmf.ctf.core, - org.eclipse.linuxtools.tmf.ctf.core.tests, - org.eclipse.linuxtools.tmf.ui, - org.eclipse.linuxtools.tmf.ui.swtbot.tests, - org.eclipse.swtbot.eclipse.finder, - org.eclipse.swtbot.junit4_x, - org.eclipse.ui, - org.eclipse.ui.ide, - org.eclipse.ui.views, - org.junit diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/about.html b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/build.properties b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/build.properties deleted file mode 100644 index 379ca6c427..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# 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: -# Ericsson - Initial API and implementation -############################################################################### -source.. = src/ -bin.includes = META-INF/,\ - .,\ - plugin.properties diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/plugin.properties b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/plugin.properties deleted file mode 100644 index dd11e5beff..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/plugin.properties +++ /dev/null @@ -1,14 +0,0 @@ -############################################################################### -# 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 -############################################################################### - -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Kernel UI SWTBot Tests Plug-in diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/pom.xml b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/pom.xml deleted file mode 100644 index 5b8dff4e25..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests - 3.1.0-SNAPSHOT - eclipse-test-plugin - - Linux Tools LTTng Kernel UI SWTBot Tests Plug-in - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests - org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests.AllTests - true - false - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide - - - 0 - - - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/AllTests.java b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/AllTests.java deleted file mode 100644 index dd242a71d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite for UI on the lttng kernel perspective - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - ImportAndReadKernelSmokeTest.class, - KernelPerspectiveChecker.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java deleted file mode 100644 index 449fbe0a8d..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * 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: - * Matthew Khouzam - Initial API and implementation - * Marc-Andre Laperle - * Patrick Tasse - Add support for folder elements - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; - -import java.util.List; - -import org.apache.log4j.ConsoleAppender; -import org.apache.log4j.Logger; -import org.apache.log4j.SimpleLayout; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesView; -import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; -import org.eclipse.linuxtools.tmf.core.signal.TmfTimeSynchSignal; -import org.eclipse.linuxtools.tmf.core.trace.ITmfContext; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.eclipse.linuxtools.tmf.ui.editors.TmfEventsEditor; -import org.eclipse.linuxtools.tmf.ui.swtbot.tests.SWTBotUtil; -import org.eclipse.linuxtools.tmf.ui.swtbot.tests.conditions.ConditionHelpers; -import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView; -import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; -import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory; -import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView; -import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; -import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; -import org.eclipse.swtbot.swt.finder.results.BoolResult; -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.ui.IEditorPart; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IViewReference; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.WorkbenchException; -import org.hamcrest.Matcher; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * SWTBot Smoke test for LTTng Kernel UI. - * - * @author Matthew Khouzam - */ -@RunWith(SWTBotJunit4ClassRunner.class) -public class ImportAndReadKernelSmokeTest { - - private static final String TRACE_TYPE = "org.eclipse.linuxtools.lttng2.kernel.tracetype"; - private static final String KERNEL_PERSPECTIVE_ID = "org.eclipse.linuxtools.lttng2.kernel.ui.perspective"; - private static final String TRACE_PROJECT_NAME = "test"; - - private static SWTWorkbenchBot fBot; - public static CtfTmfTestTrace ctt = CtfTmfTestTrace.SYNTHETIC_TRACE; - private ITmfEvent fDesired1; - private ITmfEvent fDesired2; - - /** The Log4j logger instance. */ - private static final Logger fLogger = Logger.getRootLogger(); - - /** - * Test Class setup - */ - @BeforeClass - public static void init() { - SWTBotUtil.failIfUIThread(); - - /* set up for swtbot */ - SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */ - fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT)); - fBot = new SWTWorkbenchBot(); - - final List openViews = fBot.views(); - for (SWTBotView view : openViews) { - if (view.getTitle().equals("Welcome")) { - view.close(); - fBot.waitUntil(ConditionHelpers.ViewIsClosed(view)); - } - } - /* Switch perspectives */ - switchKernelPerspective(); - /* Finish waiting for eclipse to load */ - SWTBotUtil.waitForJobs(); - } - - private static void switchKernelPerspective() { - final Exception retE[] = new Exception[1]; - if (!UIThreadRunnable.syncExec(new BoolResult() { - @Override - public Boolean run() { - try { - PlatformUI.getWorkbench().showPerspective(KERNEL_PERSPECTIVE_ID, - PlatformUI.getWorkbench().getActiveWorkbenchWindow()); - } catch (WorkbenchException e) { - retE[0] = e; - return false; - } - return true; - } - })) { - fail(retE[0].getMessage()); - } - - } - - /** - * Main test case - */ - @Test - public void test() { - SWTBotUtil.createProject(TRACE_PROJECT_NAME); - SWTBotUtil.openTrace(TRACE_PROJECT_NAME, ctt.getPath(), TRACE_TYPE); - openEditor(); - testHV(getViewPart("Histogram")); - testCFV((ControlFlowView) getViewPart("Control Flow")); - testRV((ResourcesView) getViewPart("Resources")); - - fBot.closeAllEditors(); - SWTBotUtil.deleteProject(TRACE_PROJECT_NAME, fBot); - } - - private void openEditor() { - Matcher matcher = WidgetMatcherFactory.withPartName(ctt.getTrace().getName()); - IEditorPart iep = fBot.editor(matcher).getReference().getEditor(true); - fDesired1 = getEvent(100); - fDesired2 = getEvent(10000); - final TmfEventsEditor tmfEd = (TmfEventsEditor) iep; - UIThreadRunnable.syncExec(new VoidResult() { - @Override - public void run() { - tmfEd.setFocus(); - tmfEd.selectionChanged(new SelectionChangedEvent(tmfEd, new StructuredSelection(fDesired1))); - } - }); - - SWTBotUtil.waitForJobs(); - SWTBotUtil.delay(1000); - assertNotNull(tmfEd); - } - - private static void testCFV(ControlFlowView vp) { - assertNotNull(vp); - } - - private void testHV(IViewPart vp) { - SWTBotView hvBot = (new SWTWorkbenchBot()).viewById(HistogramView.ID); - List hvTools = hvBot.getToolbarButtons(); - for (SWTBotToolbarButton hvTool : hvTools) { - if (hvTool.getToolTipText().toLowerCase().contains("lost")) { - hvTool.click(); - } - } - HistogramView hv = (HistogramView) vp; - final TmfTimeSynchSignal signal = new TmfTimeSynchSignal(hv, fDesired1.getTimestamp()); - final TmfTimeSynchSignal signal2 = new TmfTimeSynchSignal(hv, fDesired2.getTimestamp()); - hv.updateTimeRange(100000); - SWTBotUtil.waitForJobs(); - hv.currentTimeUpdated(signal); - hv.broadcast(signal); - SWTBotUtil.waitForJobs(); - SWTBotUtil.delay(1000); - - hv.updateTimeRange(1000000000); - SWTBotUtil.waitForJobs(); - hv.currentTimeUpdated(signal2); - hv.broadcast(signal2); - SWTBotUtil.waitForJobs(); - SWTBotUtil.delay(1000); - assertNotNull(hv); - } - - private static void testRV(ResourcesView vp) { - assertNotNull(vp); - } - - private static CtfTmfEvent getEvent(int rank) { - try (CtfTmfTrace trace = CtfTmfTestTrace.SYNTHETIC_TRACE.getTrace()) { - ITmfContext ctx = trace.seekEvent(0); - for (int i = 0; i < rank; i++) { - trace.getNext(ctx); - } - return trace.getNext(ctx); - } - - } - - private static IViewPart getViewPart(final String viewTile) { - final IViewPart[] vps = new IViewPart[1]; - UIThreadRunnable.syncExec(new VoidResult() { - @Override - public void run() { - IViewReference[] viewRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences(); - for (IViewReference viewRef : viewRefs) { - IViewPart vp = viewRef.getView(true); - if (vp.getTitle().equals(viewTile)) { - vps[0] = vp; - return; - } - } - } - }); - - return vps[0]; - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/KernelPerspectiveChecker.java b/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/KernelPerspectiveChecker.java deleted file mode 100644 index 524f4d1a34..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/KernelPerspectiveChecker.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * 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: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests; - -import java.util.ArrayList; -import java.util.Arrays; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.PerspectiveFactory; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesView; -import org.eclipse.linuxtools.tmf.ui.swtbot.tests.AbstractPerspectiveChecker; -import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView; -import org.eclipse.linuxtools.tmf.ui.views.statistics.TmfStatisticsView; -import org.eclipse.ui.IPageLayout; -import org.junit.Before; - -/** - * Tracing perspective view checker - * - * @author Matthew Khouzam - */ -public class KernelPerspectiveChecker extends AbstractPerspectiveChecker { - - /** - * Set up arrays for test - */ - @Before - public void init() { - fPerspectiveId = PerspectiveFactory.ID; - fViewIds = new ArrayList<>(); - fViewIds.addAll(Arrays.asList(new String[] { - // LTTng views - HistogramView.ID, - ControlView.ID, - ControlFlowView.ID, - ResourcesView.ID, - TmfStatisticsView.ID, - // Standard Eclipse views - IPageLayout.ID_PROJECT_EXPLORER, - IPageLayout.ID_PROP_SHEET, - IPageLayout.ID_BOOKMARKS - })); - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.classpath b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.project b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.project deleted file mode 100644 index 9c8b15bddb..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.kernel.ui.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f3fc64575b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,393 +0,0 @@ -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=enabled -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 62cfa90dee..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/META-INF/MANIFEST.MF deleted file mode 100644 index d65dcb4846..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,14 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.kernel.ui.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.ui, - org.eclipse.linuxtools.lttng2.kernel.ui;bundle-version="3.1.0" -Export-Package: org.eclipse.linuxtools.lttng2.kernel.ui.tests diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/about.html b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/build.properties b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/build.properties deleted file mode 100644 index f7a0b9854e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/build.properties +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties -src.includes = about.html diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/plugin.properties b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/plugin.properties deleted file mode 100644 index d34194d6a0..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/plugin.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.kernel.ui.tests -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Kernel Analysis UI Tests Plug-in \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/pom.xml b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/pom.xml deleted file mode 100644 index d96ceee8d4..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.kernel.ui.tests - 3.1.0-SNAPSHOT - eclipse-test-plugin - - Linux Tools LTTng Kernel Analysis UI Tests Plug-in - - - - - - src - - **/*.java - - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - org.eclipse.linuxtools.lttng2.kernel.ui.tests - org.eclipse.linuxtools.lttng2.kernel.ui.tests.AllTests - true - true - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide - - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/ActivatorTest.java b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/ActivatorTest.java deleted file mode 100644 index 8a83b521d7..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/ActivatorTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.kernel.ui.tests; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -/** - * Test suite for the Activator class - */ -public class ActivatorTest { - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#Activator()}. - */ - @Test - public void testActivator() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#getDefault()}. - */ - @Test - public void testGetDefault() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#start}. - */ - @Test - public void testStartBundleContext() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#stop}. - */ - @Test - public void testStopBundleContext() { - assertTrue(true); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/AllTests.java b/org.eclipse.linuxtools.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/AllTests.java deleted file mode 100644 index f37fdf03f0..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 - * Alexandre Montplaisir - Port to JUnit4 - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.kernel.ui.tests; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Run the lttng2.ui unit tests. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - ActivatorTest.class, -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/.classpath b/org.eclipse.linuxtools.lttng2.kernel.ui/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/.options b/org.eclipse.linuxtools.lttng2.kernel.ui/.options deleted file mode 100644 index 07483358d1..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/.options +++ /dev/null @@ -1,7 +0,0 @@ -org.eclipse.linuxtools.lttng.ui/debug=false -org.eclipse.linuxtools.lttng.ui/info=false -org.eclipse.linuxtools.lttng.ui/warn=false - -org.eclipse.linuxtools.lttng.ui/cfv=false -org.eclipse.linuxtools.lttng.ui/rv=false -org.eclipse.linuxtools.lttng.ui/sv=false diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/.project b/org.eclipse.linuxtools.lttng2.kernel.ui/.project deleted file mode 100644 index fd77c51cac..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.kernel.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 9f3662cd78..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,394 +0,0 @@ -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.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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.pde.prefs deleted file mode 100644 index d92b94fd4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.kernel.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 3303383a63..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,26 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.kernel.ui;singleton:=true -Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.kernel.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.linuxtools.tmf.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.ui;bundle-version="3.1.0", - org.eclipse.linuxtools.lttng2.control.core;bundle-version="3.1.0", - org.eclipse.linuxtools.lttng2.control.ui;bundle-version="3.1.0", - org.eclipse.linuxtools.lttng2.kernel.core;bundle-version="3.1.0" -Export-Package: org.eclipse.linuxtools.internal.lttng2.kernel.ui;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui.tests", - org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events;x-internal:=true, - org.eclipse.linuxtools.internal.lttng2.kernel.ui.views;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests", - org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests", - org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.cpuusage;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests", - org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests" -Import-Package: com.google.common.collect diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/about.html b/org.eclipse.linuxtools.lttng2.kernel.ui/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/build.properties b/org.eclipse.linuxtools.lttng2.kernel.ui/build.properties deleted file mode 100644 index 9775951f3b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# 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 -############################################################################### - -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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/icons/eview16/control_flow_view.gif b/org.eclipse.linuxtools.lttng2.kernel.ui/icons/eview16/control_flow_view.gif deleted file mode 100644 index 3971b50765..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.kernel.ui/icons/eview16/control_flow_view.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/icons/eview16/resources_view.gif b/org.eclipse.linuxtools.lttng2.kernel.ui/icons/eview16/resources_view.gif deleted file mode 100644 index 234486172c..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.kernel.ui/icons/eview16/resources_view.gif and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/icons/obj16/garland16.png b/org.eclipse.linuxtools.lttng2.kernel.ui/icons/obj16/garland16.png deleted file mode 100644 index 74f9751638..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.kernel.ui/icons/obj16/garland16.png and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/plugin.properties b/org.eclipse.linuxtools.lttng2.kernel.ui/plugin.properties deleted file mode 100644 index 0a53a64e67..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/plugin.properties +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################### -# 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 -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.kernel.ui -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Kernel Analysis UI Plug-in - -kernel.perspective.name = LTTng Kernel - -controlflow.view.name = Control Flow -resources.view.name = Resources -cpuusage.view.name = CPU Usage - -tracetype.type.kernel = LTTng Kernel Trace -analysis.lttngkernel = LTTng Kernel Analysis diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/plugin.xml b/org.eclipse.linuxtools.lttng2.kernel.ui/plugin.xml deleted file mode 100644 index 32138b69f3..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/plugin.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/pom.xml b/org.eclipse.linuxtools.lttng2.kernel.ui/pom.xml deleted file mode 100644 index 98039bf6ce..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.kernel.ui - 3.1.0-SNAPSHOT - eclipse-plugin - - Linux Tools LTTng Kernel Analysis UI Plug-in - - - - - - src - - **/*.java - - - - - - org.eclipse.tycho - tycho-source-plugin - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Activator.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Activator.java deleted file mode 100644 index 1dd6e7b579..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Activator.java +++ /dev/null @@ -1,184 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.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.linuxtools.lttng2.kernel.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)); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Messages.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Messages.java deleted file mode 100644 index a7d1f87162..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Messages.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.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.linuxtools.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() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/messages.properties b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/messages.properties deleted file mode 100644 index 03b880ebfe..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/messages.properties +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################### -# 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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LttngEventTableColumns.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LttngEventTableColumns.java deleted file mode 100644 index da8b20f532..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LttngEventTableColumns.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.ui.viewers.events; - -import java.util.Collection; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; -import org.eclipse.linuxtools.tmf.ui.viewers.events.columns.ITmfEventTableColumns; -import org.eclipse.linuxtools.tmf.ui.viewers.events.columns.TmfEventTableColumn; - -import com.google.common.collect.ImmutableList; - -/** - * Event table columns for LTTng 2.x kernel traces - */ -public class LttngEventTableColumns implements ITmfEventTableColumns { - - // ------------------------------------------------------------------------ - // Column definition - // ------------------------------------------------------------------------ - - @SuppressWarnings("null") - private static final @NonNull String CHANNEL_HEADER = Messages.EventsTable_channelColumn; - - @SuppressWarnings("null") - private static final @NonNull Collection LTTNG_COLUMNS = - ImmutableList. of( - TmfEventTableColumn.BaseColumns.TIMESTAMP, - new LttngChannelColumn(), - TmfEventTableColumn.BaseColumns.EVENT_TYPE, - TmfEventTableColumn.BaseColumns.CONTENTS); - - private static class LttngChannelColumn extends TmfEventTableColumn { - - public LttngChannelColumn() { - super(CHANNEL_HEADER); - } - - @Override - public String getItemString(ITmfEvent event) { - String ret = event.getReference(); - return (ret == null ? EMPTY_STRING : ret); - } - - @Override - public String getFilterFieldId() { - return ITmfEvent.EVENT_FIELD_REFERENCE; - } - } - - // ------------------------------------------------------------------------ - // Constructor - // ------------------------------------------------------------------------ - - @Override - public Collection getEventTableColumns() { - return LTTNG_COLUMNS; - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/Messages.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/Messages.java deleted file mode 100644 index d8c49487dc..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/Messages.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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: - * Patrick Tassé - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events; - -import org.eclipse.osgi.util.NLS; - -@SuppressWarnings("javadoc") -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events.messages"; //$NON-NLS-1$ - public static String EventsTable_channelColumn; - public static String EventsTable_timestampColumn; - public static String EventsTable_typeColumn; - public static String EventsTable_contentColumn; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/messages.properties b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/messages.properties deleted file mode 100644 index faeb249dcf..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/messages.properties +++ /dev/null @@ -1,16 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -EventsTable_channelColumn=Channel -EventsTable_timestampColumn=Timestamp -EventsTable_typeColumn=Event Type -EventsTable_contentColumn=Content diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/PerspectiveFactory.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/PerspectiveFactory.java deleted file mode 100644 index 13bc181afb..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/PerspectiveFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.ui.views; - -import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesView; -import org.eclipse.linuxtools.tmf.ui.project.wizards.NewTmfProjectWizard; -import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView; -import org.eclipse.linuxtools.tmf.ui.views.statistics.TmfStatisticsView; -import org.eclipse.ui.IFolderLayout; -import org.eclipse.ui.IPageLayout; -import org.eclipse.ui.IPerspectiveFactory; - -/** - * The default LTTng perspective. - */ -public class PerspectiveFactory implements IPerspectiveFactory { - - /** Perspective ID */ - public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.perspective"; //$NON-NLS-1$ - - // LTTng views - private static final String HISTOGRAM_VIEW_ID = HistogramView.ID; - private static final String CONTROL_VIEW_ID = ControlView.ID; - private static final String CONTROLFLOW_VIEW_ID = ControlFlowView.ID; - private static final String RESOURCES_VIEW_ID = ResourcesView.ID; - private static final String STATISTICS_VIEW_ID = TmfStatisticsView.ID; - - // Standard Eclipse views - private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER; - private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET; - private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS; - - @Override - public void createInitialLayout(IPageLayout layout) { - - layout.setEditorAreaVisible(true); - - addFastViews(layout); - addViewShortcuts(layout); - addPerspectiveShortcuts(layout); - - // Create the top left folder - IFolderLayout topLeftFolder = layout.createFolder( - "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ - topLeftFolder.addView(PROJECT_VIEW_ID); - - // Create the bottom left folder - IFolderLayout bottomLeftFolder = layout.createFolder( - "bottomLeftFolder", IPageLayout.BOTTOM, 0.70f, "topLeftFolder"); //$NON-NLS-1$ //$NON-NLS-2$ - bottomLeftFolder.addView(CONTROL_VIEW_ID); - - // Create the top right folder - IFolderLayout topRightFolder = layout.createFolder( - "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ - topRightFolder.addView(CONTROLFLOW_VIEW_ID); - topRightFolder.addView(RESOURCES_VIEW_ID); - topRightFolder.addView(STATISTICS_VIEW_ID); - - // Create the bottom right folder - IFolderLayout bottomRightFolder = layout.createFolder( - "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ - bottomRightFolder.addView(HISTOGRAM_VIEW_ID); - bottomRightFolder.addView(PROPERTIES_VIEW_ID); - bottomRightFolder.addView(BOOKMARKS_VIEW_ID); - - layout.addNewWizardShortcut(NewTmfProjectWizard.ID); - } - - /** - * Add fast views to the perspective - * - * @param layout - */ - private void addFastViews(IPageLayout layout) { - } - - /** - * Add view shortcuts to the perspective - * - * @param layout - */ - private void addViewShortcuts(IPageLayout layout) { - } - - /** - * Add perspective shortcuts to the perspective - * - * @param layout - */ - private void addPerspectiveShortcuts(IPageLayout layout) { - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowEntry.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowEntry.java deleted file mode 100644 index 01145fd372..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowEntry.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.ui.views.controlflow; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.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$ - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowPresentationProvider.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowPresentationProvider.java deleted file mode 100644 index 22fa932dc0..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowPresentationProvider.java +++ /dev/null @@ -1,211 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.ui.views.controlflow; - -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.StateValues; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages; -import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.StateItem; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; - -/** - * 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 getEventHoverToolTipInfo(ITimeEvent event) { - Map 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(), LttngKernelAnalysisModule.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 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(), LttngKernelAnalysisModule.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)); - Utils.drawText(gc, state.toString().substring(4), 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 */ - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java deleted file mode 100644 index 3627e80aa9..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java +++ /dev/null @@ -1,592 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.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.Nullable; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages; -import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; -import org.eclipse.linuxtools.tmf.ui.views.timegraph.AbstractTimeGraphView; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ILinkEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeGraphEntry; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeLinkEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils.Resolution; -import org.eclipse.linuxtools.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 { - - @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) { - if (trace == null) { - return; - } - ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysisModule.ID); - if (ssq == null) { - return; - } - - List entryList = new ArrayList<>(); - Map 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 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 execNameIntervals; - try { - execNameQuark = ssq.getQuarkRelative(threadQuark, Attributes.EXEC_NAME); - execNameIntervals = ssq.queryHistoryRange(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 = ssq.querySingleState(startTime, ppidQuark); - } catch (AttributeNotFoundException e) { - /* No info, keep PPID at -1 */ - } catch (StateSystemDisposedException e) { - /* SS is closing down, time to bail */ - break; - } - int ppid = -1; - if (!(ppidInterval == null) && !ppidInterval.getStateValue().isNull()) { - 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 entryList, ITmfTrace parentTrace) { - List rootListToAdd = new ArrayList<>(); - List rootListToRemove = new ArrayList<>(); - List rootList = getEntryList(parentTrace); - - for (ControlFlowEntry entry : entryList) { - boolean root = (entry.getParent() == null); - if (root && entry.getParentThreadId() > 0) { - for (ControlFlowEntry parent : entryList) { - if (parent.getThreadId() == entry.getParentThreadId() && - entry.getStartTime() >= parent.getStartTime() && - entry.getStartTime() <= parent.getEndTime()) { - 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, IProgressMonitor monitor, long start, long end) { - if (start < entry.getEndTime() && end > entry.getStartTime()) { - ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysisModule.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 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 getEventList(TimeGraphEntry tgentry, long startTime, long endTime, long resolution, IProgressMonitor monitor) { - List 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; - } - ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysisModule.ID); - if (ssq == null) { - return null; - } - try { - int statusQuark = ssq.getQuarkRelative(entry.getThreadQuark(), Attributes.STATUS); - List statusIntervals = ssq.queryHistoryRange(statusQuark, realStart, realEnd - 1, 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 (AttributeNotFoundException | TimeRangeException e) { - e.printStackTrace(); - } catch (StateSystemDisposedException e) { - /* Ignored */ - } - 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, LttngKernelAnalysisModule.ID); - if (ssq == null) { - continue; - } - if (time >= ssq.getStartTime() && time <= ssq.getCurrentEndTime()) { - List 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 getLinkList(long startTime, long endTime, long resolution, IProgressMonitor monitor) { - List list = new ArrayList<>(); - ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace()); - List entryList = getEntryList(getTrace()); - if (traces == null || entryList == null) { - return list; - } - for (ITmfTrace trace : traces) { - if (trace == null) { - continue; - } - ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysisModule.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 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 currentThreadIntervals = ssq.queryHistoryRange(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 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; - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageComposite.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageComposite.java deleted file mode 100644 index a56b3f3e83..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageComposite.java +++ /dev/null @@ -1,321 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.ui.views.cpuusage; - -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.jdt.annotation.NonNull; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerComparator; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; -import org.eclipse.linuxtools.lttng2.kernel.core.cpuusage.LttngKernelCpuUsageAnalysis; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ui.viewers.tree.AbstractTmfTreeViewer; -import org.eclipse.linuxtools.tmf.ui.viewers.tree.ITmfTreeColumnDataProvider; -import org.eclipse.linuxtools.tmf.ui.viewers.tree.ITmfTreeViewerEntry; -import org.eclipse.linuxtools.tmf.ui.viewers.tree.TmfTreeColumnData; -import org.eclipse.linuxtools.tmf.ui.viewers.tree.TmfTreeColumnData.ITmfColumnPercentageProvider; -import org.eclipse.linuxtools.tmf.ui.viewers.tree.TmfTreeViewerEntry; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Composite; - -/** - * 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 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 getColumnData() { - /* All columns are sortable */ - List 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())) { - @SuppressWarnings("null") - @NonNull List list = Collections.singletonList(entry); - super.setSelection(list); - return; - } - } - } - } - } - - @Override - public void initializeDataSource() { - fModule = getTrace().getAnalysisModuleOfClass(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 cpuUsageMap = fModule.getCpuUsageInRange(Math.max(start, getStartTime()), Math.min(end, getEndTime())); - - TmfTreeViewerEntry root = new TmfTreeViewerEntry(""); //$NON-NLS-1$ - List entryList = root.getChildren(); - - for (Entry 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, LttngKernelAnalysisModule.ID); - if (kernelSs == null) { - return tid; - } - - try { - int cpusNode = kernelSs.getQuarkAbsolute(Attributes.THREADS); - - /* Get the quarks for each cpu */ - List cpuNodes = kernelSs.getSubAttributes(cpusNode, false); - - for (Integer tidQuark : cpuNodes) { - if (kernelSs.getAttributeName(tidQuark).equals(tid)) { - int execNameQuark; - List execNameIntervals; - try { - execNameQuark = kernelSs.getQuarkRelative(tidQuark, Attributes.EXEC_NAME); - execNameIntervals = kernelSs.queryHistoryRange(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; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageEntry.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageEntry.java deleted file mode 100644 index 79bb0ce26e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageEntry.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.ui.views.cpuusage; - -import org.eclipse.linuxtools.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; - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageView.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageView.java deleted file mode 100644 index d2d8a1ed23..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageView.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.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.linuxtools.tmf.core.signal.TmfTraceSelectedSignal; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ui.views.TmfView; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; - -/** - * 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(); - } - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageXYViewer.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageXYViewer.java deleted file mode 100644 index e2167ef594..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageXYViewer.java +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.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.linuxtools.internal.lttng2.kernel.ui.Activator; -import org.eclipse.linuxtools.lttng2.kernel.core.cpuusage.LttngKernelCpuUsageAnalysis; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.tmf.ui.viewers.xycharts.linecharts.TmfCommonXLineChartViewer; -import org.eclipse.swt.widgets.Composite; - -/** - * 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 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 = getTrace().getAnalysisModuleOfClass(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 cpuUsageMap = fModule.getCpuUsageInRange(Math.max(start, traceStart), Math.min(end, traceEnd)); - Map 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 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 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 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(); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/Messages.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/Messages.java deleted file mode 100644 index 6b70d8cd28..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/Messages.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.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.linuxtools.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() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/messages.properties b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/messages.properties deleted file mode 100644 index bca6d6ab3c..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/messages.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# 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 diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java deleted file mode 100644 index c67d0e6263..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java +++ /dev/null @@ -1,177 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.ui.views.resources; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeGraphEntry; - -/** - * An entry, or row, in the resource view - * - * @author Patrick Tasse - */ -public class ResourcesEntry extends TimeGraphEntry implements Comparable { - - /** 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()); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesPresentationProvider.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesPresentationProvider.java deleted file mode 100644 index fc326f501f..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesPresentationProvider.java +++ /dev/null @@ -1,368 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.kernel.ui.views.resources; - -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.StateValues; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type; -import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.StateItem; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.NullTimeEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.ITmfTimeGraphDrawingHelper; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils.Resolution; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat; -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; - -/** - * 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 getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) { - - Map 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(), LttngKernelAnalysisModule.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 fullState = ss.queryFullState(event.getTime()); - List 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 fullState = ss.queryFullState(event.getTime()); - List 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(), LttngKernelAnalysisModule.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; - beginIndex = 4; // skip the 'sys_' - } - 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; - } -} diff --git a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java b/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java deleted file mode 100644 index 798a0e49c9..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java +++ /dev/null @@ -1,321 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.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.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages; -import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type; -import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ui.views.timegraph.AbstractTimeGraphView; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.NullTimeEvent; -import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent; -import org.eclipse.linuxtools.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) { - if (trace == null) { - return; - } - ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysisModule.ID); - if (ssq == null) { - return; - } - Comparator comparator = new Comparator() { - @Override - public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) { - return ((ResourcesEntry) o1).compareTo(o2); - } - }; - - Map 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 entryList = Collections.singletonList(traceEntry); - addToEntryList(parentTrace, entryList); - } else { - traceEntry.updateEndTime(endTime); - } - - List 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 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 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 eventList = getEventList(entry, start, endTime, resolution, monitor); - if (eventList != null) { - for (ITimeEvent event : eventList) { - entry.addEvent(event); - } - } - redraw(); - } - } - - start = end; - } - } - - @Override - protected @Nullable List getEventList(TimeGraphEntry entry, - long startTime, long endTime, long resolution, - IProgressMonitor monitor) { - ResourcesEntry resourcesEntry = (ResourcesEntry) entry; - ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(resourcesEntry.getTrace(), LttngKernelAnalysisModule.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 eventList = null; - int quark = resourcesEntry.getQuark(); - - try { - if (resourcesEntry.getType().equals(Type.CPU)) { - int statusQuark = ssq.getQuarkRelative(quark, Attributes.STATUS); - List statusIntervals = ssq.queryHistoryRange(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 irqIntervals = ssq.queryHistoryRange(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 softIrqIntervals = ssq.queryHistoryRange(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; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.kernel/.project b/org.eclipse.linuxtools.lttng2.kernel/.project deleted file mode 100644 index 145c653648..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.kernel - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/org.eclipse.linuxtools.lttng2.kernel/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.kernel/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.kernel/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.kernel/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.kernel/build.properties b/org.eclipse.linuxtools.lttng2.kernel/build.properties deleted file mode 100644 index c0db4e0a72..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -bin.includes = feature.xml,\ - feature.properties,\ - p2.inf diff --git a/org.eclipse.linuxtools.lttng2.kernel/epl-v10.html b/org.eclipse.linuxtools.lttng2.kernel/epl-v10.html deleted file mode 100644 index 9321f4082e..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/epl-v10.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - -Eclipse Public License - Version 1.0 - - - -

Eclipse Public License - v 1.0

- -

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR -DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS -AGREEMENT.

- -

1. DEFINITIONS

- -

"Contribution" means:

- -

a) in the case of the initial Contributor, the initial -code and documentation distributed under this Agreement, and

-

b) in the case of each subsequent Contributor:

-

i) changes to the Program, and

-

ii) additions to the Program;

-

where such changes and/or additions to the Program -originate from and are distributed by that particular Contributor. A -Contribution 'originates' from a Contributor if it was added to the -Program by such Contributor itself or anyone acting on such -Contributor's behalf. Contributions do not include additions to the -Program which: (i) are separate modules of software distributed in -conjunction with the Program under their own license agreement, and (ii) -are not derivative works of the Program.

- -

"Contributor" means any person or entity that distributes -the Program.

- -

"Licensed Patents" mean patent claims licensable by a -Contributor which are necessarily infringed by the use or sale of its -Contribution alone or when combined with the Program.

- -

"Program" means the Contributions distributed in accordance -with this Agreement.

- -

"Recipient" means anyone who receives the Program under -this Agreement, including all Contributors.

- -

2. GRANT OF RIGHTS

- -

a) Subject to the terms of this Agreement, each -Contributor hereby grants Recipient a non-exclusive, worldwide, -royalty-free copyright license to reproduce, prepare derivative works -of, publicly display, publicly perform, distribute and sublicense the -Contribution of such Contributor, if any, and such derivative works, in -source code and object code form.

- -

b) Subject to the terms of this Agreement, each -Contributor hereby grants Recipient a non-exclusive, worldwide, -royalty-free patent license under Licensed Patents to make, use, sell, -offer to sell, import and otherwise transfer the Contribution of such -Contributor, if any, in source code and object code form. This patent -license shall apply to the combination of the Contribution and the -Program if, at the time the Contribution is added by the Contributor, -such addition of the Contribution causes such combination to be covered -by the Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder.

- -

c) Recipient understands that although each Contributor -grants the licenses to its Contributions set forth herein, no assurances -are provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility to -secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow Recipient -to distribute the Program, it is Recipient's responsibility to acquire -that license before distributing the Program.

- -

d) Each Contributor represents that to its knowledge it -has sufficient copyright rights in its Contribution, if any, to grant -the copyright license set forth in this Agreement.

- -

3. REQUIREMENTS

- -

A Contributor may choose to distribute the Program in object code -form under its own license agreement, provided that:

- -

a) it complies with the terms and conditions of this -Agreement; and

- -

b) its license agreement:

- -

i) effectively disclaims on behalf of all Contributors -all warranties and conditions, express and implied, including warranties -or conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose;

- -

ii) effectively excludes on behalf of all Contributors -all liability for damages, including direct, indirect, special, -incidental and consequential damages, such as lost profits;

- -

iii) states that any provisions which differ from this -Agreement are offered by that Contributor alone and not by any other -party; and

- -

iv) states that source code for the Program is available -from such Contributor, and informs licensees how to obtain it in a -reasonable manner on or through a medium customarily used for software -exchange.

- -

When the Program is made available in source code form:

- -

a) it must be made available under this Agreement; and

- -

b) a copy of this Agreement must be included with each -copy of the Program.

- -

Contributors may not remove or alter any copyright notices contained -within the Program.

- -

Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution.

- -

4. COMMERCIAL DISTRIBUTION

- -

Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use of -the Program, the Contributor who includes the Program in a commercial -product offering should do so in a manner which does not create -potential liability for other Contributors. Therefore, if a Contributor -includes the Program in a commercial product offering, such Contributor -("Commercial Contributor") hereby agrees to defend and -indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") -arising from claims, lawsuits and other legal actions brought by a third -party against the Indemnified Contributor to the extent caused by the -acts or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. In -order to qualify, an Indemnified Contributor must: a) promptly notify -the Commercial Contributor in writing of such claim, and b) allow the -Commercial Contributor to control, and cooperate with the Commercial -Contributor in, the defense and any related settlement negotiations. The -Indemnified Contributor may participate in any such claim at its own -expense.

- -

For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages.

- -

5. NO WARRANTY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS -OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, -ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable laws, -damage to or loss of data, programs or equipment, and unavailability or -interruption of operations.

- -

6. DISCLAIMER OF LIABILITY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT -NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

- -

7. GENERAL

- -

If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further action -by the parties hereto, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable.

- -

If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that the -Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of the -date such litigation is filed.

- -

All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of time -after becoming aware of such noncompliance. If all Recipient's rights -under this Agreement terminate, Recipient agrees to cease use and -distribution of the Program as soon as reasonably practicable. However, -Recipient's obligations under this Agreement and any licenses granted by -Recipient relating to the Program shall continue and survive.

- -

Everyone is permitted to copy and distribute copies of this -Agreement, but in order to avoid inconsistency the Agreement is -copyrighted and may only be modified in the following manner. The -Agreement Steward reserves the right to publish new versions (including -revisions) of this Agreement from time to time. No one other than the -Agreement Steward has the right to modify this Agreement. The Eclipse -Foundation is the initial Agreement Steward. The Eclipse Foundation may -assign the responsibility to serve as the Agreement Steward to a -suitable separate entity. Each new version of the Agreement will be -given a distinguishing version number. The Program (including -Contributions) may always be distributed subject to the version of the -Agreement under which it was received. In addition, after a new version -of the Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives no -rights or licenses to the intellectual property of any Contributor under -this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved.

- -

This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No party -to this Agreement will bring a legal action under this Agreement more -than one year after the cause of action arose. Each party waives its -rights to a jury trial in any resulting litigation.

- - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.kernel/feature.properties b/org.eclipse.linuxtools.lttng2.kernel/feature.properties deleted file mode 100644 index 00d592ccb2..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/feature.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Copyright (c) 2009, 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: -# Ericsson - Initial API and implementation -############################################################################### - -featureName=LTTng Kernel Analysis - -description=Plug-ins to integrate LTTng kernel analysis tools into the workbench. \ -Includes the LTTng (Linux Tracing Toolkit), TMF (Tracing and Monitoring Framework) \ -and CTF (Common Trace Format) features. - -featureProvider=Eclipse Linux Tools - -copyright=Copyright 2013 Ericsson - diff --git a/org.eclipse.linuxtools.lttng2.kernel/feature.xml b/org.eclipse.linuxtools.lttng2.kernel/feature.xml deleted file mode 100644 index c27b468afa..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/feature.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.kernel/license.html b/org.eclipse.linuxtools.lttng2.kernel/license.html deleted file mode 100644 index 6e579a585b..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/license.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - -Eclipse Foundation Software User Agreement - - - -

Eclipse Foundation Software User Agreement

-

February 1, 2011

- -

Usage Of Content

- -

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

- -

Applicable Licenses

- -

Unless otherwise indicated, all Content made available by the Eclipse - Foundation is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 - ("EPL"). A copy of the EPL is provided with this Content and is also - available at http://www.eclipse.org/legal/epl-v10.html. - For purposes of the EPL, "Program" will mean the Content.

- -

Content includes, but is not limited to, source code, object code, -documentation and other files maintained in the Eclipse Foundation -source code - repository ("Repository") in software modules ("Modules") and made -available as downloadable archives ("Downloads").

- -
    -
  • Content may be structured and packaged into modules to -facilitate delivering, extending, and upgrading the Content. Typical -modules may include plug-ins ("Plug-ins"), plug-in fragments -("Fragments"), and features ("Features").
  • -
  • Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
  • -
  • A Feature is a bundle of one or more Plug-ins and/or -Fragments and associated material. Each Feature may be packaged as a -sub-directory in a directory named "features". Within a Feature, files -named "feature.xml" may contain a list of the names and version numbers -of the Plug-ins - and/or Fragments associated with that Feature.
  • -
  • Features may also include other Features ("Included -Features"). Within a Feature, files named "feature.xml" may contain a -list of the names and version numbers of Included Features.
  • -
- -

The terms and conditions governing Plug-ins and Fragments should be -contained in files named "about.html" ("Abouts"). The terms and -conditions governing Features and -Included Features should be contained in files named "license.html" -("Feature Licenses"). Abouts and Feature Licenses may be located in any - directory of a Download or Module -including, but not limited to the following locations:

- -
    -
  • The top-level (root) directory
  • -
  • Plug-in and Fragment directories
  • -
  • Inside Plug-ins and Fragments packaged as JARs
  • -
  • Sub-directories of the directory named "src" of certain Plug-ins
  • -
  • Feature directories
  • -
- -

Note: if a Feature made available by the Eclipse Foundation is -installed using the Provisioning Technology (as defined below), you must - agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the -Feature Update License should either provide you with the terms and -conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be -found in the "license" property of files named "feature.properties" -found within a Feature. -Such Abouts, Feature Licenses, and Feature Update Licenses contain the -terms and conditions (or references to such terms and conditions) that -govern your use of the associated Content in -that directory.

- -

THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. - SOME OF THESE -OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):

- - - -

IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND -CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, -or Feature Update License is provided, please -contact the Eclipse Foundation to determine what terms and conditions -govern that particular Content.

- - -

Use of Provisioning Technology

- -

The Eclipse Foundation makes available provisioning software, -examples of which include, but are not limited to, p2 and the Eclipse - Update Manager ("Provisioning Technology") for the purpose of -allowing users to install software, documentation, information and/or - other materials (collectively "Installable Software"). This -capability is provided with the intent of allowing such users to - install, extend and update Eclipse-based products. Information about -packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html - ("Specification").

- -

You may use Provisioning Technology to allow other parties to install - Installable Software. You shall be responsible for enabling the - applicable license agreements relating to the Installable Software to - be presented to, and accepted by, the users of the Provisioning -Technology - in accordance with the Specification. By using Provisioning -Technology in such a manner and making it available in accordance with -the - Specification, you further acknowledge your agreement to, and the -acquisition of all necessary rights to permit the following:

- -
    -
  1. A series of actions may occur ("Provisioning Process") in -which a user may execute the Provisioning Technology - on a machine ("Target Machine") with the intent of installing, -extending or updating the functionality of an Eclipse-based - product.
  2. -
  3. During the Provisioning Process, the Provisioning Technology -may cause third party Installable Software or a portion thereof to be - accessed and copied to the Target Machine.
  4. -
  5. Pursuant to the Specification, you will provide to the user -the terms and conditions that govern the use of the Installable - Software ("Installable Software Agreement") and such Installable -Software Agreement shall be accessed from the Target - Machine in accordance with the Specification. Such Installable -Software Agreement must inform the user of the terms and conditions that - govern - the Installable Software and must solicit acceptance by the end -user in the manner prescribed in such Installable Software Agreement. -Upon such - indication of agreement by the user, the provisioning Technology -will complete installation of the Installable Software.
  6. -
- -

Cryptography

- -

Content may contain encryption software. The country in which you are - currently may have restrictions on the import, possession, and use, -and/or re-export to - another country, of encryption software. BEFORE using any encryption -software, please check the country's laws, regulations and policies -concerning the import, - possession, or use, and re-export of encryption software, to see if -this is permitted.

- -

Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.kernel/p2.inf b/org.eclipse.linuxtools.lttng2.kernel/p2.inf deleted file mode 100644 index 5246a0c824..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/p2.inf +++ /dev/null @@ -1,3 +0,0 @@ -instructions.configure=\ -org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:0,name:Linux Tools,enabled:false); \ -org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:1,name:Linux Tools,enabled:false); diff --git a/org.eclipse.linuxtools.lttng2.kernel/pom.xml b/org.eclipse.linuxtools.lttng2.kernel/pom.xml deleted file mode 100644 index 7976f1f326..0000000000 --- a/org.eclipse.linuxtools.lttng2.kernel/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.kernel - 3.2.0-SNAPSHOT - eclipse-feature - - Linux Tools LTTng Kernel Analysis Feature - - org.eclipse.linuxtools.lttng2 - - - - - org.eclipse.tycho.extras - tycho-source-feature-plugin - - - source-feature - package - - source-feature - - - - - - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attached-p2-metadata - package - - p2-metadata - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/.classpath b/org.eclipse.linuxtools.lttng2.ust.core.tests/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/.project b/org.eclipse.linuxtools.lttng2.ust.core.tests/.project deleted file mode 100644 index c034d1f68e..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.ust.core.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f3fc64575b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,393 +0,0 @@ -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=enabled -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 62cfa90dee..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.ust.core.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 7a659072f2..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ust.core.tests;singleton:=true -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Require-Bundle: org.junit;bundle-version="4.0.0", - org.eclipse.core.resources, - org.eclipse.core.runtime, - org.eclipse.linuxtools.tmf.core, - org.eclipse.linuxtools.tmf.core.tests;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.ctf.core, - org.eclipse.linuxtools.tmf.ctf.core.tests, - org.eclipse.linuxtools.lttng2.ust.core, - org.eclipse.linuxtools.lttng2.control.core -Export-Package: org.eclipse.linuxtools.lttng2.ust.core.tests, - org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack -Import-Package: com.google.common.collect diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/about.html b/org.eclipse.linuxtools.lttng2.ust.core.tests/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/build.properties b/org.eclipse.linuxtools.lttng2.ust.core.tests/build.properties deleted file mode 100644 index ddfbe617f6..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties -src.includes = about.html diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/plugin.properties b/org.eclipse.linuxtools.lttng2.ust.core.tests/plugin.properties deleted file mode 100644 index 79b4ace93a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/plugin.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.ust.core -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Userspace Tracer Analysis Core Tests Plug-in \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/pom.xml b/org.eclipse.linuxtools.lttng2.ust.core.tests/pom.xml deleted file mode 100644 index 691c73868b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.ust.core.tests - 3.1.0-SNAPSHOT - eclipse-test-plugin - - Linux Tools LTTng Userspace Tracer Analysis Core Test Plug-in - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - false - false - org.eclipse.platform.ide - - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/ActivatorTest.java b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/ActivatorTest.java deleted file mode 100644 index 31014bc395..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/ActivatorTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.linuxtools.lttng2.ust.core.tests; - -import junit.framework.TestCase; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * ActivatorTest - *

- * Test suite for the Activator class - *

- */ -@SuppressWarnings("javadoc") -public class ActivatorTest extends TestCase { - - // ------------------------------------------------------------------------ - // JUnit - // ------------------------------------------------------------------------ - - @BeforeClass - public static void setUpBeforeClass() { - } - - @AfterClass - public static void tearDownAfterClass() { - } - - /** - * @throws java.lang.Exception - */ - @Before - @Override - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - @Override - public void tearDown() throws Exception { - } - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#Activator()}. - */ - @Test - public void testActivator() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#getDefault()}. - */ - @Test - public void testGetDefault() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#start(org.osgi.framework.BundleContext)}. - */ - @Test - public void testStartBundleContext() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#stop(org.osgi.framework.BundleContext)}. - */ - @Test - public void testStopBundleContext() { - assertTrue(true); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/AllTests.java b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/AllTests.java deleted file mode 100644 index 62e904d9f3..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.linuxtools.lttng2.ust.core.tests; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Runner for the lttng2.kernel unit tests. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - ActivatorTest.class, - org.eclipse.linuxtools.lttng2.ust.core.tests.analysis.memory.AllTests.class, - org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack.AllTests.class -}) -public class AllTests { } diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/AllTests.java b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/AllTests.java deleted file mode 100644 index 98924bc4d6..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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: - * Guilliano Molaire - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.ust.core.tests.analysis.memory; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - UstMemoryAnalysisModuleTest.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/UstMemoryAnalysisModuleTest.java b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/UstMemoryAnalysisModuleTest.java deleted file mode 100644 index cbf456347a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/UstMemoryAnalysisModuleTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************* - * 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: - * Guilliano Molaire - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.ust.core.tests.analysis.memory; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.Set; - -import org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage.UstMemoryStrings; -import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; -import org.eclipse.linuxtools.lttng2.ust.core.analysis.memory.UstMemoryAnalysisModule; -import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement; -import org.junit.Before; -import org.junit.Test; - -import com.google.common.collect.ImmutableSet; - -/** - * Tests for the {@link UstMemoryAnalysisModule} - * - * @author Guilliano Molaire - */ -public class UstMemoryAnalysisModuleTest { - - /** The analysis module */ - private UstMemoryAnalysisModule fUstAnalysisModule; - - /** - * Set-up the test - */ - @Before - public void setup() { - fUstAnalysisModule = new UstMemoryAnalysisModule(); - } - - /** - * Test for {@link UstMemoryAnalysisModule#getAnalysisRequirements()} - */ - @Test - public void testGetAnalysisRequirements() { - Iterable requirements = fUstAnalysisModule.getAnalysisRequirements(); - assertNotNull(requirements); - assertTrue(requirements.iterator().hasNext()); - - /* There should be the event and domain type */ - TmfAnalysisRequirement eventReq = null; - TmfAnalysisRequirement domainReq = null; - int numberOfRequirement = 0; - for (TmfAnalysisRequirement requirement : requirements) { - ++numberOfRequirement; - if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_EVENT)) { - eventReq = requirement; - } else if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN)) { - domainReq = requirement; - } - } - assertNotNull(eventReq); - assertNotNull(domainReq); - - /* There should be two requirements */ - assertEquals(2, numberOfRequirement); - - /* Verify the content of the requirements themselves */ - /* Domain should be kernel */ - assertEquals(1, domainReq.getValues().size()); - for (String domain : domainReq.getValues()) { - assertEquals(SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST, domain); - } - - /* Events */ - Set expectedEvents = ImmutableSet.of( - UstMemoryStrings.MALLOC, - UstMemoryStrings.FREE, - UstMemoryStrings.CALLOC, - UstMemoryStrings.REALLOC, - UstMemoryStrings.MEMALIGN, - UstMemoryStrings.POSIX_MEMALIGN - ); - - assertEquals(6, eventReq.getValues().size()); - for (String event : eventReq.getValues()) { - assertTrue("Unexpected event " + event, expectedEvents.contains(event)); - } - - Set infos = eventReq.getInformation(); - assertEquals(2, infos.size()); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java deleted file mode 100644 index 68841f0f16..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java +++ /dev/null @@ -1,281 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.ust.core.tests.trace.callstack; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.ust.core.trace.callstack.LttngUstCallStackProvider; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp; -import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestRule; -import org.junit.rules.Timeout; - -/** - * Base class for the UST callstack state provider tests. - * - * @author Alexandre Montplaisir - */ -public abstract class AbstractProviderTest { - - /** Time-out tests after 20 seconds */ - @Rule public TestRule globalTimeout= new Timeout(20000); - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - private static final CtfTmfTestTrace otherUstTrace = CtfTmfTestTrace.HELLO_LOST; - - private CtfTmfTrace fTrace = null; - private ITmfStateSystem fSS = null; - private TestLttngCallStackModule fModule; - - - // ------------------------------------------------------------------------ - // Abstract methods - // ------------------------------------------------------------------------ - - /** - * @return The test trace to use for this test - */ - protected abstract CtfTmfTestTrace getTestTrace(); - - /** - * @return The name of the executable process in that particular trace - */ - protected abstract String getProcName(); - - /** - * Get the list of timestamps to query in that trace. - * - * @param index - * Which of the test timestamps? - * @return That particular timestamp - */ - protected abstract long getTestTimestamp(int index); - - // ------------------------------------------------------------------------ - // Maintenance - // ------------------------------------------------------------------------ - - /** - * Perform pre-class initialization. - */ - @Before - public void setUp() { - CtfTmfTestTrace testTrace = getTestTrace(); - - fTrace = testTrace.getTrace(); - fModule = new TestLttngCallStackModule(); - try { - fModule.setTrace(fTrace); - } catch (TmfAnalysisException e) { - fail(); - } - fModule.schedule(); - assertTrue(fModule.waitForCompletion()); - - fSS = fModule.getStateSystem(); - assertNotNull(fSS); - } - - /** - * Perform post-class clean-up. - */ - @After - public void tearDown() { - fModule.close(); - if (fTrace != null) { - fTrace.dispose(); - File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(fTrace)); - deleteDirectory(suppDir); - } - } - - // ------------------------------------------------------------------------ - // Test methods - // ------------------------------------------------------------------------ - - /** - * Test the handling of generic UST traces who do not contain the required - * information. - */ - @Test - public void testOtherUstTrace() { - /* Initialize the trace and analysis module */ - File suppDir; - try (CtfTmfTrace ustTrace = otherUstTrace.getTrace();) { - try (TestLttngCallStackModule module = new TestLttngCallStackModule();) { - try { - module.setTrace(ustTrace); - } catch (TmfAnalysisException e) { - fail(); - } - module.schedule(); - assertTrue(module.waitForCompletion()); - - /* Make sure the generated state system exists, but is empty */ - ITmfStateSystem ss = module.getStateSystem(); - assertNotNull(ss); - assertTrue(ss.getStartTime() >= ustTrace.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue()); - assertEquals(0, ss.getNbAttributes()); - } - suppDir = new File(TmfTraceManager.getSupplementaryFileDir(ustTrace)); - } - deleteDirectory(suppDir); - assertFalse(suppDir.exists()); - } - - /** - * Test that the callstack state system is there and contains data. - */ - @Test - public void testConstruction() { - assertNotNull(fSS); - assertTrue(fSS.getNbAttributes() > 0); - } - - /** - * Test the callstack at the beginning of the state system. - */ - @Test - public void testCallStackBegin() { - long start = fSS.getStartTime(); - String[] cs = getCallStack(fSS, getProcName(), start); - assertEquals(1, cs.length); - - assertEquals("40472b", cs[0]); - } - - /** - * Test the callstack somewhere in the trace. - */ - @Test - public void testCallStack1() { - String[] cs = getCallStack(fSS, getProcName(), getTestTimestamp(0)); - assertEquals(2, cs.length); - - assertEquals("40472b", cs[0]); - assertEquals("403d60", cs[1]); - } - - /** - * Test the callstack somewhere in the trace. - */ - @Test - public void testCallStack2() { - String[] cs = getCallStack(fSS, getProcName(), getTestTimestamp(1)); - assertEquals(3, cs.length); - - assertEquals("40472b", cs[0]); - assertEquals("403b14", cs[1]); - assertEquals("401b23", cs[2]); - } - - /** - * Test the callstack somewhere in the trace. - */ - @Test - public void testCallStack3() { - String[] cs = getCallStack(fSS, getProcName(), getTestTimestamp(2)); - assertEquals(4, cs.length); - - assertEquals("40472b", cs[0]); - assertEquals("4045c8", cs[1]); - assertEquals("403760", cs[2]); - assertEquals("401aac", cs[3]); - } - - /** - * Test the callstack at the end of the trace/state system. - */ - @Test - public void testCallStackEnd() { - long end = fSS.getCurrentEndTime(); - String[] cs = getCallStack(fSS, getProcName(), end); - assertEquals(3, cs.length); - - assertEquals("40472b", cs[0]); - assertEquals("4045c8", cs[1]); - assertEquals("403760", cs[2]); - } - - // ------------------------------------------------------------------------ - // Utility methods - // ------------------------------------------------------------------------ - - /** Empty and delete a directory */ - private static void deleteDirectory(File dir) { - /* Assuming the dir only contains file or empty directories */ - for (File file : dir.listFiles()) { - file.delete(); - } - dir.delete(); - } - - /** Get the callstack for the given timestamp, for this particular trace */ - private static String[] getCallStack(ITmfStateSystem ss, String processName, long timestamp) { - try { - int stackAttribute = ss.getQuarkAbsolute("Threads", processName, "CallStack"); - List state = ss.queryFullState(timestamp); - int depth = state.get(stackAttribute).getStateValue().unboxInt(); - - int stackTop = ss.getQuarkRelative(stackAttribute, String.valueOf(depth)); - ITmfStateValue top = state.get(stackTop).getStateValue(); - assertEquals(top, ss.querySingleStackTop(timestamp, stackAttribute).getStateValue()); - - String[] ret = new String[depth]; - for (int i = 0; i < depth; i++) { - int quark = ss.getQuarkRelative(stackAttribute, String.valueOf(i + 1)); - ret[i] = state.get(quark).getStateValue().unboxStr(); - } - return ret; - - } catch (AttributeNotFoundException e) { - fail(e.getMessage()); - } catch (StateSystemDisposedException e) { - fail(e.getMessage()); - } - fail(); - return null; - } - - private class TestLttngCallStackModule extends TmfStateSystemAnalysisModule { - - @Override - protected ITmfStateProvider createStateProvider() { - return new LttngUstCallStackProvider(getTrace()); - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AllTests.java b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AllTests.java deleted file mode 100644 index d34690034f..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite for org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - LttngUstCallStackProviderFastTest.class, - LttngUstCallStackProviderTest.class -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderFastTest.java b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderFastTest.java deleted file mode 100644 index fccfd93ec2..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderFastTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * 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: - * Alexandre Montplaisir - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack; - -import static org.junit.Assume.assumeTrue; - -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.junit.BeforeClass; - -/** - * Test suite for the UST callstack state provider, using the trace of a program - * instrumented with lttng-ust-cyg-profile-fast.so tracepoints. These do not - * contain the function addresses in the func_exit events. - * - * @author Alexandre Montplaisir - */ -public class LttngUstCallStackProviderFastTest extends AbstractProviderTest { - - private static final long[] timestamps = { 1379361250310000000L, - 1379361250498400000L, - 1379361250499759000L }; - - /** - * Class setup - */ - @BeforeClass - public static void setUpClass() { - assumeTrue(CtfTmfTestTrace.CYG_PROFILE_FAST.exists()); - } - - @Override - protected CtfTmfTestTrace getTestTrace() { - return CtfTmfTestTrace.CYG_PROFILE_FAST; - } - - @Override - protected String getProcName() { - return "glxgears-29822"; - } - - @Override - protected long getTestTimestamp(int index) { - return timestamps[index]; - } - -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderTest.java b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderTest.java deleted file mode 100644 index e27e7627b9..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * 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: - * Alexandre Montplaisir - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack; - -import static org.junit.Assume.assumeTrue; - -import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; -import org.junit.BeforeClass; - -/** - * Test suite for the UST callstack state provider, using the trace of a program - * instrumented with lttng-ust-cyg-profile.so tracepoints. - * - * @author Alexandre Montplaisir - */ -public class LttngUstCallStackProviderTest extends AbstractProviderTest { - - private static final long[] timestamps = { 1378850463600000000L, - 1378850463770000000L, - 1378850463868753000L }; - - /** - * Class setup - */ - @BeforeClass - public static void setUpClass() { - assumeTrue(CtfTmfTestTrace.CYG_PROFILE.exists()); - } - - @Override - protected CtfTmfTestTrace getTestTrace() { - return CtfTmfTestTrace.CYG_PROFILE; - } - - @Override - protected String getProcName() { - return "glxgears-16073"; - } - - @Override - protected long getTestTimestamp(int index) { - return timestamps[index]; - } - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core/.classpath b/org.eclipse.linuxtools.lttng2.ust.core/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.ust.core/.project b/org.eclipse.linuxtools.lttng2.ust.core/.project deleted file mode 100644 index d71a1a0496..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.ust.core - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 9f3662cd78..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,394 +0,0 @@ -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.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 diff --git a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.pde.prefs deleted file mode 100644 index d92b94fd4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.core/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.ust.core/META-INF/MANIFEST.MF deleted file mode 100644 index 8cf9fe5ce2..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ust.core;singleton:=true -Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.ust.core.Activator -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Export-Package: org.eclipse.linuxtools.internal.lttng2.ust.core;x-internal:=true, - org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage;x-friends:="org.eclipse.linuxtools.lttng2.ust.ui,org.eclipse.linuxtools.lttng2.ust.core.tests", - org.eclipse.linuxtools.internal.lttng2.ust.core.trace.callstack;x-friends:="org.eclipse.linuxtools.lttng2.ust.ui,org.eclipse.linuxtools.lttng2.ust.core.tests", - org.eclipse.linuxtools.lttng2.ust.core.analysis.memory, - org.eclipse.linuxtools.lttng2.ust.core.trace -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.tracecompass.ctf.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.ctf.core, - org.eclipse.linuxtools.lttng2.control.core -Import-Package: com.google.common.collect diff --git a/org.eclipse.linuxtools.lttng2.ust.core/about.html b/org.eclipse.linuxtools.lttng2.ust.core/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.ust.core/build.properties b/org.eclipse.linuxtools.lttng2.ust.core/build.properties deleted file mode 100644 index 61172cf72c..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# 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 -############################################################################### - -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - plugin.xml -src.includes = about.html diff --git a/org.eclipse.linuxtools.lttng2.ust.core/plugin.properties b/org.eclipse.linuxtools.lttng2.ust.core/plugin.properties deleted file mode 100644 index e48e5b5e18..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/plugin.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# 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 -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.ust.core -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Userspace Tracer Analysis Core Plug-in - -tracetype.type.ust = LTTng UST Trace diff --git a/org.eclipse.linuxtools.lttng2.ust.core/plugin.xml b/org.eclipse.linuxtools.lttng2.ust.core/plugin.xml deleted file mode 100644 index 8d536c340e..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/plugin.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.ust.core/pom.xml b/org.eclipse.linuxtools.lttng2.ust.core/pom.xml deleted file mode 100644 index 28db6a7567..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.ust.core - 3.1.0-SNAPSHOT - eclipse-plugin - - Linux Tools LTTng Userspace Tracer Analysis Core Plug-in - - - - - org.eclipse.tycho - tycho-source-plugin - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/Activator.java b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/Activator.java deleted file mode 100644 index cdc004e903..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/Activator.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.linuxtools.internal.lttng2.ust.core; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; -import org.osgi.framework.BundleContext; - -/** - * Activator - *

- * 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.linuxtools.lttng2.ust.core"; //$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); - } - - /** - * 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)); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java deleted file mode 100644 index eadbc058c3..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java +++ /dev/null @@ -1,200 +0,0 @@ -/********************************************************************** - * Copyright (c) 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: - * Matthew Khouzam - Initial API and implementation - * Geneviève Bastien - Memory is per thread and only total is kept - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.linuxtools.lttng2.ust.core.trace.LttngUstTrace; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.statesystem.core.statevalue.TmfStateValue; -import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; -import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; -import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent; - -/** - * State provider to track the memory of the threads using the UST libc wrapper - * memory events. - * - * @author Matthew Khouzam - * @author Geneviève Bastien - */ -public class MemoryUsageStateProvider extends AbstractTmfStateProvider { - - /* Version of this state provider */ - private static final int VERSION = 1; - - /* Maps a pointer to a memory zone to the size of the memory */ - private final Map fMemory = new HashMap<>(); - - private static final Long MINUS_ONE = Long.valueOf(-1); - private static final Long ZERO = Long.valueOf(0); - private static final String EMPTY_STRING = ""; //$NON-NLS-1$ - - /** - * Constructor - * - * @param trace - * trace - */ - public MemoryUsageStateProvider(LttngUstTrace trace) { - super(trace, CtfTmfEvent.class, "Ust:Memory"); //$NON-NLS-1$ - } - - @Override - protected void eventHandle(ITmfEvent event) { - String name = event.getType().getName(); - switch (name) { - case UstMemoryStrings.MALLOC: { - Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); - if (ZERO.equals(ptr)) { - return; - } - Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); - setMem(event, ptr, size); - } - break; - case UstMemoryStrings.FREE: { - Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); - if (ZERO.equals(ptr)) { - return; - } - setMem(event, ptr, ZERO); - } - break; - case UstMemoryStrings.CALLOC: { - Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); - if (ZERO.equals(ptr)) { - return; - } - Long nmemb = (Long) event.getContent().getField(UstMemoryStrings.FIELD_NMEMB).getValue(); - Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); - setMem(event, ptr, size * nmemb); - } - break; - case UstMemoryStrings.REALLOC: { - Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); - if (ZERO.equals(ptr)) { - return; - } - Long newPtr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_INPTR).getValue(); - Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); - setMem(event, ptr, ZERO); - setMem(event, newPtr, size); - } - break; - case UstMemoryStrings.MEMALIGN: { - Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); - if (ZERO.equals(ptr)) { - return; - } - Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); - setMem(event, ptr, size); - } - break; - case UstMemoryStrings.POSIX_MEMALIGN: { - Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_OUTPTR).getValue(); - if (ZERO.equals(ptr)) { - return; - } - Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); - setMem(event, ptr, size); - } - break; - default: - break; - } - - } - - @Override - public ITmfStateProvider getNewInstance() { - return new MemoryUsageStateProvider(getTrace()); - } - - @Override - public LttngUstTrace getTrace() { - return (LttngUstTrace) super.getTrace(); - } - - @Override - public int getVersion() { - return VERSION; - } - - private static Long getVtid(ITmfEvent event) { - ITmfEventField field = event.getContent().getField(UstMemoryStrings.CONTEXT_VTID); - if (field == null) { - return MINUS_ONE; - } - return (Long) field.getValue(); - } - - private static String getProcname(ITmfEvent event) { - ITmfEventField field = event.getContent().getField(UstMemoryStrings.CONTEXT_PROCNAME); - if (field == null) { - return EMPTY_STRING; - } - return (String) field.getValue(); - } - - private void setMem(ITmfEvent event, Long ptr, Long size) { - long ts = event.getTimestamp().getValue(); - Long tid = getVtid(event); - - Long memoryDiff = size; - /* Size is 0, it means it was deleted */ - if (ZERO.equals(size)) { - Long memSize = fMemory.remove(ptr); - if (memSize == null) { - return; - } - memoryDiff = -memSize; - } else { - fMemory.put(ptr, size); - } - try { - int tidQuark = ss.getQuarkAbsoluteAndAdd(tid.toString()); - int tidMemQuark = ss.getQuarkRelativeAndAdd(tidQuark, UstMemoryStrings.UST_MEMORY_MEMORY_ATTRIBUTE); - - ITmfStateValue prevMem = ss.queryOngoingState(tidMemQuark); - /* First time we set this value */ - if (prevMem.isNull()) { - int procNameQuark = ss.getQuarkRelativeAndAdd(tidQuark, UstMemoryStrings.UST_MEMORY_PROCNAME_ATTRIBUTE); - String procName = getProcname(event); - /* - * No tid/procname for the event for the event, added to a - * 'others' thread - */ - if (tid.equals(MINUS_ONE)) { - procName = UstMemoryStrings.OTHERS; - } - ss.modifyAttribute(ts, TmfStateValue.newValueString(procName), procNameQuark); - prevMem = TmfStateValue.newValueLong(0); - } - - long prevMemValue = prevMem.unboxLong(); - prevMemValue += memoryDiff.longValue(); - ss.modifyAttribute(ts, TmfStateValue.newValueLong(prevMemValue), tidMemQuark); - } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) { - throw new IllegalStateException(e); - } - } - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/UstMemoryStrings.java b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/UstMemoryStrings.java deleted file mode 100644 index 30ee6d33bf..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/UstMemoryStrings.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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: - * Matthew Khouzam, Geneviève Bastien - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage; - -/** - * Strings for the memory usage state system using the LTTng UST libc - * instrumentation - * - * @author Matthew Khouzam - * @author Geneviève Bastien - */ -@SuppressWarnings({ "nls", "javadoc" }) -public interface UstMemoryStrings { - - /** Memory state system attribute name */ - static final String UST_MEMORY_MEMORY_ATTRIBUTE = "Memory"; //$NON-NLS-1$ - /** Procname state system attribute name */ - static final String UST_MEMORY_PROCNAME_ATTRIBUTE = "Procname"; //$NON-NLS-1$ - /** Name of the attribute to store memory usage of events with no context */ - static final String OTHERS = "Others"; - - /* UST_libc event names */ - static final String MALLOC = "ust_libc:malloc"; - static final String CALLOC = "ust_libc:calloc"; - static final String REALLOC = "ust_libc:realloc"; - static final String FREE = "ust_libc:free"; - static final String MEMALIGN = "ust_libc:memalign"; - static final String POSIX_MEMALIGN = "ust_libc:posix_memalign"; - - /* Possible contexts */ - static final String CONTEXT_VTID = "context._vtid"; - static final String CONTEXT_PROCNAME = "context._procname"; - - /* Event fields */ - static final String FIELD_PTR = "ptr"; - static final String FIELD_NMEMB = "nmemb"; - static final String FIELD_SIZE = "size"; - static final String FIELD_OUTPTR = "out_ptr"; - static final String FIELD_INPTR = "in_ptr"; - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/trace/callstack/LttngUstCallStackProvider.java b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/trace/callstack/LttngUstCallStackProvider.java deleted file mode 100644 index 15bc30a1aa..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/trace/callstack/LttngUstCallStackProvider.java +++ /dev/null @@ -1,171 +0,0 @@ -/******************************************************************************* - * 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: - * Alexandre Montplaisir - Initial API and implementation - * Patrick Tasse - Add support for thread id - *******************************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.ust.core.trace.callstack; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.linuxtools.tmf.core.callstack.CallStackStateProvider; -import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; -import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent; - -/** - * Callstack provider for LTTng-UST traces. - * - * If the traces contains 'func_entry' and 'func_exit' event (see the - * lttng-ust-cyg-profile manpage), AND contains vtid and procname contexts, we - * can use this information to populate the TMF Callstack View. - * - * Granted, most UST traces will not contain this information. In this case, - * this will simply build an empty state system, and the view will remain - * unavailable. - * - * @author Alexandre Montplaisir - */ -public class LttngUstCallStackProvider extends CallStackStateProvider { - - // ------------------------------------------------------------------------ - // Event strings - // ------------------------------------------------------------------------ - - /** Name of the fake field for the vtid contexts */ - private static final String CONTEXT_VTID = "context._vtid"; //$NON-NLS-1$ - - /** Name of the fake field for the procname context */ - private static final String CONTEXT_PROCNAME = "context._procname"; //$NON-NLS-1$ - - /** Field name for the target function address */ - private static final String FIELD_ADDR = "addr"; //$NON-NLS-1$ - - /** Event names indicating function entry */ - private static final Set FUNC_ENTRY_EVENTS = new HashSet<>(); - - /** Event names indicating function exit */ - private static final Set FUNC_EXIT_EVENTS = new HashSet<>(); - - static { - /* This seems overkill, but it will be checked every event. Gotta go FAST! */ - FUNC_ENTRY_EVENTS.add("lttng_ust_cyg_profile:func_entry"); //$NON-NLS-1$ - FUNC_ENTRY_EVENTS.add("lttng_ust_cyg_profile_fast:func_entry"); //$NON-NLS-1$ - - FUNC_EXIT_EVENTS.add("lttng_ust_cyg_profile:func_exit"); //$NON-NLS-1$ - FUNC_EXIT_EVENTS.add("lttng_ust_cyg_profile_fast:func_exit"); //$NON-NLS-1$ - } - - /** - * 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 = 2; - - // ------------------------------------------------------------------------ - // Constructor - // ------------------------------------------------------------------------ - - /** - * Constructor - * - * @param trace - * The UST trace - */ - public LttngUstCallStackProvider(ITmfTrace trace) { - super(trace); - } - - // ------------------------------------------------------------------------ - // Methods from AbstractTmfStateProvider - // ------------------------------------------------------------------------ - - @Override - public LttngUstCallStackProvider getNewInstance() { - return new LttngUstCallStackProvider(getTrace()); - } - - @Override - public int getVersion() { - return VERSION; - } - - // ------------------------------------------------------------------------ - // Methods from CallStackStateProvider - // ------------------------------------------------------------------------ - - /** - * Check that this event contains the required information we need to be - * used in the call stack view. We need at least the "procname" and "vtid" - * contexts. - */ - @Override - protected boolean considerEvent(ITmfEvent event) { - if (!(event instanceof CtfTmfEvent)) { - return false; - } - ITmfEventField content = ((CtfTmfEvent) event).getContent(); - if (content.getField(CONTEXT_VTID) == null || - content.getField(CONTEXT_PROCNAME) == null) { - return false; - } - return true; - } - - @Override - public String functionEntry(ITmfEvent event) { - String eventName = event.getType().getName(); - if (!FUNC_ENTRY_EVENTS.contains(eventName)) { - return null; - } - Long address = (Long) event.getContent().getField(FIELD_ADDR).getValue(); - return Long.toHexString(address); - } - - @Override - public String functionExit(ITmfEvent event) { - String eventName = event.getType().getName(); - if (!FUNC_EXIT_EVENTS.contains(eventName)) { - return null; - } - /* - * The 'addr' field may or may not be present in func_exit events, - * depending on if cyg-profile.so or cyg-profile-fast.so was used. - */ - ITmfEventField field = event.getContent().getField(FIELD_ADDR); - if (field == null) { - return CallStackStateProvider.UNDEFINED; - } - Long address = (Long) field.getValue(); - return Long.toHexString(address); - } - - @Override - public String getThreadName(ITmfEvent event) { - /* Class type and content was already checked if we get called here */ - ITmfEventField content = ((CtfTmfEvent) event).getContent(); - String procName = (String) content.getField(CONTEXT_PROCNAME).getValue(); - Long vtid = (Long) content.getField(CONTEXT_VTID).getValue(); - - if (procName == null || vtid == null) { - throw new IllegalStateException(); - } - - return new String(procName + '-' + vtid.toString()); - } - - @Override - protected Long getThreadId(ITmfEvent event) { - ITmfEventField content = ((CtfTmfEvent) event).getContent(); - return (Long) content.getField(CONTEXT_VTID).getValue(); - } -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/Messages.java b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/Messages.java deleted file mode 100644 index 90f39b747b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/Messages.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * 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: - * Guilliano Molaire - Initial API and implementation - *******************************************************************************/ -package org.eclipse.linuxtools.lttng2.ust.core.analysis.memory; - -import org.eclipse.osgi.util.NLS; - -/** - * Message bundle for the ust memory analysis module - * - * @author Guilliano Molaire - * @since 3.0 - */ -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng2.ust.core.analysis.memory.messages"; //$NON-NLS-1$ - - /** Information regarding events loading prior to the analysis execution */ - public static String UstMemoryAnalysisModule_EventsLoadingInformation; - - /** Example of how to execute the application with the libc wrapper */ - public static String UstMemoryAnalysisModule_EventsLoadingExampleInformation; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java deleted file mode 100644 index e4b3bd2167..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * 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 - * Guilliano Molaire - Provide the requirements of the analysis - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.ust.core.analysis.memory; - -import org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage.MemoryUsageStateProvider; -import org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage.UstMemoryStrings; -import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; -import org.eclipse.linuxtools.lttng2.ust.core.trace.LttngUstTrace; -import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement; -import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; - -import com.google.common.collect.ImmutableSet; - -/** - * This analysis build a state system from the libc memory instrumentation on a - * UST trace - * - * @author Geneviève Bastien - * @since 3.0 - */ -public class UstMemoryAnalysisModule extends TmfStateSystemAnalysisModule { - - /** - * Analysis ID, it should match that in the plugin.xml file - */ - public static String ID = "org.eclipse.linuxtools.lttng2.ust.analysis.memory"; //$NON-NLS-1$ - - private static final ImmutableSet REQUIRED_EVENTS = ImmutableSet.of( - UstMemoryStrings.MALLOC, - UstMemoryStrings.FREE, - UstMemoryStrings.CALLOC, - UstMemoryStrings.REALLOC, - UstMemoryStrings.MEMALIGN, - UstMemoryStrings.POSIX_MEMALIGN - ); - - /** The requirements as an immutable set */ - private static final ImmutableSet REQUIREMENTS; - - static { - /* Initialize the requirements for the analysis: domain and events */ - TmfAnalysisRequirement eventsReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT, REQUIRED_EVENTS, ValuePriorityLevel.MANDATORY); - /* - * In order to have these events, the libc wrapper with probes should be - * loaded - */ - eventsReq.addInformation(Messages.UstMemoryAnalysisModule_EventsLoadingInformation); - eventsReq.addInformation(Messages.UstMemoryAnalysisModule_EventsLoadingExampleInformation); - - /* The domain type of the analysis */ - TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN); - domainReq.addValue(SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST, ValuePriorityLevel.MANDATORY); - - REQUIREMENTS = ImmutableSet.of(domainReq, eventsReq); - } - - @Override - protected ITmfStateProvider createStateProvider() { - return new MemoryUsageStateProvider(getTrace()); - } - - @Override - public void setTrace(ITmfTrace trace) throws TmfAnalysisException { - if (!(trace instanceof LttngUstTrace)) { - throw new IllegalStateException("UstMemoryAnalysisModule: trace should be of type LttngUstTrace"); //$NON-NLS-1$ - } - super.setTrace(trace); - } - - @Override - protected LttngUstTrace getTrace() { - return (LttngUstTrace) super.getTrace(); - } - - @Override - public Iterable getAnalysisRequirements() { - return REQUIREMENTS; - } -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/messages.properties b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/messages.properties deleted file mode 100644 index fdc32e0300..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/messages.properties +++ /dev/null @@ -1,2 +0,0 @@ -UstMemoryAnalysisModule_EventsLoadingInformation=The libc wrapper should be loaded in order to get the events in the trace output. -UstMemoryAnalysisModule_EventsLoadingExampleInformation=Start the application to trace with: LD_PRELOAD=/path/to/liblttng-ust-libc-wrapper.so ./myProgram. diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/LttngUstTrace.java b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/LttngUstTrace.java deleted file mode 100644 index 2d89837f55..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/LttngUstTrace.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial API and implementation - * Alexandre Montplaisir - Add UST callstack state system - * Marc-Andre Laperle - Handle BufferOverflowException (Bug 420203) - **********************************************************************/ - -package org.eclipse.linuxtools.lttng2.ust.core.trace; - -import java.nio.BufferOverflowException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException; -import org.eclipse.linuxtools.ctf.core.trace.CTFTrace; -import org.eclipse.linuxtools.internal.lttng2.ust.core.Activator; -import org.eclipse.linuxtools.tmf.core.trace.TraceValidationStatus; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; - -/** - * Class to contain LTTng-UST traces - * - * @author Matthew Khouzam - * @since 2.1 - */ -public class LttngUstTrace extends CtfTmfTrace { - - private static final int CONFIDENCE = 100; - - /** - * Default constructor - */ - public LttngUstTrace() { - super(); - } - - /** - * {@inheritDoc} - *

- * This implementation sets the confidence to 100 if the trace is a valid - * CTF trace in the "ust" domain. - */ - @Override - public IStatus validate(final IProject project, final String path) { - try (CTFTrace temp = new CTFTrace(path);) { - /* Make sure the domain is "ust" in the trace's env vars */ - String dom = temp.getEnvironment().get("domain"); //$NON-NLS-1$ - if (dom != null && dom.equals("\"ust\"")) { //$NON-NLS-1$ - return new TraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID); - } - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngUstTrace_DomainError); - - } catch (CTFReaderException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); - } catch (NullPointerException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); - } catch (final BufferOverflowException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngUstTrace_TraceReadError + ": " + Messages.LttngUstTrace_MalformedTrace); //$NON-NLS-1$ - } - } -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/Messages.java b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/Messages.java deleted file mode 100644 index bd36c13aed..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/Messages.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.linuxtools.lttng2.ust.core.trace; - -import org.eclipse.osgi.util.NLS; - -/** - * Message bundle for lttng2.kernel.core.trace - * - * @author Matthew Khouzam - * @since 2.1 - */ -public class Messages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng2.ust.core.trace.messages"; //$NON-NLS-1$ - - /** - * The domain is not "ust" - */ - public static String LttngUstTrace_DomainError; - - /** - * Malformed trace (buffer overflow maybe?) - */ - public static String LttngUstTrace_MalformedTrace; - - /** - * Trace read error - */ - public static String LttngUstTrace_TraceReadError; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/messages.properties b/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/messages.properties deleted file mode 100644 index d170bb9a2f..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/messages.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -LttngUstTrace_DomainError=Domain mismatch, the environment should be 'ust'. -LttngUstTrace_MalformedTrace=Buffer overflow exception, trace is malformed -LttngUstTrace_TraceReadError=Lttng UST trace read error \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.classpath b/org.eclipse.linuxtools.lttng2.ust.ui.tests/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.project b/org.eclipse.linuxtools.lttng2.ust.ui.tests/.project deleted file mode 100644 index 1b6d7ef69c..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.ust.ui.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f3fc64575b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,393 +0,0 @@ -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=enabled -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 62cfa90dee..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.ust.ui.tests/META-INF/MANIFEST.MF deleted file mode 100644 index d3794c813f..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ust.ui.tests;singleton:=true -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Require-Bundle: org.junit;bundle-version="4.0.0", - org.eclipse.ui, - org.eclipse.core.resources, - org.eclipse.core.runtime, - org.eclipse.linuxtools.lttng2.ust.ui;bundle-version="3.1.0" -Export-Package: org.eclipse.linuxtools.lttng2.ust.ui.tests diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/about.html b/org.eclipse.linuxtools.lttng2.ust.ui.tests/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/build.properties b/org.eclipse.linuxtools.lttng2.ust.ui.tests/build.properties deleted file mode 100644 index f7a0b9854e..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/build.properties +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties -src.includes = about.html diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/plugin.properties b/org.eclipse.linuxtools.lttng2.ust.ui.tests/plugin.properties deleted file mode 100644 index c59001c2f2..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/plugin.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.ust.ui.tests -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Userspace Tracer Analysis UI Tests Plug-in \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/pom.xml b/org.eclipse.linuxtools.lttng2.ust.ui.tests/pom.xml deleted file mode 100644 index 2645117c8b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.ust.ui.tests - 3.1.0-SNAPSHOT - eclipse-test-plugin - - Linux Tools LTTng Userspace Tracer Analysis UI Tests Plug-in - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - org.eclipse.linuxtools.lttng2.ust.ui.tests - org.eclipse.linuxtools.lttng2.ust.ui.tests.AllTests - true - true - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide - - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/ActivatorTest.java b/org.eclipse.linuxtools.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/ActivatorTest.java deleted file mode 100644 index 3541ae3dcc..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/ActivatorTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.linuxtools.lttng2.ust.ui.tests; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -/** - * Test suite for the Activator class - */ -public class ActivatorTest { - - // ------------------------------------------------------------------------ - // Tests - // ------------------------------------------------------------------------ - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator#Activator()}. - */ - @Test - public void testActivator() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator#getDefault()}. - */ - @Test - public void testGetDefault() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator#start}. - */ - @Test - public void testStartBundleContext() { - assertTrue(true); - } - - /** - * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator#stop}. - */ - @Test - public void testStopBundleContext() { - assertTrue(true); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/AllTests.java b/org.eclipse.linuxtools.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/AllTests.java deleted file mode 100644 index b469599244..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.linuxtools.lttng2.ust.ui.tests; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Run the lttng2.ust.ui unit tests. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - ActivatorTest.class, -}) -public class AllTests { - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/.classpath b/org.eclipse.linuxtools.lttng2.ust.ui/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/.project b/org.eclipse.linuxtools.lttng2.ust.ui/.project deleted file mode 100644 index ade124a46c..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.ust.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 9f3662cd78..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,394 +0,0 @@ -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.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 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4fd0c7006a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,56 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index acc3abd47c..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,97 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.pde.prefs b/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.pde.prefs deleted file mode 100644 index d92b94fd4b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng2.ust.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 15acd32d27..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 3.1.0.qualifier -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ust.ui;singleton:=true -Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Require-Bundle: org.eclipse.core.resources, - org.eclipse.core.runtime, - org.eclipse.ui, - org.eclipse.linuxtools.lttng2.ust.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.ui;bundle-version="3.1.0", - org.eclipse.linuxtools.tmf.ctf.core -Export-Package: org.eclipse.linuxtools.internal.lttng2.ust.ui;x-friends:="org.eclipse.linuxtools.lttng2.ust.ui.tests", - org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage;x-friends:="org.eclipse.linuxtools.lttng2.ust.ui.tests", - org.eclipse.linuxtools.lttng2.ust.ui.analysis.callstack diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/about.html b/org.eclipse.linuxtools.lttng2.ust.ui/about.html deleted file mode 100644 index c258ef55d8..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2006

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/build.properties b/org.eclipse.linuxtools.lttng2.ust.ui/build.properties deleted file mode 100644 index 1046daa0a1..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# 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 -############################################################################### - -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - icons/,\ - .,\ - plugin.xml,\ - about.html,\ - plugin.properties -src.includes = about.html -additional.bundles = org.eclipse.jdt.annotation -jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/icons/obj16/garland16.png b/org.eclipse.linuxtools.lttng2.ust.ui/icons/obj16/garland16.png deleted file mode 100644 index 74f9751638..0000000000 Binary files a/org.eclipse.linuxtools.lttng2.ust.ui/icons/obj16/garland16.png and /dev/null differ diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/plugin.properties b/org.eclipse.linuxtools.lttng2.ust.ui/plugin.properties deleted file mode 100644 index b098643009..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/plugin.properties +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# 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 -############################################################################### - -#Properties file for org.eclipse.linuxtools.lttng2.ust.ui -Bundle-Vendor = Eclipse Linux Tools -Bundle-Name = Linux Tools LTTng Userspace Tracer Analysis UI Plug-in - -tracetype.type.ust = LTTng UST Trace -memoryusage.view.name = UST Memory Usage - -analysis.callstack = LTTng-UST CallStack Analysis \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/plugin.xml b/org.eclipse.linuxtools.lttng2.ust.ui/plugin.xml deleted file mode 100644 index 35df526b5b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/plugin.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/pom.xml b/org.eclipse.linuxtools.lttng2.ust.ui/pom.xml deleted file mode 100644 index 74648a0212..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.ust.ui - 3.1.0-SNAPSHOT - eclipse-plugin - - Linux Tools LTTng Userspace Tracer Analysis UI Plug-in - - - - - org.eclipse.tycho - tycho-source-plugin - - - - - org.eclipse.linuxtools.lttng2 - diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/Activator.java b/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/Activator.java deleted file mode 100644 index 93eef4cb9f..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/Activator.java +++ /dev/null @@ -1,184 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.linuxtools.internal.lttng2.ust.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.linuxtools.lttng2.ust.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)); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageView.java b/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageView.java deleted file mode 100644 index aacb49aa37..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageView.java +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************** - * 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: - * Matthew Khouzam - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage; - -import org.eclipse.linuxtools.tmf.ui.views.TmfChartView; -import org.eclipse.swt.widgets.Composite; - -/** - * Memory Usage View - * - * @author Matthew Khouzam - */ -public class MemoryUsageView extends TmfChartView { - - /** ID string */ - public static final String ID = "org.eclipse.linuxtools.lttng2.ust.memoryusage"; //$NON-NLS-1$ - - /** - * Constructor - */ - public MemoryUsageView() { - super(Messages.MemoryUsageView_Title); - } - - @Override - public void createPartControl(Composite parent) { - setChartViewer( new MemoryUsageViewer(parent)); - super.createPartControl(parent); - } - - @Override - public void setFocus() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageViewer.java b/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageViewer.java deleted file mode 100644 index fcb2c06ed0..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageViewer.java +++ /dev/null @@ -1,158 +0,0 @@ -/********************************************************************** - * Copyright (c) 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: - * Bernd Hufmann - Initial API and implementation - * Geneviève Bastien - Create and use base class for XY plots - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage.UstMemoryStrings; -import org.eclipse.linuxtools.internal.tmf.core.Activator; -import org.eclipse.linuxtools.lttng2.ust.core.analysis.memory.UstMemoryAnalysisModule; -import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; -import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; -import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; -import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; -import org.eclipse.linuxtools.tmf.ui.viewers.xycharts.linecharts.TmfCommonXLineChartViewer; -import org.eclipse.swt.widgets.Composite; - -/** - * Memory usage view - * - * @author Matthew Khouzam - */ -@SuppressWarnings("restriction") -public class MemoryUsageViewer extends TmfCommonXLineChartViewer { - - private TmfStateSystemAnalysisModule fModule = null; - - private final Map fYValues = new HashMap<>(); - private final Map fMemoryQuarks = new HashMap<>(); - private final Map fSeriesName = new HashMap<>(); - - private static final int BYTES_TO_KB = 1024; - - // Timeout between updates in the updateData thread - private static final long BUILD_UPDATE_TIMEOUT = 500; - - /** - * Constructor - * - * @param parent - * parent view - */ - public MemoryUsageViewer(Composite parent) { - super(parent, Messages.MemoryUsageViewer_Title, Messages.MemoryUsageViewer_XAxis, Messages.MemoryUsageViewer_YAxis); - } - - @Override - protected void initializeDataSource() { - if (getTrace() != null) { - fModule = getTrace().getAnalysisModuleOfClass(TmfStateSystemAnalysisModule.class, UstMemoryAnalysisModule.ID); - if (fModule == null) { - return; - } - fModule.schedule(); - } - } - - @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(); - /* Don't wait for the module completion, when it's ready, we'll know */ - if (ss == null) { - return; - } - - double[] xvalues = getXAxis(start, end, nb); - setXAxis(xvalues); - - boolean complete = false; - long currentEnd = start; - - while (!complete && currentEnd < end) { - if (monitor.isCanceled()) { - return; - } - complete = ss.waitUntilBuilt(BUILD_UPDATE_TIMEOUT); - currentEnd = ss.getCurrentEndTime(); - List tidQuarks = ss.getSubAttributes(-1, false); - long traceStart = getStartTime(); - long traceEnd = getEndTime(); - long offset = this.getTimeOffset(); - - /* Initialize quarks and series names */ - for (int quark : tidQuarks) { - fYValues.put(quark, new double[xvalues.length]); - fMemoryQuarks.put(quark, ss.getQuarkRelative(quark, UstMemoryStrings.UST_MEMORY_MEMORY_ATTRIBUTE)); - int procNameQuark = ss.getQuarkRelative(quark, UstMemoryStrings.UST_MEMORY_PROCNAME_ATTRIBUTE); - try { - ITmfStateValue procnameValue = ss.querySingleState(start, procNameQuark).getStateValue(); - String procname = new String(); - if (!procnameValue.isNull()) { - procname = procnameValue.unboxStr(); - } - fSeriesName.put(quark, new String(procname + ' ' + '(' + ss.getAttributeName(quark) + ')').trim()); - } catch (TimeRangeException e) { - fSeriesName.put(quark, '(' + ss.getAttributeName(quark) + ')'); - } - } - - /* - * TODO: It should only show active threads in the time range. If a - * tid does not have any memory value (only 1 interval in the time - * range with value null or 0), then its series should not be - * displayed. - */ - double yvalue = 0.0; - for (int i = 0; i < xvalues.length; i++) { - if (monitor.isCanceled()) { - return; - } - double x = xvalues[i]; - long time = (long) x + offset; - // make sure that time is in the trace range after double to - // long conversion - time = time < traceStart ? traceStart : time; - time = time > traceEnd ? traceEnd : time; - - for (int quark : tidQuarks) { - try { - yvalue = ss.querySingleState(time, fMemoryQuarks.get(quark)).getStateValue().unboxLong() / BYTES_TO_KB; - fYValues.get(quark)[i] = yvalue; - } catch (TimeRangeException e) { - fYValues.get(quark)[i] = 0; - } - } - } - for (int quark : tidQuarks) { - setSeries(fSeriesName.get(quark), fYValues.get(quark)); - } - updateDisplay(); - } - } catch (AttributeNotFoundException | StateValueTypeException | StateSystemDisposedException e) { - Activator.logError("Error updating the data of the Memory usage view", e); //$NON-NLS-1$ - } - } - -} diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/Messages.java b/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/Messages.java deleted file mode 100644 index 29a4bbfa68..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/Messages.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.internal.lttng2.ust.ui.views.memusage; - -import org.eclipse.osgi.util.NLS; - -/** - * Translatable strings for the ust memory usage view - * - * @author Geneviève Bastien - */ -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage.messages"; //$NON-NLS-1$ - /** Title of the memory usage xy view */ - public static String MemoryUsageView_Title; - - /** Title of the memory viewer */ - public static String MemoryUsageViewer_Title; - /** X axis caption */ - public static String MemoryUsageViewer_XAxis; - /** Y axis caption */ - public static String MemoryUsageViewer_YAxis; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/messages.properties b/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/messages.properties deleted file mode 100644 index 2de2271a0b..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/messages.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# 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: -# Ericsson - Initial API and implementation -############################################################################### -MemoryUsageView_Title=Memory Usage -MemoryUsageViewer_Title=Memory Allocation vs Time -MemoryUsageViewer_XAxis=Time -MemoryUsageViewer_YAxis=Usage (KB) diff --git a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/lttng2/ust/ui/analysis/callstack/LttngUstCallStackAnalysis.java b/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/lttng2/ust/ui/analysis/callstack/LttngUstCallStackAnalysis.java deleted file mode 100644 index f1b0ec08aa..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/lttng2/ust/ui/analysis/callstack/LttngUstCallStackAnalysis.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * 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.linuxtools.lttng2.ust.ui.analysis.callstack; - -import org.eclipse.linuxtools.internal.lttng2.ust.core.trace.callstack.LttngUstCallStackProvider; -import org.eclipse.linuxtools.lttng2.ust.core.trace.LttngUstTrace; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; -import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.ui.views.callstack.AbstractCallStackAnalysis; - -/** - * Call-stack analysis to populate the TMF CallStack View from UST cyg-profile - * events. - * - * @author Alexandre Montplaisir - * @since 3.0 - */ -public class LttngUstCallStackAnalysis extends AbstractCallStackAnalysis { - - @Override - public void setTrace(ITmfTrace trace) throws TmfAnalysisException { - if (!(trace instanceof LttngUstTrace)) { - throw new IllegalArgumentException("Trace should be of type LttngUstTrace"); //$NON-NLS-1$ - } - super.setTrace(trace); - } - - @Override - protected LttngUstTrace getTrace() { - return (LttngUstTrace) super.getTrace(); - } - - @Override - protected ITmfStateProvider createStateProvider() { - return new LttngUstCallStackProvider(getTrace()); - } - -} diff --git a/org.eclipse.linuxtools.lttng2.ust/.project b/org.eclipse.linuxtools.lttng2.ust/.project deleted file mode 100644 index 41bff854b0..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.linuxtools.lttng2.ust - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/org.eclipse.linuxtools.lttng2.ust/.settings/org.eclipse.core.resources.prefs b/org.eclipse.linuxtools.lttng2.ust/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0203..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/org.eclipse.linuxtools.lttng2.ust/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.linuxtools.lttng2.ust/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/org.eclipse.linuxtools.lttng2.ust/build.properties b/org.eclipse.linuxtools.lttng2.ust/build.properties deleted file mode 100644 index c0db4e0a72..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -# Copyright (c) 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: -# Ericsson - Initial API and implementation -############################################################################### - -bin.includes = feature.xml,\ - feature.properties,\ - p2.inf diff --git a/org.eclipse.linuxtools.lttng2.ust/feature.properties b/org.eclipse.linuxtools.lttng2.ust/feature.properties deleted file mode 100644 index 6ec91abc31..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust/feature.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Copyright (c) 2009, 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: -# Ericsson - Initial API and implementation -############################################################################### - -featureName=Linux Tools LTTng Userspace Analysis - -description=Plug-ins to integrate LTTng-UST analysis tools into the workbench. \ -Includes the LTTng (Linux Tracing Toolkit), TMF (Tracing and Monitoring Framework) \ -and CTF (Common Trace Format) features. - -featureProvider=Eclipse Linux Tools - -copyright=Copyright 2013 Ericsson - diff --git a/org.eclipse.linuxtools.lttng2.ust/feature.xml b/org.eclipse.linuxtools.lttng2.ust/feature.xml deleted file mode 100644 index 72c615a9c8..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust/feature.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.linuxtools.lttng2.ust/p2.inf b/org.eclipse.linuxtools.lttng2.ust/p2.inf deleted file mode 100644 index 5246a0c824..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust/p2.inf +++ /dev/null @@ -1,3 +0,0 @@ -instructions.configure=\ -org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:0,name:Linux Tools,enabled:false); \ -org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:1,name:Linux Tools,enabled:false); diff --git a/org.eclipse.linuxtools.lttng2.ust/pom.xml b/org.eclipse.linuxtools.lttng2.ust/pom.xml deleted file mode 100644 index 604c95f764..0000000000 --- a/org.eclipse.linuxtools.lttng2.ust/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.tracecompass - org.eclipse.tracecompass - 3.2.0-SNAPSHOT - - - org.eclipse.linuxtools.lttng2.ust - 3.2.0-SNAPSHOT - eclipse-feature - - Linux Tools LTTng Userspace Tracer Analysis Feature - - org.eclipse.linuxtools.lttng2 - - - - - org.eclipse.tycho.extras - tycho-source-feature-plugin - - - source-feature - package - - source-feature - - - - - - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attached-p2-metadata - package - - p2-metadata - - - - - - - diff --git a/org.eclipse.linuxtools.tmf.ui/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.tmf.ui/META-INF/MANIFEST.MF index 1ba880f0fd..1115e3e610 100644 --- a/org.eclipse.linuxtools.tmf.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.linuxtools.tmf.ui/META-INF/MANIFEST.MF @@ -30,9 +30,9 @@ Export-Package: org.eclipse.linuxtools.internal.tmf.ui;x-friends:="org.eclipse.l org.eclipse.linuxtools.internal.tmf.ui.project.dialogs;x-internal:=true, org.eclipse.linuxtools.internal.tmf.ui.project.dialogs.offset;x-internal:=true, org.eclipse.linuxtools.internal.tmf.ui.project.handlers;x-friends:="org.eclipse.linuxtools.tmf.ui.tests", - org.eclipse.linuxtools.internal.tmf.ui.project.model;x-friends:="org.eclipse.linuxtools.lttng2.ui,org.eclipse.linuxtools.tmf.ui.tests,org.eclipse.linuxtools.tmf.ctf.ui.tests", + org.eclipse.linuxtools.internal.tmf.ui.project.model;x-friends:="org.eclipse.tracecompass.lttng2.ui,org.eclipse.linuxtools.tmf.ui.tests,org.eclipse.linuxtools.tmf.ctf.ui.tests", org.eclipse.linuxtools.internal.tmf.ui.project.operations;x-internal:=true, - org.eclipse.linuxtools.internal.tmf.ui.project.wizards.importtrace;x-friends:="org.eclipse.linuxtools.tmf.ctf.ui.swtbot.tests,org.eclipse.linuxtools.tmf.ui,org.eclipse.linuxtools.lttng2.control.ui", + org.eclipse.linuxtools.internal.tmf.ui.project.wizards.importtrace;x-friends:="org.eclipse.linuxtools.tmf.ctf.ui.swtbot.tests,org.eclipse.linuxtools.tmf.ui,org.eclipse.tracecompass.lttng2.control.ui", org.eclipse.linuxtools.internal.tmf.ui.project.wizards.tracepkg;x-internal:=true, org.eclipse.linuxtools.internal.tmf.ui.project.wizards.tracepkg.importexport;x-internal:=true, org.eclipse.linuxtools.internal.tmf.ui.viewers.events.columns;x-internal:=true, diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/.classpath b/org.eclipse.tracecompass.lttng2.control.core.tests/.classpath new file mode 100644 index 0000000000..098194ca4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/.project b/org.eclipse.tracecompass.lttng2.control.core.tests/.project new file mode 100644 index 0000000000..96d73f60ff --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.control.core.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..f3fc64575b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,393 @@ +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=enabled +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 diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..62cfa90dee --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.control.core.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..042f862960 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.control.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.lttng2.control.core;bundle-version="3.1.0" +Export-Package: org.eclipse.linuxtools.lttng2.control.core.tests;x-friends:="org.eclipse.linuxtools.lttng.alltests", + org.eclipse.linuxtools.lttng2.control.core.tests.model.impl;x-internal:=true, + org.eclipse.linuxtools.lttng2.control.core.tests.relayd, + org.eclipse.linuxtools.lttng2.control.core.tests.session diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/about.html b/org.eclipse.tracecompass.lttng2.control.core.tests/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/build.properties b/org.eclipse.tracecompass.lttng2.control.core.tests/build.properties new file mode 100644 index 0000000000..f7a0b9854e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/build.properties @@ -0,0 +1,18 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties +src.includes = about.html diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/plugin.properties b/org.eclipse.tracecompass.lttng2.control.core.tests/plugin.properties new file mode 100644 index 0000000000..c4566f0ccd --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Control Core Tests Plug-in diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/pom.xml b/org.eclipse.tracecompass.lttng2.control.core.tests/pom.xml new file mode 100644 index 0000000000..1508086d93 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/pom.xml @@ -0,0 +1,44 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.control.core.tests + 3.1.0-SNAPSHOT + eclipse-test-plugin + + Trace Compass LTTng Control Core Tests Plug-in + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + org.eclipse.tracecompass.lttng2.control.core.tests + org.eclipse.linuxtools.lttng2.control.core.tests.AllTests + false + false + org.eclipse.platform.ide + + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/ActivatorTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/ActivatorTest.java new file mode 100644 index 0000000000..c0239d81af --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/ActivatorTest.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * 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 + * Alexandre Montplaisir - Port to JUnit4 + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Test stubs for the Activator. + */ +public class ActivatorTest { + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.core.Activator#Activator()}. + */ + @Test + public void testActivator() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.core.Activator#getDefault()}. + */ + @Test + public void testGetDefault() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.core.Activator#start(org.osgi.framework.BundleContext)}. + */ + @Test + public void testStartBundleContext() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.core.Activator#stop(org.osgi.framework.BundleContext)}. + */ + @Test + public void testStopBundleContext() { + assertTrue(true); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/AllTests.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/AllTests.java new file mode 100644 index 0000000000..cd640621f3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/AllTests.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * 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 + * Alexandre Montplaisir - Port to JUnit4 + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Run all the tests in the test suite + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ActivatorTest.class, + org.eclipse.linuxtools.lttng2.control.core.tests.model.impl.AllTests.class, + org.eclipse.linuxtools.lttng2.control.core.tests.session.AllTests.class, + org.eclipse.linuxtools.lttng2.control.core.tests.model.impl.AllTests.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/AllTests.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/AllTests.java new file mode 100644 index 0000000000..76f4d33447 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/AllTests.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2011, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Runner for the test suite + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + BaseEventInfoTest.class, + ChannelInfoTest.class, + DomainInfoTest.class, + EventInfoTest.class, + FieldInfoTest.class, + ProbeEventInfoTest.class, + SessionInfoTest.class, + TraceInfoTest.class, + UstProviderInfoTest.class, + SnapshotInfoTest.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/BaseEventInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/BaseEventInfoTest.java new file mode 100644 index 0000000000..871d2970cb --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/BaseEventInfoTest.java @@ -0,0 +1,567 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.*; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class BaseEventInfoTest contains test for the class + * {@link BaseEventInfo}. + */ +public class BaseEventInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private IBaseEventInfo fEventInfo1 = null; + private IBaseEventInfo fEventInfo2 = null; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + ModelImplFactory factory = new ModelImplFactory(); + fEventInfo1 = factory.getBaseEventInfo1(); + fEventInfo2 = factory.getBaseEventInfo2(); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Run the BaseEventInfo() constructor test. + */ + @Test + public void testBaseEventInfo() { + BaseEventInfo fixture = new BaseEventInfo("event"); + assertNotNull(fixture); + + TraceEventType result = fixture.getEventType(); + + assertEquals("event", fixture.getName()); + assertEquals("unknown", result.getInName()); + assertEquals("UNKNOWN", result.name()); + assertEquals("UNKNOWN", result.toString()); + assertEquals(4, result.ordinal()); + + TraceLogLevel level = fixture.getLogLevel(); + assertEquals("TRACE_DEBUG", level.getInName()); + assertEquals("TRACE_DEBUG", level.name()); + assertEquals("TRACE_DEBUG", level.toString()); + assertEquals(14, level.ordinal()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testEventInfoCopy() { + BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo1); + + assertEquals(fEventInfo1.getName(), info.getName()); + assertEquals(fEventInfo1.getEventType(), info.getEventType()); + assertEquals(fEventInfo1.getLogLevel(), info.getLogLevel()); + assertEquals(fEventInfo1.getFilterExpression(), info.getFilterExpression()); + + IFieldInfo[] orignalFields = fEventInfo1.getFields(); + IFieldInfo[] copiedFields = info.getFields(); + assertEquals(orignalFields.length, copiedFields.length); + + for (int i = 0; i < copiedFields.length; i++) { + assertEquals(orignalFields[i], copiedFields[i]); + } + } + + /** + * Test Copy Constructor + */ + @Test + public void testEventCopy2() { + try { + BaseEventInfo info = null; + new BaseEventInfo(info); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Run the TraceEventType getEventType() method test. + */ + @Test + public void testGetEventType_1() { + BaseEventInfo fixture = new BaseEventInfo("event"); + fixture.setEventType("unknown"); + + TraceEventType result = fixture.getEventType(); + + assertNotNull(result); + assertEquals("unknown", result.getInName()); + assertEquals("UNKNOWN", result.name()); + assertEquals("UNKNOWN", result.toString()); + assertEquals(4, result.ordinal()); + + fixture.setEventType(""); + result = fixture.getEventType(); + assertEquals("unknown", result.getInName()); + assertEquals("UNKNOWN", result.name()); + assertEquals("UNKNOWN", result.toString()); + assertEquals(4, result.ordinal()); + + fixture.setEventType("tracepoint"); + result = fixture.getEventType(); + assertNotNull(result); + assertEquals("tracepoint", result.getInName()); + assertEquals("TRACEPOINT", result.name()); + assertEquals("TRACEPOINT", result.toString()); + assertEquals(0, result.ordinal()); + + fixture.setEventType("syscall"); + result = fixture.getEventType(); + assertNotNull(result); + assertEquals("syscall", result.getInName()); + assertEquals("SYSCALL", result.name()); + assertEquals("SYSCALL", result.toString()); + assertEquals(1, result.ordinal()); + + fixture.setEventType("probe"); + result = fixture.getEventType(); + assertNotNull(result); + assertEquals("probe", result.getInName()); + assertEquals("PROBE", result.name()); + assertEquals("PROBE", result.toString()); + assertEquals(2, result.ordinal()); + + fixture.setEventType("function"); + result = fixture.getEventType(); + assertNotNull(result); + assertEquals("function", result.getInName()); + assertEquals("FUNCTION", result.name()); + assertEquals("FUNCTION", result.toString()); + assertEquals(3, result.ordinal()); + + + } + + /** + * Run the void setEventType(TraceEventType) method test. + */ + @Test + public void testSetEventType_2() { + BaseEventInfo fixture = new BaseEventInfo("event"); + fixture.setEventType(TraceEventType.TRACEPOINT); + + TraceEventType result = fixture.getEventType(); + + assertNotNull(result); + assertEquals("tracepoint", result.getInName()); + assertEquals("TRACEPOINT", result.name()); + assertEquals("TRACEPOINT", result.toString()); + assertEquals(0, result.ordinal()); + + fixture.setEventType(TraceEventType.UNKNOWN); + result = fixture.getEventType(); + + assertNotNull(result); + assertEquals("unknown", result.getInName()); + assertEquals("UNKNOWN", result.name()); + assertEquals("UNKNOWN", result.toString()); + assertEquals(4, result.ordinal()); + + fixture.setEventType(TraceEventType.SYSCALL); + result = fixture.getEventType(); + assertNotNull(result); + assertEquals("syscall", result.getInName()); + assertEquals("SYSCALL", result.name()); + assertEquals("SYSCALL", result.toString()); + assertEquals(1, result.ordinal()); + + fixture.setEventType(TraceEventType.PROBE); + result = fixture.getEventType(); + assertNotNull(result); + assertEquals("probe", result.getInName()); + assertEquals("PROBE", result.name()); + assertEquals("PROBE", result.toString()); + assertEquals(2, result.ordinal()); + + fixture.setEventType(TraceEventType.FUNCTION); + result = fixture.getEventType(); + assertNotNull(result); + assertEquals("function", result.getInName()); + assertEquals("FUNCTION", result.name()); + assertEquals("FUNCTION", result.toString()); + assertEquals(3, result.ordinal()); + + + } + + /** + * Run the void setLogLevel(TraceLogLevel) method test. + * Run the TraceLogLevel getLogLevel() method test + */ + @Test + public void testSetLogLevel1() { + BaseEventInfo fixture = new BaseEventInfo("event"); + fixture.setEventType(TraceEventType.TRACEPOINT); + fixture.setLogLevel(TraceLogLevel.TRACE_CRIT); + + // 2 set/get-operations are enough to test the method + TraceLogLevel result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_CRIT", result.getInName()); + assertEquals("TRACE_CRIT", result.name()); + assertEquals("TRACE_CRIT", result.toString()); + assertEquals(2, result.ordinal()); + + fixture.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_DEBUG_FUNCTION", result.getInName()); + assertEquals("TRACE_DEBUG_FUNCTION", result.name()); + assertEquals("TRACE_DEBUG_FUNCTION", result.toString()); + assertEquals(12, result.ordinal()); + } + + /** + * Run the void setLogLevel(String) method test. + * Run the TraceLogLevel getLogLevel() method test + */ + @Test + public void testSetLogLevel2() { + BaseEventInfo fixture = new BaseEventInfo("event"); + fixture.setEventType(TraceEventType.TRACEPOINT); + fixture.setLogLevel("TRACE_EMERG"); + + TraceLogLevel result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_EMERG", result.getInName()); + assertEquals("TRACE_EMERG", result.name()); + assertEquals(0, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_ALERT"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_ALERT", result.getInName()); + assertEquals("TRACE_ALERT", result.name()); + assertEquals(1, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_CRIT"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_CRIT", result.getInName()); + assertEquals("TRACE_CRIT", result.name()); + assertEquals(2, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_ERR"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_ERR", result.getInName()); + assertEquals("TRACE_ERR", result.name()); + assertEquals(3, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_WARNING"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_WARNING", result.getInName()); + assertEquals("TRACE_WARNING", result.name()); + assertEquals(4, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_NOTICE"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_NOTICE", result.getInName()); + assertEquals("TRACE_NOTICE", result.name()); + assertEquals(5, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_INFO"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_INFO", result.getInName()); + assertEquals("TRACE_INFO", result.name()); + assertEquals(6, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_DEBUG_SYSTEM"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_DEBUG_SYSTEM", result.getInName()); + assertEquals("TRACE_DEBUG_SYSTEM", result.name()); + assertEquals(7, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_DEBUG_PROGRAM"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_DEBUG_PROGRAM", result.getInName()); + assertEquals("TRACE_DEBUG_PROGRAM", result.name()); + assertEquals(8, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_DEBUG_PROCESS"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_DEBUG_PROCESS", result.getInName()); + assertEquals("TRACE_DEBUG_PROCESS", result.name()); + assertEquals(9, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_DEBUG_MODULE"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_DEBUG_MODULE", result.getInName()); + assertEquals("TRACE_DEBUG_MODULE", result.name()); + assertEquals(10, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_DEBUG_UNIT"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_DEBUG_UNIT", result.getInName()); + assertEquals("TRACE_DEBUG_UNIT", result.name()); + assertEquals(11, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_DEBUG_FUNCTION"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_DEBUG_FUNCTION", result.getInName()); + assertEquals("TRACE_DEBUG_FUNCTION", result.name()); + assertEquals(12, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_DEBUG_LINE"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_DEBUG_LINE", result.getInName()); + assertEquals("TRACE_DEBUG_LINE", result.name()); + assertEquals(13, result.ordinal()); + + //------------------------ + fixture.setLogLevel("TRACE_DEBUG"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("TRACE_DEBUG", result.getInName()); + assertEquals("TRACE_DEBUG", result.name()); + assertEquals(14, result.ordinal()); + + //------------------------- + fixture.setLogLevel("LEVEL_UNKNOWN"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("LEVEL_UNKNOWN", result.getInName()); + assertEquals("LEVEL_UNKNOWN", result.name()); + assertEquals(15, result.ordinal()); + + fixture.setLogLevel("garbage"); + + result = fixture.getLogLevel(); + assertNotNull(result); + assertEquals("LEVEL_UNKNOWN", result.getInName()); + assertEquals("LEVEL_UNKNOWN", result.name()); + assertEquals(15, result.ordinal()); + } + + /** + * test filter expression + */ + @Test + public void testSetFields() { + BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo2); + info.setFilterExpression("stringfield==test"); + assertEquals("stringfield==test", info.getFilterExpression()); + } + + + /** + * test add field + */ + @Test + public void testAddField() { + BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo2); + + IFieldInfo field = new FieldInfo("intfield"); + field.setFieldType("int"); + + info.addField(field); + + // Verify the stored events + IFieldInfo[] result = info.getFields(); + + assertNotNull(result); + assertEquals(1, result.length); + assertNotNull(result[0]); + assertTrue(field.equals(result[0])); + } + + /** + * test set fields + */ + @Test + public void testFields() { + BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo2); + + IFieldInfo field1 = new FieldInfo("intfield"); + field1.setFieldType("int"); + + IFieldInfo field2 = new FieldInfo("stringfield"); + field2.setFieldType("string"); + + List fields = new LinkedList<>(); + fields.add(field1); + fields.add(field2); + info.setFields(fields); + + // Verify the stored events + IFieldInfo[] result = info.getFields(); + + assertNotNull(result); + assertEquals(2, result.length); + + for (int i = 0; i < result.length; i++) { + assertNotNull(result[i]); + assertTrue(fields.get(i).equals(result[i])); + } + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_1() { + BaseEventInfo fixture = new BaseEventInfo("event"); + fixture.setName("testName"); + fixture.setEventType(TraceEventType.TRACEPOINT); + fixture.setLogLevel(TraceLogLevel.TRACE_ERR); + + String result = fixture.toString(); + + // add additional test code here + assertEquals("[BaseEventInfo([TraceInfo(Name=testName)],type=TRACEPOINT,level=TRACE_ERR)]", result); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Test the .equals() method. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fEventInfo1.equals(fEventInfo1)); + assertTrue("equals", fEventInfo2.equals(fEventInfo2)); + + assertTrue("equals", !fEventInfo1.equals(fEventInfo2)); + assertTrue("equals", !fEventInfo2.equals(fEventInfo1)); + } + + /** + * Test the .equals() method. + */ + @Test + public void testEqualsSymmetry() { + BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1); + BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo2); + + assertTrue("equals", info1.equals(fEventInfo1)); + assertTrue("equals", fEventInfo1.equals(info1)); + + assertTrue("equals", info2.equals(fEventInfo2)); + assertTrue("equals", fEventInfo2.equals(info2)); + } + + /** + * Test the .equals() method. + */ + @Test + public void testEqualsTransivity() { + BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1); + BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo1); + BaseEventInfo info3 = new BaseEventInfo((BaseEventInfo)fEventInfo1); + + assertTrue("equals", info1.equals(info2)); + assertTrue("equals", info2.equals(info3)); + assertTrue("equals", info1.equals(info3)); + } + + /** + * Test the .equals() method. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fEventInfo1.equals(null)); + assertTrue("equals", !fEventInfo2.equals(null)); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Test the hashCode() method. + */ + @Test + public void testHashCode() { + BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1); + BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo2); + + assertTrue("hashCode", fEventInfo1.hashCode() == info1.hashCode()); + assertTrue("hashCode", fEventInfo2.hashCode() == info2.hashCode()); + + assertTrue("hashCode", fEventInfo1.hashCode() != info2.hashCode()); + assertTrue("hashCode", fEventInfo2.hashCode() != info1.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ChannelInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ChannelInfoTest.java new file mode 100644 index 0000000000..44a078e012 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ChannelInfoTest.java @@ -0,0 +1,382 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.*; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class ChannelInfoTest contains tests for the class + * {@link ChannelInfo}. + */ +public class ChannelInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private IChannelInfo fChannelInfo1 = null; + private IChannelInfo fChannelInfo2 = null; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + ModelImplFactory factory = new ModelImplFactory(); + fChannelInfo1 = factory.getChannel1(); + fChannelInfo2 = factory.getChannel2(); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Run the ChannelInfo() constructor test. + */ + @Test + public void testChannelInfo() { + ChannelInfo result = new ChannelInfo("test"); + assertNotNull(result); + + assertEquals("test", result.getName()); + assertEquals(0, result.getNumberOfSubBuffers()); + assertEquals("unknown", result.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.UNKNOWN, result.getOutputType()); + assertEquals(false, result.isOverwriteMode()); + assertEquals(0, result.getReadTimer()); + assertEquals("disabled", result.getState().getInName()); + assertEquals(0, result.getSubBufferSize()); + assertEquals(0, result.getSwitchTimer()); + assertEquals(0, result.getMaxSizeTraceFiles()); + assertEquals(0, result.getMaxNumberTraceFiles()); + assertEquals(BufferType.BUFFER_TYPE_UNKNOWN, result.getBufferType()); + } + + /** + * Test copy constructor. + */ + @Test + public void testChannelInfoCopy() { + ChannelInfo channelInfo = new ChannelInfo((ChannelInfo)fChannelInfo1); + + assertEquals(fChannelInfo1.getName(), channelInfo.getName()); + assertEquals(fChannelInfo1.getNumberOfSubBuffers(), channelInfo.getNumberOfSubBuffers()); + assertEquals(fChannelInfo1.getOutputType(), channelInfo.getOutputType()); + assertEquals(fChannelInfo1.isOverwriteMode(), channelInfo.isOverwriteMode()); + assertEquals(fChannelInfo1.getReadTimer(), channelInfo.getReadTimer()); + assertEquals(fChannelInfo1.getState(), channelInfo.getState()); + assertEquals(fChannelInfo1.getSwitchTimer(), channelInfo.getSwitchTimer()); + assertEquals(fChannelInfo1.getEvents().length, channelInfo.getEvents().length); + assertEquals(fChannelInfo1.getMaxSizeTraceFiles(), channelInfo.getMaxSizeTraceFiles()); + assertEquals(fChannelInfo1.getMaxNumberTraceFiles(), channelInfo.getMaxNumberTraceFiles()); + assertEquals(fChannelInfo1.getBufferType(), channelInfo.getBufferType()); + + IEventInfo[] orignalEvents = fChannelInfo1.getEvents(); + IEventInfo[] resultEvents = channelInfo.getEvents(); + for (int i = 0; i < orignalEvents.length; i++) { + assertEquals(orignalEvents[i], resultEvents[i]); + } + } + + /** + * Test copy constructor with a null value. + */ + @Test + public void testChannelCopy2() { + try { + ChannelInfo channel = null; + new ChannelInfo(channel); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Run the IEventInfo[] getEvents() method test. + */ + @Test + public void testAddAndGetEvents_1() { + ChannelInfo fixture = new ChannelInfo("test"); + fixture.setSwitchTimer(1L); + fixture.setOverwriteMode(true); + fixture.setReadTimer(1L); + fixture.setState(TraceEnablement.DISABLED); + fixture.setNumberOfSubBuffers(1); + fixture.setOutputType(""); + fixture.setSubBufferSize(1L); + + // add an event + IEventInfo event = new EventInfo("event"); + fixture.addEvent(event); + + // Verify the stored events + IEventInfo[] result = fixture.getEvents(); + + assertNotNull(result); + assertEquals(1, result.length); + assertNotNull(result[0]); + assertTrue(event.equals(result[0])); + } + + /** + * Run the long getNumberOfSubBuffers() method test. + */ + @Test + public void testGetAndSetters() { + ChannelInfo fixture = new ChannelInfo("test"); + fixture.setSwitchTimer(2L); + fixture.setOverwriteMode(true); + fixture.setReadTimer(3L); + fixture.setState(TraceEnablement.DISABLED); + fixture.setNumberOfSubBuffers(4); + fixture.setOutputType("splice()"); + fixture.setSubBufferSize(1L); + fixture.setMaxSizeTraceFiles(1024); + fixture.setMaxNumberTraceFiles(20); + fixture.setBufferType(BufferType.BUFFER_PER_UID); + fixture.addEvent(new EventInfo("event")); + + long switchTimer = fixture.getSwitchTimer(); + assertEquals(2L, switchTimer); + + boolean mode = fixture.isOverwriteMode(); + assertTrue(mode); + + long readTimer = fixture.getReadTimer(); + assertEquals(3L, readTimer); + + TraceEnablement state = fixture.getState(); + assertEquals("disabled", state.getInName()); + + long numSubBuffers = fixture.getNumberOfSubBuffers(); + assertEquals(4, numSubBuffers); + + String outputType = fixture.getOutputType().getInName(); + assertEquals("splice()", outputType); + + long subBufferSize = fixture.getSubBufferSize(); + assertEquals(1L, subBufferSize); + + int maxSizeTraceFiles = fixture.getMaxSizeTraceFiles(); + assertEquals(1024, maxSizeTraceFiles); + + int maxNumberTraceFiles = fixture.getMaxNumberTraceFiles(); + assertEquals(20, maxNumberTraceFiles); + + BufferType bufferType = fixture.getBufferType(); + assertTrue(bufferType == BufferType.BUFFER_PER_UID); + + fixture.setSwitchTimer(5L); + fixture.setOverwriteMode(false); + fixture.setReadTimer(6L); + fixture.setState(TraceEnablement.ENABLED); + fixture.setNumberOfSubBuffers(7); + fixture.setOutputType("mmap()"); + fixture.setSubBufferSize(8L); + fixture.setMaxSizeTraceFiles(4096); + fixture.setMaxNumberTraceFiles(10); + fixture.setBufferType(BufferType.BUFFER_PER_PID); + + switchTimer = fixture.getSwitchTimer(); + assertEquals(5L, switchTimer); + + mode = fixture.isOverwriteMode(); + assertFalse(mode); + + readTimer = fixture.getReadTimer(); + assertEquals(6L, readTimer); + + state = fixture.getState(); + assertEquals("enabled", state.getInName()); + + numSubBuffers = fixture.getNumberOfSubBuffers(); + assertEquals(7, numSubBuffers); + + outputType = fixture.getOutputType().getInName(); + assertEquals("mmap()", outputType); + + subBufferSize = fixture.getSubBufferSize(); + assertEquals(8L, subBufferSize); + + maxSizeTraceFiles = fixture.getMaxSizeTraceFiles(); + assertEquals(4096, maxSizeTraceFiles); + + maxNumberTraceFiles = fixture.getMaxNumberTraceFiles(); + assertEquals(10, maxNumberTraceFiles); + + bufferType = fixture.getBufferType(); + assertTrue(bufferType == BufferType.BUFFER_PER_PID); + } + + /** + * Run the void setEvents(List) method test. + */ + @Test + public void testSetEvents_1() { + ChannelInfo fixture = new ChannelInfo("test"); + fixture.setSwitchTimer(1L); + fixture.setOverwriteMode(true); + fixture.setReadTimer(1L); + fixture.setState(TraceEnablement.DISABLED); + fixture.setNumberOfSubBuffers(1); + fixture.setOutputType(""); + fixture.setSubBufferSize(1L); + List events = new LinkedList<>(); + + for (int i = 0; i < 2; i++) { + IEventInfo info = new EventInfo("event" + i); + info.setEventType("tracepoint"); + info.setState((i % 2 == 0 ? "enabled" : "disabled")); + events.add(info); + } + + fixture.setEvents(events); + + IEventInfo[] infos = fixture.getEvents(); + + assertEquals(events.size(), infos.length); + + for (int i = 0; i < infos.length; i++) { + assertEquals(events.get(i), infos[i]); + } + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_1() { + ChannelInfo fixture = new ChannelInfo("channel"); + fixture.setSwitchTimer(1L); + fixture.setOverwriteMode(true); + fixture.setReadTimer(1L); + fixture.setState(TraceEnablement.DISABLED); + fixture.setNumberOfSubBuffers(1); + fixture.setOutputType("splice()"); + fixture.setSubBufferSize(1L); + + String result = fixture.toString(); + + // add additional test code here + assertEquals("[ChannelInfo([TraceInfo(Name=channel)],State=DISABLED,OverwriteMode=true,SubBuffersSize=1,NumberOfSubBuffers=1,SwitchTimer=1,ReadTimer=1,output=splice(),Events=None)]", result); + } + + /** + * Run another String toString() method test. + */ + @Test + public void testToString_2() { + String result = fChannelInfo1.toString(); + + // add additional test code here + assertEquals("[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])]", result); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fChannelInfo1.equals(fChannelInfo1)); + assertTrue("equals", fChannelInfo2.equals(fChannelInfo2)); + + assertTrue("equals", !fChannelInfo1.equals(fChannelInfo2)); + assertTrue("equals", !fChannelInfo2.equals(fChannelInfo1)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsSymmetry() { + ChannelInfo event1 = new ChannelInfo((ChannelInfo)fChannelInfo1); + ChannelInfo event2 = new ChannelInfo((ChannelInfo)fChannelInfo2); + + assertTrue("equals", event1.equals(fChannelInfo1)); + assertTrue("equals", fChannelInfo1.equals(event1)); + + assertTrue("equals", event2.equals(fChannelInfo2)); + assertTrue("equals", fChannelInfo2.equals(event2)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsTransivity() { + ChannelInfo channel1 = new ChannelInfo((ChannelInfo)fChannelInfo1); + ChannelInfo channel2 = new ChannelInfo((ChannelInfo)fChannelInfo1); + ChannelInfo channel3 = new ChannelInfo((ChannelInfo)fChannelInfo1); + + assertTrue("equals", channel1.equals(channel2)); + assertTrue("equals", channel2.equals(channel3)); + assertTrue("equals", channel1.equals(channel3)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fChannelInfo1.equals(null)); + assertTrue("equals", !fChannelInfo2.equals(null)); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Run the hashCode() method test. + */ + @Test + public void testHashCode() { + ChannelInfo channel1 = new ChannelInfo((ChannelInfo)fChannelInfo1); + ChannelInfo channel2 = new ChannelInfo((ChannelInfo)fChannelInfo2); + + assertTrue("hashCode", fChannelInfo1.hashCode() == channel1.hashCode()); + assertTrue("hashCode", fChannelInfo2.hashCode() == channel2.hashCode()); + + assertTrue("hashCode", fChannelInfo1.hashCode() != channel2.hashCode()); + assertTrue("hashCode", fChannelInfo2.hashCode() != channel1.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/DomainInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/DomainInfoTest.java new file mode 100644 index 0000000000..ff6fba5cf0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/DomainInfoTest.java @@ -0,0 +1,225 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.*; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class ChannelInfoTest contains tests for the class + * {@link DomainInfo}. + */ +public class DomainInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private IDomainInfo fDomainInfo1 = null; + private IDomainInfo fDomainInfo2 = null; + private IChannelInfo fChannelInfo1 = null; + private IChannelInfo fChannelInfo2 = null; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + // Get test instances from the factory + ModelImplFactory factory = new ModelImplFactory(); + fChannelInfo1 = factory.getChannel1(); + fChannelInfo2 = factory.getChannel2(); + fDomainInfo1 = factory.getDomainInfo1(); + fDomainInfo2 = factory.getDomainInfo2(); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Run the ChannelInfo() constructor test. + */ + @Test + public void testDomainInfo() { + DomainInfo result = new DomainInfo("test"); + assertNotNull(result); + + assertEquals("test", result.getName()); + assertEquals(0, result.getChannels().length); + } + + /** + * Test the copy constructor. + */ + @Test + public void testDomainInfoCopy() { + DomainInfo channelInfo = new DomainInfo((DomainInfo)fDomainInfo1); + IChannelInfo[] orignalEvents = fDomainInfo1.getChannels(); + IChannelInfo[] resultEvents = channelInfo.getChannels(); + for (int i = 0; i < orignalEvents.length; i++) { + assertEquals(orignalEvents[i], resultEvents[i]); + } + } + + /** + * Test the copy constructor. + */ + @Test + public void testDomainlCopy2() { + try { + DomainInfo domain = null; + new DomainInfo(domain); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Run the long getNumberOfSubBuffers() method test. + */ + @Test + public void testGetAndSetters() { + + // Note that addChannel() has been executed in setUp() + // check get method here + assertEquals(1, fDomainInfo1.getChannels().length); + assertNotNull(fDomainInfo1.getChannels()[0]); + assertEquals(fChannelInfo1, fDomainInfo1.getChannels()[0]); + + IDomainInfo domain = new DomainInfo("domain"); + List list = new LinkedList<>(); + list.add(fChannelInfo1); + list.add(fChannelInfo2); + domain.setChannels(list); + + IChannelInfo[] result = domain.getChannels(); + assertEquals(2, result.length); + assertEquals(fChannelInfo1, result[0]); + assertEquals(fChannelInfo2, result[1]); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_1() { + DomainInfo fixture = new DomainInfo("domain"); + + String result = fixture.toString(); + + assertEquals("[DomainInfo([TraceInfo(Name=domain)],Channels=None,isKernel=false)]", result); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_2() { + String result = fDomainInfo1.toString(); + + assertEquals("[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])],isKernel=false)]", result); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fDomainInfo1.equals(fDomainInfo1)); + assertTrue("equals", fDomainInfo2.equals(fDomainInfo2)); + + assertTrue("equals", !fDomainInfo1.equals(fDomainInfo2)); + assertTrue("equals", !fDomainInfo2.equals(fDomainInfo1)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsSymmetry() { + DomainInfo event1 = new DomainInfo((DomainInfo)fDomainInfo1); + DomainInfo event2 = new DomainInfo((DomainInfo)fDomainInfo2); + + assertTrue("equals", event1.equals(fDomainInfo1)); + assertTrue("equals", fDomainInfo1.equals(event1)); + + assertTrue("equals", event2.equals(fDomainInfo2)); + assertTrue("equals", fDomainInfo2.equals(event2)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsTransivity() { + DomainInfo channel1 = new DomainInfo((DomainInfo)fDomainInfo1); + DomainInfo channel2 = new DomainInfo((DomainInfo)fDomainInfo1); + DomainInfo channel3 = new DomainInfo((DomainInfo)fDomainInfo1); + + assertTrue("equals", channel1.equals(channel2)); + assertTrue("equals", channel2.equals(channel3)); + assertTrue("equals", channel1.equals(channel3)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fDomainInfo1.equals(null)); + assertTrue("equals", !fDomainInfo2.equals(null)); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Run the hashCode() method test. + */ + @Test + public void testHashCode() { + DomainInfo channel1 = new DomainInfo((DomainInfo)fDomainInfo1); + DomainInfo channel2 = new DomainInfo((DomainInfo)fDomainInfo2); + + assertTrue("hashCode", fDomainInfo1.hashCode() == channel1.hashCode()); + assertTrue("hashCode", fDomainInfo2.hashCode() == channel2.hashCode()); + + assertTrue("hashCode", fDomainInfo1.hashCode() != channel2.hashCode()); + assertTrue("hashCode", fDomainInfo2.hashCode() != channel1.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/EventInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/EventInfoTest.java new file mode 100644 index 0000000000..e0c5212a35 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/EventInfoTest.java @@ -0,0 +1,366 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class EventInfoTest contains test for the class + * {@link EventInfo}. + */ +public class EventInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private IEventInfo fEventInfo1 = null; + private IEventInfo fEventInfo2 = null; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + ModelImplFactory factory = new ModelImplFactory(); + fEventInfo1 = factory.getEventInfo1(); + fEventInfo2 = factory.getEventInfo2(); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Run the EventInfo() constructor test. + */ + @Test + public void testBaseEventInfo() { + EventInfo fixture = new EventInfo("event"); + assertNotNull(fixture); + + TraceEventType result = fixture.getEventType(); + + assertEquals("event", fixture.getName()); + assertEquals("unknown", result.getInName()); + assertEquals("UNKNOWN", result.name()); + assertEquals("UNKNOWN", result.toString()); + assertEquals(4, result.ordinal()); + + TraceEnablement state = fixture.getState(); + assertEquals("disabled", state.getInName()); + assertEquals("DISABLED", state.name()); + assertEquals("DISABLED", state.toString()); + assertEquals(0, state.ordinal()); + + LogLevelType logType = fixture.getLogLevelType(); + assertEquals("", logType.getShortName()); + assertEquals("LOGLEVEL_NONE", logType.name()); + assertEquals("LOGLEVEL_NONE", logType.toString()); + assertEquals(0, state.ordinal()); + + + } + + /** + * Test Copy Constructor + */ + @Test + public void testEventInfoCopy() { + EventInfo info = new EventInfo((EventInfo)fEventInfo1); + + assertEquals(fEventInfo1.getName(), info.getName()); + assertEquals(fEventInfo1.getEventType(), info.getEventType()); + assertEquals(fEventInfo1.getState(), info.getState()); + assertEquals(fEventInfo1.getLogLevelType(), info.getLogLevelType()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testEventCopy2() { + try { + EventInfo info = null; + new EventInfo(info); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Getter/Setter tests + */ + @Test + public void testGetAndSetter() { + EventInfo fixture = new EventInfo("event"); + + fixture.setEventType(TraceEventType.TRACEPOINT); + TraceEventType result = fixture.getEventType(); + + // setEventType(TraceEventType type) + assertNotNull(result); + assertEquals("tracepoint", result.getInName()); + assertEquals("TRACEPOINT", result.name()); + assertEquals("TRACEPOINT", result.toString()); + assertEquals(0, result.ordinal()); + + fixture.setEventType(TraceEventType.UNKNOWN); + result = fixture.getEventType(); + assertEquals("unknown", result.getInName()); + assertEquals("UNKNOWN", result.name()); + assertEquals("UNKNOWN", result.toString()); + assertEquals(4, result.ordinal()); + + // setEventType(String typeName) + String typeName = ""; + fixture.setEventType(typeName); + result = fixture.getEventType(); + + assertEquals("unknown", result.getInName()); + assertEquals("UNKNOWN", result.name()); + assertEquals("UNKNOWN", result.toString()); + assertEquals(4, result.ordinal()); + + typeName = "unknown"; + + fixture.setEventType(typeName); + result = fixture.getEventType(); + + assertEquals("unknown", result.getInName()); + assertEquals("UNKNOWN", result.name()); + assertEquals("UNKNOWN", result.toString()); + assertEquals(4, result.ordinal()); + + // setState(String stateName) + fixture.setState("disabled"); + TraceEnablement state = fixture.getState(); + assertEquals("disabled", state.getInName()); + assertEquals("DISABLED", state.name()); + assertEquals("DISABLED", state.toString()); + assertEquals(0, state.ordinal()); + + fixture.setState("false"); + state = fixture.getState(); + assertEquals("false", state.getInMiName()); + assertEquals("DISABLED", state.name()); + assertEquals("DISABLED", state.toString()); + assertEquals(0, state.ordinal()); + + fixture.setState("bla"); + state = fixture.getState(); + assertEquals("disabled", state.getInName()); + assertEquals("DISABLED", state.name()); + assertEquals("DISABLED", state.toString()); + assertEquals(0, state.ordinal()); + + fixture.setState("enabled"); + state = fixture.getState(); + assertEquals("enabled", state.getInName()); + assertEquals("ENABLED", state.name()); + assertEquals("ENABLED", state.toString()); + assertEquals(1, state.ordinal()); + + fixture.setState("true"); + state = fixture.getState(); + assertEquals("true", state.getInMiName()); + assertEquals("ENABLED", state.name()); + assertEquals("ENABLED", state.toString()); + assertEquals(1, state.ordinal()); + + // setState(TraceEnablement state) + fixture.setState(TraceEnablement.DISABLED); + state = fixture.getState(); + assertEquals("disabled", state.getInName()); + assertEquals("DISABLED", state.name()); + assertEquals("DISABLED", state.toString()); + assertEquals(0, state.ordinal()); + + fixture.setState(TraceEnablement.ENABLED); + state = fixture.getState(); + assertEquals("enabled", state.getInName()); + assertEquals("ENABLED", state.name()); + assertEquals("ENABLED", state.toString()); + assertEquals(1, state.ordinal()); + + // setLogLevelType(String name) + fixture.setLogLevelType("=="); + assertEquals("LOGLEVEL_ONLY", fixture.getLogLevelType().name()); + assertEquals("==", fixture.getLogLevelType().getShortName()); + + fixture.setLogLevelType("<="); + assertEquals("LOGLEVEL", fixture.getLogLevelType().name()); + assertEquals("<=", fixture.getLogLevelType().getShortName()); + + fixture.setLogLevelType(""); + assertEquals("LOGLEVEL_ALL", fixture.getLogLevelType().name()); + assertEquals("", fixture.getLogLevelType().getShortName()); + + fixture.setLogLevelType(LogLevelType.LOGLEVEL_ONLY); + assertEquals("LOGLEVEL_ONLY", fixture.getLogLevelType().name()); + assertEquals("==", fixture.getLogLevelType().getShortName()); + + fixture.setLogLevelType(LogLevelType.LOGLEVEL); + assertEquals("LOGLEVEL", fixture.getLogLevelType().name()); + assertEquals("<=", fixture.getLogLevelType().getShortName()); + + fixture.setLogLevelType(LogLevelType.LOGLEVEL_ALL); + assertEquals("LOGLEVEL_ALL", fixture.getLogLevelType().name()); + assertEquals("", fixture.getLogLevelType().getShortName()); + + fixture.setLogLevelType(LogLevelType.LOGLEVEL_NONE); + assertEquals("LOGLEVEL_NONE", fixture.getLogLevelType().name()); + assertEquals("", fixture.getLogLevelType().getShortName()); + + // setLogLevelType(String name) + // machine interface + fixture.setLogLevelType("SINGLE"); + assertEquals("LOGLEVEL_ONLY", fixture.getLogLevelType().name()); + assertEquals("SINGLE", fixture.getLogLevelType().getMiName()); + + fixture.setLogLevelType("RANGE"); + assertEquals("LOGLEVEL", fixture.getLogLevelType().name()); + assertEquals("RANGE", fixture.getLogLevelType().getMiName()); + + fixture.setLogLevelType("ALL"); + assertEquals("LOGLEVEL_ALL", fixture.getLogLevelType().name()); + assertEquals("ALL", fixture.getLogLevelType().getMiName()); + + fixture.setLogLevelType("UNKNOWN"); + assertEquals("LOGLEVEL_NONE", fixture.getLogLevelType().name()); + assertEquals("UNKNOWN", fixture.getLogLevelType().getMiName()); + + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_1() { + EventInfo fixture = new EventInfo("event"); + fixture.setName("testName"); + fixture.setEventType(TraceEventType.TRACEPOINT); + + String result = fixture.toString(); + + // add additional test code here + assertEquals("[EventInfo([BaseEventInfo([TraceInfo(Name=testName)],type=TRACEPOINT,level=TRACE_DEBUG)],State=DISABLED,levelType=LOGLEVEL_NONE)]", result); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_2() { + EventInfo fixture = new EventInfo("event"); + fixture.setName("testName"); + fixture.setEventType(TraceEventType.TRACEPOINT); + fixture.setLogLevelType(LogLevelType.LOGLEVEL_ONLY); + + String result = fixture.toString(); + + // add additional test code here + assertEquals("[EventInfo([BaseEventInfo([TraceInfo(Name=testName)],type=TRACEPOINT,level=TRACE_DEBUG)],State=DISABLED,levelType=LOGLEVEL_ONLY)]", result); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fEventInfo1.equals(fEventInfo1)); + assertTrue("equals", fEventInfo2.equals(fEventInfo2)); + + assertTrue("equals", !fEventInfo1.equals(fEventInfo2)); + assertTrue("equals", !fEventInfo2.equals(fEventInfo1)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsSymmetry() { + EventInfo info1 = new EventInfo((EventInfo)fEventInfo1); + EventInfo info2 = new EventInfo((EventInfo)fEventInfo2); + + assertTrue("equals", info1.equals(fEventInfo1)); + assertTrue("equals", fEventInfo1.equals(info1)); + + assertTrue("equals", info2.equals(fEventInfo2)); + assertTrue("equals", fEventInfo2.equals(info2)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsTransivity() { + EventInfo info1 = new EventInfo((EventInfo)fEventInfo1); + EventInfo info2 = new EventInfo((EventInfo)fEventInfo1); + EventInfo info3 = new EventInfo((EventInfo)fEventInfo1); + + assertTrue("equals", info1.equals(info2)); + assertTrue("equals", info2.equals(info3)); + assertTrue("equals", info1.equals(info3)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fEventInfo1.equals(null)); + assertTrue("equals", !fEventInfo2.equals(null)); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Run the hashCode() method test. + */ + @Test + public void testHashCode() { + EventInfo info1 = new EventInfo((EventInfo)fEventInfo1); + EventInfo info2 = new EventInfo((EventInfo)fEventInfo2); + + assertTrue("hashCode", fEventInfo1.hashCode() == info1.hashCode()); + assertTrue("hashCode", fEventInfo2.hashCode() == info2.hashCode()); + + assertTrue("hashCode", fEventInfo1.hashCode() != info2.hashCode()); + assertTrue("hashCode", fEventInfo2.hashCode() != info1.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/FieldInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/FieldInfoTest.java new file mode 100644 index 0000000000..c0b18c8a20 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/FieldInfoTest.java @@ -0,0 +1,186 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.*; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class FieldInfoTest contains test for the class + * {@link FieldInfo}. + */ +public class FieldInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private IFieldInfo fFieldInfo1 = null; + private IFieldInfo fFieldInfo2 = null; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + ModelImplFactory factory = new ModelImplFactory(); + fFieldInfo1 = factory.getFieldInfo1(); + fFieldInfo2 = factory.getFieldInfo2(); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Run the BaseEventInfo() constructor test. + */ + @Test + public void testFiledInfo() { + FieldInfo fixture = new FieldInfo("field"); + assertNotNull(fixture); + + assertEquals("field", fixture.getName()); + assertNull(fixture.getFieldType()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testEventInfoCopy() { + FieldInfo info = new FieldInfo((FieldInfo)fFieldInfo1); + + assertEquals(fFieldInfo1.getName(), info.getName()); + assertEquals(fFieldInfo1.getFieldType(), info.getFieldType()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testEventCopy2() { + try { + FieldInfo info = null; + new FieldInfo(info); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Run the TraceEventType getEventType() method test. + */ + @Test + public void testSetFieldType() { + FieldInfo info = new FieldInfo((FieldInfo)fFieldInfo1); + + info.setFieldType("string"); + assertEquals("string", info.getFieldType()); + } + + /** + * Run the toString() method test. + */ + @Test + public void testToString() { + String result = fFieldInfo1.toString(); + + // add additional test code here + assertEquals("[FieldInfo([TraceInfo(Name=intfield)],type=int", result); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fFieldInfo1.equals(fFieldInfo1)); + assertTrue("equals", fFieldInfo2.equals(fFieldInfo2)); + + assertTrue("equals", !fFieldInfo1.equals(fFieldInfo2)); + assertTrue("equals", !fFieldInfo2.equals(fFieldInfo1)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsSymmetry() { + FieldInfo info1 = new FieldInfo((FieldInfo)fFieldInfo1); + FieldInfo info2 = new FieldInfo((FieldInfo)fFieldInfo2); + + assertTrue("equals", info1.equals(fFieldInfo1)); + assertTrue("equals", fFieldInfo1.equals(info1)); + + assertTrue("equals", info2.equals(fFieldInfo2)); + assertTrue("equals", fFieldInfo2.equals(info2)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsTransivity() { + FieldInfo info1 = new FieldInfo((FieldInfo)fFieldInfo1); + FieldInfo info2 = new FieldInfo((FieldInfo)fFieldInfo1); + FieldInfo info3 = new FieldInfo((FieldInfo)fFieldInfo1); + + assertTrue("equals", info1.equals(info2)); + assertTrue("equals", info2.equals(info3)); + assertTrue("equals", info1.equals(info3)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fFieldInfo1.equals(null)); + assertTrue("equals", !fFieldInfo2.equals(null)); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Run the equals() method test. + */ + @Test + public void testHashCode() { + FieldInfo info1 = new FieldInfo((FieldInfo)fFieldInfo1); + FieldInfo info2 = new FieldInfo((FieldInfo)fFieldInfo2); + + assertTrue("hashCode", fFieldInfo1.hashCode() == info1.hashCode()); + assertTrue("hashCode", fFieldInfo2.hashCode() == info2.hashCode()); + + assertTrue("hashCode", fFieldInfo1.hashCode() != info2.hashCode()); + assertTrue("hashCode", fFieldInfo2.hashCode() != info1.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ModelImplFactory.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ModelImplFactory.java new file mode 100644 index 0000000000..569f961007 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ModelImplFactory.java @@ -0,0 +1,244 @@ +/******************************************************************************* + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; + +/** + * Test facility to constants across test case + */ +@SuppressWarnings("javadoc") +public class ModelImplFactory { + + private ISessionInfo fSessionInfo1 = null; + private ISessionInfo fSessionInfo2 = null; + private IDomainInfo fDomainInfo1 = null; + private IDomainInfo fDomainInfo2 = null; + private IChannelInfo fChannelInfo1 = null; + private IChannelInfo fChannelInfo2 = null; + private IEventInfo fEventInfo1 = null; + private IEventInfo fEventInfo2 = null; + private IEventInfo fEventInfo3 = null; + private IFieldInfo fFieldInfo1 = null; + private IFieldInfo fFieldInfo2 = null; + private IBaseEventInfo fBaseEventInfo1 = null; + private IBaseEventInfo fBaseEventInfo2 = null; + private IUstProviderInfo fUstProviderInfo1 = null; + private IUstProviderInfo fUstProviderInfo2 = null; + private IProbeEventInfo fProbeEventInfo1 = null; + private IProbeEventInfo fProbeEventInfo2 = null; + private ISnapshotInfo fSnapshotInfo1 = null; + private ISnapshotInfo fSnapshotInfo2 = null; + + public ModelImplFactory() { + + fFieldInfo1 = new FieldInfo("intfield"); + fFieldInfo1.setFieldType("int"); + fFieldInfo2 = new FieldInfo("stringfield"); + fFieldInfo2.setFieldType("string"); + + fBaseEventInfo1 = new BaseEventInfo("event1"); + fBaseEventInfo1.setEventType(TraceEventType.UNKNOWN); + fBaseEventInfo1.setLogLevel(TraceLogLevel.TRACE_ERR); + fBaseEventInfo1.addField(fFieldInfo1); + fBaseEventInfo1.addField(fFieldInfo2); + fBaseEventInfo1.setFilterExpression("intField==10"); + + fBaseEventInfo2 = new BaseEventInfo("event2"); + fBaseEventInfo2.setEventType(TraceEventType.TRACEPOINT); + fBaseEventInfo1.setLogLevel(TraceLogLevel.TRACE_DEBUG); + + fEventInfo1 = new EventInfo("event1"); + fEventInfo1.setEventType(TraceEventType.TRACEPOINT); + fEventInfo1.setLogLevelType("=="); + fEventInfo1.setLogLevel(TraceLogLevel.TRACE_DEBUG); + fEventInfo1.setState(TraceEnablement.ENABLED); + + fEventInfo2 = new EventInfo("event2"); + fEventInfo2.setLogLevelType("<="); + fEventInfo2.setLogLevel(TraceLogLevel.TRACE_INFO); + fEventInfo2.setEventType(TraceEventType.UNKNOWN); + fEventInfo2.setState(TraceEnablement.DISABLED); + + fEventInfo3 = new EventInfo("event3"); + fEventInfo3.setEventType(TraceEventType.TRACEPOINT); + fEventInfo3.setState(TraceEnablement.DISABLED); + + fUstProviderInfo1 = new UstProviderInfo("myUST1"); + fUstProviderInfo1.setPid(1234); + fUstProviderInfo1.addEvent(fBaseEventInfo1); + + fUstProviderInfo2 = new UstProviderInfo("myUST2"); + fUstProviderInfo2.setPid(2345); + fUstProviderInfo2.addEvent(fBaseEventInfo1); + fUstProviderInfo2.addEvent(fBaseEventInfo2); + + fChannelInfo1 = new ChannelInfo("channel1"); + fChannelInfo1.setSwitchTimer(10L); + fChannelInfo1.setOverwriteMode(true); + fChannelInfo1.setReadTimer(11L); + fChannelInfo1.setState(TraceEnablement.DISABLED); + fChannelInfo1.setNumberOfSubBuffers(12); + fChannelInfo1.setOutputType("splice()"); + fChannelInfo1.setSubBufferSize(13L); + fChannelInfo1.addEvent(fEventInfo1); + + fChannelInfo2 = new ChannelInfo("channel2"); + fChannelInfo2.setSwitchTimer(1L); + fChannelInfo2.setOverwriteMode(false); + fChannelInfo2.setReadTimer(2L); + fChannelInfo2.setState(TraceEnablement.ENABLED); + fChannelInfo2.setNumberOfSubBuffers(3); + fChannelInfo2.setOutputType("mmap()"); + fChannelInfo2.setSubBufferSize(4L); + fChannelInfo2.addEvent(fEventInfo2); + fChannelInfo2.addEvent(fEventInfo3); + + fDomainInfo1 = new DomainInfo("test1"); + fDomainInfo1.addChannel(fChannelInfo1); + + fDomainInfo2 = new DomainInfo("test2"); + fDomainInfo2.addChannel(fChannelInfo1); + fDomainInfo2.addChannel(fChannelInfo2); + + fSessionInfo1 = new SessionInfo("session1"); + fSessionInfo1.setSessionPath("/home/user"); + fSessionInfo1.setSessionState(TraceSessionState.ACTIVE); + fSessionInfo1.addDomain(fDomainInfo1); + + fSessionInfo2 = new SessionInfo("session2"); + fSessionInfo2.setSessionPath("/home/user1"); + fSessionInfo2.setSessionState(TraceSessionState.INACTIVE); + fSessionInfo2.addDomain(fDomainInfo1); + fSessionInfo2.addDomain(fDomainInfo2); + fSessionInfo2.setStreamedTrace(true); + + fProbeEventInfo1 = new ProbeEventInfo("probeEvent1"); + fProbeEventInfo1.setEventType(TraceEventType.TRACEPOINT); + fProbeEventInfo1.setState(TraceEnablement.ENABLED); + fProbeEventInfo1.setAddress("0xc1231234"); + + fProbeEventInfo2 = new ProbeEventInfo("probeEvent2"); + fProbeEventInfo2.setEventType(TraceEventType.FUNCTION); + fProbeEventInfo2.setState(TraceEnablement.DISABLED); + fProbeEventInfo2.setOffset("0x100"); + fProbeEventInfo2.setSymbol("init_post"); + + fSnapshotInfo1 = new SnapshotInfo("snapshot-1"); + fSnapshotInfo1.setId(1); + fSnapshotInfo1.setSnapshotPath("/home/user/lttng-trace/mysession/"); + fSnapshotInfo2 = new SnapshotInfo("other-snapshot"); + fSnapshotInfo2.setId(1); + fSnapshotInfo2.setSnapshotPath("net4://172.0.0.1:1234/"); + fSnapshotInfo2.setStreamedSnapshot(true); + + fSessionInfo1.setSnapshotInfo(fSnapshotInfo1); + } + + public ISessionInfo getSessionInfo1() { + return fSessionInfo1; + } + + public ISessionInfo getSessionInfo2() { + return fSessionInfo2; + } + + public IDomainInfo getDomainInfo1() { + return fDomainInfo1; + } + + public IDomainInfo getDomainInfo2() { + return fDomainInfo2; + } + + public IChannelInfo getChannel1() { + return fChannelInfo1; + } + + public IChannelInfo getChannel2() { + return fChannelInfo2; + } + + public IEventInfo getEventInfo1() { + return fEventInfo1; + } + + public IEventInfo getEventInfo2() { + return fEventInfo2; + } + + public IEventInfo getEventInfo3() { + return fEventInfo3; + } + + public IBaseEventInfo getBaseEventInfo1() { + return fBaseEventInfo1; + } + + public IBaseEventInfo getBaseEventInfo2() { + return fBaseEventInfo2; + } + + public IUstProviderInfo getUstProviderInfo1() { + return fUstProviderInfo1; + } + + public IUstProviderInfo getUstProviderInfo2() { + return fUstProviderInfo2; + } + + public IProbeEventInfo getProbeEventInfo1() { + return fProbeEventInfo1; + } + + public IProbeEventInfo getProbeEventInfo2() { + return fProbeEventInfo2; + } + + public IFieldInfo getFieldInfo1() { + return fFieldInfo1; + } + + public IFieldInfo getFieldInfo2() { + return fFieldInfo2; + } + + public ISnapshotInfo getSnapshotInfo1() { + return fSnapshotInfo1; + } + + public ISnapshotInfo getSnapshotInfo2() { + return fSnapshotInfo2; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ProbeEventInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ProbeEventInfoTest.java new file mode 100644 index 0000000000..5d046f5b84 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/ProbeEventInfoTest.java @@ -0,0 +1,219 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.*; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class ProbEventInfoTest contains test for the class + * {@link ProbeEventInfo}. + */ +public class ProbeEventInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private IProbeEventInfo fEventInfo1 = null; + private IProbeEventInfo fEventInfo2 = null; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + ModelImplFactory factory = new ModelImplFactory(); + fEventInfo1 = factory.getProbeEventInfo1(); + fEventInfo2 = factory.getProbeEventInfo2(); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Run the BaseEventInfo() constructor test. + */ + @Test + public void testBaseEventInfo() { + ProbeEventInfo fixture = new ProbeEventInfo("event"); + assertNotNull(fixture); + + TraceEventType result = fixture.getEventType(); + + assertEquals("event", fixture.getName()); + assertEquals("unknown", result.getInName()); + assertEquals("UNKNOWN", result.name()); + assertEquals("UNKNOWN", result.toString()); + assertEquals(4, result.ordinal()); + + TraceEnablement state = fixture.getState(); + assertEquals("disabled", state.getInName()); + assertEquals("DISABLED", state.name()); + assertEquals("DISABLED", state.toString()); + assertEquals(0, state.ordinal()); + + assertNull(fixture.getAddress()); + assertNull(fixture.getOffset()); + assertNull(fixture.getSymbol()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testEventInfoCopy() { + ProbeEventInfo info = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); + + assertEquals(fEventInfo1.getName(), info.getName()); + assertEquals(fEventInfo1.getEventType(), info.getEventType()); + assertEquals(fEventInfo1.getState(), info.getState()); + assertEquals(fEventInfo1.getAddress(), info.getAddress()); + assertEquals(fEventInfo1.getOffset(), info.getOffset()); + assertEquals(fEventInfo1.getSymbol(), info.getSymbol()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testEventCopy2() { + try { + ProbeEventInfo info = null; + new ProbeEventInfo(info); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Getter/Setter tests + */ + @Test + public void testGetAndSetter() { + ProbeEventInfo fixture = new ProbeEventInfo("event"); + + fixture.setAddress("0xc12344321"); + String result = fixture.getAddress(); + + assertNotNull(result); + assertEquals("0xc12344321", result); + + fixture.setOffset("0x1000"); + result = fixture.getOffset(); + + assertNotNull(result); + assertEquals("0x1000", result); + + fixture.setSymbol("cpu_idle"); + result = fixture.getSymbol(); + + assertNotNull(result); + assertEquals("cpu_idle", result); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_1() { + assertEquals("[ProbeEventInfo([EventInfo([BaseEventInfo([TraceInfo(Name=probeEvent1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_NONE)],fAddress=0xc1231234)]", fEventInfo1.toString()); + assertEquals("[ProbeEventInfo([EventInfo([BaseEventInfo([TraceInfo(Name=probeEvent2)],type=FUNCTION,level=TRACE_DEBUG)],State=DISABLED,levelType=LOGLEVEL_NONE)],fOffset=0x100,fSymbol=init_post)]", fEventInfo2.toString()); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fEventInfo1.equals(fEventInfo1)); + assertTrue("equals", fEventInfo2.equals(fEventInfo2)); + + assertTrue("equals", !fEventInfo1.equals(fEventInfo2)); + assertTrue("equals", !fEventInfo2.equals(fEventInfo1)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsSymmetry() { + ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); + ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo2); + + assertTrue("equals", info1.equals(fEventInfo1)); + assertTrue("equals", fEventInfo1.equals(info1)); + + assertTrue("equals", info2.equals(fEventInfo2)); + assertTrue("equals", fEventInfo2.equals(info2)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsTransivity() { + ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); + ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); + ProbeEventInfo info3 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); + + assertTrue("equals", info1.equals(info2)); + assertTrue("equals", info2.equals(info3)); + assertTrue("equals", info1.equals(info3)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fEventInfo1.equals(null)); + assertTrue("equals", !fEventInfo2.equals(null)); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Run the hashCode() method test. + */ + @Test + public void testHashCode() { + ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); + ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo2); + + assertTrue("hashCode", fEventInfo1.hashCode() == info1.hashCode()); + assertTrue("hashCode", fEventInfo2.hashCode() == info2.hashCode()); + + assertTrue("hashCode", fEventInfo1.hashCode() != info2.hashCode()); + assertTrue("hashCode", fEventInfo2.hashCode() != info1.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SessionInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SessionInfoTest.java new file mode 100644 index 0000000000..5ff8cff71d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SessionInfoTest.java @@ -0,0 +1,311 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.*; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class ChannelInfoTest contains tests for the class + * {@link SessionInfo}. + */ +public class SessionInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private ISessionInfo fSessionInfo1 = null; + private ISessionInfo fSessionInfo2 = null; + + private IDomainInfo fDomainInfo1 = null; + private IDomainInfo fDomainInfo2 = null; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + ModelImplFactory factory = new ModelImplFactory(); + fSessionInfo1 = factory.getSessionInfo1(); + fDomainInfo1 = factory.getDomainInfo1(); + fSessionInfo2 = factory.getSessionInfo2(); + fDomainInfo2 = factory.getDomainInfo2(); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Run the ChannelInfo() constructor test. + */ + @Test + public void testSessionInfo() { + ISessionInfo result = new SessionInfo("test"); + assertNotNull(result); + + assertEquals("test", result.getName()); + assertEquals("", result.getSessionPath()); + TraceSessionState state = result.getSessionState(); + assertEquals("inactive", state.getInName()); + assertEquals("INACTIVE", state.name()); + assertEquals("INACTIVE", state.toString()); + assertEquals(0, state.ordinal()); + assertEquals(0, result.getDomains().length); + assertFalse(result.isSnapshotSession()); + assertNull(result.getNetworkUrl()); + assertNull(result.getControlUrl()); + assertNull(result.getDataUrl()); + } + + /** + * Test copy constructor. + */ + @Test + public void testSessionInfoCopy() { + SessionInfo sessionInfo = new SessionInfo((SessionInfo)fSessionInfo1); + + assertEquals(sessionInfo.getName(), fSessionInfo1.getName()); + assertEquals(sessionInfo.getSessionPath(), fSessionInfo1.getSessionPath()); + assertEquals(sessionInfo.getSessionState(), fSessionInfo1.getSessionState()); + + IDomainInfo[] orignalDomains = fSessionInfo1.getDomains(); + IDomainInfo[] resultDomains = sessionInfo.getDomains(); + for (int i = 0; i < orignalDomains.length; i++) { + assertEquals(orignalDomains[i], resultDomains[i]); + } + + assertEquals(sessionInfo.getNetworkUrl(), fSessionInfo1.getNetworkUrl()); + assertEquals(sessionInfo.getControlUrl(), fSessionInfo1.getControlUrl()); + assertEquals(sessionInfo.getDataUrl(), fSessionInfo1.getDataUrl()); + } + + /** + * Test copy constructor. + */ + @Test + public void testSessionCopy2() { + try { + SessionInfo session = null; + new SessionInfo(session); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Run the long getNumberOfSubBuffers() method test. + */ + @Test + public void testGetAndSetters() { + + // Note that addDomain() has been executed in setUp() + // check get method here + assertEquals(1, fSessionInfo1.getDomains().length); + assertNotNull(fSessionInfo1.getDomains()[0]); + assertEquals(fDomainInfo1, fSessionInfo1.getDomains()[0]); + + ISessionInfo session = new SessionInfo("session"); + List list = new LinkedList<>(); + list.add(fDomainInfo1); + list.add(fDomainInfo2); + session.setDomains(list); + + IDomainInfo[] result = session.getDomains(); + assertEquals(2, result.length); + assertEquals(fDomainInfo1, result[0]); + assertEquals(fDomainInfo2, result[1]); + + session.setSessionPath("/home/user"); + assertEquals("/home/user", session.getSessionPath()); + + session.setSessionState("active"); + TraceSessionState state = session.getSessionState(); + state = session.getSessionState(); + assertEquals("active", state.getInName()); + assertEquals("ACTIVE", state.name()); + assertEquals("ACTIVE", state.toString()); + assertEquals(1, state.ordinal()); + + session.setSessionState("inactive"); + state = session.getSessionState(); + assertEquals("inactive", state.getInName()); + assertEquals("INACTIVE", state.name()); + assertEquals("INACTIVE", state.toString()); + assertEquals(0, state.ordinal()); + + session.setSessionState("test"); + state = session.getSessionState(); + assertEquals("inactive", state.getInName()); + assertEquals("INACTIVE", state.name()); + assertEquals("INACTIVE", state.toString()); + assertEquals(0, state.ordinal()); + + session.setSessionState(TraceSessionState.ACTIVE); + state = session.getSessionState(); + assertEquals("active", state.getInName()); + assertEquals("ACTIVE", state.name()); + assertEquals("ACTIVE", state.toString()); + assertEquals(1, state.ordinal()); + + session.setSessionState(TraceSessionState.INACTIVE); + state = session.getSessionState(); + assertEquals("inactive", state.getInName()); + assertEquals("INACTIVE", state.name()); + assertEquals("INACTIVE", state.toString()); + assertEquals(0, state.ordinal()); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_1() { + ISessionInfo fixture = new SessionInfo("sessionName"); + + String result = fixture.toString(); + + // add additional test code here + assertEquals("[SessionInfo([TraceInfo(Name=sessionName)],Path=,State=INACTIVE,isStreamedTrace=false,isSnapshot=false,Domains=,NetworkUrl=null,ControlUrl=null,DataUrl=null)]", result); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_2() { + String result = fSessionInfo1.toString(); + + // add additional test code here + assertEquals("[SessionInfo([TraceInfo(Name=session1)],Path=/home/user/lttng-trace/mysession/,State=ACTIVE,isStreamedTrace=false,isSnapshot=false,snapshotInfo=" + + "[SnapshotInfo([TraceInfo(Name=snapshot-1)],snapshotPath=/home/user/lttng-trace/mysession/,ID=1,isStreamedSnapshot=false)]," + + "Domains=[DomainInfo([TraceInfo(Name=test1)]," + + "Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice()," + + "Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])]," + + "isKernel=false)],NetworkUrl=null,ControlUrl=null,DataUrl=null)]", result); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_3() { + SessionInfo info = new SessionInfo((SessionInfo)fSessionInfo1); + info.setSnapshot(false); + info.setSnapshotInfo(null); + info.setSessionPath("/home/user/lttng-trace/mysession/"); + + String result = info.toString(); + + // add additional test code here + assertEquals("[SessionInfo([TraceInfo(Name=session1)],Path=/home/user/lttng-trace/mysession/,State=ACTIVE,isStreamedTrace=false,isSnapshot=false," + + "Domains=[DomainInfo([TraceInfo(Name=test1)]," + + "Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice()," + + "Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])]," + + "isKernel=false)],NetworkUrl=null,ControlUrl=null,DataUrl=null)]", result); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Run the {@link SessionInfo#equals} method test. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fSessionInfo1.equals(fSessionInfo1)); + assertTrue("equals", fSessionInfo2.equals(fSessionInfo2)); + + assertTrue("equals", !fSessionInfo1.equals(fSessionInfo2)); + assertTrue("equals", !fSessionInfo2.equals(fSessionInfo1)); + } + + /** + * Run the {@link SessionInfo#equals} method test. + */ + @Test + public void testEqualsSymmetry() { + SessionInfo event1 = new SessionInfo((SessionInfo)fSessionInfo1); + SessionInfo event2 = new SessionInfo((SessionInfo)fSessionInfo2); + + assertTrue("equals", event1.equals(fSessionInfo1)); + assertTrue("equals", fSessionInfo1.equals(event1)); + + assertTrue("equals", event2.equals(fSessionInfo2)); + assertTrue("equals", fSessionInfo2.equals(event2)); + } + + /** + * Run the {@link SessionInfo#equals} method test. + */ + @Test + public void testEqualsTransivity() { + SessionInfo channel1 = new SessionInfo((SessionInfo)fSessionInfo1); + SessionInfo channel2 = new SessionInfo((SessionInfo)fSessionInfo1); + SessionInfo channel3 = new SessionInfo((SessionInfo)fSessionInfo1); + + assertTrue("equals", channel1.equals(channel2)); + assertTrue("equals", channel2.equals(channel3)); + assertTrue("equals", channel1.equals(channel3)); + } + + /** + * Run the {@link SessionInfo#equals} method test. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fSessionInfo1.equals(null)); + assertTrue("equals", !fSessionInfo2.equals(null)); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Run the {@link SessionInfo#hashCode} method test. + */ + @Test + public void testHashCode() { + SessionInfo channel1 = new SessionInfo((SessionInfo)fSessionInfo1); + SessionInfo channel2 = new SessionInfo((SessionInfo)fSessionInfo2); + + assertTrue("hashCode", fSessionInfo1.hashCode() == channel1.hashCode()); + assertTrue("hashCode", fSessionInfo2.hashCode() == channel2.hashCode()); + + assertTrue("hashCode", fSessionInfo1.hashCode() != channel2.hashCode()); + assertTrue("hashCode", fSessionInfo2.hashCode() != channel1.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SnapshotInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SnapshotInfoTest.java new file mode 100644 index 0000000000..aa28c15644 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/SnapshotInfoTest.java @@ -0,0 +1,229 @@ +/********************************************************************** + * Copyright (c) 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.TraceInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class SnapshotInfoTest contains test for the class + * {@link SnapshotInfo}. + */ +public class SnapshotInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private ISnapshotInfo fSnapshotInfo1 = null; + private ISnapshotInfo fSnapshotInfo2 = null; + + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + ModelImplFactory factory = new ModelImplFactory(); + fSnapshotInfo1 = factory.getSnapshotInfo1(); + fSnapshotInfo2 = factory.getSnapshotInfo2(); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Constructor test. + */ + @Test + public void testSnapshotInfo() { + SnapshotInfo fixture = new SnapshotInfo("event"); + assertNotNull(fixture); + assertEquals("event", fixture.getName()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testSnapshotInfo2() { + try { + String name = null; + new SnapshotInfo(name); + fail("null name in custructor"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Test Copy Constructor + */ + @Test + public void testSnapshotCopy() { + SnapshotInfo info = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); + + assertEquals(fSnapshotInfo1.getName(), info.getName()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testTraceCopy2() { + try { + SnapshotInfo info = null; + new SnapshotInfo(info); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Run the void setEventType(String) method test. + */ + @Test + public void testSetName() { + SnapshotInfo fixture = new SnapshotInfo("event"); + fixture.setName("newName"); + assertEquals("newName", fixture.getName()); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_1() { + String result = fSnapshotInfo1.toString(); + + // add additional test code here + assertEquals("[SnapshotInfo([TraceInfo(Name=snapshot-1)],snapshotPath=/home/user/lttng-trace/mysession/,ID=1,isStreamedSnapshot=false)]", result); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fSnapshotInfo1.equals(fSnapshotInfo1)); + assertTrue("equals", fSnapshotInfo2.equals(fSnapshotInfo2)); + + assertTrue("equals", !fSnapshotInfo1.equals(fSnapshotInfo2)); + assertTrue("equals", !fSnapshotInfo2.equals(fSnapshotInfo1)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsSymmetry() { + SnapshotInfo info1 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); + SnapshotInfo info2 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo2); + + assertTrue("equals", info1.equals(fSnapshotInfo1)); + assertTrue("equals", fSnapshotInfo1.equals(info1)); + + assertTrue("equals", info2.equals(fSnapshotInfo2)); + assertTrue("equals", fSnapshotInfo2.equals(info2)); + } + /** + * Run the equals() method test. + */ + @Test + public void testEqualsTransivity() { + SnapshotInfo info1 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); + SnapshotInfo info2 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); + SnapshotInfo info3 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); + + assertTrue("equals", info1.equals(info2)); + assertTrue("equals", info2.equals(info3)); + assertTrue("equals", info1.equals(info3)); + } + /** + * Run the equals() method test. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fSnapshotInfo1.equals(null)); + assertTrue("equals", !fSnapshotInfo2.equals(null)); + + SnapshotInfo info = new SnapshotInfo("snapshot-1"); + assertTrue("equals", !fSnapshotInfo1.equals(info)); + + info.setSnapshotPath(null); + assertTrue("equals", !fSnapshotInfo1.equals(info)); + + info.setId(fSnapshotInfo1.getId()); + assertTrue("equals", !info.equals(fSnapshotInfo1)); + + info.setSnapshotPath("/home/user/lttng-trace/mysession/"); + assertTrue("equals", fSnapshotInfo1.equals(info)); + info.setId(2); + assertTrue("equals", !fSnapshotInfo1.equals(info)); + + info.setId(fSnapshotInfo1.getId()); + info.setStreamedSnapshot(true); + assertTrue("equals", !fSnapshotInfo1.equals(info)); + + assertTrue("equals", !fSnapshotInfo1.equals(new TraceInfo(fSnapshotInfo1.getName()))); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Run the hashCode() method test. + */ + @Test + public void testHashCode() { + SnapshotInfo info1 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo1); + SnapshotInfo info2 = new SnapshotInfo((SnapshotInfo)fSnapshotInfo2); + + assertTrue("hashCode", fSnapshotInfo1.hashCode() == info1.hashCode()); + assertTrue("hashCode", fSnapshotInfo2.hashCode() == info2.hashCode()); + + assertTrue("hashCode", fSnapshotInfo1.hashCode() != info2.hashCode()); + assertTrue("hashCode", fSnapshotInfo2.hashCode() != info1.hashCode()); + + // null values + SnapshotInfo info3 = new SnapshotInfo("snapshot-1"); + assertTrue("hashCode", fSnapshotInfo1.hashCode() != info3.hashCode()); + + info3.setSnapshotPath(null); + assertTrue("hashCode", fSnapshotInfo1.hashCode() != info3.hashCode()); + + info3.setSnapshotPath("/home/user/lttng-trace/mysession/"); + assertTrue("hashCode", fSnapshotInfo1.hashCode() != info3.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/TraceInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/TraceInfoTest.java new file mode 100644 index 0000000000..3f6c8a9dc1 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/TraceInfoTest.java @@ -0,0 +1,199 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ITraceInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.TraceInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class TraceInfoTest contains test for the class + * {@link TraceInfo}. + */ +public class TraceInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private ITraceInfo fTraceInfo1 = null; + private ITraceInfo fTraceInfo2 = null; + + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + fTraceInfo1 = new TraceInfo("event1"); + fTraceInfo2 = new TraceInfo("event2"); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Run the BaseEventInfo() constructor test. + */ + @Test + public void testTraceInfo() { + TraceInfo fixture = new TraceInfo("event"); + assertNotNull(fixture); + + assertEquals("event", fixture.getName()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testTraceInfo2() { + try { + String name = null; + new TraceInfo(name); + fail("null name in custructor"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Test Copy Constructor + */ + @Test + public void testTraceInfoCopy() { + TraceInfo info = new TraceInfo((TraceInfo)fTraceInfo1); + + assertEquals(fTraceInfo1.getName(), info.getName()); + } + + /** + * Test Copy Constructor + */ + @Test + public void testTraceCopy2() { + try { + TraceInfo info = null; + new TraceInfo(info); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Run the void setEventType(String) method test. + */ + @Test + public void testSetName() { + TraceInfo fixture = new TraceInfo("event"); + fixture.setName("newName"); + assertEquals("newName", fixture.getName()); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_1() { + String result = fTraceInfo1.toString(); + + // add additional test code here + assertEquals("[TraceInfo(Name=event1)]", result); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fTraceInfo1.equals(fTraceInfo1)); + assertTrue("equals", fTraceInfo2.equals(fTraceInfo2)); + + assertTrue("equals", !fTraceInfo1.equals(fTraceInfo2)); + assertTrue("equals", !fTraceInfo2.equals(fTraceInfo1)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsSymmetry() { + TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1); + TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo2); + + assertTrue("equals", info1.equals(fTraceInfo1)); + assertTrue("equals", fTraceInfo1.equals(info1)); + + assertTrue("equals", info2.equals(fTraceInfo2)); + assertTrue("equals", fTraceInfo2.equals(info2)); + } + /** + * Run the equals() method test. + */ + @Test + public void testEqualsTransivity() { + TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1); + TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo1); + TraceInfo info3 = new TraceInfo((TraceInfo)fTraceInfo1); + + assertTrue("equals", info1.equals(info2)); + assertTrue("equals", info2.equals(info3)); + assertTrue("equals", info1.equals(info3)); + } + /** + * Run the equals() method test. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fTraceInfo1.equals(null)); + assertTrue("equals", !fTraceInfo2.equals(null)); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Run the hashCode() method test. + */ + @Test + public void testHashCode() { + TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1); + TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo2); + + assertTrue("hashCode", fTraceInfo1.hashCode() == info1.hashCode()); + assertTrue("hashCode", fTraceInfo2.hashCode() == info2.hashCode()); + + assertTrue("hashCode", fTraceInfo1.hashCode() != info2.hashCode()); + assertTrue("hashCode", fTraceInfo2.hashCode() != info1.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/UstProviderInfoTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/UstProviderInfoTest.java new file mode 100644 index 0000000000..bb5dcdbac4 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/model/impl/UstProviderInfoTest.java @@ -0,0 +1,254 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.model.impl; + +import static org.junit.Assert.*; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; +import org.junit.Before; +import org.junit.Test; + +/** + * The class ChannelInfoTest contains tests for the class + * {@link UstProviderInfo}. + */ +public class UstProviderInfoTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private IUstProviderInfo fUstProviderInfo1 = null; + private IUstProviderInfo fUstProviderInfo2 = null; + + private IBaseEventInfo fEventInfo1 = null; + private IBaseEventInfo fEventInfo2 = null; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + ModelImplFactory factory = new ModelImplFactory(); + fUstProviderInfo1 = factory.getUstProviderInfo1(); + fUstProviderInfo2 = factory.getUstProviderInfo2(); + fEventInfo1 = factory.getBaseEventInfo1(); + fEventInfo2 = factory.getBaseEventInfo2(); + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Run the UstProviderInfo() constructor test. + */ + @Test + public void testUstProviderInfo() { + IUstProviderInfo result = new UstProviderInfo("test"); + assertNotNull(result); + + assertEquals("test", result.getName()); + assertEquals(0, result.getPid()); + assertEquals(0, result.getEvents().length); + } + + /** + * Test the copy constructor. + */ + @Test + public void testUstProviderInfoCopy() { + IUstProviderInfo providerInf = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); + + assertEquals(fUstProviderInfo1.getName(), providerInf.getName()); + assertEquals(fUstProviderInfo1.getPid(), providerInf.getPid()); + assertEquals(fUstProviderInfo1.getEvents().length, providerInf.getEvents().length); + + IBaseEventInfo[] orignalEvents = fUstProviderInfo1.getEvents(); + IBaseEventInfo[] resultEvents = providerInf.getEvents(); + for (int i = 0; i < orignalEvents.length; i++) { + assertEquals(orignalEvents[i], resultEvents[i]); + } + } + + /** + * Test the copy constructor. + */ + @Test + public void testUstProviderCopy2() { + try { + UstProviderInfo providerInfo = null; + new UstProviderInfo(providerInfo); + fail("null copy"); + } + catch (IllegalArgumentException e) { + // Success + } + } + + /** + * Run the IEventInfo[] getEvents() method test. + */ + @Test + public void testGetAndSetters() { + IUstProviderInfo fixture = new UstProviderInfo("test"); + fixture.setPid(2468); + + // add an event + IBaseEventInfo event = new BaseEventInfo("event"); + fixture.addEvent(event); + + // Verify the stored events + IBaseEventInfo[] result = fixture.getEvents(); + + assertNotNull(result); + assertEquals(1, result.length); + assertNotNull(result[0]); + assertTrue(event.equals(result[0])); + + assertEquals(2468, fixture.getPid()); + } + + /** + * Run the void setEvents(List) method test. + */ + @Test + public void testSetEvents_1() { + UstProviderInfo fixture = new UstProviderInfo("test"); + fixture.setPid(2468); + List events = new LinkedList<>(); + events.add(fEventInfo1); + events.add(fEventInfo2); + fixture.setEvents(events); + + IBaseEventInfo[] infos = fixture.getEvents(); + + assertEquals(events.size(), infos.length); + + for (int i = 0; i < infos.length; i++) { + assertEquals(events.get(i), infos[i]); + } + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_1() { + UstProviderInfo fixture = new UstProviderInfo("test"); + fixture.setPid(2468); + String result = fixture.toString(); + + assertEquals("[EventInfo([TraceInfo(Name=test)],PID=2468,Events=None)]", result); + } + + /** + * Run the String toString() method test. + */ + @Test + public void testToString_2() { + String result = fUstProviderInfo2.toString(); + assertEquals("[EventInfo([TraceInfo(Name=myUST2)],PID=2345,Events=[BaseEventInfo([TraceInfo(Name=event1)]," + + "type=UNKNOWN,level=TRACE_DEBUG,Fields=[FieldInfo([TraceInfo(Name=intfield)],type=int[FieldInfo" + + "([TraceInfo(Name=stringfield)],type=string,Filter=intField==10)][BaseEventInfo([TraceInfo(Name=event2)]," + + "type=TRACEPOINT,level=TRACE_DEBUG)])]", result); + } + + // ------------------------------------------------------------------------ + // equals + // ------------------------------------------------------------------------ + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsReflexivity() { + assertTrue("equals", fUstProviderInfo1.equals(fUstProviderInfo1)); + assertTrue("equals", fUstProviderInfo2.equals(fUstProviderInfo2)); + + assertTrue("equals", !fUstProviderInfo1.equals(fUstProviderInfo2)); + assertTrue("equals", !fUstProviderInfo2.equals(fUstProviderInfo1)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsSymmetry() { + UstProviderInfo event1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); + UstProviderInfo event2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo2); + + assertTrue("equals", event1.equals(fUstProviderInfo1)); + assertTrue("equals", fUstProviderInfo1.equals(event1)); + + assertTrue("equals", event2.equals(fUstProviderInfo2)); + assertTrue("equals", fUstProviderInfo2.equals(event2)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsTransivity() { + UstProviderInfo UstProvider1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); + UstProviderInfo UstProvider2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); + UstProviderInfo UstProvider3 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); + + assertTrue("equals", UstProvider1.equals(UstProvider2)); + assertTrue("equals", UstProvider2.equals(UstProvider3)); + assertTrue("equals", UstProvider1.equals(UstProvider3)); + } + + /** + * Run the equals() method test. + */ + @Test + public void testEqualsNull() { + assertTrue("equals", !fUstProviderInfo1.equals(null)); + assertTrue("equals", !fUstProviderInfo2.equals(null)); + } + + // ------------------------------------------------------------------------ + // hashCode + // ------------------------------------------------------------------------ + + /** + * Run the hashCode() method test. + */ + @Test + public void testHashCode() { + UstProviderInfo UstProvider1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); + UstProviderInfo UstProvider2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo2); + + assertTrue("hashCode", fUstProviderInfo1.hashCode() == UstProvider1.hashCode()); + assertTrue("hashCode", fUstProviderInfo2.hashCode() == UstProvider2.hashCode()); + + assertTrue("hashCode", fUstProviderInfo1.hashCode() != UstProvider2.hashCode()); + assertTrue("hashCode", fUstProviderInfo2.hashCode() != UstProvider1.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/relayd/LttngRelayd24Test.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/relayd/LttngRelayd24Test.java new file mode 100644 index 0000000000..0620f9d4a8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/relayd/LttngRelayd24Test.java @@ -0,0 +1,108 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.relayd; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.InetAddress; +import java.net.Socket; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.ILttngRelaydConnector; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.LttngRelaydConnectorFactory; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.Command; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ConnectResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionReturnCode; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.GetNextIndex; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.NextIndexReturnCode; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ViewerCommand; +import org.junit.Test; + +/** + * Unit tests for lttng-relayd. It actually allows us to test the API. + * + * @author Matthew Khouzam + */ +public class LttngRelayd24Test { + + private static final int PACKETS_TO_READ = 100; + private static final String ADDRESS = "127.0.0.1"; // change me //$NON-NLS-1$ + private static final int PORT = 5344; + + private static void getPackets(AttachSessionResponse attachedSession, Socket connection, ILttngRelaydConnector relayD) throws IOException { + int numPacketsReceived = 0; + DataOutputStream fOutNet = new DataOutputStream(connection.getOutputStream()); + DataInputStream fInNet = new DataInputStream(connection.getInputStream()); + while (numPacketsReceived < PACKETS_TO_READ) { + for (StreamResponse stream : attachedSession.getStreamList()) { + if (stream.getMetadataFlag() != 1) { + ConnectResponse connectPayload = new ConnectResponse(fInNet); + assertNotNull(connectPayload); + + ViewerCommand connectCommand = new ViewerCommand(Command.VIEWER_GET_NEXT_INDEX, ConnectResponse.SIZE, 0); + fOutNet.write(connectCommand.serialize()); + fOutNet.flush(); + + GetNextIndex indexRequest = new GetNextIndex(stream.getId()); + fOutNet.write(indexRequest.serialize()); + fOutNet.flush(); + + IndexResponse indexReply = new IndexResponse(fInNet); + // Nothing else supported for now + if (indexReply.getStatus() == NextIndexReturnCode.VIEWER_INDEX_OK) { + if (relayD.getPacketFromStream(indexReply, stream.getId()) != null) { + numPacketsReceived++; + } + } + } + } + } + } + + /** + * Test a connection + * + * @throws IOException + * network timeout? + */ + @Test + public void testViewerConnection() throws IOException { + InetAddress addr = InetAddress.getByName(ADDRESS); + try (Socket connection = new Socket(addr, PORT); + ILttngRelaydConnector relayD = LttngRelaydConnectorFactory.getNewConnector(connection);) { + + List sessions = relayD.getSessions(); + assertTrue(sessions.size() > 0); + SessionResponse lttngViewerSession = sessions.get(0); + assertNotNull(lttngViewerSession); + CreateSessionResponse createSession = relayD.createSession(); + assertEquals(createSession.getStatus(), CreateSessionReturnCode.LTTNG_VIEWER_CREATE_SESSION_OK); + AttachSessionResponse attachedSession = relayD.attachToSession(lttngViewerSession); + + String metaData = relayD.getMetadata(attachedSession); + assertNotNull(metaData); + + getPackets(attachedSession, connection, relayD); + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/AllTests.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/AllTests.java new file mode 100644 index 0000000000..a647473f4a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/AllTests.java @@ -0,0 +1,26 @@ +/********************************************************************** + * 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: + * Guilliano Molaire - Initial API and implementation + *********************************************************************/ +package org.eclipse.linuxtools.lttng2.control.core.tests.session; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Run all the tests in the lttng2.core.session plugin. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + SessionConfigGeneratorTest.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/SessionConfigGeneratorTest.java b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/SessionConfigGeneratorTest.java new file mode 100644 index 0000000000..2b0b4dd71c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/linuxtools/lttng2/control/core/tests/session/SessionConfigGeneratorTest.java @@ -0,0 +1,156 @@ +/********************************************************************** + * 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: + * Guilliano Molaire - Initial API and implementation + *********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.tests.session; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.linuxtools.internal.lttng2.control.core.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigGenerator; +import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; +import org.eclipse.linuxtools.lttng2.control.core.tests.model.impl.ModelImplFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * This class contains tests for the class {@link SessionConfigGenerator}. + */ +public class SessionConfigGeneratorTest { + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + /** Session files for validation */ + private static final File VALID_SESSION_FILE = new File("../org.eclipse.tracecompass.lttng2.control.core.tests/test_session_config_files/test_valid.lttng"); + private static final File INVALID_SESSION_FILE = new File("../org.eclipse.tracecompass.lttng2.control.core.tests/test_session_config_files/test_invalid.lttng"); + + private static final String SESSION_FILENAME = "test_session." + SessionConfigStrings.SESSION_CONFIG_FILE_EXTENSION; + private static final IPath SESSION_FILE_PATH = Activator.getDefault().getStateLocation().addTrailingSeparator().append(SESSION_FILENAME); + private static final String TRACE_SESSION_PATH = "/home/user/folder"; + + private static final String SESSION_NAME_1 = "session1"; + private static final String SESSION_NAME_2 = "session2"; + private static final String SESSION_NAME_3 = "session3"; + + /** Session informations for generation tests */ + private ISessionInfo fValidSessionInfo = null; + private ISessionInfo fValidSessionSnapshotInfo = null; + private ISessionInfo fInvalidSessionInfo = null; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + /** + * Perform pre-test initialization. + */ + @Before + public void setUp() { + /* A valid domain with shared buffer type */ + ModelImplFactory factory = new ModelImplFactory(); + IDomainInfo domain = factory.getDomainInfo1(); + domain.setBufferType(BufferType.BUFFER_SHARED); + + /* The valid sessions */ + fValidSessionInfo = new SessionInfo(SESSION_NAME_1); + fValidSessionInfo.setSessionPath(TRACE_SESSION_PATH); + fValidSessionInfo.setSessionState(TraceSessionState.ACTIVE); + fValidSessionInfo.addDomain(domain); + + fValidSessionSnapshotInfo = new SessionInfo(SESSION_NAME_2); + fValidSessionSnapshotInfo.setSessionPath(TRACE_SESSION_PATH); + fValidSessionSnapshotInfo.setSessionState(TraceSessionState.ACTIVE); + fValidSessionSnapshotInfo.addDomain(domain); + fValidSessionSnapshotInfo.setSnapshotInfo(factory.getSnapshotInfo1()); + + /* The invalid session contains an event with an invalid type */ + fInvalidSessionInfo = factory.getSessionInfo2(); + fInvalidSessionInfo.setName(SESSION_NAME_3); + } + + /** + * Delete the session file created + */ + @After + public void tearUp() { + /* Tear up the file created if it exists */ + File sessionConfigurationFile = SESSION_FILE_PATH.toFile(); + if (sessionConfigurationFile.exists()) { + sessionConfigurationFile.delete(); + } + + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Test method for {@link SessionConfigGenerator#sessionValidate(File)} + */ + @Test + public void testSessionValidate() { + File testSessionFile = VALID_SESSION_FILE; + if ((testSessionFile == null) || !testSessionFile.exists()) { + fail("Session test file does not exist"); + } + IStatus status = SessionConfigGenerator.sessionValidate(testSessionFile); + if (!status.isOK()) { + fail(status.getMessage()); + } + + testSessionFile = INVALID_SESSION_FILE; + if ((testSessionFile == null) || !testSessionFile.exists()) { + fail("Session test file does not exist"); + } + assertFalse(SessionConfigGenerator.sessionValidate(testSessionFile).isOK()); + } + + /** + * Test method for + * {@link SessionConfigGenerator#generateSessionConfig(Set, IPath)} + */ + @Test + public void testGenerateSessionConfig() { + /* Should fail since it's empty */ + final Set sessions = new HashSet<>(); + assertFalse(SessionConfigGenerator.generateSessionConfig(sessions, SESSION_FILE_PATH).isOK()); + + /* Add a valid session and validate */ + sessions.add(fValidSessionInfo); + assertTrue(SessionConfigGenerator.generateSessionConfig(sessions, SESSION_FILE_PATH).isOK()); + assertTrue(SessionConfigGenerator.sessionValidate(SESSION_FILE_PATH.toFile()).isOK()); + + /* Add a valid snapshot session and validate */ + sessions.add(fValidSessionSnapshotInfo); + assertTrue(SessionConfigGenerator.generateSessionConfig(sessions, SESSION_FILE_PATH).isOK()); + assertTrue(SessionConfigGenerator.sessionValidate(SESSION_FILE_PATH.toFile()).isOK()); + + /* Add an invalid session */ + sessions.add(fInvalidSessionInfo); + assertFalse(SessionConfigGenerator.generateSessionConfig(sessions, SESSION_FILE_PATH).isOK()); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/test_session_config_files/test_invalid.lttng b/org.eclipse.tracecompass.lttng2.control.core.tests/test_session_config_files/test_invalid.lttng new file mode 100644 index 0000000000..d13f485874 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/test_session_config_files/test_invalid.lttng @@ -0,0 +1,55 @@ + + + + + auto-20140323-130527 + false + + + GLOBAL + + + channel0 + DISCARD + 4 + 0 + 0 + 0 + 0 + false + 262144 + 200000 + SPLICE + + + exit_syscall + true + TRACEPOINT + + + + + + + + + true + + /home/user/folder + + + + + diff --git a/org.eclipse.tracecompass.lttng2.control.core.tests/test_session_config_files/test_valid.lttng b/org.eclipse.tracecompass.lttng2.control.core.tests/test_session_config_files/test_valid.lttng new file mode 100644 index 0000000000..4dea4df351 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core.tests/test_session_config_files/test_valid.lttng @@ -0,0 +1,56 @@ + + + + + auto-20140323-130527 + false + + + KERNEL + GLOBAL + + + channel0 + DISCARD + 4 + 0 + 0 + 0 + 0 + false + 262144 + 200000 + SPLICE + + + exit_syscall + true + TRACEPOINT + + + + + + + + + true + + /home/user/folder + + + + + diff --git a/org.eclipse.tracecompass.lttng2.control.core/.classpath b/org.eclipse.tracecompass.lttng2.control.core/.classpath new file mode 100644 index 0000000000..098194ca4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.control.core/.project b/org.eclipse.tracecompass.lttng2.control.core/.project new file mode 100644 index 0000000000..a1054ac077 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.control.core + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..9f3662cd78 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,394 @@ +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.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 diff --git a/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..d92b94fd4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.control.core/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.control.core/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..e6f46608f4 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.control.core;singleton:=true +Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.control.core.Activator +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.tracecompass.ctf.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.ctf.core;bundle-version="3.1.0" +Export-Package: org.eclipse.linuxtools.internal.lttng2.control.core;x-friends:="org.eclipse.tracecompass.lttng2.control.core.tests", + org.eclipse.linuxtools.internal.lttng2.control.core.model;x-friends:="org.eclipse.tracecompass.lttng2.control.ui,org.eclipse.tracecompass.lttng2.control.ui.tests,org.eclipse.tracecompass.lttng2.control.core.tests", + org.eclipse.linuxtools.internal.lttng2.control.core.model.impl;x-friends:="org.eclipse.tracecompass.lttng2.control.ui,org.eclipse.tracecompass.lttng2.control.ui.tests,org.eclipse.tracecompass.lttng2.control.core.tests", + org.eclipse.linuxtools.internal.lttng2.control.core.relayd;x-friends:="org.eclipse.tracecompass.lttng2.control.core.tests,org.eclipse.tracecompass.lttng2.control.ui,org.eclipse.tracecompass.lttng2.control.ui.tests", + org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl;x-friends:="org.eclipse.tracecompass.lttng2.control.core.tests,org.eclipse.tracecompass.lttng2.control.ui,org.eclipse.tracecompass.lttng2.control.ui.tests", + org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands;x-friends:="org.eclipse.tracecompass.lttng2.control.core.tests,org.eclipse.tracecompass.lttng2.control.ui,org.eclipse.tracecompass.lttng2.control.ui.tests", + org.eclipse.linuxtools.lttng2.control.core.session +Import-Package: com.google.common.collect diff --git a/org.eclipse.tracecompass.lttng2.control.core/about.html b/org.eclipse.tracecompass.lttng2.control.core/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/build.properties b/org.eclipse.tracecompass.lttng2.control.core/build.properties new file mode 100644 index 0000000000..7a2207a1a0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/build.properties @@ -0,0 +1,21 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + 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 diff --git a/org.eclipse.tracecompass.lttng2.control.core/plugin.properties b/org.eclipse.tracecompass.lttng2.control.core/plugin.properties new file mode 100644 index 0000000000..857d4018d6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/plugin.properties @@ -0,0 +1,15 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +#Properties file for org.eclipse.tracecompass.lttng2.control.core +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Control Core Plug-in diff --git a/org.eclipse.tracecompass.lttng2.control.core/pom.xml b/org.eclipse.tracecompass.lttng2.control.core/pom.xml new file mode 100644 index 0000000000..6456fdfbdf --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/pom.xml @@ -0,0 +1,36 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.control.core + 3.1.0-SNAPSHOT + eclipse-plugin + + Trace Compass LTTng Control Core Plug-in + + + + + org.eclipse.tycho + tycho-source-plugin + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/Activator.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/Activator.java new file mode 100644 index 0000000000..be722ee69b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/Activator.java @@ -0,0 +1,136 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.control.core; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; +import org.osgi.framework.BundleContext; + +/** + * Activator + *

+ * 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.linuxtools.lttng2.control.core"; //$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); + } + + /** + * 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)); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IBaseEventInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IBaseEventInfo.java new file mode 100644 index 0000000000..21d7b3bfdc --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IBaseEventInfo.java @@ -0,0 +1,89 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +import java.util.List; + +/** + *

+ * Interface for retrieval of basic trace event information. + *

+ * + * @author Bernd Hufmann + */ +public interface IBaseEventInfo extends ITraceInfo { + + /** + * @return the trace event type + */ + TraceEventType getEventType(); + + /** + * Sets the trace event type to the given type + * @param type - type to set + */ + void setEventType(TraceEventType type); + + /** + * Sets the trace event type to the type specified by the given name. + * @param typeName - event type name + */ + void setEventType(String typeName); + + /** + * @return the trace event log level + */ + TraceLogLevel getLogLevel(); + + /** + * Sets the trace event log level to the given level + * @param level - event log level to set + */ + void setLogLevel(TraceLogLevel level); + + /** + * Sets the trace event log level to the level specified by the given name. + * @param levelName - event log level name + */ + void setLogLevel(String levelName); + + /** + * Returns the field information (if exists) + * @return the field information or null + */ + IFieldInfo[] getFields(); + + /** + * @param field The field to add + */ + void addField(IFieldInfo field); + + /** + * Sets the fields + * @param fields The fields + */ + void setFields(List fields); + + /** + * Returns filter expression. + * @return filter expression + */ + String getFilterExpression(); + + /** + * Sets the filter expression. + * @param filter The filter expression to set + */ + void setFilterExpression(String filter); + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IChannelInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IChannelInfo.java new file mode 100644 index 0000000000..8018ea0458 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IChannelInfo.java @@ -0,0 +1,157 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Simon Delisle - Updated for support of LTTng Tools 2.2 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; + +/** + *

+ * Interface for retrieval of trace channel information. + *

+ * + * @author Bernd Hufmann + */ +public interface IChannelInfo extends ITraceInfo { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Default value for overwrite mode. + */ + public final static boolean DEFAULT_OVERWRITE_MODE = false; + + /** + * @return the overwrite mode value. + */ + boolean isOverwriteMode(); + /** + * Sets the overwrite mode value to the given mode. + * @param mode - mode to set. + */ + void setOverwriteMode(boolean mode); + + /** + * @return the sub-buffer size. + */ + long getSubBufferSize(); + /** + * Sets the sub-buffer size to the given value. + * @param bufferSize - size to set to set. + */ + void setSubBufferSize(long bufferSize); + + /** + * @return the number of sub-buffers. + */ + int getNumberOfSubBuffers(); + /** + * Sets the number of sub-buffers to the given value. + * @param numberOfSubBuffers - value to set. + */ + void setNumberOfSubBuffers(int numberOfSubBuffers); + + /** + * @return the switch timer interval. + */ + long getSwitchTimer(); + /** + * Sets the switch timer interval to the given value. + * @param timer - timer value to set. + */ + void setSwitchTimer(long timer); + + /** + * @return the read timer interval. + */ + long getReadTimer(); + /** + * Sets the read timer interval to the given value. + * @param timer - timer value to set.. + */ + void setReadTimer(long timer); + + /** + * @return the output type. + */ + TraceChannelOutputType getOutputType(); + /** + * Sets the output type to the given value. + * @param type - type to set. + */ + void setOutputType(String type); + /** + * Sets the output type to the given value. + * @param type - type to set. + */ + void setOutputType(TraceChannelOutputType type); + + /** + * @return the channel state (enabled or disabled). + */ + TraceEnablement getState(); + /** + * Sets the channel state (enablement) to the given value. + * @param state - state to set. + */ + void setState(TraceEnablement state); + /** + * Sets the channel state (enablement) to the value specified by the given name. + * @param stateName - state to set. + */ + void setState(String stateName); + + /** + * @return all event information as array. + */ + IEventInfo[] getEvents(); + /** + * Sets the event information specified by given list. + * @param events - all event information to set. + */ + void setEvents(List events); + /** + * Adds a single event information. + * @param event - event information to add. + */ + void addEvent(IEventInfo event); + /** + * Sets the maximum size of trace files + * @param maxSizeTraceFiles - maximum size + */ + void setMaxSizeTraceFiles(int maxSizeTraceFiles); + /** + * Sets the maximum number of trace files + * @param maxNumberTraceFiles - maximum number + */ + void setMaxNumberTraceFiles(int maxNumberTraceFiles); + /** + * @return maximum size of trace files + */ + int getMaxSizeTraceFiles(); + /** + * @return maximum number of trace files + */ + int getMaxNumberTraceFiles(); + /** + * Sets per UID buffers + * @param buffersUID - enable or not + */ + void setBufferType(BufferType buffersUID); + /** + * @return the value of buffersUID (enable or not) + */ + BufferType getBufferType(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IDomainInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IDomainInfo.java new file mode 100644 index 0000000000..783deb511f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IDomainInfo.java @@ -0,0 +1,69 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; + +/** + *

+ * Interface for retrieval of trace domain information. + *

+ * + * @author Bernd Hufmann + */ +public interface IDomainInfo extends ITraceInfo { + + /** + * @return information about all channels + */ + IChannelInfo[] getChannels(); + + /** + * Sets the channel information specified by given list. + * @param channels - all channel information to set. + */ + void setChannels(List channels); + + /** + * Adds a single channel information. + * @param channel - channel information to add. + */ + void addChannel(IChannelInfo channel); + + /** + * @return true if domain is kernel, false for UST + */ + boolean isKernel(); + + /** + * Sets whether domain is Kernel domain or UST + * @param isKernel true for kernel, false for UST + */ + void setIsKernel(boolean isKernel); + + /** + * @return Information about the buffer type + */ + BufferType getBufferType(); + + /** + * Sets the buffer type + * + * @param bufferType + * The buffer type + */ + void setBufferType(BufferType bufferType); + + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IEventInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IEventInfo.java new file mode 100644 index 0000000000..cd11e82b10 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IEventInfo.java @@ -0,0 +1,58 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +/** + *

+ * Interface for retrieval of trace event information. + *

+ * + * @author Bernd Hufmann + */ +public interface IEventInfo extends IBaseEventInfo { + + /** + * @return the event state (enabled or disabled). + */ + TraceEnablement getState(); + + /** + * Sets the event state (enablement) to the given value. + * @param state - state to set. + */ + void setState(TraceEnablement state); + + /** + * Sets the event state (enablement) to the value specified by the given name. + * @param stateName - state to set. + */ + void setState(String stateName); + + /** + * Returns the log level type. + * @return log level type. + */ + LogLevelType getLogLevelType(); + + /** + * Sets the LogLevelType. + * @param type - log level type + */ + void setLogLevelType(LogLevelType type); + + /** + * Sets the LogLevelType based on given short name. + * @param shortName - short name of type + */ + void setLogLevelType(String shortName); + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IFieldInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IFieldInfo.java new file mode 100644 index 0000000000..3486a841fd --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IFieldInfo.java @@ -0,0 +1,34 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +/** + *

+ * Interface for retrieval of event field information. + *

+ * + * @author Bernd Hufmann + */ +public interface IFieldInfo extends ITraceInfo { + + /** + * @return the event field type + */ + String getFieldType(); + + /** + * Sets field type string + * + * @param fieldType - sting of event field type + */ + void setFieldType(String fieldType); +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IProbeEventInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IProbeEventInfo.java new file mode 100644 index 0000000000..915998bdbf --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IProbeEventInfo.java @@ -0,0 +1,55 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +/** + *

+ * Interface for retrieval of probe event information. + *

+ * + * @author Bernd Hufmann + */ +public interface IProbeEventInfo extends IEventInfo { + + /** + * @return the address of the probe. (null if not used) + */ + String getAddress(); + + /** + * Sets the address of the probe. + * @param address - a address (null if not used) + */ + void setAddress(String address); + + /** + * @return the offset applied to the symbol (null if not used). + */ + String getOffset(); + + /** + * Sets the offset applied to the symbol. + * @param offset - a offset ((null if not used) + */ + void setOffset(String offset); + + /** + * @return the symbol name. ((null if not used)) + */ + String getSymbol(); + + /** + * Sets the symbol name. + * @param symbol - a symbol name ((null if not used)) + */ + void setSymbol(String symbol); +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISessionInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISessionInfo.java new file mode 100644 index 0000000000..d40a695b4a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISessionInfo.java @@ -0,0 +1,222 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + * Marc-Andre Laperle - Support for creating a live session + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +import java.util.List; + +/** + *

+ * Interface for retrieval of trace session information. + *

+ * + * @author Bernd Hufmann + */ +public interface ISessionInfo extends ITraceInfo { + + /** + * @return the session state state (active or inactive). + */ + TraceSessionState getSessionState(); + /** + * Sets the session state to the given value. + * @param state - state to set. + */ + void setSessionState(TraceSessionState state); + + /** + * Sets the event state to the value specified by the given name. + * @param stateName - state to set. + */ + void setSessionState(String stateName); + + /** + * @return path string where session is located. + */ + String getSessionPath(); + + /** + * Sets the path string (where session is located) to the given value. + * @param path - session path to set. + */ + void setSessionPath(String path); + + /** + * @return all domain information as array. + */ + IDomainInfo[] getDomains(); + + /** + * Sets all domain information specified by given list. + * @param domains - all domain information to set. + */ + void setDomains(List domains); + + /** + * Adds a single domain information. + * @param domainInfo domain information to add. + */ + void addDomain(IDomainInfo domainInfo); + + /** + * Returns if session is streamed over network + * @return true if streamed over network else false + */ + boolean isStreamedTrace(); + + /** + * Sets whether the trace is streamed or not + * @param isStreamedTrace true if streamed over network else false + */ + void setStreamedTrace(boolean isStreamedTrace); + + /** + * Returns whether the session is snapshot session or not + * @return true if it is snapshot session else false + */ + boolean isSnapshotSession(); + + /** + * Set whether or not the session should be in snapshot mode + * + * @param isSnapshot + * true for snapshot mode, false otherwise + */ + void setSnapshot(boolean isSnapshot); + + /** + * Gets the snapshot information the session or null if it is not a + * snapshot session. + * @return snapshot information + */ + ISnapshotInfo getSnapshotInfo(); + + /** + * Sets the snapshot information of the session + * @param setSnapshotInfo - the snapshot data to set. + */ + void setSnapshotInfo(ISnapshotInfo setSnapshotInfo); + + /** + * Get whether or not the session should be in Live mode + * + * @return true if is a live session else false + */ + public boolean isLive(); + + /** + * Set whether or not the session should be in Live mode + * + * @param isLive + * true for Live mode, false otherwise + */ + public void setLive(boolean isLive); + + /** + * Get the live delay which is the delay in micro seconds before the data is + * flushed and streamed. + * + * @return the live delay or -1 if the default value should be used + */ + public int getLiveDelay(); + + /** + * Set the live delay which is the delay in micro seconds before the data is + * flushed and streamed. + * + * @param liveDelay + * the live delay + */ + public void setLiveDelay(int liveDelay); + + /** + * Get the network URL in case control and data is configured together + * otherwise null If it returns a non-null value, getControlUrl() and + * getDataUrl() have to return null. + * + * @return The network URL or null. + */ + String getNetworkUrl(); + + /** + * Set the network URL + * + * @param networkUrl + * the network URL + */ + void setNetworkUrl(String networkUrl); + + /** + * Get the control URL in case control and data is configured separately. If + * it returns a non-null value, getDataUrl() has to return a valid value too + * and getNetworkUrl() has to return null. + * + * @return The control URL or null. + */ + String getControlUrl(); + + /** + * Set the control URL + * + * @param controlUrl + * the control URL + */ + void setControlUrl(String controlUrl); + + /** + * Get the data URL in case control and data is configured separately. If it + * returns a non-null value, getControlUrl() has to return a valid value too + * and getNetworkUrl() has to return null. + * + * @return The data URL or null. + */ + String getDataUrl(); + + /** + * Set the data URL + * + * @param datalUrl + * the data URL + */ + void setDataUrl(String datalUrl); + + /** + * Get the live URL. + * + * @return the live URL + */ + String getLiveUrl(); + + /** + * Set the live URL. + * + * @param liveUrl + * the live URL + */ + void setLiveUrl(String liveUrl); + + /** + * Get the live port. + * + * @return the live port + */ + Integer getLivePort(); + + /** + * Set the live port. + * + * @param livePort + * the live port + */ + void setLivePort(Integer livePort); +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISnapshotInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISnapshotInfo.java new file mode 100644 index 0000000000..7c360feb9c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISnapshotInfo.java @@ -0,0 +1,62 @@ +/********************************************************************** + * Copyright (c) 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + + +/** + *

+ * Interface for retrieval of snapshot information of a session. + *

+ * + * @author Bernd Hufmann + */ +public interface ISnapshotInfo extends ITraceInfo { + + /** + * @return path string where snapshot is located. + */ + String getSnapshotPath(); + + /** + * Sets the path string (where snapshot is located) to the given value. + * @param path - session path to set. + */ + void setSnapshotPath(String path); + + /** + * @return the snapshot ID. + */ + int getId(); + + /** + * Sets the snapshot ID. + * @param id - the ID to set. + */ + void setId(int id); + + /** + * Sets whether snapshot is streamed over the network or stored locally + * at the tracers host. + * + * @param isStreamed - true if streamed else false + */ + void setStreamedSnapshot(boolean isStreamed); + + /** + * Gets whether snapshot is streamed over the network or stored locally + * at the tracers host. + * + * @return true if streamed else false + */ + boolean isStreamedSnapshot(); + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ITraceInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ITraceInfo.java new file mode 100644 index 0000000000..1a3722730c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ITraceInfo.java @@ -0,0 +1,35 @@ +/********************************************************************** + * Copyright (c) 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +/** + *

+ * Interface for retrieve trace comon information. + *

+ * + * @author Bernd Hufmann + */ +public interface ITraceInfo { + /** + * @return the name of the information element. + */ + String getName(); + + /** + * Sets the name of the information element. + * + * @param name + * The name to assign + */ + void setName(String name); + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IUstProviderInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IUstProviderInfo.java new file mode 100644 index 0000000000..843028bf9d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IUstProviderInfo.java @@ -0,0 +1,52 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +import java.util.List; + +/** + *

+ * Interface for retrieval of UST provider information. + *

+ * + * @author Bernd Hufmann + */ +public interface IUstProviderInfo extends ITraceInfo { + + /** + * @return the process ID of the UST provider. + */ + int getPid(); + + /** + * Sets the process ID of the UST provider to the given value. + * @param pid - process ID to set + */ + void setPid(int pid); + + /** + * @return all event information as array. + */ + IBaseEventInfo[] getEvents(); + + /** + * Sets the event information specified by given list. + * @param events - all event information to set. + */ + void setEvents(List events); + + /** + * Adds a single event information. + * @param event - event information to add. + */ + void addEvent(IBaseEventInfo event); +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/LogLevelType.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/LogLevelType.java new file mode 100644 index 0000000000..7f6f2cef50 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/LogLevelType.java @@ -0,0 +1,104 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + *********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + + +/** + * Type of log Level enumeration. + * + * @author Bernd Hufmann + */ +public enum LogLevelType { + + // ------------------------------------------------------------------------ + // Enum definition + // ------------------------------------------------------------------------ + /** range of log levels [0,logLevel] */ + LOGLEVEL("<=", "RANGE"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** all log level */ + LOGLEVEL_ALL("", "ALL"), //$NON-NLS-1$//$NON-NLS-2$ + + /** single log level */ + LOGLEVEL_ONLY("==", "SINGLE"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** no log level */ + LOGLEVEL_NONE("", "UNKNOWN"); //$NON-NLS-1$ //$NON-NLS-2$ + + // ------------------------------------------------------------------------ + // Constuctors + // ------------------------------------------------------------------------ + + /** + * Private constructor + * + * @param name + * the name of state + */ + private LogLevelType(String shortName, String miName) { + fShortName = shortName; + fMiName = miName; + } + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * Name of enum. + */ + private final String fShortName; + private final String fMiName; + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return short string + */ + public String getShortName() { + return fShortName; + } + + /** + * @return machine interface name string + */ + public String getMiName() { + return fMiName; + } + + // ------------------------------------------------------------------------ + // Utility + // ------------------------------------------------------------------------ + /** + * Return the corresponding {@link LogLevelType} to String "name" + * + * @param name + * String to compare to retrieve the good LogLevelType + * @return the corresponding {@link LogLevelType} + */ + public static LogLevelType valueOfString(String name) { + if (name == null) { + throw new IllegalArgumentException(); + } + for (LogLevelType lltype : LogLevelType.values()) { + if (!lltype.equals(LOGLEVEL_NONE)) { + boolean isEqual = lltype.fShortName.equalsIgnoreCase(name) || lltype.fMiName.equalsIgnoreCase(name); + if (isEqual) { + return lltype; + } + } + } + + // No match + return LogLevelType.LOGLEVEL_NONE; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TargetNodeState.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TargetNodeState.java new file mode 100644 index 0000000000..5a023155b2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TargetNodeState.java @@ -0,0 +1,30 @@ +/********************************************************************** + * Copyright (c) 2012 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +/** + *

+ * Enumeration for the node connection state. + *

+ * + * @author Bernd Hufmann + */ +public enum TargetNodeState { + /** State when disconnected */ + DISCONNECTED, + /** State while disconnecting */ + DISCONNECTING, + /** State when connected */ + CONNECTED, + /** State while connecting */ + CONNECTING; +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceChannelOutputType.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceChannelOutputType.java new file mode 100644 index 0000000000..7e53f81f96 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceChannelOutputType.java @@ -0,0 +1,74 @@ +/********************************************************************** + * 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: + * Jonathan Rajotte - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +/** + * Trace domain type enumeration. + * + * @author Jonathan Rajotte + */ +public enum TraceChannelOutputType { + /** Channel output type : splice */ + SPLICE("splice()", "SPLICE" ), //$NON-NLS-1$ //$NON-NLS-2$ + /** Channel output type : mmap */ + MMAP("mmap()", "MMAP"), //$NON-NLS-1$ //$NON-NLS-2$ + /** Channel output type : unknown */ + UNKNOWN("unknown", "unknown"); //$NON-NLS-1$ //$NON-NLS-2$ + + private final String fInName; + private final String fInMiName; + + private TraceChannelOutputType(String name, String miName) { + fInName = name; + fInMiName = miName; + } + + /** + * Get the type's name + * + * @return The type's name + */ + public String getInName() { + return fInName; + } + + /** + * Get the type's name + * + * @return The type's name + */ + public String getInMiName() { + return fInMiName; + } + + /** + * Return the corresponding {@link TraceChannelOutputType} of string miName + * + * @param name + * name of the Trace domain type to look for + * @return the corresponding {@link TraceChannelOutputType} + */ + public static TraceChannelOutputType valueOfString(String name) { + if (name == null) { + throw new IllegalArgumentException(); + } + for (TraceChannelOutputType tdType : TraceChannelOutputType.values()) { + boolean isEqual = tdType.getInName().equalsIgnoreCase(name) || tdType.getInMiName().equalsIgnoreCase(name); + if (isEqual) { + return tdType; + } + } + // Unknown domain + return UNKNOWN; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java new file mode 100644 index 0000000000..de52919b66 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java @@ -0,0 +1,64 @@ +/********************************************************************** + * 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: + * Jonathan Rajotte - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +/** + * Trace domain type enumeration. + * + * @author Jonathan Rajotte + */ +public enum TraceDomainType { + /** Domain type : ust */ + UST("ust"), //$NON-NLS-1$ + /** Domain type : kernel */ + KERNEL("kernel"), //$NON-NLS-1$ + /** Domain type : jul */ + JUL("jul"), //$NON-NLS-1$ + /** Unknown domain type */ + UNKNOWN("Unknown domain type"); //$NON-NLS-1$ + + private final String fInName; + + private TraceDomainType(String name) { + fInName = name; + } + + /** + * Get the type's name + * + * @return The type's name + */ + public String getInName() { + return fInName; + } + + /** + * Return the corresponding {@link TraceDomainType} of string miName + * + * @param miName + * name of the Trace domain type to look for + * @return the corresponding {@link TraceDomainType} + */ + public static TraceDomainType valueOfString(String miName) { + if (miName == null) { + throw new IllegalArgumentException(); + } + for (TraceDomainType tdType : TraceDomainType.values()) { + if (tdType.getInName().equalsIgnoreCase(miName)) { + return tdType; + } + } + // Unknown domain + return UNKNOWN; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEnablement.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEnablement.java new file mode 100644 index 0000000000..a9583e3f29 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEnablement.java @@ -0,0 +1,91 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Jonathan Rajotte - Machine interface support and utility function + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +import java.security.InvalidParameterException; + +/** + * Enumeration for enabled/disabled states. + * + * @author Bernd Hufmann + */ +public enum TraceEnablement { + + // ------------------------------------------------------------------------ + // Enum definition + // ------------------------------------------------------------------------ + /** Tracing is disabled */ + DISABLED("disabled", "false"), //$NON-NLS-1$ //$NON-NLS-2$ + /** Tracing is enabled */ + ENABLED("enabled", "true"); //$NON-NLS-1$ //$NON-NLS-2$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * Name of enum + */ + private final String fInName; + private final String fInMiName; + + // ------------------------------------------------------------------------ + // Constuctors + // ------------------------------------------------------------------------ + + /** + * Private constructor + * + * @param name + * the name of state + */ + private TraceEnablement(String name, String miName) { + fInName = name; + fInMiName = miName; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return state name + */ + public String getInName() { + return fInName; + } + + /** + * @return state name + */ + public String getInMiName() { + return fInMiName; + } + + /** + * @param name + * name of the desired enum + * @return the corresponding {@link TraceEnablement} matching name + */ + public static TraceEnablement valueOfString(String name) { + if (name == null) { + throw new InvalidParameterException(); + } + for (TraceEnablement enablementType : TraceEnablement.values()) { + boolean exist = enablementType.fInName.equalsIgnoreCase(name) || enablementType.fInMiName.equalsIgnoreCase(name); + if (exist) { + return enablementType; + } + } + return DISABLED; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEventType.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEventType.java new file mode 100644 index 0000000000..f77e9201f4 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEventType.java @@ -0,0 +1,65 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +/** + * Trace event type enumeration. + * + * @author Bernd Hufmann + */ +public enum TraceEventType { + /** Event type: tracepoint */ + TRACEPOINT("tracepoint"), //$NON-NLS-1$ + /** Event type: syscall */ + SYSCALL("syscall"), //$NON-NLS-1$ + /** Event type: probe */ + PROBE("probe"), //$NON-NLS-1$ + /** Event type: function */ + FUNCTION("function"), //$NON-NLS-1$ + /** Event type unknown */ + UNKNOWN("unknown"); //$NON-NLS-1$ + + private final String fInName; + + private TraceEventType(String name) { + fInName = name; + } + + /** + * Get the type's name + * + * @return The type's name + */ + public String getInName() { + return fInName; + } + + /** + * Return the corresponding {@link TraceEventType} of string miName + * + * @param name + * name of the {@link TraceEventType} to look for + * @return the corresponding {@link TraceEventType} + */ + public static TraceEventType valueOfString(String name) { + if (name == null) { + throw new IllegalArgumentException(); + } + for (TraceEventType teType : TraceEventType.values()) { + if (teType.getInName().equalsIgnoreCase(name)) { + return teType; + } + } + return UNKNOWN; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceLogLevel.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceLogLevel.java new file mode 100644 index 0000000000..465312d84a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceLogLevel.java @@ -0,0 +1,114 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Jonathan Rajotte - Utility function + *********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + + +/** + * Log Level enumeration. + * + * @author Bernd Hufmann + */ +@SuppressWarnings("nls") +public enum TraceLogLevel { + + // ------------------------------------------------------------------------ + // Enum definition + // ------------------------------------------------------------------------ + /** Log level 0 */ + TRACE_EMERG("TRACE_EMERG"), + /** Log level 1 */ + TRACE_ALERT("TRACE_ALERT"), + /** Log level 2 */ + TRACE_CRIT("TRACE_CRIT"), + /** Log level 3 */ + TRACE_ERR("TRACE_ERR"), + /** Log level 4 */ + TRACE_WARNING("TRACE_WARNING"), + /** Log level 5 */ + TRACE_NOTICE("TRACE_NOTICE"), + /** Log level 6 */ + TRACE_INFO("TRACE_INFO"), + /** Log level 7 */ + TRACE_DEBUG_SYSTEM("TRACE_DEBUG_SYSTEM"), + /** Log level 8 */ + TRACE_DEBUG_PROGRAM("TRACE_DEBUG_PROGRAM"), + /** Log level 9 */ + TRACE_DEBUG_PROCESS("TRACE_DEBUG_PROCESS"), + /** Log level 10 */ + TRACE_DEBUG_MODULE("TRACE_DEBUG_MODULE"), + /** Log level 11 */ + TRACE_DEBUG_UNIT("TRACE_DEBUG_UNIT"), + /** Log level 12 */ + TRACE_DEBUG_FUNCTION("TRACE_DEBUG_FUNCTION"), + /** Log level 13 */ + TRACE_DEBUG_LINE("TRACE_DEBUG_LINE"), + /** Log level 14 */ + TRACE_DEBUG("TRACE_DEBUG"), + /** Log level 15 */ + LEVEL_UNKNOWN("LEVEL_UNKNOWN"); + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * Name of enum. + */ + private final String fInName; + + // ------------------------------------------------------------------------ + // Constuctors + // ------------------------------------------------------------------------ + + /** + * Private constructor + * + * @param name + * the name of state + */ + private TraceLogLevel(String name) { + fInName = name; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return state name + */ + public String getInName() { + return fInName; + } + + // ------------------------------------------------------------------------ + // Utility + // ------------------------------------------------------------------------ + /** + * Return the corresponding {@link TraceLogLevel} to String "name" + * + * @param name + * String to compare to retrieve the good {@link TraceLogLevel} + * @return the corresponding {@link TraceLogLevel} + */ + public static TraceLogLevel valueOfString(String name) { + if (name == null) { + throw new IllegalArgumentException(); + } + for (TraceLogLevel tllevel : TraceLogLevel.values()) { + if (tllevel.getInName().equalsIgnoreCase(name)) { + return tllevel; + } + } + // No match + return LEVEL_UNKNOWN; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceSessionState.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceSessionState.java new file mode 100644 index 0000000000..4473a11d67 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceSessionState.java @@ -0,0 +1,96 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Jonathan Rajotte - machine interface support and utility function + *********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.model; + +/** + * Session state enumeration. + * + * @author Bernd Hufmann + */ +public enum TraceSessionState { + + // ------------------------------------------------------------------------ + // Enum definition + // ------------------------------------------------------------------------ + /** Trace session inactive */ + INACTIVE("inactive", "false"), //$NON-NLS-1$ //$NON-NLS-2$ + /** Trace session active */ + ACTIVE("active", "true"); //$NON-NLS-1$ //$NON-NLS-2$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * Name of enum. + */ + private final String fInName; + private final String fMiName; + + // ------------------------------------------------------------------------ + // Constuctors + // ------------------------------------------------------------------------ + + /** + * Private constructor + * + * @param name + * the name of state + */ + private TraceSessionState(String name, String miName) { + fInName = name; + fMiName = miName; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return state name + */ + public String getInName() { + return fInName; + } + + /** + * @return the machine interface name + */ + public String getfMiName() { + return fMiName; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * Return the corresponding {@link TraceSessionState} to String "name" + * + * @param name + * String to compare to retrieve the good + * {@link TraceSessionState} + * @return the corresponding {@link TraceSessionState} + */ + public static TraceSessionState valueOfString(String name) { + if (name == null) { + return INACTIVE; + } + for (TraceSessionState tst : TraceSessionState.values()) { + boolean isEqual = tst.fInName.equalsIgnoreCase(name) || tst.fMiName.equalsIgnoreCase(name); + if (isEqual) { + return tst; + } + } + // No match + return INACTIVE; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BaseEventInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BaseEventInfo.java new file mode 100644 index 0000000000..217891138c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BaseEventInfo.java @@ -0,0 +1,223 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; + +/** +*

+* Implementation of the basic trace event interface (IEventInfo) to store event +* related data. +*

+* +* @author Bernd Hufmann +*/ +public class BaseEventInfo extends TraceInfo implements IBaseEventInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The trace event type. + */ + private TraceEventType fEventType = TraceEventType.UNKNOWN; + /** + * The trace log level. + */ + private TraceLogLevel fLogLevel = TraceLogLevel.TRACE_DEBUG; + /** + * The Event fields + */ + private final List fFields = new ArrayList<>(); + /** + * The filter expression. + */ + private String fFilterExpression; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - name of base event + */ + public BaseEventInfo(String name) { + super(name); + } + + /** + * Copy constructor + * @param other - the instance to copy + */ + public BaseEventInfo(BaseEventInfo other) { + super(other); + fEventType = other.fEventType; + fLogLevel = other.fLogLevel; + for (Iterator iterator = other.fFields.iterator(); iterator.hasNext();) { + IFieldInfo field = iterator.next(); + if (field instanceof FieldInfo) { + fFields.add(new FieldInfo((FieldInfo)field)); + } else { + fFields.add(field); + } + } + fFilterExpression = other.fFilterExpression; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public TraceEventType getEventType() { + return fEventType; + } + + @Override + public void setEventType(TraceEventType type) { + fEventType = type; + } + + @Override + public void setEventType(String typeName) { + if(TraceEventType.TRACEPOINT.getInName().equalsIgnoreCase(typeName)) { + fEventType = TraceEventType.TRACEPOINT; + } else if(TraceEventType.SYSCALL.getInName().equalsIgnoreCase(typeName)) { + fEventType = TraceEventType.SYSCALL; + } else if (TraceEventType.PROBE.getInName().equalsIgnoreCase(typeName)) { + fEventType = TraceEventType.PROBE; + } else if (TraceEventType.FUNCTION.getInName().equalsIgnoreCase(typeName)) { + fEventType = TraceEventType.FUNCTION; + } else { + fEventType = TraceEventType.UNKNOWN; + } + } + + @Override + public TraceLogLevel getLogLevel() { + return fLogLevel; + } + + @Override + public void setLogLevel(TraceLogLevel level) { + fLogLevel = level; + } + + @Override + public void setLogLevel(String levelName) { + fLogLevel = TraceLogLevel.valueOfString(levelName); + } + + @Override + public IFieldInfo[] getFields() { + return fFields.toArray(new IFieldInfo[fFields.size()]); + } + + @Override + public void addField(IFieldInfo field) { + fFields.add(field); + } + + @Override + public void setFields(List fields) { + fFields.clear(); + for (Iterator iterator = fields.iterator(); iterator.hasNext();) { + IFieldInfo fieldInfo = iterator.next(); + fFields.add(fieldInfo); + } + } + + @Override + public String getFilterExpression() { + return fFilterExpression; + } + + @Override + public void setFilterExpression(String filter) { + fFilterExpression = filter; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((fEventType == null) ? 0 : fEventType.hashCode()); + result = prime * result + fFields.hashCode(); + result = prime * result + ((fFilterExpression == null) ? 0 : fFilterExpression.hashCode()); + result = prime * result + ((fLogLevel == null) ? 0 : fLogLevel.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + BaseEventInfo other = (BaseEventInfo) obj; + if (fEventType != other.fEventType) { + return false; + } + if (!fFields.equals(other.fFields)) { + return false; + } + if (fFilterExpression == null) { + if (other.fFilterExpression != null) { + return false; + } + } else if (!fFilterExpression.equals(other.fFilterExpression)) { + return false; + } + if (fLogLevel != other.fLogLevel) { + return false; + } + return true; + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[BaseEventInfo("); + output.append(super.toString()); + output.append(",type="); + output.append(fEventType); + output.append(",level="); + output.append(fLogLevel); + if (!fFields.isEmpty()) { + output.append(",Fields="); + for (Iterator iterator = fFields.iterator(); iterator.hasNext();) { + IFieldInfo field = iterator.next(); + output.append(field.toString()); + } + } + if (fFilterExpression != null) { + output.append(",Filter="); + output.append(fFilterExpression); + } + output.append(")]"); + return output.toString(); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BufferType.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BufferType.java new file mode 100644 index 0000000000..6f67292274 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BufferType.java @@ -0,0 +1,116 @@ +/********************************************************************** + * 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: + * Simon Delisle - Initial API and implementation + * Bernd Hufmann - Updated to enum definition + * Jonathan Rajotte - Updated enum definition for lttng machine interface + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +/** + * Constants for buffer type. + * + * @author Simon Delisle + * @author Bernd Hufmann + */ + +public enum BufferType { + // ------------------------------------------------------------------------ + // Enum definition + // ------------------------------------------------------------------------ + /** + * Buffer type : per UID + */ + BUFFER_PER_UID("per UID", "PER_UID"), //$NON-NLS-1$ //$NON-NLS-2$ + /** + * Buffer type : per PID + */ + BUFFER_PER_PID("per PID", "PER_PID"), //$NON-NLS-1$ //$NON-NLS-2$ + /** + * Buffer type : shared + */ + BUFFER_SHARED("shared"), //$NON-NLS-1$ + /** + * If the LTTng version doesn't show the buffer type + */ + BUFFER_TYPE_UNKNOWN("information not unavailable"); //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * Name of enum + */ + private final String fInName; + + /** + * Name of the machine interface enum + */ + private final String fInMiName; + + // ------------------------------------------------------------------------ + // Constuctors + // ------------------------------------------------------------------------ + + /** + * Private constructor + * + * @param name + * the name of state + */ + private BufferType(String name, String miName) { + fInName = name; + fInMiName = miName; + } + + private BufferType(String name) { + fInName = name; + fInMiName = ""; //$NON-NLS-1$ + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return state name + */ + public String getInName() { + return fInName; + } + + /** + * @return machine interface buffer name + */ + public String getInMiName() { + return fInMiName; + } + + // / + // ------------------------------------------------------------------------ + // Utility function + // ------------------------------------------------------------------------- + /** + * @param name + * the string representation of the type + * @return enum BufferType of the corresponding type + */ + public static BufferType valueOfString(String name) { + if (name == null) { + throw new IllegalArgumentException(); + } + for (BufferType bufferType : BufferType.values()) { + boolean isEqual = bufferType.getInName().equalsIgnoreCase(name) || bufferType.getInMiName().equalsIgnoreCase(name); + if (isEqual) { + return bufferType; + } + } + return BUFFER_TYPE_UNKNOWN; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ChannelInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ChannelInfo.java new file mode 100644 index 0000000000..6e2f626992 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ChannelInfo.java @@ -0,0 +1,353 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Simon Delisle - Updated for support of LTTng Tools 2.2 + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; + +/** + * Implementation of the trace channel interface (IChannelInfo) to store channel + * related data. + * + * @author Bernd Hufmann + */ +public class ChannelInfo extends TraceInfo implements IChannelInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The overwrite mode of the channel. + */ + private boolean fOverwriteMode; + /** + * The sub-buffer size of the channel. + */ + private long fSubBufferSize; + /** + * The number of sub-buffers of the channel. + */ + private int fNumberOfSubBuffers; + /** + * The switch timer interval of the channel. + */ + private long fSwitchTimer; + /** + * The read timer interval of the channel. + */ + private long fReadTimer; + /** + * The Output type of the channel. + */ + private TraceChannelOutputType fOutputType = TraceChannelOutputType.UNKNOWN; + /** + * The channel enable state. + */ + private TraceEnablement fState = TraceEnablement.DISABLED; + /** + * The events information of the channel. + */ + private final List fEvents = new ArrayList<>(); + /** + * The maximum size of trace files + */ + private int fMaxSizeTraceFiles; + /** + * The maximum number of trace files + */ + private int fMaxNumberTraceFiles; + /** + * The value of buffer type + */ + private BufferType fBufferType = BufferType.BUFFER_TYPE_UNKNOWN; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * + * @param name + * - name channel + */ + public ChannelInfo(String name) { + super(name); + } + + /** + * Copy constructor + * + * @param other + * - the instance to copy + */ + public ChannelInfo(ChannelInfo other) { + super(other); + fOverwriteMode = other.fOverwriteMode; + fSubBufferSize = other.fSubBufferSize; + fNumberOfSubBuffers = other.fNumberOfSubBuffers; + fSwitchTimer = other.fSwitchTimer; + fReadTimer = other.fReadTimer; + fMaxSizeTraceFiles = other.fMaxSizeTraceFiles; + fMaxNumberTraceFiles = other.fMaxNumberTraceFiles; + fBufferType = other.fBufferType; + fOutputType = (other.fOutputType == null ? null : other.fOutputType); + fState = other.fState; + for (Iterator iterator = other.fEvents.iterator(); iterator.hasNext();) { + IEventInfo event = iterator.next(); + if (event instanceof EventInfo) { + fEvents.add(new EventInfo((EventInfo) event)); + } else { + fEvents.add(event); + } + } + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public boolean isOverwriteMode() { + return fOverwriteMode; + } + + @Override + public void setOverwriteMode(boolean mode) { + fOverwriteMode = mode; + } + + @Override + public long getSubBufferSize() { + return fSubBufferSize; + } + + @Override + public void setSubBufferSize(long bufferSize) { + fSubBufferSize = bufferSize; + } + + @Override + public int getNumberOfSubBuffers() { + return fNumberOfSubBuffers; + } + + @Override + public void setNumberOfSubBuffers(int numberOfSubBuffers) { + fNumberOfSubBuffers = numberOfSubBuffers; + } + + @Override + public long getSwitchTimer() { + return fSwitchTimer; + } + + @Override + public void setSwitchTimer(long timer) { + fSwitchTimer = timer; + } + + @Override + public long getReadTimer() { + return fReadTimer; + } + + @Override + public void setReadTimer(long timer) { + fReadTimer = timer; + } + + @Override + public TraceChannelOutputType getOutputType() { + return fOutputType; + } + + @Override + public void setOutputType(String type) { + fOutputType = TraceChannelOutputType.valueOfString(type); + } + + @Override + public void setOutputType(TraceChannelOutputType type) { + fOutputType = type; + } + + @Override + public TraceEnablement getState() { + return fState; + } + + @Override + public void setState(TraceEnablement state) { + fState = state; + } + + @Override + public void setState(String stateName) { + fState = TraceEnablement.valueOfString(stateName); + } + + @Override + public IEventInfo[] getEvents() { + return fEvents.toArray(new IEventInfo[fEvents.size()]); + } + + @Override + public void setEvents(List events) { + fEvents.clear(); + for (Iterator iterator = events.iterator(); iterator.hasNext();) { + IEventInfo eventInfo = iterator.next(); + fEvents.add(eventInfo); + } + } + + @Override + public void addEvent(IEventInfo channel) { + fEvents.add(channel); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + fEvents.hashCode(); + result = prime * result + fNumberOfSubBuffers; + result = prime * result + ((fOutputType == null) ? 0 : fOutputType.hashCode()); + result = prime * result + (fOverwriteMode ? 1231 : 1237); + result = prime * result + (int) (fReadTimer ^ (fReadTimer >>> 32)); + result = prime * result + ((fState == null) ? 0 : (fState.ordinal() + 1)); + result = prime * result + (int) (fSubBufferSize ^ (fSubBufferSize >>> 32)); + result = prime * result + (int) (fSwitchTimer ^ (fSwitchTimer >>> 32)); + result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ChannelInfo other = (ChannelInfo) obj; + if (!fEvents.equals(other.fEvents)) { + return false; + } + if (fNumberOfSubBuffers != other.fNumberOfSubBuffers) { + return false; + } + if (fOutputType == null) { + if (other.fOutputType != null) { + return false; + } + } else if (!fOutputType.equals(other.fOutputType)) { + return false; + } + if (fOverwriteMode != other.fOverwriteMode) { + return false; + } + if (fReadTimer != other.fReadTimer) { + return false; + } + if (fState != other.fState) { + return false; + } + if (fSubBufferSize != other.fSubBufferSize) { + return false; + } + if (fSwitchTimer != other.fSwitchTimer) { + return false; + } + if (fBufferType != other.fBufferType) { + return false; + } + return true; + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[ChannelInfo("); + output.append(super.toString()); + output.append(",State="); + output.append(fState); + output.append(",OverwriteMode="); + output.append(fOverwriteMode); + output.append(",SubBuffersSize="); + output.append(fSubBufferSize); + output.append(",NumberOfSubBuffers="); + output.append(fNumberOfSubBuffers); + output.append(",SwitchTimer="); + output.append(fSwitchTimer); + output.append(",ReadTimer="); + output.append(fReadTimer); + output.append(",output="); + output.append(fOutputType.getInName()); + if ((fBufferType != null) && !fBufferType.equals(BufferType.BUFFER_TYPE_UNKNOWN) && !fBufferType.equals(BufferType.BUFFER_SHARED)) { + output.append(",BufferType="); + output.append(fBufferType); + } + output.append(",Events="); + if (fEvents.isEmpty()) { + output.append("None"); + } else { + for (Iterator iterator = fEvents.iterator(); iterator.hasNext();) { + IEventInfo event = iterator.next(); + output.append(event.toString()); + } + } + output.append(")]"); + return output.toString(); + } + + @Override + public void setMaxSizeTraceFiles(int maxSizeTraceFiles) { + fMaxSizeTraceFiles = maxSizeTraceFiles; + } + + @Override + public void setMaxNumberTraceFiles(int maxNumberTraceFiles) { + fMaxNumberTraceFiles = maxNumberTraceFiles; + } + + @Override + public int getMaxSizeTraceFiles() { + return fMaxSizeTraceFiles; + } + + @Override + public int getMaxNumberTraceFiles() { + return fMaxNumberTraceFiles; + } + + @Override + public void setBufferType(BufferType bufferType) { + fBufferType = bufferType; + } + + @Override + public BufferType getBufferType() { + return fBufferType; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/DomainInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/DomainInfo.java new file mode 100644 index 0000000000..c378e125f0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/DomainInfo.java @@ -0,0 +1,173 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; + +/** + *

+ * Implementation of the trace domain interface (IDomainInfo) to store domain + * related data. + *

+ * + * @author Bernd Hufmann + */ +public class DomainInfo extends TraceInfo implements IDomainInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The channels information of the domain. + */ + private final List fChannels = new ArrayList<>(); + private boolean fIsKernel = false; + private BufferType fBufferType = BufferType.BUFFER_TYPE_UNKNOWN; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - name of domain + */ + public DomainInfo(String name) { + super(name); + } + + /** + * Copy constructor + * @param other - the instance to copy + */ + public DomainInfo(DomainInfo other) { + super(other); + for (int i = 0; i < other.fChannels.size(); i++) { + if (other.fChannels.get(i) instanceof ChannelInfo) { + fChannels.add(new ChannelInfo((ChannelInfo)other.fChannels.get(i))); + } else { + fChannels.add(other.fChannels.get(i)); + } + } + fIsKernel = other.fIsKernel; + fBufferType = other.fBufferType; + } + + @Override + public boolean isKernel() { + return fIsKernel; + } + + @Override + public void setIsKernel(boolean isKernel) { + fIsKernel = isKernel; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public IChannelInfo[] getChannels() { + return fChannels.toArray(new IChannelInfo[fChannels.size()]); + } + + @Override + public void setChannels(List channels) { + fChannels.clear(); + for (Iterator iterator = channels.iterator(); iterator.hasNext();) { + IChannelInfo channelInfo = iterator.next(); + fChannels.add(channelInfo); + } + } + + @Override + public void addChannel(IChannelInfo channel) { + fChannels.add(channel); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + fChannels.hashCode(); + result = prime * result + (fIsKernel ? 1231 : 1237); + result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + DomainInfo other = (DomainInfo) obj; + if (!fChannels.equals(other.fChannels)) { + return false; + } + if (fIsKernel != other.fIsKernel) { + return false; + } + if (fBufferType != other.fBufferType) { + return false; + } + return true; + } + + @Override + public BufferType getBufferType() { + if (fIsKernel) { + return BufferType.BUFFER_SHARED; + } + return fBufferType; + } + + @Override + public void setBufferType(BufferType bufferType) { + fBufferType = bufferType; + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[DomainInfo("); + output.append(super.toString()); + output.append(",Channels="); + if (fChannels.isEmpty()) { + output.append("None"); + } else { + for (Iterator iterator = fChannels.iterator(); iterator.hasNext();) { + IChannelInfo channel = iterator.next(); + output.append(channel.toString()); + } + } + output.append(",isKernel="); + output.append(String.valueOf(fIsKernel)); + if ((fBufferType != null) && !fBufferType.equals(BufferType.BUFFER_TYPE_UNKNOWN) && !fBufferType.equals(BufferType.BUFFER_SHARED)) { + output.append(",BufferType="); + output.append(fBufferType); + } + output.append(")]"); + return output.toString(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/EventInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/EventInfo.java new file mode 100644 index 0000000000..1de851095f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/EventInfo.java @@ -0,0 +1,139 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; + +/** +*

+* Implementation of the trace event interface (IEventInfo) to store event +* related data. +*

+* +* @author Bernd Hufmann +*/ +public class EventInfo extends BaseEventInfo implements IEventInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The enable state of the event. + */ + private TraceEnablement fState = TraceEnablement.DISABLED; + /** + * The log level type. + */ + private LogLevelType fLogLevelType = LogLevelType.LOGLEVEL_NONE; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - name of event + */ + public EventInfo(String name) { + super(name); + } + + /** + * Copy constructor + * @param other - the instance to copy + */ + public EventInfo(EventInfo other) { + super(other); + fState = other.fState; + fLogLevelType = other.fLogLevelType; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public TraceEnablement getState() { + return fState; + } + + @Override + public void setState(TraceEnablement state) { + fState = state; + } + + @Override + public void setState(String stateName) { + fState = TraceEnablement.valueOfString(stateName); + } + + @Override + public LogLevelType getLogLevelType() { + return fLogLevelType; + } + + @Override + public void setLogLevelType(LogLevelType type) { + fLogLevelType = type; + } + + @Override + public void setLogLevelType(String shortName) { + fLogLevelType = LogLevelType.valueOfString(shortName); + } + + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((fState == null) ? 0 : (fState.ordinal() + 1)); + result = prime * result + ((fLogLevelType == null) ? 0 : fLogLevelType.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + EventInfo other = (EventInfo) obj; + if (fState != other.fState) { + return false; + } + if (fLogLevelType != other.fLogLevelType) { + return false; + } + return true; + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[EventInfo("); + output.append(super.toString()); + output.append(",State="); + output.append(fState); + output.append(",levelType="); + output.append(fLogLevelType); + output.append(")]"); + return output.toString(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/FieldInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/FieldInfo.java new file mode 100644 index 0000000000..0ad2ceb42a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/FieldInfo.java @@ -0,0 +1,109 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; + +/** +*

+* Implementation of the basic trace event interface (IEventInfo) to store event +* related data. +*

+* +* @author Bernd Hufmann +*/ +public class FieldInfo extends TraceInfo implements IFieldInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The trace event type. + */ + private String fFieldType; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - name of base event + */ + public FieldInfo(String name) { + super(name); + } + + /** + * Copy constructor + * @param other - the instance to copy + */ + public FieldInfo(FieldInfo other) { + super(other); + fFieldType = other.fFieldType; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public String getFieldType() { + return fFieldType; + } + + @Override + public void setFieldType(String fieldType) { + fFieldType = fieldType.toLowerCase(); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + + ((fFieldType == null) ? 0 : fFieldType.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + FieldInfo other = (FieldInfo) obj; + if (fFieldType == null) { + if (other.fFieldType != null) { + return false; + } + } else if (!fFieldType.equals(other.fFieldType)) { + return false; + } + return true; + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[FieldInfo("); + output.append(super.toString()); + output.append(",type="); + output.append(fFieldType); + return output.toString(); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java new file mode 100644 index 0000000000..69068ee8c9 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java @@ -0,0 +1,187 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; + +/** + * Implementation of the trace event interface (IProbeEventInfo) to store probe + * event related data. + * + * @author Bernd Hufmann + */ +public class ProbeEventInfo extends EventInfo implements IProbeEventInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The dynamic probe address (null if symbol is used). + */ + private String fAddress; + /** + * The dynamic probe offset (if symbol is used). + */ + private String fOffset; + + /** + * The symbol name (null if address is used) + */ + private String fSymbol; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * + * @param name + * - name of event + */ + public ProbeEventInfo(String name) { + super(name); + } + + /** + * Copy constructor + * + * @param other + * - the instance to copy + */ + public ProbeEventInfo(ProbeEventInfo other) { + super(other); + fAddress = other.fAddress; + fOffset = other.fOffset; + fSymbol = other.fSymbol; + } + + /** + * Constructor from a {@link IEventInfo} + * + * @param eventInfo + * - the instance to copy + */ + public ProbeEventInfo(IEventInfo eventInfo) { + super(eventInfo.getName()); + setState(eventInfo.getState()); + setLogLevelType(eventInfo.getLogLevelType()); + setLogLevel(eventInfo.getLogLevel()); + setFilterExpression(eventInfo.getFilterExpression()); + setEventType(eventInfo.getEventType()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public String getAddress() { + return fAddress; + } + + @Override + public void setAddress(String address) { + fAddress = address; + } + + @Override + public String getOffset() { + return fOffset; + } + + @Override + public void setOffset(String offset) { + fOffset = offset; + } + + @Override + public String getSymbol() { + return fSymbol; + } + + @Override + public void setSymbol(String symbol) { + fSymbol = symbol; + } + + // ------------------------------------------------------------------------ + // Operation + // ------------------------------------------------------------------------ + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((fAddress == null) ? 0 : fAddress.hashCode()); + result = prime * result + ((fOffset == null) ? 0 : fOffset.hashCode()); + result = prime * result + ((fSymbol == null) ? 0 : fSymbol.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ProbeEventInfo other = (ProbeEventInfo) obj; + if (fAddress == null) { + if (other.fAddress != null) { + return false; + } + } else if (!fAddress.equals(other.fAddress)) { + return false; + } + if (fOffset == null) { + if (other.fOffset != null) { + return false; + } + } else if (!fOffset.equals(other.fOffset)) { + return false; + } + if (fSymbol == null) { + if (other.fSymbol != null) { + return false; + } + } else if (!fSymbol.equals(other.fSymbol)) { + return false; + } + return true; + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[ProbeEventInfo("); + output.append(super.toString()); + if (fAddress != null) { + output.append(",fAddress="); + output.append(fAddress); + } else { + output.append(",fOffset="); + output.append(fOffset); + output.append(",fSymbol="); + output.append(fSymbol); + } + output.append(")]"); + return output.toString(); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SessionInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SessionInfo.java new file mode 100644 index 0000000000..9f2789357c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SessionInfo.java @@ -0,0 +1,333 @@ +/********************************************************************** + + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + * Marc-Andre Laperle - Support for creating a live session + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; + +/** + * Implementation of the trace session interface (ISessionInfo) to store session + * related data. + * + * @author Bernd Hufmann + */ +public class SessionInfo extends TraceInfo implements ISessionInfo { + + /** + * The default network URL when creating a live session. + */ + public static final String DEFAULT_LIVE_NETWORK_URK = "net://127.0.0.1"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The trace session state. + */ + private TraceSessionState fState = TraceSessionState.INACTIVE; + /** + * The trace session path for storing traces. + */ + private String fSessionPath = ""; //$NON-NLS-1$ + /** + * The domains information of this session. + */ + private final List fDomains = new ArrayList<>(); + /** + * Flag to indicate whether trace is streamed over network or not. + */ + private boolean fIsStreamedTrace = false; + /** + * Flag to indicate whether the session is a snapshot session or not. + */ + private boolean fIsSnapshot = false; + /** + * The snapshot information of the session + */ + private ISnapshotInfo fSnapshotInfo = null; + /** + * The network URL for the session (-U) + */ + private String fNetworkUrl = null; + /** + * The control URL for the session (-C) + */ + private String fControlUrl = null; + /** + * The data URL for the session (-D) + */ + private String fDataUrl = null; + + /** + * Flag to indicate whether trace is live or not. + */ + private boolean fIsLive = false; + + /** + * The delay in micro seconds before the data is flushed and streamed. + */ + private int fLiveDelay = -1; + + /** + * The live connection url (Relayd). + */ + private String fLiveUrl; + + /** + * The live connection port (Relayd). + */ + private Integer fLivePort; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * + * @param name + * - name of base event + */ + public SessionInfo(String name) { + super(name); + } + + /** + * Copy constructor + * + * @param other + * - the instance to copy + */ + public SessionInfo(SessionInfo other) { + super(other); + fState = other.fState; + fSessionPath = other.fSessionPath; + fIsStreamedTrace = other.fIsStreamedTrace; + fIsSnapshot = other.fIsSnapshot; + fSnapshotInfo = other.fSnapshotInfo; + fNetworkUrl = other.fNetworkUrl; + fControlUrl = other.fControlUrl; + fDataUrl = other.fDataUrl; + + for (Iterator iterator = other.fDomains.iterator(); iterator.hasNext();) { + IDomainInfo domain = iterator.next(); + if (domain instanceof DomainInfo) { + fDomains.add(new DomainInfo((DomainInfo) domain)); + } else { + fDomains.add(domain); + } + } + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public TraceSessionState getSessionState() { + return fState; + } + + @Override + public void setSessionState(TraceSessionState state) { + fState = state; + } + + @Override + public void setSessionState(String stateName) { + fState = TraceSessionState.valueOfString(stateName); + } + + @Override + public String getSessionPath() { + if (isSnapshotSession() && fSnapshotInfo != null) { + return fSnapshotInfo.getSnapshotPath(); + } + return fSessionPath; + } + + @Override + public void setSessionPath(String path) { + fSessionPath = path; + } + + @Override + public IDomainInfo[] getDomains() { + return fDomains.toArray(new IDomainInfo[fDomains.size()]); + } + + @Override + public void setDomains(List domains) { + fDomains.clear(); + for (Iterator iterator = domains.iterator(); iterator.hasNext();) { + IDomainInfo domainInfo = iterator.next(); + fDomains.add(domainInfo); + } + } + + @Override + public boolean isStreamedTrace() { + if (isSnapshotSession() && getSnapshotInfo() != null) { + return getSnapshotInfo().isStreamedSnapshot(); + } + return fIsStreamedTrace; + } + + @Override + public void setStreamedTrace(boolean isStreamedTrace) { + fIsStreamedTrace = isStreamedTrace; + } + + @Override + public boolean isSnapshotSession() { + return fIsSnapshot || fSnapshotInfo != null; + } + + @Override + public void setSnapshot(boolean isSnapshot) { + fIsSnapshot = isSnapshot; + } + + @Override + public ISnapshotInfo getSnapshotInfo() { + return fSnapshotInfo; + } + + @Override + public void setSnapshotInfo(ISnapshotInfo info) { + fSnapshotInfo = info; + } + + @Override + public boolean isLive() { + return fIsLive; + } + + @Override + public void setLive(boolean isLive) { + fIsLive = isLive; + } + + @Override + public int getLiveDelay() { + return fLiveDelay; + } + + @Override + public void setLiveDelay(int liveDelay) { + fLiveDelay = liveDelay; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void addDomain(IDomainInfo domainInfo) { + fDomains.add(domainInfo); + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[SessionInfo("); + output.append(super.toString()); + output.append(",Path="); + output.append(getSessionPath()); + output.append(",State="); + output.append(fState); + output.append(",isStreamedTrace="); + output.append(fIsStreamedTrace); + output.append(",isSnapshot="); + output.append(fIsSnapshot); + + if (fSnapshotInfo != null) { + output.append(",snapshotInfo="); + output.append(fSnapshotInfo.toString()); + } + output.append(",Domains="); + for (Iterator iterator = fDomains.iterator(); iterator.hasNext();) { + IDomainInfo domain = iterator.next(); + output.append(domain.toString()); + } + + output.append(",NetworkUrl="); + output.append(getNetworkUrl()); + output.append(",ControlUrl="); + output.append(getControlUrl()); + output.append(",DataUrl="); + output.append(getDataUrl()); + + output.append(")]"); + return output.toString(); + } + + @Override + public String getNetworkUrl() { + return fNetworkUrl; + } + + @Override + public void setNetworkUrl(String networkUrl) { + fNetworkUrl = networkUrl; + } + + @Override + public String getControlUrl() { + return fControlUrl; + } + + @Override + public void setControlUrl(String controlUrl) { + fControlUrl = controlUrl; + } + + @Override + public void setDataUrl(String datalUrl) { + fDataUrl = datalUrl; + } + + @Override + public String getDataUrl() { + return fDataUrl; + } + + @Override + public void setLiveUrl(String liveUrl) { + fLiveUrl = liveUrl; + } + + @Override + public void setLivePort(Integer livePort) { + fLivePort = livePort; + } + + @Override + public String getLiveUrl() { + return fLiveUrl; + } + + @Override + public Integer getLivePort() { + return fLivePort; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SnapshotInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SnapshotInfo.java new file mode 100644 index 0000000000..f7aa791e0e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SnapshotInfo.java @@ -0,0 +1,150 @@ +/********************************************************************** + * Copyright (c) 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; + +/** + *

+ * Implementation of the snapshot interface (ISnapshotInfo) to store snapshot + * related data. + *

+ * + * @author Bernd Hufmann + */ +public class SnapshotInfo extends TraceInfo implements ISnapshotInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** The snapshot path for storing traces. */ + private String fPath = ""; //$NON-NLS-1$ + /** The snapshot ID */ + private int fId = -1; + /** Flag whether snapshot is stored over the network or locally */ + private boolean fIsStreamed = false; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - name of base event + */ + public SnapshotInfo(String name) { + super(name); + } + + /** + * Copy constructor + * @param other - the instance to copy + */ + public SnapshotInfo(SnapshotInfo other) { + super(other); + fPath = other.fPath; + fId = other.fId; + fIsStreamed = other.fIsStreamed; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public String getSnapshotPath() { + return fPath; + } + + @Override + public void setSnapshotPath(String path) { + fPath = path; + } + + @Override + public int getId() { + return fId; + } + + @Override + public void setId(int id) { + fId = id; + } + + @Override + public void setStreamedSnapshot(boolean isStreamed) { + fIsStreamed = isStreamed; + } + + @Override + public boolean isStreamedSnapshot() { + return fIsStreamed; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + fId; + result = prime * result + (fIsStreamed ? 1231 : 1237); + result = prime * result + ((fPath == null) ? 0 : fPath.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + SnapshotInfo other = (SnapshotInfo) obj; + if (fId != other.fId) { + return false; + } + if (fIsStreamed != other.fIsStreamed) { + return false; + } + if (fPath == null) { + if (other.fPath != null) { + return false; + } + } else if (!fPath.equals(other.fPath)) { + return false; + } + return true; + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[SnapshotInfo("); + output.append(super.toString()); + output.append(",snapshotPath="); + output.append(fPath); + output.append(",ID="); + output.append(fId); + output.append(",isStreamedSnapshot="); + output.append(fIsStreamed); + output.append(")]"); + return output.toString(); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/TraceInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/TraceInfo.java new file mode 100644 index 0000000000..65ef13b41b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/TraceInfo.java @@ -0,0 +1,113 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ITraceInfo; + +/** + *

+ * Implementation of the base trace information interface (ITraceInfo) to + * store common data. + *

+ * + * @author Bernd Hufmann + */ +public class TraceInfo implements ITraceInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The name of the element. + */ + private String fName = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - name of trace element + */ + public TraceInfo(String name) { + if (name == null) { + throw new IllegalArgumentException(); + } + fName = name; + } + + /** + * Copy constructor + * @param other - the instance to copy + */ + public TraceInfo(TraceInfo other) { + if (other == null) { + throw new IllegalArgumentException(); + } + fName = String.valueOf(other.fName); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public String getName() { + return fName; + } + + @Override + public void setName(String name) { + fName = name; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((fName == null) ? 0 : fName.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + TraceInfo other = (TraceInfo) obj; + if (fName == null) { + if (other.fName != null) { + return false; + } + } else if (!fName.equals(other.fName)) { + return false; + } + return true; + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[TraceInfo("); + output.append("Name="); + output.append(getName()); + output.append(")]"); + return output.toString(); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/UstProviderInfo.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/UstProviderInfo.java new file mode 100644 index 0000000000..7f33c8a150 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/UstProviderInfo.java @@ -0,0 +1,162 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; + +/** + *

+ * Implementation of the Ust Provider interface (IUstProviderInfo) to store UST + * provider related data. + *

+ * + * @author Bernd Hufmann + */ +public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The process ID of the UST provider. + */ + private int fPid = 0; + + /** + * List of event information. + */ + private final List fEvents = new ArrayList<>(); + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param name - name of UST provider + */ + public UstProviderInfo(String name) { + super(name); + } + + /** + * Copy constructor + * @param other - the instance to copy + */ + public UstProviderInfo(UstProviderInfo other) { + super(other); + fPid = other.fPid; + for (Iterator iterator = other.fEvents.iterator(); iterator.hasNext();) { + IBaseEventInfo event = iterator.next(); + if (event instanceof BaseEventInfo) { + fEvents.add(new BaseEventInfo((BaseEventInfo)event)); + } else { + fEvents.add(event); + } + } + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public int getPid() { + return fPid; + } + + @Override + public void setPid(int pid) { + fPid = pid; + } + + @Override + public IBaseEventInfo[] getEvents() { + return fEvents.toArray(new IBaseEventInfo[fEvents.size()]); + } + + @Override + public void setEvents(List events) { + fEvents.clear(); + for (Iterator iterator = events.iterator(); iterator.hasNext();) { + IBaseEventInfo eventInfo = iterator.next(); + fEvents.add(eventInfo); + } + } + + @Override + public void addEvent(IBaseEventInfo event) { + fEvents.add(event); + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + fEvents.hashCode(); + result = prime * result + fPid; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + UstProviderInfo other = (UstProviderInfo) obj; + if (!fEvents.equals(other.fEvents)) { + return false; + } + if (fPid != other.fPid) { + return false; + } + return true; + } + + @SuppressWarnings("nls") + @Override + public String toString() { + StringBuffer output = new StringBuffer(); + output.append("[EventInfo("); + output.append(super.toString()); + output.append(",PID="); + output.append(fPid); + output.append(",Events="); + if (fEvents.isEmpty()) { + output.append("None"); + } else { + for (Iterator iterator = fEvents.iterator(); iterator.hasNext();) { + IBaseEventInfo event = iterator.next(); + output.append(event.toString()); + } + } + output.append(")]"); + return output.toString(); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/ILttngRelaydConnector.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/ILttngRelaydConnector.java new file mode 100644 index 0000000000..88f376b566 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/ILttngRelaydConnector.java @@ -0,0 +1,119 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd; + +import java.io.IOException; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.TracePacketResponse; + +/** + * Connector for Lttng Relayd + * + * @author Matthew Khouzam + * @since 3.0 + */ +public interface ILttngRelaydConnector extends AutoCloseable { + + /** + * Gets a list of active Lttng sessions + * + * @return the session List (we need the get function) + * @throws IOException + * timeout and such + */ + List getSessions() throws IOException; + + /** + * Create a session + * + * @return create session response + * @throws IOException + * timeout and such + */ + CreateSessionResponse createSession() throws IOException; + + /** + * Attach the trace viewer to a Session + * + * @param lttngViewerSession + * viewer session + * @return An AttachSessionResponse + * @throws IOException + * timeout and such + */ + AttachSessionResponse attachToSession(SessionResponse lttngViewerSession) throws IOException; + + /** + * Get the metadata from the relayd + * + * @param attachedSession + * the attached session + * @return a chunk of TSDL metadata + * @throws IOException + * timeout and such + */ + String getMetadata(AttachSessionResponse attachedSession) throws IOException; + + /** + * Get the next index + * + * @param stream + * the stream + * @return the stream input packet entry + * @throws IOException + * timeout and such + */ + IndexResponse getNextIndex(StreamResponse stream) throws IOException; + + /** + * Get the next packet in a stream + * + * @param stream + * the stream response + * @return the packet response + * @throws IOException + * timeout and such + */ + TracePacketResponse getNextPacket(StreamResponse stream) throws IOException; + + /** + * Gets the packet from the stream + * + * @param index + * the index of the stream + * @param id + * the stream id + * @return the packet response + * @throws IOException + * timeout and such + */ + TracePacketResponse getPacketFromStream(IndexResponse index, long id) throws IOException; + + /** + * Gets the new streams + * + * @return a list of stream responses + * @throws IOException + * timeout and such + */ + Iterable getNewStreams() throws IOException; + + @Override + void close() throws IOException; +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/LttngRelaydConnectorFactory.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/LttngRelaydConnectorFactory.java new file mode 100644 index 0000000000..298d662877 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/LttngRelaydConnectorFactory.java @@ -0,0 +1,78 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.Socket; + +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl.LttngRelaydConnector_2_4; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl.LttngRelaydConnector_Unsupported; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.Command; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ConnectResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ConnectionType; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ViewerCommand; + +/** + * LTTng RelayD connector factory + * + * @author Matthew Khouzam + * @since 3.0 + */ +public final class LttngRelaydConnectorFactory { + + private LttngRelaydConnectorFactory() { + } + + /** + * Create a connection to a relayd + * + * @param myConnection + * a connection to the relayd + * + * @return A relayd connector + * @throws IOException + * caused by invalid sockets + */ + public static ILttngRelaydConnector getNewConnector(Socket myConnection) throws IOException { + DataOutputStream outNet = new DataOutputStream(myConnection.getOutputStream()); + DataInputStream inNet = new DataInputStream(myConnection.getInputStream()); + + ViewerCommand connectCommand = new ViewerCommand(Command.VIEWER_CONNECT, ConnectResponse.SIZE, 0); + + outNet.write(connectCommand.serialize()); + outNet.flush(); + + ConnectResponse payload = new ConnectResponse(0, 2, 4, ConnectionType.VIEWER_CLIENT_COMMAND); + outNet.write(payload.serialize()); + outNet.flush(); + + ConnectResponse connectReply = new ConnectResponse(inNet); + switch (connectReply.getMajor()) { + case 2: + switch (connectReply.getMinor()) { + case 0: + case 1: + case 2: + case 3: + return new LttngRelaydConnector_Unsupported(); + case 4: + default: + return new LttngRelaydConnector_2_4(inNet, outNet); + } + default: + return new LttngRelaydConnector_Unsupported(); + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_2_4.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_2_4.java new file mode 100644 index 0000000000..05435c6eea --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_2_4.java @@ -0,0 +1,181 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation + * Marc-Andre Laperle - Create session and split getNextIndex from getNextPacket + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.List; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.ILttngRelaydConnector; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionRequest; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.Command; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ConnectResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.GetMetadata; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.GetNextIndex; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.GetPacket; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ListSessionsResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.MetadataPacketResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.NewStreamsResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.NextIndexReturnCode; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SeekCommand; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.TracePacketResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.ViewerCommand; + +/** + * Lttng 2.4 implementation + * + * @author Matthew Khouzam + */ +public class LttngRelaydConnector_2_4 implements ILttngRelaydConnector { + + private final @NonNull DataInputStream fInNet; + private final @NonNull DataOutputStream fOutNet; + + /** + * Constructor needs two network streams + * + * @param inNet + * network incoming data + * @param outNet + * network outgoing data + */ + public LttngRelaydConnector_2_4(@NonNull DataInputStream inNet, @NonNull DataOutputStream outNet) { + fInNet = inNet; + fOutNet = outNet; + } + + // ------------------------------------------------------------------------ + // AutoCloseable + // ------------------------------------------------------------------------ + + @Override + public void close() throws IOException { + fInNet.close(); + fOutNet.close(); + } + + // ------------------------------------------------------------------------ + // ILttngRelaydConnector + // ------------------------------------------------------------------------ + + @Override + public List getSessions() throws IOException { + ViewerCommand listSessionsCmd = new ViewerCommand(Command.VIEWER_LIST_SESSIONS, 0,0); + + fOutNet.write(listSessionsCmd.serialize()); + fOutNet.flush(); + + return new ListSessionsResponse(fInNet).getSessionsList(); + } + + @Override + public CreateSessionResponse createSession() throws IOException { + ViewerCommand listSessionsCmd = new ViewerCommand(Command.VIEWER_CREATE_SESSION, 0, 0); + fOutNet.write(listSessionsCmd.serialize()); + fOutNet.flush(); + + return new CreateSessionResponse(fInNet); + } + + @Override + public AttachSessionResponse attachToSession(SessionResponse lttngViewerSession) throws IOException { + ViewerCommand listSessionsCmd = new ViewerCommand(Command.VIEWER_ATTACH_SESSION, 0,0); + fOutNet.write(listSessionsCmd.serialize()); + /* + * only flush if you read after + */ + + AttachSessionRequest attachRequest = new AttachSessionRequest(lttngViewerSession.getId(), SeekCommand.VIEWER_SEEK_BEGINNING); + fOutNet.write(attachRequest.serialize()); + fOutNet.flush(); + + return new AttachSessionResponse(fInNet); + } + + @Override + public String getMetadata(AttachSessionResponse attachedSession) throws IOException { + + for (StreamResponse stream : attachedSession.getStreamList()) { + if (stream.getMetadataFlag() == 1) { + issueCommand(Command.VIEWER_GET_METADATA); + + GetMetadata metadataRequest = new GetMetadata(stream.getId()); + fOutNet.write(metadataRequest.serialize()); + fOutNet.flush(); + + MetadataPacketResponse metaDataPacket = new MetadataPacketResponse(fInNet); + return new String(metaDataPacket.getData()); + } + } + + return null; + } + + @Override + public TracePacketResponse getPacketFromStream(IndexResponse index, long id) throws IOException { + + issueCommand(Command.VIEWER_GET_PACKET); + + GetPacket packetRequest = new GetPacket(id, index.getOffset(), (int) (index.getPacketSize() / 8)); + fOutNet.write(packetRequest.serialize()); + fOutNet.flush(); + + return new TracePacketResponse(fInNet); + } + + @Override + public TracePacketResponse getNextPacket(StreamResponse stream) throws IOException { + IndexResponse indexReply = getNextIndex(stream); + + TracePacketResponse packet = null; + if (indexReply.getStatus() == NextIndexReturnCode.VIEWER_INDEX_OK) { + packet = getPacketFromStream(indexReply, stream.getId()); + } + return packet; + } + + @Override + public IndexResponse getNextIndex(StreamResponse stream) throws IOException { + issueCommand(Command.VIEWER_GET_NEXT_INDEX); + + GetNextIndex indexRequest = new GetNextIndex(stream.getId()); + fOutNet.write(indexRequest.serialize()); + fOutNet.flush(); + + return new IndexResponse(fInNet); + } + + @Override + public List getNewStreams() throws IOException { + + Command viewerGetNewStreams = Command.VIEWER_GET_NEW_STREAMS; + + issueCommand(viewerGetNewStreams); + + return new NewStreamsResponse(fInNet).getStreamList(); + } + + private void issueCommand(Command command) throws IOException { + ViewerCommand connectCommand = new ViewerCommand(command, ConnectResponse.SIZE, 0); + fOutNet.write(connectCommand.serialize()); + fOutNet.flush(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_Unsupported.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_Unsupported.java new file mode 100644 index 0000000000..85ad22a81c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/impl/LttngRelaydConnector_Unsupported.java @@ -0,0 +1,76 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.impl; + +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.ILttngRelaydConnector; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.TracePacketResponse; + +/** + * Unsupported version of the relay daemon + * + * @author Matthew Khouzam + */ +public class LttngRelaydConnector_Unsupported implements ILttngRelaydConnector { + + @Override + public List getSessions() { + throw new UnsupportedOperationException(); + } + + @Override + public AttachSessionResponse attachToSession(SessionResponse lttngViewerSession) { + throw new UnsupportedOperationException(); + } + + @Override + public String getMetadata(AttachSessionResponse attachedSession) { + throw new UnsupportedOperationException(); + } + + @Override + public TracePacketResponse getNextPacket(StreamResponse stream) { + throw new UnsupportedOperationException(); + } + + @Override + public TracePacketResponse getPacketFromStream(IndexResponse index, long id) { + throw new UnsupportedOperationException(); + } + + @Override + public List getNewStreams() { + throw new UnsupportedOperationException(); + } + + @Override + public CreateSessionResponse createSession() { + throw new UnsupportedOperationException(); + } + + @Override + public IndexResponse getNextIndex(StreamResponse stream) { + throw new UnsupportedOperationException(); + } + + @Override + public void close() { + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachReturnCode.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachReturnCode.java new file mode 100644 index 0000000000..4ec77c5ca5 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachReturnCode.java @@ -0,0 +1,47 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Return codes for "viewer attach" command + * + * @author Matthew Khouzam + * @since 3.0 + */ +public enum AttachReturnCode implements IBaseCommand { + + /** If the attach command succeeded. */ + VIEWER_ATTACH_OK(1), + /** If a viewer is already attached. */ + VIEWER_ATTACH_ALREADY(2), + /** If the session ID is unknown. */ + VIEWER_ATTACH_UNK(3), + /** If the session is not live. */ + VIEWER_ATTACH_NOT_LIVE(4), + /** Seek error. */ + VIEWER_ATTACH_SEEK_ERR(5), + /** No session */ + VIEWER_ATTACH_NO_SESSION(6); + + private final int fCode; + + private AttachReturnCode(int c) { + fCode = c; + } + + @Override + public int getCommand() { + return fCode; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionRequest.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionRequest.java new file mode 100644 index 0000000000..4b426090a7 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionRequest.java @@ -0,0 +1,81 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * VIEWER_ATTACH_SESSION payload. + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class AttachSessionRequest implements IRelayCommand { + + /** + * Command size + * + * fSessionId + fOffset + fSeek + */ + public static final int SIZE = (Long.SIZE + Long.SIZE) / 8 + SeekCommand.SIZE; + /** the id of a session */ + private final long fSessionId; + /** unused for now */ + private final long fOffset; + /** enum lttng_viewer_seek */ + private final SeekCommand fSeek; + + /** + * Attach session request constructor + * + * @param id + * the session id + * @param seekCommand + * the seek command + */ + public AttachSessionRequest(long id, SeekCommand seekCommand) { + this(id, 0, seekCommand); + } + + /** + * Attach session request constructor + * + * @param id + * the session id + * @param offset + * unused for now + * @param seekCommand + * the seek command + */ + + public AttachSessionRequest(long id, int offset, SeekCommand seekCommand) { + fSessionId = id; + fOffset = offset; + fSeek = seekCommand; + + } + + @Override + public byte[] serialize() { + byte data[] = new byte[SIZE]; + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + bb.putLong(fSessionId); + bb.putLong(fOffset); + bb.putInt(fSeek.getCommand()); + return data; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionResponse.java new file mode 100644 index 0000000000..2903333d29 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/AttachSessionResponse.java @@ -0,0 +1,95 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.List; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableList.Builder; + +/** + * Attach session response + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class AttachSessionResponse implements IRelayResponse { + + /** + * Response size + * + * fStatus + fStreamsCount (first half of a packet) */ + private static final int SIZE = (Integer.SIZE + Integer.SIZE) / 8; + /** enum lttng_viewer_attach_return_code */ + private final AttachReturnCode fStatus; + /** how many streams are there */ + private final int fStreamsCount; + /** public class lttng_viewer_stream */ + private final List fStreamList; + + /** + * Attach session response network constructor + * + * @param inNet + * network input stream + * @throws IOException + * network error + */ + public AttachSessionResponse(DataInputStream inNet) throws IOException { + byte[] data = new byte[SIZE]; + inNet.readFully(data, 0, SIZE); + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + fStatus = AttachReturnCode.values()[bb.getInt() - 1]; + fStreamsCount = bb.getInt(); + Builder streamResponses = ImmutableList.builder(); + for (int i = 0; i < getNbStreams(); i++) { + streamResponses.add(new StreamResponse(inNet)); + } + fStreamList = streamResponses.build(); + + } + + /** + * Gets the Status + * + * @return the Status + */ + public AttachReturnCode getStatus() { + return fStatus; + } + + /** + * Gets the StreamsCount + * + * @return the StreamsCount + */ + public int getNbStreams() { + return fStreamsCount; + } + + /** + * Gets the StreamList + * + * @return the StreamList + */ + public List getStreamList() { + return fStreamList; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/Command.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/Command.java new file mode 100644 index 0000000000..4478ae6de6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/Command.java @@ -0,0 +1,56 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Viewer commands + * + * @author Matthew Khouzam + * @since 3.0 + */ +public enum Command implements IBaseCommand { + + /** get version */ + VIEWER_CONNECT(1), + /** list all lttng sessions */ + VIEWER_LIST_SESSIONS(2), + /** attach to a session */ + VIEWER_ATTACH_SESSION(3), + /** get the next index */ + VIEWER_GET_NEXT_INDEX(4), + /** get packet */ + VIEWER_GET_PACKET(5), + /** get metadata */ + VIEWER_GET_METADATA(6), + /** get new streams */ + VIEWER_GET_NEW_STREAMS(7), + /** create a new session */ + VIEWER_CREATE_SESSION(8); + + /** + * Command size (fCode) + */ + public static final int SIZE = Integer.SIZE / 8; + + private final int fCode; + + private Command(int c) { + fCode = c; + } + + @Override + public int getCommand() { + return fCode; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectResponse.java new file mode 100644 index 0000000000..e2579e1f2c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectResponse.java @@ -0,0 +1,119 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * CONNECT payload. + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class ConnectResponse implements IRelayResponse, IRelayCommand { + + /** + * Response or command size + * + * fViewerSessionId + fMajor + fMinor + fType + */ + public static final int SIZE = (Long.SIZE + Integer.SIZE + Integer.SIZE + Integer.SIZE) / 8; + /** session id, counts from 1 and increments by session */ + private final long fViewerSessionId; + /** + * Major version, hint, it's at least 2 + */ + private final int fMajor; + /** + * Minor version, hint, it's at least 4 + */ + private final int fMinor; + /** + * type of connect to {@link ConnectionType} + */ + private final ConnectionType fType; + + /** + * Connection response reply constructor + * + * @param inStream + * the data input stream + * @throws IOException + * a network error + */ + public ConnectResponse(DataInputStream inStream) throws IOException { + byte data[] = new byte[SIZE]; + inStream.readFully(data); + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + fViewerSessionId = bb.getLong(); + fMajor = bb.getInt(); + fMinor = bb.getInt(); + bb.getInt(); // Should not be used, see http://bugs.lttng.org/issues/728 + fType = ConnectionType.VIEWER_CLIENT_COMMAND; + } + + /** + * Constructor for command + * + * @param sessionID + * session id + * @param major + * the major version + * @param minor + * the minor version + * @param connection + * the connection type, typically VIEWER_CLIENT_COMMAND + */ + public ConnectResponse(long sessionID, int major, int minor, ConnectionType connection) { + fViewerSessionId = sessionID; + fMajor = major; + fMinor = minor; + fType = connection; + } + + /** + * get the major version + * + * @return the major version + */ + public int getMajor() { + return fMajor; + } + + /** + * get the minor version + * + * @return the minor version + */ + public int getMinor() { + return fMinor; + } + + @Override + public byte[] serialize() { + byte data[] = new byte[SIZE]; + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + bb.putLong(fViewerSessionId); + bb.putInt(fMajor); + bb.putInt(fMinor); + bb.putInt(fType.getCommand()); + return data; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectionType.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectionType.java new file mode 100644 index 0000000000..0b650741a6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ConnectionType.java @@ -0,0 +1,40 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Get viewer connection type + * + * @author Matthew Khouzam + * @since 3.0 + */ +public enum ConnectionType implements IBaseCommand { + + /** Command sent */ + VIEWER_CLIENT_COMMAND(1), + /** Notification sent */ + VIEWER_CLIENT_NOTIFICATION(2); + + private final int fCode; + + private ConnectionType(int c) { + fCode = c; + } + + @Override + public int getCommand() { + return fCode; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionResponse.java new file mode 100644 index 0000000000..97200f34b5 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionResponse.java @@ -0,0 +1,62 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * Response to a "create session" command + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class CreateSessionResponse implements IRelayResponse { + + /** + * Response size (fStatus) + */ + public static final int SIZE = Integer.SIZE / 8; + + /** enum lttng_viewer_create_session_return_code */ + private final CreateSessionReturnCode fStatus; + + /** + * Create session response network constructor + * + * @param inNet + * network input stream + * @throws IOException + * network error + */ + public CreateSessionResponse(DataInputStream inNet) throws IOException { + byte[] data = new byte[SIZE]; + inNet.readFully(data); + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + fStatus = (CreateSessionReturnCode.values()[bb.getInt() - 1]); + } + + /** + * Get status + * + * @return the status + */ + public CreateSessionReturnCode getStatus() { + return fStatus; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionReturnCode.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionReturnCode.java new file mode 100644 index 0000000000..6c3f6b4d9b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/CreateSessionReturnCode.java @@ -0,0 +1,39 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Create new session return code + * + * @author Matthew Khouzam + * @since 3.0 + */ +public enum CreateSessionReturnCode implements IBaseCommand { + + /** If new streams are being sent. */ + LTTNG_VIEWER_CREATE_SESSION_OK(1), + /** Fatal error on the server-side. */ + LTTNG_VIEWER_CREATE_SESSION_ERR(2); + + private final int fCode; + + private CreateSessionReturnCode(int c) { + fCode = c; + } + + @Override + public int getCommand() { + return fCode; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadata.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadata.java new file mode 100644 index 0000000000..54ee517b09 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadata.java @@ -0,0 +1,65 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * VIEWER_GET_METADATA payload. + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class GetMetadata implements IRelayCommand { + + /** + * Command size (fStreamId) + */ + public static final int SIZE = Long.SIZE / 8; + + /** + * The stream id + */ + private final long fStreamId; + + /** + * Set the stream id + * + * @param streamId + * the stream id + */ + public GetMetadata(long streamId) { + fStreamId = streamId; + } + + /** + * Get the stream id + * + * @return the stream id + */ + public long getStreamId() { + return fStreamId; + } + + @Override + public byte[] serialize() { + byte data[] = new byte[SIZE]; + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + bb.putLong(getStreamId()); + return data; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadataReturnCode.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadataReturnCode.java new file mode 100644 index 0000000000..0df4b60316 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetMetadataReturnCode.java @@ -0,0 +1,42 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Get metadata return code + * + * @author Matthew Khouzam + * @since 3.0 + */ +public enum GetMetadataReturnCode implements IBaseCommand { + + /** Response was OK */ + VIEWER_METADATA_OK(1), + /** Response was nothing new */ + VIEWER_NO_NEW_METADATA(2), + /** Response was Error */ + VIEWER_METADATA_ERR(3); + + private final int fCode; + + private GetMetadataReturnCode(int c) { + fCode = c; + } + + @Override + public int getCommand() { + return fCode; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetNextIndex.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetNextIndex.java new file mode 100644 index 0000000000..6a4e2fd1a3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetNextIndex.java @@ -0,0 +1,64 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * VIEWER_GET_NEXT_INDEX payload. + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class GetNextIndex implements IRelayCommand { + + /** + * Command size (fStreamId) + */ + public static final int SIZE = Long.SIZE / 8; + /** + * the id of the stream + */ + private final long fStreamId; + + /** + * Constructor + * + * @param streamId + * the index stream id + */ + public GetNextIndex(long streamId) { + fStreamId = streamId; + } + + /** + * Gets the stream id + * + * @return the stream id + */ + public long getStreamId() { + return fStreamId; + } + + @Override + public byte[] serialize() { + byte data[] = new byte[SIZE]; + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + bb.putLong(getStreamId()); + return data; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacket.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacket.java new file mode 100644 index 0000000000..172ca30a5b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacket.java @@ -0,0 +1,94 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * VIEWER_GET_PACKET payload. + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class GetPacket implements IRelayCommand { + + /** + * Command size + * + * fStreamId + fOffset + fLength + */ + public static final int SIZE = (Long.SIZE + Long.SIZE + Integer.SIZE) / 8; + /** the stream Id */ + private final long fStreamId; + /** the offset */ + private final long fOffset; + /** the length of the packet */ + private final int fLength; + + /** + * Get packet constructor + * + * @param streamId + * the stream id + * @param offset + * the offset + * @param length + * the packet length + */ + public GetPacket(long streamId, long offset, int length) { + fStreamId = streamId; + fOffset = offset; + fLength = length; + } + + /** + * Get the length of the packet + * + * @return the length of the packet in bytes + */ + public int getLength() { + return fLength; + } + + /** + * Gets the offset of the packet + * + * @return the offset + */ + public long getOffset() { + return fOffset; + } + + /** + * Gets the stream id + * + * @return the stream id + */ + public long getStreamId() { + return fStreamId; + } + + @Override + public byte[] serialize() { + byte data[] = new byte[SIZE]; + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + bb.putLong(getStreamId()); + bb.putLong(getOffset()); + bb.putInt(getLength()); + return data; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacketReturnCode.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacketReturnCode.java new file mode 100644 index 0000000000..b5fab2b21a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/GetPacketReturnCode.java @@ -0,0 +1,44 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Get packet return code + * + * @author Matthew Khouzam + * @since 3.0 + */ +public enum GetPacketReturnCode implements IBaseCommand { + + /** Response was OK */ + VIEWER_GET_PACKET_OK(1), + /** Response was RETRY */ + VIEWER_GET_PACKET_RETRY(2), + /** Response was ERROR */ + VIEWER_GET_PACKET_ERR(3), + /** Response was End of File */ + VIEWER_GET_PACKET_EOF(4); + + private final int fCode; + + private GetPacketReturnCode(int c) { + fCode = c; + } + + @Override + public int getCommand() { + return fCode; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IBaseCommand.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IBaseCommand.java new file mode 100644 index 0000000000..905cfa8f6b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IBaseCommand.java @@ -0,0 +1,30 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Instruction to send to relayd + * + * @author Matthew Khouzam + * @since 3.0 + */ +public interface IBaseCommand { + + /** + * gets the numerical value of the command + * + * @return the numerical value of the command + */ + int getCommand(); +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayCommand.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayCommand.java new file mode 100644 index 0000000000..2a47c05061 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayCommand.java @@ -0,0 +1,31 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + + +/** + * Command sent, needs a getBytes to stream the data + * + * @author Matthew Khouzam + * @since 3.0 + */ +public interface IRelayCommand { + + /** + * Gets a byte array of the command so that it may be streamed + * + * @return the byte array of the command + */ + byte[] serialize(); +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayResponse.java new file mode 100644 index 0000000000..153349d362 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IRelayResponse.java @@ -0,0 +1,24 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Command response, this will allow sorting commands easier + * + * @author Matthew Khouzam + * @since 3.0 + */ +public interface IRelayResponse { + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IndexResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IndexResponse.java new file mode 100644 index 0000000000..503ef279c2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/IndexResponse.java @@ -0,0 +1,163 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * An Lttng packet index + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class IndexResponse implements IRelayResponse { + + /** + * Command size + * + * Sum of the field sizes / 8 ( 7 longs and 2 ints): + * fOffset + fPacketSize + fContentSize + fTimestampBegin + fTimestampEnd + + * fEventsDiscarded + fStreamId + fStatus + fFlags + */ + public final static int SIZE = + (Long.SIZE * 7 + Integer.SIZE * 2) / 8; + + /** the offset */ + private final long fOffset; + /** packet_size */ + private final long fPacketSize; + /** the content size - how much of the packet is used */ + private final long fContentSize; + /** timestamp of the beginning of the packet */ + private final long fTimestampBegin; + /** timestamp of the end of the packet */ + private final long fTimestampEnd; + /** number of discarded events BEFORE this packet */ + private final long fEventsDiscarded; + /** the CTF stream id */ + private final long fStreamId; + /** the status of the getNextIndex request */ + private final NextIndexReturnCode fStatus; + /** whether there are new streams or metadata */ + private final int fFlags; + + /** + * IndexResposne from network + * + * @param inNet + * data input stream + * @throws IOException + * network error + */ + public IndexResponse(DataInputStream inNet) throws IOException { + byte[] data = new byte[SIZE]; + inNet.readFully(data); + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + fOffset = bb.getLong(); + fPacketSize = bb.getLong(); + fContentSize = bb.getLong(); + fTimestampBegin = bb.getLong(); + fTimestampEnd = bb.getLong(); + fEventsDiscarded = bb.getLong(); + fStreamId = bb.getLong(); + fStatus = NextIndexReturnCode.values()[bb.getInt() - 1]; + fFlags = bb.getInt(); + } + + /** + * Gets the offset + * + * @return the offset + */ + public long getOffset() { + return fOffset; + } + + /** + * Gets the packet size + * + * @return the packet size + */ + public long getPacketSize() { + return fPacketSize; + } + + /** + * Gets the content size - how much of the packet is used + * + * @return the content size + */ + public long getContentSize() { + return fContentSize; + } + + /** + * Gets the timestamp of the beginning of the packet + * + * @return the timestamp of the beginning of the packet + */ + public long getTimestampBegin() { + return fTimestampBegin; + } + + /** + * Gets the timestamp of the end of the packet + * + * @return the timestamp of the end of the packet + */ + public long getTimestampEnd() { + return fTimestampEnd; + } + + /** + * Gets the number of discarded events BEFORE this packet + * + * @return the number of discarded events BEFORE this packet + */ + public long getEventsDiscarded() { + return fEventsDiscarded; + } + + /** + * Gets the CTF stream id + * + * @return the CTF stream id + */ + public long getStreamId() { + return fStreamId; + } + + /** + * Gets the status + * + * @return the status + */ + public NextIndexReturnCode getStatus() { + return fStatus; + } + + /** + * Gets the flags that describe whether there are new streams or metadata + * + * @return the flags + */ + public int getFlags() { + return fFlags; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ListSessionsResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ListSessionsResponse.java new file mode 100644 index 0000000000..5a520912ce --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ListSessionsResponse.java @@ -0,0 +1,72 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.List; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableList.Builder; + +/** + * VIEWER_LIST_SESSIONS payload. + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class ListSessionsResponse implements IRelayResponse { + + /** + * Response size (nbSessions) + */ + public static final int PACKET_FIXED_SIZE = Integer.SIZE / 8; + + /** the list of sessions */ + private final List fSessionList; + + /** + * List Sessions response from network + * + * @param inNet + * the network stream + * @throws IOException + * network error + */ + public ListSessionsResponse(DataInputStream inNet) throws IOException { + byte[] data = new byte[PACKET_FIXED_SIZE]; + inNet.readFully(data); + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + int nbSessions = bb.getInt(); + Builder sl = new ImmutableList.Builder<>(); + for (int session = 0; session < nbSessions; session++) { + sl.add(new SessionResponse(inNet)); + } + fSessionList = sl.build(); + } + + /** + * Gets the session list + * + * @return the sessions list + */ + public List getSessionsList() { + return fSessionList; + } + + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/LttngViewerCommands.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/LttngViewerCommands.java new file mode 100644 index 0000000000..45b246c9a9 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/LttngViewerCommands.java @@ -0,0 +1,37 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * LTTng Relay Daemon API. needs a TCP connection, API is defined from + * BSD-licensed implementation in Lttng tools: src/bin/lttng-relayd/lttng-viewer-abi.h + * + * @author Matthew Khouzam + * @since 3.0 + */ +public interface LttngViewerCommands { + + /** Maximum path name length */ + static final int LTTNG_VIEWER_PATH_MAX = 4096; + /** Maximum name length */ + static final int LTTNG_VIEWER_NAME_MAX = 255; + /** Maximum host name length */ + static final int LTTNG_VIEWER_HOST_NAME_MAX = 64; + /** New stream in the trace */ + static final int NEW_STREAM = (1 << 1); + /** New metadata in the trace */ + static final int NEW_METADATA = (1 << 0); + +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/MetadataPacketResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/MetadataPacketResponse.java new file mode 100644 index 0000000000..97345def93 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/MetadataPacketResponse.java @@ -0,0 +1,79 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * Metadata packet response containing a packet of metadata + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class MetadataPacketResponse implements IRelayResponse { + + /** + * Response size + * + * fData.length + fStatus + */ + private static final int SIZE = (Long.SIZE + Integer.SIZE) / 8; + /** status of the metadata request */ + private final GetMetadataReturnCode fStatus; + /** the packet */ + private final byte fData[]; + + /** + * Read new metadata packet from the network + * + * @param inNet + * network input reader + * @throws IOException + * network error + */ + public MetadataPacketResponse(DataInputStream inNet) throws IOException { + byte[] data = new byte[SIZE]; + inNet.readFully(data); + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + long length = bb.getLong(); + fStatus = GetMetadataReturnCode.values()[bb.getInt() - 1]; + if (length >= Integer.MAX_VALUE) { + throw new IOException("Metadata Packet too big " + length); //$NON-NLS-1$ + } + fData = new byte[(int) length]; + inNet.readFully(fData); + } + + /** + * Get the packet + * + * @return the packet + */ + public byte[] getData() { + return fData; + } + + /** + * Gets the status + * + * @return the status + */ + public GetMetadataReturnCode getStatus() { + return fStatus; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsRequest.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsRequest.java new file mode 100644 index 0000000000..e33691e05f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsRequest.java @@ -0,0 +1,53 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * LTTNG_VIEWER_GET_NEW_STREAMS payload. + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class NewStreamsRequest implements IRelayCommand { + + /** + * Command size (fSessionId) + */ + public static final int SIZE = Long.SIZE / 8; + + /** session ID */ + private final long fSessionId; + + /** + * Constructor + * + * @param sessionId + * the session id we want + */ + public NewStreamsRequest(long sessionId) { + fSessionId = sessionId; + } + + @Override + public byte[] serialize() { + byte data[] = new byte[SIZE]; + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + bb.putLong(fSessionId); + return data; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsResponse.java new file mode 100644 index 0000000000..f107c1f51b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsResponse.java @@ -0,0 +1,96 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.List; + +import com.google.common.collect.ImmutableList; + +/** + * Response to a "new streams" command + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class NewStreamsResponse implements IRelayResponse { + + /** + * Response size + * + * fStatus + fNbStreams + */ + private static final int SIZE = (Integer.SIZE + Integer.SIZE) / 8; + /** status of the request */ + private final NewStreamsReturnCode fStatus; + /** the number of streams */ + private final int fNbStreams; + /** the list of streams in the response */ + private final List fStreamList; + + /** + * New stream response network constructor + * + * @param inNet + * network stream + * @throws IOException + * network error + */ + public NewStreamsResponse(DataInputStream inNet) throws IOException { + byte[] data = new byte[SIZE]; + inNet.readFully(data); + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + fStatus = NewStreamsReturnCode.values()[bb.getInt() - 1]; + fNbStreams = bb.getInt(); + ImmutableList.Builder sl = new ImmutableList.Builder<>(); + if (getStatus().equals(NewStreamsReturnCode.LTTNG_VIEWER_NEW_STREAMS_OK)) { + for (int stream = 0; stream < fNbStreams; stream++) { + sl.add(new StreamResponse(inNet)); + } + } + fStreamList = sl.build(); + } + + /** + * Gets the status + * + * @return the status + */ + public NewStreamsReturnCode getStatus() { + return fStatus; + } + + /** + * gets the stream list + * + * @return the stream list + */ + public List getStreamList() { + return fStreamList; + } + + /** + * The number of streams + * + * @return the number of streams + */ + public int getNbStreams() { + return fNbStreams; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsReturnCode.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsReturnCode.java new file mode 100644 index 0000000000..7bb534c987 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NewStreamsReturnCode.java @@ -0,0 +1,43 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Return codes for "new streams" command + * + * @author Matthew Khouzam + * @since 3.0 + */ +public enum NewStreamsReturnCode implements IBaseCommand { + + /** If new streams are being sent. */ + LTTNG_VIEWER_NEW_STREAMS_OK(1), + /** If no new streams are available. */ + LTTNG_VIEWER_NEW_STREAMS_NO_NEW(2), + /** Error. */ + LTTNG_VIEWER_NEW_STREAMS_ERR(3), + /** Session closed. */ + LTTNG_VIEWER_NEW_STREAMS_HUP(4); + + private final int fCode; + + private NewStreamsReturnCode(int c) { + fCode = c; + } + + @Override + public int getCommand() { + return fCode; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NextIndexReturnCode.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NextIndexReturnCode.java new file mode 100644 index 0000000000..6345ac5436 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/NextIndexReturnCode.java @@ -0,0 +1,47 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Get next index return code (hope it's viewer_index_ok) + * + * @author Matthew Khouzam + * @since 3.0 + */ +public enum NextIndexReturnCode implements IBaseCommand { + + /** Index is available. */ + VIEWER_INDEX_OK(1), + /** Index not yet available. */ + VIEWER_INDEX_RETRY(2), + /** Index closed (trace destroyed). */ + VIEWER_INDEX_HUP(3), + /** Unknown error. */ + VIEWER_INDEX_ERR(4), + /** Inactive stream beacon. */ + VIEWER_INDEX_INACTIVE(5), + /** End of index file. */ + VIEWER_INDEX_EOF(6); + + private final int fCode; + + private NextIndexReturnCode(int c) { + fCode = c; + } + + @Override + public int getCommand() { + return fCode; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SeekCommand.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SeekCommand.java new file mode 100644 index 0000000000..8e90cf40b8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SeekCommand.java @@ -0,0 +1,44 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +/** + * Seek command + * + * @author Matthew Khouzam + * @since 3.0 + */ +public enum SeekCommand implements IBaseCommand { + + /** Receive the trace packets from the beginning. */ + VIEWER_SEEK_BEGINNING(1), + /** Receive the trace packets from now. */ + VIEWER_SEEK_LAST(2); + + private final int fCode; + + /** + * Command size (fCode) + */ + public static final int SIZE = Integer.SIZE / 8; + + private SeekCommand(int c) { + fCode = c; + } + + @Override + public int getCommand() { + return fCode; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SessionResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SessionResponse.java new file mode 100644 index 0000000000..e91bbe3767 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/SessionResponse.java @@ -0,0 +1,128 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * Get viewer session response to command + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class SessionResponse implements IRelayResponse { + + /** + * Response size + * + * fHostname + fSessionName + fId + fLiveTimer + fClients + fStreams + */ + public static final int SIZE = + LttngViewerCommands.LTTNG_VIEWER_HOST_NAME_MAX + LttngViewerCommands.LTTNG_VIEWER_NAME_MAX + (Long.SIZE + Integer.SIZE + Integer.SIZE + Integer.SIZE) / 8; + /** id of the session */ + private final long fId; + /** live timer */ + private final int fLiveTimer; + /** number of clients */ + private final int fClients; + /** number streams */ + private final int fStreams; + /** Hostname, like 'localhost' */ + private final String fHostname; + /** Session name, like 'streaming session' */ + private final String fSessionName; + + /** + * Session response network constructor + * + * @param inNet + * input network stream + * @throws IOException + * network error + */ + public SessionResponse(DataInputStream inNet) throws IOException { + byte[] data = new byte[SIZE]; + inNet.readFully(data); + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + fId = bb.getLong(); + fLiveTimer = bb.getInt(); + fClients = bb.getInt(); + fStreams = bb.getInt(); + byte[] hostName = new byte[LttngViewerCommands.LTTNG_VIEWER_HOST_NAME_MAX]; + byte[] sessionName = new byte[LttngViewerCommands.LTTNG_VIEWER_NAME_MAX]; + bb.get(hostName, 0, hostName.length); + bb.get(sessionName, 0, sessionName.length); + fHostname = new String(hostName); + fSessionName = new String(sessionName); + } + + /** + * Gets the id of the session + * + * @return the id of the session + */ + public long getId() { + return fId; + } + + /** + * Gets the live timer + * + * @return the live timer + */ + public int getLiveTimer() { + return fLiveTimer; + } + + /** + * Gets the number of clients + * + * @return the number of clients + */ + public int getClients() { + return fClients; + } + + /** + * Gets the number streams + * + * @return the number streams + */ + public int getStreams() { + return fStreams; + } + + /** + * Gets the Hostname + * + * @return the Hostname + */ + public String getHostname() { + return fHostname; + } + + /** + * Gets the session name + * + * @return the session name + */ + public String getSessionName() { + return fSessionName; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/StreamResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/StreamResponse.java new file mode 100644 index 0000000000..d19303cc1a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/StreamResponse.java @@ -0,0 +1,127 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * Get response of viewer stream + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class StreamResponse implements IRelayResponse { + + /** + * Response size + * + * fId + fCtfTraceId + fMetadataFlag + fPathName + fChannelName + */ + public static final int SIZE = (Long.SIZE + Long.SIZE + Integer.SIZE) / 8 + LttngViewerCommands.LTTNG_VIEWER_PATH_MAX + LttngViewerCommands.LTTNG_VIEWER_NAME_MAX; + + /** + * id of the stream + */ + private final long fId; + /** + * It is guaranteed to be unique, because the value is assigned sequentially + * by the relay. + */ + private final long fCtfTraceId; + /** + * if the stream is a metadata stream + */ + private final int fMetadataFlag; + /** + * the path + */ + private final String fPathName; + /** + * The channel, traditionally channel0 + */ + private final String fChannelName; + + /** + * Stream response + * + * @param inNet + * input data stream + * @throws IOException + * network time + */ + public StreamResponse(DataInputStream inNet) throws IOException { + byte[] streamData = new byte[SIZE]; + inNet.readFully(streamData, 0, SIZE); + ByteBuffer bb = ByteBuffer.wrap(streamData); + bb.order(ByteOrder.BIG_ENDIAN); + fId = (bb.getLong()); + fCtfTraceId = bb.getLong(); + fMetadataFlag = bb.getInt(); + byte pathName[] = new byte[LttngViewerCommands.LTTNG_VIEWER_PATH_MAX]; + byte channelName[] = new byte[LttngViewerCommands.LTTNG_VIEWER_NAME_MAX]; + bb.get(pathName, 0, LttngViewerCommands.LTTNG_VIEWER_PATH_MAX); + bb.get(channelName, 0, LttngViewerCommands.LTTNG_VIEWER_NAME_MAX); + fPathName = new String(pathName); + fChannelName = new String(channelName); + } + + /** + * Get the id + * + * @return the Id + */ + public long getId() { + return fId; + } + + /** + * Get the CtfTraceId + * + * @return the CtfTraceId + */ + public long getCtfTraceId() { + return fCtfTraceId; + } + + /** + * Get the metadata flag + * + * @return the MetadataFlag + */ + public int getMetadataFlag() { + return fMetadataFlag; + } + + /** + * Get the path name + * + * @return the PathName + */ + public String getPathName() { + return fPathName; + } + + /** + * get the Channel name + * + * @return the ChannelName + */ + public String getChannelName() { + return fChannelName; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/TracePacketResponse.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/TracePacketResponse.java new file mode 100644 index 0000000000..719bb27b8f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/TracePacketResponse.java @@ -0,0 +1,93 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * Response to getpacket command + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class TracePacketResponse implements IRelayResponse { + + /** + * Command size + * + * fStatus + fData.length + fFlags + */ + private static final int SIZE = (Integer.SIZE + Integer.SIZE + Integer.SIZE) / 8; + /** Enum lttng_viewer_get_packet_return_code */ + private final GetPacketReturnCode fStatus; + /** flags: is there new metadata or new streams? */ + private final int fFlags; + /** the packet */ + private final byte[] fData; + + /** + * Trace packet response network constructor + * + * @param inNet + * network input stream + * @throws IOException + * network error + */ + public TracePacketResponse(DataInputStream inNet) throws IOException { + byte[] data = new byte[SIZE]; + inNet.readFully(data); + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + fStatus = GetPacketReturnCode.values()[bb.getInt() - 1]; + int length = bb.getInt(); + fFlags = bb.getInt(); + if (fStatus.equals(GetPacketReturnCode.VIEWER_GET_PACKET_OK)) { + fData = new byte[length]; + inNet.readFully(fData); + } else { + fData = new byte[0]; + } + } + + /** + * Get the status + * + * @return the Status + */ + public GetPacketReturnCode getStatus() { + return fStatus; + } + + /** + * Get the flags + * + * @return the Flags + */ + public int getFlags() { + return fFlags; + } + + /** + * Get the packet data, please do not modify the data + * + * @return the Data + */ + public byte[] getData() { + return fData; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ViewerCommand.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ViewerCommand.java new file mode 100644 index 0000000000..c8c4f8d89a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/relayd/lttngviewerCommands/ViewerCommand.java @@ -0,0 +1,96 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation and API + * Marc-Andre Laperle - Initial implementation and API + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * The LTTng command + * + * @author Matthew Khouzam + * @since 3.0 + */ +public class ViewerCommand implements IRelayCommand { + + /** + * Command size + * + * fDataSize + fCmdVersion + fCmd + */ + public static final int SIZE = (Long.SIZE + Integer.SIZE) / 8 + Command.SIZE; + /** + * data size following this header, you normally attach a payload that one, + * in bytes + */ + private final long fDataSize; + /** enum lttcomm_relayd_command */ + private final Command fCmd; + /** command version */ + private final int fCmdVersion; + + /** + * Sets the packet command + * + * @param viewerConnect + * the command + * @param size size of the command + * @param version the version number + */ + public ViewerCommand(Command viewerConnect, long size, int version) { + fCmd = viewerConnect; + fDataSize = size; + fCmdVersion = version; + } + + /** + * Get the data size + * + * @return the DataSize + */ + public long getDataSize() { + return fDataSize; + } + + /** + * Get the command + * + * @return the Cmd + */ + public Command getCmd() { + return fCmd; + } + + /** + * Get the command version + * + * @return the CmdVersion + */ + public int getCmdVersion() { + return fCmdVersion; + } + + @Override + public byte[] serialize() { + byte data[] = new byte[SIZE]; + ByteBuffer bb = ByteBuffer.wrap(data); + bb.order(ByteOrder.BIG_ENDIAN); + bb.putLong(getDataSize()); + bb.putInt(getCmd().getCommand()); + bb.putInt(fCmdVersion); + return data; + } + + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/Messages.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/Messages.java new file mode 100644 index 0000000000..2c8bac841a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/Messages.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * 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: + * Guilliano Molaire - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.core.session; + +import org.eclipse.osgi.util.NLS; + +/** + * Externalized message strings from the lttng2.core.control.session + * + * @author Guilliano Molaire + * @since 3.0 + */ +@SuppressWarnings("javadoc") +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng2.control.core.session.messages"; //$NON-NLS-1$ + + public static String SessionConfigXML_BadRequirementType; + public static String SessionConfigXML_DomainTypeMissing; + public static String SessionConfigXML_EventTypeMissing; + public static String SessionConfigXML_InvalidSessionInfoList; + public static String SessionConfigXML_InvalidTraceSessionPath; + public static String SessionConfigXML_UnknownEventType; + public static String SessionConfigXML_UnknownDomainBufferType; + public static String SessionConfigXML_SessionConfigGenerationError; + public static String SessionConfigXML_XmlParseError; + public static String SessionConfigXML_XmlValidateError; + public static String SessionConfigXML_XmlValidationError; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigGenerator.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigGenerator.java new file mode 100644 index 0000000000..dcb59bc7f1 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigGenerator.java @@ -0,0 +1,539 @@ +/********************************************************************** + * 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: + * Guilliano Molaire - Initial API and implementation + *********************************************************************/ +package org.eclipse.linuxtools.lttng2.control.core.session; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Set; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.linuxtools.internal.lttng2.control.core.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.osgi.util.NLS; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/** + * Class for generating a session configuration file. A session configuration is + * used to configure a trace session. It is a XML formatted file that contains + * values defining the behavior of that specific trace session. + *

+ * Kernel session configuration example: + * + *

+ * {@code
+ * 
+ *     
+ *         test_kernel
+ *         
+ *             
+ *                 KERNEL
+ *                 GLOBAL
+ *                 
+ *                     
+ *                         channel0
+ *                         false
+ *                         DISCARD
+ *                         262144
+ *                         4
+ *                         0
+ *                         200000
+ *                         SPLICE
+ *                         0
+ *                         0
+ *                         0
+ *                         
+ *                             
+ *                                 true
+ *                                 SYSCALL
+ *                             
+ *                             
+ *                                 snd_soc_cache_sync
+ *                                 true
+ *                                 TRACEPOINT
+ *                             
+ *                         
+ *                     
+ *                 
+ *             
+ *         
+ *         false
+ *         
+ *             
+ *                 true
+ *                 
+ *                     /home/user/lttng-traces/test_kernel
+ *                 
+ *             
+ *         
+ *     
+ * 
+ * }
+ * 
+ * + *

+ * + * @author Guilliano Molaire + * @since 3.0 + */ +public final class SessionConfigGenerator { + + /** The name of the session schema */ + private static final String SESSION_XSD_FILENAME = "session.xsd"; //$NON-NLS-1$ + + /** The indent size used for the session configuration XML file */ + private static final String INDENT_AMOUNT_PROPERTY_NAME = "{http://xml.apache.org/xslt}indent-amount"; //$NON-NLS-1$ + private static final String INDENT_AMOUNT_PROPERTY_VALUE = "4"; //$NON-NLS-1$ + + /** + * Private constructor. The class should not be instantiated. + */ + private SessionConfigGenerator() { + } + + // --------------------------------------------------------- + // Methods to generate session configuration files + // --------------------------------------------------------- + + /** + * Generates a session configuration file from a set of session information. + * + * @param sessions + * The session informations + * @param sessionFileDestination + * The path of the locally saved session configuration file + * @return The status of the session configuration generation + */ + public static IStatus generateSessionConfig(Set sessions, IPath sessionFileDestination) { + /* Parameters validation */ + if (sessions == null || sessions.isEmpty()) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SessionConfigXML_InvalidSessionInfoList); + } else if (sessionFileDestination == null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SessionConfigXML_InvalidTraceSessionPath); + } + + /* Generate the session configuration file */ + try { + Document sessionConfigDocument = generateSessionConfig(sessions); + + if (sessionConfigDocument != null) { + saveSessionConfig(sessionConfigDocument, sessionFileDestination.toString()); + } else { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SessionConfigXML_SessionConfigGenerationError); + } + } catch (TransformerException | IllegalArgumentException | ParserConfigurationException e) { + Activator.getDefault().logError("Error generating the session configuration file: " + sessionFileDestination.toString(), e); //$NON-NLS-1$ + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()); + } + + return Status.OK_STATUS; + } + + /** + * Generates a session configuration from a set of session informations. + * + * @param sessions + * The session informations + * @return The document with all session configuration nodes + * @throws IllegalArgumentException + * On an illegal argument inside sessions + * @throws ParserConfigurationException + * On an parser configuration error + */ + private static Document generateSessionConfig(Iterable sessions) throws IllegalArgumentException, ParserConfigurationException { + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); + + Document document = docBuilder.newDocument(); + + Element rootElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_SESSIONS); + document.appendChild(rootElement); + + for (ISessionInfo session : sessions) { + /* All elements under "sessions" elements */ + Element sessionElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_SESSION); + + /* Contents of session element */ + String enabled = session.getSessionState().equals(TraceSessionState.ACTIVE) ? SessionConfigStrings.CONFIG_STRING_TRUE : SessionConfigStrings.CONFIG_STRING_FALSE; + + addElementContent(document, sessionElement, SessionConfigStrings.CONFIG_ELEMENT_NAME, session.getName()); + addElementContent(document, sessionElement, SessionConfigStrings.CONFIG_ELEMENT_STARTED, enabled); + + if (session.isSnapshotSession()) { + /* If it's a snapshot, we must add an attribute telling it is */ + Element attributesElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_ATTRIBUTES); + addElementContent(document, attributesElement, SessionConfigStrings.CONFIG_ELEMENT_SNAPSHOT_MODE, SessionConfigStrings.CONFIG_STRING_TRUE); + sessionElement.appendChild(attributesElement); + } + + sessionElement.appendChild(getDomainsElement(document, session)); + sessionElement.appendChild(getOutputElement(document, session)); + rootElement.appendChild(sessionElement); + } + + return document; + } + + // --------------------------------------------------------- + // Getters for each element of the configuration file + // --------------------------------------------------------- + + /** + * Gets the 'domains' element after creating it. + * + * @param document + * The document in which the nodes are being added + * @param session + * The session informations + * @return The domains element as an XML element + */ + private static Element getDomainsElement(Document document, ISessionInfo session) { + Element domainsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DOMAINS); + + for (IDomainInfo domain : session.getDomains()) { + Element domainElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN); + + /* + * Add everything specific to a domain + * + * TODO: We suppose here that domain is either kernel or UST. It + * will have to change if other domains are supported + */ + String domainType = domain.isKernel() ? SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL : SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST; + addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_TYPE, domainType); + + String bufferType = null; + switch (domain.getBufferType()) { + case BUFFER_PER_UID: + bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_PER_UID; + break; + case BUFFER_PER_PID: + bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_PER_PID; + break; + case BUFFER_SHARED: + bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_GLOBAL; + break; + case BUFFER_TYPE_UNKNOWN: + default: + throw new IllegalArgumentException(Messages.SessionConfigXML_UnknownDomainBufferType); + } + addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_DOMAIN_BUFFER_TYPE, bufferType); + + /* Add the channels */ + domainElement.appendChild(getChannelsElement(document, domain.isKernel(), domain.getChannels())); + domainsElement.appendChild(domainElement); + } + + return domainsElement; + } + + /** + * Gets the 'output' element after creating it. If the session is a + * snapshot, it will be composed of a snapshot outputs element. Otherwise, + * it will contain the consumer output element. + * + * @param document + * The document in which the nodes are being added + * @param session + * The session informations + * @return The output element as an XML node + */ + private static Element getOutputElement(Document document, ISessionInfo session) { + Element outputElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_OUTPUT); + + if (session.isSnapshotSession()) { + outputElement.appendChild(getSnapshotOuputsElement(document, session)); + } else if (session.isStreamedTrace()) { + outputElement.appendChild(getNetOutputElement(document, session)); + } else { + outputElement.appendChild(getConsumerOutputElement(document, session)); + } + + return outputElement; + } + + /** + * Gets the 'channels' element after creating it. + * + * @param document + * The document in which the nodes are being added + * @param isKernel + * Is it a kernel domain type + * @param channels + * The channels to be added as elements + * @return The channels element as an XML element + */ + private static Element getChannelsElement(Document document, boolean isKernel, IChannelInfo[] channels) { + Element channelsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_CHANNELS); + + for (IChannelInfo channel : channels) { + Element channelElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_CHANNEL); + + /* Add everything related to a channel */ + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_NAME, channel.getName()); + + String overwriteMode = channel.isOverwriteMode() ? SessionConfigStrings.CONFIG_OVERWRITE_MODE_OVERWRITE : SessionConfigStrings.CONFIG_OVERWRITE_MODE_DISCARD; + String enabled = channel.getState().equals(TraceEnablement.ENABLED) ? SessionConfigStrings.CONFIG_STRING_TRUE : SessionConfigStrings.CONFIG_STRING_FALSE; + + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_ENABLED, enabled); + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_OVERWRITE_MODE, overwriteMode); + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_SUBBUFFER_SIZE, channel.getSubBufferSize()); + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_SUBBUFFER_COUNT, channel.getNumberOfSubBuffers()); + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_SWITCH_TIMER_INTERVAL, channel.getSwitchTimer()); + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_READ_TIMER_INTERVAL, channel.getReadTimer()); + + String outputType = channel.getOutputType().getInName().startsWith(SessionConfigStrings.CONFIG_OUTPUT_TYPE_MMAP) ? + outputType = SessionConfigStrings.CONFIG_OUTPUT_TYPE_MMAP : SessionConfigStrings.CONFIG_OUTPUT_TYPE_SPLICE; + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_OUTPUT_TYPE, outputType); + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_TRACEFILE_SIZE, channel.getMaxSizeTraceFiles()); + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_TRACEFILE_COUNT, channel.getMaxNumberTraceFiles()); + + /* + * TODO: Replace the 0 value by the channel live timer property from + * SessionInfo once live session tracing is supported + */ + addElementContent(document, channelElement, SessionConfigStrings.CONFIG_ELEMENT_LIVE_TIMER_INTERVAL, SessionConfigStrings.CONFIG_STRING_ZERO); + + /* Add the events */ + channelElement.appendChild(getEventsElement(document, isKernel, channel.getEvents())); + channelsElement.appendChild(channelElement); + } + + return channelsElement; + } + + /** + * Gets the 'events' element after creating it. It is composed of the event + * informations from a list of IEventInfo. + * + * @param document + * The document in which the nodes are being added + * @param isKernel + * Is the domain type kernel + * @param events + * The event informations to be added + * @return An element containing all the event informations as XML elements + */ + private static Element getEventsElement(Document document, boolean isKernel, IEventInfo[] events) { + Element eventsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_EVENTS); + + for (IEventInfo event : events) { + Element eventElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_EVENT); + + /* Enabled attribute */ + String enabled = event.getState().equals(TraceEnablement.ENABLED) ? SessionConfigStrings.CONFIG_STRING_TRUE : SessionConfigStrings.CONFIG_STRING_FALSE; + + /* Add the attributes to the event node */ + addElementContent(document, eventElement, SessionConfigStrings.CONFIG_ELEMENT_NAME, event.getName()); + addElementContent(document, eventElement, SessionConfigStrings.CONFIG_ELEMENT_ENABLED, enabled); + TraceEventType eventType = event.getEventType(); + if (!eventType.equals(TraceEventType.UNKNOWN)) { + addElementContent(document, eventElement, SessionConfigStrings.CONFIG_ELEMENT_TYPE, eventType.getInName().toUpperCase()); + } else { + throw new IllegalArgumentException(Messages.SessionConfigXML_UnknownEventType); + } + + /* Specific to UST session config: the log level */ + if (!isKernel && !event.getLogLevel().equals(TraceLogLevel.LEVEL_UNKNOWN)) { + addElementContent(document, eventElement, SessionConfigStrings.CONFIG_ELEMENT_LOGLEVEL, event.getLogLevel().ordinal()); + } + + /* Add the node to the parent node events */ + eventsElement.appendChild(eventElement); + } + + return eventsElement; + } + + /** + * Gets the 'consumer_output' element after creating it. + * + * @param document + * The document in which the nodes are being added + * @param session + * The session informations + * @return The consumer output element with his informations as XML elements + */ + private static Element getConsumerOutputElement(Document document, ISessionInfo session) { + Element consumerOutputElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_CONSUMER_OUTPUT); + Element destinationElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DESTINATION); + + /* Value of consumer output element */ + addElementContent(document, consumerOutputElement, SessionConfigStrings.CONFIG_ELEMENT_ENABLED, SessionConfigStrings.CONFIG_STRING_TRUE); + + if (session.isStreamedTrace()) { + /* If it is a streamed session, add the net output element */ + destinationElement.appendChild(getNetOutputElement(document, session)); + } else { + addElementContent(document, destinationElement, SessionConfigStrings.CONFIG_ELEMENT_PATH, session.getSessionPath()); + } + + consumerOutputElement.appendChild(destinationElement); + return consumerOutputElement; + } + + /** + * Gets the 'net_output' element after creating it. It is composed of the + * control and data URIs. + * + * @param document + * The document in which the nodes are being added + * @param session + * The session informations + * @return The net output element + */ + private static Element getNetOutputElement(Document document, ISessionInfo session) { + Element netOutputElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_NET_OUTPUT); + + String networkUrl = session.getNetworkUrl(); + String controlUri = networkUrl == null ? session.getControlUrl() : networkUrl; + String dataUri = networkUrl == null ? session.getDataUrl() : networkUrl; + addElementContent(document, netOutputElement, SessionConfigStrings.CONFIG_ELEMENT_CONTROL_URI, controlUri); + addElementContent(document, netOutputElement, SessionConfigStrings.CONFIG_ELEMENT_DATA_URI, dataUri); + + return netOutputElement; + } + + /** + * Gets the 'snapshot_outputs' element after creating it. + * + * @param document + * The document in which the nodes are being added + * @param session + * The session informations + * @return The snapshot outputs element with snapshot informations as XML + * elements + */ + private static Element getSnapshotOuputsElement(Document document, ISessionInfo session) { + Element snapshotOutputsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_SNAPSHOT_OUTPUTS); + Element outputElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_OUTPUT); + + /* Add the name of the snapshot and the max size element */ + addElementContent(document, outputElement, SessionConfigStrings.CONFIG_ELEMENT_NAME, session.getSnapshotInfo().getName()); + + /* + * TODO: find the proper max size value of output element. For now it is + * set to the default 0 value which means unlimited for lttng. + */ + addElementContent(document, outputElement, SessionConfigStrings.CONFIG_ELEMENT_MAX_SIZE, SessionConfigStrings.CONFIG_STRING_ZERO); + outputElement.appendChild(getConsumerOutputElement(document, session)); + + snapshotOutputsElement.appendChild(outputElement); + return snapshotOutputsElement; + } + + // --------------------------------------------------------- + // Utilities + // --------------------------------------------------------- + + /** + * Validates the session configuration file against its schema. + * + * @param sessionFile + * The session configuration file + * @return The status of the validation + */ + public static IStatus sessionValidate(File sessionFile) { + URL url = SessionConfigGenerator.class.getResource(SESSION_XSD_FILENAME); + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Source xmlSource = new StreamSource(sessionFile); + + try { + Schema schema = schemaFactory.newSchema(url); + Validator validator = schema.newValidator(); + validator.validate(xmlSource); + } catch (SAXParseException e) { + String error = NLS.bind(Messages.SessionConfigXML_XmlParseError, e.getLineNumber(), e.getLocalizedMessage()); + Activator.getDefault().logError(error); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); + } catch (SAXException e) { + String error = NLS.bind(Messages.SessionConfigXML_XmlValidationError, e.getLocalizedMessage()); + Activator.getDefault().logError(error); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); + } catch (IOException e) { + String error = Messages.SessionConfigXML_XmlValidateError; + Activator.getDefault().logError("IO exception occurred", e); //$NON-NLS-1$ + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); + } + return Status.OK_STATUS; + } + + /** + * Saves the session configuration into a XML file. + * + * @param document + * The document representing the session configuration file + * @param destination + * The path of the locally saved session configuration file + * @throws TransformerException + * On an transformation process + */ + private static void saveSessionConfig(Document document, String destination) throws TransformerException { + /* Write the content into a XML file */ + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ + transformer.setOutputProperty(INDENT_AMOUNT_PROPERTY_NAME, INDENT_AMOUNT_PROPERTY_VALUE); + + DOMSource source = new DOMSource(document); + StreamResult result = new StreamResult(new File(destination)); + + transformer.transform(source, result); + } + + /** + * Adds to a parent node an element with his content. + * + * @param document + * The document in which the nodes are being added + * @param parent + * The parent node that contains the element and his content + * @param elementName + * The element container name + * @param elementContent + * The content itself + */ + private static void addElementContent(Document document, Element parent, String elementName, Object elementContent) { + Element contentElement = document.createElement(elementName); + contentElement.appendChild(document.createTextNode(elementContent.toString())); + parent.appendChild(contentElement); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigStrings.java b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigStrings.java new file mode 100644 index 0000000000..6e3af06cdc --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/SessionConfigStrings.java @@ -0,0 +1,82 @@ +/********************************************************************** + * 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: + * Guilliano Molaire - Initial API and implementation + *********************************************************************/ +package org.eclipse.linuxtools.lttng2.control.core.session; + +/** + * This file defines most markers from a session configuration file used to + * configure a trace session. They can be found in the session configuration + * schema "session.xsd" in src/common/config/ folder of LTTng-tools. + * + * @author Guilliano Molaire + * @since 3.0 + */ +@SuppressWarnings({ "javadoc", "nls" }) +public interface SessionConfigStrings { + + /* Session configuration file extension */ + static final String SESSION_CONFIG_FILE_EXTENSION = "lttng"; + + /* Elements of the session configuration file */ + static final String CONFIG_ELEMENT_SESSIONS = "sessions"; + static final String CONFIG_ELEMENT_SESSION = "session"; + static final String CONFIG_ELEMENT_DOMAINS = "domains"; + static final String CONFIG_ELEMENT_DOMAIN = "domain"; + static final String CONFIG_ELEMENT_CHANNELS = "channels"; + static final String CONFIG_ELEMENT_CHANNEL = "channel"; + static final String CONFIG_ELEMENT_EVENTS = "events"; + static final String CONFIG_ELEMENT_EVENT = "event"; + static final String CONFIG_ELEMENT_OUTPUT = "output"; + static final String CONFIG_ELEMENT_ATTRIBUTES = "attributes"; + static final String CONFIG_ELEMENT_NET_OUTPUT = "net_output"; + static final String CONFIG_ELEMENT_MAX_SIZE = "max_size"; + static final String CONFIG_ELEMENT_SNAPSHOT_OUTPUTS = "snapshot_outputs"; + static final String CONFIG_ELEMENT_CONSUMER_OUTPUT = "consumer_output"; + static final String CONFIG_ELEMENT_DESTINATION = "destination"; + static final String CONFIG_ELEMENT_CONTROL_URI = "control_uri"; + static final String CONFIG_ELEMENT_DATA_URI = "data_uri"; + static final String CONFIG_ELEMENT_SNAPSHOT_MODE = "snapshot_mode"; + static final String CONFIG_ELEMENT_PATH = "path"; + static final String CONFIG_ELEMENT_NAME = "name"; + static final String CONFIG_ELEMENT_ENABLED = "enabled"; + static final String CONFIG_ELEMENT_TYPE = "type"; + static final String CONFIG_ELEMENT_STARTED = "started"; + static final String CONFIG_ELEMENT_DOMAIN_BUFFER_TYPE = "buffer_type"; + static final String CONFIG_ELEMENT_OVERWRITE_MODE = "overwrite_mode"; + static final String CONFIG_ELEMENT_SUBBUFFER_SIZE = "subbuffer_size"; + static final String CONFIG_ELEMENT_SUBBUFFER_COUNT = "subbuffer_count"; + static final String CONFIG_ELEMENT_SWITCH_TIMER_INTERVAL = "switch_timer_interval"; + static final String CONFIG_ELEMENT_READ_TIMER_INTERVAL = "read_timer_interval"; + static final String CONFIG_ELEMENT_OUTPUT_TYPE = "output_type"; + static final String CONFIG_ELEMENT_TRACEFILE_SIZE = "tracefile_size"; + static final String CONFIG_ELEMENT_TRACEFILE_COUNT = "tracefile_count"; + static final String CONFIG_ELEMENT_LIVE_TIMER_INTERVAL = "live_timer_interval"; + static final String CONFIG_ELEMENT_LOGLEVEL_TYPE = "loglevel_type"; + static final String CONFIG_ELEMENT_LOGLEVEL = "loglevel"; + + /* Common element values */ + static final String CONFIG_STRING_TRUE = "true"; + static final String CONFIG_STRING_FALSE = "false"; + static final String CONFIG_STRING_ZERO = "0"; + + static final String CONFIG_DOMAIN_TYPE_KERNEL = "KERNEL"; + static final String CONFIG_DOMAIN_TYPE_UST = "UST"; + + static final String CONFIG_BUFFER_TYPE_PER_UID = "PER_UID"; + static final String CONFIG_BUFFER_TYPE_PER_PID = "PER_PID"; + static final String CONFIG_BUFFER_TYPE_GLOBAL = "GLOBAL"; + + static final String CONFIG_OVERWRITE_MODE_DISCARD = "DISCARD"; + static final String CONFIG_OVERWRITE_MODE_OVERWRITE = "OVERWRITE"; + + static final String CONFIG_OUTPUT_TYPE_SPLICE = "SPLICE"; + static final String CONFIG_OUTPUT_TYPE_MMAP = "MMAP"; +} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/messages.properties b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/messages.properties new file mode 100644 index 0000000000..c0d252d198 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/messages.properties @@ -0,0 +1,23 @@ +############################################################################### +# 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: +# Guilliano Molaire - Initial API and implementation +############################################################################### + +SessionConfigXML_BadRequirementType=The requirement type is not supported +SessionConfigXML_DomainTypeMissing=The domain requirement type is missing +SessionConfigXML_EventTypeMissing=The event requirement type is missing +SessionConfigXML_InvalidSessionInfoList=The list of session is empty or null +SessionConfigXML_InvalidTraceSessionPath=The trace session path is not valid +SessionConfigXML_UnknownEventType=The event type is not handled by the session configuration +SessionConfigXML_UnknownDomainBufferType=The domain buffer type is not handled by the session configuration +SessionConfigXML_SessionConfigGenerationError=An error occurred while generating the session configuration file +SessionConfigXML_XmlParseError=XML Parsing error at line {0}: {1} +SessionConfigXML_XmlValidateError=An error occurred while validating the XML file. +SessionConfigXML_XmlValidationError=Error validating XML file {0} diff --git a/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/session.xsd b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/session.xsd new file mode 100644 index 0000000000..7c3e9d8fc6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/linuxtools/lttng2/control/core/session/session.xsd @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/.classpath b/org.eclipse.tracecompass.lttng2.control.ui.tests/.classpath new file mode 100644 index 0000000000..f1d3296b72 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/.project b/org.eclipse.tracecompass.lttng2.control.ui.tests/.project new file mode 100644 index 0000000000..b9f247dea1 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.control.ui.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..f3fc64575b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,393 @@ +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=enabled +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 diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..62cfa90dee --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.control.ui.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..a5d2d3a757 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/META-INF/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.control.ui.tests;singleton:=true +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.junit;bundle-version="4.0.0", + org.eclipse.core.commands, + org.eclipse.core.runtime, + org.eclipse.ui, + org.eclipse.ui.ide, + org.eclipse.tracecompass.lttng2.control.core;bundle-version="3.1.0", + org.eclipse.tracecompass.lttng2.control.ui;bundle-version="3.1.0" +Import-Package: org.eclipse.rse.core, + org.eclipse.rse.core.model, + org.eclipse.rse.core.subsystems, + org.eclipse.rse.services.shells, + org.eclipse.rse.services.terminals, + org.eclipse.rse.subsystems.files.core, + org.eclipse.rse.subsystems.files.core.servicesubsystem +Export-Package: org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs;x-internal:=true, + org.eclipse.linuxtools.internal.lttng2.control.stubs.service;x-internal:=true, + org.eclipse.linuxtools.internal.lttng2.control.stubs.shells;x-internal:=true, + org.eclipse.linuxtools.lttng2.control.ui.tests;x-friends:="org.eclipse.linuxtools.lttng.alltests", + org.eclipse.linuxtools.lttng2.control.ui.tests.model.component;x-internal:=true, + org.eclipse.linuxtools.lttng2.control.ui.tests.service;x-internal:=true diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/about.html b/org.eclipse.tracecompass.lttng2.control.ui.tests/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/build.properties b/org.eclipse.tracecompass.lttng2.control.ui.tests/build.properties new file mode 100644 index 0000000000..370858e81e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/build.properties @@ -0,0 +1,19 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +source.. = src/,\ + stubs/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties +src.includes = about.html diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/plugin.properties b/org.eclipse.tracecompass.lttng2.control.ui.tests/plugin.properties new file mode 100644 index 0000000000..e72e1453c3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Control UI Tests Plug-in diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/pom.xml b/org.eclipse.tracecompass.lttng2.control.ui.tests/pom.xml new file mode 100644 index 0000000000..ac14cfc735 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.control.ui.tests + 3.1.0-SNAPSHOT + eclipse-test-plugin + + Trace Compass LTTng Control UI Tests Plug-in + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + org.eclipse.tracecompass.lttng2.control.ui.tests + org.eclipse.linuxtools.lttng2.control.ui.tests.AllTests + true + true + ${tycho.testArgLine} ${base.ui.test.vmargs} + org.eclipse.platform.ide + + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/ActivatorTest.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/ActivatorTest.java new file mode 100644 index 0000000000..7878ac0732 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/ActivatorTest.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.control.ui.tests; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Test suite for the Activator class + */ +public class ActivatorTest { + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.ui.Activator#Activator}. + */ + @Test + public void testActivator() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.ui.Activator#getDefault}. + */ + @Test + public void testGetDefault() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.ui.Activator#start}. + */ + @Test + public void testStartBundleContext() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.control.ui.Activator#stop}. + */ + @Test + public void testStopBundleContext() { + assertTrue(true); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/AllTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/AllTests.java new file mode 100644 index 0000000000..9d884e8921 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/AllTests.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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 + * Alexandre Montplaisir - Port to JUnit4 + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Runner for the test suite + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ActivatorTest.class, + org.eclipse.linuxtools.lttng2.control.ui.tests.model.component.AllTests.class, + org.eclipse.linuxtools.lttng2.control.ui.tests.service.AllTests.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/AllTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/AllTests.java new file mode 100644 index 0000000000..5ae2c88ac0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/AllTests.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2011, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Runner for the model.component unit tests. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + TraceControlComponentTest.class, + TraceControlCreateSessionTests.class, + TraceControlCreateSessionMiTests.class, + TraceControlKernelProviderTests.class, + TraceControlKernelSessionTests.class, + TraceControlPropertiesTest.class, + TraceControlTreeModelNoProvidersTest.class, + TraceControlTreeModelTest.class, + TraceControlUstProviderTests.class, + TraceControlUstSessionTests.class, + TraceControlUstSessionTests2.class, + TraceControlSnapshotSessionTests.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/ListenerValidator.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/ListenerValidator.java new file mode 100644 index 0000000000..9dbd99fada --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/ListenerValidator.java @@ -0,0 +1,94 @@ +/********************************************************************** + * Copyright (c) 2012 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponentChangedListener; + +/** + * The class can be used to validate the listener interface. + */ +@SuppressWarnings("javadoc") +public class ListenerValidator implements ITraceControlComponentChangedListener { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + private boolean fisAddedCalled = false; + private boolean fisRemoveCalled = false; + private boolean fisChangedCalled = false; + + private ITraceControlComponent fParent = null; + private ITraceControlComponent fChild = null; + private ITraceControlComponent fChangedComponent = null; + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + public boolean isAddedCalled() { + return fisAddedCalled; + } + + public boolean isRemovedCalled() { + return fisRemoveCalled; + } + + public boolean isChangedCalled() { + return fisChangedCalled; + } + + public ITraceControlComponent getSavedParent() { + return fParent; + } + + public ITraceControlComponent getSavedChild() { + return fChild; + } + + public ITraceControlComponent getSavedComponent() { + return fChangedComponent; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + public void initialize() { + fisAddedCalled = false; + fisRemoveCalled = false; + fisChangedCalled = false; + fParent = null; + fChild = null; + fChangedComponent = null; + } + + @Override + public void componentAdded(ITraceControlComponent parent, ITraceControlComponent component) { + fisAddedCalled = true; + fParent = parent; + fChild = component; + } + + @Override + public void componentRemoved(ITraceControlComponent parent, ITraceControlComponent component) { + fisRemoveCalled = true; + fParent = parent; + fChild = component; + } + + @Override + public void componentChanged(ITraceControlComponent component) { + fisChangedCalled = true; + fParent = null; + fChangedComponent = component; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlComponentTest.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlComponentTest.java new file mode 100644 index 0000000000..74d4b1e439 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlComponentTest.java @@ -0,0 +1,540 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponentChangedListener; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlRoot; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlService; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceMI; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.PlatformUI; +import org.junit.Test; + +/** + * The class TraceControlComponentTest contains tests for the class + * {@link TraceControlComponent}. + */ +public class TraceControlComponentTest { + + /** + * Run the TraceControlComponent(String) constructor test. + */ + @Test + public void testTraceControlComponent_1() { + + String name = "node"; + + TraceControlComponent result = new TraceControlComponent(name); + + assertNotNull(result); + assertEquals(name, result.getName()); + assertEquals(null, result.getParent()); + assertEquals(false, result.hasChildren()); + assertEquals(null, result.getImage()); + assertEquals(null, result.getControlService()); + assertEquals(null, result.getToolTip()); + } + + /** + * Run the TraceControlComponent(String,ITraceControlComponent) constructor test. + */ + @Test + public void testTraceControlComponent_2() { + String name = "node"; + + ITraceControlComponent parent = new TraceControlRoot(); + TraceControlComponent result = new TraceControlComponent(name, parent); + + assertNotNull(result); + assertEquals(name, result.getName()); + assertEquals(false, result.hasChildren()); + assertEquals(null, result.getImage()); + assertEquals(null, result.getControlService()); + assertEquals(null, result.getToolTip()); + } + + /** + * Run the void addChild(ITraceControlComponent) method test. + */ + @Test + public void testAddAndGetChild1() { + TraceControlComponent fixture = new TraceControlComponent("node", new TraceControlRoot()); + fixture.setToolTip("This is the test node"); + fixture.addChild(new TraceControlRoot()); + ITraceControlComponent component = new TraceControlRoot(); + fixture.addChild(component); + + ITraceControlComponent child = fixture.getChild(TraceControlRoot.TRACE_CONTROL_ROOT_NAME); + assertNotNull(child); + assertEquals(TraceControlRoot.TRACE_CONTROL_ROOT_NAME, child.getName()); + } + + /** + * Run the void addChild(ITraceControlComponent) method test. + */ + @Test + public void testAddAndGetChild2() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + ITraceControlComponent component = null; + + fixture.addChild(component); + assertFalse(fixture.hasChildren()); + } + + /** + * Run the void addComponentListener(ITraceControlComponentChangedListener) method test. + */ + @Test + public void testAddComponentListener_1() { + TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null); + fixture.setToolTip(""); + + ListenerValidator validator = new ListenerValidator(); + fixture.addComponentListener(validator); + + TraceControlRoot root = new TraceControlRoot(); + fixture.addChild(root); + assertTrue(validator.isAddedCalled()); + + fixture.removeChild(root); + assertTrue(validator.isRemovedCalled()); + + fixture.fireComponentChanged(fixture); + assertTrue(validator.isChangedCalled()); + } + + /** + * Run the boolean containsChild(String) method test. + */ + @Test + public void testContainsChild_1() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + fixture.addChild(new TraceControlRoot()); + String name = "node"; + + boolean result = fixture.containsChild(name); + + assertEquals(false, result); + } + + /** + * Run the boolean containsChild(String) method test. + */ + @Test + public void testContainsChild_2() { + TraceControlComponent fixture = new TraceControlComponent("name", new TraceControlRoot()); + fixture.setToolTip(""); + + boolean result = fixture.containsChild(TraceControlRoot.TRACE_CONTROL_ROOT_NAME); + + assertEquals(false, result); + } + + /** + * Run the void fireCompenentAdded(ITraceControlComponent,ITraceControlComponent) method test. + * Run the void fireCompenentRemoved(ITraceControlComponent,ITraceControlComponent) method test. + * Run the void fireCompenentChanged(ITraceControlComponent) method test + */ + @Test + public void testFireCompenentUpdated() { + ITraceControlComponent parent = new TraceControlRoot(); + + TraceControlComponent fixture = new TraceControlComponent("node", parent); + fixture.setToolTip(""); + + ITraceControlComponent component = new TraceControlComponent("child"); + fixture.addChild(component); + + ListenerValidator validator = new ListenerValidator(); + fixture.addComponentListener(validator); + + fixture.fireComponentAdded(parent, component); + assertTrue(validator.isAddedCalled()); + assertEquals(parent.getName(), validator.getSavedParent().getName()); + assertEquals(component.getName(), validator.getSavedChild().getName()); + + validator.initialize(); + + fixture.fireComponentRemoved(parent, component); + assertTrue(validator.isRemovedCalled()); + assertEquals(parent.getName(), validator.getSavedParent().getName()); + assertEquals(component.getName(), validator.getSavedChild().getName()); + + validator.initialize(); + fixture.fireComponentChanged(fixture); + assertTrue(validator.isChangedCalled()); + assertEquals(fixture.getName(), validator.getSavedComponent().getName()); + } + + /** + * Run the Object getAdapter(Class) method test. + */ + @Test + public void testGetAdapter() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + fixture.addChild(new TraceControlRoot()); + Class adapter = Object.class; + + Object result = fixture.getAdapter(adapter); + + assertEquals(null, result); + } + + /** + * Run the ITraceControlComponent[] getChildren() method test. + */ + @Test + public void testGetChildren_1() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + fixture.addChild(new TraceControlRoot()); + + ITraceControlComponent[] result = fixture.getChildren(); + + assertNotNull(result); + assertEquals(1, result.length); + assertNotNull(result[0]); + assertEquals("trace_control_root", result[0].getName()); + assertEquals(null, result[0].getParent()); + assertEquals(false, result[0].hasChildren()); + assertEquals(null, result[0].getImage()); + assertEquals(null, result[0].getControlService()); + assertEquals(null, result[0].getToolTip()); + } + + /** + * Run the ILttngControlService getControlService()/setControlService() + * method test. + * + * @throws ExecutionException + * Would fail the test + */ + @Test + public void testGetAndSetControlService_1() throws ExecutionException { + + TraceControlComponent parent = new TraceControlComponent("parent") { + ILttngControlService fService = null; + + @Override + public void setControlService(ILttngControlService service ) { + fService = service; + } + + @Override + public ILttngControlService getControlService() { + return fService; + } + }; + + TraceControlComponent fixture = new TraceControlComponent("", parent); + parent.addChild(fixture); + fixture.setToolTip(""); + TraceControlComponent child = new TraceControlComponent("child", fixture); + fixture.addChild(child); + + ILttngControlService result = fixture.getControlService(); + assertEquals(null, result); + + TestRemoteSystemProxy proxy = new TestRemoteSystemProxy(); + ILttngControlService service = new LTTngControlService(proxy.createCommandShell()); + fixture.setControlService(service); + result = fixture.getControlService(); + assertNotNull(service); + assertEquals(service, result); + + service = new LTTngControlServiceMI(proxy.createCommandShell(), LTTngControlServiceMI.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME)); + fixture.setControlService(service); + result = fixture.getControlService(); + assertNotNull(service); + assertEquals(service, result); + + result = fixture.getChildren()[0].getControlService(); + assertNotNull(service); + assertEquals(service, result); + } + + /** + * Run the Image getImage() method test. + */ + @Test + public void testGetImage_1() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + fixture.addChild(new TraceControlRoot()); + + Image result = fixture.getImage(); + assertEquals(null, result); + + fixture.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER)); + assertNotNull(fixture.getImage()); + } + + /** + * Run the boolean hasChildren() method test. + */ + @Test + public void testHasChildren_1() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + fixture.addChild(new TraceControlRoot()); + + boolean result = fixture.hasChildren(); + + assertTrue(result); + } + + /** + * Run the boolean hasChildren() method test. + */ + @Test + public void testHasChildren_2() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + + boolean result = fixture.hasChildren(); + + assertFalse(result); + } + + /** + * Run the void removeAllChildren() method test. + */ + @Test + public void testRemoveAllChildren_2() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + + fixture.addChild(new TraceControlRoot()); + fixture.addChild(new TraceControlComponent("child")); + + fixture.removeAllChildren(); + assertFalse(fixture.hasChildren()); + } + + /** + * Run the void removeChild(ITraceControlComponent) method test. + */ + @Test + public void testRemoveChild_1() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + TraceControlComponent child = new TraceControlComponent("child", fixture); + + fixture.addChild(child); + fixture.removeChild(child); + assertFalse(fixture.hasChildren()); + } + + /** + * Run the void removeChild(ITraceControlComponent) method test. + */ + @Test + public void testRemoveChild_2() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + fixture.addChild(new TraceControlRoot()); + ITraceControlComponent component = null; + + fixture.removeChild(component); + assertTrue(fixture.hasChildren()); + } + + /** + * Run the void removeComponentListener(ITraceControlComponentChangedListener) method test. + */ + @Test + public void testRemoveComponentListener_1() { + TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null); + fixture.setToolTip(""); + + ListenerValidator validator = new ListenerValidator(); + fixture.addComponentListener(validator); + + // Remove listener and check that validator is not called anymore + validator.initialize(); + fixture.removeComponentListener(validator); + TraceControlRoot root = new TraceControlRoot(); + fixture.addChild(root); + assertFalse(validator.isAddedCalled()); + + fixture.removeChild(root); + assertFalse(validator.isRemovedCalled()); + + fixture.fireComponentChanged(fixture); + assertFalse(validator.isChangedCalled()); + } + + /** + * Run the void removeComponentListener(ITraceControlComponentChangedListener) method test. + */ + @Test + public void testRemoveComponentListener_2() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + fixture.addChild(new TraceControlRoot()); + ITraceControlComponentChangedListener listener = new ControlView(); + + fixture.removeComponentListener(listener); + + } + + /** + * Run the void setChildren(List)/ITraceControlComponent[] getChildren() method test. + */ + @Test + public void testGetAndSetChildren() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + List children = new LinkedList<>(); + children.add(new TraceControlComponent("child1")); + children.add(new TraceControlComponent("child2")); + + fixture.setChildren(children); + + ITraceControlComponent[] result = fixture.getChildren(); + assertEquals(2, result.length); + assertEquals("child1", result[0].getName()); + assertEquals("child2", result[1].getName()); + } + + /** + * Run the void String getName()/setName(String) method tests. + */ + @Test + public void testGetAndSetName() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + fixture.addChild(new TraceControlRoot()); + String name = "node"; + + fixture.setName(name); + assertEquals(name,fixture.getName()); + + } + + /** + * Run the void ITraceControlComponent getParent()/setParent(ITraceControlComponent) method tests. + */ + @Test + public void testGetAndSetParent() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip(""); + fixture.addChild(new TraceControlRoot()); + ITraceControlComponent parent = new TraceControlRoot(); + parent.addChild(fixture); + + fixture.setParent(parent); + ITraceControlComponent retrievedParent = fixture.getParent(); + assertNotNull(retrievedParent); + assertEquals(parent.getName(), retrievedParent.getName()); + assertEquals(TraceControlRoot.TRACE_CONTROL_ROOT_NAME, retrievedParent.getName()); + assertEquals(null, retrievedParent.getParent()); + assertEquals(true, retrievedParent.hasChildren()); + } + + /** + * Run the void TargetNodeState getTargetNodeState()/etTargetNodeState(TargetNodeState) method tests. + */ + @Test + public void testGetAndSetTargetNodeState_1() { + TraceControlComponent parent = new TraceControlComponent("parent") { + private TargetNodeState fState; + + @Override + public void setTargetNodeState(TargetNodeState state ) { + fState = state; + } + + @Override + public TargetNodeState getTargetNodeState() { + return fState; + } + }; + + TraceControlComponent fixture = new TraceControlComponent("", parent); + parent.addChild(fixture); + + fixture.setToolTip(""); + TargetNodeState state = TargetNodeState.CONNECTED; + + fixture.setTargetNodeState(state); + TargetNodeState result = fixture.getTargetNodeState(); + + assertNotNull(result); + assertEquals(state, result); + // Check also parent + assertEquals(state, fixture.getParent().getTargetNodeState()); + assertEquals("CONNECTED", result.name()); + assertEquals("CONNECTED", result.toString()); + assertEquals(2, result.ordinal()); + + fixture.setTargetNodeState(TargetNodeState.DISCONNECTED); + result = fixture.getTargetNodeState(); + assertNotNull(result); + assertEquals("DISCONNECTED", result.name()); + assertEquals("DISCONNECTED", result.toString()); + assertEquals(0, result.ordinal()); + + state = TargetNodeState.CONNECTING; + + fixture.setTargetNodeState(state); + result = fixture.getTargetNodeState(); + assertNotNull(result); + assertEquals("CONNECTING", result.name()); + assertEquals("CONNECTING", result.toString()); + assertEquals(3, result.ordinal()); + + fixture.setTargetNodeState(TargetNodeState.DISCONNECTING); + result = fixture.getTargetNodeState(); + assertNotNull(result); + assertEquals("DISCONNECTING", result.name()); + assertEquals("DISCONNECTING", result.toString()); + assertEquals(1, result.ordinal()); + + } + + /** + * Run the void setToolTip(String) method test. + */ + @Test + public void testGetSndSetToolTip() { + TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot()); + fixture.setToolTip("This is a tooltip"); + fixture.addChild(new TraceControlRoot()); + + String result = fixture.getToolTip(); + + assertEquals("This is a tooltip", result); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTests.java new file mode 100644 index 0000000000..bb287f133a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTests.java @@ -0,0 +1,27 @@ +/********************************************************************** + * 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: + * Jonathan Rajotte - Support for machine interface LTTng 2.6 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +/** + * Machine interface Kernel session manipulation handling test cases. + * LTTng 2.6 + */ +public class TraceControlCreateSessionMiTests extends TraceControlCreateSessionTests { + + private static final String TEST_STREAM = "CreateSessionTestMi.cfg"; + + @Override + protected String getTestStream() { + return TEST_STREAM; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTests.java new file mode 100644 index 0000000000..50611ca5a2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTests.java @@ -0,0 +1,284 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Jonathan Rajotte - Support for LTTng 2.6 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class {@link TraceControlKernelSessionTests} contains Kernel + * session/channel/event handling test cases. + */ +public class TraceControlCreateSessionTests { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + private static final String TEST_STREAM = "CreateSessionTest.cfg"; + private static final String SCEN_SCENARIO_FILE_PROTO_TEST = "CreateSessionFileProto"; + private static final String SCEN_SCENARIO_CONTROL_DATA_TEST = "CreateSessionControlData"; + private static final String SCEN_SCENARIO_NETWORK_TEST = "CreateSessionNetwork"; + private static final String SCEN_SCENARIO_NETWORK2_TEST = "CreateSessionNetwork2"; + + private static final String SESSION = "mysession"; + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + private TraceControlTestFacility fFacility; + private TestRemoteSystemProxy fProxy; + private String fTestFile; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fFacility = TraceControlTestFacility.getInstance(); + fFacility.init(); + fProxy = new TestRemoteSystemProxy(); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + getTestStream()), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestFile = testfile.getAbsolutePath(); + } + + /** + * Get the test stream file name to use for the test suite + * + * @return the name of the test stream file + */ + protected String getTestStream() { + return TEST_STREAM; + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + fFacility.waitForJobs(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * on internal error + */ + @Test + public void testTraceSessionTree() throws Exception { + + fProxy.setTestFile(fTestFile); + fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); + + ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); + + root.addChild(node); + fFacility.waitForJobs(); + + fFacility.executeCommand(node, "connect"); + int i = 0; + while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { + i++; + fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); + } + + // Verify that node is connected + assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); + + ILttngControlService controleService = node.getControlService(); + + // Get provider groups + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + // Initialize dialog implementations for command execution + CreateSessionDialogStub sessionDialogStub = new CreateSessionDialogStub(); + TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub); + TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); + + // ------------------------------------------------------------------------ + // Create session (--U file://...) and destroy + // ------------------------------------------------------------------------ + // Initialize session handling scenario + fProxy.setScenario(SCEN_SCENARIO_FILE_PROTO_TEST); + + sessionDialogStub.setNetworkUrl("file:///tmp"); + sessionDialogStub.setStreamedTrace(true); + TraceSessionComponent session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals(getSessionName(), session.getName()); + if (controleService.isVersionSupported("2.6.0")) { + assertEquals("/tmp", session.getSessionPath()); + } else { + assertEquals("file:///tmp", session.getSessionPath()); + } + + assertTrue(!session.isStreamedTrace()); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + sessionDialogStub.setNetworkUrl(null); + sessionDialogStub.setStreamedTrace(false); + + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + // ------------------------------------------------------------------------ + // Create session (--U file://,,, and destroy + // ------------------------------------------------------------------------ + // Initialize session handling scenario + fProxy.setScenario(SCEN_SCENARIO_CONTROL_DATA_TEST); + + sessionDialogStub.setControlUrl("tcp://172.0.0.1"); + sessionDialogStub.setDataUrl("tcp://172.0.0.1:5343"); + sessionDialogStub.setStreamedTrace(true); + + session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals(getSessionName(), session.getName()); + if (controleService.isVersionSupported("2.6.0")) { + assertEquals("tcp4://172.0.0.1:5342/ [data: 5343]", session.getSessionPath()); + } else { + assertEquals("tcp://172.0.0.1:5342 [data: 5343]", session.getSessionPath()); + } + assertTrue(session.isStreamedTrace()); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + sessionDialogStub.setControlUrl(null); + sessionDialogStub.setDataUrl(null); + sessionDialogStub.setStreamedTrace(false); + + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + // ------------------------------------------------------------------------ + // Create session (--U file://... and destroy + // ------------------------------------------------------------------------ + // Initialize session handling scenario + fProxy.setScenario(SCEN_SCENARIO_NETWORK_TEST); + + sessionDialogStub.setNetworkUrl("net://172.0.0.1:1234:2345"); + sessionDialogStub.setStreamedTrace(true); + + session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals(getSessionName(), session.getName()); + if (controleService.isVersionSupported("2.6.0")) { + assertEquals("tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]", session.getSessionPath()); + } else { + assertEquals("net://172.0.0.1:1234 [data: 2345]", session.getSessionPath()); + } + assertTrue(session.isStreamedTrace()); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + sessionDialogStub.setNetworkUrl(null); + + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + // ------------------------------------------------------------------------ + // Create session (--U net6://[...] and destroy + // ------------------------------------------------------------------------ + // Initialize session handling scenario + fProxy.setScenario(SCEN_SCENARIO_NETWORK2_TEST); + + sessionDialogStub.setNetworkUrl("net6://[ffff::eeee:dddd:cccc:0]"); + sessionDialogStub.setStreamedTrace(true); + + session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals(getSessionName(), session.getName()); + if (controleService.isVersionSupported("2.6.0")) { + assertEquals("tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]", session.getSessionPath()); + } else { + assertEquals("net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]", session.getSessionPath()); + } + assertTrue(session.isStreamedTrace()); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + sessionDialogStub.setNetworkUrl(null); + + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + // ------------------------------------------------------------------------- + // Disconnect node + // ------------------------------------------------------------------------- + fFacility.executeCommand(node, "disconnect"); + assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); + + // ------------------------------------------------------------------------- + // Delete node + // ------------------------------------------------------------------------- + + fFacility.executeCommand(node, "delete"); + assertEquals(0, fFacility.getControlView().getTraceControlRoot().getChildren().length); + } + + private static String getSessionName() { + return SESSION; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTests.java new file mode 100644 index 0000000000..2a77d8c477 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTests.java @@ -0,0 +1,271 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class TraceControlKernelProviderTests contains UST provider + * handling test cases. + */ +public class TraceControlKernelProviderTests { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private static final String TEST_STREAM = "CreateTreeTest.cfg"; + private static final String SCEN_SCENARIO1_TEST = "Scenario1"; + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private TraceControlTestFacility fFacility; + private TestRemoteSystemProxy fProxy; + private String fTestFile; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fFacility = TraceControlTestFacility.getInstance(); + fFacility.init(); + fProxy = new TestRemoteSystemProxy(); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestFile = testfile.getAbsolutePath(); + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + fFacility.waitForJobs(); + fFacility.dispose(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * Would fail the test + */ + @Test + public void testKernelProviderTree() throws Exception { + + fProxy.setTestFile(fTestFile); + fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); + + ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); + + root.addChild(node); + + fFacility.waitForJobs(); + + fFacility.executeCommand(node, "connect"); + int i = 0; + while ((i < 20) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { + i++; + fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); + } + + // Verify that node is connected + assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); + + // Get provider and session group + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + // Check for kernel provider + TraceProviderGroup providerGroup = (TraceProviderGroup) groups[0]; + assertTrue(providerGroup.hasKernelProvider()); + + // Get kernel provider + ITraceControlComponent[] providers = providerGroup.getChildren(); + KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0]; + + // Get kernel provider events and select 2 events + ITraceControlComponent[] events = kernelProvider.getChildren(); + assertNotNull(events); + assertEquals(3, events.length); + + BaseEventComponent baseEventInfo0 = (BaseEventComponent) events[0]; + BaseEventComponent baseEventInfo1 = (BaseEventComponent) events[1]; + + // Initialize dialog implementations for command execution + TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); + TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); + TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); + + // Initialize session handling scenario + fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); + + // ------------------------------------------------------------------------ + // Create session + // ------------------------------------------------------------------------ + TraceSessionComponent session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals("mysession", session.getName()); + assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath()); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + + // ------------------------------------------------------------------------ + // Enable event on default channel on created session above + // ------------------------------------------------------------------------ + // Initialize scenario + fProxy.setScenario(SCEN_SCENARIO1_TEST); + + ITraceControlComponent[] components = { baseEventInfo0, baseEventInfo1 }; + + fFacility.executeCommand(components, "assign.event"); + + // Verify that kernel domain was created + ITraceControlComponent[] domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + assertEquals("Kernel", domains[0].getName()); + + // Verify that channel0 was created with default values + ITraceControlComponent[] channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(1, channels.length); + + assertTrue(channels[0] instanceof TraceChannelComponent); + TraceChannelComponent channel = (TraceChannelComponent) channels[0]; + assertEquals("channel0", channel.getName()); + assertEquals(4, channel.getNumberOfSubBuffers()); + assertEquals("splice()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); + assertEquals(false, channel.isOverwriteMode()); + assertEquals(200, channel.getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channel.getState()); + assertEquals(262144, channel.getSubBufferSize()); + assertEquals(0, channel.getSwitchTimer()); + + // Verify that event components were created + ITraceControlComponent[] channel0Events = channel.getChildren(); + assertNotNull(channel0Events); + assertEquals(2, channel0Events.length); + assertTrue(channel0Events[0] instanceof TraceEventComponent); + assertTrue(channel0Events[1] instanceof TraceEventComponent); + + TraceEventComponent event = (TraceEventComponent) channel0Events[0]; + assertEquals("sched_kthread_stop_ret", event.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + TraceEventComponent event1 = (TraceEventComponent) channel0Events[1]; + assertEquals("sched_kthread_stop", event1.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event1.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event1.getEventType()); + assertEquals(TraceEnablement.ENABLED, event1.getState()); + + // ------------------------------------------------------------------------ + // Disable event components + // ------------------------------------------------------------------------ + ITraceControlComponent[] selection = { event, event1 }; + fFacility.executeCommand(selection, "disableEvent"); + + assertEquals(TraceEnablement.DISABLED, event.getState()); + assertEquals(TraceEnablement.DISABLED, event1.getState()); + + // ------------------------------------------------------------------------ + // Enable event component + // ------------------------------------------------------------------------ + fFacility.executeCommand(event1, "enableEvent"); + + // Verify event state + assertEquals(TraceEnablement.ENABLED, event1.getState()); + + // ------------------------------------------------------------------------ + // Destroy session + // ------------------------------------------------------------------------ + // Initialize session handling scenario + fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); + + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + //------------------------------------------------------------------------- + // Disconnect node + //------------------------------------------------------------------------- + fFacility.executeCommand(node, "disconnect"); + assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); + + //------------------------------------------------------------------------- + // Delete node + //------------------------------------------------------------------------- + fFacility.executeCommand(node, "delete"); + assertEquals(0, fFacility.getControlView().getTraceControlRoot().getChildren().length); + + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTests.java new file mode 100644 index 0000000000..3ae9a82730 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTests.java @@ -0,0 +1,823 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +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.net.URL; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.AddContextDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableEventsDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class TraceControlKernelSessionTests contains Kernel + * session/channel/event handling test cases. + */ +public class TraceControlKernelSessionTests { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private static final String TEST_STREAM = "CreateTreeTest.cfg"; + private static final String SCEN_SCENARIO3_TEST = "Scenario3"; + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private TraceControlTestFacility fFacility; + private TestRemoteSystemProxy fProxy; + private String fTestFile; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fFacility = TraceControlTestFacility.getInstance(); + fFacility.init(); + fProxy = new TestRemoteSystemProxy(); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestFile = testfile.getAbsolutePath(); + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + fFacility.waitForJobs(); + fFacility.dispose(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * Would fail the test + */ + @Test + public void testTraceSessionTree() throws Exception { + + fProxy.setTestFile(fTestFile); + fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); + + ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); + + root.addChild(node); + fFacility.waitForJobs(); + + fFacility.executeCommand(node, "connect"); + int i = 0; + while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { + i++; + fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); + } + + // Verify that node is connected + assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); + + // Get provider groups + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + // Initialize dialog implementations for command execution + TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); + TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); + TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); + + // Initialize session handling scenario + fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); + + // ------------------------------------------------------------------------ + // Create session + // ------------------------------------------------------------------------ + TraceSessionComponent session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals("mysession", session.getName()); + assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath()); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + + // Initialize scenario + fProxy.setScenario(SCEN_SCENARIO3_TEST); + + // ------------------------------------------------------------------------ + // Enable channel on session + // ------------------------------------------------------------------------ + EnableChannelDialogStub channelStub = new EnableChannelDialogStub(); + channelStub.setIsKernel(true); + TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub); + + fFacility.executeCommand(session, "enableChannelOnSession"); + + // Verify that Kernel domain was created + ITraceControlComponent[] domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + assertEquals("Kernel", domains[0].getName()); + + // Verify that channel was created with correct data + ITraceControlComponent[] channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(1, channels.length); + + assertTrue(channels[0] instanceof TraceChannelComponent); + TraceChannelComponent channel = (TraceChannelComponent) channels[0]; + assertEquals("mychannel", channel.getName()); + assertEquals(4, channel.getNumberOfSubBuffers()); + assertEquals("splice()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); + assertEquals(true, channel.isOverwriteMode()); + assertEquals(200, channel.getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channel.getState()); + assertEquals(16384, channel.getSubBufferSize()); + assertEquals(100, channel.getSwitchTimer()); + + // ------------------------------------------------------------------------ + // Create channel on domain + // ------------------------------------------------------------------------ + ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo(); + info.setName("mychannel2"); + info.setOverwriteMode(false); + info.setSubBufferSize(32768); + info.setNumberOfSubBuffers(2); + info.setSwitchTimer(100); + info.setReadTimer(200); + channelStub.setChannelInfo(info); + + fFacility.executeCommand(domains[0], "enableChannelOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(2, channels.length); + + assertTrue(channels[1] instanceof TraceChannelComponent); + channel = (TraceChannelComponent) channels[1]; + assertEquals("mychannel2", channel.getName()); + assertEquals(2, channel.getNumberOfSubBuffers()); + assertEquals("splice()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); + assertEquals(false, channel.isOverwriteMode()); + assertEquals(200, channel.getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channel.getState()); + assertEquals(32768, channel.getSubBufferSize()); + assertEquals(100, channel.getSwitchTimer()); + + EnableEventsDialogStub eventsDialogStub = new EnableEventsDialogStub(); + eventsDialogStub.setIsTracePoints(true); + List events = new ArrayList<>(); + events.add("sched_kthread_stop"); + events.add("sched_kthread_stop_ret"); + eventsDialogStub.setNames(events); + eventsDialogStub.setIsKernel(true); + TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub); + + // ------------------------------------------------------------------------ + // disable channels + // ------------------------------------------------------------------------ + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(2, channels.length); + + fFacility.executeCommand(channels, "disableChannel"); + + assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[0]).getState()); + assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[1]).getState()); + + // ------------------------------------------------------------------------ + // enable channels + // ------------------------------------------------------------------------ + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(2, channels.length); + + fFacility.executeCommand(channels, "enableChannel"); + + assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[0]).getState()); + assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[1]).getState()); + + // ------------------------------------------------------------------------ + // enable event (tracepoints) on session + // ------------------------------------------------------------------------ + fFacility.executeCommand(session, "enableEventOnSession"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(3, channels.length); + + assertTrue(channels[2] instanceof TraceChannelComponent); + channel = (TraceChannelComponent) channels[2]; + assertEquals("channel0", channel.getName()); + // No need to check parameters of default channel because that has been done in other tests + + ITraceControlComponent[] channel0Events = channel.getChildren(); + assertEquals(2, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + assertTrue(channel0Events[1] instanceof TraceEventComponent); + + TraceEventComponent event = (TraceEventComponent) channel0Events[0]; + assertEquals("sched_kthread_stop_ret", event.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + event = (TraceEventComponent) channel0Events[1]; + assertEquals("sched_kthread_stop", event.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // enable event (tracepoints) on domain + // ------------------------------------------------------------------------ + events.clear(); + events.add("sched_wakeup_new"); + eventsDialogStub.setNames(events); + + fFacility.executeCommand(domains[0], "enableEventOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel = (TraceChannelComponent) channels[2]; + + channel0Events = channel.getChildren(); + assertEquals(3, channel0Events.length); + + assertTrue(channel0Events[2] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[2]; + assertEquals("sched_wakeup_new", event.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // enable event (tracepoints) on channel + // ------------------------------------------------------------------------ + events.clear(); + eventsDialogStub.setNames(events); + eventsDialogStub.setIsAllTracePoints(true); + + fFacility.executeCommand(channels[1], "enableEventOnChannel"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + // No need to check parameters of default channel because that has been done in other tests + channel = (TraceChannelComponent) channels[1]; + + channel0Events = channel.getChildren(); + assertEquals(3, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + assertTrue(channel0Events[1] instanceof TraceEventComponent); + assertTrue(channel0Events[2] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("sched_kthread_stop_ret", event.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + event = (TraceEventComponent) channel0Events[1]; + assertEquals("sched_kthread_stop", event.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + event = (TraceEventComponent) channel0Events[2]; + assertEquals("sched_wakeup_new", event.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // enable event (syscall) on channel + // ------------------------------------------------------------------------ + events.clear(); + eventsDialogStub.setIsTracePoints(false); + eventsDialogStub.setIsAllTracePoints(false); + eventsDialogStub.setIsSysCalls(true); + + fFacility.executeCommand(channels[0], "enableEventOnChannel"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[0]; + // No need to check parameters of default channel because that has been done in other tests + + channel = (TraceChannelComponent) channels[0]; + + channel0Events = channel.getChildren(); + assertEquals(1, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("syscalls", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.SYSCALL, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // enable event (syscall) on domain + // ------------------------------------------------------------------------ + fFacility.executeCommand(domains[0], "enableEventOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[0]; + // No need to check parameters of default channel because that has been done in other tests + + channel = (TraceChannelComponent) channels[2]; + + channel0Events = channel.getChildren(); + assertEquals(4, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("syscalls", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.SYSCALL, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // enable event (syscall) on session + // ------------------------------------------------------------------------ + fFacility.executeCommand(session, "enableEventOnSession"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[0]; + // No need to check parameters of default channel because that has been done in other tests + + channel = (TraceChannelComponent) channels[2]; + + channel0Events = channel.getChildren(); + assertEquals(4, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("syscalls", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.SYSCALL, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + + // ------------------------------------------------------------------------ + // enable event (dynamic probe) on domain + // ------------------------------------------------------------------------ + events.clear(); + eventsDialogStub.setIsSysCalls(false); + eventsDialogStub.setIsDynamicProbe(true); + eventsDialogStub.setDynamicProbe("0xc0101280"); + eventsDialogStub.setProbeEventName("myevent1"); + + fFacility.executeCommand(domains[0], "enableEventOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(5, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); + + TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[0]; + assertEquals("myevent1", probeEvent.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); + assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); + assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); + assertNull(probeEvent.getOffset()); + assertEquals("0xc0101280", probeEvent.getAddress()); + assertNull(probeEvent.getSymbol()); + + // ------------------------------------------------------------------------ + // enable event (dynamic probe) on channel + // ------------------------------------------------------------------------ + eventsDialogStub.setIsDynamicProbe(true); + eventsDialogStub.setDynamicProbe("init_post"); + eventsDialogStub.setProbeEventName("myevent2"); + + fFacility.executeCommand(channels[2], "enableEventOnChannel"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(6, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); + + probeEvent = (TraceProbeEventComponent) channel0Events[0]; + assertEquals("myevent2", probeEvent.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); + assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); + assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); + assertEquals("0x0", probeEvent.getOffset()); + assertNull(null, probeEvent.getAddress()); + assertEquals("init_post", probeEvent.getSymbol()); + + // ------------------------------------------------------------------------ + // enable event (dynamic probe) on session + // ------------------------------------------------------------------------ + eventsDialogStub.setIsDynamicProbe(true); + eventsDialogStub.setDynamicProbe("init_post:0x1000"); + eventsDialogStub.setProbeEventName("myevent3"); + + fFacility.executeCommand(session, "enableEventOnSession"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(7, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); + + probeEvent = (TraceProbeEventComponent) channel0Events[0]; + assertEquals("myevent3", probeEvent.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); + assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); + assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); + assertEquals("0x1000", probeEvent.getOffset()); + assertNull(null, probeEvent.getAddress()); + assertEquals("init_post", probeEvent.getSymbol()); + + // ------------------------------------------------------------------------ + // enable event (dynamic function probe) on session + // ------------------------------------------------------------------------ + eventsDialogStub.setIsDynamicProbe(false); + eventsDialogStub.setDynamicProbe(null); + eventsDialogStub.setProbeEventName(null); + eventsDialogStub.setIsFunctionProbe(true); + eventsDialogStub.setFunctionEventName("myevent4"); + eventsDialogStub.setFunctionProbe("create_dev"); + + fFacility.executeCommand(session, "enableEventOnSession"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(8, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); + + probeEvent = (TraceProbeEventComponent) channel0Events[0]; + assertEquals("myevent4", probeEvent.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); + // Changed for Bug fix 419454 to function event which was introduced by LTTng 2.2 + assertEquals(TraceEventType.FUNCTION, probeEvent.getEventType()); + assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); + assertEquals("0x0", probeEvent.getOffset()); + assertNull(null, probeEvent.getAddress()); + assertEquals("create_dev", probeEvent.getSymbol()); + + // ------------------------------------------------------------------------ + // enable event (dynamic function probe) on domain + // ------------------------------------------------------------------------ + eventsDialogStub.setIsFunctionProbe(true); + eventsDialogStub.setFunctionEventName("myevent5"); + eventsDialogStub.setFunctionProbe("create_dev:0x2000"); + + fFacility.executeCommand(domains[0], "enableEventOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(9, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); + + probeEvent = (TraceProbeEventComponent) channel0Events[0]; + assertEquals("myevent5", probeEvent.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); + assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); + assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); + assertEquals("0x2000", probeEvent.getOffset()); + assertNull(null, probeEvent.getAddress()); + assertEquals("create_dev", probeEvent.getSymbol()); + + // ------------------------------------------------------------------------ + // enable event (dynamic function probe) on channel + // ------------------------------------------------------------------------ + eventsDialogStub.setIsFunctionProbe(true); + eventsDialogStub.setFunctionEventName("myevent"); + eventsDialogStub.setFunctionProbe("create_dev:0x2000"); + + fFacility.executeCommand(channels[0], "enableEventOnChannel"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[0]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(2, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceProbeEventComponent); + + probeEvent = (TraceProbeEventComponent) channel0Events[0]; + assertEquals("myevent", probeEvent.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); + assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); + assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); + assertEquals("0x2000", probeEvent.getOffset()); + assertNull(null, probeEvent.getAddress()); + assertEquals("create_dev", probeEvent.getSymbol()); + + // ------------------------------------------------------------------------ + // Add Context on domain + // ------------------------------------------------------------------------ + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + AddContextDialogStub addContextStub = new AddContextDialogStub(); + List contexts = new ArrayList<>(); + contexts.add("prio"); + contexts.add("perf:branch-misses"); + contexts.add("perf:cache-misses"); + addContextStub.setContexts(contexts); + TraceControlDialogFactory.getInstance().setAddContextDialog(addContextStub); + + fFacility.executeCommand(domains[0], "addContextOnDomain"); + // Currently there is nothing to verify because the list commands don't show any context information + // However, the execution of the command make sure that the correct service command line is build and executed. + + // ------------------------------------------------------------------------ + // Add Context on channel + // ------------------------------------------------------------------------ + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + //Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[0]; + + try { + // The setContext() verifies that the contexts set are part of the available contexts + // The available contexts are set by the command handler addContextOnDomain above. + // So we indirectly test here that the parsing and setting of available contexts were + // done correctly above. + addContextStub.setContexts(contexts); + } catch (IllegalArgumentException e) { + fail("Exception caught - unknown context"); + } + + fFacility.executeCommand(channel, "addContextOnChannel"); + // Currently there is nothing to verify because the list commands don't show any context information + // However, the execution of the command make sure that the correct service command line is build and executed. + + // ------------------------------------------------------------------------ + // Add Context on event + // ------------------------------------------------------------------------ + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + //Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + + channel0Events = channel.getChildren(); + + event = (TraceEventComponent) channel0Events[6]; + + fFacility.executeCommand(event, "addContextOnEvent"); + // Currently there is nothing to verify because the list commands don't show any context information + // However, the execution of the command make sure that the correct service command line is build and executed. + + // ------------------------------------------------------------------------ + // Calibrate + // ------------------------------------------------------------------------ + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + fFacility.executeCommand(domains[0], "calibrate"); + // There is nothing to verify here. + // However, the execution of the command make sure that the correct service command line is build and executed. + + // ------------------------------------------------------------------------ + // refresh + // ------------------------------------------------------------------------ + fFacility.executeCommand(node, "refresh"); + groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + assertEquals(3, groups[0].getChildren().length); // provider + assertEquals(1, groups[1].getChildren().length); // sessions + assertEquals(1, groups[1].getChildren()[0].getChildren().length); // domains + assertEquals(3, groups[1].getChildren()[0].getChildren()[0].getChildren().length); // channels + assertEquals(2, groups[1].getChildren()[0].getChildren()[0].getChildren()[0].getChildren().length); // events (of channel[0]) + + // Initialize session handling scenario + fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); + + session = (TraceSessionComponent)groups[1].getChildren()[0]; + + // ------------------------------------------------------------------------ + // start session + // ------------------------------------------------------------------------ + fFacility.startSession(session); + assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); + + // ------------------------------------------------------------------------ + // stop session + // ------------------------------------------------------------------------ + fFacility.stopSession(session); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + + // ------------------------------------------------------------------------ + // Destroy session + // ------------------------------------------------------------------------ + + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + //------------------------------------------------------------------------- + // Disconnect node + //------------------------------------------------------------------------- + fFacility.executeCommand(node, "disconnect"); + assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); + + //------------------------------------------------------------------------- + // Delete node + //------------------------------------------------------------------------- + + fFacility.executeCommand(node, "delete"); + assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length); + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java new file mode 100644 index 0000000000..12e41ce3be --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlPropertiesTest.java @@ -0,0 +1,360 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.*; + +import java.io.File; +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.BaseEventPropertySource; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.KernelProviderPropertySource; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TargetNodePropertySource; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceChannelPropertySource; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceDomainPropertySource; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceEventPropertySource; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceProbeEventPropertySource; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceSessionPropertySource; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.UstProviderPropertySource; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.ui.views.properties.IPropertySource; +import org.junit.After; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class TraceControlPropertiesTest contains tests for the all + * property class. + */ +public class TraceControlPropertiesTest { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private static final String DIRECTORY = "testfiles"; + private static final String TEST_STREAM = "ListInfoTest.cfg"; + private static final String SCEN_LIST_INFO_TEST = "ListInfoTest"; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + TraceControlTestFacility.getInstance().waitForJobs(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * This will fail the test + */ + @Test + public void testComponentProperties() throws Exception { + + TestRemoteSystemProxy proxy = new TestRemoteSystemProxy(); + + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(DIRECTORY + File.separator + TEST_STREAM), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + proxy.setTestFile(testfile.getAbsolutePath()); + proxy.setScenario(SCEN_LIST_INFO_TEST); + + ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, proxy); + + root.addChild(node); + node.connect(); + + TraceControlTestFacility.getInstance().waitForJobs(); + + // ------------------------------------------------------------------------ + // Verify Node Properties (adapter) + // ------------------------------------------------------------------------ + Object adapter = node.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof TargetNodePropertySource); + + TargetNodePropertySource source = (TargetNodePropertySource)adapter; + + assertNull(source.getEditableValue()); + assertFalse(source.isPropertySet(TargetNodePropertySource.TARGET_NODE_NAME_PROPERTY_ID)); + assertNotNull(source.getPropertyDescriptors()); + + assertEquals("myNode", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_NAME_PROPERTY_ID)); + assertEquals("LOCALHOST", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_ADDRESS_PROPERTY_ID)); + assertEquals(TargetNodeState.CONNECTED.name(), source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_STATE_PROPERTY_ID)); + assertEquals("2.1.0", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_VERSION_PROPERTY_ID)); + assertNull(source.getPropertyValue("test")); + + adapter = node.getAdapter(IChannelInfo.class); + assertNull(adapter); + + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + ITraceControlComponent[] providers = groups[0].getChildren(); + + assertNotNull(providers); + assertEquals(3, providers.length); + + // ------------------------------------------------------------------------ + // Verify Kernel Provider Properties (adapter) + // ------------------------------------------------------------------------ + KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0]; + + adapter = kernelProvider.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof KernelProviderPropertySource); + + KernelProviderPropertySource kernelSource = (KernelProviderPropertySource)adapter; + assertNotNull(kernelSource.getPropertyDescriptors()); + + assertEquals("Kernel", kernelSource.getPropertyValue(KernelProviderPropertySource.KERNEL_PROVIDER_NAME_PROPERTY_ID)); + + // ------------------------------------------------------------------------ + // Verify UST Provider Properties (adapter) + // ------------------------------------------------------------------------ + UstProviderComponent ustProvider = (UstProviderComponent) providers[1]; + + adapter = ustProvider.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof UstProviderPropertySource); + + UstProviderPropertySource ustSource = (UstProviderPropertySource)adapter; + assertNotNull(ustSource.getPropertyDescriptors()); + + assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustSource.getPropertyValue(UstProviderPropertySource.UST_PROVIDER_NAME_PROPERTY_ID)); + assertEquals(String.valueOf(9379), ustSource.getPropertyValue(UstProviderPropertySource.UST_PROVIDER_PID_PROPERTY_ID)); + + // ------------------------------------------------------------------------ + // Verify Base Event Properties (adapter) + // ------------------------------------------------------------------------ + ITraceControlComponent[] events = ustProvider.getChildren(); + assertNotNull(events); + assertEquals(2, events.length); + + BaseEventComponent baseEventInfo = (BaseEventComponent) events[0]; + assertNotNull(baseEventInfo); + + adapter = baseEventInfo.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof BaseEventPropertySource); + + BaseEventPropertySource baseSource = (BaseEventPropertySource)adapter; + assertNotNull(baseSource.getPropertyDescriptors()); + + assertEquals("ust_tests_hello:tptest_sighandler", baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_NAME_PROPERTY_ID)); + assertEquals(TraceEventType.TRACEPOINT.name(), baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_TYPE_PROPERTY_ID)); + assertEquals(TraceLogLevel.TRACE_DEBUG_MODULE.name(), baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_LOGLEVEL_PROPERTY_ID)); + + baseEventInfo = (BaseEventComponent) events[1]; + assertNotNull(baseEventInfo); + + adapter = baseEventInfo.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof BaseEventPropertySource); + baseSource = (BaseEventPropertySource)adapter; + assertNotNull(baseSource.getPropertyDescriptors()); + assertEquals("doublefield=float;floatfield=float;stringfield=string", baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_FIELDS_PROPERTY_ID)); + + // ------------------------------------------------------------------------ + // Verify Session Properties (adapter) + // ------------------------------------------------------------------------ + ITraceControlComponent[] sessions = groups[1].getChildren(); + assertNotNull(sessions); + assertEquals(2, sessions.length); + + TraceSessionComponent session = (TraceSessionComponent)sessions[1]; + + adapter = session.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof TraceSessionPropertySource); + + TraceSessionPropertySource sessionSource = (TraceSessionPropertySource)adapter; + assertNotNull(sessionSource.getPropertyDescriptors()); + + assertEquals("mysession", sessionSource.getPropertyValue(TraceSessionPropertySource.TRACE_SESSION_NAME_PROPERTY_ID)); + assertEquals("/home/user/lttng-traces/mysession-20120129-084256", sessionSource.getPropertyValue(TraceSessionPropertySource.TRACE_SESSION_PATH_PROPERTY_ID)); + assertEquals(TraceSessionState.ACTIVE.name(), sessionSource.getPropertyValue(TraceSessionPropertySource.TRACE_SESSION_STATE_PROPERTY_ID)); + + // ------------------------------------------------------------------------ + // Verify Domain Provider Properties (adapter) + // ------------------------------------------------------------------------ + ITraceControlComponent[] domains = session.getChildren(); + assertNotNull(domains); + assertEquals(2, domains.length); + + TraceDomainComponent domain = (TraceDomainComponent) domains[0]; + adapter = domain.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof TraceDomainPropertySource); + + TraceDomainPropertySource domainSource = (TraceDomainPropertySource)adapter; + assertNotNull(domainSource.getPropertyDescriptors()); + + assertEquals("Kernel", domainSource.getPropertyValue(TraceDomainPropertySource.TRACE_DOMAIN_NAME_PROPERTY_ID)); + assertEquals(BufferType.BUFFER_SHARED.getInName(), domainSource.getPropertyValue(TraceDomainPropertySource.BUFFER_TYPE_PROPERTY_ID)); + + ITraceControlComponent[] channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(2, channels.length); + + // ------------------------------------------------------------------------ + // Verify Channel Properties (adapter) + // ------------------------------------------------------------------------ + assertTrue(channels[0] instanceof TraceChannelComponent); + TraceChannelComponent channel = (TraceChannelComponent) channels[0]; + + adapter = channel.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof TraceChannelPropertySource); + + TraceChannelPropertySource channelSource = (TraceChannelPropertySource)adapter; + assertNotNull(channelSource.getPropertyDescriptors()); + + assertEquals("channel0", channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_NAME_PROPERTY_ID)); + assertEquals(String.valueOf(4), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID)); + assertEquals(TraceEnablement.ENABLED.name(), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_STATE_PROPERTY_ID)); + assertEquals(String.valueOf(false), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID)); + assertEquals("splice()", channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID)); + assertEquals(String.valueOf(200), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_READ_TIMER_PROPERTY_ID)); + assertEquals(String.valueOf(262144), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID)); + assertEquals(String.valueOf(0), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID)); + + // ------------------------------------------------------------------------ + // Verify Event Properties (adapter) + // ------------------------------------------------------------------------ + ITraceControlComponent[] channel0Events = channel.getChildren(); + assertNotNull(channel0Events); + assertEquals(5, channel0Events.length); + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + TraceEventComponent event = (TraceEventComponent) channel0Events[0]; + + adapter = event.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof TraceEventPropertySource); + + TraceEventPropertySource eventSource = (TraceEventPropertySource)adapter; + assertNotNull(eventSource.getPropertyDescriptors()); + + assertEquals("block_rq_remap", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID)); + assertEquals(TraceLogLevel.TRACE_EMERG.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); + assertEquals(TraceEventType.TRACEPOINT.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID)); + assertEquals(TraceEnablement.ENABLED.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID)); + + // ------------------------------------------------------------------------ + // Verify Probe Event Properties (adapter) + // ------------------------------------------------------------------------ + assertTrue(channel0Events[2] instanceof TraceProbeEventComponent); + + TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[2]; + + adapter = probeEvent.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof TraceProbeEventPropertySource); + + TraceProbeEventPropertySource probeEventSource = (TraceProbeEventPropertySource)adapter; + assertNotNull(probeEventSource.getPropertyDescriptors()); + assertEquals(4, probeEventSource.getPropertyDescriptors().length); + + assertEquals("myevent2", probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID)); + assertEquals(TraceEventType.PROBE.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID)); + assertEquals(TraceEnablement.ENABLED.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID)); + assertEquals("0xc0101340", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID)); + + assertTrue(channel0Events[3] instanceof TraceProbeEventComponent); + + probeEvent = (TraceProbeEventComponent) channel0Events[3]; + + adapter = probeEvent.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof TraceProbeEventPropertySource); + + probeEventSource = (TraceProbeEventPropertySource)adapter; + assertNotNull(probeEventSource.getPropertyDescriptors()); + assertEquals(5, probeEventSource.getPropertyDescriptors().length); + + assertEquals("myevent0", probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID)); + assertEquals(TraceEventType.PROBE.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID)); + assertEquals(TraceEnablement.ENABLED.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID)); + assertEquals("0x0", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID)); + assertEquals("init_post", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID)); + + //------------------------------------------------------------------------- + // Verify Filter of UST event + //------------------------------------------------------------------------- + event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[0]; + adapter = event.getAdapter(IPropertySource.class); + assertEquals("with filter", event.getFilterExpression()); + + //------------------------------------------------------------------------- + // Verify Log Level Type of UST events (> LTTng 2.4) + //------------------------------------------------------------------------- + event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[0]; + adapter = event.getAdapter(IPropertySource.class); + eventSource = (TraceEventPropertySource) adapter; + assertEquals("== TRACE_DEBUG_LINE", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); + + event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[1]; + adapter = event.getAdapter(IPropertySource.class); + eventSource = (TraceEventPropertySource) adapter; + assertEquals("<= TRACE_INFO", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); + + event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[2]; + adapter = event.getAdapter(IPropertySource.class); + eventSource = (TraceEventPropertySource) adapter; + assertEquals("TRACE_DEBUG_SYSTEM", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); + + //------------------------------------------------------------------------- + // Delete node + //------------------------------------------------------------------------- + node.disconnect(); + node.getParent().removeChild(node); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTests.java new file mode 100644 index 0000000000..569de1d086 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTests.java @@ -0,0 +1,220 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceSessionPropertySource; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.ui.views.properties.IPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertySource; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class TraceControlSnapshotSessionTests contains Snapshot + * session test cases for support of LTTng Tools 2.3. + */ +public class TraceControlSnapshotSessionTests { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private static final String TEST_STREAM = "CreateSessionTest2.cfg"; + private static final String SCEN_CREATE_SESSION = "ScenCreateSession"; + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private TraceControlTestFacility fFacility; + private TestRemoteSystemProxy fProxy; + private String fTestFile; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fFacility = TraceControlTestFacility.getInstance(); + fFacility.init(); + fProxy = new TestRemoteSystemProxy(); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestFile = testfile.getAbsolutePath(); + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + fFacility.waitForJobs(); + fFacility.dispose(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * This will fail the test + */ + @Test + public void testTraceSessionTree() throws Exception { + + fProxy.setTestFile(fTestFile); + fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); + + ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); + + root.addChild(node); + fFacility.waitForJobs(); + + fFacility.executeCommand(node, "connect"); + int i = 0; + while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { + i++; + fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); + } + + // Get provider groups + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + // Initialize dialog implementations for command execution + // --- snapshot session --- + CreateSessionDialogStub sessionDialog = new CreateSessionDialogStub(); + sessionDialog.setSnapshot(true); + + TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialog); + TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); + TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); + + // Initialize scenario + fProxy.setScenario(SCEN_CREATE_SESSION); + + // ------------------------------------------------------------------------ + // Create session + // ------------------------------------------------------------------------ + TraceSessionComponent session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals("mysession", session.getName()); + assertTrue(session.isSnapshotSession()); + assertNotNull(session.getSnapshotInfo()); + assertEquals("snapshot-1", session.getSnapshotInfo().getName()); + assertEquals("/home/user/lttng-traces/mysession-20130913-141651", session.getSnapshotInfo().getSnapshotPath()); + assertEquals(1, session.getSnapshotInfo().getId()); + + // ------------------------------------------------------------------------ + // Start session + // ------------------------------------------------------------------------ + fFacility.startSession(session); + assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); + + // verify properties + Object adapter = session.getAdapter(IPropertySource.class); + assertNotNull(adapter); + assertTrue(adapter instanceof TraceSessionPropertySource); + + TraceSessionPropertySource sessionSource = (TraceSessionPropertySource)adapter; + IPropertyDescriptor[] descriptors = sessionSource.getPropertyDescriptors(); + assertNotNull(descriptors); + + Map map = new HashMap<>(); + map.put(TraceSessionPropertySource.TRACE_SESSION_NAME_PROPERTY_ID, "mysession"); + map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_NAME_PROPERTY_ID, "snapshot-1"); + map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_PATH_PROPERTY_ID, "/home/user/lttng-traces/mysession-20130913-141651"); + map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_ID_PROPERTY_ID, "1"); + map.put(TraceSessionPropertySource.TRACE_SESSION_STATE_PROPERTY_ID, TraceSessionState.ACTIVE.name()); + + for (int j = 0; j < descriptors.length; j++) { + String expected = map.get(descriptors[j].getId()); + assertNotNull(expected); + assertEquals(expected, sessionSource.getPropertyValue(descriptors[j].getId()).toString()); + } + + // ------------------------------------------------------------------------ + // Record snapshot + // ------------------------------------------------------------------------ + fFacility.executeCommand(session, "snapshot"); + + // ------------------------------------------------------------------------ + // Stop snapshot + // ------------------------------------------------------------------------ + fFacility.stopSession(session); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + + // ------------------------------------------------------------------------ + // Destroy session + // ------------------------------------------------------------------------ + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + //------------------------------------------------------------------------- + // Disconnect node + //------------------------------------------------------------------------- + fFacility.executeCommand(node, "disconnect"); + assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); + + //------------------------------------------------------------------------- + // Delete node + //------------------------------------------------------------------------- + + fFacility.executeCommand(node, "delete"); + + assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTestFacility.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTestFacility.java new file mode 100644 index 0000000000..ace1759e56 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTestFacility.java @@ -0,0 +1,286 @@ +/******************************************************************************* + * Copyright (c) 2011, 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: + * Bernd Hufmann - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.NotEnabledException; +import org.eclipse.core.commands.NotHandledException; +import org.eclipse.core.commands.common.NotDefinedException; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.IHandlerService; + +/** + * Singleton class to facilitate the test cases. Creates UML2SD view and loader objects as well as provides + * utility methods for interacting with the loader/view. + */ +@SuppressWarnings("javadoc") +public class TraceControlTestFacility { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + public final static int WAIT_FOR_JOBS_DELAY = 50; + public final static int GUI_REFESH_DELAY = 500; + + public final static String DIRECTORY = "testfiles"; + public final static String COMMAND_CATEGORY_PREFIX = "org.eclipse.linuxtools.internal.lttng2.ui.commands.control."; + public final static String SCEN_INIT_TEST = "Initialize"; + public final static String SCEN_SCENARIO_SESSION_HANDLING = "SessionHandling"; + public final static String SCEN_SCENARIO_SESSION_HANDLING_WITH_PATH = "SessionHandlingWithPath"; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + private static TraceControlTestFacility fInstance = null; + private ControlView fControlView = null; + private boolean fIsInitialized = false; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + private TraceControlTestFacility() { + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + public static TraceControlTestFacility getInstance() { + if (fInstance == null) { + fInstance = new TraceControlTestFacility(); + } + return fInstance; + } + + /** + * Initial the test facility. + */ + public void init() { + + if (!fIsInitialized) { + + IViewPart view; + try { + + view = PlatformUI.getWorkbench() + .getActiveWorkbenchWindow() + .getActivePage() + .findView("org.eclipse.ui.internal.introview"); + + if (view != null) { + PlatformUI.getWorkbench() + .getActiveWorkbenchWindow() + .getActivePage().hideView(view); + } + + view = PlatformUI.getWorkbench() + .getActiveWorkbenchWindow() + .getActivePage() + .showView(ControlView.ID); + + } catch (PartInitException e) { + throw new RuntimeException(e); + } + + fControlView = (ControlView) view; + + delay(3000); + fIsInitialized = true; + } + } + + + /** + * Disposes the facility (and GUI) + */ + public void dispose() { + if (fIsInitialized) { + waitForJobs(); + + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(fControlView); + fIsInitialized = false; + } + } + + /** + * Creates a delay for given time. + * @param waitTimeMillis - time in milli seconds + */ + public void delay(long waitTimeMillis) { + Display display = Display.getCurrent(); + if (display != null) { + long endTimeMillis = System.currentTimeMillis() + waitTimeMillis; + while(System.currentTimeMillis() < endTimeMillis) { + if (!display.readAndDispatch()) { + // We do not use Display.sleep because it might never wake up + // if there is no user interaction + try { + Thread.sleep(Math.min(waitTimeMillis, 10)); + } catch (final InterruptedException e) { + // Ignored + } + } + display.update(); + } + } else { + try { + Thread.sleep(waitTimeMillis); + } catch (InterruptedException e) { + // Ignored + } + } + } + + /** + * Waits for all Eclipse jobs to finish + */ + public void waitForJobs() { + while (!Job.getJobManager().isIdle()) { + delay(WAIT_FOR_JOBS_DELAY); + } + } + + /** + * @return current control view + */ + public ControlView getControlView() { + return fControlView; + } + + /** + * Executes an Eclipse command with command ID after selecting passed component + * @param component - component to select in the tree + * @param commandId - command ID + * @throws ExecutionException + * @throws NotDefinedException + * @throws NotEnabledException + * @throws NotHandledException + */ + public void executeCommand(ITraceControlComponent component, String commandId) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { + setSelection(component); + executeCommand(commandId); + } + + /** + * Executes an Eclipse command with command ID after selecting passed components + * @param components - array of components to select in the tree + * @param commandId - command ID + * @throws ExecutionException + * @throws NotDefinedException + * @throws NotEnabledException + * @throws NotHandledException + */ + public void executeCommand(ITraceControlComponent[] components, String commandId) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { + setSelection(components); + executeCommand(commandId); + } + + /** + * Executes an Eclipse command with command ID + * @param commandId + * @throws ExecutionException + * @throws NotDefinedException + * @throws NotEnabledException + * @throws NotHandledException + */ + public void executeCommand(String commandId) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { + IHandlerService handlerService = (IHandlerService) fControlView.getSite().getService(IHandlerService.class); + handlerService.executeCommand(COMMAND_CATEGORY_PREFIX + commandId, null); + waitForJobs(); + } + + /** + * Selects passed component + * @param component - component to select in the tree + * @param commandId - command ID + */ + public void setSelection(ITraceControlComponent component) { + fControlView.setSelection(component); + // Selection is done in own job + waitForJobs(); + } + + + /** + * Selects passed components + * @param components - array of component to select in the tree + * @param commandId - command ID + */ + public void setSelection(ITraceControlComponent[] components) { + fControlView.setSelection(components); + + // Selection is done in own job + waitForJobs(); + } + + /** + * Creates session on passed session group. + * @param group - session group + * @return - trace session group if it's successful else null + * @throws ExecutionException + * @throws NotDefinedException + * @throws NotEnabledException + * @throws NotHandledException + */ + public TraceSessionComponent createSession(ITraceControlComponent group) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { + executeCommand(group, "createSession"); + + ITraceControlComponent[] sessions = group.getChildren(); + if ((sessions == null) || (sessions.length == 0)) { + return null; + } + return (TraceSessionComponent)sessions[0]; + } + + /** + * Destroys a given session. + * @param session - session to destroy + * @throws ExecutionException + * @throws NotDefinedException + * @throws NotEnabledException + * @throws NotHandledException + */ + public void destroySession(TraceSessionComponent session) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { + executeCommand(session, "destroySession"); + } + + /** + * Starts a given session + * @param session - session to start + * @throws ExecutionException + * @throws NotDefinedException + * @throws NotEnabledException + * @throws NotHandledException + */ + public void startSession(TraceSessionComponent session) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { + executeCommand(session, "start"); + } + + /** + * Stops a given session + * @param session - session to stop + * @throws ExecutionException + * @throws NotDefinedException + * @throws NotEnabledException + * @throws NotHandledException + */ + public void stopSession(TraceSessionComponent session) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { + executeCommand(session, "stop"); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelNoProvidersTest.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelNoProvidersTest.java new file mode 100644 index 0000000000..76397a0950 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelNoProvidersTest.java @@ -0,0 +1,169 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlService; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.swt.graphics.Image; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class TraceControlTreeModelNoProvidersTest verifies that the + * Tracer Control can handle the case where no kernel provider and only UST + * provider are available. + */ +public class TraceControlTreeModelNoProvidersTest { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private static final String TEST_STREAM = "ListInfoTest.cfg"; + private static final String SCEN_LIST_INFO_TEST = "ListInfoTestNoKernel"; + private static final String TARGET_NODE_NAME = "myNode"; + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private TestRemoteSystemProxy fProxy; + private String fTestFile; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fProxy = new TestRemoteSystemProxy(); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestFile = testfile.getAbsolutePath(); + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + TraceControlTestFacility.getInstance().waitForJobs(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * This will fail the test + */ + @Test + public void testTraceControlComponents() throws Exception { + + fProxy.setTestFile(fTestFile); + fProxy.setScenario(SCEN_LIST_INFO_TEST); + + ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent(TARGET_NODE_NAME, root, host, fProxy); + + root.addChild(node); + node.connect(); + + TraceControlTestFacility.getInstance().waitForJobs(); + + // ------------------------------------------------------------------------ + // Verify Parameters of TargetNodeComponent + // ------------------------------------------------------------------------ + assertEquals("LOCALHOST", node.getHostName()); // assigned in createLocalHost() above + assertEquals("LOCALHOST", node.getToolTip()); // assigned in createLocalHost() above + Image connectedImage = node.getImage(); + assertNotNull(connectedImage); + assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); + assertNotNull(node.getControlService()); + ILttngControlService service = node.getControlService(); + assertTrue(service instanceof LTTngControlService); + node.setControlService(service); + assertTrue(node.getControlService() instanceof LTTngControlService); + + assertTrue(node.isPassiveCommunicationsListener()); + + // ------------------------------------------------------------------------ + // Verify Children of TargetNodeComponent + // ------------------------------------------------------------------------ + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + assertTrue(groups[0] instanceof TraceProviderGroup); + assertTrue(groups[1] instanceof TraceSessionGroup); + + // Check for kernel provider + TraceProviderGroup providerGroup = (TraceProviderGroup) groups[0]; + assertFalse(providerGroup.hasKernelProvider()); + + assertEquals("Provider", providerGroup.getName()); + assertEquals("Sessions", groups[1].getName()); + + // ------------------------------------------------------------------------ + // Verify TraceProviderGroup + // ------------------------------------------------------------------------ + ITraceControlComponent[] providers = groups[0].getChildren(); + + assertNotNull(providers); + assertEquals(1, providers.length); + assertTrue(providers[0] instanceof UstProviderComponent); + + // disconnect + node.disconnect(); + assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); + assertNotNull(node.getImage()); + assertNotSame(connectedImage, node.getImage()); + + node.getParent().removeChild(node); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelTest.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelTest.java new file mode 100644 index 0000000000..e932107845 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlTreeModelTest.java @@ -0,0 +1,701 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlService; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.swt.graphics.Image; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class TraceControlTreeModelTest contains tests for the tree + * component classes. + */ +public class TraceControlTreeModelTest { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private static final String TEST_STREAM = "ListInfoTest.cfg"; + private static final String SCEN_LIST_INFO_TEST = "ListInfoTest"; + private static final String TARGET_NODE_NAME = "myNode"; + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private TestRemoteSystemProxy fProxy; + private String fTestFile; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fProxy = new TestRemoteSystemProxy(); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestFile = testfile.getAbsolutePath(); + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + TraceControlTestFacility.getInstance().waitForJobs(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * This will fail the test + */ + @Test + public void testTraceControlComponents() throws Exception { + + fProxy.setTestFile(fTestFile); + fProxy.setScenario(SCEN_LIST_INFO_TEST); + + ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent(TARGET_NODE_NAME, root, host, fProxy); + + root.addChild(node); + node.connect(); + + TraceControlTestFacility.getInstance().waitForJobs(); + + // ------------------------------------------------------------------------ + // Verify Parameters of TargetNodeComponent + // ------------------------------------------------------------------------ + assertEquals("LOCALHOST", node.getHostName()); // assigned in createLocalHost() above + assertEquals("LOCALHOST", node.getToolTip()); // assigned in createLocalHost() above + Image connectedImage = node.getImage(); + assertNotNull(connectedImage); + assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); + assertNotNull(node.getControlService()); + ILttngControlService service = node.getControlService(); + assertTrue(service instanceof LTTngControlService); + node.setControlService(service); + assertTrue(node.getControlService() instanceof LTTngControlService); + + assertTrue(node.isPassiveCommunicationsListener()); + + // ------------------------------------------------------------------------ + // Verify Children of TargetNodeComponent + // ------------------------------------------------------------------------ + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + assertTrue(groups[0] instanceof TraceProviderGroup); + assertTrue(groups[1] instanceof TraceSessionGroup); + + assertEquals("Provider", groups[0].getName()); + assertEquals("Sessions", groups[1].getName()); + + // ------------------------------------------------------------------------ + // Verify TraceProviderGroup + // ------------------------------------------------------------------------ + ITraceControlComponent[] providers = groups[0].getChildren(); + + assertNotNull(providers); + assertEquals(3, providers.length); + + // ------------------------------------------------------------------------ + // Verify KernelProviderComponent + // ------------------------------------------------------------------------ + KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0]; + + // ------------------------------------------------------------------------ + // Verify event info (kernel provider) + // ------------------------------------------------------------------------ + ITraceControlComponent[] events = kernelProvider.getChildren(); + assertNotNull(events); + assertEquals(3, events.length); + + BaseEventComponent baseEventInfo = (BaseEventComponent) events[0]; + assertNotNull(baseEventInfo); + assertEquals("sched_kthread_stop", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + baseEventInfo = (BaseEventComponent) events[1]; + assertEquals("sched_kthread_stop_ret", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + baseEventInfo = (BaseEventComponent) events[2]; + assertEquals("sched_wakeup_new", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + // ------------------------------------------------------------------------ + // Verify UstProviderComponent + // ------------------------------------------------------------------------ + UstProviderComponent ustProvider = (UstProviderComponent) providers[1]; + assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustProvider.getName()); + assertEquals(9379, ustProvider.getPid()); + + // ------------------------------------------------------------------------ + // Verify event info (UST provider) + // ------------------------------------------------------------------------ + events = ustProvider.getChildren(); + assertNotNull(events); + assertEquals(2, events.length); + + baseEventInfo = (BaseEventComponent) events[0]; + assertNotNull(baseEventInfo); + assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_MODULE, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + baseEventInfo = (BaseEventComponent) events[1]; + assertEquals("ust_tests_hello:tptest", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_INFO, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + // ------------------------------------------------------------------------ + // Verify UstProviderComponent + // ------------------------------------------------------------------------ + ustProvider = (UstProviderComponent) providers[2]; + assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=4852]", ustProvider.getName()); + assertEquals(4852, ustProvider.getPid()); + + // verify getters and setter + verifyUstProviderGettersSetters(ustProvider); + + // ------------------------------------------------------------------------ + // Verify event info (UST provider) + // ------------------------------------------------------------------------ + events = ustProvider.getChildren(); + assertNotNull(events); + assertEquals(2, events.length); + + baseEventInfo = (BaseEventComponent) events[0]; + assertNotNull(baseEventInfo); + assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_WARNING, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + baseEventInfo = (BaseEventComponent) events[1]; + assertEquals("ust_tests_hello:tptest", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + // verify getters and setters + verifyBaseEventGettersSetters(baseEventInfo); + + // ------------------------------------------------------------------------ + // Verify TraceSessionGroup + // ------------------------------------------------------------------------ + ITraceControlComponent[] sessions = groups[1].getChildren(); + assertNotNull(sessions); + assertEquals(2, sessions.length); + for (int i = 0; i < sessions.length; i++) { + assertTrue(sessions[i] instanceof TraceSessionComponent); + } + assertEquals("mysession1", sessions[0].getName()); + assertEquals("mysession", sessions[1].getName()); + + // ------------------------------------------------------------------------ + // Verify TraceSessionComponent + // ------------------------------------------------------------------------ + TraceSessionComponent session = (TraceSessionComponent)sessions[1]; + assertEquals("mysession", session.getName()); + assertEquals("/home/user/lttng-traces/mysession-20120129-084256", session.getSessionPath()); + assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); + + // Verify setters and setters + verifySessionGetterSetters(session); + + ITraceControlComponent[] domains = session.getChildren(); + assertNotNull(domains); + assertEquals(2, domains.length); + + // ------------------------------------------------------------------------ + // Verify Kernel domain + // ------------------------------------------------------------------------ + assertEquals("Kernel", domains[0].getName()); + ITraceControlComponent[] channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(2, channels.length); + + // Verify setters and setters + verifyDomainGettersSetters((TraceDomainComponent) domains[0]); + + // ------------------------------------------------------------------------ + // Verify Kernel's channel0 + // ------------------------------------------------------------------------ + assertTrue(channels[0] instanceof TraceChannelComponent); + TraceChannelComponent channel = (TraceChannelComponent) channels[0]; + assertEquals("channel0", channel.getName()); + assertEquals(4, channel.getNumberOfSubBuffers()); + assertEquals("splice()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); + assertEquals(false, channel.isOverwriteMode()); + assertEquals(200, channel.getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channel.getState()); + assertEquals(262144, channel.getSubBufferSize()); + assertEquals(0, channel.getSwitchTimer()); + + // ------------------------------------------------------------------------ + // Verify event info (kernel, channel0) + // ------------------------------------------------------------------------ + ITraceControlComponent[] channel0Events = channel.getChildren(); + assertNotNull(channel0Events); + assertEquals(5, channel0Events.length); + assertTrue(channel0Events[0] instanceof TraceEventComponent); + assertTrue(channel0Events[1] instanceof TraceEventComponent); + assertTrue(channel0Events[2] instanceof TraceProbeEventComponent); + assertTrue(channel0Events[3] instanceof TraceProbeEventComponent); + assertTrue(channel0Events[4] instanceof TraceEventComponent); + + TraceEventComponent event = (TraceEventComponent) channel0Events[0]; + assertEquals("block_rq_remap", event.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + event = (TraceEventComponent) channel0Events[1]; + assertEquals("block_bio_remap", event.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.DISABLED, event.getState()); + + TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[2]; + assertEquals("myevent2", probeEvent.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); + assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); + assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); + assertEquals("0xc0101340", probeEvent.getAddress()); + assertNull(probeEvent.getOffset()); + assertNull(probeEvent.getSymbol()); + + // verify getters and setter + verifyProbeEventGettersSetters(probeEvent); + + probeEvent = (TraceProbeEventComponent) channel0Events[3]; + assertEquals("myevent0", probeEvent.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel()); + assertEquals(TraceEventType.PROBE, probeEvent.getEventType()); + assertEquals(TraceEnablement.ENABLED, probeEvent.getState()); + assertNull(probeEvent.getAddress()); + assertEquals("0x0", probeEvent.getOffset()); + assertEquals("init_post", probeEvent.getSymbol()); + + event = (TraceEventComponent) channel0Events[4]; + assertEquals("syscalls", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.SYSCALL, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Verify Kernel's channel1 + // ------------------------------------------------------------------------ + assertEquals("channel1", channels[1].getName()); + channel = (TraceChannelComponent) channels[1]; + assertEquals(4, channel.getNumberOfSubBuffers()); + assertEquals("splice()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); + assertEquals(true, channel.isOverwriteMode()); + assertEquals(400, channel.getReadTimer()); + assertEquals(TraceEnablement.DISABLED, channel.getState()); + assertEquals(524288, channel.getSubBufferSize()); + assertEquals(100, channel.getSwitchTimer()); + + // ------------------------------------------------------------------------ + // Verify event info (kernel, channel1) + // ------------------------------------------------------------------------ + ITraceControlComponent[] channel1Events = channels[1].getChildren(); + assertEquals(0, channel1Events.length); + + // ------------------------------------------------------------------------ + // Verify domain UST global + // ------------------------------------------------------------------------ + assertEquals("UST global", domains[1].getName()); + + ITraceControlComponent[] ustChannels = domains[1].getChildren(); + + for (int i = 0; i < ustChannels.length; i++) { + assertTrue(ustChannels[i] instanceof TraceChannelComponent); + } + + // ------------------------------------------------------------------------ + // Verify UST global's mychannel1 + // ------------------------------------------------------------------------ + channel = (TraceChannelComponent) ustChannels[0]; + assertEquals("mychannel1", channel.getName()); + assertEquals(8, channel.getNumberOfSubBuffers()); + assertEquals("mmap()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); + assertEquals(true, channel.isOverwriteMode()); + assertEquals(100, channel.getReadTimer()); + assertEquals(TraceEnablement.DISABLED, channel.getState()); + assertEquals(8192, channel.getSubBufferSize()); + assertEquals(200, channel.getSwitchTimer()); + + // verify getters and setters + verifyChannelGettersSetters(channel); + + // ------------------------------------------------------------------------ + // Verify event info (UST global, mychannel1) + // ------------------------------------------------------------------------ + ITraceControlComponent[] ustEvents = channel.getChildren(); + assertEquals(0, ustEvents.length); + + // ------------------------------------------------------------------------ + // Verify UST global's channel0 + // ------------------------------------------------------------------------ + channel = (TraceChannelComponent) ustChannels[1]; + assertEquals("channel0", channel.getName()); + assertEquals(4, channel.getNumberOfSubBuffers()); + assertEquals("mmap()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); + assertEquals(false, channel.isOverwriteMode()); + assertEquals(200, channel.getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channel.getState()); + assertEquals(4096, channel.getSubBufferSize()); + assertEquals(0, channel.getSwitchTimer()); + + // ------------------------------------------------------------------------ + // Verify event info (UST global, channel0) + // ------------------------------------------------------------------------ + ustEvents = channel.getChildren(); + assertEquals(4, ustEvents.length); + + event = (TraceEventComponent) ustEvents[0]; + assertEquals("ust_tests_hello:tptest_sighandler", event.getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, event.getLogLevel()); + assertEquals(LogLevelType.LOGLEVEL_ONLY, event.getLogLevelType()); + assertEquals(LogLevelType.LOGLEVEL_ONLY.getShortName(), event.getLogLevelType().getShortName()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.DISABLED, event.getState()); + + event = (TraceEventComponent) ustEvents[1]; + assertEquals("ust_tests_hello:tptest_sighandler1", event.getName()); + assertEquals(TraceLogLevel.TRACE_INFO, event.getLogLevel()); + assertEquals(LogLevelType.LOGLEVEL, event.getLogLevelType()); + assertEquals(LogLevelType.LOGLEVEL.getShortName(), event.getLogLevelType().getShortName()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.DISABLED, event.getState()); + + event = (TraceEventComponent) ustEvents[2]; + assertEquals("ust_tests_hello:tptest_sighandler2", event.getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_SYSTEM, event.getLogLevel()); + assertEquals(LogLevelType.LOGLEVEL_NONE, event.getLogLevelType()); + assertEquals(LogLevelType.LOGLEVEL_NONE.getShortName(), event.getLogLevelType().getShortName()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.DISABLED, event.getState()); + + event = (TraceEventComponent) ustEvents[3]; + assertEquals("*", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // verify getters and setters + verifyEventGettersSetters(event); + + // disconnect + node.disconnect(); + assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); + assertNotNull(node.getImage()); + assertNotSame(connectedImage, node.getImage()); + + node.getParent().removeChild(node); + } + + private static void verifySessionGetterSetters(TraceSessionComponent session) { + // save original values + String name = session.getName(); + String origPath = session.getSessionPath(); + TraceSessionState origState = session.getSessionState(); + + // test cases + session.setName("newName"); + assertEquals("newName", session.getName()); + + session.setSessionPath("/home/user/tmp"); + assertEquals("/home/user/tmp", session.getSessionPath()); + + session.setSessionState(TraceSessionState.INACTIVE); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + Image inactiveImage = session.getImage(); + assertNotNull(inactiveImage); + + session.setSessionState("active"); + assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); + + Image activeImage = session.getImage(); + assertNotNull(activeImage); + assertNotSame(activeImage, inactiveImage); + + ITraceControlComponent[] children = session.getChildren(); + TraceDomainComponent[] domains = session.getDomains(); + + assertEquals(children.length, domains.length); + + for (int i = 0; i < domains.length; i++) { + assertEquals(domains[i].getName(), children[i].getName()); + } + + // restore original values + session.setName(name); + session.setSessionPath(origPath); + session.setSessionState(origState); + } + + private static void verifyDomainGettersSetters(TraceDomainComponent domain) { + // save original values + boolean isKernel = domain.isKernel(); + + domain.setIsKernel(false); + assertFalse(domain.isKernel()); + domain.setIsKernel(true); + assertTrue(domain.isKernel()); + + ITraceControlComponent[] children = domain.getChildren(); + TraceChannelComponent[] channels = domain.getChannels(); + + assertEquals(children.length, channels.length); + + for (int i = 0; i < channels.length; i++) { + assertEquals(channels[i].getName(), children[i].getName()); + } + + String nodeName = domain.getTargetNode().getName(); + assertEquals(TARGET_NODE_NAME, nodeName); + + // restore original values + domain.setIsKernel(isKernel); + } + + private static void verifyBaseEventGettersSetters(BaseEventComponent event) { + // save original values + String name = event.getName(); + TraceLogLevel level = event.getLogLevel(); + TraceEventType type = event.getEventType(); + + // test cases + event.setName("newName"); + assertEquals("newName", event.getName()); + + event.setLogLevel(TraceLogLevel.TRACE_INFO); + assertEquals(TraceLogLevel.TRACE_INFO, event.getLogLevel()); + event.setLogLevel("TRACE_ALERT"); + assertEquals(TraceLogLevel.TRACE_ALERT, event.getLogLevel()); + + event.setEventType(TraceEventType.UNKNOWN); + assertEquals(TraceEventType.UNKNOWN, event.getEventType()); + event.setEventType("tracepoint"); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + + // restore original values + event.setName(name); + event.setLogLevel(level); + event.setEventType(type); + } + + private static void verifyEventGettersSetters(TraceEventComponent event) { + // save original values + String name = event.getName(); + TraceLogLevel level = event.getLogLevel(); + TraceEventType type = event.getEventType(); + TraceEnablement state = event.getState(); + + // test cases + event.setName("newName"); + assertEquals("newName", event.getName()); + + event.setLogLevel(TraceLogLevel.TRACE_INFO); + assertEquals(TraceLogLevel.TRACE_INFO, event.getLogLevel()); + event.setLogLevel("TRACE_ALERT"); + assertEquals(TraceLogLevel.TRACE_ALERT, event.getLogLevel()); + + event.setEventType(TraceEventType.UNKNOWN); + assertEquals(TraceEventType.UNKNOWN, event.getEventType()); + event.setEventType("tracepoint"); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + + event.setState("disabled"); + assertEquals(TraceEnablement.DISABLED, event.getState()); + + Image disabledImage = event.getImage(); + assertNotNull(disabledImage); + + event.setState(TraceEnablement.ENABLED); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + Image enabledImage = event.getImage(); + assertNotNull(enabledImage); + assertNotSame(enabledImage, disabledImage); + + // restore original values + event.setName(name); + event.setLogLevel(level); + event.setEventType(type); + event.setState(state); + } + + private static void verifyProbeEventGettersSetters(TraceProbeEventComponent event) { + // save original values + String address = event.getAddress(); + String offset = event.getOffset(); + String symbol = event.getSymbol(); + + // test cases + event.setAddress("0xffff1234"); + assertEquals("0xffff1234", event.getAddress()); + + event.setOffset("0x1234"); + assertEquals("0x1234", event.getOffset()); + + event.setSymbol("init"); + assertEquals("init", event.getSymbol()); + + // restore original values + event.setAddress(address); + event.setOffset(offset); + event.setSymbol(symbol); + } + + private static void verifyChannelGettersSetters(TraceChannelComponent channel) { + // save original values + String name = channel.getName(); + int nbSubBuffers = channel.getNumberOfSubBuffers(); + TraceChannelOutputType type = channel.getOutputType(); + boolean mode = channel.isOverwriteMode(); + long readTimer = channel.getReadTimer(); + TraceEnablement state = channel.getState(); + long subBufferSize = channel.getSubBufferSize(); + long switchTimer = channel.getSwitchTimer(); + + // test cases + channel.setName("newName"); + assertEquals("newName", channel.getName()); + + channel.setNumberOfSubBuffers(2); + assertEquals(2, channel.getNumberOfSubBuffers()); + + channel.setOutputType("splice()"); + assertEquals("splice()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType()); + + channel.setOverwriteMode(false); + assertEquals(false, channel.isOverwriteMode()); + + channel.setReadTimer(250); + assertEquals(250, channel.getReadTimer()); + + channel.setState("enabled"); + assertEquals(TraceEnablement.ENABLED, channel.getState()); + + Image enabledImage = channel.getImage(); + assertNotNull(enabledImage); + channel.setState(TraceEnablement.DISABLED); + assertEquals(TraceEnablement.DISABLED, channel.getState()); + + Image disabledImage = channel.getImage(); + assertNotNull(disabledImage); + assertNotSame(enabledImage, disabledImage); + + channel.setSubBufferSize(1024); + assertEquals(1024, channel.getSubBufferSize()); + + channel.setSwitchTimer(1000); + assertEquals(1000, channel.getSwitchTimer()); + + // restore original values + channel.setName(name); + channel.setNumberOfSubBuffers(nbSubBuffers); + channel.setOutputType(type); + channel.setOverwriteMode(mode); + channel.setReadTimer(readTimer); + channel.setState(state); + channel.setSubBufferSize(subBufferSize); + channel.setSwitchTimer(switchTimer); + } + + private static void verifyUstProviderGettersSetters(UstProviderComponent ustProvider) { + // save original values + String name = ustProvider.getName(); + int pid = ustProvider.getPid(); + + // test cases + ustProvider.setName("newName"); + assertEquals("newName", ustProvider.getName()); + + ustProvider.setPid(9876); + assertEquals(9876, ustProvider.getPid()); + + // restore original values + ustProvider.setName(name); + ustProvider.setPid(pid); + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstProviderTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstProviderTests.java new file mode 100644 index 0000000000..8d7b0666e9 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstProviderTests.java @@ -0,0 +1,296 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.*; + +import java.io.File; +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class TraceControlUstProviderTests contains UST provider + * handling test cases. + */ +public class TraceControlUstProviderTests { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private static final String TEST_STREAM = "CreateTreeTest.cfg"; + private static final String SCEN_SCENARIO2_TEST = "Scenario2"; + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private TraceControlTestFacility fFacility; + private TestRemoteSystemProxy fProxy; + private String fTestFile; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fFacility = TraceControlTestFacility.getInstance(); + fFacility.init(); + fProxy = new TestRemoteSystemProxy(); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestFile = testfile.getAbsolutePath(); + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + fFacility.waitForJobs(); + fFacility.dispose(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * This will fail the test + */ + @Test + public void testUstProviderTree() throws Exception { + + fProxy.setTestFile(fTestFile); + fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); + + ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); + root.addChild(node); + + fFacility.waitForJobs(); + + fFacility.executeCommand(node, "connect"); + + int i = 0; + while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { + i++; + fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); + } + + // Verify that node is connected + assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState()); + + // Get provider groups + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + // Get kernel provider + ITraceControlComponent[] providers = groups[0].getChildren(); + KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0]; + + // Get kernel provider events and select 2 events + ITraceControlComponent[] events = kernelProvider.getChildren(); + assertNotNull(events); + assertEquals(3, events.length); + + BaseEventComponent baseEventInfo0 = (BaseEventComponent) events[0]; + BaseEventComponent baseEventInfo1 = (BaseEventComponent) events[1]; + + // Initialize dialog implementations for command execution + TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); + TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); + TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); + + // ------------------------------------------------------------------------ + // Create session + // ------------------------------------------------------------------------ + // Initialize session handling scenario + fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING_WITH_PATH); + + CreateSessionDialogStub sessionDialogStub = new CreateSessionDialogStub(); + sessionDialogStub.setSessionPath("/home/user/temp"); + TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub); + + TraceSessionComponent session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals("mysession", session.getName()); + assertEquals("/home/user/temp", session.getSessionPath()); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + + // ------------------------------------------------------------------------ + // Enable Channel on UST global domain + // ------------------------------------------------------------------------ + fProxy.setScenario(SCEN_SCENARIO2_TEST); + EnableChannelDialogStub channelDialogStub = new EnableChannelDialogStub(); + channelDialogStub.setIsKernel(false); + channelDialogStub.getChannelInfo().setOverwriteMode(false); + channelDialogStub.getChannelInfo().setSwitchTimer(200); + channelDialogStub.getChannelInfo().setReadTimer(100); + channelDialogStub.getChannelInfo().setNumberOfSubBuffers(2); + TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelDialogStub); + + fFacility.executeCommand(session, "enableChannelOnSession"); + + // Verify that UST domain was created + ITraceControlComponent[] domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + assertEquals("UST global", domains[0].getName()); + + // Verify that channel was created with correct data + ITraceControlComponent[]channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(1, channels.length); + + assertTrue(channels[0] instanceof TraceChannelComponent); + TraceChannelComponent channel = (TraceChannelComponent) channels[0]; + assertEquals("mychannel", channel.getName()); + assertEquals(2, channel.getNumberOfSubBuffers()); + assertEquals("mmap()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); + assertEquals(false, channel.isOverwriteMode()); + assertEquals(100, channel.getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channel.getState()); + assertEquals(16384, channel.getSubBufferSize()); + assertEquals(200, channel.getSwitchTimer()); + + // ------------------------------------------------------------------------ + // Enable event on default channel on created session above + // ------------------------------------------------------------------------ + // Get first UST provider + UstProviderComponent ustProvider = (UstProviderComponent) providers[1]; + assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustProvider.getName()); + assertEquals(9379, ustProvider.getPid()); + + // Get events + events = ustProvider.getChildren(); + assertNotNull(events); + assertEquals(2, events.length); + + baseEventInfo0 = (BaseEventComponent) events[0]; + baseEventInfo1 = (BaseEventComponent) events[1]; + + ITraceControlComponent[] ustSelection = { baseEventInfo0, baseEventInfo1 }; + + fFacility.executeCommand(ustSelection, "assign.event"); + + // verify that events were created under the channel + // Note that domain and channel has to be re-read because the tree is re-created + + domains = session.getChildren(); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + + ITraceControlComponent[] ustEvents = channels[0].getChildren(); + assertEquals(2, ustEvents.length); + + TraceEventComponent event = (TraceEventComponent) ustEvents[0]; + assertEquals("ust_tests_hello:tptest_sighandler", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + event = (TraceEventComponent) ustEvents[1]; + assertEquals("ust_tests_hello:tptest", ustEvents[1].getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Disable event components + // ------------------------------------------------------------------------ + fFacility.executeCommand(event, "disableEvent"); + + assertEquals(TraceEnablement.DISABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Enable event component + // ------------------------------------------------------------------------ + fFacility.executeCommand(event, "enableEvent"); + + // Verify event state + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Destroy session + // ------------------------------------------------------------------------ + + // Initialize session handling scenario + fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); + + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + //------------------------------------------------------------------------- + // Disconnect node + //------------------------------------------------------------------------- + fFacility.executeCommand(node, "disconnect"); + assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); + + //------------------------------------------------------------------------- + // Delete node + //------------------------------------------------------------------------- + fFacility.executeCommand(node, "delete"); + assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests.java new file mode 100644 index 0000000000..5fa6c7e54a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests.java @@ -0,0 +1,548 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.*; + +import java.io.File; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableEventsDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class TraceControlUstSessionTests contains UST + * session/channel/event handling test cases. + */ +public class TraceControlUstSessionTests { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private static final String TEST_STREAM = "CreateTreeTest.cfg"; + private static final String SCEN_SCENARIO4_TEST = "Scenario4"; + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private TraceControlTestFacility fFacility; + private TestRemoteSystemProxy fProxy; + private String fTestFile; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fFacility = TraceControlTestFacility.getInstance(); + fFacility.init(); + fProxy = new TestRemoteSystemProxy(); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestFile = testfile.getAbsolutePath(); + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + fFacility.waitForJobs(); + fFacility.dispose(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * This will fail the test + */ + @Test + public void testTraceSessionTree() throws Exception { + + fProxy.setTestFile(fTestFile); + fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); + + ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); + + root.addChild(node); + fFacility.waitForJobs(); + + fFacility.executeCommand(node, "connect"); + int i = 0; + while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { + i++; + fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); + } + + // Get provider groups + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + // Initialize dialog implementations for command execution + TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); + TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); + TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); + + // Initialize session handling scenario + fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); + + // ------------------------------------------------------------------------ + // Create session + // ------------------------------------------------------------------------ + TraceSessionComponent session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals("mysession", session.getName()); + assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath()); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + + // Initialize scenario + fProxy.setScenario(SCEN_SCENARIO4_TEST); + + // ------------------------------------------------------------------------ + // Enable default channel on created session above + // ------------------------------------------------------------------------ + EnableChannelDialogStub channelStub = new EnableChannelDialogStub(); + channelStub.setIsKernel(false); + TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub); + + fFacility.executeCommand(session, "enableChannelOnSession"); + + // Verify that Kernel domain was created + ITraceControlComponent[] domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + assertEquals("UST global", domains[0].getName()); + assertEquals("Domain buffer Type", BufferType.BUFFER_TYPE_UNKNOWN, ((TraceDomainComponent)domains[0]).getBufferType()); + + // Verify that channel was created with correct data + ITraceControlComponent[] channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(1, channels.length); + + assertTrue(channels[0] instanceof TraceChannelComponent); + TraceChannelComponent channel = (TraceChannelComponent) channels[0]; + assertEquals("mychannel", channel.getName()); + assertEquals(4, channel.getNumberOfSubBuffers()); + assertEquals("mmap()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); + assertEquals(true, channel.isOverwriteMode()); + assertEquals(200, channel.getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channel.getState()); + assertEquals(16384, channel.getSubBufferSize()); + assertEquals(100, channel.getSwitchTimer()); + + // ------------------------------------------------------------------------ + // Enable channel on domain + // ------------------------------------------------------------------------ + ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo(); + info.setName("mychannel2"); + info.setOverwriteMode(false); + info.setSubBufferSize(32768); + info.setNumberOfSubBuffers(2); + info.setSwitchTimer(100); + info.setReadTimer(200); + channelStub.setChannelInfo(info); + + fFacility.executeCommand(domains[0], "enableChannelOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(2, channels.length); + + assertTrue(channels[1] instanceof TraceChannelComponent); + channel = (TraceChannelComponent) channels[1]; + assertEquals("mychannel2", channel.getName()); + assertEquals(2, channel.getNumberOfSubBuffers()); + assertEquals("mmap()", channel.getOutputType().getInName()); + assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType()); + assertEquals(false, channel.isOverwriteMode()); + assertEquals(200, channel.getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channel.getState()); + assertEquals(32768, channel.getSubBufferSize()); + assertEquals(100, channel.getSwitchTimer()); + + // ------------------------------------------------------------------------ + // Enable event (tracepoint) on session and default channel + // ------------------------------------------------------------------------ + EnableEventsDialogStub eventsDialogStub = new EnableEventsDialogStub(); + eventsDialogStub.setIsTracePoints(true); + List events = new ArrayList<>(); + events.add("ust_tests_hello:tptest_sighandler"); + eventsDialogStub.setNames(events); + eventsDialogStub.setIsKernel(false); + TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub); + + fFacility.executeCommand(session, "enableEventOnSession"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(3, channels.length); + + assertTrue(channels[2] instanceof TraceChannelComponent); + channel = (TraceChannelComponent) channels[2]; + assertEquals("channel0", channel.getName()); + // No need to check parameters of default channel because that has been done in other tests + + ITraceControlComponent[] channel0Events = channel.getChildren(); + assertEquals(1, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + TraceEventComponent event = (TraceEventComponent) channel0Events[0]; + assertEquals("ust_tests_hello:tptest_sighandler", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); // TODO + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Enable event (tracepoint) on domain and default channel + // ------------------------------------------------------------------------ + events.clear(); + events.add("ust_tests_hello:tptest"); + eventsDialogStub.setNames(events); + + fFacility.executeCommand(domains[0], "enableEventOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(2, channel0Events.length); + + assertTrue(channel0Events[1] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[1]; + assertEquals("ust_tests_hello:tptest", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); // TODO + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Enable event (all tracepoints) on specific channel + // ------------------------------------------------------------------------ + events.clear(); + eventsDialogStub.setNames(events); + eventsDialogStub.setIsAllTracePoints(true); + + fFacility.executeCommand(channels[1], "enableEventOnChannel"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[1]; + // No need to check parameters of default channel because that has been done in other tests + + channel = (TraceChannelComponent) channels[1]; + + channel0Events = channel.getChildren(); + assertEquals(1, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("*", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Enable event (wildcard) on specific channel + // ------------------------------------------------------------------------ + events.clear(); + eventsDialogStub.setIsTracePoints(false); + eventsDialogStub.setIsAllTracePoints(false); + eventsDialogStub.setIsWildcard(true); + eventsDialogStub.setWildcard("ust*"); + + fFacility.executeCommand(channels[0], "enableEventOnChannel"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[0]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(1, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("ust*", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Enable event (wildcard) on domain + // ------------------------------------------------------------------------ + events.clear(); + eventsDialogStub.setIsTracePoints(false); + eventsDialogStub.setIsAllTracePoints(false); + eventsDialogStub.setIsWildcard(true); + eventsDialogStub.setWildcard("ust*"); + + fFacility.executeCommand(domains[0], "enableEventOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[0]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(1, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("ust*", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Enable event (wildcard) on session + // ------------------------------------------------------------------------ + events.clear(); + eventsDialogStub.setIsTracePoints(false); + eventsDialogStub.setIsAllTracePoints(false); + eventsDialogStub.setIsWildcard(true); + eventsDialogStub.setWildcard("ust*"); + + fFacility.executeCommand(domains[0], "enableEventOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(4, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("u*", event.getName()); + assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Enable event (loglevel) on domain + // ------------------------------------------------------------------------ + events.clear(); + eventsDialogStub.setIsWildcard(false); + eventsDialogStub.setIsLogLevel(true); + eventsDialogStub.setLogLevelEventName("myevent1"); + eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL); + eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_WARNING); + + fFacility.executeCommand(domains[0], "enableEventOnDomain"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(5, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("myevent1", event.getName()); + assertEquals(TraceLogLevel.TRACE_WARNING, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Enable event (loglevel) on session + // ------------------------------------------------------------------------ + eventsDialogStub.setLogLevelEventName("myevent2"); + eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY); + eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION); + + fFacility.executeCommand(session, "enableEventOnSession"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[2]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(6, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("myevent2", event.getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Enable event (loglevel) on channel + // ------------------------------------------------------------------------ + eventsDialogStub.setLogLevelEventName("myevent0"); + eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY); + eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION); + + fFacility.executeCommand(channels[0], "enableEventOnChannel"); + + // Get Kernel domain component instance + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + channel = (TraceChannelComponent) channels[0]; + // No need to check parameters of default channel because that has been done in other tests + + channel0Events = channel.getChildren(); + assertEquals(2, channel0Events.length); + + assertTrue(channel0Events[0] instanceof TraceEventComponent); + + event = (TraceEventComponent) channel0Events[0]; + assertEquals("myevent0", event.getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, event.getEventType()); + assertEquals(TraceEnablement.ENABLED, event.getState()); + + // ------------------------------------------------------------------------ + // Destroy session + // ------------------------------------------------------------------------ + // Initialize session handling scenario + fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING); + + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals("Session components still exist.", 0, groups[1].getChildren().length); + + //------------------------------------------------------------------------- + // Disconnect node + //------------------------------------------------------------------------- + fFacility.executeCommand(node, "disconnect"); + assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); + + //------------------------------------------------------------------------- + // Delete node + //------------------------------------------------------------------------- + + fFacility.executeCommand(node, "delete"); + + assertEquals("Node not deleted.", 0, fFacility.getControlView().getTraceControlRoot().getChildren().length); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests2.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests2.java new file mode 100644 index 0000000000..6f13022303 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests2.java @@ -0,0 +1,309 @@ +/********************************************************************** + * Copyright (c) 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.model.component; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class TraceControlUstSessionTests contains UST + * session/channel/event handling test cases for LTTng 2.2. + */ +public class TraceControlUstSessionTests2 { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private static final String TEST_STREAM = "CreateTreeTest2.cfg"; + private static final String SCEN_SCEN_PER_UID_TEST = "ScenPerUidTest"; + private static final String SCEN_SCEN_PER_PID_TEST = "ScenPerPidTest"; + private static final String SCEN_SCEN_BUF_SIZE_TEST = "ScenBufSizeTest"; + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private TraceControlTestFacility fFacility; + private TestRemoteSystemProxy fProxy; + private String fTestFile; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fFacility = TraceControlTestFacility.getInstance(); + fFacility.init(); + fProxy = new TestRemoteSystemProxy(); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestFile = testfile.getAbsolutePath(); + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + fFacility.waitForJobs(); + fFacility.dispose(); + } + + /** + * Run the TraceControlComponent. + * + * @throws Exception + * This will fail the test + */ + @Test + public void testTraceSessionTree() throws Exception { + + fProxy.setTestFile(fTestFile); + fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST); + + ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); + + TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy); + + root.addChild(node); + fFacility.waitForJobs(); + + fFacility.executeCommand(node, "connect"); + int i = 0; + while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) { + i++; + fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY); + } + + // Get provider groups + ITraceControlComponent[] groups = node.getChildren(); + assertNotNull(groups); + assertEquals(2, groups.length); + + // Initialize dialog implementations for command execution + TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub()); + TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub()); + TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub()); + + // Initialize scenario + fProxy.setScenario(SCEN_SCEN_PER_UID_TEST); + + // ------------------------------------------------------------------------ + // Create session + // ------------------------------------------------------------------------ + TraceSessionComponent session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals("mysession", session.getName()); + + // ------------------------------------------------------------------------ + // Enable default channel on created session above + // ------------------------------------------------------------------------ + EnableChannelDialogStub channelStub = new EnableChannelDialogStub(); + channelStub.setIsKernel(false); + ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo(); + info.setName("mychannel"); + info.setOverwriteMode(false); + info.setSubBufferSize(-1); + info.setNumberOfSubBuffers(-1); + info.setSwitchTimer(-1); + info.setReadTimer(-1); + info.setMaxNumberTraceFiles(-1); + info.setMaxSizeTraceFiles(-1); + info.setBufferType(BufferType.BUFFER_PER_UID); + channelStub.setChannelInfo(info); + + TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub); + + fFacility.executeCommand(session, "enableChannelOnSession"); + + // Verify that UST domain was created + ITraceControlComponent[] domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + assertEquals("UST global", domains[0].getName()); + assertEquals("Domain buffer Type", BufferType.BUFFER_PER_UID, ((TraceDomainComponent)domains[0]).getBufferType()); + + // Verify that channel was created with correct data + ITraceControlComponent[] channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(1, channels.length); + + assertTrue(channels[0] instanceof TraceChannelComponent); + TraceChannelComponent channel = (TraceChannelComponent) channels[0]; + assertEquals("mychannel", channel.getName()); + + // ------------------------------------------------------------------------ + // Destroy session + // ------------------------------------------------------------------------ + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + // ------------------------------------------------------------------------ + // Create session (per-pid buffers) + // ------------------------------------------------------------------------ + + // Initialize scenario + fProxy.setScenario(SCEN_SCEN_PER_PID_TEST); + + session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals("mysession", session.getName()); + + // ------------------------------------------------------------------------ + // Enable default channel on created session above + // ------------------------------------------------------------------------ + info = (ChannelInfo)channelStub.getChannelInfo(); + info.setName("mychannel"); + info.setBufferType(BufferType.BUFFER_PER_PID); + channelStub.setChannelInfo(info); + + fFacility.executeCommand(session, "enableChannelOnSession"); + + // Verify that UST domain was created + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + assertEquals("UST global", domains[0].getName()); + assertEquals("Domain buffer Type", BufferType.BUFFER_PER_PID, ((TraceDomainComponent)domains[0]).getBufferType()); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(1, channels.length); + + assertTrue(channels[0] instanceof TraceChannelComponent); + channel = (TraceChannelComponent) channels[0]; + assertEquals("mychannel", channel.getName()); + + // ------------------------------------------------------------------------ + // Destroy session + // ------------------------------------------------------------------------ + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + // ------------------------------------------------------------------------ + // Create session (configured file size and number of files) + // ------------------------------------------------------------------------ + + // Initialize scenario + fProxy.setScenario(SCEN_SCEN_BUF_SIZE_TEST); + + session = fFacility.createSession(groups[1]); + + // Verify that session was created + assertNotNull(session); + assertEquals("mysession", session.getName()); + + // ------------------------------------------------------------------------ + // Enable default channel on created session above + // ------------------------------------------------------------------------ + info = (ChannelInfo)channelStub.getChannelInfo(); + info.setName("mychannel"); + info.setMaxNumberTraceFiles(10); + info.setMaxSizeTraceFiles(1024); + info.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN); + channelStub.setChannelInfo(info); + + fFacility.executeCommand(session, "enableChannelOnSession"); + + // Verify that UST domain was created + domains = session.getChildren(); + assertNotNull(domains); + assertEquals(1, domains.length); + + assertEquals("UST global", domains[0].getName()); + assertEquals("Domain buffer Type", BufferType.BUFFER_PER_PID, ((TraceDomainComponent)domains[0]).getBufferType()); + + // Verify that channel was created with correct data + channels = domains[0].getChildren(); + assertNotNull(channels); + assertEquals(1, channels.length); + + assertTrue(channels[0] instanceof TraceChannelComponent); + channel = (TraceChannelComponent) channels[0]; + assertEquals("mychannel", channel.getName()); + + // ------------------------------------------------------------------------ + // Destroy session + // ------------------------------------------------------------------------ + fFacility.destroySession(session); + + // Verify that no more session components exist + assertEquals(0, groups[1].getChildren().length); + + //------------------------------------------------------------------------- + // Disconnect node + //------------------------------------------------------------------------- + fFacility.executeCommand(node, "disconnect"); + assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState()); + + //------------------------------------------------------------------------- + // Delete node + //------------------------------------------------------------------------- + + fFacility.executeCommand(node, "delete"); + + assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/AllTests.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/AllTests.java new file mode 100644 index 0000000000..8c1040009b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/AllTests.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2011, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.service; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Runner for the service unit tests. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + LTTngControlServiceTest.class, + LTTngControlServiceMiTest.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java new file mode 100644 index 0000000000..32fa19ab62 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceMiTest.java @@ -0,0 +1,148 @@ +/********************************************************************** + * 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: + * Jonathan Rajotte - Support of machine interface + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.service; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.net.URL; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceMI; + +/** + * @author ejorajo + * + */ +public class LTTngControlServiceMiTest extends LTTngControlServiceTest { + + private static final String MI_TEST_STREAM = "LTTngServiceMiTest.cfg"; + + @Override + protected ILttngControlService getControlService() { + try { + URL resource = LTTngControlServiceMI.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME); + return new LTTngControlServiceMI(getfShell(), resource); + } catch (ExecutionException e) { + return null; + } + } + + @Override + public void testGetSessionNameGarbage() { + try { + fShell.setScenario(SCEN_GET_SESSION_GARBAGE_OUT); + fService.getSessionNames(new NullProgressMonitor()); + } catch (ExecutionException e) { + // Success. Parsing of garbage result in an ExecutionException + // generated by the XML document parser: Unable to parse the xml + // document. + } + } + + @Override + public void testCreateLiveSession() throws ExecutionException { + fShell.setScenario(SCEN_CREATE_LIVE_SESSION); + + ISessionInfo params = new SessionInfo("mysession"); + params.setLive(true); + params.setStreamedTrace(true); + params.setNetworkUrl("net://127.0.0.1"); + ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); + assertNotNull(sessionInfo); + assertEquals("mysession", sessionInfo.getName()); + assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); + assertTrue(sessionInfo.isStreamedTrace()); + assertTrue(sessionInfo.isLive()); + assertEquals("tcp4://127.0.0.1:5342/ [data: 5343]", sessionInfo.getSessionPath()); + String[] names = fService.getSessionNames(new NullProgressMonitor()); + assertEquals(names[0], "mysession"); + fService.destroySession("mysession", new NullProgressMonitor()); + } + + @Override + protected String getTestStream() { + return MI_TEST_STREAM; + } + + @Override + protected TraceLogLevel getAllEventTraceLogLevel() { + return TraceLogLevel.TRACE_DEBUG; + } + + @Override + public void testGetKernelProviderNoUstVerbose() { + // Verbose mode in machine interface is deactivated. This test is + // ignored. + } + + @Override + public void testCreateSession2_1() { + // 2.1 is not supported by mi. This test is ignored. + } + + @Override + public void testGetKernelProviderNoUst3() { + // Verbose mode in machine interface is deactivated. This test is + // ignored. + } + + @Override + public void testGetKernelProviderNoKernelVerbose() { + // Verbose mode in machine interface is deactivated. This test is + // ignored. + } + + @Override + public void testCreateSessionVerbose2_1() { + // Verbose mode in machine interface is deactivated. This test is + // ignored. + } + + @Override + public void testDestroySessionVerbose() { + // Verbose mode in machine interface is deactivated. This test is + // ignored. + } + + @Override + public void testCreateSessionWithPrompt() { + // TODO Investigate if this case can happen in production. If yes than + // we need to rethinks the MI fetching and parsing. + } + + @Override + public void testAddContext() { + // TODO This does not use mi feature.And currently the context enabling + // is wrong for 2.6. + } + + @Override + public void testAddContextFailure() { + // TODO This does not use mi feature.And currently the context enabling + // is wrong for 2.6. + } + + @Override + public void testCreateSnapshotSession2_5() { + // not applicable for MI + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceTest.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceTest.java new file mode 100644 index 0000000000..0c7d59202d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/linuxtools/lttng2/control/ui/tests/service/LTTngControlServiceTest.java @@ -0,0 +1,1524 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Alexandre Montplaisir - Port to JUnit4 + * Marc-Andre Laperle - Support for creating a live session + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.control.ui.tests.service; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.service.CommandShellFactory; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.shells.LTTngToolsFileShell; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlService; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.osgi.framework.FrameworkUtil; + +/** + * The class LTTngControlServiceTest contains test for the class + * {@link LTTngControlService}. + */ +@SuppressWarnings("javadoc") +public class LTTngControlServiceTest { + + private static final String DIRECTORY = "testfiles"; + private static final String TEST_STREAM = "LTTngServiceTest.cfg"; + + private static final String SCEN_LTTNG_NOT_INSTALLED = "LttngNotInstalled"; + private static final String SCEN_LTTNG_VERSION = "LttngVersion"; + private static final String SCEN_LTTNG_VERSION_WITH_PROMPT = "LttngVersionWithPrompt"; + private static final String SCEN_LTTNG_UNSUPPORTED_VERSION = "LttngUnsupportedVersion"; + private static final String SCEN_LTTNG_NO_VERSION = "LttngNoVersion"; + private static final String SCEN_NO_SESSION_AVAILABLE = "NoSessionAvailable"; + private static final String SCEN_GET_SESSION_NAMES1 = "GetSessionNames1"; + private static final String SCEN_GET_SESSION_NAME_NOT_EXIST = "GetSessionNameNotExist"; + private static final String SCEN_GET_SESSION_NAME_NOT_EXIST_VERBOSE = "GetSessionNameNotExistVerbose"; + protected static final String SCEN_GET_SESSION_GARBAGE_OUT = "GetSessionGarbageOut"; + private static final String SCEN_GET_SESSION1 = "GetSession1"; + private static final String SCEN_GET_KERNEL_PROVIDER1 = "GetKernelProvider1"; + private static final String SCEN_LIST_WITH_NO_KERNEL1 = "ListWithNoKernel1"; + private static final String SCEN_LIST_WITH_NO_KERNEL2 = "ListWithNoKernel2"; + private static final String SCEN_LIST_WITH_NO_KERNEL_VERBOSE = "ListWithNoKernelVerbose"; + private static final String SCEN_GET_UST_PROVIDER1 = "GetUstProvider1"; + private static final String SCEN_GET_UST_PROVIDER2 = "GetUstProvider2"; + private static final String SCEN_GET_UST_PROVIDER3 = "GetUstProvider3"; + private static final String SCEN_LIST_WITH_NO_UST1 = "ListWithNoUst1"; + private static final String SCEN_LIST_WITH_NO_UST2 = "ListWithNoUst2"; + private static final String SCEN_LIST_WITH_NO_UST3 = "ListWithNoUst3"; + private static final String SCEN_LIST_WITH_NO_UST_VERBOSE = "ListWithNoUstVerbose"; + private static final String SCEN_CREATE_SESSION1 = "CreateSession1"; + private static final String SCEN_CREATE_SESSION_WITH_PROMPT = "CreateSessionWithPrompt"; + private static final String SCEN_CREATE_SESSION_VARIANTS = "CreateSessionVariants"; + private static final String SCEN_DESTROY_SESSION1 = "DestroySession1"; + private static final String SCEN_DESTROY_SESSION_VERBOSE = "DestroySessionVerbose"; + private static final String SCEN_CHANNEL_HANDLING = "ChannelHandling"; + private static final String SCEN_EVENT_HANDLING = "EventHandling"; + private static final String SCEN_CONTEXT_HANDLING = "ContextHandling"; + private static final String SCEN_CONTEXT_ERROR_HANDLING = "ContextErrorHandling"; + private static final String SCEN_CALIBRATE_HANDLING = "CalibrateHandling"; + private static final String SCEN_CREATE_SESSION_2_1 = "CreateSessionLttng2.1"; + private static final String SCEN_CREATE_SESSION_VERBOSE_2_1 = "CreateSessionLttngVerbose2.1"; + private static final String SCEN_CREATE_SNAPSHOT_SESSION = "CreateSessionSnapshot"; + private static final String SCEN_CREATE_SNAPSHOT_SESSION_2_5 = "CreateSessionSnapshot2.5"; + private static final String SCEN_CREATE_STREAMED_SNAPSHOT_SESSION = "CreateSessionStreamedSnapshot"; + private static final String SCEN_CREATE_SNAPSHOT_SESSION_ERRORS = "CreateSessionSnapshotErrors"; + protected static final String SCEN_CREATE_LIVE_SESSION = "CreateSessionLive"; + private static final String SCEN_CREATE_LIVE_SESSION_ERRORS = "CreateSessionLiveErrors"; + + + // ------------------------------------------------------------------------ + // Test data + // ------------------------------------------------------------------------ + + private CommandShellFactory fShellFactory; + private String fTestfile; + protected LTTngToolsFileShell fShell; + protected ILttngControlService fService; + + // ------------------------------------------------------------------------ + // Housekeeping + // ------------------------------------------------------------------------ + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + */ + @Before + public void setUp() throws Exception { + fShellFactory = CommandShellFactory.getInstance(); + + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(getTestDirectory() + File.separator + getTestStream()), null); + File testfile = new File(FileLocator.toFileURL(location).toURI()); + fTestfile = testfile.getAbsolutePath(); + + fShell = fShellFactory.getFileShell(); + fShell.loadScenarioFile(fTestfile); + fService = getControlService(); + if (fService == null) { + throw new Exception("Unable to obtain a valid ControlService"); + } + + ControlPreferences.getInstance().init(Activator.getDefault().getPreferenceStore()); + } + + /** + * @return the string of the test directory to use + */ + protected String getTestDirectory() { + return DIRECTORY; + } + + /** + * @return the LttngCon + */ + protected ILttngControlService getControlService() { + return new LTTngControlService(fShell); + } + + public LTTngToolsFileShell getfShell() { + return fShell; + } + + /** + * @return + */ + protected String getTestStream() { + return TEST_STREAM; + } + + @After + public void tearDown() { + disableVerbose(); + ControlPreferences.getInstance().dispose(); + } + + // ------------------------------------------------------------------------ + // Test Cases + // ------------------------------------------------------------------------ + + @Test + public void testVersion() { + try { + fShell.setScenario(SCEN_LTTNG_VERSION); + ILttngControlService service = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); + assertNotNull(service); + assertEquals("2.1.0", service.getVersionString()); + } catch (ExecutionException e) { + fail("Exeption thrown " + e); + } + } + + @Test + public void testVersionWithPrompt() { + try { + fShell.setScenario(SCEN_LTTNG_VERSION_WITH_PROMPT); + ILttngControlService service = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); + assertNotNull(service); + assertEquals("2.0.0", service.getVersionString()); + } catch (ExecutionException e) { + fail("Exeption thrown " + e); + } + } + + @Test + public void testUnsupportedVersion() { + try { + fShell.setScenario(SCEN_LTTNG_UNSUPPORTED_VERSION); + LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); + fail("No exeption thrown"); + } catch (ExecutionException e) { + // success + } + } + + @Test + public void testNoVersion() { + try { + fShell.setScenario(SCEN_LTTNG_NO_VERSION); + LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); + fail("No exeption thrown"); + } catch (ExecutionException e) { + // success + } + } + + @Test + public void testLttngNotInstalled() { + try { + fShell.setScenario(SCEN_LTTNG_NOT_INSTALLED); + fService.getSessionNames(new NullProgressMonitor()); + fail("No exeption thrown"); + } catch (ExecutionException e) { + // success + } + } + + @Test + public void testGetSessionNames1() { + try { + fShell.setScenario(SCEN_NO_SESSION_AVAILABLE); + String[] result = fService.getSessionNames(new NullProgressMonitor()); + + assertNotNull(result); + assertEquals(0, result.length); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testGetSessionNames2() { + try { + fShell.setScenario(SCEN_GET_SESSION_NAMES1); + String[] result = fService.getSessionNames(new NullProgressMonitor()); + + assertNotNull(result); + assertEquals(2, result.length); + assertEquals("mysession1", result[0]); + assertEquals("mysession", result[1]); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testGetSessionNotExist() { + try { + fShell.setScenario(SCEN_GET_SESSION_NAME_NOT_EXIST); + fService.getSessionNames(new NullProgressMonitor()); + fail("No exeption thrown"); + + } catch (ExecutionException e) { + // success + } + } + + @Test + public void testGetSessionNotExistVerbose() { + try { + enableVerbose(); + fShell.setScenario(SCEN_GET_SESSION_NAME_NOT_EXIST_VERBOSE); + fService.getSessionNames(new NullProgressMonitor()); + fail("No exeption thrown"); + + } catch (ExecutionException e) { + // success + } finally { + disableVerbose(); + } + } + + @Test + public void testGetSessionNameGarbage() { + try { + fShell.setScenario(SCEN_GET_SESSION_GARBAGE_OUT); + String[] result = fService.getSessionNames(new NullProgressMonitor()); + + assertNotNull(result); + assertEquals(0, result.length); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testGetSession1() { + try { + fShell.setScenario(SCEN_GET_SESSION1); + ISessionInfo session = fService.getSession("mysession", new NullProgressMonitor()); + + // Verify Session + assertNotNull(session); + assertEquals("mysession", session.getName()); + assertEquals("/home/user/lttng-traces/mysession-20120129-084256", session.getSessionPath()); + assertEquals(TraceSessionState.ACTIVE, session.getSessionState()); + + IDomainInfo[] domains = session.getDomains(); + assertNotNull(domains); + assertEquals(2, domains.length); + + // Verify Kernel domain + assertEquals("Kernel", domains[0].getName()); + IChannelInfo[] channels = domains[0].getChannels(); + assertNotNull(channels); + assertEquals(2, channels.length); + + // Verify Kernel's channel0 + assertEquals("channel0", channels[0].getName()); + assertEquals(4, channels[0].getNumberOfSubBuffers()); + assertEquals("splice()", channels[0].getOutputType().getInName()); + assertEquals(TraceChannelOutputType.SPLICE, channels[0].getOutputType()); + assertEquals(false, channels[0].isOverwriteMode()); + assertEquals(200, channels[0].getReadTimer()); + assertEquals(TraceEnablement.ENABLED, channels[0].getState()); + assertEquals(262144, channels[0].getSubBufferSize()); + assertEquals(0, channels[0].getSwitchTimer()); + + // Verify event info + IEventInfo[] channel0Events = channels[0].getEvents(); + assertNotNull(channel0Events); + assertEquals(2, channel0Events.length); + assertEquals("block_rq_remap", channel0Events[0].getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[0].getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, channel0Events[0].getEventType()); + assertEquals(TraceEnablement.ENABLED, channel0Events[0].getState()); + + assertEquals("block_bio_remap", channel0Events[1].getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[1].getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, channel0Events[1].getEventType()); + assertEquals(TraceEnablement.DISABLED, channel0Events[1].getState()); + + // Verify Kernel's channel1 + assertEquals("channel1", channels[1].getName()); + assertEquals(4, channels[1].getNumberOfSubBuffers()); + assertEquals("splice()", channels[1].getOutputType().getInName()); + assertEquals(TraceChannelOutputType.SPLICE, channels[1].getOutputType()); + assertEquals(true, channels[1].isOverwriteMode()); + assertEquals(400, channels[1].getReadTimer()); + assertEquals(TraceEnablement.DISABLED, channels[1].getState()); + assertEquals(524288, channels[1].getSubBufferSize()); + assertEquals(100, channels[1].getSwitchTimer()); + + // Verify event info + IEventInfo[] channel1Events = channels[1].getEvents(); + assertEquals(0, channel1Events.length); + + // Verify domain UST global + assertEquals("UST global", domains[1].getName()); + + IChannelInfo[] ustChannels = domains[1].getChannels(); + + // Verify UST global's mychannel1 + assertEquals("mychannel1", ustChannels[0].getName()); + assertEquals(8, ustChannels[0].getNumberOfSubBuffers()); + assertEquals("mmap()", ustChannels[0].getOutputType().getInName()); + assertEquals(TraceChannelOutputType.MMAP, ustChannels[0].getOutputType()); + assertEquals(true, ustChannels[0].isOverwriteMode()); + assertEquals(100, ustChannels[0].getReadTimer()); + assertEquals(TraceEnablement.DISABLED, ustChannels[0].getState()); + assertEquals(8192, ustChannels[0].getSubBufferSize()); + assertEquals(200, ustChannels[0].getSwitchTimer()); + + // Verify event info + IEventInfo[] ustEvents = ustChannels[0].getEvents(); + assertEquals(0, ustEvents.length); + + // Verify UST global's channel0 + assertEquals("channel0", ustChannels[1].getName()); + assertEquals(4, ustChannels[1].getNumberOfSubBuffers()); + assertEquals("mmap()", ustChannels[1].getOutputType().getInName()); + assertEquals(TraceChannelOutputType.MMAP, ustChannels[1].getOutputType()); + assertEquals(false, ustChannels[1].isOverwriteMode()); + assertEquals(200, ustChannels[1].getReadTimer()); + assertEquals(TraceEnablement.ENABLED, ustChannels[1].getState()); + assertEquals(4096, ustChannels[1].getSubBufferSize()); + assertEquals(0, ustChannels[1].getSwitchTimer()); + + // Verify event info + ustEvents = ustChannels[1].getEvents(); + assertEquals(2, ustEvents.length); + + assertEquals("ust_tests_hello:tptest_sighandler", ustEvents[0].getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, ustEvents[0].getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, ustEvents[0].getEventType()); + assertEquals(TraceEnablement.DISABLED, ustEvents[0].getState()); + + assertEquals("*", ustEvents[1].getName()); + assertEquals(getAllEventTraceLogLevel(), ustEvents[1].getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, ustEvents[1].getEventType()); + assertEquals(TraceEnablement.ENABLED, ustEvents[1].getState()); + + // next session (no detailed information available) + session = fService.getSession("mysession1", new NullProgressMonitor()); + assertNotNull(session); + assertEquals("mysession1", session.getName()); + assertEquals("/home/user/lttng-traces/mysession1-20120203-133225", session.getSessionPath()); + assertEquals(TraceSessionState.INACTIVE, session.getSessionState()); + + domains = session.getDomains(); + assertNotNull(domains); + assertEquals(0, domains.length); + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + /** + * @return + */ + protected TraceLogLevel getAllEventTraceLogLevel() { + return TraceLogLevel.LEVEL_UNKNOWN; + } + + public void testGetKernelProvider() { + try { + fShell.setScenario(SCEN_GET_KERNEL_PROVIDER1); + List events = fService.getKernelProvider(new NullProgressMonitor()); + + // Verify event info + assertNotNull(events); + assertEquals(3, events.size()); + + IBaseEventInfo baseEventInfo = events.get(0); + assertNotNull(baseEventInfo); + assertEquals("sched_kthread_stop", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + baseEventInfo = events.get(1); + assertEquals("sched_kthread_stop_ret", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + baseEventInfo = events.get(2); + assertEquals("sched_wakeup_new", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testGetKernelProviderNoKernel1() { + try { + fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL1); + List events = fService.getKernelProvider(new NullProgressMonitor()); + + // Verify event info + assertNotNull(events); + assertEquals(0, events.size()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testGetKernelProviderNoKernel2() { + try { + fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL2); + List events = fService.getKernelProvider(new NullProgressMonitor()); + + // Verify event info + assertNotNull(events); + assertEquals(0, events.size()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testGetKernelProviderNoKernelVerbose() { + try { + enableVerbose(); + fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL_VERBOSE); + List events = fService.getKernelProvider(new NullProgressMonitor()); + + // Verify event info + assertNotNull(events); + assertEquals(0, events.size()); + + } catch (ExecutionException e) { + fail(e.toString()); + } finally { + disableVerbose(); + } + } + + @Test + public void testGetUstProvider() { + try { + fShell.setScenario(SCEN_GET_UST_PROVIDER1); + List providers = fService.getUstProvider(); + + // Check all providers + assertNotNull(providers); + assertEquals(2, providers.size()); + + //Verify first provider + assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(0).getName()); + assertEquals(9379, providers.get(0).getPid()); + + // Verify event info + IBaseEventInfo[] events = providers.get(0).getEvents(); + assertNotNull(events); + assertEquals(2, events.length); + + IBaseEventInfo baseEventInfo = events[0]; + assertNotNull(baseEventInfo); + assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_MODULE, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + baseEventInfo = events[1]; + assertEquals("ust_tests_hello:tptest", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_INFO, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + //Verify second provider + assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(1).getName()); + assertEquals(4852, providers.get(1).getPid()); + + // Verify event info + events = providers.get(1).getEvents(); + assertNotNull(events); + assertEquals(2, events.length); + + baseEventInfo = events[0]; + assertNotNull(baseEventInfo); + assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_WARNING, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + baseEventInfo = events[1]; + assertEquals("ust_tests_hello:tptest", baseEventInfo.getName()); + assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, baseEventInfo.getLogLevel()); + assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testUstProvider2() { + try { + fShell.setScenario(SCEN_GET_UST_PROVIDER2); + List providers = fService.getUstProvider(); + + assertNotNull(providers); + assertEquals(0, providers.size()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testGetUstProvider3() { + try { + fShell.setScenario(SCEN_GET_UST_PROVIDER3); + // Set version + ((LTTngControlService)fService).setVersion("2.1.0"); + List providers = fService.getUstProvider(); + + // Check all providers + assertNotNull(providers); + assertEquals(2, providers.size()); + + //Verify first provider + assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(0).getName()); + assertEquals(9379, providers.get(0).getPid()); + + // Verify event info + IBaseEventInfo[] events = providers.get(0).getEvents(); + assertNotNull(events); + assertEquals(2, events.length); + + IBaseEventInfo baseEventInfo = events[0]; + assertNotNull(baseEventInfo); + IFieldInfo[] fields = baseEventInfo.getFields(); + assertNotNull(fields); + assertEquals(0, fields.length); + + baseEventInfo = events[1]; + fields = baseEventInfo.getFields(); + assertNotNull(fields); + assertEquals(3, fields.length); + assertEquals("doublefield", fields[0].getName()); + assertEquals("float", fields[0].getFieldType()); + + assertEquals("floatfield", fields[1].getName()); + assertEquals("float", fields[1].getFieldType()); + + assertEquals("stringfield", fields[2].getName()); + assertEquals("string", fields[2].getFieldType()); + + //Verify second provider + assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(1).getName()); + assertEquals(4852, providers.get(1).getPid()); + + // Verify event info + events = providers.get(1).getEvents(); + assertNotNull(events); + assertEquals(2, events.length); + + baseEventInfo = events[0]; + assertNotNull(baseEventInfo); + fields = baseEventInfo.getFields(); + assertNotNull(fields); + assertEquals(0, fields.length); + + baseEventInfo = events[1]; + fields = baseEventInfo.getFields(); + assertNotNull(fields); + assertEquals(3, fields.length); + + assertEquals("doublefield", fields[0].getName()); + assertEquals("float", fields[0].getFieldType()); + + assertEquals("floatfield", fields[1].getName()); + assertEquals("float", fields[1].getFieldType()); + + assertEquals("stringfield", fields[2].getName()); + assertEquals("string", fields[2].getFieldType()); + + // Reset version + ((LTTngControlService)fService).setVersion("2.0.0"); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + + @Test + public void testGetKernelProviderNoUst1() { + try { + fShell.setScenario(SCEN_LIST_WITH_NO_UST1); + List providerList = fService.getUstProvider(new NullProgressMonitor()); + + // Verify Provider info + assertNotNull(providerList); + assertEquals(0, providerList.size()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + + @Test + public void testGetKernelProviderNoUst2() { + try { + // Set version + ((LTTngControlService)fService).setVersion("2.1.0"); + + fShell.setScenario(SCEN_LIST_WITH_NO_UST2); + List providerList = fService.getUstProvider(new NullProgressMonitor()); + + // Verify Provider info + assertNotNull(providerList); + assertEquals(0, providerList.size()); + + // Reset version + ((LTTngControlService)fService).setVersion("2.0.0"); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testGetKernelProviderNoUst3() { + try { + + // Set version + ((LTTngControlService)fService).setVersion("2.1.0"); + + fShell.setScenario(SCEN_LIST_WITH_NO_UST3); + List providerList = fService.getUstProvider(new NullProgressMonitor()); + + // Verify provider info + assertNotNull(providerList); + assertEquals(0, providerList.size()); + + // Reset version + ((LTTngControlService)fService).setVersion("2.0.0"); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testGetKernelProviderNoUstVerbose() { + try { + enableVerbose(); + + // Set version + ((LTTngControlService)fService).setVersion("2.1.0"); + + fShell.setScenario(SCEN_LIST_WITH_NO_UST_VERBOSE); + List providerList = fService.getUstProvider(new NullProgressMonitor()); + + // Verify provider info + assertNotNull(providerList); + assertEquals(0, providerList.size()); + + // Reset version + ((LTTngControlService)fService).setVersion("2.0.0"); + + } catch (ExecutionException e) { + fail(e.toString()); + } finally { + disableVerbose(); + } + } + + + + @Test + public void testCreateSession() { + try { + fShell.setScenario(SCEN_CREATE_SESSION1); + + ISessionInfo info = fService.createSession(new SessionInfo("mysession2"), new NullProgressMonitor()); + assertNotNull(info); + assertEquals("mysession2", info.getName()); + assertNotNull(info.getSessionPath()); + assertTrue(info.getSessionPath().contains("mysession2")); + assertEquals(TraceSessionState.INACTIVE, info.getSessionState()); + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testCreateSessionWithPrompt() { + try { + // First line has the shell prompt before the command output + // This can happen in a real application if the command line is not echoed by the shell. + fShell.setScenario(SCEN_CREATE_SESSION_WITH_PROMPT); + + // First line has no shell prompt before the output + ISessionInfo info = fService.createSession(new SessionInfo("mysession2"), new NullProgressMonitor()); + assertNotNull(info); + assertEquals("mysession2", info.getName()); + assertNotNull(info.getSessionPath()); + assertTrue(info.getSessionPath().contains("mysession2")); + assertEquals(TraceSessionState.INACTIVE, info.getSessionState()); + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testCreateSessionVariants() { + + fShell.setScenario(SCEN_CREATE_SESSION_VARIANTS); + + try { + fService.createSession(new SessionInfo("alreadyExist"), new NullProgressMonitor()); + fail("No exeption thrown"); + } catch (ExecutionException e) { + // success + } + + try { + fService.createSession(new SessionInfo("wrongName"), new NullProgressMonitor()); + fail("No exeption thrown"); + } catch (ExecutionException e) { + // success + } + + try { + ISessionInfo sessionInfo = new SessionInfo("withPath"); + sessionInfo.setSessionPath("/home/user/hallo"); + fService.createSession(sessionInfo, new NullProgressMonitor()); + fail("No exeption thrown"); + } catch (ExecutionException e) { + // success + } + + try { + ISessionInfo info = fService.createSession(new SessionInfo("session with spaces"), new NullProgressMonitor()); + assertNotNull(info); + assertEquals("session with spaces", info.getName()); + assertNotNull(info.getSessionPath()); + assertTrue(info.getSessionPath().contains("session with spaces")); + assertEquals(TraceSessionState.INACTIVE, info.getSessionState()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + + try { + ISessionInfo sessionInfo = new SessionInfo("pathWithSpaces"); + sessionInfo.setSessionPath("/home/user/hallo user/here"); + ISessionInfo info = fService.createSession(sessionInfo, new NullProgressMonitor()); + assertNotNull(info); + assertEquals("pathWithSpaces", info.getName()); + assertNotNull(info.getSessionPath()); + assertTrue(info.getSessionPath().contains("/home/user/hallo user/here")); + assertEquals(TraceSessionState.INACTIVE, info.getSessionState()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testDestroySession() { + try { + fShell.setScenario(SCEN_DESTROY_SESSION1); + fService.destroySession("mysession2", new NullProgressMonitor()); + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testDestroySessionVerbose() { + try { + enableVerbose(); + fShell.setScenario(SCEN_DESTROY_SESSION_VERBOSE); + fService.destroySession("mysession2", new NullProgressMonitor()); + } catch (ExecutionException e) { + fail(e.toString()); + } finally { + disableVerbose(); + } + } + + @Test + public void testCreateChannel() { + try { + ((LTTngControlService)fService).setVersion("2.2.0"); + String sessionName = "mysession2"; + List list = new ArrayList<>(); + String kernelChannel0 = "mychannel0"; + String kernelChannel1 = "mychannel1"; + list.add(kernelChannel0); + list.add(kernelChannel1); + + fShell.setScenario(SCEN_CHANNEL_HANDLING); + + // Create/enable/configure 2 kernel channels + ChannelInfo chanInfo = new ChannelInfo(""); + chanInfo.setOverwriteMode(true); + chanInfo.setSubBufferSize(16384); + chanInfo.setReadTimer(100); + chanInfo.setSwitchTimer(200); + chanInfo.setNumberOfSubBuffers(2); + chanInfo.setMaxNumberTraceFiles(10); + chanInfo.setMaxSizeTraceFiles(0); + fService.enableChannels(sessionName, list, true, chanInfo, new NullProgressMonitor()); + + // Create/enable/configure 1 UST channel + list.clear(); + list.add("ustChannel"); + + chanInfo = new ChannelInfo(""); + chanInfo.setOverwriteMode(true); + chanInfo.setSubBufferSize(32768); + chanInfo.setReadTimer(200); + chanInfo.setSwitchTimer(100); + chanInfo.setNumberOfSubBuffers(1); + chanInfo.setMaxNumberTraceFiles(20); + chanInfo.setMaxSizeTraceFiles(0); + fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor()); + ((LTTngControlService)fService).setVersion("2.0.0"); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testCreateChannelUIDBuffer() { + try { + ((LTTngControlService)fService).setVersion("2.2.0"); + String sessionName = "mysession2"; + List list = new ArrayList<>(); + String USTChannel = "ustChannel"; + list.add(USTChannel); + fShell.setScenario(SCEN_CHANNEL_HANDLING); + + ChannelInfo chanInfo = new ChannelInfo(""); + chanInfo.setOverwriteMode(true); + chanInfo.setSubBufferSize(32768); + chanInfo.setReadTimer(200); + chanInfo.setSwitchTimer(100); + chanInfo.setNumberOfSubBuffers(1); + chanInfo.setMaxNumberTraceFiles(20); + chanInfo.setMaxSizeTraceFiles(0); + chanInfo.setBufferType(BufferType.BUFFER_PER_UID); + fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor()); + ((LTTngControlService)fService).setVersion("2.0.0"); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testCreateChannelPIDBuffer() { + try { + ((LTTngControlService)fService).setVersion("2.2.0"); + String sessionName = "mysession2"; + List list = new ArrayList<>(); + String USTChannel = "ustChannel"; + list.add(USTChannel); + fShell.setScenario(SCEN_CHANNEL_HANDLING); + + + ChannelInfo chanInfo = new ChannelInfo(""); + chanInfo.setOverwriteMode(true); + chanInfo.setSubBufferSize(-1); + chanInfo.setReadTimer(-1); + chanInfo.setSwitchTimer(-1); + chanInfo.setNumberOfSubBuffers(-1); + chanInfo.setMaxNumberTraceFiles(-1); + chanInfo.setMaxSizeTraceFiles(-1); + chanInfo.setBufferType(BufferType.BUFFER_PER_PID); + + fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor()); + ((LTTngControlService)fService).setVersion("2.0.0"); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testDisableChannel() { + try { + + String sessionName = "mysession2"; + List list = new ArrayList<>(); + String kernelChannel0 = "mychannel0"; + String kernelChannel1 = "mychannel1"; + list.add(kernelChannel0); + list.add(kernelChannel1); + + fShell.setScenario(SCEN_CHANNEL_HANDLING); + fService.disableChannels(sessionName, list, true, new NullProgressMonitor()); + + list.clear(); + list.add("ustChannel"); + fService.disableChannels(sessionName, list, false, new NullProgressMonitor()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testEnableChannel() { + try { + + String sessionName = "mysession2"; + List list = new ArrayList<>(); + String kernelChannel0 = "mychannel0"; + String kernelChannel1 = "mychannel1"; + list.add(kernelChannel0); + list.add(kernelChannel1); + + fShell.setScenario(SCEN_CHANNEL_HANDLING); + fService.enableChannels(sessionName, list, true, null, new NullProgressMonitor()); + + // Create/enable/configure 1 UST channel + list.clear(); + list.add("ustChannel"); + + fService.enableChannels(sessionName, list, false, null, new NullProgressMonitor()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testEnableEvents() { + try { + // 1) session name, channel = null, 3 event names, kernel + String sessionName = "mysession2"; + List list = new ArrayList<>(); + String eventName0 = "block_rq_remap"; + String eventName1 = "block_bio_remap"; + String eventName2 = "softirq_entry"; + list.add(eventName0); + list.add(eventName1); + list.add(eventName2); + fShell.setScenario(SCEN_EVENT_HANDLING); + fService.enableEvents(sessionName, null, list, true, null, new NullProgressMonitor()); + + // 2) session name, channel=mychannel, event name= null, kernel + String channelName = "mychannel"; + fService.enableEvents(sessionName, channelName, null, true, null, new NullProgressMonitor()); + + // 3) session name, channel=mychannel, 1 event name, ust, no filter + String ustEventName = "ust_tests_hello:tptest_sighandler"; + list.clear(); + list.add(ustEventName); + fService.enableEvents(sessionName, channelName, list, false, null, new NullProgressMonitor()); + + // 4) session name, channel = mychannel, no event name, ust, with filter + fService.enableEvents(sessionName, channelName, list, false, "intfield==10", new NullProgressMonitor()); + + // 5) session name, channel = mychannel, no event name, ust, no filter + list.clear(); + fService.enableEvents(sessionName, channelName, list, false, null, new NullProgressMonitor()); + + // TODO add test with filters + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testEnableSyscalls() { + try { + // 1) session name, channel = null, 3 event names, kernel + String sessionName = "mysession2"; + String channelName = "mychannel"; + + fShell.setScenario(SCEN_EVENT_HANDLING); + + // 1) session name, channel = null + fService.enableSyscalls(sessionName, null, new NullProgressMonitor()); + + // 2) session name, channel = mychannel + fService.enableSyscalls(sessionName, channelName, new NullProgressMonitor()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testDynamicProbe() { + try { + // 1) session name, channel = null, 3 event names, kernel + String sessionName = "mysession2"; + String channelName = "mychannel"; + String eventName0 = "myevent0"; + String eventName1 = "myevent1"; + String functionProbe = "0xc0101340"; + String dynProbe = "init_post"; + + fShell.setScenario(SCEN_EVENT_HANDLING); + + // 1) session name, channel = null, event name, function probe, probe + fService.enableProbe(sessionName, null, eventName0, true, functionProbe, new NullProgressMonitor()); + + // 2) session name, channel = mychannel + fService.enableProbe(sessionName, channelName, eventName1, false, dynProbe, new NullProgressMonitor()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testEnableLogLevel() { + try { + // 1) session name, channel = null, 3 event names, kernel + String sessionName = "mysession2"; + String channelName = "mychannel"; + String eventName4 = "myevent4"; + String eventName5 = "myevent5"; + + fShell.setScenario(SCEN_EVENT_HANDLING); + + // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG + fService.enableLogLevel(sessionName, null, eventName4, LogLevelType.LOGLEVEL_ONLY, TraceLogLevel.TRACE_DEBUG, null, new NullProgressMonitor()); + + // 2) session name, channel = mychannel, null, loglevel, TRACE_DEBUG_FUNCTION + fService.enableLogLevel(sessionName, channelName, eventName5, LogLevelType.LOGLEVEL, TraceLogLevel.TRACE_DEBUG_FUNCTION, null, new NullProgressMonitor()); + + // TODO add test with filters + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testAddContext() { + try { + // 1) session name, channel = null, 3 event names, kernel + String sessionName = "mysession2"; + String channelName = "mychannel"; + String eventName = "ust_tests_hello:tptest_sighandler"; + List contexts = new ArrayList<>(); + contexts.add("prio"); + contexts.add("pid"); + + fShell.setScenario(SCEN_CONTEXT_HANDLING); + + List availContexts = fService.getContextList(new NullProgressMonitor()); + assertNotNull(availContexts); + assertEquals(12, availContexts.size()); + + // A very "hard-coded" way to verify but it works ... + Set expectedContexts = new HashSet<>(); + expectedContexts.add("pid"); + expectedContexts.add("procname"); + expectedContexts.add("prio"); + expectedContexts.add("nice"); + expectedContexts.add("vpid"); + expectedContexts.add("tid"); + expectedContexts.add("pthread_id"); + expectedContexts.add("vtid"); + expectedContexts.add("ppid"); + expectedContexts.add("vppid"); + expectedContexts.add("perf:cpu-cycles"); + expectedContexts.add("perf:cycles"); + + assertTrue(expectedContexts.containsAll(availContexts)); + + // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG + fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testAddContextFailure() { + + // 1) session name, channel = null, 3 event names, kernel + String sessionName = "mysession2"; + String channelName = "mychannel"; + String eventName = "ust_tests_hello:tptest_sighandler"; + List contexts = new ArrayList<>(); + contexts.add("prio"); + contexts.add("pid"); + fShell.setScenario(SCEN_CONTEXT_ERROR_HANDLING); + try { + fService.getContextList(new NullProgressMonitor()); + fail("No exeption generated"); + } catch (ExecutionException e) { + // success + } + try { + // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG + fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor()); + fail("No exeption generated"); + } catch (ExecutionException e) { + // success + } + } + + @Test + public void testCalibrate() { + try { + fShell.setScenario(SCEN_CALIBRATE_HANDLING); + fService.calibrate(true, new NullProgressMonitor()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testCalibrateFailure() { + try { + fShell.setScenario(SCEN_CALIBRATE_HANDLING); + fService.calibrate(false, new NullProgressMonitor()); + fail("No exeption generated"); + } catch (ExecutionException e) { + // success + } + } + + @Test + public void testCreateSession2_1() { + + try { + fShell.setScenario(SCEN_CREATE_SESSION_2_1); + + ISessionInfo sessionInfo = new SessionInfo("mysession"); + sessionInfo.setNetworkUrl("net://172.0.0.1"); + sessionInfo.setStreamedTrace(true); + ISessionInfo info = fService.createSession(sessionInfo, new NullProgressMonitor()); + assertNotNull(info); + assertEquals("mysession", info.getName()); + assertEquals("net://172.0.0.1", info.getSessionPath()); + assertTrue(info.isStreamedTrace()); + fService.destroySession("mysession", new NullProgressMonitor()); + + sessionInfo = new SessionInfo("mysession"); + sessionInfo.setStreamedTrace(true); + sessionInfo.setNetworkUrl("file:///tmp"); + info = fService.createSession(sessionInfo, new NullProgressMonitor()); + assertNotNull(info); + assertEquals("mysession", info.getName()); + assertEquals("file:///tmp", info.getSessionPath()); + assertTrue(!info.isStreamedTrace()); + fService.destroySession("mysession", new NullProgressMonitor()); + + sessionInfo = new SessionInfo("mysession"); + sessionInfo.setStreamedTrace(true); + sessionInfo.setNetworkUrl("file:///tmp"); + info = fService.createSession(sessionInfo, new NullProgressMonitor()); + assertNotNull(info); + assertEquals("mysession", info.getName()); + assertEquals("file:///tmp", info.getSessionPath()); + assertTrue(!info.isStreamedTrace()); + fService.destroySession("mysession", new NullProgressMonitor()); + + sessionInfo = new SessionInfo("mysession"); + sessionInfo.setStreamedTrace(true); + sessionInfo.setControlUrl("tcp://172.0.0.1"); + sessionInfo.setDataUrl("tcp://172.0.0.1:5343"); + info = fService.createSession(sessionInfo, new NullProgressMonitor()); + assertNotNull(info); + assertEquals("mysession", info.getName()); + assertEquals("", info.getSessionPath()); // the complete network path is not available at this point + assertTrue(info.isStreamedTrace()); + fService.destroySession("mysession", new NullProgressMonitor()); + + sessionInfo = new SessionInfo("mysession"); + sessionInfo.setStreamedTrace(true); + sessionInfo.setNetworkUrl("net://172.0.0.1:1234:2345"); + info = fService.createSession(sessionInfo, new NullProgressMonitor()); + assertNotNull(info); + assertEquals("mysession", info.getName()); + assertEquals("net://172.0.0.1:1234:2345", info.getSessionPath()); + assertTrue(info.isStreamedTrace()); + fService.destroySession("mysession", new NullProgressMonitor()); + + // verbose + enableVerbose(); + sessionInfo = new SessionInfo("mysession"); + sessionInfo.setStreamedTrace(true); + sessionInfo.setNetworkUrl("net://172.0.0.1"); + info = fService.createSession(sessionInfo, new NullProgressMonitor()); + assertNotNull(info); + assertEquals("mysession", info.getName()); + assertEquals("net://172.0.0.1", info.getSessionPath()); + assertTrue(info.isStreamedTrace()); + disableVerbose(); + fService.destroySession("mysession", new NullProgressMonitor()); + + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testCreateSessionVerbose2_1() { + try { + fShell.setScenario(SCEN_CREATE_SESSION_VERBOSE_2_1); + + enableVerbose(); + ISessionInfo sessionInfo = new SessionInfo("mysession"); + sessionInfo.setStreamedTrace(true); + sessionInfo.setNetworkUrl("net://172.0.0.1"); + ISessionInfo info = fService.createSession(sessionInfo, new NullProgressMonitor()); + assertNotNull(info); + assertEquals("mysession", info.getName()); + assertEquals("net://172.0.0.1", info.getSessionPath()); + assertTrue(info.isStreamedTrace()); + fService.destroySession("mysession", new NullProgressMonitor()); + } catch (ExecutionException e) { + fail(e.toString()); + } finally { + disableVerbose(); + } + } + + @Test + public void testCreateSnapshotSession() { + try { + fShell.setScenario(SCEN_CREATE_SNAPSHOT_SESSION); + ISessionInfo params = new SessionInfo("mysession"); + params.setSnapshot(true); + ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); + assertNotNull(sessionInfo); + assertEquals("mysession", sessionInfo.getName()); + assertTrue(sessionInfo.isSnapshotSession()); + assertEquals("", sessionInfo.getSessionPath()); + assertTrue(!sessionInfo.isStreamedTrace()); + + assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); + + String[] names = fService.getSessionNames(new NullProgressMonitor()); + assertEquals(names[0], "mysession"); + + ISnapshotInfo snapshotInfo = fService.getSnapshotInfo("mysession", new NullProgressMonitor()); + assertNotNull(snapshotInfo); + assertEquals("snapshot-1", snapshotInfo.getName()); + assertEquals("/home/user/lttng-traces/mysession-20130913-141651", snapshotInfo.getSnapshotPath()); + assertEquals(1, snapshotInfo.getId()); + assertTrue(!snapshotInfo.isStreamedSnapshot()); + + // we need to set the snapshotInfo to so that the session path is set correctly + sessionInfo.setSnapshotInfo(snapshotInfo); + assertEquals("/home/user/lttng-traces/mysession-20130913-141651", sessionInfo.getSessionPath()); + + fService.recordSnapshot("mysession", new NullProgressMonitor()); + + fService.destroySession("mysession", new NullProgressMonitor()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testCreateSnapshotSession2_5() { + try { + fShell.setScenario(SCEN_CREATE_SNAPSHOT_SESSION_2_5); + ISessionInfo params = new SessionInfo("mysession"); + params.setSnapshot(true); + ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); + assertNotNull(sessionInfo); + assertEquals("mysession", sessionInfo.getName()); + assertTrue(sessionInfo.isSnapshotSession()); + assertEquals("", sessionInfo.getSessionPath()); + assertTrue(!sessionInfo.isStreamedTrace()); + + assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); + + String[] names = fService.getSessionNames(new NullProgressMonitor()); + assertEquals(names[0], "mysession"); + + ISnapshotInfo snapshotInfo = fService.getSnapshotInfo("mysession", new NullProgressMonitor()); + assertNotNull(snapshotInfo); + assertEquals("snapshot-1", snapshotInfo.getName()); + assertEquals("/home/user/lttng-traces/mysession-20130913-141651", snapshotInfo.getSnapshotPath()); + assertEquals(1, snapshotInfo.getId()); + assertTrue(!snapshotInfo.isStreamedSnapshot()); + + // we need to set the snapshotInfo to so that the session path is set correctly + sessionInfo.setSnapshotInfo(snapshotInfo); + assertEquals("/home/user/lttng-traces/mysession-20130913-141651", sessionInfo.getSessionPath()); + + fService.recordSnapshot("mysession", new NullProgressMonitor()); + + fService.destroySession("mysession", new NullProgressMonitor()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + public void testCreateStreamedSnapshotSession() { + try { + fShell.setScenario(SCEN_CREATE_STREAMED_SNAPSHOT_SESSION); + + ISessionInfo params = new SessionInfo("mysession"); + params.setNetworkUrl("net://172.0.0.1"); + ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); + assertNotNull(sessionInfo); + assertEquals("mysession", sessionInfo.getName()); + assertTrue(sessionInfo.isSnapshotSession()); + + assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); + assertTrue(sessionInfo.isStreamedTrace()); + + String[] names = fService.getSessionNames(new NullProgressMonitor()); + assertEquals(names[0], "mysession"); + + ISnapshotInfo snapshotInfo = sessionInfo.getSnapshotInfo(); + assertNotNull(sessionInfo); + assertEquals("snapshot-2", snapshotInfo.getName()); + assertEquals("net4://172.0.0.1:5342/", snapshotInfo.getSnapshotPath()); + assertEquals(2, snapshotInfo.getId()); + assertTrue(snapshotInfo.isStreamedSnapshot()); + + // we need to set the snapshotInfo to so that the session path is set correctly + sessionInfo.setSnapshotInfo(snapshotInfo); + assertEquals("net4://172.0.0.1:5342/", sessionInfo.getSessionPath()); + + fService.recordSnapshot("mysession", new NullProgressMonitor()); + + fService.destroySession("mysession", new NullProgressMonitor()); + + } catch (ExecutionException e) { + fail(e.toString()); + } + } + + @Test + public void testCreateSnapshotSessionErrors() { + try { + fShell.setScenario(SCEN_CREATE_SNAPSHOT_SESSION_ERRORS); + + String[] names = fService.getSessionNames(new NullProgressMonitor()); + assertEquals(names[0], "mysession"); + } catch (ExecutionException e) { + fail(e.toString()); + } + + try { + fService.getSnapshotInfo("blabla", new NullProgressMonitor()); + fail("getSnapshoInfo() didn't fail"); + } catch (ExecutionException e) { + // successful + } + + try { + fService.recordSnapshot("blabla", new NullProgressMonitor()); + fail("getSnapshoInfo() didn't fail"); + } catch (ExecutionException e) { + // successful + } + + try { + fService.recordSnapshot("mysession", new NullProgressMonitor()); + fail("getSnapshoInfo() didn't fail"); + } catch (ExecutionException e) { + // successful + } + } + + @Test + public void testCreateLiveSession() throws ExecutionException { + fShell.setScenario(SCEN_CREATE_LIVE_SESSION); + + ISessionInfo params = new SessionInfo("mysession"); + params.setLive(true); + params.setStreamedTrace(true); + params.setNetworkUrl("net://127.0.0.1"); + ISessionInfo sessionInfo = fService.createSession(params, new NullProgressMonitor()); + assertNotNull(sessionInfo); + assertEquals("mysession", sessionInfo.getName()); + assertEquals(TraceSessionState.INACTIVE, sessionInfo.getSessionState()); + assertTrue(sessionInfo.isStreamedTrace()); + assertTrue(sessionInfo.isLive()); + assertEquals("net://127.0.0.1", sessionInfo.getSessionPath()); + String[] names = fService.getSessionNames(new NullProgressMonitor()); + assertEquals(names[0], "mysession"); + fService.destroySession("mysession", new NullProgressMonitor()); + } + + @Test + public void testCreateLiveSessionErrors() { + try { + fShell.setScenario(SCEN_CREATE_LIVE_SESSION_ERRORS); + + ISessionInfo parameters = new SessionInfo("mysession"); + parameters.setLive(true); + parameters.setSnapshot(true); + fService.createSession(parameters, new NullProgressMonitor()); + fail("createSession() didn't fail"); + } catch (ExecutionException e) { + // successful + } + + try { + ISessionInfo parameters = new SessionInfo("mysession"); + parameters.setNetworkUrl("blah"); + parameters.setLive(true); + fService.createSession(parameters, new NullProgressMonitor()); + fail("createSession() didn't fail"); + } catch (ExecutionException e) { + // successful + } + + try { + ISessionInfo parameters = new SessionInfo("mysession"); + parameters.setControlUrl("net://127.0.0.1"); + parameters.setLive(true); + fService.createSession(parameters, new NullProgressMonitor()); + fail("createSession() didn't fail"); + } catch (ExecutionException e) { + // successful + } + } + + private static void enableVerbose() { + // verbose + ControlCommandLogger.init(ControlPreferences.getInstance().getLogfilePath(), false); + ControlPreferences.getInstance().getPreferenceStore().setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, true); + ControlPreferences.getInstance().getPreferenceStore().setDefault(ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE); + } + + private static void disableVerbose() { + ControlPreferences.getInstance().getPreferenceStore().setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, false); + } + + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/AddContextDialogStub.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/AddContextDialogStub.java new file mode 100644 index 0000000000..189964bc10 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/AddContextDialogStub.java @@ -0,0 +1,63 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IAddContextDialog; + +/** + * Add Context dialog stub. + */ +@SuppressWarnings("javadoc") +public class AddContextDialogStub implements IAddContextDialog { + + private Set fAvailableContexts = null; + private List fContexts = null; + + @Override + public int open() { + return 0; + } + + @Override + public void setAvalibleContexts(List contexts) { + fAvailableContexts = new HashSet<>(); + fAvailableContexts.addAll(contexts); + } + + @Override + public List getContexts() { + List ret = new ArrayList<>(); + ret.addAll(fContexts); + return ret; + } + + public void setContexts(List contexts) throws IllegalArgumentException{ + fContexts = new ArrayList<>(); + fContexts.addAll(contexts); + // If availableContexts are null we cannot verify + if (fAvailableContexts != null) { + for (Iterator iterator = fContexts.iterator(); iterator.hasNext();) { + String string = iterator.next(); + if (!fAvailableContexts.contains(string)) { + throw new IllegalArgumentException(); + } + } + } + } +} + diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/CreateSessionDialogStub.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/CreateSessionDialogStub.java new file mode 100644 index 0000000000..a3f7be4abc --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/CreateSessionDialogStub.java @@ -0,0 +1,101 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + * Marc-Andre Laperle - Support for creating a live session + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.ICreateSessionDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; + +/** + * Create session dialog stub implementation. + */ +@SuppressWarnings("javadoc") +public class CreateSessionDialogStub implements ICreateSessionDialog { + + public String fName = "mysession"; + public String fPath = null; + private boolean fIsStreamedTrace = false; + private String fNetworkUrl = null; + private String fControlUrl = null; + private String fDataUrl = null; + private boolean fIsSnapshot; + private boolean fIsLive = false; + private int fLiveDelay = 0; + + @Override + public void initialize(TraceSessionGroup group) { + } + + @Override + public int open() { + return 0; + } + + public void setSessionPath(String path) { + fPath = path; + } + + public void setSessionName(String name) { + fName = name; + } + + public void setStreamedTrace(boolean isStreamedTrace) { + fIsStreamedTrace = isStreamedTrace; + } + + public void setNetworkUrl(String fNetworkUrl) { + this.fNetworkUrl = fNetworkUrl; + } + + public void setControlUrl(String fControlUrl) { + this.fControlUrl = fControlUrl; + } + + public void setDataUrl(String fDataUrl) { + this.fDataUrl = fDataUrl; + } + + public void setSnapshot(boolean isSnapshot) { + fIsSnapshot = isSnapshot; + } + + public void setLive(boolean isLive) { + fIsLive = isLive; + } + + public void setLiveDelay(int liveDelay) { + fLiveDelay = liveDelay; + } + + @Override + public ISessionInfo getParameters() { + ISessionInfo sessionInfo = new SessionInfo(fName); + + if (fIsStreamedTrace) { + sessionInfo.setNetworkUrl(fNetworkUrl); + sessionInfo.setControlUrl(fControlUrl); + sessionInfo.setDataUrl(fDataUrl); + sessionInfo.setStreamedTrace(true); + } else if (fPath != null) { + sessionInfo.setSessionPath(fPath); + } + + sessionInfo.setLive(fIsLive); + sessionInfo.setLiveDelay(fLiveDelay); + sessionInfo.setSnapshot(fIsSnapshot); + + return sessionInfo; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/DestroyConfirmDialogStub.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/DestroyConfirmDialogStub.java new file mode 100644 index 0000000000..88479e2354 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/DestroyConfirmDialogStub.java @@ -0,0 +1,26 @@ +/********************************************************************** + * Copyright (c) 2012 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IConfirmDialog; +import org.eclipse.swt.widgets.Shell; + +/** + * A confirmation dialog stub implementation. + */ +public class DestroyConfirmDialogStub implements IConfirmDialog { + + @Override + public boolean openConfirm(Shell parent, String title, String message) { + return true; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableChannelDialogStub.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableChannelDialogStub.java new file mode 100644 index 0000000000..eb96367227 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableChannelDialogStub.java @@ -0,0 +1,93 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IEnableChannelDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; + +/** + * Create channel dialog stub implementation. + */ +@SuppressWarnings("javadoc") +public class EnableChannelDialogStub implements IEnableChannelDialog { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + private TraceDomainComponent fDomain; + private ChannelInfo fChannelInfo; + private boolean fIsKernel; + + // ------------------------------------------------------------------------ + // Constructor + // ------------------------------------------------------------------------ + public EnableChannelDialogStub() { + fChannelInfo = new ChannelInfo("mychannel"); + fChannelInfo.setNumberOfSubBuffers(4); + fChannelInfo.setOverwriteMode(true); + fChannelInfo.setReadTimer(200); + fChannelInfo.setSwitchTimer(100); + fChannelInfo.setSubBufferSize(16384); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + public void setIsKernel(boolean isKernel) { + fIsKernel = isKernel; + } + + @Override + public IChannelInfo getChannelInfo() { + return fChannelInfo; + } + + @Override + public void setDomainComponent(TraceDomainComponent domain) { + fDomain = domain; + if (fDomain != null) { + fIsKernel = fDomain.isKernel(); + } + } + + @Override + public int open() { + return 0; + } + + @Override + public boolean isKernel() { + return fIsKernel; + } + + @Override + public void setHasKernel(boolean hasKernel) { + // Do nothing + } + + public void setChannelInfo(ChannelInfo info) { + fChannelInfo = info; + } + + @Override + public void setTargetNodeComponent(TargetNodeComponent node) { + // Do nothing + } + + public void setBufferType (BufferType bufferType) { + fChannelInfo.setBufferType(bufferType); + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java new file mode 100644 index 0000000000..b8be180e9e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/EnableEventsDialogStub.java @@ -0,0 +1,234 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IEnableEventsDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; + +/** + * Enable events dialog stub implementation. + */ +@SuppressWarnings("javadoc") +public class EnableEventsDialogStub implements IEnableEventsDialog { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + private boolean fIsKernel; + private boolean fIsTracePoints; + private boolean fIsAllTracePoints; + private boolean fIsSysCalls; + private boolean fIsDynamicProbe; + private String fProbeEventName; + private String fDynamicProbe; + private boolean fIsFunctionProbe; + private String fFunctionEventName; + private String fFunctionProbe; + private boolean fIsWildcard; + private String fWildcard; + private boolean fIsLogLevel; + private String fLogLevelEventName; + private TraceLogLevel fLogLevel; + private LogLevelType fLogLevelType; + private String fFilter; + private List fNames = new ArrayList<>(); + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + public void setIsKernel(boolean isKernel) { + fIsKernel = isKernel; + } + + public void setIsTracePoints(boolean isTracePoints) { + fIsTracePoints = isTracePoints; + } + + public void setIsAllTracePoints(boolean isAllTracePoints) { + fIsAllTracePoints = isAllTracePoints; + } + + public void setIsSysCalls(boolean isSysCalls) { + this.fIsSysCalls = isSysCalls; + } + + public void setIsDynamicProbe(boolean isDynamicProbe) { + fIsDynamicProbe = isDynamicProbe; + } + + public void setProbeEventName(String probeEventName) { + fProbeEventName = probeEventName; + } + + public void setDynamicProbe(String dynamicProbe) { + fDynamicProbe = dynamicProbe; + } + + public void setIsFunctionProbe(boolean isFunctionProbe) { + fIsFunctionProbe = isFunctionProbe; + } + + public void setFunctionEventName(String functionEventName) { + fFunctionEventName = functionEventName; + } + + public void setFunctionProbe(String functionProbe) { + fFunctionProbe = functionProbe; + } + + public void setIsWildcard(boolean isWildcard) { + fIsWildcard = isWildcard; + } + + public void setWildcard(String wildcard) { + fWildcard = wildcard; + } + + public void setIsLogLevel(boolean isLogLevel) { + fIsLogLevel = isLogLevel; + } + + public void setLogLevelEventName(String logLevelEventName) { + fLogLevelEventName = logLevelEventName; + } + + public void setLogLevel(TraceLogLevel logLevel) { + fLogLevel = logLevel; + } + + public void setLogLevelType(LogLevelType logLevelType) { + fLogLevelType = logLevelType; + } + + public void setNames(List names) { + fNames = names; + } + + public void setFilterExpression(String filter) { + fFilter = filter; + } + + @Override + public boolean isTracepoints() { + return fIsTracePoints; + } + + @Override + public boolean isAllTracePoints() { + return fIsAllTracePoints; + } + + @Override + public boolean isSysCalls() { + return fIsSysCalls; + } + + @Override + public boolean isAllSysCalls() { + return fIsSysCalls; + } + + @Override + public List getEventNames() { + return fNames; + } + + @Override + public boolean isDynamicProbe() { + return fIsDynamicProbe; + } + + @Override + public String getProbeEventName() { + return fProbeEventName; + } + + @Override + public String getProbeName() { + return fDynamicProbe; + } + + @Override + public boolean isDynamicFunctionProbe() { + return fIsFunctionProbe; + } + + @Override + public String getFunctionEventName() { + return fFunctionEventName; + } + + @Override + public String getFunction() { + return fFunctionProbe; + } + + @Override + public boolean isWildcard() { + return fIsWildcard; + } + + @Override + public String getWildcard() { + return fWildcard; + } + + @Override + public boolean isLogLevel() { + return fIsLogLevel; + } + + @Override + public LogLevelType getLogLevelType() { + return fLogLevelType; + } + + @Override + public TraceLogLevel getLogLevel() { + return fLogLevel; + } + + @Override + public String getLogLevelEventName() { + return fLogLevelEventName; + } + + @Override + public boolean isKernel() { + return fIsKernel; + } + + @Override + public void setTraceProviderGroup(TraceProviderGroup providerGroup) { + } + + @Override + public void setTraceDomainComponent(TraceDomainComponent domain) { + } + + @Override + public int open() { + return 0; + } + + @Override + public String getFilterExpression() { + return fFilter; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/GetEventInfoDialogStub.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/GetEventInfoDialogStub.java new file mode 100644 index 0000000000..51940fb4f8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/dialogs/GetEventInfoDialogStub.java @@ -0,0 +1,68 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs; + +import java.util.Arrays; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IGetEventInfoDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; + +/** + * Get event information dialog stub implementation. + */ +public class GetEventInfoDialogStub implements IGetEventInfoDialog { + + private TraceSessionComponent[] fSessions; + private String fFilterExpression; + + @Override + public TraceSessionComponent getSession() { + return fSessions[0]; + } + + @Override + public TraceChannelComponent getChannel() { + return null; + } + + @Override + public void setIsKernel(boolean isKernel) { + } + + @Override + public void setSessions(TraceSessionComponent[] sessions) { + if (sessions != null) { + fSessions = Arrays.copyOf(sessions, sessions.length); + return; + } + fSessions = null; + } + + @Override + public String getFilterExpression() { + return fFilterExpression; + } + + @Override + public int open() { + return 0; + } + + /** + * @param filter the filter to set + */ + public void setFilterExpression(String filter) { + fFilterExpression = filter; + } +} + diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/CommandShellFactory.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/CommandShellFactory.java new file mode 100644 index 0000000000..f7dc1bdb7f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/CommandShellFactory.java @@ -0,0 +1,41 @@ +/********************************************************************** + * Copyright (c) 2012 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.stubs.service; + +import org.eclipse.linuxtools.internal.lttng2.control.stubs.shells.LTTngToolsFileShell; + +@SuppressWarnings("javadoc") +public class CommandShellFactory { + + public static final int GET_SESSION_NAMES_COMMAND_SHELL = 0; + + private static CommandShellFactory fInstance = null; + + public static CommandShellFactory getInstance() { + if (fInstance == null) { + fInstance = new CommandShellFactory(); + } + return fInstance; + } + +// public ICommandShell getRealShell() { +// ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); +// IHost host = registry.getLocalHost(); +// RemoteSystemProxy proxy = new RemoteSystemProxy(host); +// ICommandShell shell = new LTTngToolsSimulatorShell(proxy); +// return shell; +// } + + public LTTngToolsFileShell getFileShell() { + return new LTTngToolsFileShell(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java new file mode 100644 index 0000000000..19de1fcd39 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java @@ -0,0 +1,118 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.stubs.service; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.Status; +import org.eclipse.linuxtools.internal.lttng2.control.stubs.shells.LTTngToolsFileShell; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; +import org.eclipse.rse.core.model.IRSECallback; +import org.eclipse.rse.core.subsystems.ICommunicationsListener; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.services.shells.IShellService; +import org.eclipse.rse.services.terminals.ITerminalService; +import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; + +@SuppressWarnings("javadoc") +public class TestRemoteSystemProxy implements IRemoteSystemProxy { + + private LTTngToolsFileShell fShell = null; + private String fTestFile = null; + private String fScenario = null; + + @Override + public IShellService getShellService() { + return null; + } + + @Override + public ITerminalService getTerminalService() { + return null; + } + + @Override + public ISubSystem getShellServiceSubSystem() { + return null; + } + + @Override + public ISubSystem getTerminalServiceSubSystem() { + return null; + } + @Override + public IFileServiceSubSystem getFileServiceSubSystem() { + return null; + } + + @Override + public void connect(IRSECallback callback) throws ExecutionException { +// System.out.println("in done: proxy connect "); + if (callback != null) { + callback.done(Status.OK_STATUS, null); + } + } + + @Override + public void disconnect() throws ExecutionException { + fShell = null; + } + + @Override + public ICommandShell createCommandShell() throws ExecutionException { + if (fShell == null) { + fShell = CommandShellFactory.getInstance().getFileShell(); + if ((fTestFile != null) && (fScenario != null)) { + try { + fShell.loadScenarioFile(fTestFile); + } catch (Exception e) { + throw new ExecutionException(e.toString()); + } + fShell.setScenario(fScenario); + } + } + return fShell; + } + + @Override + public void addCommunicationListener(ICommunicationsListener listener) { + } + + @Override + public void removeCommunicationListener(ICommunicationsListener listener) { + } + + public void setTestFile(String testFile) { + fTestFile = testFile; + } + + public void setScenario(String scenario) { + fScenario = scenario; + if (fShell != null) { + fShell.setScenario(fScenario); + } + } + + @Override + public int getPort() { + return IRemoteSystemProxy.INVALID_PORT_NUMBER; + } + + @Override + public void setPort(int port) { + } + + @Override + public boolean isLocal() { + return false; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java new file mode 100644 index 0000000000..3f262b6c04 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java @@ -0,0 +1,279 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.stubs.shells; + +import java.io.BufferedReader; +import java.io.DataInputStream; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.CommandResult; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult; + +@SuppressWarnings("javadoc") +public class LTTngToolsFileShell extends TestCommandShell { + + // ------------------------------------------------------------------------ + // CONSTANTS + // ------------------------------------------------------------------------ + private final static String SCENARIO_KEY = ""; + private final static String SCENARIO_END_KEY = ""; + private final static String INPUT_KEY = ""; + private final static String INPUT_END_KEY = ""; + private final static String RESULT_KEY = ""; + private final static String OUTPUT_KEY = ""; + private final static String OUTPUT_END_KEY = ""; + private final static String ERROR_OUTPUT_KEY = ""; + private final static String ERROR_OUTPUT_END_KEY = ""; + private final static String COMMENT_KEY = "#.*"; + + private final static Pattern LTTNG_LIST_SESSION_PATTERN = Pattern.compile("lttng\\s+list\\s+(.+)"); + private final static String LTTNG_LIST_PROVIDER_PATTERN = "lttng\\s+list\\s+(-u|-k)"; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + private String fScenariofile; + private String fScenario; + + private final Map> fScenarioMap = new HashMap<>(); + private final Map fSessionNameMap = new HashMap<>(); + + /** + * Parse a scenario file with the format: + *
+     * <SCENARIO>
+     * ScenarioName
+     *
+     * <COMMAND_INPUT>
+     * Command
+     * </COMAND_INPUT>
+     *
+     * <COMMAND_RESULT>
+     * CommandResult
+     * </COMMAND_RESULT>
+     *
+     * <COMMAND_OUTPUT>
+     * CommandOutput
+     * <COMMAND_ERROR_OUTPUT>
+     * CommandErrorOutput
+     * </COMMAND_ERROR_OUTPUT>
+     * </COMMAND_OUTPUT>
+     *
+     * </SCENARIO>
+     *
+     * Where: ScenarioName - is the scenario name
+     *        Command - the command line string
+     *        CommandResult - the result integer of the command (0 for success, 1 for failure)
+     *        ComandOutput - the command output string (multi-line possible)
+     *        ComandErrorOutput - the command error output string (multi-line possible)
+     *
+     * Note: 1) There can be many scenarios per file
+     *       2) There can be many (Command-CommandResult-CommandOutput) triples per scenario
+     *       3) Lines starting with # will be ignored (comments)
+     * 
+     * @param scenariofile - path to scenario file
+     * @throws Exception
+     */
+    public synchronized void loadScenarioFile(String scenariofile) throws Exception {
+        fScenariofile = scenariofile;
+
+        // clean up map
+        Collection> values = fScenarioMap.values();
+        for (Iterator> iterator = values.iterator(); iterator.hasNext();) {
+            Map map = iterator.next();
+            map.clear();
+        }
+        fScenarioMap.clear();
+
+        // load from file
+
+        // Open the file
+        try (FileInputStream fstream = new FileInputStream(fScenariofile);
+                DataInputStream in = new DataInputStream(fstream);
+                BufferedReader br = new BufferedReader(new InputStreamReader(in));) {
+            String strLine;
+
+            // Read File Line by Line
+
+            // Temporary map for generating instance numbers for lttng list
+            //  commands.
+            // The numbers are per scenario.
+            Map tmpSessionNameMap = new HashMap<>();
+            while ((strLine = br.readLine()) != null) {
+
+                // Ignore comments
+                if (isComment(strLine)) {
+                    continue;
+                }
+
+                if (SCENARIO_KEY.equals(strLine)) {
+                    // scenario start
+
+                    // Ignore comments
+                    strLine = br.readLine();
+                    while (isComment(strLine)) {
+                        strLine = br.readLine();
+                    }
+
+                    String scenario = strLine;
+                    Map commandMap = new HashMap<>();
+                    fScenarioMap.put(scenario, commandMap);
+                    List output = null;
+                    List errorOutput = null;
+                    String input = null;
+                    boolean inOutput = false;
+                    boolean inErrorOutput = false;
+                    int result = 0;
+                    tmpSessionNameMap.clear();
+                    while ((strLine = br.readLine()) != null) {
+                        // Ignore comments
+                        if (isComment(strLine)) {
+                            continue;
+                        }
+
+                        if (SCENARIO_END_KEY.equals(strLine)) {
+                            // Scenario is finished
+                            break;
+                        }
+                        if (INPUT_KEY.equals(strLine)) {
+                            strLine = br.readLine();
+                            // Ignore comments
+                            while (isComment(strLine)) {
+                                strLine = br.readLine();
+                            }
+                            // Read command
+                            input = strLine;
+
+                            // Handle instances of 'lttng list
+                            // ();
+                            errorOutput = new ArrayList<>();
+                        } else if (RESULT_KEY.equals(strLine)) {
+                            strLine = br.readLine();
+                            // Ignore comments
+                            while (isComment(strLine)) {
+                                strLine = br.readLine();
+                            }
+                            // Save result value
+                            result = Integer.parseInt(strLine);
+                        } else if (OUTPUT_END_KEY.equals(strLine)) {
+                            // Save output/result in command map
+                            if (output != null && errorOutput != null) {
+                                commandMap.put(input, new CommandResult(result, output.toArray(new String[output.size()]), errorOutput.toArray(new String[errorOutput.size()])));
+                            }
+                            inOutput = false;
+                        } else if (OUTPUT_KEY.equals(strLine)) {
+                            // first line of output
+                            inOutput = true;
+                        } else if (ERROR_OUTPUT_KEY.equals(strLine)) {
+                            // first line of output
+                            inErrorOutput = true;
+                        } else if (ERROR_OUTPUT_END_KEY.equals(strLine)) {
+                            inErrorOutput = false;
+                        } else if (inOutput) {
+                            while (isComment(strLine)) {
+                                strLine = br.readLine();
+                            }
+                            // lines of output/error output
+                            if (errorOutput != null && inErrorOutput) {
+                                errorOutput.add(strLine);
+                            } else if (output != null) {
+                                output.add(strLine);
+                            }
+                        }
+                        // else {
+                        // if (RESULT_END_KEY.equals(strLine)) {
+                        // nothing to do
+                        // }
+                    }
+                }
+            }
+        }
+    }
+
+    // Set the scenario to consider in executeCommand()
+    public synchronized void setScenario(String scenario) {
+        fScenario = scenario;
+        fSessionNameMap.clear();
+        if (!fScenarioMap.containsKey(fScenario)) {
+            throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+   public synchronized ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException {
+        Map commands = fScenarioMap.get(fScenario);
+        String fullCommand = command;
+
+        Matcher matcher = LTTNG_LIST_SESSION_PATTERN.matcher(command);
+        if (matcher.matches() && !command.matches(LTTNG_LIST_PROVIDER_PATTERN)) {
+            String sessionName = matcher.group(1).trim();
+            Integer i = fSessionNameMap.get(sessionName);
+            if (i != null) {
+                i++;
+            } else {
+                i = 0;
+            }
+            fSessionNameMap.put(sessionName, i);
+            fullCommand += String.valueOf(i);
+        }
+
+        if (commands.containsKey(fullCommand)) {
+            return commands.get(fullCommand);
+        }
+
+        String[] output = new String[1];
+        output[0] = String.valueOf("Command not found");
+        CommandResult result = new CommandResult(0, null, null);
+        // For verification of setters of class CommandResult
+        result.setOutput(output);
+        result.setErrorOutput(output);
+        result.setResult(1);
+        return result;
+   }
+
+    // ------------------------------------------------------------------------
+    // Helper methods
+    // ------------------------------------------------------------------------
+
+    private static boolean isComment(String line) {
+        if (line == null) {
+            throw new RuntimeException("line is null");
+        }
+        return line.matches(COMMENT_KEY);
+    }
+}
diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java
new file mode 100644
index 0000000000..998e72eb30
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java
@@ -0,0 +1,50 @@
+/**********************************************************************
+ * Copyright (c) 2012 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:
+ *   Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.stubs.shells;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.CommandResult;
+import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult;
+import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell;
+
+/**
+ * Command shell stub
+ */
+public class TestCommandShell implements ICommandShell {
+
+    /** If the shell is connected */
+    protected boolean fIsConnected = false;
+
+    @Override
+    public void connect() throws ExecutionException {
+        fIsConnected = true;
+    }
+
+    @Override
+    public void disconnect() {
+        fIsConnected = false;
+    }
+
+    @Override
+    public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException {
+        return executeCommand(command, monitor, true);
+    }
+
+    @Override
+    public ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException {
+        if (fIsConnected) {
+
+        }
+        return new CommandResult(0, new String[0], new String[0]);
+    }
+}
diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg
new file mode 100644
index 0000000000..9b06e93148
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg
@@ -0,0 +1,228 @@
+####################################################################
+# Copyright (c) 2012 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: 
+#    Bernd Hufmann - Initial API and implementation
+####################################################################
+####################################################################
+# Scenario: Initialize
+####################################################################
+
+Initialize
+
+lttng version 
+
+
+0
+
+
+lttng version 2.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+lttng list 
+
+
+0
+
+
+Currently no available tracing session
+
+
+
+lttng list -k
+
+
+0
+
+
+Kernel events
+-------------
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+
+
+
+
+lttng list -u
+
+
+0
+
+
+UST events:
+-------------
+
+PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  with LTTng 2.1 options  
+####################################################################
+##################################################################
+
+CreateSessionFileProto
+
+lttng create mysession -U file:///tmp
+
+
+0
+
+
+Session mysession created.
+Traces will be written in file:///tmp
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: file:///tmp
+
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+##################################################################
+
+CreateSessionControlData
+
+lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
+
+
+0
+
+
+Session mysession created.
+Control URL tcp://172.0.0.1 set for session mysession
+Data URL tcp://172.0.0.1:5343 set for session mysession
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: tcp://172.0.0.1:5342 [data: 5343]
+
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+##################################################################
+
+CreateSessionNetwork
+
+lttng create mysession -U net://172.0.0.1:1234:2345
+
+
+0
+
+
+Session mysession created.
+Traces will be written in net://172.0.0.1:1234:2345
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: net://172.0.0.1:1234 [data: 2345]
+
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession2 destroyed.
+
+
+
+
+##################################################################
+
+CreateSessionNetwork2
+
+lttng create mysession -U net6://[ffff::eeee:dddd:cccc:0]
+
+
+0
+
+
+Session mysession created.
+Traces will be written in net6://[ffff::eeee:dddd:cccc:0]
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path:  net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]
+
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession2 destroyed.
+
+
+
\ No newline at end of file
diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg
new file mode 100644
index 0000000000..808a51f369
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg
@@ -0,0 +1,158 @@
+####################################################################
+# Copyright (c) 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: 
+#    Bernd Hufmann - Initial API and implementation
+####################################################################
+####################################################################
+# Scenario: Initialize
+####################################################################
+
+Initialize
+
+lttng version 
+
+
+0
+
+
+lttng version 2.3.0 - Dominus Vobiscum
+
+A very succulent line-up of beers brewed at Microbrasserie Charlevoix. Elaborated starting from special malts and fermented with a Belgian yeast. These beers are refermented in bottle and will make you discover the richness of wheat, amber and triple styles.
+
+Web site: http://lttng.org
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+lttng list 
+
+
+0
+
+
+Currently no available tracing session
+
+
+
+lttng list -k
+
+
+0
+
+
+Kernel events
+-------------
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+
+
+
+
+lttng list -u -f 
+
+
+0
+
+
+UST events:
+-------------
+
+PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --snapshot" LTTng 2.3
+####################################################################
+
+ScenCreateSession
+
+lttng create mysession --snapshot 
+
+
+0
+
+
+Session mysession created.
+Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
+Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
+
+#------------------------------------------------------------------------------
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive snapshot]
+    Trace path: 
+
+
+#------------------------------------------------------------------------------
+
+lttng snapshot list-output  -s mysession
+
+
+0
+
+
+Snapshot output list for session mysession
+    [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
+
+#------------------------------------------------------------------------------
+
+lttng start mysession
+
+
+0
+
+
+Tracing started for session mysession.
+
+#------------------------------------------------------------------------------
+
+lttng snapshot record  -s mysession
+
+
+0
+
+
+    Snapshot recorded successfully for session mysession
+
+#------------------------------------------------------------------------------
+
+lttng stop mysession
+
+
+0
+
+
+Tracing stopped for session mysession.
+
+#------------------------------------------------------------------------------
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg
new file mode 100644
index 0000000000..b841a5c8b1
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg
@@ -0,0 +1,528 @@
+####################################################################
+# 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:
+#    Jonathan Rajotte - Initial API and implementation
+####################################################################
+####################################################################
+# Scenario: Initialize
+####################################################################
+
+Initialize
+
+lttng --mi xml version 
+
+
+0
+
+
+
+
+  version
+  
+    
+      2.6.0
+      2
+      6
+      
+      0
+      TestMI
+      Lorem ipsum
+      http://lttng.org
+      lttng is free software and under the GPL license and part LGPL
+    
+  
+
+
+
+
+lttng --mi xml list 
+
+
+0
+
+
+
+
+  list
+  
+    
+  
+
+
+
+
+lttng --mi xml list -k
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        KERNEL
+        PER_PID
+        
+          
+            sched_kthread_stop
+            TRACEPOINT
+            true
+            false
+            TRACE_EMERG
+            ALL
+            false
+          
+          
+            sched_kthread_stop_ret
+            TRACEPOINT
+            true
+            false
+            TRACE_EMERG
+            ALL
+            false
+          
+          
+            sched_wakeup_new
+            TRACEPOINT
+            true
+            false
+            TRACE_EMERG
+            ALL
+            false
+          
+        
+      
+    
+  
+
+
+
+
+lttng --mi xml list -u -f 
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        UST
+        PER_PID
+        
+          
+            9379
+            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+            
+              
+                ust_tests_hello:tptest_sighandler
+                TRACEPOINT
+                true
+                false
+                TRACE_DEBUG_MODULE
+                ALL
+                false
+                
+              
+              
+                ust_tests_hello:tptest
+                TRACEPOINT
+                true
+                false
+                TRACE_INFO
+                ALL
+                false
+                
+                  
+                    doublefield
+                    FLOAT
+                    0
+                  
+                  
+                    floatfield
+                    FLOAT
+                    0
+                  
+                  
+                    stringfield
+                    STRING
+                    0
+                  
+                
+              
+            
+          
+          
+            4852
+            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+            
+              
+                ust_tests_hello:tptest_sighandler
+                TRACEPOINT
+                true
+                false
+                TRACE_WARNING
+                ALL
+                false
+                
+              
+              
+                ust_tests_hello:tptest
+                TRACEPOINT
+                true
+                false
+                TRACE_DEBUG_FUNCTION
+                ALL
+                false
+                
+                  
+                    doublefield
+                    FLOAT
+                    0
+                  
+                  
+                    floatfield
+                    FLOAT
+                    0
+                  
+                  
+                    stringfield
+                    STRING
+                    0
+                  
+                
+              
+            
+          
+        
+      
+    
+  
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  with LTTng 2.1 options  
+####################################################################
+##################################################################
+
+CreateSessionFileProto
+
+lttng --mi xml create mysession -U file:///tmp
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      /tmp
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml list mysession
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession
+        /tmp
+        false
+        0
+        0
+        
+      
+    
+  
+
+
+
+
+lttng --mi xml destroy mysession
+
+
+0
+
+
+
+
+  destroy
+  
+    
+      
+        mysession
+        /tmp
+        false
+        0
+        0
+      
+    
+  
+  true
+
+
+
+
+##################################################################
+
+CreateSessionControlData
+
+lttng --mi xml create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      tcp4://172.0.0.1:5342/ [data: 5343]
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml list mysession
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession
+        tcp4://172.0.0.1:5342/ [data: 5343]
+        false
+        0
+        0
+        
+      
+    
+  
+
+
+
+
+lttng --mi xml destroy mysession
+
+
+0
+
+
+
+
+  destroy
+  
+    
+      
+        mysession
+        tcp4://172.0.0.1:5342/ [data: 5343]
+        false
+        0
+        0
+      
+    
+  
+  true
+
+
+
+
+##################################################################
+
+CreateSessionNetwork
+
+lttng --mi xml create mysession -U net://172.0.0.1:1234:2345
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml list mysession
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession
+        tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]
+        false
+        0
+        0
+        
+      
+    
+  
+
+
+
+
+lttng --mi xml destroy mysession
+
+
+0
+
+
+
+
+  destroy
+  
+    
+      
+        mysession
+        tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]
+        false
+        0
+        0
+      
+    
+  
+  true
+
+
+
+
+
+##################################################################
+
+CreateSessionNetwork2
+
+lttng --mi xml create mysession -U net6://[ffff::eeee:dddd:cccc:0]
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml list mysession
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession
+        tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]
+        false
+        0
+        0
+        
+      
+    
+  
+
+
+
+
+lttng --mi xml destroy mysession
+
+
+0
+
+
+
+
+  destroy
+  
+    
+      
+        mysession
+        tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]
+        false
+        0
+        0
+      
+    
+  
+  true
+
+
+
+
\ No newline at end of file
diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg
new file mode 100644
index 0000000000..f3cc92d8f0
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg
@@ -0,0 +1,2676 @@
+####################################################################
+# Copyright (c) 2012, 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: 
+#    Bernd Hufmann - Initial API and implementation
+####################################################################
+####################################################################
+# Scenario: Initialize
+####################################################################
+
+Initialize
+
+lttng version 
+
+
+0
+
+
+lttng version 2.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+lttng list 
+
+
+0
+
+
+Currently no available tracing session
+
+
+
+lttng list -k
+
+
+0
+
+
+Kernel events
+-------------
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+
+
+
+
+lttng list -u
+
+
+0
+
+
+UST events:
+-------------
+
+PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+
+
+
+####################################################################
+# Scenario: Create and destroy session
+####################################################################
+
+SessionHandling
+
+
+lttng create mysession
+
+
+0
+
+
+Session mysession created.
+Traces will be written in /home/user/lttng-traces/mysession-20120314-132824
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+lttng start mysession
+
+
+0
+
+
+Tracing started for session mysession.
+
+
+
+lttng stop mysession
+
+
+0
+
+
+Tracing stopped for session mysession.
+
+
+
+
+####################################################################
+# Scenario: Create and destroy session
+####################################################################
+
+SessionHandlingWithPath
+
+
+lttng create mysession -o /home/user/temp
+
+
+0
+
+
+Session mysession created.
+Traces will be written in /home/user/temp
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/temp
+
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+
+
+####################################################################
+# Scenario: Enable events from kernel provider events
+####################################################################
+
+Scenario1
+
+
+
+lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k  -s mysession --tracepoint 
+
+
+0
+
+
+kernel event sched_kthread_stop created in channel channel0
+kernel sched_kthread_stop_ret created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng disable-event sched_kthread_stop_ret,sched_kthread_stop -k  -s mysession -c channel0
+
+
+0
+
+
+kernel event sched_kthread_stop_ret disabled in channel channel0
+kernel event sched_kthread_stop disabled in channel channel0
+
+
+
+lttng enable-event sched_kthread_stop -k  -s mysession -c channel0 --tracepoint 
+
+
+0
+
+
+kernel event sched_kthread_stop enabled in channel channel0
+
+
+
+
+####################################################################
+# Scenario: Enable events from UST provider events
+####################################################################
+
+Scenario2
+
+
+lttng enable-channel mychannel -u  -s mysession --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
+
+
+0
+
+
+UST channel mychannel enabled for session mysession
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/temp
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 16384
+      number of subbufers: 2
+      switch timer interval: 200
+      read timer interval: 100
+      output: mmap()
+
+    Events:
+      None
+
+
+
+
+lttng enable-event ust_tests_hello:tptest_sighandler,ust_tests_hello:tptest -u  -s mysession --tracepoint 
+
+
+0
+
+
+UST event ust_tests_hello:tptest_sighandler in channel channel0
+UST sched_ust_tests_hello:tptest created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/temp
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 16384
+      number of subbufers: 2
+      switch timer interval: 200
+      read timer interval: 100
+      output: mmap()
+
+    Events:
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+      ust_tests_hello:tptest (type: tracepoint) [enabled]
+
+
+
+
+lttng disable-event ust_tests_hello:tptest -u  -s mysession -c mychannel
+
+
+0
+
+
+kernel event ust_tests_hello:tptest in channel mychannel
+
+
+
+lttng enable-event ust_tests_hello:tptest -u  -s mysession -c mychannel --tracepoint 
+
+
+0
+
+
+kernel event ust_tests_hello:tptest enabled in channel mychannel
+
+
+
+
+
+Scenario3
+
+
+lttng enable-channel mychannel -k  -s mysession --overwrite  --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
+
+
+0
+
+
+Kernel channel mychannel enabled for session mysession
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      None
+
+
+
+
+lttng enable-channel mychannel2 -k  -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
+
+
+0
+
+
+Kernel channel mychannel2 enabled for session mysession
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      None
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      None
+
+
+
+
+
+lttng disable-channel mychannel,mychannel2 -k  -s mysession
+
+
+0
+
+
+Kernel channel mychannel disabled for session mysession
+Kernel channel mychannel2 disabled for session mysession
+
+
+
+lttng enable-channel mychannel,mychannel2 -k  -s mysession
+
+
+0
+
+
+Kernel channel mychannel enabled for session mysession
+Kernel channel mychannel2 enabled for session mysession
+
+
+
+lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k  -s mysession --tracepoint 
+
+
+0
+
+
+kernel event sched_kthread_stop created in channel channel0
+kernel sched_kthread_stop_ret created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      None
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      None
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event sched_wakeup_new -k  -s mysession --tracepoint 
+
+
+0
+
+
+kernel event sched_wakeup_new created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      None
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      None
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event  -a  -k  -s mysession -c mychannel2 --tracepoint 
+
+
+0
+
+
+All kernel event sched_kthread_stop created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      None
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event  -a  -k  -s mysession -c mychannel --syscall 
+
+
+0
+
+
+All kernel system calls are enabled in channel mychannel
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event  -a  -k  -s mysession --syscall 
+
+
+0
+
+
+All kernel system calls are enabled in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event  -a  -k  -s mysession --syscall 
+
+
+0
+
+
+All kernel system calls are enabled in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event myevent1 -k  -s mysession --probe 0xc0101280
+
+
+0
+
+
+kernel event myevent1 created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]        
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event myevent2 -k  -s mysession -c channel0 --probe init_post
+
+
+0
+
+
+kernel event myevent2 created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event myevent3 -k  -s mysession --probe init_post:0x1000
+
+
+0
+
+
+kernel event myevent2 created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event myevent4 -k  -s mysession --function create_dev
+
+
+0
+
+
+kernel event myevent4 created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent4 (type: function) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event myevent5 -k  -s mysession --function create_dev:0x2000
+
+
+0
+
+
+kernel event myevent5 created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent5 (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev
+      myevent4 (type: function) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event myevent -k  -s mysession -c mychannel --function create_dev:0x2000
+
+
+0
+
+
+kernel event myevent created in channel mychannel
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev    
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent5 (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev
+      myevent4 (type: function) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng list 
+
+
+0
+
+
+Available tracing sessions:
+  1) mysession (/home/eedbhu/lttng-traces/mysession-20120321-115617) [inactive]
+
+Use lttng list  for more details
+
+
+
+lttng list -k
+
+
+0
+
+
+Kernel events
+-------------
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+
+
+
+
+lttng list -u
+
+
+0
+
+
+UST events:
+-------------
+
+PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev    
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent5 (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev
+      myevent4 (type: function) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng add-context  -h 
+
+
+0
+
+
+usage: lttng add-context -t TYPE
+
+If no channel and no event is given (-c/-e), the context
+will be added to all events and all channels.
+Otherwise the context will be added only to the channel (-c)
+and/or event (-e) indicated.
+Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
+
+Options:
+  -h, --help               Show this help
+      --list-options       Simple listing of options
+  -s, --session NAME       Apply to session name
+  -c, --channel NAME       Apply to channel
+  -e, --event NAME         Apply to event
+  -k, --kernel             Apply to the kernel tracer
+  -u, --userspace          Apply to the user-space tracer
+  -t, --type TYPE          Context type. You can repeat that option on
+                           the command line to specify multiple contexts at once.
+                           (--kernel preempts --userspace)
+                           TYPE can be one of the strings below:
+                               pid, procname, prio, nice, vpid, tid, pthread_id,
+                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles,
+                               perf:stalled-cycles-frontend,
+                               perf:idle-cycles-frontend,
+                               perf:stalled-cycles-backend,
+                               perf:idle-cycles-backend, perf:instructions,
+                               perf:cache-references, perf:cache-misses,
+                               perf:branch-instructions, perf:branches,
+                               perf:branch-misses, perf:bus-cycles,
+                               perf:L1-dcache-loads, perf:L1-dcache-load-misses,
+                               perf:L1-dcache-stores,
+                               perf:L1-dcache-store-misses,
+                               perf:L1-dcache-prefetches,
+                               perf:L1-dcache-prefetch-misses,
+                               perf:L1-icache-loads, perf:L1-icache-load-misses,
+                               perf:L1-icache-stores,
+                               perf:L1-icache-store-misses,
+                               perf:L1-icache-prefetches,
+                               perf:L1-icache-prefetch-misses, perf:LLC-loads,
+                               perf:LLC-load-misses, perf:LLC-stores,
+                               perf:LLC-store-misses, perf:LLC-prefetches,
+                               perf:LLC-prefetch-misses, perf:dTLB-loads,
+                               perf:dTLB-load-misses, perf:dTLB-stores,
+                               perf:dTLB-store-misses, perf:dTLB-prefetches,
+                               perf:dTLB-prefetch-misses, perf:iTLB-loads,
+                               perf:iTLB-load-misses, perf:branch-loads,
+                               perf:branch-load-misses, perf:cpu-clock,
+                               perf:task-clock, perf:page-fault, perf:faults,
+                               perf:major-faults, perf:minor-faults,
+                               perf:context-switches, perf:cs,
+                               perf:cpu-migrations, perf:migrations,
+                               perf:alignment-faults, perf:emulation-faults
+Example:
+This command will add the context information 'prio' and two perf
+counters (hardware branch misses and cache misses), to all events
+in the trace data output:
+# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
+
+
+
+
+lttng add-context  -s mysession -k  -t prio -t perf:branch-misses -t perf:cache-misses
+
+
+0
+
+
+kernel context perf:cache-misses added to all channels
+kernel context perf:branch-misses added to all channels
+kernel context prio added to all channels
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev    
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent5 (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev
+      myevent4 (type: function) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng add-context  -h 
+
+
+0
+
+
+usage: lttng add-context -t TYPE
+
+If no channel and no event is given (-c/-e), the context
+will be added to all events and all channels.
+Otherwise the context will be added only to the channel (-c)
+and/or event (-e) indicated.
+Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
+
+Options:
+  -h, --help               Show this help
+      --list-options       Simple listing of options
+  -s, --session NAME       Apply to session name
+  -c, --channel NAME       Apply to channel
+  -e, --event NAME         Apply to event
+  -k, --kernel             Apply to the kernel tracer
+  -u, --userspace          Apply to the user-space tracer
+  -t, --type TYPE          Context type. You can repeat that option on
+                           the command line to specify multiple contexts at once.
+                           (--kernel preempts --userspace)
+                           TYPE can be one of the strings below:
+                               pid, procname, prio, nice, vpid, tid, pthread_id,
+                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles,
+                               perf:stalled-cycles-frontend,
+                               perf:idle-cycles-frontend,
+                               perf:stalled-cycles-backend,
+                               perf:idle-cycles-backend, perf:instructions,
+                               perf:cache-references, perf:cache-misses,
+                               perf:branch-instructions, perf:branches,
+                               perf:branch-misses, perf:bus-cycles,
+                               perf:L1-dcache-loads, perf:L1-dcache-load-misses,
+                               perf:L1-dcache-stores,
+                               perf:L1-dcache-store-misses,
+                               perf:L1-dcache-prefetches,
+                               perf:L1-dcache-prefetch-misses,
+                               perf:L1-icache-loads, perf:L1-icache-load-misses,
+                               perf:L1-icache-stores,
+                               perf:L1-icache-store-misses,
+                               perf:L1-icache-prefetches,
+                               perf:L1-icache-prefetch-misses, perf:LLC-loads,
+                               perf:LLC-load-misses, perf:LLC-stores,
+                               perf:LLC-store-misses, perf:LLC-prefetches,
+                               perf:LLC-prefetch-misses, perf:dTLB-loads,
+                               perf:dTLB-load-misses, perf:dTLB-stores,
+                               perf:dTLB-store-misses, perf:dTLB-prefetches,
+                               perf:dTLB-prefetch-misses, perf:iTLB-loads,
+                               perf:iTLB-load-misses, perf:branch-loads,
+                               perf:branch-load-misses, perf:cpu-clock,
+                               perf:task-clock, perf:page-fault, perf:faults,
+                               perf:major-faults, perf:minor-faults,
+                               perf:context-switches, perf:cs,
+                               perf:cpu-migrations, perf:migrations,
+                               perf:alignment-faults, perf:emulation-faults
+Example:
+This command will add the context information 'prio' and two perf
+counters (hardware branch misses and cache misses), to all events
+in the trace data output:
+# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
+
+
+
+
+lttng add-context  -s mysession -c mychannel -k  -t prio -t perf:branch-misses -t perf:cache-misses
+
+
+0
+
+
+kernel context perf:cache-misses added to channel mychannel
+kernel context perf:branch-misses added to channel mychannel
+kernel context prio added to channel mychannel
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev    
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent5 (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev
+      myevent4 (type: function) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng add-context  -h 
+
+
+0
+
+
+usage: lttng add-context -t TYPE
+
+If no channel and no event is given (-c/-e), the context
+will be added to all events and all channels.
+Otherwise the context will be added only to the channel (-c)
+and/or event (-e) indicated.
+Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
+
+Options:
+  -h, --help               Show this help
+      --list-options       Simple listing of options
+  -s, --session NAME       Apply to session name
+  -c, --channel NAME       Apply to channel
+  -e, --event NAME         Apply to event
+  -k, --kernel             Apply to the kernel tracer
+  -u, --userspace          Apply to the user-space tracer
+  -t, --type TYPE          Context type. You can repeat that option on
+                           the command line to specify multiple contexts at once.
+                           (--kernel preempts --userspace)
+                           TYPE can be one of the strings below:
+                               pid, procname, prio, nice, vpid, tid, pthread_id,
+                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles,
+                               perf:stalled-cycles-frontend,
+                               perf:idle-cycles-frontend,
+                               perf:stalled-cycles-backend,
+                               perf:idle-cycles-backend, perf:instructions,
+                               perf:cache-references, perf:cache-misses,
+                               perf:branch-instructions, perf:branches,
+                               perf:branch-misses, perf:bus-cycles,
+                               perf:L1-dcache-loads, perf:L1-dcache-load-misses,
+                               perf:L1-dcache-stores,
+                               perf:L1-dcache-store-misses,
+                               perf:L1-dcache-prefetches,
+                               perf:L1-dcache-prefetch-misses,
+                               perf:L1-icache-loads, perf:L1-icache-load-misses,
+                               perf:L1-icache-stores,
+                               perf:L1-icache-store-misses,
+                               perf:L1-icache-prefetches,
+                               perf:L1-icache-prefetch-misses, perf:LLC-loads,
+                               perf:LLC-load-misses, perf:LLC-stores,
+                               perf:LLC-store-misses, perf:LLC-prefetches,
+                               perf:LLC-prefetch-misses, perf:dTLB-loads,
+                               perf:dTLB-load-misses, perf:dTLB-stores,
+                               perf:dTLB-store-misses, perf:dTLB-prefetches,
+                               perf:dTLB-prefetch-misses, perf:iTLB-loads,
+                               perf:iTLB-load-misses, perf:branch-loads,
+                               perf:branch-load-misses, perf:cpu-clock,
+                               perf:task-clock, perf:page-fault, perf:faults,
+                               perf:major-faults, perf:minor-faults,
+                               perf:context-switches, perf:cs,
+                               perf:cpu-migrations, perf:migrations,
+                               perf:alignment-faults, perf:emulation-faults
+Example:
+This command will add the context information 'prio' and two perf
+counters (hardware branch misses and cache misses), to all events
+in the trace data output:
+# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
+
+
+
+
+lttng add-context  -s mysession -c channel0 -e sched_kthread_stop_ret -k  -t prio -t perf:branch-misses -t perf:cache-misses
+
+
+0
+
+
+kernel context perf:cache-misses added to event sched_kthread_stop_ret channel mychannel
+kernel context perf:branch-misses added to event sched_kthread_stop_ret channel mychannel
+kernel context prio added to channel event sched_kthread_stop_ret mychannel
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev    
+      syscalls (type: syscall) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent5 (type: probe) [enabled]
+        offset: 0x2000
+        symbol: create_dev
+      myevent4 (type: function) [enabled]
+        offset: 0x0
+        symbol: create_dev
+      myevent3 (type: probe) [enabled]
+        offset: 0x1000
+        symbol: init_post
+      myevent2 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      myevent1 (type: probe) [enabled]
+        addr: 0xc0101280
+      syscalls (type: syscall) [enabled]
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+
+
+
+
+lttng calibrate  -k  --function 
+
+
+0
+
+
+Kernel calibration done
+
+
+
+
+
+Scenario4
+
+
+lttng enable-channel mychannel -u  -s mysession --overwrite  --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
+
+
+0
+
+
+UST channel mychannel enabled for session mysession
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      None
+
+
+
+
+lttng enable-channel mychannel2 -u  -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
+
+
+0
+
+
+UST channel mychannel2 enabled for session mysession
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      None
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      None
+
+
+
+
+lttng enable-event ust_tests_hello:tptest_sighandler -u  -s mysession --tracepoint 
+
+
+0
+
+
+UST event ust_tests_hello:tptest_sighandler created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      None
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      None
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event ust_tests_hello:tptest -u  -s mysession --tracepoint 
+
+
+0
+
+
+UST event ust_tests_hello:tptest created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      None
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      None
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+      ust_tests_hello:tptest (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event  -a  -u  -s mysession -c mychannel2 --tracepoint 
+
+
+0
+
+
+All UST events created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      None
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      * (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+      ust_tests_hello:tptest (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event "ust*" -u  -s mysession -c mychannel --tracepoint 
+
+
+0
+
+
+UST event ust* created in channel mychannel
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust* (type: tracepoint) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      * (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+      ust_tests_hello:tptest (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event "ust*" -u  -s mysession --tracepoint 
+
+
+0
+
+
+UST event ust* created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust* (type: tracepoint) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      * (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust* (type: tracepoint) [enabled]
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+      ust_tests_hello:tptest (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event "u*" -u  -s mysession --tracepoint 
+
+
+0
+
+
+UST event u* created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust* (type: tracepoint) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      * (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      u* (type: tracepoint) [enabled]
+      ust* (type: tracepoint) [enabled]
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+      ust_tests_hello:tptest (type: tracepoint) [enabled]
+
+
+
+
+
+lttng enable-event myevent1 -u  -s mysession --loglevel TRACE_WARNING
+
+
+0
+
+
+UST event myevent1 created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust* (type: tracepoint) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      * (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent1 (loglevel <= TRACE_WARNING (4)) (type: tracepoint) [enabled]
+      u* (type: tracepoint) [enabled]
+      ust* (type: tracepoint) [enabled]
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+      ust_tests_hello:tptest (type: tracepoint) [enabled]
+      
+
+
+
+lttng enable-event myevent2 -u  -s mysession --loglevel-only TRACE_DEBUG_FUNCTION
+
+
+0
+
+
+UST event myevent2 created in channel channel0
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust* (type: tracepoint) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      * (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent2 (loglevel == TRACE_DEBUG_FUNCTION (12)) (type: tracepoint) [enabled]
+      myevent1 (loglevel <= TRACE_WARNING (4)) (type: loglevel) [enabled]
+      u* (type: tracepoint) [enabled]
+      ust* (type: tracepoint) [enabled]
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+      ust_tests_hello:tptest (type: tracepoint) [enabled]
+
+
+
+
+lttng enable-event myevent0 -u  -s mysession -c mychannel --loglevel-only TRACE_DEBUG_FUNCTION
+
+
+0
+
+
+UST event myevent0 created in channel mychannel
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 16384
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      myevent0 (loglevel <= TRACE_DEBUG_FUNCTION (12)) (type: tracepoint) [enabled]
+      ust* (type: tracepoint) [enabled]
+
+- mychannel2: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 32768
+      number of subbufers: 2
+      switch timer interval: 100
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      * (type: tracepoint) [enabled]
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      myevent2 (loglevel <= TRACE_DEBUG_FUNCTION (12)) (type: tracepoint) [enabled]
+      myevent1 (loglevel == TRACE_WARNING (4)) (type: loglevel) [enabled]
+      u* (type: tracepoint) [enabled]
+      ust* (type: tracepoint) [enabled]
+      ust_tests_hello:tptest_sighandler (type: tracepoint) [enabled]
+      ust_tests_hello:tptest (type: tracepoint) [enabled]
+
+
+
+
+
+
+
+
diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg
new file mode 100644
index 0000000000..929dc44a25
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg
@@ -0,0 +1,323 @@
+####################################################################
+# Copyright (c) 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:
+#    Bernd Hufmann - Initial API and implementation
+####################################################################
+####################################################################
+# Scenario: Initialize
+####################################################################
+
+Initialize
+
+lttng version 
+
+
+0
+
+
+lttng version 2.2.0 - Cuda
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+lttng list 
+
+
+0
+
+
+Currently no available tracing session
+
+
+
+lttng list -k
+
+
+0
+
+
+Kernel events
+-------------
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+
+
+
+
+lttng list -u -f 
+
+
+0
+
+
+UST events:
+-------------
+
+PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+
+
+
+####################################################################
+# Scenario: Session and channel with per-UID UST buffers
+####################################################################
+
+ScenPerUidTest
+
+lttng create mysession
+
+
+0
+
+
+Session mysession created.
+Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20130812-113358
+
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session my destroyed.
+
+
+
+lttng enable-channel mychannel -u  -s mysession --buffers-uid 
+
+
+0
+
+
+UST channel mychannel enabled for session mysession
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20130812-113358
+
+=== Domain: UST global ===
+
+Buffer type: per UID
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 8388608
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 0
+      output: mmap()
+
+    Events:
+      None
+
+
+
+
+
+####################################################################
+# Scenario: Session and channel with per-PID UST buffers
+####################################################################
+
+ScenPerPidTest
+
+lttng create mysession
+
+
+0
+
+
+Session mysession created.
+Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20130812-113358
+
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+lttng enable-channel mychannel -u  -s mysession --buffers-pid 
+
+
+0
+
+
+UST channel mychannel enabled for session mysession
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20130812-113358
+
+=== Domain: UST global ===
+
+Buffer type: per PID
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 8388608
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 0
+      output: mmap()
+
+    Events:
+      None
+
+
+
+
+
+####################################################################
+# Scenario: Session and channel with per-PID UST buffers with option -C -W
+####################################################################
+
+ScenBufSizeTest
+
+lttng create mysession
+
+
+0
+
+
+Session mysession created.
+Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20130812-113358
+
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+lttng enable-channel mychannel -u  -s mysession -C 1024 -W 10
+
+
+0
+
+
+
+Warning: Tracefile size rounded up from (1024) to subbuffer size (8388608)
+
+UST channel mychannel enabled for session mysession
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [inactive]
+    Trace path: /home/user/lttng-traces/mysession-20130812-113358
+
+=== Domain: UST global ===
+
+Buffer type: per PID
+
+Channels:
+-------------
+- mychannel: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 8388608
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 0
+      output: mmap()
+
+    Events:
+      None
+
+
+
+
+
+
+
diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg
new file mode 100644
index 0000000000..f0dc0dea36
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg
@@ -0,0 +1,2364 @@
+####################################################################
+# 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: 
+#    Jonathan Rajotte - Initial API and implementation
+####################################################################
+####################################################################
+# Scenario: Test lttng not installed
+####################################################################
+
+LttngNotInstalled
+
+lttng --mi xml list 
+
+
+1
+
+
+
+Command not found
+
+
+
+
+####################################################################
+# Scenario: Test lttng version
+####################################################################
+
+LttngVersion
+
+lttng version 
+
+
+0
+
+
+lttng version 2.1.0 - Basse Messe
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+####################################################################
+# Scenario: Test lttng version
+# output with prompt
+####################################################################
+
+LttngVersionWithPrompt
+
+lttng version 
+
+
+0
+
+
+Prompt> lttng version 2.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+####################################################################
+# Scenario: Test lttng version (unsupported version)
+####################################################################
+
+LttngUnsupportedVersion
+
+lttng version 
+
+
+0
+
+
+lttng version 200.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+
+####################################################################
+# Scenario: Test lttng version (noversion)
+####################################################################
+
+LttngNoVersion
+
+lttng version 
+
+
+0
+
+
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+####################################################################
+# Scenario: Test no sessions available
+####################################################################
+
+NoSessionAvailable
+
+lttng --mi xml list 
+
+
+0
+
+
+
+list
+
+
+
+####################################################################
+# Scenario: Test get sessions
+####################################################################
+
+GetSessionNames1
+
+lttng --mi xml list 
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession1
+        home/user/lttng-traces/mysession1-20120123-083928
+        false
+        0
+        0
+      
+      
+        mysession
+        home/user/lttng-traces/mysession-20120123-083318
+        false
+        0
+        0
+      
+    
+  
+
+
+
+
+####################################################################
+# Scenario: Test lttng list  where session doesn't exist 
+####################################################################
+
+GetSessionNameNotExist
+
+lttng --mi xml list test
+
+
+1
+
+
+
+list
+
+Error: Session 'test' not found
+Error: Command error
+
+
+
+
+####################################################################
+# Scenario: Test lttng -vvv list  where session doesn't exist
+####################################################################
+
+GetSessionNameNotExistVerbose
+
+lttng --mi xml -vvv  list test
+
+
+1
+
+
+
+list
+
+Error: Session 'test' not found
+Error: Command error
+
+
+
+
+####################################################################
+# Scenario: Test lttng list with garbage output 
+####################################################################
+
+GetSessionGarbageOut
+
+lttng --mi xml list 
+
+
+0
+
+
+asdfaereafsdcv 12333456434&*89**(())(^%$*
+@#$%^&*()@#$%^&*()0834523094578kj;djkfs
+a;sdf094v5u dsafj;sd9
+
+
+
+####################################################################
+# Scenario: Test lttng list  with sample outputs 
+####################################################################
+
+GetSession1
+
+lttng --mi xml list mysession
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession
+        /home/user/lttng-traces/mysession-20120129-084256
+        true
+        0
+        0
+        
+          
+            KERNEL
+            PER_PID
+            
+              
+                channel0
+                true
+                
+                  DISCARD
+                  262144
+                  4
+                  0
+                  200
+                  SPLICE
+                  0
+                  0
+                  0
+                
+                
+                  
+                    block_rq_remap
+                    TRACEPOINT
+                    true
+                    false
+                    TRACE_EMERG
+                    ALL
+                    false
+                  
+                  
+                    block_bio_remap
+                    TRACEPOINT
+                    false
+                    false
+                    TRACE_EMERG
+                    ALL
+                    false
+                  
+                
+              
+              
+                channel1
+                false
+                
+                  OVERWRITE
+                  524288
+                  4
+                  100
+                  400
+                  SPLICE
+                  0
+                  0
+                  4294967295
+                
+                
+              
+            
+          
+          
+            UST
+            PER_UID
+            
+              
+                mychannel1
+                false
+                
+                  OVERWRITE
+                  8192
+                  8
+                  200
+                  100
+                  MMAP
+                  0
+                  0
+                  0
+                
+                
+              
+              
+                channel0
+                true
+                
+                  DISCARD
+                  4096
+                  4
+                  0
+                  200
+                  MMAP
+                  0
+                  0
+                  0
+                
+                
+                  
+                    ust_tests_hello:tptest_sighandler
+                    TRACEPOINT
+                    false
+                    false
+                    TRACE_DEBUG_LINE
+                    ALL
+                    false
+                  
+                  
+                    *
+                    TRACEPOINT
+                    true
+                    false
+                    false
+                  
+                
+              
+            
+          
+        
+      
+    
+  
+
+
+
+lttng --mi xml list mysession1
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession1
+        /home/user/lttng-traces/mysession1-20120203-133225
+        false
+        0
+        0
+        
+      
+    
+  
+
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with sample output 
+####################################################################
+
+GetKernelProvider1
+
+lttng --mi xml list -k
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        KERNEL
+        PER_PID
+        
+          
+            sched_kthread_stop
+            TRACEPOINT
+            true
+            false
+            TRACE_EMERG
+            ALL
+            false
+          
+          
+            sched_kthread_stop_ret
+            TRACEPOINT
+            true
+            false
+            TRACE_EMERG
+            ALL
+            false
+          
+          
+            sched_wakeup_new
+            TRACEPOINT
+            true
+            false
+            TRACE_EMERG
+            ALL
+            false
+          
+	
+      
+    
+  
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel and no session daemon 
+####################################################################
+
+ListWithNoKernel1
+
+lttng --mi xml list -k
+
+
+1
+
+
+Spawning session daemon
+
+Error: Unable to list kernel events
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel and with session daemon 
+####################################################################
+
+ListWithNoKernel2
+
+lttng --mi xml list -k
+
+
+1
+
+
+
+Error: Unable to list kernel events
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with sample output 
+####################################################################
+
+GetUstProvider1
+
+lttng --mi xml list -u -f 
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        UST
+        PER_PID
+        
+          
+            9379
+            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+            
+              
+                ust_tests_hello:tptest_sighandler
+                TRACEPOINT
+                true
+                false
+                TRACE_DEBUG_MODULE
+                ALL
+                false
+                
+              
+              
+                ust_tests_hello:tptest
+                TRACEPOINT
+                true
+                false
+                TRACE_INFO
+                ALL
+                false
+                
+                  
+                    doublefield
+                    FLOAT
+                    0
+                  
+                  
+                    floatfield
+                    FLOAT
+                    0
+                  
+                  
+                    stringfield
+                    STRING
+                    0
+                  
+                
+              
+            
+          
+          
+            4852
+            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+            
+              
+                ust_tests_hello:tptest_sighandler
+                TRACEPOINT
+                true
+                false
+                TRACE_WARNING
+                ALL
+                false
+                
+              
+              
+                ust_tests_hello:tptest
+                TRACEPOINT
+                true
+                false
+                TRACE_DEBUG_FUNCTION
+                ALL
+                false
+                
+                  
+                    doublefield
+                    FLOAT
+                    0
+                  
+                  
+                    floatfield
+                    FLOAT
+                    0
+                  
+                  
+                    stringfield
+                    STRING
+                    0
+                  
+                
+              
+            
+          
+        
+      
+    
+  
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with no UST provider available 
+####################################################################
+
+GetUstProvider2
+
+lttng --mi xml list -u -f 
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        UST
+        PER_PID
+        
+      
+    
+  
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with no UST available (LTTng 2.0.x) 
+####################################################################
+
+ListWithNoUst1
+
+lttng --mi xml list -u -f 
+
+
+1
+
+
+
+list
+
+Error: Unable to list UST event fields: LTTng-UST tracer is not supported. Please rebuild lttng-tools with lttng-ust support enabled.
+Error: Command error
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with no UST available and no session daemon 
+####################################################################
+
+ListWithNoUst2
+
+lttng --mi xml list -u -f 
+
+
+1
+
+
+
+list
+
+Error: Unable to list UST event fields: LTTng-UST tracer is not supported. Please rebuild lttng-tools with lttng-ust support enabled.
+Error: Command error
+
+
+
+####################################################################
+# Scenario: Test "lttng list -" with no kernel and with session daemon 
+####################################################################
+
+ListWithNoUst3
+
+lttng --mi xml list -u -f 
+
+
+1
+
+
+
+list
+
+Error: Unable to list kernel events: Tracing the kernel requires a root lttng-sessiond daemon, as well as "tracing" group membership or root user ID for the lttng client.
+Error: Command Error
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u -f" with sample output (version 2.6.0) 
+####################################################################
+
+GetUstProvider3
+
+lttng --mi xml list -u -f 
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        UST
+        PER_PID
+        
+          
+            9379
+            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+            
+              
+                ust_tests_hello:tptest_sighandler
+                TRACEPOINT
+                true
+                false
+                TRACE_DEBUG_MODULE
+                ALL
+                false
+                
+              
+              
+                ust_tests_hello:tptest
+                TRACEPOINT
+                true
+                false
+                TRACE_INFO
+                ALL
+                false
+                
+                  
+                    doublefield
+                    FLOAT
+                    0
+                  
+                  
+                    floatfield
+                    FLOAT
+                    0
+                  
+                  
+                    stringfield
+                    STRING
+                    0
+                  
+                
+              
+            
+          
+          
+            4852
+            /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+            
+              
+                ust_tests_hello:tptest_sighandler
+                TRACEPOINT
+                true
+                false
+                TRACE_WARNING
+                ALL
+                false
+                
+              
+              
+                ust_tests_hello:tptest
+                TRACEPOINT
+                true
+                false
+                TRACE_DEBUG_FUNCTION
+                ALL
+                false
+                
+                  
+                    doublefield
+                    FLOAT
+                    0
+                  
+                  
+                    floatfield
+                    FLOAT
+                    0
+                  
+                  
+                    stringfield
+                    STRING
+                    0
+                  
+                
+              
+            
+          
+        
+      
+    
+  
+
+
+
+####################################################################
+# Scenario: Test "lttng create   
+####################################################################
+
+CreateSession1
+
+lttng --mi xml create mysession2
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession2
+      /home/user/lttng-traces/mysession2-20120209-095418
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create   
+####################################################################
+
+CreateSessionWithPrompt
+
+lttng --mi xml create mysession2
+
+
+0
+
+
+Prompt> Session mysession2 created.
+Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
+
+
+
+####################################################################
+# Scenario: Test "lttng create  with different variants 
+# and errors
+####################################################################
+
+CreateSessionVariants
+
+lttng --mi xml create alreadyExist
+
+
+1
+
+
+
+
+  create
+  
+  false
+
+
+Warning: Session mysession2 already exists
+Error: Session name already exists
+
+
+
+
+lttng --mi xml create "session with spaces"
+
+
+0
+
+
+
+
+  create
+  
+    
+      session with spaces
+      /home/user/lttng-traces/session with spaces-20120209-095418
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml create wrongName
+
+
+0
+
+
+
+
+  create
+  
+    
+      auto
+      /home/user/lttng-traces/auto-20120209-095418
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml create wrongPath -o /home/user/hallo
+
+
+0
+
+
+
+
+  create
+  
+    
+      wrongPath
+      /home/user/lttng-traces/wrongPath-20120209-095418
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml create pathWithSpaces -o "/home/user/hallo user/here"
+
+
+0
+
+
+
+
+  create
+  
+    
+      pathWithSpaces
+      /home/user/hallo user/here/pathWithSpaces-20120209-095418
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+####################################################################
+# Scenario: Test "lttng destroy  
+####################################################################
+
+
+DestroySession1
+
+lttng --mi xml destroy mysession2
+
+
+0
+
+
+
+
+  destroy
+  
+    
+      
+        mysession2
+        /home/user/lttng-traces/mysession2-20140812-160632
+        false
+        0
+        0
+      
+    
+  
+  true
+
+
+
+
+####################################################################
+# Scenario: Test "lttng enable-channel ..." with different inputs 
+####################################################################
+
+
+ChannelHandling
+
+lttng --mi xml enable-channel mychannel0,mychannel1 -k  -s mysession2 --overwrite  --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10
+
+
+0
+
+
+Kernel channel mychannel0 enabled for session mysession2
+Kernel channel mychannel1 enabled for session mysession2
+
+
+
+lttng --mi xml enable-channel mychannel0,mychannel1 -k  -s mysession2 --overwrite  --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
+
+
+0
+
+
+
+
+  enable-channel
+  
+    
+      
+        mychannel0
+        false
+        
+          OVERWRITE
+          16384
+          2
+          200
+          100
+          SPLICE
+          0
+          0
+          4294967295
+        
+        true
+      
+      
+        mychannel1
+        false
+        
+          OVERWRITE
+          16384
+          2
+          200
+          100
+          SPLICE
+          0
+          0
+          4294967295
+        
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
+
+
+0
+
+
+UST channel channel0 enabled for session mysession2
+
+
+
+lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
+
+
+0
+
+
+
+
+  enable-channel
+  
+    
+      
+        ustChannel
+        false
+        
+          OVERWRITE
+          32768
+          2
+          100
+          200
+          MMAP
+          0
+          0
+          4294967295
+        
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid  -C 0 -W 20
+
+
+0
+
+
+UST channel channel0 enabled for session mysession2
+
+
+
+lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --buffers-pid 
+
+
+0
+
+
+
+
+  enable-channel
+  
+    
+      
+        ustChannel
+        false
+        
+          OVERWRITE
+          4096
+          4
+          0
+          0
+          MMAP
+          0
+          0
+          4294967295
+        
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200 --buffers-uid
+
+
+0
+
+
+
+
+  enable-channel
+  
+    
+      
+        ustChannel
+        false
+        
+          OVERWRITE
+          32768
+          2
+          100
+          200
+          MMAP
+          0
+          0
+          4294967295
+        
+        true
+      
+    
+  
+  true
+
+
+
+
+
+lttng --mi xml enable-channel mychannel0,mychannel1 -k  -s mysession2
+
+
+0
+
+
+
+
+  enable-channel
+  
+    
+      
+        mychannel0
+        false
+        
+          DISCARD
+          262144
+          4
+          0
+          200000
+          SPLICE
+          0
+          0
+          4294967295
+        
+        true
+      
+      
+        mychannel1
+        false
+        
+          DISCARD
+          262144
+          4
+          0
+          200000
+          SPLICE
+          0
+          0
+          4294967295
+        
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-channel ustChannel -u  -s mysession2
+
+
+0
+
+
+
+
+  enable-channel
+  
+    
+      
+        ustChannel
+        false
+        
+          DISCARD
+          131072
+          4
+          0
+          0
+          MMAP
+          0
+          0
+          4294967295
+        
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml disable-channel mychannel0,mychannel1 -k  -s mysession2
+
+
+0
+
+
+
+
+  disable-channel
+  
+    
+      
+        mychannel0
+        false
+        true
+      
+      
+        mychannel1
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml disable-channel ustChannel -u  -s mysession2
+
+
+0
+
+
+
+
+  disable-channel
+  
+    
+      
+        ustChannel
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+
+####################################################################
+# Scenario: Test "lttng --mi xml enable-events ..." with different inputs 
+####################################################################
+
+EventHandling
+
+# Tracepoint test cases
+ 
+
+lttng --mi xml enable-event block_rq_remap,block_bio_remap,softirq_entry -k  -s mysession2 --tracepoint 
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        block_rq_remap
+        TRACEPOINT
+        true
+        false
+        TRACE_EMERG
+        ALL
+        false
+        true
+      
+      
+        block_bio_remap
+        TRACEPOINT
+        true
+        false
+        TRACE_EMERG
+        ALL
+        false
+        true
+      
+      
+        softirq_entry
+        TRACEPOINT
+        true
+        false
+        TRACE_EMERG
+        ALL
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-event  -a  -k  -s mysession2 -c mychannel --tracepoint 
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        *
+        TRACEPOINT
+        true
+        false
+        TRACE_EMERG
+        ALL
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u  -s mysession2 -c mychannel --tracepoint 
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        ust_tests_hello:tptest_sighandler
+        TRACEPOINT
+        true
+        false
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u  -s mysession2 -c mychannel --tracepoint  --filter 'intfield==10'
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        ust_tests_hello:tptest_sighandler
+        TRACEPOINT
+        true
+        true
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-event  -a  -u  -s mysession2 -c mychannel --tracepoint 
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        *
+        TRACEPOINT
+        true
+        false
+        false
+        true
+      
+    
+  
+  true
+
+
+
+# Syscall test cases
+
+
+lttng --mi xml enable-event  -a  -k  -s mysession2 --syscall 
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        *
+        SYSCALL
+        true
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-event  -a  -k  -s mysession2 -c mychannel --syscall 
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        *
+        SYSCALL
+        true
+        false
+        true
+      
+    
+  
+  true
+
+
+
+# dynamic probe/function probe test cases
+
+
+lttng --mi xml enable-event myevent0 -k  -s mysession2 --function 0xc0101340
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        myevent0
+        FUNCTION
+        false
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-event myevent1 -k  -s mysession2 -c mychannel --probe init_post
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        myevent1
+        PROBE
+        false
+        false
+        0
+        init_post
+        true
+      
+    
+  
+  true
+
+
+
+
+# log level test cases
+
+
+lttng --mi xml enable-event myevent4 -u  -s mysession2 --loglevel-only TRACE_DEBUG
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        myevent4
+        TRACEPOINT
+        true
+        false
+        TRACE_DEBUG
+        SINGLE
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml enable-event myevent5 -u  -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
+
+
+0
+
+
+
+
+  enable-event
+  
+    
+      
+        myevent5
+        TRACEPOINT
+        true
+        false
+        TRACE_DEBUG_FUNCTION
+        RANGE
+        false
+        true
+      
+    
+  
+  true
+
+
+
+
+
+####################################################################
+# Scenario: Test "lttng add-context -h" and lttng --mi xml add-context ..." with different inputs 
+####################################################################
+
+
+ContextHandling
+
+
+lttng --mi xml add-context  -h 
+
+
+0
+
+
+usage: lttng add-context -t TYPE [-k|-u] [OPTIONS]
+
+If no channel is given (-c), the context is added to
+all channels.
+
+Otherwise the context is added only to the channel (-c).
+
+Exactly one domain (-k or -u) must be specified.
+
+Options:
+  -h, --help               Show this help
+      --list-options       Simple listing of options
+  -s, --session NAME       Apply to session name
+  -c, --channel NAME       Apply to channel
+  -k, --kernel             Apply to the kernel tracer
+  -u, --userspace          Apply to the user-space tracer
+
+Context:
+  -t, --type TYPE          Context type. You can repeat that option on
+                           the command line to specify multiple contexts at once.
+                           (--kernel preempts --userspace)
+                           TYPE can be one of the strings below:
+                               pid, procname, prio, nice, vpid, tid, pthread_id,
+                               vtid, ppid, vppid, perf:cpu:cpu-cycles, perf:cpu:cycles
+Note that the vpid, vppid and vtid context types represent the virtual process id,
+virtual parent process id and virtual thread id as seen from the current execution context
+as opposed to the pid, ppid and tid which are kernel internal data structures.
+
+Example:
+This command will add the context information 'prio' and two per-cpu
+perf counters (hardware branch misses and cache misses), to all channels
+in the trace data output:
+# lttng add-context -k -t prio -t perf:cpu:branch-misses -t perf:cpu:cache-misses
+
+
+
+lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
+
+
+0
+
+
+UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
+UST context pid added to event sched_kthread_stop_ret channel mychannel
+
+
+
+
+ContextErrorHandling
+
+
+lttng --mi xml add-context  -h 
+
+
+1
+
+
+usage: lttng add-context -t TYPE
+
+If no channel and no event is given (-c/-e), the context
+will be added to all events and all channels.
+Otherwise the context will be added only to the channel (-c)
+and/or event (-e) indicated.
+Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
+
+Options:
+  -h, --help               Show this help
+      --list-options       Simple listing of options
+  -s, --session NAME       Apply to session name
+  -c, --channel NAME       Apply to channel
+  -e, --event NAME         Apply to event
+  -k, --kernel             Apply to the kernel tracer
+  -u, --userspace          Apply to the user-space tracer
+  -t, --type TYPE          Context type. You can repeat that option on
+                           the command line to specify multiple contexts at once.
+                           (--kernel preempts --userspace)
+                           TYPE can be one of the strings below:
+                               pid, procname, prio, nice, vpid, tid, pthread_id,
+                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
+Example:
+This command will add the context information 'prio' and two perf
+counters (hardware branch misses and cache misses), to all events
+in the trace data output:
+# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
+
+
+
+
+lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
+
+
+1
+
+
+UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
+UST context pid added to event sched_kthread_stop_ret channel mychannel
+
+
+
+
+
+CalibrateHandling
+
+lttng --mi xml calibrate  -k  --function 
+
+
+0
+
+
+
+
+  calibrate
+  
+    
+      FUNCTION
+    
+  
+  true
+
+
+
+
+lttng --mi xml calibrate -u --function 
+
+
+0
+
+
+
+
+  calibrate
+  
+    
+      FUNCTION
+    
+  
+  true
+
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  with LTTng 2.1 options  
+####################################################################
+
+CreateSessionLttng2.1
+
+
+lttng --mi xml create mysession -U net://172.0.0.1
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      tcp4://172.0.0.1:5342/mysession-20140813-095804 [data: 5343]
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml create mysession -U file:///tmp
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      /tmp
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      tcp4://172.0.0.1:5342/ [data: 5343]
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml create mysession -U 172.0.0.1:1234:2345
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      tcp4://172.0.0.1:1234/mysession-20140813-102225 [data: 2345]
+      false
+      0
+      0
+    
+  
+  true
+
+
+
+
+lttng --mi xml destroy mysession
+
+
+0
+
+
+
+
+  destroy
+  
+    
+      
+        mysession
+        /home/user/lttng-traces/mysession-20140818-100114
+        false
+        0
+        0
+      
+    
+  
+  true
+
+
+
+
+lttng --mi xml -vvv  create mysession -U net://172.0.0.1
+
+
+0
+
+
+DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
+DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
+DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
+DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
+Session mysession created.
+Traces will be written in net://172.0.0.1
+DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --snapshot (LTTng 2.3)
+####################################################################
+
+CreateSessionSnapshot
+
+lttng --mi xml create mysession --snapshot 
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      
+      false
+      1
+      4294967295
+    
+  
+  true
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml snapshot list-output  -s mysession
+
+
+0
+
+
+
+
+  snapshot
+  
+    
+      list-output
+      
+        
+          mysession
+          
+            
+              1
+              snapshot-1
+              /home/user/lttng-traces/mysession-20130913-141651
+              
+              0
+            
+          
+        
+      
+    
+  
+  true
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml list 
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession
+        
+        false
+        1
+        4294967295
+      
+    
+  
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml snapshot record  -s mysession
+
+
+0
+
+
+    Snapshot recorded successfully for session mysession
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml destroy mysession
+
+
+0
+
+
+
+
+  destroy
+  
+    
+      
+        mysession
+        /home/user/lttng-traces/mysession-20140818-100114
+        false
+        0
+        0
+      
+    
+  
+  true
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --snapshot -U  (LTTng 2.3)
+####################################################################
+
+CreateSessionStreamedSnapshot
+
+lttng --mi xml create mysession --snapshot -U net://172.0.0.1
+
+
+0
+
+
+Session mysession created.
+Default snapshot output set to: net://172.0.0.1
+Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml snapshot list-output  -s mysession
+
+
+0
+
+
+Snapshot output list for session mysession
+    [2] snapshot-2: net4://172.0.0.1:5342/
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml list 
+
+
+0
+
+
+  1) mysession () [inactive snapshot]
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml snapshot record  -s mysession
+
+
+0
+
+
+    Snapshot recorded successfully for session mysession
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml destroy mysession
+
+
+0
+
+
+
+
+  destroy
+  
+    
+      
+        mysession
+        /home/user/lttng-traces/mysession-20140818-100114
+        false
+        0
+        0
+      
+    
+  
+  true
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --snapshot (LTTng 2.3)
+####################################################################
+
+CreateSessionSnapshotErrors
+
+lttng --mi xml snapshot list-output  -s blabla
+
+
+1
+
+
+
+
+
+  snapshot
+  
+    
+      list-output
+      
+    
+  
+  false
+
+
+
+#------------------------------------------------------------------------------
+#next is not an error case but good to be tested
+
+lttng --mi xml list 
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession
+        
+        true
+        1
+        4294967295
+      
+    
+  
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml snapshot record  -s blabla
+
+
+1
+
+
+
+    Error: Session name not found
+
+
+
+  snapshot
+  
+    
+      record
+      
+    
+  
+  false
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml snapshot record  -s mysession
+
+
+1
+
+
+
+    Error: Session needs to be started once
+
+
+
+  snapshot
+  
+    
+      record
+      
+    
+  
+  false
+
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --live [USEC] (LTTng 2.4)
+####################################################################
+
+CreateSessionLive
+
+lttng --mi xml create mysession --live  -U net://127.0.0.1
+
+
+0
+
+
+
+
+  create
+  
+    
+      mysession
+      tcp4://127.0.0.1:5342/ [data: 5343]
+      false
+      0
+      1000000
+    
+  
+  true
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml list 
+
+
+0
+
+
+
+
+  list
+  
+    
+      
+        mysession
+        tcp4://127.0.0.1:5342/ [data: 5343]
+        false
+        0
+        1000000
+      
+    
+  
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml destroy mysession
+
+
+0
+
+
+
+
+  destroy
+  
+    
+      
+        mysession
+        /home/user/lttng-traces/mysession-20140818-100114
+        false
+        0
+        0
+      
+    
+  
+  true
+
+
+
+
+####################################################################
+# Scenario: Test errors for  "lttng create  --live [USEC] (LTTng 2.4)
+####################################################################
+
+CreateSessionLiveErrors
+
+lttng --mi xml create mysession --live --snapshot
+
+
+1
+
+
+
+Error: Snapshot and live modes are mutually exclusive.
+Error: Command error
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml create mysession --live -U blah
+
+
+1
+
+
+
+Error: URI parse unknown protocol blah
+Error: Unable to parse the URL blah
+Error: Invalid parameter
+
+
+#------------------------------------------------------------------------------
+
+lttng --mi xml create mysession --live -C net://127.0.0.1
+
+
+1
+
+
+
+Error: You need both control and data URL.
+Error: Command error
+
+
+
\ No newline at end of file
diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg
new file mode 100644
index 0000000000..5c7dc89b4f
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg
@@ -0,0 +1,1481 @@
+####################################################################
+# Copyright (c) 2012 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: 
+#    Bernd Hufmann - Initial API and implementation
+####################################################################
+####################################################################
+# Scenario: Test lttng not installed
+####################################################################
+
+LttngNotInstalled
+
+lttng list 
+
+
+1
+
+
+
+Command not found
+
+
+
+
+####################################################################
+# Scenario: Test lttng version
+####################################################################
+
+LttngVersion
+
+lttng version 
+
+
+0
+
+
+lttng version 2.1.0 - Basse Messe
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+####################################################################
+# Scenario: Test lttng version
+# output with prompt
+####################################################################
+
+LttngVersionWithPrompt
+
+lttng version 
+
+
+0
+
+
+Prompt> lttng version 2.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+####################################################################
+# Scenario: Test lttng version (unsupported version)
+####################################################################
+
+LttngUnsupportedVersion
+
+lttng version 
+
+
+0
+
+
+lttng version 200.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+
+####################################################################
+# Scenario: Test lttng version (noversion)
+####################################################################
+
+LttngNoVersion
+
+lttng version 
+
+
+0
+
+
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+####################################################################
+# Scenario: Test no sessions available
+####################################################################
+
+NoSessionAvailable
+
+lttng list 
+
+
+0
+
+
+Currently no available tracing session
+
+
+
+####################################################################
+# Scenario: Test get sessions
+####################################################################
+
+GetSessionNames1
+
+lttng list 
+
+
+0
+
+
+Available tracing sessions:
+  1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
+  2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
+
+ Use lttng list  for more details
+
+
+
+####################################################################
+# Scenario: Test lttng list  where session doesn't exist 
+####################################################################
+
+GetSessionNameNotExist
+
+lttng list test
+
+
+1
+
+
+Session test not found
+
+Error: Session name not found
+
+
+
+
+####################################################################
+# Scenario: Test lttng -vvv list  where session doesn't exist
+####################################################################
+
+GetSessionNameNotExistVerbose
+
+lttng -vvv  list test
+
+
+1
+
+
+DEBUG2: Session name: test [in cmd_list() at commands/list.c:618]
+DEBUG1: Session count 1 [in list_sessions() at commands/list.c:485]
+
+Error: Session 'test' not found
+Error: Command error
+
+DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
+
+
+
+####################################################################
+# Scenario: Test lttng list with garbage output 
+####################################################################
+
+GetSessionGarbageOut
+
+lttng list 
+
+
+0
+
+
+asdfaereafsdcv 12333456434&*89**(())(^%$*
+@#$%^&*()@#$%^&*()0834523094578kj;djkfs
+a;sdf094v5u dsafj;sd9
+
+
+
+####################################################################
+# Scenario: Test lttng list  with sample outputs 
+####################################################################
+
+GetSession1
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [active]                                                                    
+    Trace path: /home/user/lttng-traces/mysession-20120129-084256
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled]
+
+- channel1: [disabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 524288
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 400
+      output: splice()
+
+    Events:
+      None
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel1: [disabled]
+
+    Attributes:
+     overwrite mode: 1
+     subbufers size: 8192
+      number of subbufers: 8
+      switch timer interval: 200
+      read timer interval: 100
+      output: mmap()
+
+    Events:
+      None
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 4096
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled]
+      * (type: tracepoint) [enabled]
+
+
+
+lttng list mysession1
+
+
+0
+
+
+Tracing session mysession1: [inactive]
+    Trace path: /home/user/lttng-traces/mysession1-20120203-133225
+
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with sample output 
+####################################################################
+
+GetKernelProvider1
+
+lttng list -k
+
+
+0
+
+
+Kernel events
+-------------
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel and no session daemon 
+####################################################################
+
+ListWithNoKernel1
+
+lttng list -k
+
+
+1
+
+
+Spawning session daemon
+
+Error: Unable to list kernel events
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel and with session daemon 
+####################################################################
+
+ListWithNoKernel2
+
+lttng list -k
+
+
+1
+
+
+
+Error: Unable to list kernel events
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel, with session daemon and verbose
+####################################################################
+
+ListWithNoKernelVerbose
+
+lttng -vvv  list -k
+
+
+1
+
+
+DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:618]
+DEBUG1: Getting kernel tracing events [in list_kernel_events() at commands/list.c:309]
+
+Error: Unable to list kernel events
+
+DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with sample output 
+####################################################################
+
+GetUstProvider1
+
+lttng list -u
+
+
+0
+
+
+UST events:
+-------------
+
+PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
+
+PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with no UST provider available 
+####################################################################
+
+GetUstProvider2
+
+lttng list -u
+
+
+0
+
+
+UST events:
+-------------
+None
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with no UST available (LTTng 2.0.x) 
+####################################################################
+
+ListWithNoUst1
+
+lttng list -u
+
+
+1
+
+
+UST events:
+-------------
+None
+Segmentation Fault
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with no UST available and no session daemon 
+####################################################################
+
+ListWithNoUst2
+
+lttng list -u -f 
+
+
+1
+
+
+Spawning a session daemon
+
+Error: Unable to list UST events: Listing UST events failed
+Error: Command Error
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with no ust and with session daemon 
+####################################################################
+
+ListWithNoUst3
+
+lttng list -u -f 
+
+
+1
+
+
+
+Error: Unable to list UST events: Listing UST events failed
+Error: Command Error
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u" with no kernel, with session daemon and verbose
+####################################################################
+
+ListWithNoUstVerbose
+
+lttng -vvv  list -u -f 
+
+
+1
+
+
+DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:618]
+DEBUG1: Getting kernel tracing events [in list_kernel_events() at commands/list.c:309]
+Spawning a session daemon
+
+Error: Unable to list UST events: Listing UST events failed
+Error: Command Error
+
+DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -u -f" with sample output (version 2.1.0) 
+####################################################################
+
+GetUstProvider3
+
+lttng list -u -f 
+
+
+0
+
+
+UST events:
+-------------
+
+PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
+        field: doublefield (float)
+        field: floatfield (float)
+        field: stringfield (string)
+
+PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+        field: doublefield (float)
+        field: floatfield (float)
+        field: stringfield (string)
+
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create   
+####################################################################
+
+CreateSession1
+
+lttng create mysession2
+
+
+0
+
+
+Session mysession2 created.
+Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
+
+
+
+####################################################################
+# Scenario: Test "lttng create   
+####################################################################
+
+CreateSessionWithPrompt
+
+lttng create mysession2
+
+
+0
+
+
+Prompt> Session mysession2 created.
+Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
+
+
+
+####################################################################
+# Scenario: Test "lttng create  with different variants 
+# and errors
+####################################################################
+
+CreateSessionVariants
+
+lttng create alreadyExist
+
+
+1
+
+
+
+Error: Session name already exist
+
+
+
+
+lttng create "session with spaces"
+
+
+0
+
+
+Session session with spaces created.
+Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418
+
+
+
+lttng create wrongName
+
+
+0
+
+
+Session auto created.
+Traces will be written in /home/user/lttng-traces/auto-20120209-095418
+
+
+
+lttng create wrongPath -o /home/user/hallo
+
+
+0
+
+
+Session wrongPath created.
+Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
+
+
+
+lttng create pathWithSpaces -o "/home/user/hallo user/here"
+
+
+0
+
+
+Session pathWithSpaces created.
+Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418
+
+
+
+####################################################################
+# Scenario: Test "lttng destroy  
+####################################################################
+
+
+DestroySession1
+
+lttng destroy mysession2
+
+
+0
+
+
+Session mysession2 destroyed.
+
+
+
+####################################################################
+# Scenario: Test "lttng -vvv destroy "
+####################################################################
+
+
+DestroySessionVerbose
+
+lttng -vvv  destroy mysession2
+
+
+0
+
+
+DEBUG2: Config file path found: /home/eedbhu [in get_session_name() at utils.c:98]
+DEBUG1: Session name found: mysession2 [in get_session_name() at utils.c:99]
+Session mysession2 destroyed at /home/eedbhu
+
+
+
+
+####################################################################
+# Scenario: Test "lttng enable-channel ..." with different inputs 
+####################################################################
+
+
+ChannelHandling
+
+lttng enable-channel mychannel0,mychannel1 -k  -s mysession2 --overwrite  --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10
+
+
+0
+
+
+Kernel channel mychannel0 enabled for session mysession2
+Kernel channel mychannel1 enabled for session mysession2
+
+
+
+lttng enable-channel mychannel0,mychannel1 -k  -s mysession2 --overwrite  --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
+
+
+0
+
+
+Kernel channel mychannel0 enabled for session mysession2
+Kernel channel mychannel1 enabled for session mysession2
+
+
+
+lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
+
+
+0
+
+
+UST channel channel0 enabled for session mysession2
+
+
+
+lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
+
+
+0
+
+
+UST channel channel0 enabled for session mysession2
+
+
+
+lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid  -C 0 -W 20
+
+
+0
+
+
+UST channel channel0 enabled for session mysession2
+
+
+
+lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --buffers-pid 
+
+
+0
+
+
+UST channel ustChannel enabled for session mysession2
+
+
+
+lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid
+
+
+0
+
+
+UST channel channel0 enabled for session mysession2
+
+
+
+
+lttng enable-channel mychannel0,mychannel1 -k  -s mysession2
+
+
+0
+
+
+Kernel channel mychannel0 enabled for session mysession2
+Kernel channel mychannel1 enabled for session mysession2
+
+
+
+lttng enable-channel ustChannel -u  -s mysession2
+
+
+0
+
+
+UST channel mychannel0 enabled for session mysession2
+
+
+
+lttng disable-channel mychannel0,mychannel1 -k  -s mysession2
+
+
+0
+
+
+Kernel channel mychannel0 disabled for session mysession2
+Kernel channel mychannel1 disabled for session mysession2
+
+
+
+lttng disable-channel ustChannel -u  -s mysession2
+
+
+0
+
+
+UST channel mychannel0 enabled for session mysession2
+
+
+
+
+####################################################################
+# Scenario: Test "lttng enable-events ..." with different inputs 
+####################################################################
+
+EventHandling
+
+# Tracepoint test cases
+ 
+
+lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k  -s mysession2 --tracepoint 
+
+
+0
+
+
+kernel event block_rq_remap created in channel channel0
+kernel event block_bio_remap created in channel channel0
+kernel event softirq_entry created in channel channel0
+
+
+
+lttng enable-event  -a  -k  -s mysession2 -c mychannel --tracepoint 
+
+
+0
+
+
+All kernel tracepoints are enabled in channel channel0
+
+
+
+lttng enable-event ust_tests_hello:tptest_sighandler -u  -s mysession2 -c mychannel --tracepoint 
+
+
+0
+
+
+UST event ust_tests_hello:tptest_sighandler created in channel mychannel
+
+
+
+lttng enable-event ust_tests_hello:tptest_sighandler -u  -s mysession2 -c mychannel --tracepoint  --filter 'intfield==10'
+
+
+0
+
+
+UST event ust_tests_hello:tptest_sighandler created in channel mychannel
+
+
+
+lttng enable-event  -a  -u  -s mysession2 -c mychannel --tracepoint 
+
+
+0
+
+
+All UST tracepoints are enabled in channel mychannel
+
+
+# Syscall test cases
+
+
+lttng enable-event  -a  -k  -s mysession2 --syscall 
+
+
+0
+
+
+All kernel system calls are enabled in channel channel0
+
+
+
+lttng enable-event  -a  -k  -s mysession2 -c mychannel --syscall 
+
+
+0
+
+
+All kernel system calls are enabled in channel mychannel
+
+
+# dynamic probe/function probe test cases
+
+
+lttng enable-event myevent0 -k  -s mysession2 --function 0xc0101340
+
+
+0
+
+
+kernel event myevent0 created in channel mychannel
+
+
+
+lttng enable-event myevent1 -k  -s mysession2 -c mychannel --probe init_post
+
+
+0
+
+
+kernel event myevent1 created in channel mychannel
+
+
+# log level test cases
+
+
+lttng enable-event myevent4 -u  -s mysession2 --loglevel-only TRACE_DEBUG
+
+
+0
+
+
+UST event myevent4 created in channel channel0
+
+
+
+lttng enable-event myevent5 -u  -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
+
+
+0
+
+
+UST event myevent5 created in channel mychannel
+
+
+
+
+####################################################################
+# Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs 
+####################################################################
+
+
+ContextHandling
+
+
+lttng add-context  -h 
+
+
+0
+
+
+usage: lttng add-context -t TYPE
+
+If no channel and no event is given (-c/-e), the context
+will be added to all events and all channels.
+Otherwise the context will be added only to the channel (-c)
+and/or event (-e) indicated.
+Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
+
+Options:
+  -h, --help               Show this help
+      --list-options       Simple listing of options
+  -s, --session NAME       Apply to session name
+  -c, --channel NAME       Apply to channel
+  -e, --event NAME         Apply to event
+  -k, --kernel             Apply to the kernel tracer
+  -u, --userspace          Apply to the user-space tracer
+  -t, --type TYPE          Context type. You can repeat that option on
+                           the command line to specify multiple contexts at once.
+                           (--kernel preempts --userspace)
+                           TYPE can be one of the strings below:
+                               pid, procname, prio, nice, vpid, tid, pthread_id,
+                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
+Example:
+This command will add the context information 'prio' and two perf
+counters (hardware branch misses and cache misses), to all events
+in the trace data output:
+# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
+
+
+
+
+lttng add-context  -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
+
+
+0
+
+
+UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
+UST context pid added to event sched_kthread_stop_ret channel mychannel
+
+
+
+
+ContextErrorHandling
+
+
+lttng add-context  -h 
+
+
+1
+
+
+usage: lttng add-context -t TYPE
+
+If no channel and no event is given (-c/-e), the context
+will be added to all events and all channels.
+Otherwise the context will be added only to the channel (-c)
+and/or event (-e) indicated.
+Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
+
+Options:
+  -h, --help               Show this help
+      --list-options       Simple listing of options
+  -s, --session NAME       Apply to session name
+  -c, --channel NAME       Apply to channel
+  -e, --event NAME         Apply to event
+  -k, --kernel             Apply to the kernel tracer
+  -u, --userspace          Apply to the user-space tracer
+  -t, --type TYPE          Context type. You can repeat that option on
+                           the command line to specify multiple contexts at once.
+                           (--kernel preempts --userspace)
+                           TYPE can be one of the strings below:
+                               pid, procname, prio, nice, vpid, tid, pthread_id,
+                               vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
+Example:
+This command will add the context information 'prio' and two perf
+counters (hardware branch misses and cache misses), to all events
+in the trace data output:
+# lttng add-context -k  -t prio -t perf:branch-misses -t perf:cache-misses
+
+
+
+
+lttng add-context  -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u  -t prio -t pid
+
+
+1
+
+
+UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
+UST context pid added to event sched_kthread_stop_ret channel mychannel
+
+
+
+
+
+CalibrateHandling
+
+lttng calibrate  -k  --function 
+
+
+0
+
+
+Kernel calibration done
+
+
+
+lttng calibrate  -u  --function 
+
+
+1
+
+
+Kernel calibration done
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  with LTTng 2.1 options  
+####################################################################
+
+CreateSessionLttng2.1
+
+
+lttng create mysession -U net://172.0.0.1
+
+
+0
+
+
+Session mysession created.
+Traces will be written in net://172.0.0.1
+
+
+
+lttng create mysession -U file:///tmp
+
+
+0
+
+
+Session mysession created.
+Traces will be written in file:///tmp
+
+
+
+lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
+
+
+0
+
+
+Session mysession created.
+Control URL tcp://172.0.0.1 set for session mysession
+Data URL tcp://172.0.0.1:5343 set for session mysession
+
+
+
+lttng create mysession -U net://172.0.0.1:1234:2345
+
+
+0
+
+
+Session mysession created.
+Traces will be written in net://172.0.0.1:1234:2345
+
+
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+lttng -vvv  create mysession -U net://172.0.0.1
+
+
+0
+
+
+DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
+DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
+DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
+DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
+Session mysession created.
+Traces will be written in net://172.0.0.1
+DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
+
+
+
+
+####################################################################
+# Scenario: Test "lttng -vvv create  with LTTng 2.1 options"
+####################################################################
+
+CreateSessionLttngVerbose2.1
+
+lttng -vvv  create mysession -U net://172.0.0.1
+
+
+0
+
+
+DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
+DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
+DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
+DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
+Session mysession created.
+Traces will be written in net://172.0.0.1
+DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
+
+
+
+lttng -vvv  destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --snapshot (LTTng 2.3)
+####################################################################
+
+CreateSessionSnapshot
+
+lttng create mysession --snapshot 
+
+
+0
+
+
+Session mysession created.
+Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
+Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
+
+#------------------------------------------------------------------------------
+
+lttng snapshot list-output  -s mysession
+
+
+0
+
+
+Snapshot output list for session mysession
+    [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
+
+#------------------------------------------------------------------------------
+
+lttng list 
+
+
+0
+
+
+  1) mysession () [inactive snapshot]
+
+
+#------------------------------------------------------------------------------
+
+lttng snapshot record  -s mysession
+
+
+0
+
+
+    Snapshot recorded successfully for session mysession
+
+#------------------------------------------------------------------------------
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --snapshot -U  (LTTng 2.3)
+####################################################################
+
+CreateSessionStreamedSnapshot
+
+lttng create mysession --snapshot -U net://172.0.0.1
+
+
+0
+
+
+Session mysession created.
+Default snapshot output set to: net://172.0.0.1
+Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
+
+#------------------------------------------------------------------------------
+
+lttng snapshot list-output  -s mysession
+
+
+0
+
+
+Snapshot output list for session mysession
+    [2] snapshot-2: net4://172.0.0.1:5342/
+
+#------------------------------------------------------------------------------
+
+lttng list 
+
+
+0
+
+
+  1) mysession () [inactive snapshot]
+
+
+#------------------------------------------------------------------------------
+
+lttng snapshot record  -s mysession
+
+
+0
+
+
+    Snapshot recorded successfully for session mysession
+
+#------------------------------------------------------------------------------
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --snapshot (LTTng 2.3)
+####################################################################
+
+CreateSessionSnapshotErrors
+
+lttng snapshot list-output  -s blabla
+
+
+1
+
+
+
+Error: Session name not found
+
+
+#------------------------------------------------------------------------------
+#next is not an error case but good to be tested
+
+lttng list 
+
+
+0
+
+
+  1) mysession () [active snapshot]
+
+
+#------------------------------------------------------------------------------
+
+lttng snapshot record  -s blabla
+
+
+1
+
+
+
+    Error: Session name not found
+
+
+#------------------------------------------------------------------------------
+
+lttng snapshot record  -s mysession
+
+
+1
+
+
+
+    Error: Session needs to be started once
+
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --live [USEC] (LTTng 2.4)
+####################################################################
+
+CreateSessionLive
+
+lttng create mysession --live  -U net://127.0.0.1
+
+
+0
+
+
+Session mysession created.
+Traces will be written in net://127.0.0.1
+Live timer set to 1000000 usec
+
+#------------------------------------------------------------------------------
+
+lttng list 
+
+
+0
+
+
+Available tracing sessions:
+  1) mysession (net4://127.0.0.1:5342/ [data: 5343]) [inactive]
+
+Use lttng list  for more details
+
+#------------------------------------------------------------------------------
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
+
+####################################################################
+# Scenario: Test errors for  "lttng create  --live [USEC] (LTTng 2.4)
+####################################################################
+
+CreateSessionLiveErrors
+
+lttng create mysession --live --snapshot
+
+
+1
+
+
+
+Error: Snapshot and live modes are mutually exclusive.
+Error: Command error
+
+
+#------------------------------------------------------------------------------
+
+lttng create mysession --live -U blah
+
+
+1
+
+
+
+Error: URI parse unknown protocol blah
+Error: Unable to parse the URL blah
+Error: Invalid parameter
+
+
+#------------------------------------------------------------------------------
+
+lttng create mysession --live -C net://127.0.0.1
+
+
+1
+
+
+
+Error: You need both control and data URL.
+Error: Command error
+
+
+
+####################################################################
+# Scenario: Test "lttng create  --snapshot (LTTng 2.5)
+####################################################################
+
+CreateSessionSnapshot2.5
+
+lttng create mysession --snapshot 
+
+
+0
+
+
+Session mysession created.
+Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
+Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
+
+#------------------------------------------------------------------------------
+
+lttng snapshot list-output  -s mysession
+
+
+0
+
+
+Snapshot output list for session mysession
+    [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651 (max-size: 0)
+
+#------------------------------------------------------------------------------
+
+lttng list 
+
+
+0
+
+
+  1) mysession () [inactive snapshot]
+
+
+#------------------------------------------------------------------------------
+
+lttng snapshot record  -s mysession
+
+
+0
+
+
+    Snapshot recorded successfully for session mysession
+
+#------------------------------------------------------------------------------
+
+lttng destroy mysession
+
+
+0
+
+
+Session mysession destroyed.
+
+
diff --git a/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg
new file mode 100644
index 0000000000..4329c6f5bc
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg
@@ -0,0 +1,240 @@
+####################################################################
+# Copyright (c) 2012 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: 
+#    Bernd Hufmann - Initial API and implementation
+####################################################################
+####################################################################
+# Scenario: Test lttng list  with sample outputs 
+####################################################################
+
+ListInfoTest
+
+
+lttng version 
+
+
+0
+
+
+lttng version 2.1.0 - Basse Messe
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+lttng list 
+
+
+0
+
+
+Available tracing sessions:
+  1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
+  2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
+
+ Use lttng list  for more details
+
+
+
+lttng list mysession
+
+
+0
+
+
+Tracing session mysession: [active]                                                                    
+    Trace path: /home/user/lttng-traces/mysession-20120129-084256
+
+=== Domain: Kernel ===
+
+Channels:
+-------------
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 262144
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: splice()
+
+    Events:
+      block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
+      block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled]
+      myevent2 (type: probe) [enabled]
+        addr: 0xc0101340
+      myevent0 (type: probe) [enabled]
+        offset: 0x0
+        symbol: init_post
+      syscalls (type: syscall) [enabled]
+
+- channel1: [disabled]
+
+    Attributes:
+      overwrite mode: 1
+      subbufers size: 524288
+      number of subbufers: 4
+      switch timer interval: 100
+      read timer interval: 400
+      output: splice()
+
+    Events:
+      None
+
+=== Domain: UST global ===
+
+Channels:
+-------------
+- mychannel1: [disabled]
+
+    Attributes:
+     overwrite mode: 1
+     subbufers size: 8192
+      number of subbufers: 8
+      switch timer interval: 200
+      read timer interval: 100
+      output: mmap()
+
+    Events:
+      None
+
+- channel0: [enabled]
+
+    Attributes:
+      overwrite mode: 0
+      subbufers size: 4096
+      number of subbufers: 4
+      switch timer interval: 0
+      read timer interval: 200
+      output: mmap()
+
+    Events:
+      ust_tests_hello:tptest_sighandler (loglevel == TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled] [with filter]
+      ust_tests_hello:tptest_sighandler1 (loglevel <= TRACE_INFO (7)) (type: tracepoint) [disabled] [with filter]
+      ust_tests_hello:tptest_sighandler2 (loglevel: TRACE_DEBUG_SYSTEM (8)) (type: tracepoint) [disabled] [with filter]
+      * (type: tracepoint) [enabled]
+
+
+
+lttng list mysession1
+
+
+0
+
+
+Tracing session mysession1: [inactive]
+    Trace path: /home/user/lttng-traces/mysession1-20120203-133225
+
+
+
+
+lttng list -k
+
+
+0
+
+
+Kernel events
+-------------
+      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
+
+
+
+
+lttng list -u -f 
+
+
+0
+
+
+UST events:
+-------------
+
+PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
+        field: doublefield (float)
+        field: floatfield (float)
+        field: stringfield (string)
+
+PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
+        field: doublefield (float)
+        field: floatfield (float)
+        field: stringfield (string)
+
+
+
+
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel and no session daemon 
+####################################################################
+
+ListInfoTestNoKernel
+
+
+lttng version 
+
+
+0
+
+
+lttng version 2.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+
+
+
+lttng list 
+
+
+0
+
+
+Currently no available tracing session
+
+
+
+lttng list -k
+
+
+1
+
+
+
+Error: Unable to list kernel events
+
+
+
+
+lttng list -u
+
+
+0
+
+
+UST events:
+-------------
+
+PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
+    ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
+    ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
+
+
+
+
+
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/.classpath b/org.eclipse.tracecompass.lttng2.control.ui/.classpath
new file mode 100644
index 0000000000..098194ca4b
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/.classpath
@@ -0,0 +1,7 @@
+
+
+	
+	
+	
+	
+
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/.project b/org.eclipse.tracecompass.lttng2.control.ui/.project
new file mode 100644
index 0000000000..9988deae57
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/.project
@@ -0,0 +1,34 @@
+
+
+	org.eclipse.tracecompass.lttng2.control.ui
+	
+	
+	
+	
+		
+			org.eclipse.jdt.core.javabuilder
+			
+			
+		
+		
+			org.eclipse.pde.ManifestBuilder
+			
+			
+		
+		
+			org.eclipse.pde.SchemaBuilder
+			
+			
+		
+		
+			org.eclipse.pde.api.tools.apiAnalysisBuilder
+			
+			
+		
+	
+	
+		org.eclipse.pde.PluginNature
+		org.eclipse.jdt.core.javanature
+		org.eclipse.pde.api.tools.apiAnalysisNature
+	
+
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000000..99f26c0203
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/=UTF-8
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000000..5a0ad22d2a
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..9f3662cd78
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,394 @@
+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.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
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..4fd0c7006a
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,56 @@
+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
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 0000000000..acc3abd47c
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,97 @@
+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
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..d92b94fd4b
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+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
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.control.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..ea50c41600
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,44 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 3.1.0.qualifier
+Bundle-Localization: plugin
+Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.control.ui;singleton:=true
+Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.control.ui.Activator
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.core.expressions,
+ org.eclipse.core.resources,
+ org.eclipse.core.runtime,
+ org.eclipse.tracecompass.lttng2.control.core;bundle-version="3.1.0",
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0",
+ org.eclipse.linuxtools.tmf.ui;bundle-version="3.1.0",
+ org.eclipse.linuxtools.tmf.ctf.core,
+ org.eclipse.tracecompass.ctf.core
+Export-Package: org.eclipse.linuxtools.internal.lttng2.control.ui;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
+ org.eclipse.linuxtools.internal.lttng2.control.ui.relayd;x-internal:=true,
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui,org.eclipse.tracecompass.lttng2.control.ui.tests,org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests",
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers;x-internal:=true,
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages;x-internal:=true,
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.model;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.property;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
+ org.eclipse.linuxtools.internal.lttng2.control.ui.views.service;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests"
+Import-Package: com.google.common.collect,
+ org.eclipse.rse.core,
+ org.eclipse.rse.core.model,
+ org.eclipse.rse.core.subsystems,
+ org.eclipse.rse.services,
+ org.eclipse.rse.services.clientserver.messages,
+ org.eclipse.rse.services.files,
+ org.eclipse.rse.services.shells,
+ org.eclipse.rse.services.terminals,
+ org.eclipse.rse.subsystems.files.core.servicesubsystem,
+ org.eclipse.rse.subsystems.files.core.subsystems
diff --git a/org.eclipse.tracecompass.lttng2.control.ui/about.html b/org.eclipse.tracecompass.lttng2.control.ui/about.html
new file mode 100644
index 0000000000..c258ef55d8
--- /dev/null
+++ b/org.eclipse.tracecompass.lttng2.control.ui/about.html
@@ -0,0 +1,28 @@
+
+
+
+
+About
+
+
+

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/build.properties b/org.eclipse.tracecompass.lttng2.control.ui/build.properties new file mode 100644 index 0000000000..94af68f058 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/build.properties @@ -0,0 +1,23 @@ +############################################################################### +# Copyright (c) 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: +# 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 diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/add-context.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/add-context.gif new file mode 100644 index 0000000000..030eade39b Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/add-context.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/add_button.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/add_button.gif new file mode 100644 index 0000000000..252d7ebcb8 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/add_button.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/calibrate.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/calibrate.gif new file mode 100644 index 0000000000..c984fba703 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/calibrate.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/connect.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/connect.gif new file mode 100644 index 0000000000..866ad33825 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/connect.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/delete_trace.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/delete_trace.gif new file mode 100644 index 0000000000..b6922ac11c Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/delete_trace.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/disable.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/disable.gif new file mode 100644 index 0000000000..f6b9f8a590 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/disable.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/disable_event.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/disable_event.gif new file mode 100644 index 0000000000..2966a28163 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/disable_event.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/disconnect.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/disconnect.gif new file mode 100644 index 0000000000..ec8a8b01e4 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/disconnect.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/edit.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/edit.gif new file mode 100644 index 0000000000..feb8e94a74 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/edit.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/enable.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/enable.gif new file mode 100644 index 0000000000..9cacb96dca Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/enable.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/enable_event.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/enable_event.gif new file mode 100644 index 0000000000..06d007905b Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/enable_event.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/import_trace.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/import_trace.gif new file mode 100644 index 0000000000..d38085ad9c Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/import_trace.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/pause_trace.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/pause_trace.gif new file mode 100644 index 0000000000..161e3f594f Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/pause_trace.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/refresh.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/refresh.gif new file mode 100644 index 0000000000..3ca04d06ff Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/refresh.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/snapshot.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/snapshot.gif new file mode 100644 index 0000000000..176830af2d Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/snapshot.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/start_trace.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/start_trace.gif new file mode 100644 index 0000000000..d6b3bdcc37 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/start_trace.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/stop_trace.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/stop_trace.gif new file mode 100644 index 0000000000..dc47edf069 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/stop_trace.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/target_add.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/target_add.gif new file mode 100644 index 0000000000..114b964325 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/target_add.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/target_delete.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/target_delete.gif new file mode 100644 index 0000000000..b853d62333 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/elcl16/target_delete.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/eview16/control_view.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/eview16/control_view.gif new file mode 100644 index 0000000000..0dc862cbd7 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/eview16/control_view.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/channel.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/channel.gif new file mode 100644 index 0000000000..e8efe69dc3 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/channel.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/channel_disabled.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/channel_disabled.gif new file mode 100644 index 0000000000..413c1b953e Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/channel_disabled.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/domain.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/domain.gif new file mode 100644 index 0000000000..c4a8af4184 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/domain.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/event_disabled.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/event_disabled.gif new file mode 100644 index 0000000000..2966a28163 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/event_disabled.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/event_enabled.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/event_enabled.gif new file mode 100644 index 0000000000..11d3d8da1e Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/event_enabled.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/garland16.png b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/garland16.png new file mode 100644 index 0000000000..74f9751638 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/garland16.png differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/providers.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/providers.gif new file mode 100644 index 0000000000..885b8a69e3 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/providers.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/session_active.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/session_active.gif new file mode 100644 index 0000000000..57a42bca84 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/session_active.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/session_destroyed.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/session_destroyed.gif new file mode 100644 index 0000000000..b0adbc3231 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/session_destroyed.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/session_inactive.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/session_inactive.gif new file mode 100644 index 0000000000..b6774cb0ef Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/session_inactive.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/sessions.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/sessions.gif new file mode 100644 index 0000000000..c69588429f Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/sessions.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/systemlttng2-live.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/systemlttng2-live.gif new file mode 100755 index 0000000000..57c522db6c Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/systemlttng2-live.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/systemlttng2.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/systemlttng2.gif new file mode 100755 index 0000000000..fd7b3117f2 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/systemlttng2.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/target_connected.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/target_connected.gif new file mode 100644 index 0000000000..def312aa12 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/target_connected.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/target_disconnected.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/target_disconnected.gif new file mode 100644 index 0000000000..2104ab4545 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/target_disconnected.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/targets.gif b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/targets.gif new file mode 100644 index 0000000000..c1e4ee3a59 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.control.ui/icons/obj16/targets.gif differ diff --git a/org.eclipse.tracecompass.lttng2.control.ui/plugin.properties b/org.eclipse.tracecompass.lttng2.control.ui/plugin.properties new file mode 100644 index 0000000000..a34fc4e9d6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/plugin.properties @@ -0,0 +1,142 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +Bundle-Vendor = Eclipse Linux Tools +Bundle-Name = Linux Tools LTTng Control UI Plug-in + +views.category.name = LTTng +control.view.name = Control +events.view.name = Events +timeframe.view.name = Time Frame +controlflow.view.name = Control Flow +resources.view.name = Resources +statistics.view.name = Statistics +histogram.view.name = Histogram +latency.view.name = Latency View + +project.new.category.name = LTTng +project.new.wizard.name = LTTng Project +project.new.wizard.description = Create a new LTTng project + +project.propertyPage.tracelibPath = LTTng Trace Library Path +action.set.label = LTTng Action Set +action.set.description = LTTng Action Set + +tracetype.category.lttng= LTTng +tracetype.type.kernel = Kernel Trace + +#Commands and Menus +commands.trace.category.name = LTTng Trace Commands +commands.trace.category.description = LTTng Trace Commands +commands.trace.import = Import Trace +commands.trace.import.description = Import an LTTng Trace +commands.trace.open = Open Trace +commands.trace.open.description = Open an LTTng Trace +commands.trace.rename = Rename Trace +commands.trace.rename.description = Rename an LTTng Trace +commands.trace.delete = Delete Trace +commands.trace.delete.description = Delete an LTTng Trace +commands.trace.selectparser = Select Parser + +commands.experiment.category.name = LTTng Experiment Commands +commands.experiment.category.description = LTTng Experiment Commands +commands.experiment.new = New Experiment +commands.experiment.new.description = Create a new LTTng Experiment +commands.experiment.selecttraces = Select Traces +commands.experiment.selecttraces.description = Select LTTng Traces +commands.experiment.open = Open Experiment +commands.experiment.open.description = Open an LTTng Experiment +commands.experiment.rename = Rename Experiment +commands.experiment.rename.description = Rename an LTTng Experiment +commands.experiment.delete = Delete Experiment +commands.experiment.delete.description = Delete an LTTng Experiment + +# LTTng 2.0 trace control commands +trace.control.rse.system.type.name=LTTng (v2.0) +trace.control.rse.system.type.description=LTTng Trace Control (v2.0) + +commands.control.category=LTTng Trace Control Commands +commands.control.category.description=LTTng Trace Control Commands + +commands.control.new=New Connection... +commands.control.new.description=New Connection to Target Node + +commands.control.connect=Connect +commands.control.connect.description=Connect to Target Node + +commands.control.disconnect=Disconnect +commands.control.disconnect.description=Disconnect to Target Node + +commands.control.refresh=Refresh +commands.control.refresh.description=Refresh Node Configuration + +commands.control.delete=Delete +commands.control.delete.description=Delete Target Node + +commands.control.create.session=Create Session... +commands.control.create.session.description=Create a Trace Session + +commands.control.execute.command.script=Execute Command Script... +commands.control.execute.command.script.description=Execute Command Script + +commands.control.destroy.session=Destroy Session... +commands.control.destroy.session.description=Destroy a Trace Session + +commands.control.enable.channelOnSession=Enable Channel... +commands.control.enable.channelOnSession.description=Enable a Trace Channel + +commands.control.enable.channelOnDomain=Enable Channel... +commands.control.enable.channelOnDomain.description=Enable a Trace Channel + +commands.control.enable.channel=Enable Channel +commands.control.enable.channel.description=Enable a Trace Channel + +commands.control.disable.channel=Disable Channel +commands.control.disable.channel.description=Disable a Trace Channel + +commands.control.start=Start +commands.control.start.description=Start Trace Session + +commands.control.stop=Stop +commands.control.stop.description=Stop Trace Session + +commands.control.assign.event=Enable Event... +commands.control.assign.event.description=Assign Event to Session and Channel and Enable Event + +commands.control.enable.event=Enable Event +commands.control.enable.event.description=Enable Event + +commands.control.enable.eventOnChannel=Enable Event... +commands.control.enable.eventOnChannel.description=Enable Event + +commands.control.enable.eventOnDomain=Enable Event (default channel)... +commands.control.enable.eventOnDomain.description=Enable Event on Default Channel + +commands.control.enable.eventOnSession=Enable Event (default channel)... +commands.control.enable.eventOnSession.description=Enable Event on Default Channel + +commands.control.disable.event=Disable Event +commands.control.disable.event.description=Disable Event + +commands.control.add.context=Add Context... +commands.control.add.context.description=Add Context to Channel(s) and/or Event(s) + +commands.control.import=Import... +commands.control.import.description=Import Traces to LTTng Project + +commands.control.calibrate=Calibrate +commands.control.calibrate.description=Quantify LTTng overhead + +commands.control.snapshot=Record Snapshot +commands.control.snapshot.description=Record a snapshot + +preference.page.control.name=LTTng Tracer Control Preferences diff --git a/org.eclipse.tracecompass.lttng2.control.ui/plugin.xml b/org.eclipse.tracecompass.lttng2.control.ui/plugin.xml new file mode 100644 index 0000000000..9240836ca5 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/plugin.xml @@ -0,0 +1,1277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.control.ui/pom.xml b/org.eclipse.tracecompass.lttng2.control.ui/pom.xml new file mode 100644 index 0000000000..6bf9d699f6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/pom.xml @@ -0,0 +1,36 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.control.ui + 3.1.0-SNAPSHOT + eclipse-plugin + + Trace Compass LTTng Control UI Plug-in + + + + + org.eclipse.tycho + tycho-source-plugin + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/Activator.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/Activator.java new file mode 100644 index 0000000000..6d09b6bc16 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/Activator.java @@ -0,0 +1,210 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.control.ui; + +import java.net.URL; + +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.linuxtools.internal.lttng2.control.ui.relayd.LttngRelaydConnectionManager; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; +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.linuxtools.lttng2.control.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; + ControlPreferences.getInstance().init(getPreferenceStore()); + // This registers the connection manager with the signal manager + LttngRelaydConnectionManager.getInstance(); + } + + @Override + public void stop(BundleContext context) throws Exception { + ControlPreferences.getInstance().dispose(); + LttngRelaydConnectionManager.getInstance().dispose(); + plugin = null; + super.stop(context); + } + + @Override + protected void initializeImageRegistry(ImageRegistry reg) { + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Gets an image object using given path within plug-in. + * + * @param path path to image file + * + * @return image object + */ + public Image getImageFromPath(String path) { + return getImageDescripterFromPath(path).createImage(); + } + + /** + * Gets an image descriptor using given path within plug-in. + * + * @param path path to image file + * + * @return image descriptor object + */ + public ImageDescriptor getImageDescripterFromPath(String path) { + return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); + } + + /** + * Gets a image object from the image registry based on the given path. + * If the image is not in the registry it will be registered. + * + * @param path to the image file + * @return 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; + } + + /** + * Loads the image in the plug-ins image registry (if necessary) and returns the image + * @param url - URL relative to the Bundle + * @return the image + */ + public Image loadIcon(String url) { + String key = plugin.getBundle().getSymbolicName() + "/" + url; //$NON-NLS-1$ + Image icon = plugin.getImageRegistry().get(key); + if (icon == null) { + URL imageURL = plugin.getBundle().getResource(url); + ImageDescriptor descriptor = ImageDescriptor.createFromURL(imageURL); + icon = descriptor.createImage(); + plugin.getImageRegistry().put(key, 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)); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionInfo.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionInfo.java new file mode 100644 index 0000000000..456dba31e8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionInfo.java @@ -0,0 +1,111 @@ +/********************************************************************** + * 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: + * Marc-Andre Laperle - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.relayd; + +/** + * A class that holds information about the relayd connection. + * + * @author Marc-Andre Laperle + * @since 3.1 + */ +public final class LttngRelaydConnectionInfo { + + private final String fHost; + private final int fPort; + private final String fSessionName; + + /** + * Constructs a connection information. + * + * @param host + * the host string + * @param port + * the port number + * @param sessionName + * the session name + */ + public LttngRelaydConnectionInfo(String host, int port, String sessionName) { + fHost = host; + fPort = port; + fSessionName = sessionName; + } + + /** + * Get the host string. + * + * @return the host string + */ + public String getHost() { + return fHost; + } + + /** + * Get the port number. + * + * @return the port number + */ + public int getPort() { + return fPort; + } + + /** + * Get the session name. + * + * @return the session name + */ + public String getSessionName() { + return fSessionName; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((fHost == null) ? 0 : fHost.hashCode()); + result = prime * result + fPort; + result = prime * result + ((fSessionName == null) ? 0 : fSessionName.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + LttngRelaydConnectionInfo other = (LttngRelaydConnectionInfo) obj; + if (fHost == null) { + if (other.fHost != null) { + return false; + } + } else if (!fHost.equals(other.fHost)) { + return false; + } + if (fPort != other.fPort) { + return false; + } + if (fSessionName == null) { + if (other.fSessionName != null) { + return false; + } + } else if (!fSessionName.equals(other.fSessionName)) { + return false; + } + return true; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionManager.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionManager.java new file mode 100644 index 0000000000..b71ffa7198 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConnectionManager.java @@ -0,0 +1,149 @@ +/********************************************************************** + * 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: + * Marc-Andre Laperle - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.relayd; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler; +import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager; +import org.eclipse.linuxtools.tmf.core.signal.TmfTraceClosedSignal; +import org.eclipse.linuxtools.tmf.core.signal.TmfTraceOpenedSignal; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.CtfConstants; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.eclipse.ui.PlatformUI; + +/** + * Manages relayd connections. When a trace is opened, it creates a connection + * if the trace was started with live support. When a trace is closed, is closes + * the connection. + * + * @author Marc-Andre Laperle + * @since 3.1 + */ +public final class LttngRelaydConnectionManager { + private static LttngRelaydConnectionManager fConnectionManager; + private Map fConnections = new HashMap<>(); + + /** + * Get an instance of the trace manager. + * + * @return The trace manager + */ + public static synchronized LttngRelaydConnectionManager getInstance() { + if (fConnectionManager == null) { + fConnectionManager = new LttngRelaydConnectionManager(); + TmfSignalManager.register(fConnectionManager); + } + return fConnectionManager; + } + + /** + * Get the cosumer for the given relayd connection information. + * + * @param connectionInfo + * the connection information + * + * @return the consumer + */ + public LttngRelaydConsumer getConsumer(final LttngRelaydConnectionInfo connectionInfo) { + if (!fConnections.containsKey(connectionInfo)) { + LttngRelaydConsumer lttngRelaydConsumer = new LttngRelaydConsumer(connectionInfo); + fConnections.put(connectionInfo, lttngRelaydConsumer); + return lttngRelaydConsumer; + } + + return fConnections.get(connectionInfo); + } + + private static LttngRelaydConnectionInfo getEntry(final ITmfTrace trace) throws CoreException { + if (trace instanceof CtfTmfTrace) { + CtfTmfTrace ctfTmfTrace = (CtfTmfTrace) trace; + if (!ctfTmfTrace.isComplete()) { + IResource resource = ctfTmfTrace.getResource(); + String host = resource.getPersistentProperty(CtfConstants.LIVE_HOST); + String port = resource.getPersistentProperty(CtfConstants.LIVE_PORT); + String sessionName = resource.getPersistentProperty(CtfConstants.LIVE_SESSION_NAME); + if (host != null && port != null && sessionName != null && !sessionName.isEmpty()) { + LttngRelaydConnectionInfo entry = new LttngRelaydConnectionInfo(host, Integer.parseInt(port), sessionName); + return entry; + } + } + } + + return null; + } + + /** + * Listen to trace opened so that we can start the relayd job if necessary. + * + * @param signal + * the signal to be processed + */ + @TmfSignalHandler + public void traceOpened(final TmfTraceOpenedSignal signal) { + + try { + LttngRelaydConnectionInfo entry = getEntry(signal.getTrace()); + if (entry != null) { + LttngRelaydConsumer consumer = getConsumer(entry); + consumer.connect(); + consumer.run((CtfTmfTrace) signal.getTrace()); + } + } catch (CoreException e) { + Activator.getDefault().logError(Messages.LttngRelaydConnectionManager_ConnectionError, e); + ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, Messages.LttngRelaydConnectionManager_ConnectionError, new Status(IStatus.WARNING, + Activator.PLUGIN_ID, e.getLocalizedMessage(), e)); + } + } + + /** + * Listen to trace closed so that we can stop the relayd job. + * + * @param signal + * the signal to be processed + */ + @TmfSignalHandler + public void traceClosed(final TmfTraceClosedSignal signal) { + LttngRelaydConnectionInfo entry; + try { + entry = getEntry(signal.getTrace()); + if (entry != null) { + LttngRelaydConsumer comsumer = getConsumer(entry); + if (comsumer != null) { + comsumer.dispose(); + } + fConnections.remove(entry); + } + } catch (CoreException e) { + // Something went wrong with the resource. That's OK, the trace is + // getting closed anyway. + } + } + + /** + * Dispose of all the manager's resources (i.e. its connections). + */ + public void dispose() { + for (LttngRelaydConsumer consumer : fConnections.values()) { + consumer.dispose(); + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConsumer.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConsumer.java new file mode 100644 index 0000000000..47a8e2d8aa --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/LttngRelaydConsumer.java @@ -0,0 +1,255 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.relayd; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.Socket; +import java.util.List; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.linuxtools.ctf.core.trace.CTFTrace; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.ILttngRelaydConnector; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.LttngRelaydConnectorFactory; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachReturnCode; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.AttachSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.CreateSessionReturnCode; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.IndexResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.NextIndexReturnCode; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.SessionResponse; +import org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands.StreamResponse; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.tmf.core.signal.TmfTraceRangeUpdatedSignal; +import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTimestamp; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; + +/** + * Consumer of the relay d. + * + * @author Matthew Khouzam + * @since 3.1 + */ +public final class LttngRelaydConsumer { + + private static final int SIGNAL_THROTTLE_NANOSEC = 10_000_000; + private static final String ENCODING_UTF_8 = "UTF-8"; //$NON-NLS-1$ + + private Job fConsumerJob; + private CtfTmfTrace fCtfTmfTrace; + private CTFTrace fCtfTrace; + private long fTimestampEnd; + private AttachSessionResponse fSession; + private Socket fConnection; + private ILttngRelaydConnector fRelayd; + private String fTracePath; + private long fLastSignal = 0; + private final LttngRelaydConnectionInfo fConnectionInfo; + + /** + * Start a lttng consumer. + * + * @param address + * the ip address in string format + * @param port + * the port, an integer + * @param sessionName + * the session name + * @param project + * the default project + */ + LttngRelaydConsumer(final LttngRelaydConnectionInfo connectionInfo) { + fConnectionInfo = connectionInfo; + fTimestampEnd = 0; + } + + /** + * Connects to the relayd at the given address and port then attaches to the + * given session name. + * + * @throws CoreException + * If something goes wrong during the connection + *
    + *
  • + * Connection could not be established (Socket could not be + * opened, etc)
  • + *
  • + * Connection timeout
  • + *
  • + * The session was not found
  • + *
  • + * Could not create viewer session
  • + *
  • + * Invalid trace (no metadata, no streams)
  • + *
+ */ + public void connect() throws CoreException { + if (fConnection != null) { + return; + } + + try { + fConnection = new Socket(fConnectionInfo.getHost(), fConnectionInfo.getPort()); + fRelayd = LttngRelaydConnectorFactory.getNewConnector(fConnection); + List sessions = fRelayd.getSessions(); + SessionResponse selectedSession = null; + for (SessionResponse session : sessions) { + String asessionName = nullTerminatedByteArrayToString(session.getSessionName().getBytes()); + + if (asessionName.equals(fConnectionInfo.getSessionName())) { + selectedSession = session; + break; + } + } + + if (selectedSession == null) { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_SessionNotFound)); + } + + CreateSessionResponse createSession = fRelayd.createSession(); + if (createSession.getStatus() != CreateSessionReturnCode.LTTNG_VIEWER_CREATE_SESSION_OK) { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_CreateViewerSessionError + createSession.getStatus().toString())); + } + + AttachSessionResponse attachedSession = fRelayd.attachToSession(selectedSession); + if (attachedSession.getStatus() != AttachReturnCode.VIEWER_ATTACH_OK) { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_AttachSessionError + attachedSession.getStatus().toString())); + } + + String metadata = fRelayd.getMetadata(attachedSession); + if (metadata == null) { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_NoMetadata)); + } + + List attachedStreams = attachedSession.getStreamList(); + if (attachedStreams.isEmpty()) { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_NoStreams)); + } + + fTracePath = nullTerminatedByteArrayToString(attachedStreams.get(0).getPathName().getBytes()); + + fSession = attachedSession; + } catch (IOException e) { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_ErrorConnecting + (e.getMessage() != null ? e.getMessage() : ""))); //$NON-NLS-1$ + } + } + + /** + * Run the consumer operation for a give trace. + * + * @param trace + * the trace + */ + public void run(final CtfTmfTrace trace) { + if (fSession == null) { + return; + } + + fCtfTmfTrace = trace; + fCtfTrace = trace.getCTFTrace(); + fConsumerJob = new Job("RelayD consumer") { //$NON-NLS-1$ + + @Override + protected IStatus run(final IProgressMonitor monitor) { + try { + while (!monitor.isCanceled()) { + List attachedStreams = fSession.getStreamList(); + for (StreamResponse stream : attachedStreams) { + if (stream.getMetadataFlag() != 1) { + IndexResponse indexReply = fRelayd.getNextIndex(stream); + if (indexReply.getStatus() == NextIndexReturnCode.VIEWER_INDEX_OK) { + long nanoTimeStamp = fCtfTrace.timestampCyclesToNanos(indexReply.getTimestampEnd()); + if (nanoTimeStamp > fTimestampEnd) { + CtfTmfTimestamp endTime = new CtfTmfTimestamp(nanoTimeStamp); + TmfTimeRange range = new TmfTimeRange(fCtfTmfTrace.getStartTime(), endTime); + + long currentTime = System.nanoTime(); + if (currentTime - fLastSignal > SIGNAL_THROTTLE_NANOSEC) { + TmfTraceRangeUpdatedSignal signal = new TmfTraceRangeUpdatedSignal(LttngRelaydConsumer.this, fCtfTmfTrace, range); + fCtfTmfTrace.broadcastAsync(signal); + fLastSignal = currentTime; + } + fTimestampEnd = nanoTimeStamp; + } + } else if (indexReply.getStatus() == NextIndexReturnCode.VIEWER_INDEX_HUP) { + // The trace is now complete because the trace session was destroyed + fCtfTmfTrace.setComplete(true); + TmfTraceRangeUpdatedSignal signal = new TmfTraceRangeUpdatedSignal(LttngRelaydConsumer.this, fCtfTmfTrace, new TmfTimeRange(fCtfTmfTrace.getStartTime(), new CtfTmfTimestamp(fTimestampEnd))); + fCtfTmfTrace.broadcastAsync(signal); + return Status.OK_STATUS; + } + } + } + } + } catch (IOException e) { + Activator.getDefault().logError("Error during live trace reading", e); //$NON-NLS-1$ + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngRelaydConsumer_ErrorLiveReading + (e.getMessage() != null ? e.getMessage() : "")); //$NON-NLS-1$ + } + + return Status.OK_STATUS; + } + }; + fConsumerJob.setSystem(true); + fConsumerJob.schedule(); + } + + /** + * Dispose the consumer and it's resources (sockets, etc). + */ + public void dispose() { + try { + if (fConsumerJob != null) { + fConsumerJob.cancel(); + fConsumerJob.join(); + } + if (fConnection != null) { + fConnection.close(); + } + if (fRelayd != null) { + fRelayd.close(); + } + } catch (IOException e) { + // Ignore + } catch (InterruptedException e) { + // Ignore + } + } + + /** + * Once the consumer is connected to the relayd session, it knows the trace + * path. This can be useful to know exactly where the trace is so that it + * can be imported into the workspace and it can be opened. + * + * @return the trace path + */ + public String getTracePath() { + return fTracePath; + } + + private static String nullTerminatedByteArrayToString(final byte[] byteArray) throws UnsupportedEncodingException { + // Find length of null terminated string + int length = 0; + while (length < byteArray.length && byteArray[length] != 0) { + length++; + } + + String asessionName = new String(byteArray, 0, length, ENCODING_UTF_8); + return asessionName; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/Messages.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/Messages.java new file mode 100644 index 0000000000..81e611a742 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/Messages.java @@ -0,0 +1,71 @@ +/********************************************************************** + * 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: + * Marc-Andre Laperle - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.relayd; + +import org.eclipse.osgi.util.NLS; + +/** + * Messages for the relayd connection. + * + * @author Marc-Andre Laperle + */ +public final class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.messages"; //$NON-NLS-1$ + + /** + * Error occurred establishing the connection. + */ + public static String LttngRelaydConnectionManager_ConnectionError; + + /** + * Error occurred attaching to the session. + */ + public static String LttngRelaydConsumer_AttachSessionError; + + /** + * Error occurred creating the viewer session. + */ + public static String LttngRelaydConsumer_CreateViewerSessionError; + + /** + * Error occurred connecting to the relayd. + */ + public static String LttngRelaydConsumer_ErrorConnecting; + + /** + * Error (generic) during live reading. + */ + public static String LttngRelaydConsumer_ErrorLiveReading; + + /** + * No metadata for this trace session. + */ + public static String LttngRelaydConsumer_NoMetadata; + + /** + * No streams for this trace session. + */ + public static String LttngRelaydConsumer_NoStreams; + + /** + * The session was not found by the relayd. + */ + public static String LttngRelaydConsumer_SessionNotFound; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/messages.properties b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/messages.properties new file mode 100644 index 0000000000..e76b1d2b96 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/relayd/messages.properties @@ -0,0 +1,20 @@ +############################################################################### +# 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: +# Marc-Andre Laperle - initial API and implementation +############################################################################### + +LttngRelaydConnectionManager_ConnectionError=The connection to the relayd could not be established. The trace cannot be opened in Live mode. +LttngRelaydConsumer_AttachSessionError=Error, could not attach to session, error code: +LttngRelaydConsumer_CreateViewerSessionError=Error, could not create viewer session, error code: +LttngRelaydConsumer_ErrorConnecting=Error connecting to live trace session. +LttngRelaydConsumer_ErrorLiveReading=Error during live trace reading. +LttngRelaydConsumer_NoMetadata=Error, trace has no metadata. +LttngRelaydConsumer_NoStreams=Error, has no streams. +LttngRelaydConsumer_SessionNotFound=Error, live session not found diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/ControlView.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/ControlView.java new file mode 100644 index 0000000000..64f3edd94a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/ControlView.java @@ -0,0 +1,194 @@ +/******************************************************************************* + * Copyright (c) 2009, 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 + * Bernd Hufmann - Filled with content + *******************************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponentChangedListener; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlContentProvider; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlLabelProvider; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlRoot; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.ui.part.ViewPart; +import org.eclipse.ui.progress.UIJob; + +/** + *

+ * View implementation for Trace Control. + *

+ * + * @author Bernd Hufmann + */ +public class ControlView extends ViewPart implements ITraceControlComponentChangedListener { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * View ID. + */ + public static final String ID = "org.eclipse.linuxtools.internal.lttng2.ui.views.control"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The tree viewer. + */ + private TreeViewer fTreeViewer = null; + + /** + * The trace control root node. This provides access to the whole model. + */ + private ITraceControlComponent fRoot = null; + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * Returns the trace control tree node (model) + * + * @return the trace control tree node (model). + */ + public ITraceControlComponent getTraceControlRoot() { + return fRoot; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void createPartControl(Composite parent) { + // Create tree viewer + fTreeViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + ColumnViewerToolTipSupport.enableFor(fTreeViewer); + + fTreeViewer.setContentProvider(new TraceControlContentProvider()); + fTreeViewer.setLabelProvider(new TraceControlLabelProvider()); + + // Create model root + fRoot = new TraceControlRoot(); + fRoot.addComponentListener(this); + fTreeViewer.setInput(fRoot); + + // Create context menu for the tree viewer + createContextMenu(); + + getSite().setSelectionProvider(fTreeViewer); + + RSECorePlugin.getTheSystemRegistry(); // to load RSE + } + + @Override + public void setFocus() { + fTreeViewer.getControl().setFocus(); + } + + @Override + public void componentAdded(ITraceControlComponent parent, ITraceControlComponent component) { + componentChanged(parent); + } + + @Override + public void componentRemoved(ITraceControlComponent parent, ITraceControlComponent component) { + componentChanged(parent); + } + + @Override + public void componentChanged(final ITraceControlComponent component) { + if (fTreeViewer.getTree().isDisposed()) { + return; + } + + UIJob myJob = new UIJob("Refresh") { //$NON-NLS-1$ + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + if (fTreeViewer.getTree().isDisposed()) { + return Status.OK_STATUS; + } + + fTreeViewer.refresh(component); + + // Change selection needed + final ISelection sel = fTreeViewer.getSelection(); + fTreeViewer.setSelection(null); + fTreeViewer.setSelection(sel); + + // Show component that was changed + fTreeViewer.reveal(component); + + return Status.OK_STATUS; + } + }; + myJob.setUser(false); + myJob.setSystem(true); + myJob.schedule(); + } + + /** + * Sets the selected component in the tree + * @param component - component to select + */ + public void setSelection(ITraceControlComponent component) { + ITraceControlComponent[] components = new ITraceControlComponent[1]; + components[0] = component; + setSelection(components); + } + + /** + * Sets the selected components in the tree + * @param components - array of components to select + */ + public void setSelection(ITraceControlComponent[] components) { + final StructuredSelection selection = new StructuredSelection(components); + UIJob myJob = new UIJob("Select") { //$NON-NLS-1$ + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + fTreeViewer.setSelection(selection); + return Status.OK_STATUS; + } + }; + myJob.setUser(false); + myJob.schedule(); + } + + // ------------------------------------------------------------------------ + // Helper methods + // ------------------------------------------------------------------------ + /** + * Creates the context sensitive menu. + */ + private void createContextMenu() { + // First we create a menu Manager + final MenuManager menuManager = new MenuManager(); + final Menu menu = menuManager.createContextMenu(fTreeViewer.getTree()); + // Set the MenuManager + fTreeViewer.getTree().setMenu(menu); + getSite().registerContextMenu(menuManager, fTreeViewer); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/AddContextDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/AddContextDialog.java new file mode 100644 index 0000000000..d2a0018141 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/AddContextDialog.java @@ -0,0 +1,420 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.viewers.CheckStateChangedEvent; +import org.eclipse.jface.viewers.CheckboxTreeViewer; +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.ICheckStateListener; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; + +/** + *

+ * Dialog box for collecting information about contexts to be added to channels/events. + *

+ * + * @author Bernd Hufmann + */ +public class AddContextDialog extends Dialog implements IAddContextDialog { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * The icon file for this dialog box. + */ + public static final String ADD_CONTEXT_ICON_FILE = "icons/elcl16/add-context.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * A tree viewer for displaying and selection of available contexts. + */ + private CheckboxTreeViewer fContextsViewer; + + /** + * A Tree model for the checkbox tree viewer. + */ + private final ContextModel fContextModel = new ContextModel(); + + /** + * The contexts to add. + */ + private final List fSelectedContexts = new ArrayList<>(); + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param shell - a shell for the display of the dialog + */ + public AddContextDialog(Shell shell) { + super(shell); + setShellStyle(SWT.RESIZE | getShellStyle()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public void setAvalibleContexts(List contexts) { + fContextModel.setAvalibleContexts(contexts); + } + + @Override + public List getContexts() { + List ret = new ArrayList<>(); + ret.addAll(fSelectedContexts); + return ret; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(Messages.TraceControl_AddContextDialogTitle); + newShell.setImage(Activator.getDefault().loadIcon(ADD_CONTEXT_ICON_FILE)); + } + + @Override + protected Control createDialogArea(Composite parent) { + + // Main dialog panel + Composite dialogComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + dialogComposite.setLayout(layout); + dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + // Contexts list + Group contextGroup = new Group(dialogComposite, SWT.SHADOW_NONE); + contextGroup.setText(Messages.TraceControl_AddContextAvailableContextsLabel); + layout = new GridLayout(1, true); + contextGroup.setLayout(layout); + contextGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); + + fContextsViewer = new CheckboxTreeViewer(contextGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + fContextsViewer.getTree().setToolTipText(Messages.TraceControl_AddContextAvailableContextsTooltip); + + fContextsViewer.setContentProvider(new ContextsContentProvider()); + fContextsViewer.setLabelProvider(new ContextsLabelProvider()); + fContextsViewer.addCheckStateListener(new ContextCheckListener()); + fContextsViewer.setInput(fContextModel); + fContextsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH)); + + getShell().setMinimumSize(new Point(500, 450)); + + return dialogComposite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ + createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ + } + + @Override + protected void okPressed() { + fSelectedContexts.clear(); + + Object[] checkedElements = fContextsViewer.getCheckedElements(); + for (int i = 0; i < checkedElements.length; i++) { + IContextModelComponent component = (IContextModelComponent)checkedElements[i]; + if (!Messages.TraceControl_AddContextAllLabel.equals(component.getName())) { + fSelectedContexts.add(component.getName()); + } + } + + // validation successful -> call super.okPressed() + super.okPressed(); + } + + // ------------------------------------------------------------------------ + // Helper classes and methods + // ------------------------------------------------------------------------ + /** + * Content provider for the contexts tree + */ + public static final class ContextsContentProvider implements ITreeContentProvider { + + @Override + public void dispose() { + } + + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + + @Override + public Object[] getElements(Object inputElement) { + return getChildren(inputElement); + } + + @Override + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof IContextModelComponent) { + return ((IContextModelComponent)parentElement).getChildren(); + } + return null; + } + + @Override + public Object getParent(Object element) { + if (element instanceof IContextModelComponent) { + return ((IContextModelComponent)element).getParent(); + } + return null; + } + + @Override + public boolean hasChildren(Object element) { + if (element instanceof IContextModelComponent) { + return ((IContextModelComponent)element).hasChildren(); + } + return false; + } + } + + /** + * Label provider for the contexts tree + */ + public static final class ContextsLabelProvider extends ColumnLabelProvider { + @Override + public String getText(Object element) { + + if ((element != null) && (element instanceof IContextModelComponent)) { + return ((IContextModelComponent)element).getName(); + } + + return "";//$NON-NLS-1$ + } + } + + /** + * Check state listener for the contexts tree. + */ + public final class ContextCheckListener implements ICheckStateListener { + @Override + public void checkStateChanged(CheckStateChangedEvent event) { + if (event.getChecked()) { + if (event.getElement() instanceof AllContexts) { + fContextsViewer.setSubtreeChecked(event.getElement(), true); + } + } else { + if (event.getElement() instanceof AllContexts) { + fContextsViewer.setSubtreeChecked(event.getElement(), false); + } else { + IContextModelComponent component = (IContextModelComponent) event.getElement(); + fContextsViewer.setChecked(component.getParent(), false); + } + } + } + } + + /** + * Model for the context tree viewer (root component) + */ + public static class ContextModel implements IContextModelComponent { + + private final AllContexts fAllContexts; + + /** + * Constructor + */ + public ContextModel() { + fAllContexts = new AllContexts(this); + } + + /** + * Sets the available contexts + * + * @param contexts + * The contexts to set + */ + public void setAvalibleContexts(List contexts) { + fAllContexts.setAvalibleContexts(contexts); + } + + @Override + public String getName() { + return "root"; //$NON-NLS-1$ + } + + @Override + public Object getParent() { + return null; + } + + @Override + public Object[] getChildren() { + Object[] ret = new Object[1]; + ret[0] = fAllContexts; + return ret; + } + + @Override + public boolean hasChildren() { + return true; + } + } + + /** + * Model element (to select/deselect) all contexts) for the context tree viewer + */ + public static class AllContexts implements IContextModelComponent { + /** + * The available list of contexts. + */ + private List fAvailableContexts; + + private final IContextModelComponent fParent; + + /** + * Constructor + * + * @param parent + * The parent component + */ + public AllContexts(IContextModelComponent parent) { + fParent = parent; + } + + /** + * Sets the available contexts + * + * @param contexts + * The contexts to set + */ + public void setAvalibleContexts(List contexts) { + fAvailableContexts = new ArrayList<>(); + if (contexts != null) { + for (Iterator iterator = contexts.iterator(); iterator.hasNext();) { + String name = iterator.next(); + fAvailableContexts.add(new Context(this, name)); + } + } + } + + @Override + public String getName() { + return Messages.TraceControl_AddContextAllLabel; + } + + @Override + public Object[] getChildren() { + return fAvailableContexts.toArray(); + } + + @Override + public Object getParent() { + return fParent; + } + + @Override + public boolean hasChildren() { + return true; + } + } + + /** + * Model element (the context) for the context tree viewer + */ + public static class Context implements IContextModelComponent { + + private final String fContextName; + private final IContextModelComponent fParent; + + /** + * Constructor + * + * @param parent + * The parent component + * @param name + * The name of this context + */ + public Context(IContextModelComponent parent, String name) { + fParent = parent; + fContextName = name; + } + + @Override + public String getName() { + return fContextName; + } + + @Override + public Object getParent() { + return fParent; + } + + @Override + public Object[] getChildren() { + return null; + } + + @Override + public boolean hasChildren() { + return false; + } + } + + /** + * Interface for the tree model used for the context tree viewer. + */ + public interface IContextModelComponent { + + /** + * @return The name of this component + */ + String getName(); + + /** + * @return The parent component + */ + Object getParent(); + + /** + * @return The array of children of this component + */ + Object[] getChildren(); + + /** + * @return If this component has children or not + */ + boolean hasChildren(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ConfirmDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ConfirmDialog.java new file mode 100644 index 0000000000..088a48ec89 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ConfirmDialog.java @@ -0,0 +1,36 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.swt.widgets.Shell; + +/** + *

+ * Confirmation dialog implementation. + *

+ * + * @author Bernd Hufmann + */ + +public class ConfirmDialog implements IConfirmDialog { + + @Override + public boolean openConfirm(Shell parent, String title, String message) { + return MessageDialog.openConfirm(parent, + Messages.TraceControl_DestroyConfirmationTitle, + Messages.TraceControl_DestroyConfirmationMessage); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/CreateSessionDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/CreateSessionDialog.java new file mode 100644 index 0000000000..9453ce7637 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/CreateSessionDialog.java @@ -0,0 +1,1048 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + * Marc-Andre Laperle - Support for creating a live session + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.TitleAreaDialog; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; +import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; +import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CCombo; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.VerifyEvent; +import org.eclipse.swt.events.VerifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +/** + *

+ * Dialog box for collecting session creation information. + *

+ * + * @author Bernd Hufmann + */ +public class CreateSessionDialog extends TitleAreaDialog implements ICreateSessionDialog { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The icon file for this dialog box. + */ + public static final String CREATE_SESSION_ICON_FILE = "icons/elcl16/add_button.gif"; //$NON-NLS-1$ + + /** + * To indicate that the default value will be used for this field + */ + private static final String DEFAULT_TEXT = "<" + Messages.EnableChannelDialog_DefaultMessage + ">"; //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The default port for the connection to Relayd. This actual value is + * needed because this is not an optional argument to a command; this is + * what is used to connect directly to Relayd from Java through a socket. + * There is also currently no way to know the default value by issuing a + * command. + */ + private static final int DEFAULT_LIVE_PORT = 5344; + + /** + * The default address for the connection to Relayd. Only local is supported + * for now. See above comment for why it's needed. + */ + private static final String DEFAULT_LIVE_URL = "127.0.0.1"; //$NON-NLS-1$ + + /** + * Supported network protocols for streaming + */ + private enum StreamingProtocol { + /** Default network protocol for IPv4 (TCP)*/ + net, + /** Default network protocol for IPv6 (TCP)*/ + net6, + /** File */ + file, + } + + /** + * Supported network protocols for Live tracing + */ + private enum LiveProtocol { + /** Default network protocol for IPv4 (TCP)*/ + net, + /** Default network protocol for IPv6 (TCP)*/ + net6 + } + + private enum StreamingProtocol2 { + /** Default network protocol for IPv4 (TCP)*/ + net, + /** Default network protocol for IPv6 (TCP)*/ + net6, + /** TCP network protocol for IPv4*/ + tcp, + /** TCP network protocol for IPv6*/ + tcp6 } + + /** + * Index of last supported streaming protocol for common URL configuration. + */ + private static final int COMMON_URL_LAST_INDEX = 1; + /** + * Index of default streaming protocol. + */ + private static final int DEFAULT_URL_INDEX = 0; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The dialog composite. + */ + private Composite fDialogComposite = null; + /** + * The text widget for the session name + */ + private Text fSessionNameText = null; + /** + * The label widget for the session path. + */ + private Label fSessionPathLabel = null; + /** + * The text widget for the session path. + */ + private Text fSessionPathText = null; + /** + * The button widget to select a normal session + */ + private Button fNormalModeButton = null; + /** + * The button widget to select a snapshot session + */ + private Button fSnapshotButton = null; + /** + * The group that contains the mutually exclusive mode buttons + */ + private Group fModeButtonGroup = null; + /** + * The button widget to select a live session + */ + private Button fLiveButton = null; + + /** + * The text widget to set a live delay + */ + private Text fLiveDelayText = null; + /** + * The Group for advanced configuration. + */ + private Group fAdvancedGroup = null; + /** + * The button to show advanced options. + */ + private Button fAdvancedButton = null; + /** + * The composite with streaming configuration parameter. + */ + private Composite fStreamingComposite = null; + /** + * The text widget for the trace path. + */ + private Text fTracePathText = null; + /** + * The button to link data protocol/Address with control protocol. + */ + private Button fLinkDataWithControlButton = null; + /** + * The Combo box for channel protocol selection. + */ + private CCombo fControlProtocolCombo = null; + /** + * A selection listener that copies the protocol from control to data when being linked. + */ + private ControlProtocolSelectionListener fCopyProtocolSelectionListener; + /** + * A selection listener updates the control port text depending on the control protocol selected. + */ + private ProtocolComboSelectionListener fControlProtocolSelectionListener; + /** + * A selection listener updates the data port text depending on the data protocol selected. + */ + private ProtocolComboSelectionListener fDataProtocolSelectionListener; + /** + * The text box for the host/IP address of the control channel. + */ + private Text fControlHostAddressText = null; + /** + * A key listener that copies the host address from control to data when being linked. + */ + private CopyModifyListener fControlUrlKeyListener; + /** + * A modify listener that updates the enablement of the dialog. + */ + private UpdateEnablementModifyListener fUpdateEnablementModifyListener; + /** + * The text box for the control port. + */ + private Text fControlPortText = null; + /** + * The Combo box for data protocol selection. + */ + private CCombo fDataProtocolCombo = null; + /** + * The text box for the host/IP address of the data channel. + */ + private Text fDataHostAddressText = null; + /** + * The text box for the data port. + */ + private Text fDataPortText = null; + /** + * The parent where the new node should be added. + */ + private TraceSessionGroup fParent = null; + /** + * The session name string. + */ + private String fSessionName = ""; //$NON-NLS-1$; + /** + * The session path string. + */ + private String fSessionPath = null; + /** + * Flag whether the session is snapshot or not + */ + private boolean fIsSnapshot = false; + /** + * Flag whether the session is live or not + */ + private boolean fIsLive = false; + /** + * The text box for the live address (relayd). + */ + private Text fLiveHostAddressText = null; + /** + * The text box for the live port (relayd). + */ + private Text fLivePortText = null; + /** + * The live delay + */ + private Integer fLiveDelay = 0; + /** + * The live url. + */ + private String fLiveUrl = null; + /** + * The live port. + */ + private Integer fLivePort = 0; + /** + * Flag whether default location (path) shall be used or not + */ + private boolean fIsDefaultPath = true; + /** + * Flag whether the advanced options are enabled or not + */ + private boolean fIsAdvancedEnabled = false; + /** + * The network URL in case control and data is configured together. + * If set, fControlUrl and fDataUrl will be null. + */ + private String fNetworkUrl = null; + /** + * The control URL in case control and data is configured separately. + * If set, fDataUrl will be set too and fNetworkUrl will be null. + */ + private String fControlUrl = null; + /** + * The data URL in case control and data is configured separately. + * If set, fControlUrl will be set too and fNetworkUrl will be null. + */ + private String fDataUrl = null; + /** + * The trace path string. + */ + private String fTracePath = null; + /** + * The Group for advanced configuration of Live mode. + */ + private Group fLiveGroup = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param shell - a shell for the display of the dialog + */ + public CreateSessionDialog(Shell shell) { + super(shell); + setShellStyle(SWT.RESIZE | getShellStyle()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public void initialize(TraceSessionGroup group) { + fParent = group; + fStreamingComposite = null; + fLiveGroup = null; + fLiveButton = null; + fIsLive = false; + fSnapshotButton = null; + fSessionName = ""; //$NON-NLS-1$ + fSessionPath = null; + fIsSnapshot = false; + fIsDefaultPath = true; + fIsAdvancedEnabled = false; + fNetworkUrl = null; + fControlUrl = null; + fDataUrl = null; + } + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(Messages.TraceControl_CreateSessionDialogTitle); + newShell.setImage(Activator.getDefault().loadIcon(CREATE_SESSION_ICON_FILE)); + } + + @Override + protected Control createDialogArea(Composite parent) { + Composite dialogAreaa = (Composite) super.createDialogArea(parent); + setTitle(Messages.TraceControl_CreateSessionDialogTitle); + setMessage(Messages.TraceControl_CreateSessionDialogMessage); + + // Main dialog panel + fDialogComposite = new Composite(dialogAreaa, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + fDialogComposite.setLayout(layout); + fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + Group sessionGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); + sessionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + sessionGroup.setLayout(new GridLayout(4, true)); + + fUpdateEnablementModifyListener = new UpdateEnablementModifyListener(); + + Label sessionNameLabel = new Label(sessionGroup, SWT.RIGHT); + sessionNameLabel.setText(Messages.TraceControl_CreateSessionNameLabel); + fSessionNameText = new Text(sessionGroup, SWT.NONE); + fSessionNameText.setToolTipText(Messages.TraceControl_CreateSessionNameTooltip); + fSessionNameText.addModifyListener(fUpdateEnablementModifyListener); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 3; + fSessionNameText.setLayoutData(data); + + fSessionPathLabel = new Label(sessionGroup, SWT.RIGHT); + fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel); + fSessionPathText = new Text(sessionGroup, SWT.NONE); + fSessionPathText.setToolTipText(Messages.TraceControl_CreateSessionPathTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 3; + fSessionPathText.setLayoutData(data); + fSessionPathText.addModifyListener(fUpdateEnablementModifyListener); + + if (fParent.isSnapshotSupported() || fParent.isLiveSupported()) { + fModeButtonGroup = new Group(sessionGroup, SWT.NONE); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 4; + fModeButtonGroup.setLayoutData(data); + fModeButtonGroup.setLayout(new GridLayout(3, true)); + + SelectionAdapter modeChangedListener = new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + if (fLiveButton != null) { + if (fLiveButton.getSelection()) { + createAdvancedLiveGroup(); + updateSessionPathEnablement(); + updateProtocolComboItems(); + } else { + disposeLiveGroup(); + updateSessionPathEnablement(); + updateProtocolComboItems(); + } + } + updateEnablement(); + } + }; + + fNormalModeButton = new Button(fModeButtonGroup, SWT.RADIO); + fNormalModeButton.setText(Messages.TraceControl_CreateSessionNormalLabel); + fNormalModeButton.setToolTipText(Messages.TraceControl_CreateSessionNormalTooltip); + fNormalModeButton.setSelection(true); + fNormalModeButton.addSelectionListener(modeChangedListener); + + if (fParent.isSnapshotSupported()) { + fSnapshotButton = new Button(fModeButtonGroup, SWT.RADIO); + fSnapshotButton.setText(Messages.TraceControl_CreateSessionSnapshotLabel); + fSnapshotButton.setToolTipText(Messages.TraceControl_CreateSessionSnapshotTooltip); + fSnapshotButton.addSelectionListener(modeChangedListener); + } + + if (fParent.isLiveSupported()) { + fLiveButton = new Button(fModeButtonGroup, SWT.RADIO); + fLiveButton.setText(Messages.TraceControl_CreateSessionLiveLabel); + fLiveButton.setToolTipText(Messages.TraceControl_CreateSessionLiveTooltip); + fLiveButton.addSelectionListener(modeChangedListener); + } + } + + if (fParent.isNetworkStreamingSupported() || fParent.isLiveSupported()) { + createAdvancedOptionsComposite(); + } + + return fDialogComposite; + } + + private void createAdvancedOptionsComposite() { + + fAdvancedGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); + fAdvancedGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); + fAdvancedGroup.setLayout(new GridLayout(1, true)); + + fAdvancedButton = new Button(fAdvancedGroup, SWT.PUSH); + fAdvancedButton.setText(Messages.TraceControl_CreateSessionConfigureStreamingButtonText + " >>>"); //$NON-NLS-1$ + fAdvancedButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip); + fAdvancedButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + if (fIsAdvancedEnabled) { + fIsAdvancedEnabled = false; + fAdvancedButton.setText(">>> " + Messages.TraceControl_CreateSessionConfigureStreamingButtonText); //$NON-NLS-1$ + fAdvancedButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip); + + if (fParent.isNetworkStreamingSupported()) { + updateSessionPathEnablement(); + disposeConfigureStreamingComposite(); + } + + if (fParent.isLiveSupported()) { + disposeLiveGroup(); + } + } else { + fIsAdvancedEnabled = true; + fAdvancedButton.setText("<<< " + Messages.TraceControl_CreateSessionNoStreamingButtonText); //$NON-NLS-1$ + fAdvancedButton.setToolTipText(Messages.TraceControl_CreateSessionNoStreamingButtonTooltip); + + if (fParent.isNetworkStreamingSupported()) { + updateSessionPathEnablement(); + createConfigureStreamingComposite(); + } + if (fLiveButton != null && fLiveButton.getSelection()) { + createAdvancedLiveGroup(); + } + } + + updateEnablement(); + getShell().pack(); + } + }); + } + + private void updateSessionPathEnablement() { + if (fIsAdvancedEnabled || fIsLive) { + fSessionPathText.setEnabled(false); + fSessionPathText.setText(""); //$NON-NLS-1$ + fSessionPathLabel.setText(""); //$NON-NLS-1$ + } else { + fSessionPathText.setEnabled(true); + fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel); + } + } + + private void updateProtocolComboItems() { + if (fControlProtocolCombo == null || fControlProtocolCombo.isDisposed()) { + return; + } + + int currentSelection = fControlProtocolCombo.getSelectionIndex() <= COMMON_URL_LAST_INDEX ? + fControlProtocolCombo.getSelectionIndex() : DEFAULT_URL_INDEX; + + fControlProtocolCombo.removeAll(); + Enum>[] values; + if (fIsLive) { + values = LiveProtocol.values(); + } else if (fLinkDataWithControlButton.getSelection()) { + values = StreamingProtocol.values(); + } else { + values = StreamingProtocol2.values(); + } + + String[] controlItems = new String[values.length]; + for (int i = 0; i < controlItems.length; i++) { + controlItems[i] = values[i].name(); + } + fControlProtocolCombo.setItems(controlItems); + fDataProtocolCombo.setItems(controlItems); + + // Set selection + if (currentSelection != -1) { + fControlProtocolCombo.select(currentSelection); + fDataProtocolCombo.select(currentSelection); + } + } + + private void createConfigureStreamingComposite() { + if (fStreamingComposite == null) { + fStreamingComposite = new Group(fAdvancedGroup, SWT.SHADOW_NONE); + GridLayout layout = new GridLayout(1, true); + fStreamingComposite.setLayout(layout); + fStreamingComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + layout = new GridLayout(7, true); + fStreamingComposite.setLayout(layout); + fStreamingComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + Label tracePathLabel = new Label(fStreamingComposite, SWT.RIGHT); + tracePathLabel.setText(Messages.TraceControl_CreateSessionTracePathText); + fTracePathText = new Text(fStreamingComposite, SWT.NONE); + fTracePathText.setToolTipText(Messages.TraceControl_CreateSessionTracePathTooltip); + + // layout widgets + GridData data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 6; + fTracePathText.setLayoutData(data); + fTracePathText.addModifyListener(fUpdateEnablementModifyListener); + + fLinkDataWithControlButton = new Button(fStreamingComposite, SWT.CHECK); + fLinkDataWithControlButton.setText(Messages.TraceControl_CreateSessionLinkButtonText); + fLinkDataWithControlButton.setToolTipText(Messages.TraceControl_CreateSessionLinkButtonTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 7; + fLinkDataWithControlButton.setLayoutData(data); + fLinkDataWithControlButton.setSelection(true); + + Label label = new Label(fStreamingComposite, SWT.NONE); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + label.setLayoutData(data); + + label = new Label(fStreamingComposite, SWT.NONE); + label.setText(Messages.TraceControl_CreateSessionProtocolLabelText); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + label.setLayoutData(data); + + label = new Label(fStreamingComposite, SWT.NONE); + label.setText(Messages.TraceControl_CreateSessionAddressLabelText); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 4; + label.setLayoutData(data); + + label = new Label(fStreamingComposite, SWT.NONE); + label.setText(Messages.TraceControl_CreateSessionPortLabelText); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + label.setLayoutData(data); + + label = new Label(fStreamingComposite, SWT.RIGHT); + label.setText(Messages.TraceControl_CreateSessionControlUrlLabel); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + label.setLayoutData(data); + + fControlProtocolCombo = new CCombo(fStreamingComposite, SWT.READ_ONLY); + fControlProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionCommonProtocolTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + fControlProtocolCombo.setLayoutData(data); + fControlProtocolCombo.addModifyListener(fUpdateEnablementModifyListener); + + fControlHostAddressText = new Text(fStreamingComposite, SWT.NONE); + fControlHostAddressText.setToolTipText(Messages.TraceControl_CreateSessionControlAddressTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 4; + fControlHostAddressText.setLayoutData(data); + fControlHostAddressText.addModifyListener(fUpdateEnablementModifyListener); + + fControlPortText = new Text(fStreamingComposite, SWT.NONE); + fControlPortText.setToolTipText(Messages.TraceControl_CreateSessionControlPortTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + fControlPortText.setLayoutData(data); + fControlPortText.addModifyListener(fUpdateEnablementModifyListener); + + label = new Label(fStreamingComposite, SWT.RIGHT); + label.setText(Messages.TraceControl_CreateSessionDataUrlLabel); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + label.setLayoutData(data); + + fDataProtocolCombo = new CCombo(fStreamingComposite, SWT.READ_ONLY); + fDataProtocolCombo.setEnabled(false); + fDataProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionProtocolTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + fDataProtocolCombo.setLayoutData(data); + fDataProtocolCombo.addModifyListener(fUpdateEnablementModifyListener); + + updateProtocolComboItems(); + + fDataHostAddressText = new Text(fStreamingComposite, SWT.NONE); + fDataHostAddressText.setEnabled(false); + fDataHostAddressText.setToolTipText(Messages.TraceControl_CreateSessionDataAddressTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 4; + fDataHostAddressText.setLayoutData(data); + fDataHostAddressText.addModifyListener(fUpdateEnablementModifyListener); + + fDataPortText = new Text(fStreamingComposite, SWT.NONE); + fDataPortText.setEnabled(true); + fDataPortText.setToolTipText(Messages.TraceControl_CreateSessionDataPortTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + fDataPortText.setLayoutData(data); + fDataPortText.addModifyListener(fUpdateEnablementModifyListener); + + fCopyProtocolSelectionListener = new ControlProtocolSelectionListener(); + fControlProtocolSelectionListener = new ProtocolComboSelectionListener(fControlProtocolCombo, fControlPortText); + fDataProtocolSelectionListener = new ProtocolComboSelectionListener(fDataProtocolCombo, fDataPortText); + + fControlProtocolCombo.addSelectionListener(fCopyProtocolSelectionListener); + + fControlUrlKeyListener = new CopyModifyListener(fControlHostAddressText, fDataHostAddressText); + fControlHostAddressText.addModifyListener(fControlUrlKeyListener); + + fControlProtocolCombo.select(DEFAULT_URL_INDEX); + fDataProtocolCombo.select(DEFAULT_URL_INDEX); + + fLinkDataWithControlButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + if (fLinkDataWithControlButton.getSelection()) { + // Set enablement control data channel inputs + fDataProtocolCombo.setEnabled(false); + fDataHostAddressText.setEnabled(false); + fControlPortText.setEnabled(true); + fDataPortText.setEnabled(true); + + // Update listeners + fControlProtocolCombo.removeSelectionListener(fControlProtocolSelectionListener); + fDataProtocolCombo.removeSelectionListener(fDataProtocolSelectionListener); + fControlProtocolCombo.addSelectionListener(fCopyProtocolSelectionListener); + fControlHostAddressText.addModifyListener(fControlUrlKeyListener); + + updateProtocolComboItems(); + + fDataHostAddressText.setText(fControlHostAddressText.getText()); + + // Update tool tips + fControlProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionCommonProtocolTooltip); + } else { + // Enable data channel inputs + fDataProtocolCombo.setEnabled(true); + fDataHostAddressText.setEnabled(true); + + // Update listeners + fControlProtocolCombo.removeSelectionListener(fCopyProtocolSelectionListener); + fControlProtocolCombo.addSelectionListener(fControlProtocolSelectionListener); + fDataProtocolCombo.addSelectionListener(fDataProtocolSelectionListener); + fControlHostAddressText.removeModifyListener(fControlUrlKeyListener); + + updateProtocolComboItems(); + + // Update tool tips + fDataProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionProtocolTooltip); + fControlProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionProtocolTooltip); + + // Update control/data port enablement and input + if (fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net.name()) || + fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net6.name())) { + fControlPortText.setText(""); //$NON-NLS-1$ + fControlPortText.setEnabled(false); + } else { + fControlPortText.setEnabled(true); + } + + if (fDataProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net.name()) || + fDataProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net6.name())) { + fDataPortText.setText(""); //$NON-NLS-1$ + fDataPortText.setEnabled(false); + } else { + fDataPortText.setEnabled(true); + } + } + } + }); + } + } + + private void createAdvancedLiveGroup() { + if (fLiveGroup == null && fIsAdvancedEnabled) { + GridLayout layout = new GridLayout(7, true); + fLiveGroup = new Group(fAdvancedGroup, SWT.NONE); + fLiveGroup.setLayout(layout); + GridData layoutData = new GridData(GridData.FILL_BOTH); + fLiveGroup.setLayoutData(layoutData); + + Label label = new Label(fLiveGroup, SWT.NONE); + label.setText(Messages.TraceControl_CreateSessionLiveConnectionLabel); + layoutData = new GridData(GridData.FILL_HORIZONTAL); + layoutData.horizontalSpan = 2; + label.setLayoutData(layoutData); + + fLiveHostAddressText = new Text(fLiveGroup, SWT.NONE); + fLiveHostAddressText.setText(DEFAULT_LIVE_URL); + fLiveHostAddressText.setEnabled(false); + fLiveHostAddressText.setToolTipText(Messages.TraceControl_CreateSessionLiveConnectionUrlTooltip); + layoutData = new GridData(GridData.FILL_HORIZONTAL); + layoutData.horizontalSpan = 4; + fLiveHostAddressText.setLayoutData(layoutData); + + fLivePortText = new Text(fLiveGroup, SWT.NONE); + fLivePortText.setText(Integer.toString(DEFAULT_LIVE_PORT)); + fLivePortText.setToolTipText(Messages.TraceControl_CreateSessionLiveConnectionPortTooltip); + layoutData = new GridData(GridData.FILL_HORIZONTAL); + fLivePortText.setLayoutData(layoutData); + + Label liveDelayLabel = new Label(fLiveGroup, SWT.NONE); + layoutData = new GridData(GridData.FILL_HORIZONTAL); + liveDelayLabel.setText(Messages.TraceControl_CreateSessionLiveDelayLabel); + liveDelayLabel.setLayoutData(layoutData); + fLiveDelayText = new Text(fLiveGroup, SWT.NONE); + fLiveDelayText.setText(DEFAULT_TEXT); + fLiveDelayText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + fLiveDelayText.setToolTipText(Messages.TraceControl_CreateSessionLiveDelayTooltip); + fLiveDelayText.addVerifyListener(new VerifyListener() { + @Override + public void verifyText(VerifyEvent e) { + // only numbers and default are allowed. + e.doit = e.text.matches("[0-9]*") || e.text.matches(DEFAULT_TEXT); //$NON-NLS-1$ + updateEnablement(); + } + }); + fLiveDelayText.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent event) { + updateEnablement(); + } + }); + + fLiveDelayText.addFocusListener(new FocusListener() { + + @Override + public void focusLost(FocusEvent e) { + Text focusLostWidget = (Text) e.widget; + if (focusLostWidget.getText().isEmpty()) { + focusLostWidget.setText(DEFAULT_TEXT); + focusLostWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + } + } + + @Override + public void focusGained(FocusEvent e) { + Text focusGainedWidget = (Text) e.widget; + if (focusGainedWidget.getText().equals(DEFAULT_TEXT)) { + focusGainedWidget.setText(""); //$NON-NLS-1$ + focusGainedWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_BLACK)); + } + } + }); + + layoutData = new GridData(GridData.FILL_HORIZONTAL); + layoutData.grabExcessHorizontalSpace = true; + layoutData.horizontalSpan = 6; + fLiveDelayText.setLayoutData(layoutData); + getShell().pack(); + } + } + + private void disposeLiveGroup() { + if (fLiveGroup != null) { + fLiveGroup.dispose(); + fLiveGroup = null; + getShell().pack(); + } + } + + private void disposeConfigureStreamingComposite() { + if (fStreamingComposite != null) { + fStreamingComposite.dispose(); + fStreamingComposite = null; + } + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ + createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ + } + + private void updateEnablement() { + validate(); + getButton(IDialogConstants.OK_ID).setEnabled(getErrorMessage() == null); + } + + private void validate() { + // Validate input data + fSessionName = fSessionNameText.getText(); + fSessionPath = fSessionPathText.getText(); + setErrorMessage(null); + + if (fParent.isLiveSupported() && fLiveButton != null) { + fIsLive = fLiveButton.getSelection(); + fLiveDelay = LTTngControlServiceConstants.UNUSED_VALUE; + fLiveUrl = DEFAULT_LIVE_URL; + fLivePort = DEFAULT_LIVE_PORT; + } + + if (!"".equals(fSessionPath)) { //$NON-NLS-1$ + // validate sessionPath + if (!fIsAdvancedEnabled && !fIsLive) { + TargetNodeComponent node = (TargetNodeComponent)fParent.getParent(); + IRemoteSystemProxy proxy = node.getRemoteSystemProxy(); + IFileServiceSubSystem fsss = proxy.getFileServiceSubSystem(); + if (fsss != null) { + try { + IRemoteFile remoteFolder = fsss.getRemoteFileObject(fSessionPath, new NullProgressMonitor()); + + if (remoteFolder == null) { + setErrorMessage(Messages.TraceControl_InvalidSessionPathError + " (" + fSessionPath + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + return; + } + + if (remoteFolder.exists()) { + setErrorMessage(Messages.TraceControl_SessionPathAlreadyExistsError + " (" + fSessionPath + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + return; + } + } catch (SystemMessageException e) { + setErrorMessage(Messages.TraceControl_FileSubSystemError + "\n" + e); //$NON-NLS-1$ + return; + } + } + } + fIsDefaultPath = false; + } + + if (fParent.isSnapshotSupported()) { + fIsSnapshot = fSnapshotButton.getSelection(); + } + + fNetworkUrl = null; + fControlUrl = null; + fDataUrl = null; + + if (fIsAdvancedEnabled && fStreamingComposite != null) { + // Validate input data + + if (fIsLive && fLiveGroup != null) { + String liveDelayText = fLiveDelayText.getText(); + try { + fLiveDelay = liveDelayText.equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.valueOf(liveDelayText); + fLivePort = Integer.valueOf(fLivePortText.getText()); + fLiveUrl = fLiveHostAddressText.getText(); + } catch (NumberFormatException e) { + setErrorMessage(Messages.TraceControl_InvalidLiveDelayError); + return; + } + } + + fTracePath = fTracePathText.getText(); + + if (fControlProtocolCombo.getSelectionIndex() < 0) { + setErrorMessage("Control Protocol Text is empty\n"); //$NON-NLS-1$ + return; + } + + if ("".equals(fControlHostAddressText.getText())) { //$NON-NLS-1$ + setErrorMessage("Control Address Text is empty\n"); //$NON-NLS-1$ + return; + } + + if (!fLinkDataWithControlButton.getSelection()) { + if (fDataProtocolCombo.getSelectionIndex() < 0) { + setErrorMessage("Data Protocol Text is empty\n"); //$NON-NLS-1$ + return; + } + + if ("".equals(fDataHostAddressText.getText())) { //$NON-NLS-1$ + setErrorMessage("Data Address Text is empty\n"); //$NON-NLS-1$ + return; + } + + fControlUrl = getUrlString(fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()), + fControlHostAddressText.getText(), + fControlPortText.getText(), + null, + fTracePath); + + fDataUrl = getUrlString(fDataProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()), + fDataHostAddressText.getText(), + null, + fDataPortText.getText(), + fTracePath); + } else { + fNetworkUrl = getUrlString(fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()), + fControlHostAddressText.getText(), + fControlPortText.getText(), + fDataPortText.getText(), + fTracePath); + } + } + + if (fIsLive && fNetworkUrl == null && fControlUrl == null && fDataUrl == null) { + fNetworkUrl = SessionInfo.DEFAULT_LIVE_NETWORK_URK; + } + + // Check for invalid names + if (!"".equals(fSessionName) && !fSessionName.matches("^[a-zA-Z0-9\\-\\_]{1,}$")) { //$NON-NLS-1$ //$NON-NLS-2$ + setErrorMessage(Messages.TraceControl_InvalidSessionNameError + " (" + fSessionName + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + return; + } + + // Check if node with name already exists in parent + if(fParent.containsChild(fSessionName)) { + setErrorMessage(Messages.TraceControl_SessionAlreadyExistsError + " (" + fSessionName + ")"); //$NON-NLS-1$ //$NON-NLS-2$ + return; + } + } + + private static String getUrlString(String proto, String host, String ctrlPort, String dataPort, String sessionPath) { + //proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH] + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(proto); + stringBuilder.append("://"); //$NON-NLS-1$ + stringBuilder.append(host); + + if ((ctrlPort != null) && (!"".equals(ctrlPort))) { //$NON-NLS-1$ + stringBuilder.append(":"); //$NON-NLS-1$ + stringBuilder.append(ctrlPort); + } + + if ((dataPort != null) && (!"".equals(dataPort))) { //$NON-NLS-1$ + stringBuilder.append(":"); //$NON-NLS-1$ + stringBuilder.append(dataPort); + } + + if ((sessionPath != null) && (!"".equals(sessionPath))) { //$NON-NLS-1$ + stringBuilder.append("/"); //$NON-NLS-1$ + stringBuilder.append(sessionPath); + } + return stringBuilder.toString(); + } + + private static class CopyModifyListener implements ModifyListener { + private Text fSource; + private Text fDestination; + + public CopyModifyListener(Text source, Text destination) { + fSource = source; + fDestination = destination; + } + + @Override + public void modifyText(ModifyEvent e) { + fDestination.setText(fSource.getText()); + } + } + + private class ControlProtocolSelectionListener extends SelectionAdapter { + + @Override + public void widgetSelected(SelectionEvent e) { + fDataProtocolCombo.select(fControlProtocolCombo.getSelectionIndex()); + if (fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.file.name())) { + fControlPortText.setText(""); //$NON-NLS-1$ + fDataPortText.setText(""); //$NON-NLS-1$ + fControlPortText.setEnabled(false); + fDataPortText.setEnabled(false); + } else { + fControlPortText.setEnabled(true); + fDataPortText.setEnabled(true); + } + } + } + + private class ProtocolComboSelectionListener extends SelectionAdapter { + + private CCombo fCombo; + private Text fPortText; + + public ProtocolComboSelectionListener(CCombo combo, Text portText) { + fCombo = combo; + fPortText = portText; + } + + @Override + public void widgetSelected(SelectionEvent e) { + if (fCombo.getItem(fCombo.getSelectionIndex()).equals(StreamingProtocol.net.name()) || + fCombo.getItem(fCombo.getSelectionIndex()).equals(StreamingProtocol.net6.name())) { + fPortText.setText(""); //$NON-NLS-1$ + fPortText.setEnabled(false); + } else { + fPortText.setEnabled(true); + } + } + } + + @Override + public ISessionInfo getParameters() { + ISessionInfo sessionInfo = new SessionInfo(fSessionName); + + boolean isStreaming = (fIsAdvancedEnabled && fStreamingComposite != null) || fIsLive; + if (isStreaming) { + sessionInfo.setNetworkUrl(fNetworkUrl); + sessionInfo.setControlUrl(fControlUrl); + sessionInfo.setDataUrl(fDataUrl); + sessionInfo.setStreamedTrace(true); + } else if (!fIsDefaultPath) { + sessionInfo.setSessionPath(fSessionPath); + } + + sessionInfo.setLive(fIsLive); + sessionInfo.setLiveUrl(fLiveUrl); + sessionInfo.setLivePort(fLivePort); + sessionInfo.setLiveDelay(fLiveDelay); + sessionInfo.setSnapshot(fIsSnapshot); + + return sessionInfo; + } + + private final class UpdateEnablementModifyListener implements ModifyListener { + @Override + public void modifyText(ModifyEvent e) { + updateEnablement(); + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableChannelDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableChannelDialog.java new file mode 100644 index 0000000000..649e90af47 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableChannelDialog.java @@ -0,0 +1,595 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Simon Delisle - Updated for support of LTTng Tools 2.2 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.VerifyEvent; +import org.eclipse.swt.events.VerifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +/** + *

+ * Dialog box for collecting channel information when enabling a channel (which will be created). + *

+ * + * @author Bernd Hufmann + */ +public class EnableChannelDialog extends Dialog implements IEnableChannelDialog { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The icon file for this dialog box. + */ + public static final String ENABLE_CHANNEL_ICON_FILE = "icons/elcl16/add_button.gif"; //$NON-NLS-1$ + + /** + * To indicate that the default value will be used for this field + */ + private static final String DEFAULT_TEXT = "<" + Messages.EnableChannelDialog_DefaultMessage + ">"; //$NON-NLS-1$ //$NON-NLS-2$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The text widget for the channel name + */ + private Text fChannelNameText = null; + /** + * The discard mode of the channel. + */ + private Button fDiscardModeButton = null; + /** + * The overwrite mode of the channel. + */ + private Button fOverwriteModeButton = null; + /** + * The sub-buffer size of the channel. + */ + private Text fSubBufferSizeText = null; + /** + * The number of sub-buffers of the channel. + */ + private Text fNumberOfSubBuffersText = null; + /** + * The switch timer interval of the channel. + */ + private Text fSwitchTimerText = null; + /** + * The read timer interval of the channel. + */ + private Text fReadTimerText = null; + /** + * Radio button for selecting kernel domain. + */ + private Button fKernelButton = null; + /** + * Radio button for selecting UST domain. + */ + private Button fUstButton = null; + /** + * The parent domain component where the channel node should be added. + * Null in case of creation on session level. + */ + private TraceDomainComponent fDomain = null; + /** + * The target node component + */ + private TargetNodeComponent fTargetNodeComponent = null; + /** + * Common verify listener for numeric text input. + */ + private VerifyListener fVerifyListener = null; + /** + * Common focus listener + */ + private FocusListener fFocusListener = null; + /** + * Output channel information. + */ + private IChannelInfo fChannelInfo = null; + /** + * Output domain information. True in case of Kernel domain. False for UST. + */ + private boolean fIsKernel; + /** + * Flag which indicates whether Kernel domain is available or not + */ + private boolean fHasKernel; + /** + * Maximum size of trace files of the channel. + */ + private Text fMaxSizeTraceText = null; + /** + * Maximum number of trace files of the channel. + */ + private Text fMaxNumberTraceText = null; + /** + * CheckBox for selecting shared buffers (kernel onlyu). + */ + private Button fSharedBuffersButton = null; + /** + * CheckBox for selecting per UID buffers. + */ + private Button fPIDBuffersButton = null; + /** + * CheckBox for selecting per UID buffers. + */ + private Button fUIDBuffersButton = null; + /** + * CheckBox to configure metadata channel + */ + private Button fMetadataChannelButton = null; + /** + * Previous channel name + */ + private String fPreviousChannelName = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param shell - a shell for the display of the dialog + */ + public EnableChannelDialog(Shell shell) { + super(shell); + fIsKernel = true; + + // Common verify listener + fVerifyListener = new VerifyListener() { + @Override + public void verifyText(VerifyEvent e) { + // only numbers and default are allowed. + e.doit = e.text.matches("[0-9]*") || e.text.matches(DEFAULT_TEXT); //$NON-NLS-1$ + } + }; + + // Common focus listener + fFocusListener = new FocusListener() { + + @Override + public void focusLost(FocusEvent e) { + Text focusLostWidget = (Text) e.widget; + if (focusLostWidget.getText().isEmpty()) { + focusLostWidget.setText(DEFAULT_TEXT); + focusLostWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + } + } + + @Override + public void focusGained(FocusEvent e) { + Text focusGainedWidget = (Text) e.widget; + if (focusGainedWidget.getText().equals(DEFAULT_TEXT)) { + focusGainedWidget.setText(""); //$NON-NLS-1$ + focusGainedWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_BLACK)); + } + } + }; + + setShellStyle(SWT.RESIZE | getShellStyle()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public IChannelInfo getChannelInfo() { + return fChannelInfo; + } + + @Override + public void setDomainComponent(TraceDomainComponent domain) { + fDomain = domain; + if (fDomain != null) { + fIsKernel = fDomain.isKernel(); + } else { + fIsKernel = true; + } + } + + @Override + public boolean isKernel() { + return fIsKernel; + } + + @Override + public void setHasKernel(boolean hasKernel) { + if (fDomain != null) { + fIsKernel = fDomain.isKernel(); + } else { + fIsKernel = hasKernel; + } + + fHasKernel = hasKernel; + } + + @Override + public void setTargetNodeComponent(TargetNodeComponent node) { + fTargetNodeComponent = node; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(Messages.TraceControl_EnableChannelDialogTitle); + newShell.setImage(Activator.getDefault().loadIcon(ENABLE_CHANNEL_ICON_FILE)); + } + + @Override + protected Control createDialogArea(Composite parent) { + + int numColumn = 2; + if (fTargetNodeComponent.isBufferTypeConfigSupported()) { + numColumn = 3; + } + + // Main dialog panel + Composite dialogComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + dialogComposite.setLayout(layout); + + Composite commonModeGroup = new Composite(dialogComposite, SWT.NONE); + layout = new GridLayout(3, true); + commonModeGroup.setLayout(layout); + + Label channelNameLabel = new Label(commonModeGroup, SWT.RIGHT); + channelNameLabel.setText(Messages.TraceControl_EnableChannelNameLabel); + fChannelNameText = new Text(commonModeGroup, SWT.NONE); + fChannelNameText.setToolTipText(Messages.TraceControl_EnableChannelNameTooltip); + + Label subBufferSizeLabel = new Label(commonModeGroup, SWT.RIGHT); + subBufferSizeLabel.setText(Messages.TraceControl_SubBufferSizePropertyName); + fSubBufferSizeText = new Text(commonModeGroup, SWT.NONE); + fSubBufferSizeText.setToolTipText(Messages.TraceControl_EnableChannelSubBufferSizeTooltip); + fSubBufferSizeText.addVerifyListener(fVerifyListener); + fSubBufferSizeText.addFocusListener(fFocusListener); + fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + + Label numSubBufferLabel = new Label(commonModeGroup, SWT.RIGHT); + numSubBufferLabel.setText(Messages.TraceControl_NbSubBuffersPropertyName); + fNumberOfSubBuffersText = new Text(commonModeGroup, SWT.NONE); + fNumberOfSubBuffersText.setToolTipText(Messages.TraceControl_EnableChannelNbSubBuffersTooltip); + fNumberOfSubBuffersText.addVerifyListener(fVerifyListener); + fNumberOfSubBuffersText.addFocusListener(fFocusListener); + + Label switchTimerLabel = new Label(commonModeGroup, SWT.RIGHT); + switchTimerLabel.setText(Messages.TraceControl_SwitchTimerPropertyName); + fSwitchTimerText = new Text(commonModeGroup, SWT.NONE); + fSwitchTimerText.setToolTipText(Messages.TraceControl_EnableChannelSwitchTimerTooltip); + fSwitchTimerText.addVerifyListener(fVerifyListener); + fSwitchTimerText.addFocusListener(fFocusListener); + + Label readTimerLabel = new Label(commonModeGroup, SWT.RIGHT); + readTimerLabel.setText(Messages.TraceControl_ReadTimerPropertyName); + fReadTimerText = new Text(commonModeGroup, SWT.NONE); + fReadTimerText.setToolTipText(Messages.TraceControl_EnableChannelReadTimerTooltip); + fReadTimerText.addVerifyListener(fVerifyListener); + fReadTimerText.addFocusListener(fFocusListener); + + if (fTargetNodeComponent.isTraceFileRotationSupported()) { + Label maxSizeTraceFilesLabel = new Label(commonModeGroup, SWT.RIGHT); + maxSizeTraceFilesLabel.setText(Messages.TraceControl_MaxSizeTraceFilesPropertyName); + fMaxSizeTraceText = new Text(commonModeGroup, SWT.NONE); + fMaxSizeTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxSizeTraceFilesTooltip); + fMaxSizeTraceText.addVerifyListener(fVerifyListener); + fMaxSizeTraceText.addFocusListener(fFocusListener); + + Label maxNumTraceFilesLabel = new Label(commonModeGroup, SWT.RIGHT); + maxNumTraceFilesLabel.setText(Messages.TraceControl_MaxNumTraceFilesPropertyName); + fMaxNumberTraceText = new Text(commonModeGroup, SWT.NONE); + fMaxNumberTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxNumTraceFilesTooltip); + fMaxNumberTraceText.addVerifyListener(fVerifyListener); + fMaxNumberTraceText.addFocusListener(fFocusListener); + } + + if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) { + fMetadataChannelButton = new Button(commonModeGroup, SWT.CHECK); + fMetadataChannelButton.setText(Messages.TraceControl_ConfigureMetadataChannelName); + fMetadataChannelButton.setSelection(false); + + fMetadataChannelButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + if (fMetadataChannelButton.getSelection()) { + fPreviousChannelName = fChannelNameText.getText(); + fChannelNameText.setText("metadata"); //$NON-NLS-1$ + fChannelNameText.setEnabled(false); + } else { + fChannelNameText.setText(fPreviousChannelName); + fChannelNameText.setEnabled(true); + } + } + }); + } + Group discardModeGroup = new Group(dialogComposite, SWT.SHADOW_NONE); + discardModeGroup.setText(Messages.TraceControl_EnableChannelDiscardModeGroupName); + layout = new GridLayout(numColumn, true); + discardModeGroup.setLayout(layout); + + fDiscardModeButton = new Button(discardModeGroup, SWT.RADIO); + fDiscardModeButton.setText(Messages.TraceControl_EnableChannelDiscardModeLabel); + fDiscardModeButton.setToolTipText(Messages.TraceControl_EnableChannelDiscardModeTooltip); + fDiscardModeButton.setSelection(true); + + fOverwriteModeButton = new Button(discardModeGroup, SWT.RADIO); + fOverwriteModeButton.setText(Messages.TraceControl_EnableChannelOverwriteModeLabel); + fOverwriteModeButton.setToolTipText(Messages.TraceControl_EnableChannelOverwriteModeTooltip); + fOverwriteModeButton.setSelection(false); + + Group domainGroup = new Group(dialogComposite, SWT.SHADOW_NONE); + domainGroup.setText(Messages.TraceControl_DomainDisplayName); + layout = new GridLayout(numColumn, true); + domainGroup.setLayout(layout); + + fKernelButton = new Button(domainGroup, SWT.RADIO); + fKernelButton.setText(Messages.TraceControl_KernelDomainDisplayName); + fKernelButton.setSelection(fIsKernel); + fUstButton = new Button(domainGroup, SWT.RADIO); + fUstButton.setText(Messages.TraceControl_UstDisplayName); + fUstButton.setSelection(!fIsKernel); + + if (fTargetNodeComponent.isBufferTypeConfigSupported()) { + Group bufferTypeGroup = new Group(dialogComposite, SWT.SHADOW_NONE); + bufferTypeGroup.setText(Messages.TraceControl_BufferTypeDisplayName); + layout = new GridLayout(numColumn, true); + bufferTypeGroup.setLayout(layout); + + GridData data = new GridData(GridData.FILL, GridData.BEGINNING, false, false); + data.horizontalSpan = 3; + bufferTypeGroup.setLayoutData(data); + + fSharedBuffersButton = new Button(bufferTypeGroup, SWT.RADIO); + fSharedBuffersButton.setText(Messages.TraceControl_SharedBuffersDisplayName); + fSharedBuffersButton.setSelection(fIsKernel); + fSharedBuffersButton.setEnabled(false); + + fPIDBuffersButton = new Button(bufferTypeGroup, SWT.RADIO); + fPIDBuffersButton.setText(Messages.TraceControl_PerPidBuffersDisplayName); + fPIDBuffersButton.setToolTipText(Messages.TraceControl_PerPidBuffersTooltip); + fPIDBuffersButton.setSelection(false); + + fUIDBuffersButton = new Button(bufferTypeGroup, SWT.RADIO); + fUIDBuffersButton.setText(Messages.TraceControl_PerUidBuffersDisplayName); + fUIDBuffersButton.setToolTipText(Messages.TraceControl_PerPidBuffersTooltip); + fUIDBuffersButton.setSelection(false); + + fUIDBuffersButton.setEnabled(!fIsKernel); + fPIDBuffersButton.setEnabled(!fIsKernel); + + // Update buffers type buttons depending on UST or Kernel + fUstButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + if (fUstButton.getSelection()) { + fSharedBuffersButton.setSelection(false); + fPIDBuffersButton.setSelection(false); + fUIDBuffersButton.setSelection(false); + fPIDBuffersButton.setEnabled(true); + fUIDBuffersButton.setEnabled(true); + } else { + fSharedBuffersButton.setSelection(true); + fPIDBuffersButton.setSelection(false); + fUIDBuffersButton.setSelection(false); + fPIDBuffersButton.setEnabled(false); + fUIDBuffersButton.setEnabled(false); + } + } + }); + } + + if ((fDomain != null) || (!fHasKernel)) { + fKernelButton.setEnabled(false); + fUstButton.setEnabled(false); + + if (fTargetNodeComponent.isBufferTypeConfigSupported()) { + fSharedBuffersButton.setEnabled(false); + fUIDBuffersButton.setEnabled(!fHasKernel); + fPIDBuffersButton.setEnabled(!fHasKernel); + setBufferTypeButtonSelection(); + } + } + + // layout widgets + GridData data = new GridData(GridData.FILL, GridData.BEGINNING, false, false); + data.horizontalSpan = 3; + discardModeGroup.setLayoutData(data); + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + fDiscardModeButton.setLayoutData(data); + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + fOverwriteModeButton.setLayoutData(data); + + data = new GridData(GridData.FILL, GridData.BEGINNING, false, false); + data.horizontalSpan = 3; + domainGroup.setLayoutData(data); + + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + fKernelButton.setLayoutData(data); + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + fUstButton.setLayoutData(data); + if (fTargetNodeComponent.isBufferTypeConfigSupported()) { + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + fSharedBuffersButton.setLayoutData(data); + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + fPIDBuffersButton.setLayoutData(data); + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + fUIDBuffersButton.setLayoutData(data); + } + + if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) { + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + data.horizontalSpan = numColumn; + fMetadataChannelButton.setLayoutData(data); + } + + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 2; + + fChannelNameText.setLayoutData(data); + fSubBufferSizeText.setLayoutData(data); + fNumberOfSubBuffersText.setLayoutData(data); + fSwitchTimerText.setLayoutData(data); + fReadTimerText.setLayoutData(data); + if (fTargetNodeComponent.isTraceFileRotationSupported()) { + fMaxNumberTraceText.setLayoutData(data); + fMaxSizeTraceText.setLayoutData(data); + } + + setDefaults(); + + return dialogComposite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.DETAILS_ID, "&Default", true); //$NON-NLS-1$ + createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ + createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ + } + + @Override + protected void okPressed() { + // Set channel information + ChannelInfo channelInfo = new ChannelInfo(fChannelNameText.getText()); + channelInfo.setSubBufferSize(fSubBufferSizeText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Long.parseLong(fSubBufferSizeText.getText())); + channelInfo.setNumberOfSubBuffers(fNumberOfSubBuffersText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.parseInt(fNumberOfSubBuffersText.getText())); + channelInfo.setSwitchTimer(fSwitchTimerText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Long.parseLong(fSwitchTimerText.getText())); + channelInfo.setReadTimer(fReadTimerText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Long.parseLong(fReadTimerText.getText())); + channelInfo.setOverwriteMode(fOverwriteModeButton.getSelection()); + if (fTargetNodeComponent.isTraceFileRotationSupported()) { + channelInfo.setMaxSizeTraceFiles(fMaxSizeTraceText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.parseInt(fMaxSizeTraceText.getText())); + channelInfo.setMaxNumberTraceFiles(fMaxNumberTraceText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.parseInt(fMaxNumberTraceText.getText())); + } + if (fTargetNodeComponent.isBufferTypeConfigSupported()) { + if (fSharedBuffersButton.getSelection()) { + channelInfo.setBufferType(BufferType.BUFFER_SHARED); + } else if (fPIDBuffersButton.getSelection()) { + channelInfo.setBufferType(BufferType.BUFFER_PER_PID); + } else if (fUIDBuffersButton.getSelection()) { + channelInfo.setBufferType(BufferType.BUFFER_PER_UID); + } else { + channelInfo.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN); + } + } + + fIsKernel = fKernelButton.getSelection(); + + // Check for invalid names + if (!channelInfo.getName().matches("^[a-zA-Z0-9\\-\\_]{1,}$")) { //$NON-NLS-1$ + MessageDialog.openError(getShell(), + Messages.TraceControl_EnableChannelDialogTitle, + Messages.TraceControl_InvalidChannelNameError + " (" + channelInfo.getName() + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + return; + } + + // Check for duplicate names + if (fDomain != null && fDomain.containsChild(channelInfo.getName())) { + MessageDialog.openError(getShell(), + Messages.TraceControl_EnableChannelDialogTitle, + Messages.TraceControl_ChannelAlreadyExistsError + " (" + channelInfo.getName() + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + return; + } + + fChannelInfo = channelInfo; + + // validation successful -> call super.okPressed() + super.okPressed(); + } + + @Override + protected void buttonPressed(int buttonId) { + if (buttonId == IDialogConstants.DETAILS_ID) { + setDefaults(); + return; + } + super.buttonPressed(buttonId); + } + + // ------------------------------------------------------------------------ + // Helper methods + // ------------------------------------------------------------------------ + + /** + * Sets default value depending on Kernel or UST + */ + private void setDefaults() { + fSwitchTimerText.setText(DEFAULT_TEXT); + fSwitchTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + fReadTimerText.setText(DEFAULT_TEXT); + fReadTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + fOverwriteModeButton.setSelection(IChannelInfo.DEFAULT_OVERWRITE_MODE); + if (fTargetNodeComponent.isTraceFileRotationSupported()) { + fMaxSizeTraceText.setText(DEFAULT_TEXT); + fMaxSizeTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + fMaxNumberTraceText.setText(DEFAULT_TEXT); + fMaxNumberTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + } + fSubBufferSizeText.setText(DEFAULT_TEXT); + fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + fNumberOfSubBuffersText.setText(DEFAULT_TEXT); + fNumberOfSubBuffersText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY)); + if (fTargetNodeComponent.isBufferTypeConfigSupported()) { + setBufferTypeButtonSelection(); + } + } + + private void setBufferTypeButtonSelection() { + if ((fDomain != null) && fDomain.getBufferType() != null) { + switch (fDomain.getBufferType()) { + case BUFFER_PER_PID: + fPIDBuffersButton.setSelection(true); + break; + case BUFFER_PER_UID: + fUIDBuffersButton.setSelection(true); + break; + case BUFFER_SHARED: + fSharedBuffersButton.setSelection(true); + break; + //$CASES-OMITTED$ + default: + break; + } + } + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java new file mode 100644 index 0000000000..15351276e0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableEventsDialog.java @@ -0,0 +1,436 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.List; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; + +/** + *

+ * Dialog box for collecting information events to be enabled. + *

+ * + * @author Bernd Hufmann + */ +public class EnableEventsDialog extends Dialog implements IEnableEventsDialog { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * The icon file for this dialog box. + */ + public static final String ENABLE_EVENT_ICON_FILE = "icons/elcl16/enable_event.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The dialog composite. + */ + private Composite fDialogComposite; + /** + * The composite with widgets for collecting information about kernel events. + */ + private EnableKernelEventComposite fKernelComposite; + /** + * The composite with widgets for collecting information about UST events. + */ + private EnableUstEventsComposite fUstComposite; + /** + * Radio button for selecting kernel domain. + */ + private Button fKernelButton; + /** + * Radio button for selecting UST domain. + */ + private Button fUstButton; + /** + * The referenced trace provider group containing the kernel provider and UST + * provider component which contains a list of available tracepoints. + */ + private TraceProviderGroup fProviderGroup; + /** + * The parent domain component where the channel node should be added. + * Null in case the domain is not known (i.e. on session level). + */ + private TraceDomainComponent fDomain; + /** + * Output domain information. True in case of Kernel domain. False for UST. + */ + private boolean fIsKernel; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param shell - a shell for the display of the dialog + */ + public EnableEventsDialog(Shell shell) { + super(shell); + setShellStyle(SWT.RESIZE | getShellStyle()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public boolean isTracepoints() { + if (fIsKernel) { + return fKernelComposite.isTracepoints(); + } + return fUstComposite.isTracepoints(); + } + + @Override + public boolean isAllTracePoints() { + if (fIsKernel) { + return fKernelComposite.isAllTracePoints(); + } + return fUstComposite.isAllTracePoints(); + } + + @Override + public boolean isSysCalls() { + if (fIsKernel) { + return fKernelComposite.isSysCalls(); + } + return false; + } + + @Override + public boolean isAllSysCalls() { + if (fIsKernel) { + return fKernelComposite.isSysCalls(); + } + return false; + } + + @Override + public List getEventNames() { + if (fIsKernel) { + return fKernelComposite.getEventNames(); + } + return fUstComposite.getEventNames(); + } + + @Override + public boolean isDynamicProbe() { + if (fIsKernel) { + return fKernelComposite.isDynamicProbe(); + } + return false; + } + + @Override + public String getProbeName() { + if (fIsKernel) { + return fKernelComposite.getProbeName(); + } + return null; + } + + @Override + public String getProbeEventName() { + if (fIsKernel) { + return fKernelComposite.getProbeEventName(); + } + return null; + } + + @Override + public boolean isDynamicFunctionProbe() { + if (fIsKernel) { + return fKernelComposite.isDynamicFunctionProbe(); + } + return false; + } + + @Override + public String getFunctionEventName() { + if (fIsKernel) { + return fKernelComposite.getFunctionEventName(); + } + return null; + } + + @Override + public String getFunction() { + if (fIsKernel) { + return fKernelComposite.getFunction(); + } + return null; + } + + @Override + public boolean isWildcard() { + if (!fIsKernel) { + return fUstComposite.isWildcard(); + } + return false; + } + + @Override + public String getWildcard() { + if (!fIsKernel) { + return fUstComposite.getWildcard(); + } + return null; + } + + @Override + public boolean isLogLevel() { + if (!fIsKernel) { + return fUstComposite.isLogLevel(); + } + return false; + } + + @Override + public LogLevelType getLogLevelType() { + if (!fIsKernel) { + return fUstComposite.getLogLevelType(); + } + return null; + } + + @Override + public TraceLogLevel getLogLevel() { + if (!fIsKernel) { + return fUstComposite.getLogLevel(); + } + return null; + } + + @Override + public String getLogLevelEventName() { + if (!fIsKernel) { + return fUstComposite.getLogLevelEventName(); + } + return null; + } + + @Override + public boolean isKernel() { + return fIsKernel; + } + + @Override + public void setTraceProviderGroup(TraceProviderGroup providerGroup) { + fProviderGroup = providerGroup; + } + + @Override + public void setTraceDomainComponent(TraceDomainComponent domain) { + fDomain = domain; + if (fDomain != null) { + fIsKernel = fDomain.isKernel(); + } else { + fIsKernel = fProviderGroup != null ? fProviderGroup.hasKernelProvider() : true; + } + } + + @Override + public String getFilterExpression() { + if (!fIsKernel) { + return fUstComposite.getFilterExpression(); + } + return null; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(Messages.TraceControl_EnableEventsDialogTitle); + newShell.setImage(Activator.getDefault().loadIcon(ENABLE_EVENT_ICON_FILE)); + } + + @Override + protected Control createDialogArea(Composite parent) { + + // Main dialog panel + fDialogComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + fDialogComposite.setLayout(layout); + fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + // ------------------------------------------------------------------------ + // Domain Group + // ------------------------------------------------------------------------ + Group domainGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); + domainGroup.setText(Messages.TraceControl_DomainDisplayName); + layout = new GridLayout(2, true); + domainGroup.setLayout(layout); + + fKernelButton = new Button(domainGroup, SWT.RADIO); + fKernelButton.setText(Messages.TraceControl_KernelDomainDisplayName); + fKernelButton.setSelection(fIsKernel); + fUstButton = new Button(domainGroup, SWT.RADIO); + fUstButton.setText(Messages.TraceControl_UstDisplayName); + fUstButton.setSelection(!fIsKernel); + + if ((fDomain != null) || ((fProviderGroup != null) && (!fProviderGroup.hasKernelProvider()))) { + fKernelButton.setEnabled(false); + fUstButton.setEnabled(false); + } + + // layout widgets + GridData data = new GridData(GridData.FILL_HORIZONTAL); + domainGroup.setLayoutData(data); + + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + fKernelButton.setLayoutData(data); + data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); + fUstButton.setLayoutData(data); + + // ------------------------------------------------------------------------ + // Kernel or UST event data group + // ------------------------------------------------------------------------ + fUstComposite = null; + fKernelComposite = null; + if (fIsKernel) { + createKernelComposite(); + fUstComposite = null; + } else { + createUstComposite(); + } + + fKernelButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + if (fKernelButton.getSelection()) { + disposeUstComposite(); + createKernelComposite(); + fDialogComposite.layout(); + } + } + }); + + fUstButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + if (fUstButton.getSelection()) { + disposeKernelComposite(); + createUstComposite(); + fDialogComposite.layout(); + } + } + }); + + getShell().setMinimumSize(new Point(500, 650)); + + return fDialogComposite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ + createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ + } + + @Override + protected void okPressed() { + fIsKernel = fKernelButton.getSelection(); + + // Validate kernel composite in case of kernel domain + if (fKernelComposite != null && !fKernelComposite.isValid()) { + return; + } + + // Validate UST composite in case of UST domain + if (fUstComposite != null && !fUstComposite.isValid()) { + return; + } + + // validation successful -> call super.okPressed() + super.okPressed(); + } + + // ------------------------------------------------------------------------ + // Helper methods + // ------------------------------------------------------------------------ + + /** + * Creates the kernel composite (if not existing) + */ + private void createKernelComposite() { + if (fKernelComposite == null) { + fKernelComposite = new EnableKernelEventComposite(fDialogComposite, SWT.NONE, fProviderGroup); + GridLayout layout = new GridLayout(1, true); + fKernelComposite.setLayout(layout); + fKernelComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + fKernelComposite.createContent(); + } + } + + /** + * Disposes the kernel composite (if existing) + */ + private void disposeKernelComposite() { + if (fKernelComposite != null) { + fKernelComposite.dispose(); + fKernelComposite = null; + } + } + + /** + * Creates the UST composite (if not existing) + */ + private void createUstComposite() { + if (fUstComposite == null) { + fUstComposite = new EnableUstEventsComposite(fDialogComposite, SWT.NONE, fProviderGroup); + GridLayout layout = new GridLayout(1, true); + fUstComposite.setLayout(layout); + fUstComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + fUstComposite.createContent(); + } + } + + /** + * Disposes the UST composite (if existing) + */ + private void disposeUstComposite() { + if (fUstComposite != null) { + fUstComposite.dispose(); + fUstComposite = null; + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java new file mode 100644 index 0000000000..7dc6300752 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableKernelEventComposite.java @@ -0,0 +1,601 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Marc-Andre Laperle - Add filtering textbox + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.CheckStateChangedEvent; +import org.eclipse.jface.viewers.CheckboxTreeViewer; +import org.eclipse.jface.viewers.ICheckStateListener; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlContentProvider; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlLabelProvider; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; + +/** + *

+ * A composite for collecting information about kernel events to be enabled. + *

+ * + * @author Bernd Hufmann + */ +public class EnableKernelEventComposite extends Composite implements IEnableKernelEvents { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + private enum KernelGroupEnum { TRACEPOINTS, SYSCALLS, PROBE, FUNCTION } + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * A button to enable/disable the tracepoints group + */ + private Button fTracepointsActivateButton; + /** + * A tree viewer for displaying and selection of available tracepoints. + */ + private CheckboxTreeViewer fTracepointsViewer; + /** + * A button to enable/disable the syscalls group + */ + private Button fSysCallsActivateButton; + /** + * A button to enable or disable the dynamic probe group. + */ + private Button fProbeActivateButton; + /** + * The text field for the event name for the dynamic probe. + */ + private Text fProbeEventNameText; + /** + * The text field for the dynamic probe. + */ + private Text fProbeText; + /** + * A button to enable or disable the dynamic function probe group. + */ + private Button fFunctionActivateButton; + /** + * The text field for the event name for the dynamic probe. + */ + private Text fFunctionEventNameText; + /** + * The text field for the dynamic function entry/return probe. + */ + private Text fFunctionText; + /** + * The referenced trace provider group containing the kernel provider + * component which contains a list of available tracepoints. + */ + private final TraceProviderGroup fProviderGroup; + /** + * The flag indicating that tracepoints are selected. + */ + private boolean fIsTracepoints; + /** + * The flag indicating that all tracepoints are selected. + */ + private boolean fIsAllTracepoints; + /** + * The flag indicating that syscalls are selected. + */ + private boolean fIsSysCalls; + /** + * The list of tracepoints to be enabled. + */ + private List fSelectedEvents; + /** + * The flag indicating that dynamic probe is selected. + */ + private boolean fIsDynamicProbe; + /** + * The event name of the dynamic probe. + */ + private String fProbeEventName; + /** + * The dynamic probe. + */ + private String fProbeString; + /** + * The flag indicating that the dynamic function probe is selected. + */ + private boolean fIsDynamicFunctionProbe; + /** + * The event name of the dynamic function entry/return probe. + */ + private String fFunctionEventName; + /** + * The dynamic function entry/return probe. + */ + private String fFunctionString; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * + * @param parent + * The parent composite + * @param style + * The index of the style for this event composite + * @param providerGroup + * The trace provider group + */ + public EnableKernelEventComposite(Composite parent, int style, TraceProviderGroup providerGroup) { + super(parent, style); + fProviderGroup = providerGroup; + } + + // ------------------------------------------------------------------------ + // Acessors + // ------------------------------------------------------------------------ + + @Override + public boolean isTracepoints() { + return fIsTracepoints; + } + + @Override + public boolean isAllTracePoints() { + return fIsAllTracepoints; + } + + @Override + public boolean isSysCalls() { + return fIsSysCalls; + } + + @Override + public boolean isAllSysCalls() { + return fIsSysCalls; + } + + @Override + public List getEventNames() { + return new ArrayList<>(fSelectedEvents); + } + + @Override + public boolean isDynamicProbe() { + return fIsDynamicProbe; + } + + @Override + public String getProbeName() { + return fProbeString; + } + + @Override + public String getProbeEventName() { + return fProbeEventName; + } + + @Override + public boolean isDynamicFunctionProbe() { + return fIsDynamicFunctionProbe; + } + + @Override + public String getFunctionEventName() { + return fFunctionEventName; + } + + @Override + public String getFunction() { + return fFunctionString; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Creates the composite content + */ + public void createContent() { + + // Tracepoints Group + createTracepointsGroup(); + + // Syscalls Group + createSysCallsGroup(); + + // Dynamic Probe Group + createDynamicProbeGroup(); + + // Dynamic Function Probe Group + createDynamicFunctionPropeGroup(); + + // Set default enablements + setKernelEnablements(KernelGroupEnum.TRACEPOINTS); + } + + /** + * Validates the kernel composite input data. + * @return true if configured data is valid and can be retrieved. + */ + public boolean isValid() { + fIsTracepoints = fTracepointsActivateButton.getSelection(); + fIsSysCalls = fSysCallsActivateButton.getSelection(); + fIsDynamicProbe = fProbeActivateButton.getSelection(); + fIsDynamicFunctionProbe = fFunctionActivateButton.getSelection(); + + // initialize tracepoint fields + fIsAllTracepoints = false; + fSelectedEvents = new ArrayList<>(); + + if (fIsTracepoints) { + List comps = fProviderGroup.getChildren(KernelProviderComponent.class); + fIsAllTracepoints = fTracepointsViewer.getChecked(comps.get(0)); + + Object[] checkedElements = fTracepointsViewer.getCheckedElements(); + for (int i = 0; i < checkedElements.length; i++) { + ITraceControlComponent component = (ITraceControlComponent)checkedElements[i]; + if (component instanceof BaseEventComponent) { + fSelectedEvents.add(component.getName()); + } + } + } + + if (fIsDynamicProbe) { + String temp = fProbeEventNameText.getText(); + if (temp.isEmpty() || + fProbeText.getText().matches("\\s*") || //$NON-NLS-1$ + (!temp.matches("^[\\s]{0,}$") && !temp.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$ + MessageDialog.openError(getShell(), + Messages.TraceControl_EnableEventsDialogTitle, + Messages.TraceControl_InvalidProbeNameError + " (" + temp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + + return false; + } + + fProbeEventName = temp; + // fProbeString will be validated by lttng-tools + fProbeString = fProbeText.getText(); + } + + // initialize function string + fFunctionEventName = null; + fFunctionString = null; + if (fIsDynamicFunctionProbe) { + String functionTemp = fFunctionEventNameText.getText(); + if (functionTemp.isEmpty() || + functionTemp.matches("\\s*") || //$NON-NLS-1$ + (!functionTemp.matches("^[\\s]{0,}$") && !functionTemp.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$ + MessageDialog.openError(getShell(), + Messages.TraceControl_EnableEventsDialogTitle, + Messages.TraceControl_InvalidProbeNameError + " (" + functionTemp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + + return false; + } + + fFunctionEventName = functionTemp; + // fFunctionString will be validated by lttng-tools + fFunctionString = fFunctionText.getText(); + } + + return true; + } + + /** + * Creates tracepoints group. + */ + private void createTracepointsGroup() { + + GridLayout layout; + GridData data; + Group tpMainGroup = new Group(this, SWT.SHADOW_NONE); + tpMainGroup.setText(Messages.TraceControl_EnableEventsTracepointGroupName); + layout = new GridLayout(2, false); + tpMainGroup.setLayout(layout); + data = new GridData(GridData.FILL_BOTH); + tpMainGroup.setLayoutData(data); + + Composite buttonComposite = new Composite(tpMainGroup, SWT.NONE); + layout = new GridLayout(1, true); + buttonComposite.setLayout(layout); + data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); + buttonComposite.setLayoutData(data); + + fTracepointsActivateButton = new Button(buttonComposite, SWT.RADIO); + fTracepointsActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); + data = new GridData(GridData.FILL_HORIZONTAL); + fTracepointsActivateButton.setLayoutData(data); + fTracepointsActivateButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + setKernelEnablements(KernelGroupEnum.TRACEPOINTS); + } + }); + + Group tracepointsGroup = new Group(tpMainGroup, SWT.SHADOW_NONE); + layout = new GridLayout(1, true); + tracepointsGroup.setLayout(layout); + data = new GridData(GridData.FILL_BOTH); + tracepointsGroup.setLayoutData(data); + + new FilteredTree(tracepointsGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, new PatternFilter(), true) { + @Override + protected TreeViewer doCreateTreeViewer(Composite aparent, int style) { + fTracepointsViewer = new CheckboxTreeViewer(aparent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + fTracepointsViewer.getTree().setToolTipText(Messages.TraceControl_EnableEventsTracepointTreeTooltip); + + fTracepointsViewer.setContentProvider(new KernelContentProvider()); + fTracepointsViewer.setLabelProvider(new KernelLabelProvider()); + fTracepointsViewer.addCheckStateListener(new KernelCheckListener()); + fTracepointsViewer.setInput(fProviderGroup); + + fTracepointsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH)); + return fTracepointsViewer; + } + }; + } + + /** + * Creates syscalls group. + */ + private void createSysCallsGroup() { + GridLayout layout; + GridData data; + Group sysCallsMainGroup = new Group(this, SWT.SHADOW_NONE); + sysCallsMainGroup.setText(Messages.TraceControl_EnableEventsSyscallName); + sysCallsMainGroup.setToolTipText(Messages.TraceControl_EnableEventsSyscallTooltip); + layout = new GridLayout(2, false); + sysCallsMainGroup.setLayout(layout); + data = new GridData(GridData.FILL_HORIZONTAL); + sysCallsMainGroup.setLayoutData(data); + + Composite buttonComposite = new Composite(sysCallsMainGroup, SWT.NONE); + layout = new GridLayout(1, false); + buttonComposite.setLayout(layout); + data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); + buttonComposite.setLayoutData(data); + + fSysCallsActivateButton = new Button(buttonComposite, SWT.RADIO); + fSysCallsActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); + fSysCallsActivateButton.setToolTipText(Messages.TraceControl_EnableEventsSyscallTooltip); + fSysCallsActivateButton.setSelection(false); + data = new GridData(GridData.FILL_HORIZONTAL); + fSysCallsActivateButton.setLayoutData(data); + fSysCallsActivateButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + setKernelEnablements(KernelGroupEnum.SYSCALLS); + } + }); + } + + /** + * Creates dynamic probe group. + */ + private void createDynamicProbeGroup() { + GridLayout layout; + GridData data; + Group probeMainGroup = new Group(this, SWT.SHADOW_NONE); + probeMainGroup.setText(Messages.TraceControl_EnableEventsProbeGroupName); + layout = new GridLayout(2, false); + probeMainGroup.setLayout(layout); + data = new GridData(GridData.FILL_HORIZONTAL); + probeMainGroup.setLayoutData(data); + + Composite buttonComposite = new Composite(probeMainGroup, SWT.NONE); + layout = new GridLayout(1, false); + buttonComposite.setLayout(layout); + data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); + buttonComposite.setLayoutData(data); + + fProbeActivateButton = new Button(buttonComposite, SWT.RADIO); + fProbeActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); + fProbeActivateButton.setSelection(false); + data = new GridData(GridData.FILL_HORIZONTAL); + fProbeActivateButton.setLayoutData(data); + fProbeActivateButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + setKernelEnablements(KernelGroupEnum.PROBE); + } + }); + + Group probeGroup = new Group(probeMainGroup, SWT.SHADOW_NONE); + layout = new GridLayout(4, true); + probeGroup.setLayout(layout); + probeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + Label probeNameLabel = new Label(probeGroup, SWT.LEFT); + probeNameLabel.setText(Messages.TraceControl_EnableEventsEventNameLabel); + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 1; + probeNameLabel.setLayoutData(data); + + fProbeEventNameText = new Text(probeGroup, SWT.LEFT); + fProbeEventNameText.setToolTipText(Messages.TraceControl_EnableEventsProbeEventNameTooltip); + + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 3; + fProbeEventNameText.setLayoutData(data); + + Label probeLabel = new Label(probeGroup, SWT.LEFT); + probeLabel.setText(Messages.TraceControl_EnableEventsProbeNameLabel); + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 1; + probeLabel.setLayoutData(data); + + fProbeText = new Text(probeGroup, SWT.LEFT); + fProbeText.setToolTipText(Messages.TraceControl_EnableEventsProbeNameTooltip); + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 3; + fProbeText.setLayoutData(data); + } + + /** + * Creates dynamic function entry/return probe group. + */ + private void createDynamicFunctionPropeGroup() { + GridLayout layout; + GridData data; + Group functionMainGroup = new Group(this, SWT.SHADOW_NONE); + functionMainGroup.setText(Messages.TraceControl_EnableEventsFucntionGroupName); + layout = new GridLayout(2, false); + functionMainGroup.setLayout(layout); + data = new GridData(GridData.FILL_HORIZONTAL); + functionMainGroup.setLayoutData(data); + + Composite buttonComposite = new Composite(functionMainGroup, SWT.NONE); + layout = new GridLayout(1, false); + buttonComposite.setLayout(layout); + data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); + buttonComposite.setLayoutData(data); + + fFunctionActivateButton = new Button(buttonComposite, SWT.RADIO); + fFunctionActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); + fFunctionActivateButton.setSelection(false); + data = new GridData(GridData.FILL_HORIZONTAL); + fFunctionActivateButton.setLayoutData(data); + fFunctionActivateButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + setKernelEnablements(KernelGroupEnum.FUNCTION); + } + }); + + Group functionGroup = new Group(functionMainGroup, SWT.SHADOW_NONE); + layout = new GridLayout(4, true); + functionGroup.setLayout(layout); + functionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + Label functionNameLabel = new Label(functionGroup, SWT.LEFT); + functionNameLabel.setText(Messages.TraceControl_EnableEventsEventNameLabel); + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 1; + functionNameLabel.setLayoutData(data); + + fFunctionEventNameText = new Text(functionGroup, SWT.LEFT); + fFunctionEventNameText.setToolTipText(Messages.TraceControl_EnableEventsFunctionEventNameTooltip); + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 3; + fFunctionEventNameText.setLayoutData(data); + + Label functionLabel = new Label(functionGroup, SWT.LEFT); + functionLabel.setText(Messages.TraceControl_EnableEventsFunctionNameLabel); + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 1; + functionLabel.setLayoutData(data); + + fFunctionText = new Text(functionGroup, SWT.LEFT); + fFunctionText.setToolTipText(Messages.TraceControl_EnableEventsProbeNameTooltip); + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 3; + fFunctionText.setLayoutData(data); + } + + /** + * Enable/selects widgets depending on the group specified. + * @param group - group to enable. + */ + private void setKernelEnablements(KernelGroupEnum group) { + fTracepointsActivateButton.setSelection(group == KernelGroupEnum.TRACEPOINTS); + fTracepointsViewer.getTree().setEnabled(group == KernelGroupEnum.TRACEPOINTS); + + fSysCallsActivateButton.setSelection(group == KernelGroupEnum.SYSCALLS); + + fProbeActivateButton.setSelection(group == KernelGroupEnum.PROBE); + fProbeEventNameText.setEnabled(group == KernelGroupEnum.PROBE); + fProbeText.setEnabled(group == KernelGroupEnum.PROBE); + + fFunctionActivateButton.setSelection(group == KernelGroupEnum.FUNCTION); + fFunctionEventNameText.setEnabled(group == KernelGroupEnum.FUNCTION); + fFunctionText.setEnabled(group == KernelGroupEnum.FUNCTION); + } + + // ------------------------------------------------------------------------ + // Local classes + // ------------------------------------------------------------------------ + /** + * Content provider for the tracepoints tree. + */ + public static final class KernelContentProvider extends TraceControlContentProvider { + @Override + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof TraceProviderGroup) { + List children = ((ITraceControlComponent)parentElement).getChildren(KernelProviderComponent.class); + return children.toArray(new ITraceControlComponent[children.size()]); + } + if (parentElement instanceof ITraceControlComponent) { + return ((ITraceControlComponent)parentElement).getChildren(); + } + return new Object[0]; + } + } + + /** + * Content label for the tracepoints tree. + */ + public static final class KernelLabelProvider extends TraceControlLabelProvider { + @Override + public Image getImage(Object element) { + return null; + } + @Override + public String getText(Object element) { + if ((element != null) && (element instanceof KernelProviderComponent)) { + return Messages.TraceControl_EnableEventsTracepointTreeAllLabel; + } + return super.getText(element); + } + } + + /** + * Check state listener for the tracepoints tree. + */ + public final class KernelCheckListener implements ICheckStateListener { + @Override + public void checkStateChanged(CheckStateChangedEvent event) { + if (event.getChecked()) { + if (event.getElement() instanceof KernelProviderComponent) { + fTracepointsViewer.setSubtreeChecked(event.getElement(), true); + } + } else { + if (event.getElement() instanceof KernelProviderComponent) { + fTracepointsViewer.setSubtreeChecked(event.getElement(), false); + } else { + ITraceControlComponent component = (ITraceControlComponent) event.getElement(); + fTracepointsViewer.setChecked(component.getParent(), false); + } + } + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java new file mode 100644 index 0000000000..af21af6aae --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java @@ -0,0 +1,637 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + * Marc-Andre Laperle - Add filtering textbox + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.CheckStateChangedEvent; +import org.eclipse.jface.viewers.CheckboxTreeViewer; +import org.eclipse.jface.viewers.ICheckStateListener; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlContentProvider; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlLabelProvider; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CCombo; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; + +/** + *

+ * A composite for collecting information about UST events to be enabled. + *

+ * + * @author Bernd Hufmann + */ +public class EnableUstEventsComposite extends Composite implements IEnableUstEvents { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + private enum GroupEnum { TRACEPOINTS, WILDCARD, LOGLEVEL } + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * A button to enable/disable the tracepoints group + */ + private Button fTracepointsActivateButton; + /** + * A tree viewer for diplaying and selection of available tracepoints. + */ + private CheckboxTreeViewer fTracepointsViewer; + /** + * A button to enable/disable the wildcard group + */ + private Button fWildcardActivateButton; + /** + * A Text field for the event's wildcard. + */ + private Text fWildcardText; + /** + * A button to enable/disable the log level group + */ + private Button fLogLevelActivateButton; + /** + * A Text field for the event name for the log level enablement. + */ + private Text fLogLevelEventNameText; + /** + * A Combo box for selecting the log level. + */ + private CCombo fLogLevelCombo; + /** + * A button for selecting the log level (range 0 to level). + */ + private Button fLogLevelButton; + /** + * A button for selecting the specified log level only. + */ + private Button fLogLevelOnlyButton; + /** + * The filter text + */ + private Text fFilterText; + + /** + * The referenced trace provider group containing the UST providers + * component which contains a list of available tracepoints. + */ + private final TraceProviderGroup fProviderGroup; + /** + * The flag indicating that tracepoints are selected. + */ + private boolean fIsTracepoints; + /** + * The flag indicating that all tracepoints (across providers) are selected. + */ + private boolean fIsAllTracepoints; + /** + * The list of tracepoints to be enabled. + */ + private List fSelectedEvents; + /** + * The flag indicating that all wildcard are selected.. + */ + private boolean fIsWildcard; + /** + * The wildcard if wildcard is selected. + */ + private String fWildcard; + /** + *The flag indicating that all log level are selected. + */ + private boolean fIsLogLevel; + /** + * The event name for the log level enablement. + */ + private String fLogLevelEventName; + /** + * The type of the log level (loglevel or loglevel-only) + */ + private LogLevelType fLogLevelType; + /** + * The actual selected log level. + */ + private TraceLogLevel fLogLevel; + /** + * The filter expression + */ + private String fFilterExpression; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param parent - a parent composite + * @param style - a composite style + * @param providerGroup - the trace provider group + */ + public EnableUstEventsComposite(Composite parent, int style, TraceProviderGroup providerGroup) { + super(parent, style); + fProviderGroup = providerGroup; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public boolean isTracepoints() { + return fIsTracepoints; + } + + @Override + public boolean isAllTracePoints() { + return fIsAllTracepoints; + } + + @Override + public List getEventNames() { + return new ArrayList<>(fSelectedEvents); + } + + @Override + public boolean isWildcard() { + return fIsWildcard; + } + + @Override + public String getWildcard() { + return fWildcard; + } + + @Override + public boolean isLogLevel() { + return fIsLogLevel; + } + + @Override + public LogLevelType getLogLevelType() { + return fLogLevelType; + } + + @Override + public TraceLogLevel getLogLevel() { + return fLogLevel; + } + + @Override + public String getLogLevelEventName() { + return fLogLevelEventName; + } + + @Override + public String getFilterExpression() { + return fFilterExpression; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Create the contents of this event composite + */ + public void createContent() { + + // Tracepoints Group + createTracepointsGroup(); + + // Wildcard Group + createWildCardGroup(); + + // Log Level Group + createLogLevelGroup(); + + // Filter Group + createFilterGroup(); + + // Set default enablements + setEnablements(GroupEnum.TRACEPOINTS); + } + + /** + * Validates the UST composite input data. + * + * @return true if configured data is valid and can be retrieved. + */ + public boolean isValid() { + + fIsTracepoints = fTracepointsActivateButton.getSelection(); + fIsWildcard = fWildcardActivateButton.getSelection(); + fIsLogLevel = fLogLevelActivateButton.getSelection(); + + // initialize tracepoint fields + fIsAllTracepoints = false; + fSelectedEvents = new ArrayList<>(); + if (fIsTracepoints) { + fIsAllTracepoints = fTracepointsViewer.getChecked(fProviderGroup); + Set set = new HashSet<>(); + Object[] checkedElements = fTracepointsViewer.getCheckedElements(); + for (int i = 0; i < checkedElements.length; i++) { + ITraceControlComponent component = (ITraceControlComponent)checkedElements[i]; + if (!set.contains(component.getName()) && (component instanceof BaseEventComponent)) { + set.add(component.getName()); + fSelectedEvents.add(component.getName()); + } + } + } + + // initialize log level event name string + fLogLevelType = LogLevelType.LOGLEVEL_NONE; + fLogLevelEventName = null; + + if (fIsLogLevel) { + if (fLogLevelButton.getSelection()) { + fLogLevelType = LogLevelType.LOGLEVEL; + } else if (fLogLevelOnlyButton.getSelection()) { + fLogLevelType = LogLevelType.LOGLEVEL_ONLY; + } + + String temp = fLogLevelEventNameText.getText(); + if (temp.isEmpty() || + temp.matches("\\s*") || //$NON-NLS-1$ + (!temp.matches("^[\\s]{0,}$") && !temp.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$ + MessageDialog.openError(getShell(), + Messages.TraceControl_EnableEventsDialogTitle, + Messages.TraceControl_InvalidLogLevelEventNameError + " (" + temp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + + return false; + } + + fLogLevelEventName = temp; + + TraceLogLevel[] levels = TraceLogLevel.values(); + int id = fLogLevelCombo.getSelectionIndex(); + + if (id < 0) { + MessageDialog.openError(getShell(), + Messages.TraceControl_EnableEventsDialogTitle, + Messages.TraceControl_InvalidLogLevel + " (" + temp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + + return false; + } + fLogLevel = levels[id]; + } + + // initialize wildcard with null + fWildcard = null; + if (fIsWildcard) { + String tempWildcard = fWildcardText.getText(); + if (tempWildcard.isEmpty() || + tempWildcard.matches("\\s*") || //$NON-NLS-1$ + (!tempWildcard.matches("^[\\s]{0,}$") && !tempWildcard.matches("^[a-zA-Z0-9\\-\\_\\*]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$ + MessageDialog.openError(getShell(), + Messages.TraceControl_EnableEventsDialogTitle, + Messages.TraceControl_InvalidWildcardError + " (" + tempWildcard + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + + return false; + } + + fWildcard = tempWildcard; + } + + // initialize filter with null + fFilterExpression = null; + if (fProviderGroup.isEventFilteringSupported()) { + String tempFilter = fFilterText.getText(); + + if(!tempFilter.isEmpty() && !tempFilter.matches("\\s*")) { //$NON-NLS-1$ + fFilterExpression = tempFilter; + } + } + + // validation successful -> call super.okPressed() + return true; + } + + // ------------------------------------------------------------------------ + // Helper methods + // ------------------------------------------------------------------------ + + /** + * Creates tracepoints group. + */ + private void createTracepointsGroup() { + Group tpMainGroup = new Group(this, SWT.SHADOW_NONE); + tpMainGroup.setText(Messages.TraceControl_EnableEventsTracepointGroupName); + GridLayout layout = new GridLayout(2, false); + tpMainGroup.setLayout(layout); + GridData data = new GridData(GridData.FILL_BOTH); + tpMainGroup.setLayoutData(data); + + Composite buttonComposite = new Composite(tpMainGroup, SWT.NONE); + layout = new GridLayout(1, true); + buttonComposite.setLayout(layout); + data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); + buttonComposite.setLayoutData(data); + + fTracepointsActivateButton = new Button(buttonComposite, SWT.RADIO); + fTracepointsActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); + data = new GridData(GridData.FILL_HORIZONTAL); + fTracepointsActivateButton.setLayoutData(data); + fTracepointsActivateButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + setEnablements(GroupEnum.TRACEPOINTS); + } + }); + + Group tpGroup = new Group(tpMainGroup, SWT.SHADOW_NONE); + layout = new GridLayout(1, true); + tpGroup.setLayout(layout); + data = new GridData(GridData.FILL_BOTH); + tpGroup.setLayoutData(data); + new FilteredTree(tpGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, new PatternFilter(), true) { + @Override + protected TreeViewer doCreateTreeViewer(Composite aparent, int style) { + fTracepointsViewer = new CheckboxTreeViewer(aparent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + fTracepointsViewer.getTree().setToolTipText(Messages.TraceControl_EnableEventsTracepointTreeTooltip); + fTracepointsViewer.setContentProvider(new UstContentProvider()); + + fTracepointsViewer.setLabelProvider(new UstLabelProvider()); + fTracepointsViewer.addCheckStateListener(new UstCheckStateListener()); + + fTracepointsViewer.setInput(fProviderGroup.getParent()); + fTracepointsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH)); + return fTracepointsViewer; + } + }; + } + + /** + * Creates wildcard group. + */ + private void createWildCardGroup() { + Group wildcardMainGroup = new Group(this, SWT.SHADOW_NONE); + wildcardMainGroup.setText(Messages.TraceControl_EnableEventsWildcardGroupName); + GridLayout layout = new GridLayout(2, false); + wildcardMainGroup.setLayout(layout); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + wildcardMainGroup.setLayoutData(data); + + Composite buttonComposite = new Composite(wildcardMainGroup, SWT.NONE); + layout = new GridLayout(1, false); + buttonComposite.setLayout(layout); + data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); + buttonComposite.setLayoutData(data); + + fWildcardActivateButton = new Button(buttonComposite, SWT.RADIO); + fWildcardActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); + fWildcardActivateButton.setSelection(false); + data = new GridData(GridData.FILL_HORIZONTAL); + fWildcardActivateButton.setLayoutData(data); + fWildcardActivateButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + setEnablements(GroupEnum.WILDCARD); + } + }); + + Group wildcardGroup = new Group(wildcardMainGroup, SWT.SHADOW_NONE); + layout = new GridLayout(3, true); + wildcardGroup.setLayout(layout); + data = new GridData(GridData.FILL_HORIZONTAL); + wildcardGroup.setLayoutData(data); + + Label wildcardLabel = new Label(wildcardGroup, SWT.LEFT); + wildcardLabel.setText(Messages.TraceControl_EnableEventsWildcardLabel); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + wildcardLabel.setLayoutData(data); + + fWildcardText = new Text(wildcardGroup, SWT.LEFT); + fWildcardText.setToolTipText(Messages.TraceControl_EnableEventsWildcardTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 2; + fWildcardText.setLayoutData(data); + } + + /** + * Creates log level group. + */ + private void createLogLevelGroup() { + Group logLevelMainGroup = new Group(this, SWT.SHADOW_NONE); + logLevelMainGroup.setText(Messages.TraceControl_EnableEventsLogLevelGroupName); + GridLayout layout = new GridLayout(2, false); + logLevelMainGroup.setLayout(layout); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + logLevelMainGroup.setLayoutData(data); + + Composite buttonComposite = new Composite(logLevelMainGroup, SWT.NONE); + layout = new GridLayout(1, false); + buttonComposite.setLayout(layout); + data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true); + buttonComposite.setLayoutData(data); + + fLogLevelActivateButton = new Button(buttonComposite, SWT.RADIO); + fLogLevelActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName); + fLogLevelActivateButton.setSelection(false); + data = new GridData(GridData.FILL_HORIZONTAL); + fLogLevelActivateButton.setLayoutData(data); + fLogLevelActivateButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + setEnablements(GroupEnum.LOGLEVEL); + } + }); + + Group logLevelGroup = new Group(logLevelMainGroup, SWT.SHADOW_NONE); + layout = new GridLayout(3, true); + logLevelGroup.setLayout(layout); + logLevelGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + Label logLevelEventNameLabel = new Label(logLevelGroup, SWT.LEFT); + logLevelEventNameLabel.setText(Messages.TraceControl_EnableEventsEventNameLabel); + + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 1; + logLevelEventNameLabel.setLayoutData(data); + + fLogLevelEventNameText = new Text(logLevelGroup, SWT.LEFT); + fLogLevelEventNameText.setToolTipText(Messages.TraceControl_EnableEventsLoglevelEventNameTooltip); + data = new GridData(GridData.FILL_BOTH); + data.horizontalSpan = 2; + fLogLevelEventNameText.setLayoutData(data); + + TraceLogLevel[] levels = TraceLogLevel.values(); + + String[] levelNames = new String[levels.length - 1]; + int k = 0; + for (int i = 0; i < levels.length; i++) { + if (levels[i] != TraceLogLevel.LEVEL_UNKNOWN) { + levelNames[k++] = levels[i].getInName(); + } + } + + fLogLevelCombo = new CCombo(logLevelGroup, SWT.READ_ONLY); + fLogLevelCombo.setItems(levelNames); + fLogLevelCombo.setToolTipText(Messages.TraceControl_EnableEventsLogLevelTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 4; + fLogLevelCombo.setLayoutData(data); + + fLogLevelButton = new Button(logLevelGroup, SWT.RADIO); + fLogLevelButton.setText(Messages.TraceControl_EnableEventsLogLevelTypeName); + fLogLevelButton.setToolTipText(Messages.TraceControl_EnableEventsLogLevelTypeTooltip); + data = new GridData(GridData.FILL_BOTH); + fLogLevelButton.setLayoutData(data); + fLogLevelButton.setSelection(true); + + fLogLevelOnlyButton = new Button(logLevelGroup, SWT.RADIO); + fLogLevelOnlyButton.setText(Messages.TraceControl_EnableEventsLogLevelOnlyTypeName); + fLogLevelOnlyButton.setToolTipText(Messages.TraceControl_EnableEventsLogLevelOnlyTypeTooltip); + data = new GridData(GridData.FILL_BOTH); + fLogLevelButton.setLayoutData(data); + } + + void createFilterGroup() { + if (fProviderGroup.isEventFilteringSupported()) { + Group filterMainGroup = new Group(this, SWT.SHADOW_NONE); + filterMainGroup.setText(Messages.TraceControl_EnableEventsFilterGroupName); + GridLayout layout = new GridLayout(3, false); + filterMainGroup.setLayout(layout); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + filterMainGroup.setLayoutData(data); + + fFilterText = new Text(filterMainGroup, SWT.LEFT); + fFilterText.setToolTipText(Messages.TraceControl_EnableEventsFilterTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + fFilterText.setLayoutData(data); + } + } + + /** + * Enable/selects widgets depending on the group specified. + * @param group - group to enable. + */ + private void setEnablements(GroupEnum group) { + + // Enable/disable trace point items + fTracepointsActivateButton.setSelection(group == GroupEnum.TRACEPOINTS); + fTracepointsViewer.getTree().setEnabled(group == GroupEnum.TRACEPOINTS); + + // Enable/disable wildcard items + fWildcardActivateButton.setSelection(group == GroupEnum.WILDCARD); + fWildcardText.setEnabled(group == GroupEnum.WILDCARD); + + // Enable/disable log level items + fLogLevelActivateButton.setSelection(group == GroupEnum.LOGLEVEL); + fLogLevelEventNameText.setEnabled(group == GroupEnum.LOGLEVEL); + fLogLevelCombo.setEnabled(group == GroupEnum.LOGLEVEL); + fLogLevelButton.setEnabled(group == GroupEnum.LOGLEVEL); + fLogLevelOnlyButton.setEnabled(group == GroupEnum.LOGLEVEL); + } + + // ------------------------------------------------------------------------ + // Local classes + // ------------------------------------------------------------------------ + /** + * Content provider for the tracepoints tree. + */ + public static final class UstContentProvider extends TraceControlContentProvider { + @Override + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof TargetNodeComponent) { + List children = ((ITraceControlComponent)parentElement).getChildren(TraceProviderGroup.class); + return children.toArray(new ITraceControlComponent[children.size()]); + } + if (parentElement instanceof TraceProviderGroup) { + List children = ((ITraceControlComponent)parentElement).getChildren(UstProviderComponent.class); + return children.toArray(new ITraceControlComponent[children.size()]); + } + if (parentElement instanceof ITraceControlComponent) { + return ((ITraceControlComponent)parentElement).getChildren(); + } + return new Object[0]; + } + } + + /** + * Content label for the tracepoints tree. + */ + public static final class UstLabelProvider extends TraceControlLabelProvider { + @Override + public Image getImage(Object element) { + return null; + } + @Override + public String getText(Object element) { + if ((element != null) && (element instanceof TraceProviderGroup)) { + return Messages.TraceControl_EnableEventsTracepointTreeAllLabel; + } + + if ((element != null) && (element instanceof UstProviderComponent)) { + return Messages.TraceControl_EnableEventsTracepointTreeAllLabel + " - " + ((UstProviderComponent)element).getName(); //$NON-NLS-1$ + } + return super.getText(element); + } + } + + /** + * Check state listener for the tracepoints tree. + */ + public final class UstCheckStateListener implements ICheckStateListener { + @Override + public void checkStateChanged(CheckStateChangedEvent event) { + if (event.getChecked()) { + if (event.getElement() instanceof TraceProviderGroup) { + fTracepointsViewer.setSubtreeChecked(event.getElement(), true); + } + if (event.getElement() instanceof UstProviderComponent) { + fTracepointsViewer.setSubtreeChecked(event.getElement(), true); + } + } else { + if (event.getElement() instanceof TraceProviderGroup) { + fTracepointsViewer.setSubtreeChecked(event.getElement(), true); + } + if (event.getElement() instanceof UstProviderComponent) { + ITraceControlComponent component = (ITraceControlComponent) event.getElement(); + fTracepointsViewer.setSubtreeChecked(event.getElement(), false); + fTracepointsViewer.setChecked(component.getParent(), false); + } else { + ITraceControlComponent component = (ITraceControlComponent) event.getElement(); + fTracepointsViewer.setChecked(component.getParent(), false); + fTracepointsViewer.setChecked(component.getParent().getParent(), false); + } + } + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/GetEventInfoDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/GetEventInfoDialog.java new file mode 100644 index 0000000000..2ec434aeb0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/GetEventInfoDialog.java @@ -0,0 +1,281 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.Arrays; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CCombo; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +/** + *

+ * Dialog box for collecting information about the events to enable. + *

+ * + * @author Bernd Hufmann + */ +public class GetEventInfoDialog extends Dialog implements IGetEventInfoDialog { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The icon file for this dialog box. + */ + public static final String TARGET_NEW_CONNECTION_ICON_FILE = "icons/elcl16/enable_event.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The session combo box. + */ + private CCombo fSessionsCombo = null; + /** + * The channel combo box. + */ + private CCombo fChannelsCombo = null; + /** + * The filter text + */ + private Text fFilterText; + /** + * The list of available sessions. + */ + private TraceSessionComponent[] fSessions; + /** + * True for kernel, false for UST. + */ + private boolean fIsKernel; + /** + * Index in session array (selected session). + */ + private int fSessionIndex = 0; + /** + * The Channel where the events should be enabled. + */ + private TraceChannelComponent fChannel; + /** + * List of available channels of the selected session. + */ + private TraceChannelComponent[] fChannels; + /** + * The filter expression + */ + private String fFilterExpression; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor of dialog box. + * @param shell - the shell for the dialog box + */ + public GetEventInfoDialog(Shell shell) { + super(shell); + setShellStyle(SWT.RESIZE | getShellStyle()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public TraceSessionComponent getSession() { + return fSessions[fSessionIndex]; + } + + @Override + public TraceChannelComponent getChannel() { + return fChannel; + } + + @Override + public void setIsKernel(boolean isKernel) { + fIsKernel = isKernel; + } + + @Override + public void setSessions(TraceSessionComponent[] sessions) { + fSessions = Arrays.copyOf(sessions, sessions.length); + } + + @Override + public String getFilterExpression() { + return fFilterExpression; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(Messages.TraceControl_EnableEventsDialogTitle); + newShell.setImage(Activator.getDefault().loadIcon(TARGET_NEW_CONNECTION_ICON_FILE)); + } + + @Override + protected Control createDialogArea(Composite parent) { + + // Main dialog panel + Composite dialogComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + dialogComposite.setLayout(layout); + dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + Group sessionsGroup = new Group(dialogComposite, SWT.SHADOW_NONE); + sessionsGroup.setText(Messages.TraceControl_EnableEventsSessionGroupName); + layout = new GridLayout(1, true); + sessionsGroup.setLayout(layout); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + sessionsGroup.setLayoutData(data); + + fSessionsCombo = new CCombo(sessionsGroup, SWT.READ_ONLY); + fSessionsCombo.setToolTipText(Messages.TraceControl_EnableEventsSessionsTooltip); + fSessionsCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + String items[] = new String[fSessions.length]; + for (int i = 0; i < items.length; i++) { + items[i] = String.valueOf(fSessions[i].getName()); + } + + fSessionsCombo.setItems(items); + fSessionsCombo.setEnabled(fSessions.length > 0); + + Group channelsGroup = new Group(dialogComposite, SWT.SHADOW_NONE); + channelsGroup.setText(Messages.TraceControl_EnableEventsChannelGroupName); + layout = new GridLayout(1, true); + channelsGroup.setLayout(layout); + data = new GridData(GridData.FILL_HORIZONTAL); + channelsGroup.setLayoutData(data); + + fChannelsCombo = new CCombo(channelsGroup, SWT.READ_ONLY); + fChannelsCombo.setToolTipText(Messages.TraceControl_EnableEventsChannelsTooltip); + fChannelsCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + fChannelsCombo.setEnabled(false); + + fSessionsCombo.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + fSessionIndex = fSessionsCombo.getSelectionIndex(); + + if (fSessionIndex >= 0) { + TraceDomainComponent domain = null; + TraceDomainComponent[] domains = fSessions[fSessionIndex].getDomains(); + for (int i = 0; i < domains.length; i++) { + + if (domains[i].isKernel() == fIsKernel) { + domain = domains[i]; + break; + } + } + + if (domain != null) { + fChannels = domain.getChannels(); + String selectionItems[] = new String[fChannels.length]; + for (int i = 0; i < selectionItems.length; i++) { + selectionItems[i] = String.valueOf(fChannels[i].getName()); + } + fChannelsCombo.setItems(selectionItems); + fChannelsCombo.setEnabled(fChannels.length > 0); + } else { + fChannelsCombo.setItems(new String[0]); + fChannelsCombo.setEnabled(false); + fChannels = null; + } + fChannelsCombo.getParent().getParent().layout(); + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + // take first session to test whether events filtering is supported or not + if (fSessions[0].isEventFilteringSupported() && !fIsKernel) { + Group filterMainGroup = new Group(dialogComposite, SWT.SHADOW_NONE); + filterMainGroup.setText(Messages.TraceControl_EnableEventsFilterGroupName); + layout = new GridLayout(2, false); + filterMainGroup.setLayout(layout); + data = new GridData(GridData.FILL_HORIZONTAL); + filterMainGroup.setLayoutData(data); + + fFilterText = new Text(filterMainGroup, SWT.LEFT); + fFilterText.setToolTipText(Messages.TraceControl_EnableEventsFilterTooltip); + data = new GridData(GridData.FILL_HORIZONTAL); + fFilterText.setLayoutData(data); + } + + getShell().setMinimumSize(new Point(300, 200)); + + return dialogComposite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ + createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ + } + + @Override + protected void okPressed() { + + if (fSessionsCombo.getSelectionIndex() < 0) { + MessageDialog.openError(getShell(), + Messages.TraceControl_EnableEventsDialogTitle, + Messages.TraceControl_EnableEventsNoSessionError); + return; + } + + fSessionIndex = fSessionsCombo.getSelectionIndex(); + + // if no channel is available or no channel is selected use default channel indicated by fChannel=null + fChannel = null; + if ((fChannels != null) && (fChannelsCombo.getSelectionIndex() >= 0)) { + fChannel = fChannels[fChannelsCombo.getSelectionIndex()]; + } + + // initialize filter with null + fFilterExpression = null; + if (fSessions[0].isEventFilteringSupported() && !fIsKernel) { + String tempFilter = fFilterText.getText(); + + if(!tempFilter.isEmpty() && !tempFilter.matches("\\s*")) { //$NON-NLS-1$ + fFilterExpression = tempFilter; + } + } + + super.okPressed(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IAddContextDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IAddContextDialog.java new file mode 100644 index 0000000000..b65c3ba29f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IAddContextDialog.java @@ -0,0 +1,47 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.List; + +/** + *

+ * Interface for providing information about contexts to be added to channels/events. + *

+ * + * @author Bernd Hufmann + */ +public interface IAddContextDialog { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * Sets the available contexts to choose from. + * @param contexts - a list of available contexts. + */ + void setAvalibleContexts(List contexts); + + /** + * @return array of contexts to be added + */ + List getContexts(); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * @return returns the open return value + */ + int open(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IConfirmDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IConfirmDialog.java new file mode 100644 index 0000000000..4c36519cee --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IConfirmDialog.java @@ -0,0 +1,38 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.swt.widgets.Shell; + +/** + *

+ * Interface for a confirmation dialog. + *

+ * + * @author Bernd Hufmann + */ +public interface IConfirmDialog { + + /** + * Open a confirmation dialog + * + * @param parent + * The parent shell + * @param title + * The title of the dialog window + * @param message + * The message in the dialog window + * @return If the user clicked OK (true) or Cancel (false) + */ + boolean openConfirm(Shell parent, String title, String message); + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ICreateSessionDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ICreateSessionDialog.java new file mode 100644 index 0000000000..c2c914755b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ICreateSessionDialog.java @@ -0,0 +1,52 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; + +/** + *

+ * Interface for create session dialog. + *

+ * + * @author Bernd Hufmann + */ +public interface ICreateSessionDialog { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * Get the parameters necessary for the creation of a LTTng session + * + * @return the parameters + */ + ISessionInfo getParameters(); + + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * Initializes the dialog box. + * @param group - the session group + */ + void initialize(TraceSessionGroup group); + + /** + * @return the open return value + */ + int open(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableChannelDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableChannelDialog.java new file mode 100644 index 0000000000..b0aad194fc --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableChannelDialog.java @@ -0,0 +1,65 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; + +/** + *

+ * Interface for the enable channel dialog when domain is known. + *

+ * + * @author Bernd Hufmann + */ +public interface IEnableChannelDialog { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return the configuration info for the new channel. + */ + IChannelInfo getChannelInfo(); + + /** + * Sets the domain component + * @param domain - the trace domain component + */ + void setDomainComponent(TraceDomainComponent domain); + + /** + * Set the targent node component + * @param node - the node component + */ + void setTargetNodeComponent(TargetNodeComponent node); + + /** + * @return true for Kernel domain. False for UST. + */ + boolean isKernel(); + + /** + * Sets the whether dialog is for Kernel or UST + * @param isKernel true for kernel domain else UST + */ + void setHasKernel(boolean isKernel); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * @return the open return value + */ + int open(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableEventsDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableEventsDialog.java new file mode 100644 index 0000000000..90ac9b4cf5 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableEventsDialog.java @@ -0,0 +1,53 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; + +/** + *

+ * Interface for providing information about Kernel or UST events to be enabled. + *

+ * + * @author Bernd Hufmann + */ +public interface IEnableEventsDialog extends IEnableKernelEvents, IEnableUstEvents { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return the session the events shall be enabled. + */ + boolean isKernel(); + + /** + * Sets the trace provider group. + * @param providerGroup - a trace provider group + */ + void setTraceProviderGroup(TraceProviderGroup providerGroup); + + /** + * Sets the trace domain component. + * @param domain - a domain of the events (null if not known) + */ + void setTraceDomainComponent(TraceDomainComponent domain); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * @return returns the open return value + */ + int open(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java new file mode 100644 index 0000000000..66a8f59f8f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableKernelEvents.java @@ -0,0 +1,84 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.List; + +/** + *

+ * Interface for providing information about kernel events to be enabled. + *

+ * + * @author Bernd Hufmann + */ +public interface IEnableKernelEvents { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * @return a flag whether the tracepoints shall be configured. + */ + boolean isTracepoints(); + + /** + * @return a flag indicating whether all tracepoints shall be enabled or not. + */ + boolean isAllTracePoints(); + + /** + * @return a flag whether the syscalls shall be configured. + */ + boolean isSysCalls(); + + /** + * @return a flag indicating whether syscalls shall be enabled or not. + */ + boolean isAllSysCalls(); + + /** + * @return a list of event names to be enabled. + */ + List getEventNames(); + + /** + * @return a flag whether the dynamic probe shall be configured. + */ + boolean isDynamicProbe(); + + /** + * @return event name of the dynamic probe (or null if no dynamic probe). + */ + String getProbeEventName(); + + /** + * @return the dynamic probe (or null if no dynamic probe). + */ + String getProbeName(); + + /** + * @return a flag whether the dynamic function entry/return probe shall be configured. + */ + boolean isDynamicFunctionProbe(); + + /** + * @return event name of the dynamic function entry/exit probe (or null if no dynamic probe). + */ + String getFunctionEventName(); + + /** + * @return the dynamic function entry/exit probe (or null if no dynamic probe). + */ + String getFunction(); + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableUstEvents.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableUstEvents.java new file mode 100644 index 0000000000..dfe72fb63d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IEnableUstEvents.java @@ -0,0 +1,83 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; + +/** + *

+ * Interface for providing information about UST events to be enabled. + *

+ * + * @author Bernd Hufmann + */ +public interface IEnableUstEvents { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * @return a flag whether the tracepoints shall be configured. + */ + boolean isTracepoints(); + + /** + * @return a flag indicating whether all tracepoints shall be enabled or not. + */ + boolean isAllTracePoints(); + + /** + * @return a list of event names to be enabled. + */ + List getEventNames(); + + /** + * @return a flag whether events using wildcards should be enabled + */ + boolean isWildcard(); + + /** + * @return a wildcard + */ + String getWildcard(); + + /** + * @return a flag whether events using log levels should be enabled + */ + boolean isLogLevel(); + + /** + * @return a log level type (loglevel or loglevel-only) + */ + LogLevelType getLogLevelType(); + + /** + * @return a log level + */ + TraceLogLevel getLogLevel(); + + /** + * @return a event name for the log level enable action + */ + String getLogLevelEventName(); + + /** + * @return a filter expression + */ + String getFilterExpression(); + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IGetEventInfoDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IGetEventInfoDialog.java new file mode 100644 index 0000000000..c61a7fe878 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IGetEventInfoDialog.java @@ -0,0 +1,65 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; + +/** + *

+ * Interface for a dialog box for collecting information about the events to enable. + *

+ * + * @author Bernd Hufmann + */ +public interface IGetEventInfoDialog { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return the session the events shall be enabled. + */ + TraceSessionComponent getSession(); + + /** + * @return the channel the events shall be enabled. Null for default channel. + */ + TraceChannelComponent getChannel(); + + /** + * Sets flag about domain. + * @param isKernel - true for kernel, false for UST + */ + void setIsKernel(boolean isKernel); + + /** + * Sets available session. + * @param sessions - a array of available sessions. + */ + void setSessions(TraceSessionComponent[] sessions); + + /** + * Returns the filter expression. + * @return the filter expression or null for no filtering + */ + String getFilterExpression(); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * @return returns the open return value + */ + int open(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportConfirmationDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportConfirmationDialog.java new file mode 100644 index 0000000000..59884073c1 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportConfirmationDialog.java @@ -0,0 +1,49 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +/** + *

+ * Interface for dialog box for updating file import information. + *

+ * + * @author Bernd Hufmann + */ +public interface IImportConfirmationDialog { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @param name old trace name. + */ + void setTraceName(String name); + + /** + * @return the new trace name if not overwrite. + */ + String getNewTraceName(); + + /** + * + * @return true to overwrite existing trace. + */ + boolean isOverwrite(); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * @return the open return value + */ + int open(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportDialog.java new file mode 100644 index 0000000000..170b021033 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/IImportDialog.java @@ -0,0 +1,63 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.List; + +import org.eclipse.core.resources.IProject; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; + +/** + *

+ * Interface for import traces dialog. + *

+ * + * @author Bernd Hufmann + */ +public interface IImportDialog { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return a list of trace paths to import. + */ + List getTracePathes(); + + /** + * @return the project to import the traces to + */ + IProject getProject(); + + /** + * Sets the session containing the traces to import + * @param session The trace session + */ + void setSession(TraceSessionComponent session); + + /** + * Sets the default project name to use + * + * @param defaultProject + * the name of the default project to use + */ + void setDefaultProject(String defaultProject); + + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * @return the open return value + */ + int open(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/INewConnectionDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/INewConnectionDialog.java new file mode 100644 index 0000000000..1bdb9a2019 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/INewConnectionDialog.java @@ -0,0 +1,69 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.rse.core.model.IHost; + +/** + *

+ * Interface for connection information dialog. + *

+ * + * @author Bernd Hufmann + */ +public interface INewConnectionDialog { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return the connection name (alias). + */ + String getConnectionName(); + + /** + * @return the host name (IP address or DNS name) + */ + String getHostName(); + + /** + * @return port of IP connection to be used + */ + int getPort(); + + /** + * Sets the trace control root + * @param parent - the trace control parent + */ + void setTraceControlParent(ITraceControlComponent parent); + + /** + * Sets the available hosts to select. + * @param hosts - the available hosts + */ + void setHosts(IHost[] hosts); + + /** + * Set the port of the IP connection to be used. + * @param port - the IP port to set + */ + void setPort(int port); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * @return returns the open return value + */ + int open(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ISelectCommandScriptDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ISelectCommandScriptDialog.java new file mode 100644 index 0000000000..15dd52e9f3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ISelectCommandScriptDialog.java @@ -0,0 +1,32 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.List; + +/** + * Interface for dialog for selecting a command script. + * + * @author Bernd Hufmann + * + */ +public interface ISelectCommandScriptDialog { + /** + * @return a list of command + */ + List getCommands(); + + /** + * @return the open return value + */ + int open(); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportConfirmationDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportConfirmationDialog.java new file mode 100644 index 0000000000..d58d8234d3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportConfirmationDialog.java @@ -0,0 +1,200 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +/** + *

+ * Dialog box for collecting session creation information. + *

+ * + * @author Bernd Hufmann + */ +public class ImportConfirmationDialog extends Dialog implements IImportConfirmationDialog { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The icon file for this dialog box. + */ + public static final String IMPORT_ICON_FILE = "icons/elcl16/import_trace.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The radio button for selecting the overwrite action + */ + private Button fOverwriteButton = null; + /** + * The radio button for selecting the renaming action + */ + private Button fRenameButton = null; + /** + * The text widget for the session name + */ + private Text fNewTraceNameText = null; + /** + * The trace name which already exists in the project + */ + private String fTraceName = null; + /** + * The session name string. + */ + private String fNewTraceName = null; + /** + * Flag whether default location (path) shall be used or not + */ + private boolean fIsOverride = true; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param shell - a shell for the display of the dialog + */ + public ImportConfirmationDialog(Shell shell) { + super(shell); + setShellStyle(SWT.RESIZE | getShellStyle()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public void setTraceName(String name) { + fTraceName = name; + } + + @Override + public String getNewTraceName() { + return fNewTraceName; + } + + @Override + public boolean isOverwrite() { + return fIsOverride; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(Messages.TraceControl_ImportDialogConfirmationTitle); + newShell.setImage(Activator.getDefault().loadIcon(IMPORT_ICON_FILE)); + } + + @Override + protected Control createDialogArea(Composite parent) { + + // Main dialog panel + Composite dialogComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + dialogComposite.setLayout(layout); + dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + Label sessionNameLabel = new Label(dialogComposite, SWT.RIGHT); + sessionNameLabel.setText(Messages.TraceControl_ImportDialogTraceAlreadyExistError + ": " + fTraceName); //$NON-NLS-1$ + + fOverwriteButton = new Button(dialogComposite, SWT.RADIO); + fOverwriteButton.setText(Messages.TraceControl_ImportDialogConfirmationOverwriteLabel); + + fOverwriteButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + fNewTraceNameText.setEnabled(false); + fNewTraceNameText.setText(fTraceName); + } + }); + + fRenameButton = new Button(dialogComposite, SWT.RADIO); + fRenameButton.setText(Messages.TraceControl_ImportDialogConfirmationRenameLabel); + + fRenameButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + fNewTraceNameText.setEnabled(true); + } + }); + + fNewTraceNameText = new Text(dialogComposite, SWT.NONE); + fNewTraceNameText.setToolTipText(Messages.TraceControl_ImportDialogConfirmationNewNameLabel); + fNewTraceNameText.setText(fTraceName); + + // Default + fOverwriteButton.setSelection(true); + fNewTraceNameText.setEnabled(false); + + + // layout widgets + GridData data = new GridData(GridData.FILL_HORIZONTAL); + + fNewTraceNameText.setLayoutData(data); + + getShell().setMinimumSize(new Point(300, 150)); + + return dialogComposite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ + createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ + } + + @Override + protected void okPressed() { + + fIsOverride = fOverwriteButton.getSelection(); + + if (fIsOverride) { + // new name is old name + fNewTraceName = fTraceName; + } else { + fNewTraceName = fNewTraceNameText.getText(); + } + + // Check for invalid names + if (!fNewTraceName.matches("^[a-zA-Z0-9\\-\\_]{1,}$")) { //$NON-NLS-1$ + MessageDialog.openError(getShell(), + Messages.TraceControl_ImportDialogConfirmationTitle, + Messages.TraceControl_InvalidTraceNameError + " (" + fNewTraceName + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$ + return; + } + + // validation successful -> call super.okPressed() + super.okPressed(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportDialog.java new file mode 100644 index 0000000000..70a9f3cc60 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportDialog.java @@ -0,0 +1,453 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Added handling of streamed traces + * Marc-Andre Laperle - Use common method to get opened tmf projects + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.CheckStateChangedEvent; +import org.eclipse.jface.viewers.CheckboxTreeViewer; +import org.eclipse.jface.viewers.ICheckStateListener; +import org.eclipse.jface.window.Window; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; +import org.eclipse.linuxtools.tmf.ui.project.model.TmfTracesFolder; +import org.eclipse.linuxtools.tmf.ui.project.model.TraceUtils; +import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; +import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; +import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CCombo; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.ui.model.WorkbenchContentProvider; +import org.eclipse.ui.model.WorkbenchLabelProvider; + +/** + *

+ * Dialog box for collecting trace import information. + *

+ * + * @author Bernd Hufmann + */ +public class ImportDialog extends Dialog implements IImportDialog { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** The icon file for this dialog box. */ + public static final String IMPORT_ICON_FILE = "icons/elcl16/import_trace.gif"; //$NON-NLS-1$ + + /** Parent directory for UST traces */ + public static final String UST_PARENT_DIRECTORY = "ust"; //$NON-NLS-1$ + + /** Name of metadata file of trace */ + public static final String METADATA_FILE_NAME = "metadata"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The dialog composite. + */ + private Composite fDialogComposite = null; + /** + * The checkbox tree viewer for selecting available traces + */ + private CheckboxTreeViewer fFolderViewer; + /** + * The combo box for selecting a project. + */ + private CCombo fCombo; + /** + * The overwrite button + */ + private Button fOverwriteButton; + /** + * List of available LTTng 2.0 projects + */ + private List fProjects; + /** + * The parent where the new node should be added. + */ + private TraceSessionComponent fSession = null; + /** + * The name of the default project name + */ + private String fDefaultProjectName = null; + /** + * List of traces to import + */ + private final List fTraces = new ArrayList<>(); + /** + * Selection index in project combo box. + */ + private int fProjectIndex; + /** + * Flag to indicate that something went wrong when creating the dialog box. + */ + private boolean fIsError = false; + /** + * Children of the remote folder (can be null) + */ + private Object[] fFolderChildren = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param shell - a shell for the display of the dialog + */ + public ImportDialog(Shell shell) { + super(shell); + setShellStyle(SWT.RESIZE | getShellStyle()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public List getTracePathes() { + List retList = new ArrayList<>(); + retList.addAll(fTraces); + return retList; + } + + @Override + public IProject getProject() { + return fProjects.get(fProjectIndex); + } + + @Override + public void setSession(TraceSessionComponent session) { + fSession = session; + } + + @Override + public void setDefaultProject(String defaultProject) { + fDefaultProjectName = defaultProject; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(Messages.TraceControl_ImportDialogTitle); + newShell.setImage(Activator.getDefault().loadIcon(IMPORT_ICON_FILE)); + } + + @Override + protected Control createDialogArea(Composite parent) { + + // Main dialog panel + fDialogComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + fDialogComposite.setLayout(layout); + fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + try { + createRemoteComposite(); + } catch (SystemMessageException e) { + createErrorComposite(parent, e.fillInStackTrace()); + return fDialogComposite; + } + return fDialogComposite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + Button selectAllButton = createButton(parent, IDialogConstants.SELECT_ALL_ID, Messages.TraceControl_ImportDialog_SelectAll, true); + selectAllButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + setFolderChildrenChecked(true); + } + }); + + Button deselectAllButton = createButton(parent, IDialogConstants.DESELECT_ALL_ID, Messages.TraceControl_ImportDialog_DeselectAll, true); + deselectAllButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + setFolderChildrenChecked(false); + } + }); + createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); + createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); + updateOKButtonEnablement(); + } + + @Override + protected void okPressed() { + if (!fIsError) { + + // Validate input data + fTraces.clear(); + + fProjectIndex = fCombo.getSelectionIndex(); + + if (fProjectIndex < 0) { + MessageDialog.openError(getShell(), + Messages.TraceControl_ImportDialogTitle, + Messages.TraceControl_ImportDialogNoProjectSelectedError); + return; + } + + IProject project = fProjects.get(fProjectIndex); + IFolder traceFolder = project.getFolder(TmfTracesFolder.TRACES_FOLDER_NAME); + + if (!traceFolder.exists()) { + // Invalid LTTng 2.0 project + MessageDialog.openError(getShell(), + Messages.TraceControl_ImportDialogTitle, + Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTracesFolder.TRACES_FOLDER_NAME + ")"); //$NON-NLS-1$//$NON-NLS-2$ + return; + } + + boolean overwriteAll = fOverwriteButton.getSelection(); + + Object[] checked = fFolderViewer.getCheckedElements(); + for (int i = 0; i < checked.length; i++) { + IRemoteFile file = (IRemoteFile) checked[i]; + if (!file.isDirectory() && file.getName().equals(METADATA_FILE_NAME)) { + IRemoteFile trace = file.getParentRemoteFile(); + IRemoteFile parent = trace.getParentRemoteFile(); + + String path = fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getSnapshotPath() : fSession.getSessionPath(); + path = getUnifiedPath(path); + IPath sessionParentPath = new Path(path).removeLastSegments(1); + IPath traceParentPath = new Path(parent.getAbsolutePath()); + + IPath relativeTracePath = traceParentPath.makeRelativeTo(sessionParentPath); + + IFolder destinationFolder = traceFolder.getFolder(new Path(relativeTracePath.toOSString())); + + ImportFileInfo info = new ImportFileInfo(trace, trace.getName(), destinationFolder, overwriteAll); + IFolder folder = destinationFolder.getFolder(trace.getName()); + + // Verify if trace directory already exists (and not overwrite) + if (folder.exists() && !overwriteAll) { + + // Ask user for overwrite or new name + IImportConfirmationDialog conf = TraceControlDialogFactory.getInstance().getImportConfirmationDialog(); + conf.setTraceName(trace.getName()); + + // Don't add trace to list if dialog was cancelled. + if (conf.open() == Window.OK) { + info.setOverwrite(conf.isOverwrite()); + if (!conf.isOverwrite()) { + info.setLocalTraceName(conf.getNewTraceName()); + } + fTraces.add(info); + } + } else { + fTraces.add(info); + } + } + } + + if (fTraces.isEmpty()) { + MessageDialog.openError(getShell(), + Messages.TraceControl_ImportDialogTitle, + Messages.TraceControl_ImportDialogNoTraceSelectedError); + return; + } + } + + // validation successful -> call super.okPressed() + super.okPressed(); + } + + // ------------------------------------------------------------------------ + // Helper methods and classes + // ------------------------------------------------------------------------ + + /** + * Helper class for the contents of a folder in a tracing project + * + * @author Bernd Hufmann + */ + public static class FolderContentProvider extends WorkbenchContentProvider { + @Override + public Object[] getChildren(Object o) { + if (o instanceof IRemoteFile) { + IRemoteFile element = (IRemoteFile) o; + // For our purpose, we need folders + files + if (!element.isDirectory()) { + return new Object[0]; + } + } + return super.getChildren(o); + } + } + + /** + * Creates a dialog composite with an error message which can be used + * when an exception occurred during creation time of the dialog box. + * @param parent - a parent composite + * @param e - a error causing exception + */ + private void createErrorComposite(Composite parent, Throwable e) { + fIsError = true; + fDialogComposite.dispose(); + + fDialogComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + fDialogComposite.setLayout(layout); + fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + Text errorText = new Text(fDialogComposite, SWT.MULTI); + StringBuffer error = new StringBuffer(); + error.append(Messages.TraceControl_ImportDialogCreationError); + error.append(System.getProperty("line.separator")); //$NON-NLS-1$ + error.append(System.getProperty("line.separator")); //$NON-NLS-1$ + error.append(e.toString()); + errorText.setText(error.toString()); + errorText.setLayoutData(new GridData(GridData.FILL_BOTH)); + } + + private void createRemoteComposite() throws SystemMessageException{ + Group contextGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); + contextGroup.setText(Messages.TraceControl_ImportDialogTracesGroupName); + GridLayout layout = new GridLayout(1, true); + contextGroup.setLayout(layout); + contextGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); + + IRemoteSystemProxy proxy = fSession.getTargetNode().getRemoteSystemProxy(); + + IFileServiceSubSystem fsss = proxy.getFileServiceSubSystem(); + + final String path = fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getSnapshotPath() : fSession.getSessionPath(); + final IRemoteFile remoteFolder = fsss.getRemoteFileObject(path, new NullProgressMonitor()); + // make sure that remote directory is read and not cached + remoteFolder.markStale(true, true); + + fFolderViewer = new CheckboxTreeViewer(contextGroup, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); + GridData data = new GridData(GridData.FILL_BOTH); + Tree tree = fFolderViewer.getTree(); + tree.setLayoutData(data); + tree.setFont(fDialogComposite.getFont()); + tree.setToolTipText(Messages.TraceControl_ImportDialogTracesTooltip); + + fFolderViewer.setContentProvider(new FolderContentProvider()); + fFolderViewer.setLabelProvider(new WorkbenchLabelProvider()); + + fFolderViewer.addCheckStateListener(new ICheckStateListener() { + @Override + public void checkStateChanged(CheckStateChangedEvent event) { + Object elem = event.getElement(); + if (elem instanceof IRemoteFile) { + IRemoteFile element = (IRemoteFile) elem; + if (!element.isDirectory()) { + // A trick to keep selection of a file in sync with the directory + boolean p = fFolderViewer.getChecked((element.getParentRemoteFile())); + fFolderViewer.setChecked(element, p); + } else { + fFolderViewer.setSubtreeChecked(event.getElement(), event.getChecked()); + if (!event.getChecked()) { + fFolderViewer.setChecked(element.getParentRemoteFile(), false); + } + } + updateOKButtonEnablement(); + } + } + }); + fFolderViewer.setInput(remoteFolder); + + fFolderChildren = remoteFolder.getContents(RemoteChildrenContentsType.getInstance()); + // children can be null if there the path doesn't exist. This happens when a trace + // session hadn't been started and no output was created. + setFolderChildrenChecked(true); + + Group projectGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); + projectGroup.setText(Messages.TraceControl_ImportDialogProjectsGroupName); + layout = new GridLayout(1, true); + projectGroup.setLayout(layout); + projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + fProjects = new ArrayList<>(); + List projectNames = new ArrayList<>(); + + for (IProject project : TraceUtils.getOpenedTmfProjects()) { + fProjects.add(project); + projectNames.add(project.getName()); + } + + fCombo = new CCombo(projectGroup, SWT.READ_ONLY); + fCombo.setToolTipText(Messages.TraceControl_ImportDialogProjectsTooltip); + fCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1)); + fCombo.setItems(projectNames.toArray(new String[projectNames.size()])); + + if (fDefaultProjectName != null) { + int select = projectNames.indexOf(fDefaultProjectName); + fCombo.select(select); + } + + Group overrideGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); + layout = new GridLayout(1, true); + overrideGroup.setLayout(layout); + overrideGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + fOverwriteButton = new Button(overrideGroup, SWT.CHECK); + fOverwriteButton.setText(Messages.TraceControl_ImportDialogOverwriteButtonText); + getShell().setMinimumSize(new Point(500, 400)); + } + + private void setFolderChildrenChecked(boolean isChecked) { + if (fFolderChildren != null) { + for (Object child : fFolderChildren) { + fFolderViewer.setSubtreeChecked(child, isChecked); + } + } + updateOKButtonEnablement(); + } + + private void updateOKButtonEnablement() { + Object[] checked = fFolderViewer.getCheckedElements(); + Button okButton = getButton(IDialogConstants.OK_ID); + if (okButton != null) { + okButton.setEnabled(checked.length > 0); + } + } + + private static String getUnifiedPath(String path) { + // Use Path class to remove unnecessary slashes + return new Path(path).removeTrailingSeparator().toString(); + } + } diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportFileInfo.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportFileInfo.java new file mode 100644 index 0000000000..73db884387 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/ImportFileInfo.java @@ -0,0 +1,127 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.core.resources.IFolder; +import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; + +/** + *

+ * Helper class for storing information about a remote file to import. + *

+ * + * @author Bernd Hufmann + */ +public class ImportFileInfo { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * Remote file reference + */ + private IRemoteFile fRemoteFile; + /** + * Local Trace Name + */ + private String fLocalTraceName; + /** + * Global overwrite flag + */ + private boolean fIsOverwrite; + /** + * Destination folder to import the trace to (full workspace path) + */ + private IFolder fDestinationFolder; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Standard constructor + * + * @param file + * A remote file reference + * @param traceName + * A trace name + * @param destinationFolder + * The destination folder (full workspace path) + * @param isOverwrite + * global overwrite flag + */ + public ImportFileInfo(IRemoteFile file, String traceName, IFolder destinationFolder, boolean isOverwrite) { + fRemoteFile = file; + fLocalTraceName = traceName; + fDestinationFolder = destinationFolder; + fIsOverwrite = isOverwrite; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return name of traces after importing + */ + public String getLocalTraceName() { + return fLocalTraceName; + } + + /** + * Sets the local trace name + * + * @param importTraceName + * - local name of trace to set (name after importing) + */ + public void setLocalTraceName(String importTraceName) { + this.fLocalTraceName = importTraceName; + } + /** + * @return true if local trace should be overwritten if a trace with the same name already exists. + */ + public boolean isOverwrite() { + return fIsOverwrite; + } + /** + * Sets the overwrite flag. + * @param isOverwrite If the Overwrite checkbox is checked or not + */ + public void setOverwrite(boolean isOverwrite) { + this.fIsOverwrite = isOverwrite; + } + + /** + * @return the remote file implementation. + */ + public IRemoteFile getImportFile() { + return fRemoteFile; + } + + /** + * Sets the remote file implementation + * + * @param remoteFile + * The remote file implementation. + */ + public void setRemoteFile(IRemoteFile remoteFile) { + fRemoteFile = remoteFile; + } + + /** + * Returns the destination folder to import the trace to (full workspace path). + * + * @return destination folder + */ + public IFolder getDestinationFolder() { + return fDestinationFolder; + } +} + diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/NewConnectionDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/NewConnectionDialog.java new file mode 100644 index 0000000000..24c6f74f55 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/NewConnectionDialog.java @@ -0,0 +1,321 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.util.Arrays; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CCombo; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.events.VerifyEvent; +import org.eclipse.swt.events.VerifyListener; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +/** + *

+ * Dialog box for connection information. + *

+ * + * @author Bernd Hufmann + */ +public class NewConnectionDialog extends Dialog implements INewConnectionDialog { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The icon file for this dialog box. + */ + public static final String TARGET_NEW_CONNECTION_ICON_FILE = "icons/elcl16/target_add.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The host combo box. + */ + private CCombo fExistingHostsCombo = null; + /** + * The check box button for enabling/disabling the text input. + */ + private Button fButton = null; + /** + * The text widget for the node name (alias) + */ + private Text fConnectionNameText = null; + /** + * The text widget for the node address (IP or DNS name) + */ + private Text fHostNameText = null; + /** + * The text widget for the IP port + */ + private Text fPortText = null; + /** + * The parent where the new node should be added. + */ + private ITraceControlComponent fParent; + /** + * The node name (alias) string. + */ + private String fConnectionName = null; + /** + * The node address (IP or DNS name) string. + */ + private String fHostName = null; + /** + * The IP port of the connection. + */ + private int fPort = IRemoteSystemProxy.INVALID_PORT_NUMBER; + /** + * Input list of existing RSE hosts available for selection. + */ + private IHost[] fExistingHosts = new IHost[0]; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * + * @param shell + * The shell + */ + public NewConnectionDialog(Shell shell) { + super(shell); + setShellStyle(SWT.RESIZE | getShellStyle()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public String getConnectionName() { + return fConnectionName; + } + + @Override + public String getHostName() { + return fHostName; + } + + @Override + public int getPort() { + return fPort; + } + + @Override + public void setTraceControlParent(ITraceControlComponent parent) { + fParent = parent; + } + + @Override + public void setHosts(IHost[] hosts) { + if (hosts != null) { + fExistingHosts = Arrays.copyOf(hosts, hosts.length); + } + } + + @Override + public void setPort(int port) { + fPort = port; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(Messages.TraceControl_NewDialogTitle); + newShell.setImage(Activator.getDefault().loadIcon(TARGET_NEW_CONNECTION_ICON_FILE)); + } + + @Override + protected Control createDialogArea(Composite parent) { + + // Main dialog panel + Composite dialogComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + dialogComposite.setLayout(layout); + dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + // Existing connections group + Group comboGroup = new Group(dialogComposite, SWT.SHADOW_NONE); + comboGroup.setText(Messages.TraceControl_NewNodeExistingConnectionGroupName); + layout = new GridLayout(2, true); + comboGroup.setLayout(layout); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + comboGroup.setLayoutData(data); + + fExistingHostsCombo = new CCombo(comboGroup, SWT.READ_ONLY); + fExistingHostsCombo.setToolTipText(Messages.TraceControl_NewNodeComboToolTip); + fExistingHostsCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1)); + + String items[] = new String[fExistingHosts.length]; + for (int i = 0; i < items.length; i++) { + items[i] = String.valueOf(fExistingHosts[i].getAliasName() + " - " + fExistingHosts[i].getHostName()); //$NON-NLS-1$ + } + + fExistingHostsCombo.setItems(items); + fExistingHostsCombo.setEnabled(fExistingHosts.length > 0); + + // Node information grop + Group textGroup = new Group(dialogComposite, SWT.SHADOW_NONE); + layout = new GridLayout(3, true); + textGroup.setLayout(layout); + data = new GridData(GridData.FILL_HORIZONTAL); + textGroup.setLayoutData(data); + + fButton = new Button(textGroup, SWT.CHECK); + fButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1)); + fButton.setText(Messages.TraceControl_NewNodeEditButtonName); + fButton.setEnabled(fExistingHosts.length > 0); + + Label connectionNameLabel = new Label(textGroup, SWT.RIGHT); + connectionNameLabel.setText(Messages.TraceControl_NewNodeConnectionNameLabel); + fConnectionNameText = new Text(textGroup, SWT.NONE); + fConnectionNameText.setToolTipText(Messages.TraceControl_NewNodeConnectionNameTooltip); + fConnectionNameText.setEnabled(fExistingHosts.length == 0); + + Label hostNameLabel = new Label(textGroup, SWT.RIGHT); + hostNameLabel.setText(Messages.TraceControl_NewNodeHostNameLabel); + fHostNameText = new Text(textGroup, SWT.NONE); + fHostNameText.setToolTipText(Messages.TraceControl_NewNodeHostNameTooltip); + fHostNameText.setEnabled(fExistingHosts.length == 0); + + Label portLabel = new Label(textGroup, SWT.RIGHT); + portLabel.setText(Messages.TraceControl_NewNodePortLabel); + fPortText = new Text(textGroup, SWT.NONE); + fPortText.setToolTipText(Messages.TraceControl_NewNodePortTooltip); + fPortText.setEnabled(fExistingHosts.length == 0); + fPortText.addVerifyListener(new VerifyListener() { + @Override + public void verifyText(VerifyEvent e) { + // only numbers are allowed. + e.doit = e.text.matches("[0-9]*"); //$NON-NLS-1$ + } + }); + + fButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + if (fButton.getSelection()) { + fExistingHostsCombo.deselectAll(); + fExistingHostsCombo.setEnabled(false); + fConnectionNameText.setEnabled(true); + fHostNameText.setEnabled(true); + fPortText.setEnabled(true); + } else { + fExistingHostsCombo.setEnabled(true); + fConnectionNameText.setEnabled(false); + fHostNameText.setEnabled(false); + fPortText.setEnabled(false); + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + fExistingHostsCombo.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + int index = fExistingHostsCombo.getSelectionIndex(); + fConnectionNameText.setText(fExistingHosts[index].getAliasName()); + fHostNameText.setText(fExistingHosts[index].getHostName()); + fPortText.setText(""); //$NON-NLS-1$ + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + // layout widgets + data = new GridData(GridData.FILL_HORIZONTAL); + fHostNameText.setText("666.666.666.666"); //$NON-NLS-1$ + Point minSize = fHostNameText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); + int widthHint = minSize.x + 5; + data.widthHint = widthHint; + data.horizontalSpan = 2; + fConnectionNameText.setLayoutData(data); + + data = new GridData(GridData.FILL_HORIZONTAL); + data.widthHint = widthHint; + data.horizontalSpan = 2; + fHostNameText.setLayoutData(data); + + data = new GridData(GridData.FILL_HORIZONTAL); + data.widthHint = widthHint; + data.horizontalSpan = 2; + fPortText.setLayoutData(data); + + fHostNameText.setText(""); //$NON-NLS-1$ + + return dialogComposite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$ + createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$ + } + + @Override + protected void okPressed() { + // Validate input data + fConnectionName = fConnectionNameText.getText(); + fHostName = fHostNameText.getText(); + fPort = (fPortText.getText().length() > 0) ? Integer.parseInt(fPortText.getText()) : IRemoteSystemProxy.INVALID_PORT_NUMBER; + + if (!"".equals(fHostName)) { //$NON-NLS-1$ + // If no node name is specified use the node address as name + if ("".equals(fConnectionName)) { //$NON-NLS-1$ + fConnectionName = fHostName; + } + // Check if node with name already exists in parent + if(fParent.containsChild(fConnectionName)) { + MessageDialog.openError(getShell(), + Messages.TraceControl_NewDialogTitle, + Messages.TraceControl_AlreadyExistsError + " (" + fConnectionName + ")"); //$NON-NLS-1$//$NON-NLS-2$ + return; + } + } + else { + return; + } + // validation successful -> call super.okPressed() + super.okPressed(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/OpenCommandScriptDialog.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/OpenCommandScriptDialog.java new file mode 100644 index 0000000000..7c1f422577 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/OpenCommandScriptDialog.java @@ -0,0 +1,269 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.tmf.core.io.BufferedRandomAccessFile; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; + +import com.google.common.collect.ImmutableList; + +/** + *

+ * Dialog box for selecting a command script. It parses the script and + * provides a list of shell commands to be executed. + *

+ * + * @author Bernd Hufmann + */ +public class OpenCommandScriptDialog extends Dialog implements ISelectCommandScriptDialog { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The icon file for this dialog box. + */ + public static final String CREATE_SESSION_ICON_FILE = "icons/elcl16/add_button.gif"; //$NON-NLS-1$ + + // Dialog settings constants + private static final String DIALOG_SETTINGS_SECTION = "OpenCommandScriptDialog"; //$NON-NLS-1$ + private static final String FILE_NAME_ID = "STORE_FILE_NAME_ID"; //$NON-NLS-1$ + private static final int COMBO_HISTORY_LENGTH = 5; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // Dialog attributes + private Control fControl = null; + private Composite fDialogComposite = null; + private Button fBrowseButton; + private Label fFileNameLabel = null; + private Combo fFileNameCombo = null; + + // Output list of commands + private List fCommands = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param shell - a shell for the display of the dialog + */ + public OpenCommandScriptDialog(Shell shell) { + super(shell); + setShellStyle(SWT.RESIZE | getShellStyle()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + @NonNull public List getCommands() { + if (fCommands != null) { + return fCommands; + } + return new ArrayList<>(); + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected Control createContents(Composite parent) { + fControl = super.createContents(parent); + + /* set the shell minimum size */ + Point clientArea = fControl.computeSize(SWT.DEFAULT, SWT.DEFAULT); + Rectangle trim = getShell().computeTrim(0, 0, clientArea.x, clientArea.y); + getShell().setMinimumSize(trim.width, trim.height); + + return fControl; + } + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(Messages.TraceControl_ExecuteScriptDialogTitle); + newShell.setImage(Activator.getDefault().loadIcon(CREATE_SESSION_ICON_FILE)); + } + + @Override + protected Control createDialogArea(Composite parent) { + + // Main dialog panel + fDialogComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + fDialogComposite.setLayout(layout); + fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + Group sessionGroup = new Group(fDialogComposite, SWT.SHADOW_NONE); + sessionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + sessionGroup.setLayout(new GridLayout(6, true)); + + fFileNameLabel = new Label(sessionGroup, SWT.RIGHT); + fFileNameLabel.setText(Messages.TraceControl_ExecuteScriptSelectLabel); + fFileNameCombo = new Combo(sessionGroup, SWT.BORDER); + + fBrowseButton = new Button(sessionGroup, SWT.PUSH); + fBrowseButton.setText(Messages.TraceControl_ExecuteScriptBrowseText); + fBrowseButton.addListener(SWT.Selection, new Listener() { + @Override + public void handleEvent(Event event) { + handleFilePathBrowseButtonPressed(SWT.OPEN); + } + }); + + // layout widgets + GridData data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + data.grabExcessHorizontalSpace = false; + fFileNameLabel.setLayoutData(data); + + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 4; + fFileNameCombo.setLayoutData(data); + + data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 1; + + // Initialize a empty list + fCommands = new ArrayList<>(); + + restoreWidgetValues(); + + return fDialogComposite; + } + + private void restoreWidgetValues() { + IDialogSettings workbenchSettings = Activator.getDefault().getDialogSettings(); + IDialogSettings settings = workbenchSettings.getSection(DIALOG_SETTINGS_SECTION); + if (settings == null) { + settings = workbenchSettings.addNewSection(DIALOG_SETTINGS_SECTION); + } + String[] fileNames = settings.getArray(FILE_NAME_ID); + if ((fileNames != null) && (fileNames.length != 0)) { + for (int i = 0; i < fileNames.length; i++) { + fFileNameCombo.add(fileNames[i]); + } + } + } + + private void saveWidgetValues() { + IDialogSettings workbenchSettings = Activator.getDefault().getDialogSettings(); + IDialogSettings settings = workbenchSettings.getSection(DIALOG_SETTINGS_SECTION); + if (settings != null) { + // update file names history + String[] fileNames = settings.getArray(FILE_NAME_ID); + if (fileNames == null) { + fileNames = new String[0]; + } + + fileNames = addToHistory(fileNames, fFileNameCombo.getText().trim()); + settings.put(FILE_NAME_ID, fileNames); + } + } + + /** + * Adds an entry to a history, while taking care of duplicate history items + * and excessively long histories. The assumption is made that all histories + * should be of length COMBO_HISTORY_LENGTH. + * + * @param history the current history + * @param newEntry the entry to add to the history + */ + private static String[] addToHistory(String[] history, String newEntry) { + List list = new ArrayList<>(Arrays.asList(history)); + list.remove(newEntry); + list.add(0, newEntry); + + // since only one new item was added, we can be over the limit + // by at most one item + if (list.size() > COMBO_HISTORY_LENGTH) { + list.remove(COMBO_HISTORY_LENGTH); + } + String[] r = new String[list.size()]; + list.toArray(r); + return r; + } + + private void handleFilePathBrowseButtonPressed(int fileDialogStyle) { + FileDialog dialog = new FileDialog(getShell(), fileDialogStyle | SWT.SHEET); + dialog.setFilterExtensions(new String[] { "*.*", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$ + dialog.setText(Messages.TraceControl_ExecuteScriptDialogTitle); + String selectedFileName = dialog.open(); + if (selectedFileName != null) { + fFileNameCombo.setText(selectedFileName); + } + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); + createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); + } + + @Override + protected void okPressed() { + // Validate input data + String sessionPath = fFileNameCombo.getText(); + + if (!"".equals(sessionPath)) { //$NON-NLS-1$ + + ImmutableList.Builder builder = new ImmutableList.Builder<>(); + try (BufferedRandomAccessFile rafile = new BufferedRandomAccessFile(sessionPath, "r")) { //$NON-NLS-1$ + String line = rafile.getNextLine(); + while (line != null) { + builder.add(line); + line = rafile.getNextLine(); + } + } catch (IOException e) { + ErrorDialog.openError(getShell(), null, null, new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, e.getLocalizedMessage(), e)); + return; + } + saveWidgetValues(); + fCommands = builder.build(); + super.okPressed(); + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/TraceControlDialogFactory.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/TraceControlDialogFactory.java new file mode 100644 index 0000000000..58364d2471 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/TraceControlDialogFactory.java @@ -0,0 +1,282 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs; + +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Factory for generating dialog boxes. It allows to overwrite the dialog implementation. + * Useful also for testing purposes. + *

+ * + * @author Bernd Hufmann + * + */ +public final class TraceControlDialogFactory { + + // ------------------------------------------------------------------------ + // Members + // ------------------------------------------------------------------------ + + /** + * The factory instance. + */ + private static TraceControlDialogFactory fInstance; + + /** + * The new connection dialog reference. + */ + private INewConnectionDialog fNewConnectionDialog; + + /** + * The enable channel dialog + */ + private IEnableChannelDialog fEnableChannelDialog; + + /** + * The create session dialog. + */ + private ICreateSessionDialog fCreateSessionDialog; + + /** + * The command script selection dialog. + */ + private ISelectCommandScriptDialog fCommandScriptDialog; + + /** + * The enable events dialog. + */ + private IEnableEventsDialog fEnableEventsDialog; + + /** + * The get event info dialog. + */ + private IGetEventInfoDialog fGetEventInfoDialog; + + /** + * The confirmation dialog implementation. + */ + private IConfirmDialog fConfirmDialog; + + /** + * The add context dialog implementation. + */ + private IAddContextDialog fAddContextDialog; + + /** + * The import dialog implementation. + */ + private IImportDialog fImportDialog; + + /** + * The import confirmation dialog. + */ + private IImportConfirmationDialog fImportConfirmationDialog; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor for R4EUIDialogFactory. + */ + private TraceControlDialogFactory() { + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * @return TraceControlDialogFactory instance + */ + public static synchronized TraceControlDialogFactory getInstance() { + if (fInstance == null) { + fInstance = new TraceControlDialogFactory(); + } + return fInstance; + } + + /** + * @return new connection dialog + */ + public INewConnectionDialog getNewConnectionDialog() { + if (fNewConnectionDialog == null) { + fNewConnectionDialog = new NewConnectionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + } + return fNewConnectionDialog; + } + + /** + * Sets a new connection dialog implementation. + * @param newConnectionDialog - new connection dialog implementation + */ + public void setNewConnectionDialog(INewConnectionDialog newConnectionDialog) { + fNewConnectionDialog = newConnectionDialog; + } + + /** + * @return enable channel dialog + */ + public IEnableChannelDialog getEnableChannelDialog() { + if (fEnableChannelDialog == null) { + fEnableChannelDialog = new EnableChannelDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + } + return fEnableChannelDialog; + } + + /** + * Sets a enable channel dialog implementation. + * @param createEnableDialog - a create channel dialog implementation + */ + public void setEnableChannelDialog(IEnableChannelDialog createEnableDialog) { + fEnableChannelDialog = createEnableDialog; + } + + /** + * @return create session dialog implementation + */ + public ICreateSessionDialog getCreateSessionDialog() { + if (fCreateSessionDialog == null) { + fCreateSessionDialog = new CreateSessionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + } + return fCreateSessionDialog; + } + + /** + * @return command script selection dialog implementation + */ + public ISelectCommandScriptDialog getCommandScriptDialog() { + if (fCommandScriptDialog == null) { + fCommandScriptDialog = new OpenCommandScriptDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + } + return fCommandScriptDialog; + } + + /** + * Sets a create session dialog implementation. + * @param createSessionDialog - a create session implementation. + */ + public void setCreateSessionDialog(ICreateSessionDialog createSessionDialog) { + fCreateSessionDialog = createSessionDialog; + } + + /** + * @return enable events dialog implementation. + */ + public IEnableEventsDialog getEnableEventsDialog() { + if (fEnableEventsDialog == null) { + fEnableEventsDialog = new EnableEventsDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + } + return fEnableEventsDialog; + } + + /** + * Sets a enable events dialog implementation. + * @param enableEventsDialog - a enable events dialog implementation. + */ + public void setEnableEventsDialog(IEnableEventsDialog enableEventsDialog) { + fEnableEventsDialog = enableEventsDialog; + } + + /** + * @return get events info dialog implementation. + */ + public IGetEventInfoDialog getGetEventInfoDialog() { + if (fGetEventInfoDialog == null) { + fGetEventInfoDialog = new GetEventInfoDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + } + return fGetEventInfoDialog; + } + + /** + * Sets a get events info dialog implementation. + * @param getEventInfoDialog - a get events info dialog implementation + */ + public void setGetEventInfoDialog(IGetEventInfoDialog getEventInfoDialog) { + fGetEventInfoDialog = getEventInfoDialog; + } + + /** + * @return the confirmation dialog implementation + */ + public IConfirmDialog getConfirmDialog() { + if (fConfirmDialog == null) { + fConfirmDialog = new ConfirmDialog(); + } + return fConfirmDialog; + } + + /** + * Sets the confirmation dialog implementation + * @param confirmDialog - a confirmation dialog implementation + */ + public void setConfirmDialog(IConfirmDialog confirmDialog) { + fConfirmDialog = confirmDialog; + } + + /** + * @return the add context dialog implementation + */ + public IAddContextDialog getAddContextDialog() { + if (fAddContextDialog == null) { + fAddContextDialog = new AddContextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + } + return fAddContextDialog; + } + + /** + * Sets the add context dialog information + * @param addContextDialog - a add context dialog implementation + */ + public void setAddContextDialog(IAddContextDialog addContextDialog) { + fAddContextDialog = addContextDialog; + } + + /** + * @return the import dialog implementation + */ + public IImportDialog getImportDialog() { + if (fImportDialog == null) { + fImportDialog = new ImportDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + } + return fImportDialog; + } + + /** + * Sets the import dialog implementation. + * @param importDialog - a import dialog implementation + */ + public void setImportDialog(IImportDialog importDialog) { + fImportDialog = importDialog; + } + + /** + * @return the import confirmation dialog implementation. + */ + public IImportConfirmationDialog getImportConfirmationDialog() { + if (fImportConfirmationDialog == null) { + fImportConfirmationDialog = new ImportConfirmationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + } + return fImportConfirmationDialog; + } + + /** + * Sets the import confirmation dialog implementation. + * @param confirmDialog - a import confirmation dialog implementation. + */ + public void setImportConfirmationDialog(IImportConfirmationDialog confirmDialog) { + fImportConfirmationDialog = confirmDialog; + } +} + diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnChannelHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnChannelHandler.java new file mode 100644 index 0000000000..fc3d28a4a3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnChannelHandler.java @@ -0,0 +1,90 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to add contexts to a given channel and all of its events. + *

+ * + * @author Bernd Hufmann + */ +public class AddContextOnChannelHandler extends BaseAddContextHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void addContexts(CommandParameter param, List contextNames, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof ChannelCommandParameter) { + TraceChannelComponent channel = ((ChannelCommandParameter)param).getChannel(); + channel.addContexts(contextNames, monitor); + } + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceChannelComponent channel = null; + TraceSessionComponent session = null; + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceChannelComponent) { + // Add only if corresponding TraceSessionComponents is inactive and not destroyed + TraceChannelComponent tmpChannel = (TraceChannelComponent) element; + session = tmpChannel.getSession(); + if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) { + channel = tmpChannel; + } + } + } + } + + boolean isEnabled = (channel != null); + fLock.lock(); + try { + fParam = null; + if(isEnabled) { + fParam = new ChannelCommandParameter(session, channel); + } + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnDomainHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnDomainHandler.java new file mode 100644 index 0000000000..d7df3133ed --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnDomainHandler.java @@ -0,0 +1,98 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to add contexts to all channels and all events. + *

+ * + * @author Bernd Hufmann + */ +public class AddContextOnDomainHandler extends BaseAddContextHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void addContexts(CommandParameter param, List contextNames, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof DomainCommandParameter) { + TraceDomainComponent domain = ((DomainCommandParameter)param).getDomain(); + domain.addContexts(contextNames, monitor); + } + } + + @Override + public boolean isEnabled() { + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceDomainComponent domain = null; + TraceSessionComponent session = null; + + // Check if one domain is selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceDomainComponent) { + TraceDomainComponent tmpDomain = (TraceDomainComponent) element; + session = (TraceSessionComponent) tmpDomain.getParent(); + + // Add only TraceDomainComponent whose TraceSessionComponent parent is inactive and not destroyed + if ((session.getSessionState() == TraceSessionState.INACTIVE) && (!session.isDestroyed())) { + domain = tmpDomain; + } + } + } + } + + boolean isEnabled = domain != null; + + fLock.lock(); + try { + fParam = null; + if (isEnabled) { + fParam = new DomainCommandParameter(session, domain); + } + } finally { + fLock.unlock(); + } + + return isEnabled; + } + + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnEventHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnEventHandler.java new file mode 100644 index 0000000000..62edf0a39f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AddContextOnEventHandler.java @@ -0,0 +1,90 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to add contexts to a given event. + *

+ * + * @author Bernd Hufmann + */ +public class AddContextOnEventHandler extends BaseAddContextHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void addContexts(CommandParameter param, List contextNames, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof EventCommandParameter) { + TraceEventComponent event = ((EventCommandParameter)param).getEvent(); + event.addContexts(contextNames, monitor); + } + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceEventComponent event = null; + TraceSessionComponent session = null; + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceEventComponent) { + // Add only if corresponding TraceSessionComponents is inactive and not destroyed + TraceEventComponent tmpEvent = (TraceEventComponent) element; + session = tmpEvent.getSession(); + if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) { + event = tmpEvent; + } + } + } + } + + boolean isEnabled = (event != null); + fLock.lock(); + try { + fParam = null; + if(isEnabled) { + fParam = new EventCommandParameter(session, event); + } + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AssignEventHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AssignEventHandler.java new file mode 100644 index 0000000000..39ba8fefad --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/AssignEventHandler.java @@ -0,0 +1,253 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.window.Window; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IGetEventInfoDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to assign events to a session and channel and enable/configure them. + * This is done on the trace provider level. + *

+ * + * @author Bernd Hufmann + */ +public class AssignEventHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The command execution parameter. + */ + private Parameter fParam; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + fLock.lock(); + try { + // Make a copy for thread safety + final Parameter param = new Parameter(fParam); + + // Open dialog box to retrieve the session and channel where the events should be enabled in. + final IGetEventInfoDialog dialog = TraceControlDialogFactory.getInstance().getGetEventInfoDialog(); + dialog.setIsKernel(param.isKernel()); + dialog.setSessions(param.getSessions()); + + if (dialog.open() != Window.OK) { + return null; + } + + Job job = new Job(Messages.TraceControl_EnableEventsJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + + Exception error = null; + + try { + List eventNames = new ArrayList<>(); + List events = param.getEvents(); + // Create list of event names + for (Iterator iterator = events.iterator(); iterator.hasNext();) { + BaseEventComponent baseEvent = iterator.next(); + eventNames.add(baseEvent.getName()); + } + + TraceChannelComponent channel = dialog.getChannel(); + if (channel == null) { + // enable events on default channel (which will be created by lttng-tools) + dialog.getSession().enableEvents(eventNames, param.isKernel(), dialog.getFilterExpression(), monitor); + } else { + channel.enableEvents(eventNames, dialog.getFilterExpression(), monitor); + } + + } catch (ExecutionException e) { + error = e; + } + + // refresh in all cases + refresh(new CommandParameter(dialog.getSession())); + + if (error != null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_EnableEventsFailure, error); + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + + return null; + } + + @Override + public boolean isEnabled() { + ArrayList events = new ArrayList<>(); + TraceSessionComponent[] sessions = null; + Boolean isKernel = null; + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + // Check if one or more session are selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof BaseEventComponent) { + BaseEventComponent event = (BaseEventComponent) element; + ITraceControlComponent provider = event.getParent(); + + // check for kernel or UST provider + boolean temp = false; + if (provider instanceof KernelProviderComponent) { + temp = true; + } else if (provider instanceof UstProviderComponent) { + temp = false; + } else { + return false; + } + if (isKernel == null) { + isKernel = Boolean.valueOf(temp); + } else { + // don't mix events from Kernel and UST provider + if (isKernel.booleanValue() != temp) { + return false; + } + } + + // Add BaseEventComponents + events.add(event); + + if (sessions == null) { + TargetNodeComponent root = (TargetNodeComponent)event.getParent().getParent().getParent(); + sessions = root.getSessions(); + } + } + } + } + + boolean isEnabled = ((!events.isEmpty()) && (sessions != null) && (sessions.length > 0)); + + // To avoid compiler warnings check for null even if isKernel is always not null when used below + if (isKernel == null) { + return false; + } + + fLock.lock(); + try { + fParam = null; + if(isEnabled) { + fParam = new Parameter(sessions, events, isKernel); + } + } finally { + fLock.unlock(); + } + return isEnabled; + } + + /** + * Class containing parameter for the command execution. + */ + private static final class Parameter { + + /** + * The list of event components the command is to be executed on. + */ + private final List fEvents; + + /** + * The list of available sessions. + */ + final private TraceSessionComponent[] fSessions; + + /** + * Flag for indicating Kernel or UST. + */ + private final boolean fIsKernel; + + /** + * Constructor + * + * @param sessions - a array of trace sessions + * @param events - a lists of events to enable + * @param isKernel - domain (true for kernel or UST) + */ + public Parameter(TraceSessionComponent[] sessions, List events, boolean isKernel) { + fSessions = Arrays.copyOf(sessions, sessions.length); + fEvents = new ArrayList<>(); + fEvents.addAll(events); + fIsKernel = isKernel; + } + + /** + * Copy constructor + * @param other - a parameter to copy + */ + public Parameter(Parameter other) { + this(other.fSessions, other.fEvents, other.fIsKernel); + } + + public TraceSessionComponent[] getSessions() { + return fSessions; + } + + public List getEvents() { + return fEvents; + } + + public boolean isKernel() { + return fIsKernel; + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseAddContextHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseAddContextHandler.java new file mode 100644 index 0000000000..bba85505b6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseAddContextHandler.java @@ -0,0 +1,132 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.window.Window; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IAddContextDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.progress.UIJob; + +/** + *

+ * Base command handler implementation to add contexts. + *

+ * + * @author Bernd Hufmann + */ +public abstract class BaseAddContextHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The command execution parameter. + */ + protected CommandParameter fParam = null; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Adds contexts to channel(s) and/or event(s) + * + * @param param + * - a parameter instance with data for the command execution + * @param contextNames + * - list contexts to add + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If something goes wrong + */ + public abstract void addContexts(CommandParameter param, List contextNames, IProgressMonitor monitor) throws ExecutionException; + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + return false; + } + fLock.lock(); + try { + // Make a copy for thread safety + final CommandParameter param = fParam.clone(); + + UIJob getJob = new UIJob(Messages.TraceControl_GetContextJob) { + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + + try { + final List availableContexts = param.getSession().getContextList(monitor); + final IAddContextDialog dialog = TraceControlDialogFactory.getInstance().getAddContextDialog(); + dialog.setAvalibleContexts(availableContexts); + + if ((dialog.open() != Window.OK) || (dialog.getContexts().isEmpty())) { + return Status.OK_STATUS; + } + + Job addJob = new Job(Messages.TraceControl_AddContextJob) { + @Override + protected IStatus run(IProgressMonitor monitor2) { + Exception error = null; + + try { + List contextNames = dialog.getContexts(); + addContexts(param, contextNames, monitor2); + + } catch (ExecutionException e) { + error = e; + } + + // get session configuration in all cases + refresh(param); + + if (error != null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_AddContextFailure, error); + } + return Status.OK_STATUS; + } + }; + addJob.setUser(true); + addJob.schedule(); + } catch (ExecutionException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_GetContextFailure, e); + } + + return Status.OK_STATUS; + } + }; + getJob.setUser(false); + getJob.schedule(); + + } finally { + fLock.unlock(); + } + return null; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseControlViewHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseControlViewHandler.java new file mode 100644 index 0000000000..8f36de1e6f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseControlViewHandler.java @@ -0,0 +1,94 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.concurrent.locks.ReentrantLock; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Abstract Command handler implementation for all control view handlers. + *

+ * + * @author Bernd Hufmann + */ +public abstract class BaseControlViewHandler extends AbstractHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The synchronization lock. + */ + protected final ReentrantLock fLock = new ReentrantLock(); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * @return returns the workbench page for the Control View + */ + protected IWorkbenchPage getWorkbenchPage() { + // Check if we are closing down + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) { + return null; + } + + // Check if we are in the Project View + IWorkbenchPage page = window.getActivePage(); + if (page == null) { + return null; + } + + IWorkbenchPart part = page.getActivePart(); + if (!(part instanceof ControlView)) { + return null; + } + return page; + } + + /** + * Refreshes the session information based on given session (in CommandParameter) + * @param param - command parameter containing the session to refresh + */ + protected void refresh(final CommandParameter param) { + Job job = new Job(Messages.TraceControl_RetrieveNodeConfigurationJob) { + + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + param.getSession().getConfigurationFromNode(monitor); + } catch (ExecutionException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ListSessionFailure, e); + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableChannelHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableChannelHandler.java new file mode 100644 index 0000000000..0b3f65d9a2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableChannelHandler.java @@ -0,0 +1,124 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.window.Window; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IEnableChannelDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; + +/** + *

+ * Base implementation of a command handler to enable a trace channel. + *

+ * + * @author Bernd Hufmann + */ +abstract class BaseEnableChannelHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + protected CommandParameter fParam; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Enables channels with given names which are part of this domain. If a + * given channel doesn't exists it creates a new channel with the given + * parameters (or default values if given parameter is null). + * + * @param param + * - a parameter instance with data for the command execution + * @param channelNames + * - a list of channel names to enable on this domain + * @param info + * - channel information to set for the channel (use null for + * default) + * @param isKernel + * - a flag for indicating kernel or UST. + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If something goes wrong when enabling the channel + */ + public abstract void enableChannel(CommandParameter param, + List channelNames, IChannelInfo info, boolean isKernel, + IProgressMonitor monitor) throws ExecutionException; + + /** + * @param param - a parameter instance with data for the command execution + * @return returns the relevant domain (null if domain is not known) + */ + public abstract TraceDomainComponent getDomain(CommandParameter param); + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + fLock.lock(); + try { + final CommandParameter param = fParam.clone(); + + final IEnableChannelDialog dialog = TraceControlDialogFactory.getInstance().getEnableChannelDialog(); + dialog.setTargetNodeComponent(param.getSession().getTargetNode()); + dialog.setDomainComponent(getDomain(param)); + dialog.setHasKernel(param.getSession().hasKernelProvider()); + + if (dialog.open() != Window.OK) { + return null; + } + + Job job = new Job(Messages.TraceControl_CreateChannelStateJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + Exception error = null; + + List channelNames = new ArrayList<>(); + channelNames.add(dialog.getChannelInfo().getName()); + + try { + enableChannel(param, channelNames, dialog.getChannelInfo(), dialog.isKernel(), monitor); + } catch (ExecutionException e) { + error = e; + } + + // refresh in all cases + refresh(param); + + if (error != null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateChannelStateFailure, error); + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + return null; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java new file mode 100644 index 0000000000..d4a39e90f7 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseEnableEventHandler.java @@ -0,0 +1,227 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.window.Window; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IEnableEventsDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Base command handler implementation to enable events. + *

+ * + * @author Bernd Hufmann + */ +public abstract class BaseEnableEventHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The command execution parameter. + */ + protected CommandParameter fParam = null; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Enables a list of events for given parameters. + * + * @param param + * - a parameter instance with data for the command execution + * @param eventNames + * - list of event names + * @param isKernel + * - true if kernel domain else false + * @param filterExpression + * - a filter expression + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails for some reason + */ + public abstract void enableEvents(CommandParameter param, List eventNames, boolean isKernel, String filterExpression, IProgressMonitor monitor) throws ExecutionException; + + /** + * Enables all syscall events. + * + * @param param + * - a parameter instance with data for the command execution + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails for some reason + */ + public abstract void enableSyscalls(CommandParameter param, IProgressMonitor monitor) throws ExecutionException; + + /** + * Enables a dynamic probe. + * + * @param param + * - a parameter instance with data for the command execution + * @param eventName + * - a event name + * @param isFunction + * - true for dynamic function entry/return probe else false + * @param probe + * - a dynamic probe information + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails for some reason + */ + public abstract void enableProbe(CommandParameter param, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException; + + /** + * Enables events using log level + * + * @param param + * - a parameter instance with data for the command execution + * @param eventName + * - a event name + * @param logLevelType + * - a log level type + * @param level + * - a log level + * @param filterExpression + * - a filter expression + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails for some reason + */ + public abstract void enableLogLevel(CommandParameter param, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExpression, IProgressMonitor monitor) throws ExecutionException; + + /** + * @param param + * - a parameter instance with data for the command execution + * @return returns the relevant domain (null if domain is not known) + */ + public abstract TraceDomainComponent getDomain(CommandParameter param); + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + return false; + } + fLock.lock(); + try { + // Make a copy for thread safety + final CommandParameter param = fParam.clone(); + + TargetNodeComponent node = param.getSession().getTargetNode(); + List providers = node.getChildren(TraceProviderGroup.class); + + final IEnableEventsDialog dialog = TraceControlDialogFactory.getInstance().getEnableEventsDialog(); + dialog.setTraceProviderGroup((TraceProviderGroup)providers.get(0)); + dialog.setTraceDomainComponent(getDomain(param)); + + if (dialog.open() != Window.OK) { + return null; + } + + Job job = new Job(Messages.TraceControl_ChangeEventStateJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + Exception error = null; + + try { + String filter = dialog.getFilterExpression(); + + // Enable tracepoint events + if (dialog.isTracepoints()) { + if (dialog.isAllTracePoints()) { + enableEvents(param, null, dialog.isKernel(), filter, monitor); + } else { + List eventNames = dialog.getEventNames(); + if (!eventNames.isEmpty()) { + enableEvents(param, eventNames, dialog.isKernel(), filter, monitor); + } + } + } + + // Enable syscall events + if (dialog.isAllSysCalls()) { + enableSyscalls(param, monitor); + } + + // Enable dynamic probe + if (dialog.isDynamicProbe() && (dialog.getProbeEventName() != null) && (dialog.getProbeName() != null)) { + enableProbe(param, dialog.getProbeEventName(), false, dialog.getProbeName(), monitor); + } + + // Enable dynamic function probe + if (dialog.isDynamicFunctionProbe() && (dialog.getFunctionEventName() != null) && (dialog.getFunction() != null)) { + enableProbe(param, dialog.getFunctionEventName(), true, dialog.getFunction(), monitor); + } + + // Enable event using a wildcard + if (dialog.isWildcard()) { + List eventNames = dialog.getEventNames(); + eventNames.add(dialog.getWildcard()); + + if (!eventNames.isEmpty()) { + enableEvents(param, eventNames, dialog.isKernel(), filter, monitor); + } + } + + // Enable events using log level + if (dialog.isLogLevel()) { + enableLogLevel(param, dialog.getLogLevelEventName(), dialog.getLogLevelType(), dialog.getLogLevel(), filter, monitor); + } + + } catch (ExecutionException e) { + error = e; + } + + // refresh in all cases + refresh(param); + + if (error != null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeEventStateFailure, error); + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + return null; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseNodeHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseNodeHandler.java new file mode 100644 index 0000000000..e3f234c631 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/BaseNodeHandler.java @@ -0,0 +1,70 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to delete a target host. + *

+ * + * @author Bernd Hufmann + */ +public abstract class BaseNodeHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The target node component the command is to be executed on. + */ + protected TargetNodeComponent fTargetNode = null; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public boolean isEnabled() { + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TargetNodeComponent node = null; + // Check if the node component is selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + Object element = ((StructuredSelection) selection).getFirstElement(); + node = (element instanceof TargetNodeComponent) ? (TargetNodeComponent) element : null; + } + boolean isEnabled = node != null; + fLock.lock(); + try { + if (isEnabled) { + fTargetNode = node; + } + } finally { + fLock.unlock(); + } + return isEnabled; + } + + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CalibrateHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CalibrateHandler.java new file mode 100644 index 0000000000..521c2ee86a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CalibrateHandler.java @@ -0,0 +1,132 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Command handler implementation to execute command calibrate to quantify LTTng overhead. + *

+ * + * @author Bernd Hufmann + */ +public class CalibrateHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The command execution parameter. + */ + protected DomainCommandParameter fParam = null; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + return false; + } + fLock.lock(); + try { + // Make a copy for thread safety + final DomainCommandParameter param = fParam.clone(); + + Job addJob = new Job(Messages.TraceControl_AddCalibrateJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + param.getDomain().calibrate(monitor); + } catch (ExecutionException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_AddCalibrateFailure, e); + } + + return Status.OK_STATUS; + } + }; + addJob.setUser(true); + addJob.schedule(); + + } finally { + fLock.unlock(); + } + return Status.OK_STATUS; + } + + @Override + public boolean isEnabled() { + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceDomainComponent domain = null; + TraceSessionComponent session = null; + + // Check if one domain is selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceDomainComponent) { + TraceDomainComponent tmpDomain = (TraceDomainComponent) element; + session = (TraceSessionComponent) tmpDomain.getParent(); + + // Add only TraceDomainComponent whose TraceSessionComponent parent is not destroyed + if ((!session.isDestroyed())) { + domain = tmpDomain; + } + } + } + } + + boolean isEnabled = domain != null; + + fLock.lock(); + try { + fParam = null; + if (isEnabled) { + fParam = new DomainCommandParameter(session, domain); + } + } finally { + fLock.unlock(); + } + + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeChannelStateHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeChannelStateHandler.java new file mode 100644 index 0000000000..125f06378a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeChannelStateHandler.java @@ -0,0 +1,303 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Abstract command handler implementation to enable or disabling a trace channel. + *

+ * + * @author Bernd Hufmann + */ +public abstract class ChangeChannelStateHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The command execution parameter. + */ + protected Parameter fParam; + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return the new state to set + */ + protected abstract TraceEnablement getNewState(); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * Changes the state of the given channels. + * @param domain - the domain of the channels. + * @param channelNames - a list of channel names + * @param monitor - a progress monitor + * @throws ExecutionException If the command fails + */ + protected abstract void changeState(TraceDomainComponent domain, List channelNames, IProgressMonitor monitor) throws ExecutionException; + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + fLock.lock(); + try { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + return false; + } + + final Parameter param = new Parameter(fParam); + + Job job = new Job(Messages.TraceControl_ChangeChannelStateJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + Exception error = null; + + TraceSessionComponent session = null; + + try { + TraceDomainComponent kernelDomain = param.getKernelDomain(); + List kernelChannels = param.getKernelChannels(); + + if (kernelDomain != null) { + session = (TraceSessionComponent)kernelDomain.getParent(); + List channelNames = new ArrayList<>(); + for (Iterator iterator = kernelChannels.iterator(); iterator.hasNext();) { + // Enable all selected channels which are disabled + TraceChannelComponent channel = iterator.next(); + channelNames.add(channel.getName()); + } + + changeState(kernelDomain, channelNames, monitor); + + for (Iterator iterator = kernelChannels.iterator(); iterator.hasNext();) { + // Enable all selected channels which are disabled + TraceChannelComponent channel = iterator.next(); + channel.setState(getNewState()); + } + } + + TraceDomainComponent ustDomain = param.getUstDomain(); + List ustChannels = param.getUstChannels(); + if (ustDomain != null) { + if (session == null) { + session = (TraceSessionComponent)ustDomain.getParent(); + } + + List channelNames = new ArrayList<>(); + for (Iterator iterator = ustChannels.iterator(); iterator.hasNext();) { + // Enable all selected channels which are disabled + TraceChannelComponent channel = iterator.next(); + channelNames.add(channel.getName()); + } + + changeState(ustDomain, channelNames, monitor); + + for (Iterator iterator = ustChannels.iterator(); iterator.hasNext();) { + // Enable all selected channels which are disabled + TraceChannelComponent channel = iterator.next(); + channel.setState(getNewState()); + } + } + } catch (ExecutionException e) { + error = e; + } + + // In all cases notify listeners + if (session != null) { + session.fireComponentChanged(session); + } + + if (error != null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeChannelStateFailure, error); + } + + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + + return null; + } + + @Override + public boolean isEnabled() { + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceDomainComponent kernelDomain = null; + TraceDomainComponent ustDomain = null; + List kernelChannels = new ArrayList<>(); + List ustChannels = new ArrayList<>(); + + // Check if one or more session are selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + String sessionName = null; + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + + if (element instanceof TraceChannelComponent) { + + // Add only TraceChannelComponents that are disabled + TraceChannelComponent channel = (TraceChannelComponent) element; + if (sessionName == null) { + sessionName = String.valueOf(channel.getSessionName()); + } + + // Enable command only for channels of same session + if (!sessionName.equals(channel.getSessionName())) { + kernelChannels.clear(); + ustChannels.clear(); + break; + } + + if ((channel.getState() != getNewState())) { + if (channel.isKernel()) { + kernelChannels.add(channel); + if (kernelDomain == null) { + kernelDomain = (TraceDomainComponent) channel.getParent(); + } + } else { + ustChannels.add(channel); + if (ustDomain == null) { + ustDomain = (TraceDomainComponent) channel.getParent(); + } + } + } + } + } + } + + boolean isEnabled = (!kernelChannels.isEmpty() || !ustChannels.isEmpty()); + fLock.lock(); + try { + if (isEnabled) { + fParam = new Parameter(kernelDomain, ustDomain, kernelChannels, ustChannels); + } + } finally { + fLock.unlock(); + } + + return isEnabled; + } + + /** + * Class containing parameter for the command execution. + */ + protected static class Parameter { + /** + * Kernel domain component reference. + */ + protected final TraceDomainComponent fKernelDomain; + /** + * UST domain component reference. + */ + protected final TraceDomainComponent fUstDomain; + /** + * The list of kernel channel components the command is to be executed on. + */ + protected final List fKernelChannels; + /** + * The list of UST channel components the command is to be executed on. + */ + protected final List fUstChannels; + + /** + * Constructor + * @param kernelDomain - a kernel domain component + * @param ustDomain - a UST domain component + * @param kernelChannels - list of available kernel channels + * @param ustChannels - list of available UST channels + */ + public Parameter(TraceDomainComponent kernelDomain, TraceDomainComponent ustDomain, List kernelChannels, List ustChannels) { + fKernelDomain = kernelDomain; + fUstDomain = ustDomain; + fKernelChannels = new ArrayList<>(); + fKernelChannels.addAll(kernelChannels); + fUstChannels = new ArrayList<>(); + fUstChannels.addAll(ustChannels); + } + + /** + * Copy constructor + * @param other a parameter to copy + */ + public Parameter(Parameter other) { + this(other.fKernelDomain, other.fUstDomain, other.fKernelChannels, other.fUstChannels); + } + + /** + * @return the kernel domain component. + */ + public TraceDomainComponent getKernelDomain() { + return fKernelDomain; + } + + /** + * @return the UST domain component. + */ + public TraceDomainComponent getUstDomain() { + return fUstDomain; + } + + /** + * @return the list of kernel channel components. + */ + public List getKernelChannels() { + return fKernelChannels; + } + + /** + * @return the list of UST channel components. + */ + public List getUstChannels() { + return fUstChannels; + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeEventStateHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeEventStateHandler.java new file mode 100644 index 0000000000..72c53c103e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeEventStateHandler.java @@ -0,0 +1,261 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Base Command handler implementation to enable or disabling a trace channel. + *

+ * + * @author Bernd Hufmann + */ +public abstract class ChangeEventStateHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The command execution parameter. + */ + protected Parameter fParam; + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return the new state to set + */ + protected abstract TraceEnablement getNewState(); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * Change the state + * @param channel - channel of events to be enabled + * @param eventNames - list event names + * @param monitor - a progress monitor + * @throws ExecutionException If the command fails + */ + protected abstract void changeState(TraceChannelComponent channel, List eventNames, IProgressMonitor monitor) throws ExecutionException; + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + return false; + } + + fLock.lock(); + try { + + final Parameter param = new Parameter(fParam); + + Job job = new Job(Messages.TraceControl_ChangeChannelStateJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + Exception error = null; + + TraceSessionComponent session = null; + + try { + boolean isAll = false; + if (param.getChannel() != null) { + session = param.getChannel().getSession(); + List eventNames = new ArrayList<>(); + List events = param.getEvents(); + + for (Iterator iterator = events.iterator(); iterator.hasNext();) { + // Enable/disable all selected channels which are disabled + TraceEventComponent traceEvent = iterator.next(); + + // Workaround for wildcard handling in lttng-tools + if ("*".equals(traceEvent.getName())) { //$NON-NLS-1$ + isAll = true; + } else { + eventNames.add(traceEvent.getName()); + } + } + if (isAll) { + changeState(param.getChannel(), null, monitor); + } + + if (!eventNames.isEmpty()) { + changeState(param.getChannel(), eventNames, monitor); + } + + for (Iterator iterator = events.iterator(); iterator.hasNext();) { + // Enable all selected channels which are disabled + TraceEventComponent ev = iterator.next(); + ev.setState(getNewState()); + } + } + } catch (ExecutionException e) { + error = e; + } + + if (session != null) { + // In all cases notify listeners + session.fireComponentChanged(session); + } + + if (error != null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeEventStateFailure, error); + } + + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + // Check if one or more session are selected + ISelection selection = page.getSelection(ControlView.ID); + + TraceChannelComponent channel = null; + List events = new ArrayList<>(); + + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + String sessionName = null; + String channelName = null; + + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + + if (element instanceof TraceEventComponent) { + + TraceEventComponent event = (TraceEventComponent) element; + if (sessionName == null) { + sessionName = String.valueOf(event.getSessionName()); + } + + if (channel == null) { + channel = (TraceChannelComponent)event.getParent(); + } + + if (channelName == null) { + channelName = event.getChannelName(); + } + + // Enable command only for events of same session, same channel and domain + if ((!sessionName.equals(event.getSessionName())) || + (!channelName.equals(event.getChannelName())) || + (channel.isKernel() != event.isKernel())) { + events.clear(); + break; + } + + if ((event.getState() != getNewState())) { + events.add(event); + } + } + } + } + boolean isEnabled = !events.isEmpty(); + + fLock.lock(); + try { + fParam = null; + if (isEnabled) { + fParam = new Parameter(channel, events); + } + } finally { + fLock.unlock(); + } + return isEnabled; + } + + /** + * Class containing parameter for the command execution. + */ + protected static class Parameter { + /** + * Channel component reference. + */ + private final TraceChannelComponent fChannel; + /** + * The list of kernel channel components the command is to be executed on. + */ + private final List fEvents = new ArrayList<>(); + + /** + * Constructor + * @param channel - a channel component + * @param events - a list of event components + */ + public Parameter(TraceChannelComponent channel, List events) { + fChannel = channel; + fEvents.addAll(events); + } + + /** + * Copy constructor + * @param other - a parameter to copy + */ + public Parameter(Parameter other) { + this(other.fChannel, other.fEvents); + } + + /** + * @return the trace channel component. + */ + public TraceChannelComponent getChannel() { + return fChannel; + } + + /** + * @return a list of trace event components. + */ + public List getEvents() { + return fEvents; + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeSessionStateHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeSessionStateHandler.java new file mode 100644 index 0000000000..eb43ece9aa --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChangeSessionStateHandler.java @@ -0,0 +1,157 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Abstract command handler implementation to start or stop one or more trace sessions. + *

+ * + * @author Bernd Hufmann + */ +public abstract class ChangeSessionStateHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The list of session components the command is to be executed on. + */ + protected List fSessions = new ArrayList<>(); + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * @return new required state. + */ + public abstract TraceSessionState getNewState(); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Performs the state change on given session. + * + * @param session + * - a session which state is to be changed + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public abstract void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException; + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + return false; + } + + fLock.lock(); + try { + + final List sessions = new ArrayList<>(); + sessions.addAll(fSessions); + + Job job = new Job(Messages.TraceControl_ChangeSessionStateJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + for (Iterator iterator = sessions.iterator(); iterator.hasNext();) { + + // Start all selected sessions + TraceSessionComponent session = iterator.next(); + changeState(session, monitor); + + // Set Session state + session.setSessionState(getNewState()); + session.fireComponentChanged(session); + } + } catch (ExecutionException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeSessionStateFailure, e); + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + List sessions = new ArrayList<>(0); + + // Check if one or more session are selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceSessionComponent) { + // Add only TraceSessionComponents that are inactive and not destroyed + TraceSessionComponent session = (TraceSessionComponent) element; + if ((session.getSessionState() != getNewState()) && (!session.isDestroyed())) { + sessions.add(session); + } + } + } + } + boolean isEnabled = !sessions.isEmpty(); + fLock.lock(); + try { + fSessions = null; + if (isEnabled) { + fSessions = sessions; + } + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChannelCommandParameter.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChannelCommandParameter.java new file mode 100644 index 0000000000..fc0f7638e5 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ChannelCommandParameter.java @@ -0,0 +1,66 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; + +/** + * Class containing parameter for the command execution. + * + * @author Bernd Hufmann + */ +public class ChannelCommandParameter extends CommandParameter { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + private TraceChannelComponent fChannel; + + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param session - a trace session component. + * @param channel - a trace channel component + */ + public ChannelCommandParameter(TraceSessionComponent session, TraceChannelComponent channel) { + super(session); + fChannel = channel; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * @return the trace channel component + */ + public TraceChannelComponent getChannel() { + return fChannel; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public ChannelCommandParameter clone() { + ChannelCommandParameter clone = (ChannelCommandParameter) super.clone(); + clone.fChannel = fChannel; + return clone; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CommandParameter.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CommandParameter.java new file mode 100644 index 0000000000..a469561380 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CommandParameter.java @@ -0,0 +1,69 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; + +/** + * Class containing parameter for the command execution. + * + * @author Bernd Hufmann + */ +public class CommandParameter implements Cloneable { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The trace session component. + */ + private TraceSessionComponent fSession; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param session a trace session component. + */ + public CommandParameter(TraceSessionComponent session) { + fSession = session; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * @return the session component. + */ + public TraceSessionComponent getSession() { + return fSession; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public CommandParameter clone() { + CommandParameter clone = null; + try { + clone = (CommandParameter) super.clone(); + clone.fSession = fSession; + } catch (CloneNotSupportedException e) { + } + return clone; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ConnectHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ConnectHandler.java new file mode 100644 index 0000000000..b779adaab5 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ConnectHandler.java @@ -0,0 +1,53 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; + +/** + *

+ * Command handler implementation to connect to a target host. + *

+ * + * @author Bernd Hufmann + */ +public class ConnectHandler extends BaseNodeHandler { + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + fLock.lock(); + try { + fTargetNode.connect(); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + boolean isEnabled = false; + fLock.lock(); + try { + isEnabled = (super.isEnabled() && (fTargetNode.getTargetNodeState() == TargetNodeState.DISCONNECTED)); + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CreateSessionHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CreateSessionHandler.java new file mode 100644 index 0000000000..866670017a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/CreateSessionHandler.java @@ -0,0 +1,118 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.window.Window; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.ICreateSessionDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to create a trace session. + *

+ * + * @author Bernd Hufmann + */ +public class CreateSessionHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The trace session group the command is to be executed on. + */ + private TraceSessionGroup fSessionGroup = null; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + fLock.lock(); + try { + final TraceSessionGroup sessionGroup = fSessionGroup; + + // Open dialog box for the node name and address + final ICreateSessionDialog dialog = TraceControlDialogFactory.getInstance().getCreateSessionDialog(); + dialog.initialize(sessionGroup); + + if (dialog.open() != Window.OK) { + return null; + } + + Job job = new Job(Messages.TraceControl_CreateSessionJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + sessionGroup.createSession(dialog.getParameters(), monitor); + } catch (ExecutionException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateSessionFailure, e); + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceSessionGroup sessionGroup = null; + + // Check if the session group project is selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + Object element = ((StructuredSelection) selection).getFirstElement(); + sessionGroup = (element instanceof TraceSessionGroup) ? (TraceSessionGroup) element : null; + } + + boolean isEnabled = sessionGroup != null; + fLock.lock(); + try { + fSessionGroup = null; + if(isEnabled) { + fSessionGroup = sessionGroup; + } + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DeleteHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DeleteHandler.java new file mode 100644 index 0000000000..b9437e5838 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DeleteHandler.java @@ -0,0 +1,57 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; + +/** + *

+ * Command handler implementation to delete a target host. + *

+ * + * @author Bernd Hufmann + */ +public class DeleteHandler extends BaseNodeHandler { + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + fLock.lock(); + try { + ITraceControlComponent root = fTargetNode.getParent(); + fTargetNode.removeAllChildren(); + fTargetNode.deregister(); + root.removeChild(fTargetNode); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + boolean isEnabled = false; + fLock.lock(); + try { + isEnabled = (super.isEnabled() && (fTargetNode.getTargetNodeState() == TargetNodeState.DISCONNECTED)); + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DestroySessionHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DestroySessionHandler.java new file mode 100644 index 0000000000..2735d930e3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DestroySessionHandler.java @@ -0,0 +1,129 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IConfirmDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Command handler implementation to destroy one or more trace sessions. + *

+ * + * @author Bernd Hufmann + */ +public class DestroySessionHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The list of session components the command is to be executed on. + */ + private final List fSessions = new ArrayList<>(); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + return false; + } + // Get user confirmation + IConfirmDialog dialog = TraceControlDialogFactory.getInstance().getConfirmDialog(); + if (!dialog.openConfirm(window.getShell(), + Messages.TraceControl_DestroyConfirmationTitle, + Messages.TraceControl_DestroyConfirmationMessage)) { + + return null; + } + + Job job = new Job(Messages.TraceControl_DestroySessionJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + // Make a copy of the list of sessions to avoid ConcurrentModificationException when iterating + // over fSessions, since fSessions is modified in another thread triggered by the tree viewer refresh + // after removing a session. + TraceSessionComponent[] sessions = fSessions.toArray(new TraceSessionComponent[fSessions.size()]); + + for (int i = 0; i < sessions.length; i++) { + // Destroy all selected sessions + TraceSessionComponent session = sessions[i]; + TraceSessionGroup sessionGroup = (TraceSessionGroup)session.getParent(); + sessionGroup.destroySession(session, monitor); + } + } catch (ExecutionException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_DestroySessionFailure, e); + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + + return null; + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + fSessions.clear(); + + // Check if one or more session are selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceSessionComponent) { + // Add only TraceSessionComponents that are inactive and not destroyed + TraceSessionComponent session = (TraceSessionComponent) element; + if ((session.getSessionState() == TraceSessionState.INACTIVE) && (!session.isDestroyed())) { + fSessions.add((TraceSessionComponent)element); + } + } + } + } + return !fSessions.isEmpty(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableChannelHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableChannelHandler.java new file mode 100644 index 0000000000..cc1337fe12 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableChannelHandler.java @@ -0,0 +1,47 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; + +/** + *

+ * Command handler implementation to disable one or more trace channels per session and domain. + *

+ * + * @author Bernd Hufmann + */ +public class DisableChannelHandler extends ChangeChannelStateHandler { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + protected TraceEnablement getNewState() { + return TraceEnablement.DISABLED; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void changeState(TraceDomainComponent domain, List channelNames, IProgressMonitor monitor) throws ExecutionException { + domain.disableChannels(channelNames, monitor); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableEventHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableEventHandler.java new file mode 100644 index 0000000000..8503b8b76c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisableEventHandler.java @@ -0,0 +1,47 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; + +/** + *

+ * Command handler implementation to disable one or more events session, domain and channel. + *

+ * + * @author Bernd Hufmann + */ +public class DisableEventHandler extends ChangeEventStateHandler { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + protected TraceEnablement getNewState() { + return TraceEnablement.DISABLED; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void changeState(TraceChannelComponent channel, List eventNames, IProgressMonitor monitor) throws ExecutionException{ + channel.disableEvent(eventNames, monitor); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisconnectHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisconnectHandler.java new file mode 100644 index 0000000000..24c0db0329 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DisconnectHandler.java @@ -0,0 +1,53 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; + +/** + *

+ * Command handler implementation to disconnect from a target host. + *

+ * + * @author Bernd Hufmann + */ +public class DisconnectHandler extends BaseNodeHandler { + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + fLock.lock(); + try { + fTargetNode.disconnect(); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + boolean isEnabled = false; + fLock.lock(); + try { + isEnabled = super.isEnabled() && (fTargetNode.getTargetNodeState() == TargetNodeState.CONNECTED); + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DomainCommandParameter.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DomainCommandParameter.java new file mode 100644 index 0000000000..f233c55572 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/DomainCommandParameter.java @@ -0,0 +1,66 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; + +/** + * Class containing parameter for the command execution. + * + * @author Bernd Hufmann + */ +public class DomainCommandParameter extends CommandParameter { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + private TraceDomainComponent fDomain; + + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param session - a trace session component. + * @param domain - a trace domain component + */ + public DomainCommandParameter(TraceSessionComponent session, TraceDomainComponent domain) { + super(session); + fDomain = domain; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * @return the trace domain component + */ + public TraceDomainComponent getDomain() { + return fDomain; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public DomainCommandParameter clone() { + DomainCommandParameter clone = (DomainCommandParameter) super.clone(); + clone.fDomain = fDomain; + return clone; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelHandler.java new file mode 100644 index 0000000000..4c44129966 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelHandler.java @@ -0,0 +1,47 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; + +/** + *

+ * Command handler implementation to enable one or more trace channels per session and domain. + *

+ * + * @author Bernd Hufmann + */ +public class EnableChannelHandler extends ChangeChannelStateHandler { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + protected TraceEnablement getNewState() { + return TraceEnablement.ENABLED; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void changeState(TraceDomainComponent domain, List channelNames, IProgressMonitor monitor) throws ExecutionException { + domain.enableChannels(channelNames, null, monitor); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnDomainHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnDomainHandler.java new file mode 100644 index 0000000000..a718662837 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnDomainHandler.java @@ -0,0 +1,105 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to enable a trace channel for known domain. + *

+ * + * @author Bernd Hufmann + */ +public class EnableChannelOnDomainHandler extends BaseEnableChannelHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void enableChannel(CommandParameter param, List channelNames, IChannelInfo info, boolean isKernel, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof DomainCommandParameter) { + ((DomainCommandParameter)param).getDomain().enableChannels(channelNames, info, monitor); + } + } + + @Override + public TraceDomainComponent getDomain(CommandParameter param) { + if (param instanceof DomainCommandParameter) { + return ((DomainCommandParameter)param).getDomain(); + } + return null; + } + + @Override + public boolean isEnabled() { + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceDomainComponent domain = null; + TraceSessionComponent session = null; + + // Check if one domain is selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceDomainComponent) { + TraceDomainComponent tmpDomain = (TraceDomainComponent) element; + session = (TraceSessionComponent) tmpDomain.getParent(); + + // Add only TraceDomainComponent whose TraceSessionComponent parent is inactive and not destroyed + if ((session.getSessionState() == TraceSessionState.INACTIVE) && (!session.isDestroyed())) { + domain = tmpDomain; + } + } + } + } + + boolean isEnabled = domain != null; + + fLock.lock(); + try { + fParam = null; + if (isEnabled) { + fParam = new DomainCommandParameter(session, domain); + } + } finally { + fLock.unlock(); + } + + return isEnabled; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnSessionHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnSessionHandler.java new file mode 100644 index 0000000000..1f22ff788d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableChannelOnSessionHandler.java @@ -0,0 +1,94 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to enable a trace channel for unknown domain + * (on session level). + *

+ * + * @author Bernd Hufmann + */ +public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + @Override + public void enableChannel(CommandParameter param, List channelNames, IChannelInfo info, boolean isKernel, IProgressMonitor monitor) throws ExecutionException { + param.getSession().enableChannels(channelNames, info, isKernel, monitor); + } + + @Override + public TraceDomainComponent getDomain(CommandParameter param) { + return null; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceSessionComponent session = null; + // Check if one session is selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceSessionComponent) { + // Add only TraceSessionComponents that are inactive and not destroyed + TraceSessionComponent tmpSession = (TraceSessionComponent) element; + if ((tmpSession.getSessionState() == TraceSessionState.INACTIVE) && (!tmpSession.isDestroyed())) { + session = tmpSession; + } + } + } + } + boolean isEnabled = session != null; + + fLock.lock(); + try { + fParam = null; + if (isEnabled) { + fParam = new CommandParameter(session); + } + } finally { + fLock.unlock(); + } + + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventHandler.java new file mode 100644 index 0000000000..fc59ad9714 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventHandler.java @@ -0,0 +1,47 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; + +/** + *

+ * Command handler implementation to enable one or more events session, domain and channel. + *

+ * + * @author Bernd Hufmann + */ +public class EnableEventHandler extends ChangeEventStateHandler { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + protected TraceEnablement getNewState() { + return TraceEnablement.ENABLED; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + protected void changeState(TraceChannelComponent channel, List eventNames, IProgressMonitor monitor) throws ExecutionException{ + channel.enableEvents(eventNames, monitor); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnChannelHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnChannelHandler.java new file mode 100644 index 0000000000..538c2b4c3c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnChannelHandler.java @@ -0,0 +1,122 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to enable events for a known channel. + *

+ * + * @author Bernd Hufmann + */ +public class EnableEventOnChannelHandler extends BaseEnableEventHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void enableEvents(CommandParameter param, List eventNames, boolean isKernel, String filterExression, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof ChannelCommandParameter) { + ((ChannelCommandParameter)param).getChannel().enableEvents(eventNames, filterExression, monitor); + } + } + + @Override + public void enableSyscalls(CommandParameter param, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof ChannelCommandParameter) { + ((ChannelCommandParameter)param).getChannel().enableSyscalls(monitor); + } + } + + @Override + public void enableProbe(CommandParameter param, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof ChannelCommandParameter) { + ((ChannelCommandParameter)param).getChannel().enableProbe(eventName, isFunction, probe, monitor); + } + } + + @Override + public void enableLogLevel(CommandParameter param, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExression, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof ChannelCommandParameter) { + ((ChannelCommandParameter)param).getChannel().enableLogLevel(eventName, logLevelType, level, filterExression, monitor); + } + } + + @Override + public TraceDomainComponent getDomain(CommandParameter param) { + if (param instanceof ChannelCommandParameter) { + return (TraceDomainComponent) ((ChannelCommandParameter)param).getChannel().getParent(); + } + return null; + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceChannelComponent channel = null; + TraceSessionComponent session = null; + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceChannelComponent) { + // Add only if corresponding TraceSessionComponents is inactive and not destroyed + TraceChannelComponent tmpChannel = (TraceChannelComponent) element; + session = tmpChannel.getSession(); + if(!session.isDestroyed()) { + channel = tmpChannel; + } + } + } + } + + boolean isEnabled = (channel != null); + fLock.lock(); + try { + fParam = null; + if(isEnabled) { + fParam = new ChannelCommandParameter(session, channel); + } + } finally { + fLock.unlock(); + } + return isEnabled; + } +} + diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnDomainHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnDomainHandler.java new file mode 100644 index 0000000000..1abb3fcea1 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnDomainHandler.java @@ -0,0 +1,118 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to enable events for a known domain and default channel 'channel0' + * (which will be created if doesn't exist). + *

+ * + * @author Bernd Hufmann + */ +public class EnableEventOnDomainHandler extends BaseEnableEventHandler { + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void enableEvents(CommandParameter param, List eventNames, boolean isKernel, String filterExression, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof DomainCommandParameter) { + ((DomainCommandParameter)param).getDomain().enableEvents(eventNames, monitor); + } + } + + @Override + public void enableSyscalls(CommandParameter param, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof DomainCommandParameter) { + ((DomainCommandParameter)param).getDomain().enableSyscalls(monitor); + } + } + + @Override + public void enableProbe(CommandParameter param, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof DomainCommandParameter) { + ((DomainCommandParameter)param).getDomain().enableProbe(eventName, isFunction, probe, monitor); + } + } + + @Override + public void enableLogLevel(CommandParameter param, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExression, IProgressMonitor monitor) throws ExecutionException { + if (param instanceof DomainCommandParameter) { + ((DomainCommandParameter)param).getDomain().enableLogLevel(eventName, logLevelType, level, filterExression, monitor); + } + } + + @Override + public TraceDomainComponent getDomain(CommandParameter param) { + if (param instanceof DomainCommandParameter) { + return ((DomainCommandParameter)param).getDomain(); + } + return null; + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceDomainComponent domain = null; + TraceSessionComponent session = null; + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceDomainComponent) { + // Add only if corresponding TraceSessionComponents is inactive and not destroyed + TraceDomainComponent tmpDomain = (TraceDomainComponent) element; + session = tmpDomain.getSession(); + if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) { + domain = tmpDomain; + } + } + } + } + + boolean isEnabled = (domain != null); + fLock.lock(); + try { + fParam = null; + if(isEnabled) { + fParam = new DomainCommandParameter(session, domain); + } + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnSessionHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnSessionHandler.java new file mode 100644 index 0000000000..dc4c89b86c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EnableEventOnSessionHandler.java @@ -0,0 +1,109 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to enable events for a known session and default channel 'channel0' + * (which will be created if doesn't exist). + *

+ * + * @author Bernd Hufmann + */ +public class EnableEventOnSessionHandler extends BaseEnableEventHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + //------------------------------------------------------------------------- + // Operations + // ------------------------------------------------------------------------ + + @Override + public void enableEvents(CommandParameter param, List eventNames, boolean isKernel, String filterExpression, IProgressMonitor monitor) throws ExecutionException { + param.getSession().enableEvents(eventNames, isKernel, filterExpression, monitor); + } + + @Override + public void enableSyscalls(CommandParameter param, IProgressMonitor monitor) throws ExecutionException { + param.getSession().enableSyscalls(monitor); + } + + @Override + public void enableProbe(CommandParameter param, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException { + param.getSession().enableProbe(eventName, isFunction, probe, monitor); + } + + @Override + public void enableLogLevel(CommandParameter param, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExpression, IProgressMonitor monitor) throws ExecutionException { + param.getSession().enableLogLevel(eventName, logLevelType, level, filterExpression, monitor); + } + + @Override + public TraceDomainComponent getDomain(CommandParameter param) { + return null; + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceSessionComponent session = null; + // Check if one session is selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceSessionComponent) { + // Add only if corresponding TraceSessionComponents is inactive and not destroyed + TraceSessionComponent tmpSession = (TraceSessionComponent) element; + if(tmpSession.getSessionState() == TraceSessionState.INACTIVE && !tmpSession.isDestroyed()) { + session = tmpSession; + } + } + } + } + boolean isEnabled = (session != null); + fLock.lock(); + try { + fParam = null; + if(isEnabled) { + fParam = new CommandParameter(session); + } + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EventCommandParameter.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EventCommandParameter.java new file mode 100644 index 0000000000..411e061e07 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/EventCommandParameter.java @@ -0,0 +1,65 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; + +/** + * Class containing parameter for a command execution. + * + * @author Bernd Hufmann + */ +public class EventCommandParameter extends CommandParameter { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + private TraceEventComponent fEvent; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param session - a trace session component. + * @param event - a trace event component + */ + public EventCommandParameter(TraceSessionComponent session, TraceEventComponent event) { + super(session); + fEvent = event; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * @return the trace event component + */ + public TraceEventComponent getEvent() { + return fEvent; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public EventCommandParameter clone() { + EventCommandParameter clone = (EventCommandParameter) super.clone(); + clone.fEvent = fEvent; + return clone; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ExecuteCommandScriptHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ExecuteCommandScriptHandler.java new file mode 100644 index 0000000000..1db9731470 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ExecuteCommandScriptHandler.java @@ -0,0 +1,116 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.window.Window; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.ISelectCommandScriptDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to execute commands of a command script. + *

+ * + * @author Bernd Hufmann + */ +public class ExecuteCommandScriptHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The trace session group the command is to be executed on. + */ + private TraceSessionGroup fSessionGroup = null; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + fLock.lock(); + try { + final TraceSessionGroup sessionGroup = fSessionGroup; + + // Open dialog box for the node name and address + final ISelectCommandScriptDialog dialog = TraceControlDialogFactory.getInstance().getCommandScriptDialog(); + + if (dialog.open() != Window.OK) { + return null; + } + + Job job = new Job(Messages.TraceControl_ExecuteScriptJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + sessionGroup.executeCommands(monitor, dialog.getCommands()); + } catch (ExecutionException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateSessionFailure, e); + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TraceSessionGroup sessionGroup = null; + + // Check if the session group project is selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + Object element = ((StructuredSelection) selection).getFirstElement(); + sessionGroup = (element instanceof TraceSessionGroup) ? (TraceSessionGroup) element : null; + } + + boolean isEnabled = sessionGroup != null; + fLock.lock(); + try { + fSessionGroup = null; + if(isEnabled) { + fSessionGroup = sessionGroup; + } + } finally { + fLock.unlock(); + } + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ImportHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ImportHandler.java new file mode 100644 index 0000000000..99ea37c732 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/ImportHandler.java @@ -0,0 +1,390 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of streamed traces + * Patrick Tasse - Add support for source location + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.MultiStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.core.runtime.URIUtil; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.dialogs.MessageDialogWithToggle; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.window.Window; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.LttngRelaydConnectionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.LttngRelaydConnectionManager; +import org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.LttngRelaydConsumer; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.IImportDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.ImportFileInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.internal.tmf.ui.project.wizards.importtrace.ImportTraceWizard; +import org.eclipse.linuxtools.tmf.core.TmfCommonConstants; +import org.eclipse.linuxtools.tmf.core.project.model.TmfTraceImportException; +import org.eclipse.linuxtools.tmf.core.project.model.TraceTypeHelper; +import org.eclipse.linuxtools.tmf.ctf.core.CtfConstants; +import org.eclipse.linuxtools.tmf.ui.project.model.TmfOpenTraceHelper; +import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectElement; +import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectRegistry; +import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement; +import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceFolder; +import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceTypeUIUtils; +import org.eclipse.linuxtools.tmf.ui.project.model.TmfTracesFolder; +import org.eclipse.linuxtools.tmf.ui.project.model.TraceUtils; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; +import org.eclipse.rse.services.files.IFileService; +import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; +import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Command handler implementation to import traces from a (remote) session to a + * tracing project. + *

+ * + * @author Bernd Hufmann + */ +public class ImportHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** Name of default project to import traces to */ + public static final String DEFAULT_REMOTE_PROJECT_NAME = "Remote"; //$NON-NLS-1$ + + /** The preference key to remeber whether or not the user wants the notification shown next time **/ + private static final String NOTIFY_IMPORT_STREAMED_PREF_KEY = "NOTIFY_IMPORT_STREAMED"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The command parameter + */ + protected CommandParameter fParam; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + return false; + } + + fLock.lock(); + try { + final CommandParameter param = fParam.clone(); + + // create default project + IProject project = TmfProjectRegistry.createProject(DEFAULT_REMOTE_PROJECT_NAME, null, null); + + if (param.getSession().isLiveTrace()) { + importLiveTrace(new LttngRelaydConnectionInfo(param.getSession().getLiveUrl(), param.getSession().getLivePort(), param.getSession().getName()), project); + return null; + } else if (param.getSession().isStreamedTrace()) { + + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + String notify = store.getString(NOTIFY_IMPORT_STREAMED_PREF_KEY); + if (!MessageDialogWithToggle.ALWAYS.equals(notify)) { + MessageDialogWithToggle.openInformation(window.getShell(), null, Messages.TraceControl_ImportDialogStreamedTraceNotification, Messages.TraceControl_ImportDialogStreamedTraceNotificationToggle, false, store, NOTIFY_IMPORT_STREAMED_PREF_KEY); + } + + // Streamed trace + TmfProjectElement projectElement = TmfProjectRegistry.getProject(project, true); + TmfTraceFolder traceFolder = projectElement.getTracesFolder(); + + ImportTraceWizard wizard = new ImportTraceWizard(); + wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(traceFolder)); + WizardDialog dialog = new WizardDialog(window.getShell(), wizard); + dialog.open(); + return null; + } + + // Remote trace + final IImportDialog dialog = TraceControlDialogFactory.getInstance().getImportDialog(); + dialog.setSession(param.getSession()); + dialog.setDefaultProject(DEFAULT_REMOTE_PROJECT_NAME); + + if (dialog.open() != Window.OK) { + return null; + } + + Job job = new Job(Messages.TraceControl_ImportJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + + MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, Messages.TraceControl_ImportFailure, null); + List traces = dialog.getTracePathes(); + IProject selectedProject = dialog.getProject(); + for (Iterator iterator = traces.iterator(); iterator.hasNext();) { + try { + + if (monitor.isCanceled()) { + status.add(Status.CANCEL_STATUS); + break; + } + + ImportFileInfo remoteFile = iterator.next(); + + downloadTrace(remoteFile, selectedProject, monitor); + + // Set trace type + IFolder traceFolder = remoteFile.getDestinationFolder(); + + IResource file = traceFolder.findMember(remoteFile.getLocalTraceName()); + + if (file != null) { + TraceTypeHelper helper = null; + + try { + helper = TmfTraceTypeUIUtils.selectTraceType(file.getLocation().toOSString(), null, null); + } catch (TmfTraceImportException e) { + // the trace did not match any trace type + } + + if (helper != null) { + status.add(TmfTraceTypeUIUtils.setTraceType(file, helper)); + } + + try { + final String scheme = "sftp"; //$NON-NLS-1$ + String host = remoteFile.getImportFile().getHost().getName(); + int port = remoteFile.getImportFile().getParentRemoteFileSubSystem().getConnectorService().getPort(); + String path = remoteFile.getImportFile().getAbsolutePath(); + if (file instanceof IFolder) { + path += IPath.SEPARATOR; + } + URI uri = new URI(scheme, null, host, port, path, null, null); + String sourceLocation = URIUtil.toUnencodedString(uri); + file.setPersistentProperty(TmfCommonConstants.SOURCE_LOCATION, sourceLocation); + } catch (URISyntaxException e) { + } + } + } catch (ExecutionException e) { + status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ImportFailure, e)); + } catch (CoreException e) { + status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ImportFailure, e)); + } + } + return status; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + // Check if one or more session are selected + ISelection selection = page.getSelection(ControlView.ID); + TraceSessionComponent session = null; + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceSessionComponent) { + // Add only TraceSessionComponents that are inactive and not + // destroyed + TraceSessionComponent tmpSession = (TraceSessionComponent) element; + if ((tmpSession.isSnapshotSession() || tmpSession.isLiveTrace() || (tmpSession.getSessionState() == TraceSessionState.INACTIVE)) && (!tmpSession.isDestroyed())) { + session = tmpSession; + } + } + } + } + boolean isEnabled = session != null; + + fLock.lock(); + try { + fParam = null; + if (isEnabled) { + fParam = new CommandParameter(session); + } + } finally { + fLock.unlock(); + } + return isEnabled; + } + + // ------------------------------------------------------------------------ + // Helper methods + // ------------------------------------------------------------------------ + + /** + * Downloads a trace from the remote host to the given project. + * + * @param trace + * - trace information of trace to import + * @param project + * - project to import to + * @param monitor + * - a progress monitor + * @throws ExecutionException + */ + private static void downloadTrace(ImportFileInfo trace, IProject project, IProgressMonitor monitor) + throws ExecutionException { + try { + IRemoteFileSubSystem fsss = trace.getImportFile().getParentRemoteFileSubSystem(); + + IFolder traceFolder = project.getFolder(TmfTracesFolder.TRACES_FOLDER_NAME); + if (!traceFolder.exists()) { + throw new ExecutionException(Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTracesFolder.TRACES_FOLDER_NAME + ")"); //$NON-NLS-1$//$NON-NLS-2$ + } + + IFolder destinationFolder = trace.getDestinationFolder(); + TraceUtils.createFolder(destinationFolder, monitor); + + String traceName = trace.getLocalTraceName(); + IFolder folder = destinationFolder.getFolder(traceName); + if (folder.exists()) { + if (!trace.isOverwrite()) { + throw new ExecutionException(Messages.TraceControl_ImportDialogTraceAlreadyExistError + ": " + traceName); //$NON-NLS-1$ + } + } else { + folder.create(true, true, null); + } + + IRemoteFile[] sources = fsss.list(trace.getImportFile(), IFileService.FILE_TYPE_FILES, new NullProgressMonitor()); + SubMonitor subMonitor = SubMonitor.convert(monitor, sources.length); + subMonitor.beginTask(Messages.TraceControl_DownloadTask, sources.length); + + for (int i = 0; i < sources.length; i++) { + if (subMonitor.isCanceled()) { + monitor.setCanceled(true); + return; + } + String destination = folder.getLocation().addTrailingSeparator().append(sources[i].getName()).toOSString(); + subMonitor.setTaskName(Messages.TraceControl_DownloadTask + ' ' + traceName + '/' + sources[i].getName()); + fsss.download(sources[i], destination, null, subMonitor.newChild(1)); + } + } catch (SystemMessageException e) { + throw new ExecutionException(e.toString(), e); + } catch (CoreException e) { + throw new ExecutionException(e.toString(), e); + } + } + + private static void importLiveTrace(final LttngRelaydConnectionInfo connectionInfo, final IProject project) { + Job job = new Job(Messages.TraceControl_ImportJob) { + + @Override + protected IStatus run(final IProgressMonitor monitor) { + try { + // We initiate the connection first so that we can retrieve the trace path + LttngRelaydConsumer lttngRelaydConsumer = LttngRelaydConnectionManager.getInstance().getConsumer(connectionInfo); + try { + lttngRelaydConsumer.connect(); + } catch (CoreException e) { + new Status(IStatus.ERROR, Activator.PLUGIN_ID, org.eclipse.linuxtools.internal.lttng2.control.ui.relayd.Messages.LttngRelaydConnectionManager_ConnectionError, e); + } + initializeTraceResource(connectionInfo, lttngRelaydConsumer.getTracePath(), project); + return Status.OK_STATUS; + } catch (CoreException | TmfTraceImportException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ImportHandler_LiveTraceInitError, e); + } + } + + }; + job.setSystem(true); + job.schedule(); + } + + + private static void initializeTraceResource(final LttngRelaydConnectionInfo connectionInfo, final String tracePath, final IProject project) throws CoreException, TmfTraceImportException { + IFolder folder = project.getFolder(TmfTracesFolder.TRACES_FOLDER_NAME); + IFolder traceFolder = folder.getFolder(connectionInfo.getSessionName()); + Path location = new Path(tracePath); + IStatus result = ResourcesPlugin.getWorkspace().validateLinkLocation(folder, location); + if (result.isOK()) { + traceFolder.createLink(location, IResource.REPLACE, new NullProgressMonitor()); + } else { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, result.getMessage())); + } + + TraceTypeHelper selectedTraceType = TmfTraceTypeUIUtils.selectTraceType(location.toOSString(), null, null); + // No trace type was determined. + TmfTraceTypeUIUtils.setTraceType(traceFolder, selectedTraceType); + + final TmfProjectElement projectElement = TmfProjectRegistry.getProject(project, true); + final TmfTraceFolder tracesFolder = projectElement.getTracesFolder(); + final List traces = tracesFolder.getTraces(); + TmfTraceElement found = null; + for (TmfTraceElement candidate : traces) { + if (candidate.getName().equals(connectionInfo.getSessionName())) { + found = candidate; + } + } + + if (found == null) { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ImportHandler_LiveTraceElementError)); + } + + // Properties used to be able to reopen a trace in live mode + traceFolder.setPersistentProperty(CtfConstants.LIVE_HOST, connectionInfo.getHost()); + traceFolder.setPersistentProperty(CtfConstants.LIVE_PORT, Integer.toString(connectionInfo.getPort())); + traceFolder.setPersistentProperty(CtfConstants.LIVE_SESSION_NAME, connectionInfo.getSessionName()); + + final TmfTraceElement finalTrace = found; + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + TmfOpenTraceHelper.openTraceFromElement(finalTrace); + } + }); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java new file mode 100644 index 0000000000..04bfccea7a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java @@ -0,0 +1,197 @@ +/********************************************************************** + * Copyright (c) 2012, 2014 Ericsson and others + * + * 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: + * Bernd Hufmann - Initial API and implementation + * Anna Dushistova(Montavista) - [382684] Allow reusing already defined connections that have Files and Shells subsystems + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.ArrayList; +import java.util.Arrays; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.window.Window; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.INewConnectionDialog; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; +import org.eclipse.rse.core.IRSESystemType; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + *

+ * Command handler for creation new connection for trace control. + *

+ * + * @author Bernd Hufmann + */ +public class NewConnectionHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * The trace control system type defined for LTTng version 2.0 and later. + */ + public static final String TRACE_CONTROL_SYSTEM_TYPE = "org.eclipse.linuxtools.internal.lttng2.ui.control.systemType"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The parent trace control component the new node will be added to. + */ + private ITraceControlComponent fRoot = null; + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + assert (fRoot != null); + + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) { + return false; + } + + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + + // get system type definition for LTTng 2.x connection + IRSESystemType sysType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(TRACE_CONTROL_SYSTEM_TYPE); + + // get all hosts for this system type + IHost[] hosts = getSuitableHosts(); + + // Open dialog box for the node name and address + final INewConnectionDialog dialog = TraceControlDialogFactory.getInstance().getNewConnectionDialog(); + dialog.setTraceControlParent(fRoot); + dialog.setHosts(hosts); + dialog.setPort(IRemoteSystemProxy.INVALID_PORT_NUMBER); + + if (dialog.open() != Window.OK) { + return null; + } + + String hostName = dialog.getConnectionName(); + String hostAddress = dialog.getHostName(); + int port = dialog.getPort(); + + // get the singleton RSE registry + IHost host = null; + + for (int i = 0; i < hosts.length; i++) { + if (hosts[i].getAliasName().equals(hostName)) { + host = hosts[i]; + break; + } + } + + if (host == null) { + // if there's no host then we will create it + try { + // create the host object as an SSH Only connection + host = registry.createHost( + sysType, //System Type Name + hostName, //Connection name + hostAddress, //IP Address + "Connection to Host"); //description //$NON-NLS-1$ + } + catch (Exception e) { + MessageDialog.openError(window.getShell(), + Messages.TraceControl_EclipseCommandFailure, + Messages.TraceControl_NewNodeCreationFailure + " (" + hostName + ", " + hostAddress + ")" + ":\n" + e.toString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + return null; + } + } + + if (host != null) { + fLock.lock(); + try { + // successful creation of host + TargetNodeComponent node = null; + if (!fRoot.containsChild(hostName)) { + node = new TargetNodeComponent(hostName, fRoot, host); + node.setPort(port); + fRoot.addChild(node); + } + else { + node = (TargetNodeComponent)fRoot.getChild(hostName); + } + + node.connect(); + } finally { + fLock.unlock(); + } + } + return null; + } + + private static IHost[] getSuitableHosts() { + // need shells and files + ArrayList result = new ArrayList<>(); + ArrayList shellConnections = new ArrayList<>( + Arrays.asList(RSECorePlugin.getTheSystemRegistry() + .getHostsBySubSystemConfigurationCategory("shells"))); //$NON-NLS-1$ + + for (IHost connection : shellConnections) { + ISubSystem[] subSystems = connection.getSubSystems(); + for (int i = 0; i < subSystems.length; i++) { + if (subSystems[i] instanceof IFileServiceSubSystem) { + result.add(connection); + break; + } + } + } + + return result.toArray(new IHost[result.size()]); + } + + @Override + public boolean isEnabled() { + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + ITraceControlComponent root = null; + + // no need to verify part because it has been already done in getWorkbenchPage() + IWorkbenchPart part = page.getActivePart(); + root = ((ControlView) part).getTraceControlRoot(); + + boolean isEnabled = root != null; + + fLock.lock(); + try { + fRoot = null; + if (isEnabled) { + fRoot = root; + } + } finally { + fLock.unlock(); + } + + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/RefreshHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/RefreshHandler.java new file mode 100644 index 0000000000..ba28a4de72 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/RefreshHandler.java @@ -0,0 +1,105 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.Iterator; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to refresh node configuration. + *

+ * + * @author Bernd Hufmann + */ +public class RefreshHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The node component reference. + */ + private TargetNodeComponent fNode; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + fLock.lock(); + try { + fNode.refresh(); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + TargetNodeComponent node = null; + // Check if one or more session are selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceControlComponent) { + TraceControlComponent component = (TraceControlComponent) element; + boolean isConnected = component.getTargetNodeState() == TargetNodeState.CONNECTED; + if (isConnected) { + while ((component != null) && component.getClass() != TargetNodeComponent.class) { + component = (TraceControlComponent) component.getParent(); + } + if (component != null) { + node = (TargetNodeComponent) component; + } + } + } + } + } + + boolean isEnabled = node != null; + + fLock.lock(); + try { + fNode = null; + if (isEnabled) { + fNode = node; + } + } finally { + fLock.unlock(); + } + + return isEnabled; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/SnaphshotHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/SnaphshotHandler.java new file mode 100644 index 0000000000..25b52c4089 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/SnaphshotHandler.java @@ -0,0 +1,130 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.MultiStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.ui.IWorkbenchPage; + +/** + *

+ * Command handler implementation to record a snapshot. + *

+ * + * @author Bernd Hufmann + */ +public class SnaphshotHandler extends BaseControlViewHandler { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The list of session components the command is to be executed on. + */ + protected List fSessions = new ArrayList<>(); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + fLock.lock(); + try { + // Make a copy for thread safety + final List sessions = new ArrayList<>(); + sessions.addAll(fSessions); + + Job job = new Job(Messages.TraceControl_RecordSnapshotJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null); + for (Iterator iterator = sessions.iterator(); iterator.hasNext();) { + try { + // record snapshot for all selected sessions sequentially + TraceSessionComponent session = iterator.next(); + session.recordSnapshot(monitor); + if (monitor.isCanceled()) { + status.add(Status.CANCEL_STATUS); + break; + } + } catch (ExecutionException e) { + status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_RecordSnapshotFailure, e)); + } + } + return status; + } + }; + job.setUser(true); + job.schedule(); + } finally { + fLock.unlock(); + } + return null; + } + + @Override + public boolean isEnabled() { + // Get workbench page for the Control View + IWorkbenchPage page = getWorkbenchPage(); + if (page == null) { + return false; + } + + List sessions = new ArrayList<>(0); + + // Check if one session is selected + ISelection selection = page.getSelection(ControlView.ID); + if (selection instanceof StructuredSelection) { + StructuredSelection structered = ((StructuredSelection) selection); + for (Iterator iterator = structered.iterator(); iterator.hasNext();) { + Object element = iterator.next(); + if (element instanceof TraceSessionComponent) { + // Add only if corresponding TraceSessionComponent is an active snapshot session and not destroyed + TraceSessionComponent session = (TraceSessionComponent) element; + if(session.isSnapshotSession() && + session.getSessionState() == TraceSessionState.ACTIVE && + !session.isDestroyed()) { + sessions.add(session); + } + } + } + } + boolean isEnabled = !sessions.isEmpty(); + fLock.lock(); + try { + fSessions = null; + if (isEnabled) { + fSessions = sessions; + } + } finally { + fLock.unlock(); + } + return isEnabled; + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StartHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StartHandler.java new file mode 100644 index 0000000000..841cce33f4 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StartHandler.java @@ -0,0 +1,45 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; + +/** + *

+ * Command handler implementation to start one or more trace sessions. + *

+ * + * @author Bernd Hufmann + */ +public class StartHandler extends ChangeSessionStateHandler { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public TraceSessionState getNewState() { + return TraceSessionState.ACTIVE; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException { + session.startSession(monitor); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StopHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StopHandler.java new file mode 100644 index 0000000000..fc44dd676a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/StopHandler.java @@ -0,0 +1,45 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; + +/** + *

+ * Command handler implementation to stop one or more trace sessions. + *

+ * + * @author Bernd Hufmann + */ +public class StopHandler extends ChangeSessionStateHandler { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public TraceSessionState getNewState() { + return TraceSessionState.INACTIVE; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException { + session.stopSession(monitor); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/XmlMiValidationErrorHandler.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/XmlMiValidationErrorHandler.java new file mode 100644 index 0000000000..6f6f5f7f7b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/XmlMiValidationErrorHandler.java @@ -0,0 +1,49 @@ +/********************************************************************** + * 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: + * Jonathan Rajotte - Initial implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceMI; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/** + *

+ * Error handler for xml xsd validation while using machine interface mode + * in {@link LTTngControlServiceMI}. + *

+ * + * @author Jonathan Rajotte + */ +public class XmlMiValidationErrorHandler implements ErrorHandler { + + @Override + public void error(SAXParseException e) throws SAXException { + Activator.getDefault().logError(Messages.TraceControl_XmlValidationError, e); + throw new SAXException(Messages.TraceControl_XmlValidationError, e); + } + + @Override + public void fatalError(SAXParseException e) throws SAXException { + Activator.getDefault().logError(Messages.TraceControl_XmlValidationError, e); + throw new SAXException(Messages.TraceControl_XmlValidationError, e); + } + + @Override + public void warning(SAXParseException e) throws SAXException { + Activator.getDefault().logWarning(Messages.TraceControl_XmlValidationWarning, e); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/logging/ControlCommandLogger.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/logging/ControlCommandLogger.java new file mode 100644 index 0000000000..c308483c0b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/logging/ControlCommandLogger.java @@ -0,0 +1,117 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; + +/** + *

+ * Class to log control commands. + *

+ * + * @author Bernd Hufmann + */ +final public class ControlCommandLogger { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The bufferd writer reference + */ + private static BufferedWriter fTraceLog = null; + + // ------------------------------------------------------------------------ + // Constructor + // ------------------------------------------------------------------------ + private ControlCommandLogger() { + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * Initializes the logger class and opens the log file with the given parameter. + * @param filename - file name of logger output + * @param append - true to open log file in append mode else false (overwrite) + */ + public static void init(String filename, boolean append) { + if (fTraceLog != null) { + close(); + } + fTraceLog = openLogFile(filename, append); + } + + /** + * Closes the log file if open. + */ + public static void close() { + if (fTraceLog == null) { + return; + } + + try { + fTraceLog.close(); + fTraceLog = null; + } catch (IOException e) { + Activator.getDefault().logWarning("Can't close log file of the trace control", e); //$NON-NLS-1$ + } + } + + /** + * Logs a message to the log file. + * @param msg - message (e.g. command or command result) to log + */ + @SuppressWarnings("nls") + public static void log(String msg) { + long currentTime = System.currentTimeMillis(); + StringBuilder message = new StringBuilder("["); + message.append(currentTime / 1000); + message.append("."); + message.append(String.format("%1$03d", currentTime % 1000)); + message.append("] "); + message.append(msg); + if (fTraceLog != null) { + try { + fTraceLog.write(message.toString()); + fTraceLog.newLine(); + fTraceLog.flush(); + } catch (IOException e) { + Activator.getDefault().logError("Can't log message in log file of the tracer control", e); //$NON-NLS-1$ + } + } + } + + // ------------------------------------------------------------------------ + // Helper methods + // ------------------------------------------------------------------------ + /** + * Opens the trace log file with given name in the workspace root directory + * @param filename - file name of logger output + * @param append - true to open log file in append mode else false (overwrite) + * @return the buffer writer class or null if not successful + */ + private static BufferedWriter openLogFile(String filename, boolean append) { + BufferedWriter outfile = null; + try { + outfile = new BufferedWriter(new FileWriter(filename, append)); + } catch (IOException e) { + Activator.getDefault().logError("Can't open log file for logging of tracer control commands: " + filename, e); //$NON-NLS-1$ + } + return outfile; + } +} + diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/Messages.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/Messages.java new file mode 100644 index 0000000000..fd5210fa2c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/Messages.java @@ -0,0 +1,343 @@ +/******************************************************************************* + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + * Jonathan Rajotte - Updated for basic support of LTTng 2.6 machine interface + *******************************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages; + +import org.eclipse.osgi.util.NLS; + +/** + * Messages file for the trace control package. + * + * @author Bernd Hufmann + */ +@SuppressWarnings("javadoc") +public final class Messages extends NLS { + + private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.messages"; //$NON-NLS-1$ + + public static String EnableChannelDialog_DefaultMessage; + + public static String ImportHandler_LiveTraceElementError; + + public static String ImportHandler_LiveTraceInitError; + + // Failures + public static String TraceControl_ConnectionFailure; + public static String TraceControl_DisconnectionFailure; + public static String TraceControl_ExecutionCancelled; + public static String TraceControl_ExecutionFailure; + public static String TraceControl_ExecutionTimeout; + public static String TraceControl_ShellNotConnected; + + public static String TraceControl_CommandShellError; + public static String TraceControl_CommandError; + public static String TraceControl_UnexpectedCommandOutputFormat; + public static String TraceControl_UnexpectedNameError; + public static String TraceControl_UnexpectedPathError; + public static String TraceControl_UnexpectedNumberOfElementError; + public static String TraceControl_UnexpectedValueError; + + public static String TraceControl_UnsupportedVersionError; + public static String TraceControl_GettingVersionError; + + // Xml parsing related failures + public static String TraceControl_InvalidSchemaError; + public static String TraceControl_XmlDocumentBuilderError; + public static String TraceControl_XmlParsingError; + public static String TraceControl_XmlValidationError; + public static String TraceControl_XmlValidationWarning; + + // Xml machine interface failures + public static String TraceControl_MiInvalidNumberOfElementError; + public static String TraceControl_MiInvalidProviderError; + public static String TraceControl_MiMissingRequiredError; + public static String TraceControl_MiInvalidElementError; + public static String TraceControl_MiIllegalValueError; + + // Commands + public static String TraceControl_ErrorTitle; + public static String TraceControl_RetrieveNodeConfigurationJob; + public static String TraceControl_RetrieveNodeConfigurationFailure; + public static String TraceControl_ListSessionFailure; + public static String TraceControl_EclipseCommandFailure; + public static String TraceControl_NewNodeCreationFailure; + public static String TraceControl_CreateSessionJob; + public static String TraceControl_CreateSessionFailure; + + public static String TraceControl_DestroySessionJob; + public static String TraceControl_DestroySessionFailure; + public static String TraceControl_DestroyConfirmationTitle; + public static String TraceControl_DestroyConfirmationMessage; + + public static String TraceControl_ImportJob; + public static String TraceControl_DownloadTask; + public static String TraceControl_ImportFailure; + + public static String TraceControl_ChangeSessionStateJob; + public static String TraceControl_ChangeSessionStateFailure; + + public static String TraceControl_CreateChannelStateJob; + public static String TraceControl_CreateChannelStateFailure; + + public static String TraceControl_ChangeChannelStateJob; + public static String TraceControl_ChangeChannelStateFailure; + public static String TraceControl_ChangeEventStateJob; + public static String TraceControl_ChangeEventStateFailure; + + public static String TraceControl_EnableEventsJob; + public static String TraceControl_EnableEventsFailure; + public static String TraceControl_DisableEventsJob; + + public static String TraceControl_GetContextJob; + public static String TraceControl_GetContextFailure; + + public static String TraceControl_AddContextJob; + public static String TraceControl_AddContextFailure; + + public static String TraceControl_AddCalibrateJob; + public static String TraceControl_AddCalibrateFailure; + + public static String TraceControl_RecordSnapshotJob; + public static String TraceControl_RecordSnapshotFailure; + + // Dialogs + public static String TraceControl_NewDialogTitle; + public static String TraceControl_NewNodeExistingConnectionGroupName; + public static String TraceControl_NewNodeEditButtonName; + public static String TraceControl_NewNodeComboToolTip; + public static String TraceControl_NewNodeConnectionNameLabel; + public static String TraceControl_NewNodeConnectionNameTooltip; + public static String TraceControl_NewNodeHostNameLabel; + public static String TraceControl_NewNodeHostNameTooltip; + public static String TraceControl_NewNodePortLabel; + public static String TraceControl_NewNodePortTooltip; + public static String TraceControl_AlreadyExistsError; + + public static String TraceControl_CreateSessionDialogTitle; + public static String TraceControl_CreateSessionDialogMessage; + public static String TraceControl_CreateSessionNameLabel; + public static String TraceControl_CreateSessionNameTooltip; + public static String TraceControl_CreateSessionPathLabel; + public static String TraceControl_CreateSessionPathTooltip; + public static String TraceControl_CreateSessionNormalLabel; + public static String TraceControl_CreateSessionNormalTooltip; + public static String TraceControl_CreateSessionSnapshotLabel; + public static String TraceControl_CreateSessionSnapshotTooltip; + public static String TraceControl_CreateSessionLiveLabel; + public static String TraceControl_CreateSessionLiveTooltip; + + public static String TraceControl_CreateSessionConfigureStreamingButtonText; + public static String TraceControl_CreateSessionConfigureStreamingButtonTooltip; + public static String TraceControl_CreateSessionNoStreamingButtonText; + public static String TraceControl_CreateSessionNoStreamingButtonTooltip; + public static String TraceControl_CreateSessionTracePathText; + public static String TraceControl_CreateSessionTracePathTooltip; + public static String TraceControl_CreateSessionLinkButtonText; + public static String TraceControl_CreateSessionLinkButtonTooltip; + public static String TraceControl_CreateSessionProtocolLabelText; + public static String TraceControl_CreateSessionAddressLabelText; + public static String TraceControl_CreateSessionPortLabelText; + public static String TraceControl_CreateSessionControlUrlLabel; + public static String TraceControl_CreateSessionDataUrlLabel; + public static String TraceControl_CreateSessionCommonProtocolTooltip; + public static String TraceControl_CreateSessionControlAddressTooltip; + public static String TraceControl_CreateSessionControlPortTooltip; + public static String TraceControl_CreateSessionProtocolTooltip; + public static String TraceControl_CreateSessionDataAddressTooltip; + public static String TraceControl_CreateSessionDataPortTooltip; + public static String TraceControl_CreateSessionNoConsumertText; + public static String TraceControl_CreateSessionNoConsumertTooltip; + public static String TraceControl_CreateSessionDisableConsumertText; + public static String TraceControl_CreateSessionDisableConsumertTooltip; + public static String TraceControl_CreateSessionLiveConnectionLabel; + public static String TraceControl_CreateSessionLiveConnectionUrlTooltip; + public static String TraceControl_CreateSessionLiveConnectionPortTooltip; + public static String TraceControl_CreateSessionLiveDelayLabel; + public static String TraceControl_CreateSessionLiveDelayTooltip; + + public static String TraceControl_InvalidSessionNameError; + public static String TraceControl_SessionAlreadyExistsError; + public static String TraceControl_SessionPathAlreadyExistsError; + public static String TraceControl_InvalidSessionPathError; + public static String TraceControl_InvalidLiveDelayError; + public static String TraceControl_FileSubSystemError; + + public static String TraceControl_EnableChannelDialogTitle; + public static String TraceControl_EnableChannelNameLabel; + public static String TraceControl_EnableChannelNameTooltip; + public static String TraceControl_EnableChannelSubBufferSizeTooltip; + public static String TraceControl_EnableChannelNbSubBuffersTooltip; + public static String TraceControl_EnableChannelSwitchTimerTooltip; + public static String TraceControl_EnableChannelReadTimerTooltip; + public static String TraceControl_EnableChannelOutputTypeTooltip; + public static String TraceControl_EnableChannelDiscardModeGroupName; + public static String TraceControl_EnableChannelDiscardModeLabel; + public static String TraceControl_EnableChannelDiscardModeTooltip; + public static String TraceControl_EnableChannelOverwriteModeLabel; + public static String TraceControl_EnableChannelOverwriteModeTooltip; + public static String TraceControl_EnbleChannelMaxSizeTraceFilesTooltip; + public static String TraceControl_EnbleChannelMaxNumTraceFilesTooltip; + + public static String TraceControl_InvalidChannelNameError; + public static String TraceControl_ChannelAlreadyExistsError; + + public static String TraceControl_EnableEventsDialogTitle; + public static String TraceControl_EnableEventsSessionGroupName; + public static String TraceControl_EnableEventsChannelGroupName; + public static String TraceControl_EnableEventsSessionsTooltip; + public static String TraceControl_EnableEventsChannelsTooltip; + public static String TraceControl_EnableEventsNoSessionError; + public static String TraceControl_EnableEventsNoChannelError; + + public static String TraceControl_EnableGroupSelectionName; + public static String TraceControl_EnableEventsTracepointGroupName; + public static String TraceControl_EnableEventsTracepointTreeTooltip; + public static String TraceControl_EnableEventsTracepointTreeAllLabel; + public static String TraceControl_EnableEventsSyscallName; + public static String TraceControl_EnableEventsSyscallTooltip; + public static String TraceControl_EnableEventsProbeGroupName; + public static String TraceControl_EnableEventsEventNameLabel; + public static String TraceControl_EnableEventsProbeEventNameTooltip; + public static String TraceControl_EnableEventsProbeNameLabel; + public static String TraceControl_EnableEventsProbeNameTooltip; + public static String TraceControl_EnableEventsFucntionGroupName; + public static String TraceControl_EnableEventsFunctionEventNameTooltip; + public static String TraceControl_EnableEventsFunctionNameLabel; + + public static String TraceControl_EnableEventsWildcardGroupName; + public static String TraceControl_EnableEventsWildcardLabel; + public static String TraceControl_EnableEventsWildcardTooltip; + public static String TraceControl_EnableEventsLogLevelGroupName; + public static String TraceControl_EnableEventsLogLevelTypeName; + public static String TraceControl_EnableEventsLogLevelTypeTooltip; + public static String TraceControl_EnableEventsLogLevelOnlyTypeName; + public static String TraceControl_EnableEventsLogLevelOnlyTypeTooltip; + public static String TraceControl_EnableEventsLogLevelTooltip; + public static String TraceControl_EnableEventsLoglevelEventNameTooltip; + public static String TraceControl_EnableEventsFilterGroupName; + public static String TraceControl_EnableEventsFilterTooltip; + + public static String TraceControl_InvalidProbeNameError; + public static String TraceControl_InvalidWildcardError; + public static String TraceControl_InvalidLogLevelEventNameError; + public static String TraceControl_InvalidLogLevel; + + public static String TraceControl_AddContextDialogTitle; + public static String TraceControl_AddContextAvailableContextsLabel; + public static String TraceControl_AddContextAvailableContextsTooltip; + public static String TraceControl_AddContextAllLabel; + + public static String TraceControl_ImportDialogStreamedTraceNotification; + public static String TraceControl_ImportDialogStreamedTraceNotificationToggle; + public static String TraceControl_ImportDialogTitle; + public static String TraceControl_ImportDialogTracesGroupName; + public static String TraceControl_ImportDialogTracesTooltip; + public static String TraceControl_ImportDialogProjectsGroupName; + public static String TraceControl_ImportDialogProjectsTooltip; + public static String TraceControl_ImportDialogOverwriteButtonText; + public static String TraceControl_ImportDialogCreationError; + public static String TraceControl_ImportDialogNoProjectSelectedError; + public static String TraceControl_ImportDialogInvalidTracingProject; + public static String TraceControl_ImportDialogNoTraceSelectedError; + public static String TraceControl_ImportDialog_SelectAll; + public static String TraceControl_ImportDialog_DeselectAll; + + public static String TraceControl_ImportDialogConfirmationTitle; + public static String TraceControl_ImportDialogConfirmationOverwriteLabel; + public static String TraceControl_ImportDialogConfirmationRenameLabel; + public static String TraceControl_ImportDialogConfirmationNewNameLabel; + public static String TraceControl_InvalidTraceNameError; + public static String TraceControl_ImportDialogTraceAlreadyExistError; + + // Tree structure strings + public static String TraceControl_KernelDomainDisplayName; + public static String TraceControl_UstDisplayName; + public static String TraceControl_UstGlobalDomainDisplayName; + public static String TraceControl_UnknownDomainDisplayName; + public static String TraceControl_JULDomainDisplayName; + public static String TraceControl_AllSessionsDisplayName; + public static String TraceControl_SessionDisplayName; + public static String TraceControl_DomainDisplayName; + public static String TraceControl_BufferTypeDisplayName; + public static String TraceControl_ChannelDisplayName; + public static String TraceControl_EventDisplayName; + public static String TraceControl_ProviderDisplayName; + public static String TraceControl_KernelProviderDisplayName; + public static String TraceControl_SharedBuffersDisplayName; + public static String TraceControl_PerPidBuffersDisplayName; + public static String TraceControl_PerPidBuffersTooltip; + public static String TraceControl_PerUidBuffersDisplayName; + public static String TraceControl_PerUidBuffersTooltip; + + // Property names + public static String TraceControl_SessionNamePropertyName; + public static String TraceControl_EventNamePropertyName; + public static String TraceControl_EventTypePropertyName; + public static String TraceControl_LogLevelPropertyName; + public static String TraceControl_FieldsPropertyName; + public static String TraceControl_FilterPropertyName; + public static String TraceControl_StatePropertyName; + public static String TraceControl_VersionPropertyName; + public static String TraceControl_DomainNamePropertyName; + public static String TraceControl_BufferTypePropertyName; + public static String TraceControl_ChannelNamePropertyName; + public static String TraceControl_OverwriteModePropertyName; + public static String TraceControl_SubBufferSizePropertyName; + public static String TraceControl_NbSubBuffersPropertyName; + public static String TraceControl_SwitchTimerPropertyName; + public static String TraceControl_ReadTimerPropertyName; + public static String TraceControl_OutputTypePropertyName; + public static String TraceControl_HostNamePropertyName; + public static String TraceControl_HostAddressPropertyName; + public static String TraceControl_SessionPathPropertyName; + public static String TraceControl_SnapshotPathPropertyName; + public static String TraceControl_SnapshotNamePropertyName; + public static String TraceControl_SnapshotIdPropertyName; + public static String TraceControl_ProviderNamePropertyName; + public static String TraceControl_ProcessIdPropertyName; + public static String TraceControl_ProbeAddressPropertyName; + public static String TraceControl_ProbeOffsetPropertyName; + public static String TraceControl_ProbeSymbolPropertyName; + public static String TraceControl_MaxSizeTraceFilesPropertyName; + public static String TraceControl_MaxNumTraceFilesPropertyName; + public static String TraceControl_ConfigureMetadataChannelName; + + // Preferences + public static String TraceControl_TracingGroupPreference; + public static String TraceControl_LoggingPreference; + public static String TraceControl_LogfilePath; + public static String TraceControl_AppendLogfilePreference; + public static String TraceControl_CommandTimeout; + + public static String TraceControl_VerboseLevelsPreference; + public static String TraceControl_VerboseLevelNonePreference; + public static String TraceControl_VerboseLevelVerbosePreference; + public static String TraceControl_VerboseLevelVeryVerbosePreference; + public static String TraceControl_VerboseLevelVeryVeryVerbosePreference; + + public static String TraceControl_ExecuteScriptJob; + public static String TraceControl_ExecuteScriptError; + + public static String TraceControl_ExecuteScriptDialogTitle; + public static String TraceControl_ExecuteScriptBrowseText; + public static String TraceControl_ExecuteScriptSelectLabel; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/messages.properties b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/messages.properties new file mode 100644 index 0000000000..f826ea3789 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/messages/messages.properties @@ -0,0 +1,321 @@ +############################################################################### +# Copyright (c) 2012, 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: +# Bernd Hufmann - initial API and implementation +# Jonathan Rajotte - updated for basic support of LTTng 2.6 machine interface +############################################################################### + +EnableChannelDialog_DefaultMessage=Default +ImportHandler_LiveTraceElementError=Could not find trace element +ImportHandler_LiveTraceInitError=Error initializing live trace. +TraceControl_ConnectionFailure=Connecting to host failed +TraceControl_DisconnectionFailure=Disconnection from host failed +TraceControl_ExecutionCancelled=Command Execution cancelled +TraceControl_ExecutionFailure=Command Execution failed +TraceControl_ExecutionTimeout=Command Execution timed-out +TraceControl_ShellNotConnected=Command shell not connected +TraceControl_CommandShellError=Could not create HostShellProcessAdapter +TraceControl_CommandError=Command failed! Command: +TraceControl_UnexpectedCommandOutputFormat=Unexpected command output +TraceControl_UnexpectedNameError=Unexpected session name returned +TraceControl_UnexpectedPathError=Unexpected session path returned +TraceControl_UnexpectedNumberOfElementError=Unexpected number of elements {0} returned +TraceControl_UnexpectedValueError=Unexpected value. Returned {0} Expected: {1} + +TraceControl_UnsupportedVersionError=Unsupported LTTng Tracer Control version +TraceControl_GettingVersionError=Could not get version of LTTng Tracer Control + +# Xml parsing related failures +TraceControl_InvalidSchemaError=Could not open/validate xsd Schema +TraceControl_XmlDocumentBuilderError=Unable to create the xml document builder +TraceControl_XmlParsingError=Unable to parse the xml document +TraceControl_XmlValidationError=Could not validate the xml response +TraceControl_XmlValidationWarning=Xml validation warning + +# Xml machine interface failures +TraceControl_MiInvalidNumberOfElementError=Invalid number of element +TraceControl_MiInvalidProviderError=Invalid provider data +TraceControl_MiMissingRequiredError=Missing required data +TraceControl_MiIllegalValueError=Invalid value + +# Commands +TraceControl_MiInvalidElementError=Invalid xml data + +TraceControl_ErrorTitle=Error +TraceControl_ListSessionFailure=List sessions failed +TraceControl_RetrieveNodeConfigurationJob=Retrieving Target Node Configuration... +TraceControl_RetrieveNodeConfigurationFailure=Error retrieving node configuration +TraceControl_EclipseCommandFailure=Command failed +TraceControl_NewNodeCreationFailure=Creation of new connection failed +TraceControl_CreateSessionJob=Creating Session... +TraceControl_CreateSessionFailure=Command to create session failed + +TraceControl_DestroySessionJob=Destroying Session... +TraceControl_DestroySessionFailure=Command to destroy session failed +TraceControl_DestroyConfirmationTitle=Destroy Confirmation +TraceControl_DestroyConfirmationMessage=Do you want to delete all selected sessions? + +TraceControl_ImportJob=Importing Traces... +TraceControl_DownloadTask=Downloading +TraceControl_ImportFailure=Command to import traces failed + +TraceControl_ChangeSessionStateJob=Changing Session State... +TraceControl_ChangeSessionStateFailure=Command to change session state failed... + +TraceControl_CreateChannelStateJob=Enabling (creating) channel... +TraceControl_CreateChannelStateFailure=Command to enable channel failed + +TraceControl_ChangeChannelStateJob=Changing State of Channels... +TraceControl_ChangeChannelStateFailure=Command to change state of channels failed +TraceControl_ChangeEventStateJob=Changing State of Events... +TraceControl_ChangeEventStateFailure=Command to change state of events failed + +TraceControl_EnableEventsJob=Enabling Events... +TraceControl_EnableEventsFailure=Command to enable events failed +TraceControl_DisableEventsJob=Disabling Events... + +TraceControl_GetContextJob=Getting Available Contexts... +TraceControl_GetContextFailure=Command to get available contexts failed + +TraceControl_AddContextJob=Adding Contexts... +TraceControl_AddContextFailure=Command to add contexts failed + +TraceControl_AddCalibrateJob=Calibrating... +TraceControl_AddCalibrateFailure=Command to calibrate failed + +TraceControl_RecordSnapshotJob=Record snapshot... +TraceControl_RecordSnapshotFailure=Command to snapshot record failed + +# Dialogs +TraceControl_NewDialogTitle=New Connection +TraceControl_NewNodeExistingConnectionGroupName=Existing Connections +TraceControl_NewNodeEditButtonName=Edit connection information +TraceControl_NewNodeComboToolTip=List of existing connections (connection name - host name) +TraceControl_NewNodeConnectionNameLabel=Connection Name +TraceControl_NewNodeConnectionNameTooltip=Alias to be displayed for node to connect to. +TraceControl_NewNodeHostNameLabel=Host Name +TraceControl_NewNodeHostNameTooltip=IP Address or DNS name of node to connect to. +TraceControl_NewNodePortLabel=Port Number +TraceControl_NewNodePortTooltip=IP Port Number to be used for the connection. Leave empty for default port. +TraceControl_AlreadyExistsError=Node name already exists in Control View + +TraceControl_CreateSessionDialogTitle=Create Session +TraceControl_CreateSessionDialogMessage=Configure the new tracing session +TraceControl_CreateSessionNameLabel=Session Name +TraceControl_CreateSessionNameTooltip=The name of the session to be created. +TraceControl_CreateSessionPathLabel=Session Path +TraceControl_CreateSessionPathTooltip=The session path (keep empty for default location) +TraceControl_CreateSessionNormalLabel=Normal Mode +TraceControl_CreateSessionNormalTooltip=Configure session in normal mode +TraceControl_CreateSessionSnapshotLabel=Snapshot Mode +TraceControl_CreateSessionSnapshotTooltip=Configure session in snapshot mode +TraceControl_CreateSessionLiveLabel=Live Mode +TraceControl_CreateSessionLiveTooltip=Configure session in live mode + + +TraceControl_CreateSessionConfigureStreamingButtonText=Advanced +TraceControl_CreateSessionConfigureStreamingButtonTooltip=Configure advanced options +TraceControl_CreateSessionNoStreamingButtonText=Basic +TraceControl_CreateSessionNoStreamingButtonTooltip=Use basic options +TraceControl_CreateSessionTracePathText=Trace Path +TraceControl_CreateSessionTracePathTooltip=The trace path (keep empty for default location) +TraceControl_CreateSessionLinkButtonText=Use same protocol and address for data and control +TraceControl_CreateSessionLinkButtonTooltip=Use the same protocol and address for the data and control connection +TraceControl_CreateSessionProtocolLabelText=Protocol +TraceControl_CreateSessionAddressLabelText=Address +TraceControl_CreateSessionPortLabelText=Port +TraceControl_CreateSessionControlUrlLabel=Control URL +TraceControl_CreateSessionDataUrlLabel=Data URL +TraceControl_CreateSessionCommonProtocolTooltip=file - Local file system full path\n\ +net or net6 - Default network transport layer which is TCP for both control and data channel. +TraceControl_CreateSessionControlAddressTooltip=IP Address or DNS name used for control channel.\n\ +NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732) +TraceControl_CreateSessionControlPortTooltip=The control port (default: 5342). +TraceControl_CreateSessionProtocolTooltip=file - Local file system full path\n\ +net or net6 - Default network transport layer which is TCP\n\ +tcp or tcp6 - TCP network transport +TraceControl_CreateSessionDataAddressTooltip=IP Address or DNS name used for data channel.\n\ +NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732) +TraceControl_CreateSessionDataPortTooltip=The data port (default: 5343). +TraceControl_CreateSessionNoConsumertText=No Consumer +TraceControl_CreateSessionNoConsumertTooltip=Don't activate a consumer for this session. +TraceControl_CreateSessionDisableConsumertText=Disable Consumer +TraceControl_CreateSessionDisableConsumertTooltip=Disable consumer for this session. +TraceControl_CreateSessionLiveConnectionLabel=Live Connection +TraceControl_CreateSessionLiveDelayLabel=Live Delay +TraceControl_CreateSessionLiveDelayTooltip=The delay in micro seconds before the data is flushed and streamed +TraceControl_CreateSessionLiveConnectionUrlTooltip=The URL for the live connection (Relayd) +TraceControl_CreateSessionLiveConnectionPortTooltip=The port for the live connection (Relayd) + +TraceControl_InvalidSessionNameError=The session name is invalid +TraceControl_SessionAlreadyExistsError=The session name already exists +TraceControl_SessionPathAlreadyExistsError=Session path already exists +TraceControl_InvalidSessionPathError=The session path is invalid +TraceControl_InvalidLiveDelayError=Live Delay must be a valid positive number +TraceControl_FileSubSystemError=File subsystem error in session creation dialog. + +TraceControl_EnableChannelDialogTitle=Enable Channel +TraceControl_EnableChannelNameLabel=Channel Name +TraceControl_EnableChannelNameTooltip=The name of the channel to be enabled. +TraceControl_EnableChannelSubBufferSizeTooltip=The sub-buffers size of the channel. Needs to be a power of 2 for kernel and ust tracers (Only for versions prior to 2.2.0). +TraceControl_EnableChannelNbSubBuffersTooltip=The number of sub-buffers of the channel. Needs to be a power of 2 for kernel and ust tracers (Only for versions prior to 2.2.0). +TraceControl_EnableChannelSwitchTimerTooltip=The Switch subbuffer timer interval in usec (default: 0). Needs to be a power of 2 for kernel and ust tracers (Only for versions prior to 2.2.0). +TraceControl_EnableChannelReadTimerTooltip=The Read timer interval in usec. +TraceControl_EnableChannelOutputTypeTooltip=The output type of the channel. +TraceControl_EnableChannelDiscardModeGroupName=Discard Mode +TraceControl_EnableChannelDiscardModeLabel=Discard +TraceControl_EnableChannelDiscardModeTooltip=Discard event when subbuffers are full +TraceControl_EnableChannelOverwriteModeLabel=Overwrite +TraceControl_EnableChannelOverwriteModeTooltip=Flight recorder mode : overwrites events when subbuffers are full +TraceControl_EnbleChannelMaxSizeTraceFilesTooltip=Maximum size of each tracefile within a stream (in bytes). 0 means unlimited +TraceControl_EnbleChannelMaxNumTraceFilesTooltip=Used in conjunction with the maximum size of trace files option, this will limit the number of files created to the specified count. 0 means unlimited + +TraceControl_InvalidChannelNameError=The channel name is invalid or empty +TraceControl_ChannelAlreadyExistsError=Channel already exists + +TraceControl_EnableEventsDialogTitle=Enable Events +TraceControl_EnableEventsSessionGroupName=Session List +TraceControl_EnableEventsChannelGroupName=Channel List +TraceControl_EnableEventsSessionsTooltip=List of available sessions. +TraceControl_EnableEventsChannelsTooltip=List of available channels of selected session.\nIf no channel is available default channel will be created. +TraceControl_EnableEventsNoSessionError=No session from session list is selected. +TraceControl_EnableEventsNoChannelError=No channel from channel list is selected. + +TraceControl_EnableGroupSelectionName=Select +TraceControl_EnableEventsTracepointGroupName=Tracepoint Events +TraceControl_EnableEventsTracepointTreeTooltip=List of available kernel tracepoint events +TraceControl_EnableEventsTracepointTreeAllLabel=All +TraceControl_EnableEventsSyscallName=All Syscalls +TraceControl_EnableEventsSyscallTooltip=Enable all Syscalls +TraceControl_EnableEventsProbeGroupName=Dynamic Probe +TraceControl_EnableEventsEventNameLabel=Event Name +TraceControl_EnableEventsProbeEventNameTooltip=The name of the event for enabling a dynamic probe +TraceControl_EnableEventsProbeNameLabel=Probe +TraceControl_EnableEventsProbeNameTooltip=[addr | symbol | symbol+offset]\nAddr and offset can be octal (0NNN...),\ndecimal (NNN...) or hexadecimal (0xNNN...) +TraceControl_EnableEventsFucntionGroupName=Dynamic Function Entry/Return Probe +TraceControl_EnableEventsFunctionEventNameTooltip=The name of the event for enabling a dynamic function entry/return probe +TraceControl_EnableEventsFunctionNameLabel=Function + +TraceControl_EnableEventsWildcardGroupName=Wildcard +TraceControl_EnableEventsWildcardLabel=Wildcard +TraceControl_EnableEventsWildcardTooltip=The wild card string of event names +TraceControl_EnableEventsLogLevelGroupName=Log Level +TraceControl_EnableEventsLogLevelTypeName=loglevel +TraceControl_EnableEventsLogLevelTypeTooltip=The tracepoint log level range from 0 to loglevel +TraceControl_EnableEventsLogLevelOnlyTypeName=loglevel-only +TraceControl_EnableEventsLogLevelOnlyTypeTooltip=The tracepoint log level (only this loglevel) +TraceControl_EnableEventsLogLevelTooltip=The available log levels +TraceControl_EnableEventsLoglevelEventNameTooltip=Event name for enabling log levels +TraceControl_EnableEventsFilterGroupName=Filter Expression +TraceControl_EnableEventsFilterTooltip=Filter expression on event field. + +TraceControl_InvalidProbeNameError=The probe name is invalid or empty +TraceControl_InvalidWildcardError=The wild card name is invalid or empty +TraceControl_InvalidLogLevelEventNameError=The event name for log level is invalid or empty +TraceControl_InvalidLogLevel=No log level selected + +TraceControl_AddContextDialogTitle=Add Contexts +TraceControl_AddContextAvailableContextsLabel=Contexts +TraceControl_AddContextAvailableContextsTooltip=Available Contexts +TraceControl_AddContextAllLabel=All Contexts + +TraceControl_ImportDialogStreamedTraceNotification=You are importing a trace generated by a streamed session. By default the traces will be outputed to ~/lttng-traces/hostname/sessionname but the location can vary. +TraceControl_ImportDialogStreamedTraceNotificationToggle=Do not warn me again +TraceControl_ImportDialogTitle=Import Traces +TraceControl_ImportDialogTracesGroupName=Available Traces +TraceControl_ImportDialogTracesTooltip=The available traces of current session to import +TraceControl_ImportDialogProjectsGroupName=Available Projects +TraceControl_ImportDialogProjectsTooltip=The available projects to select from +TraceControl_ImportDialogOverwriteButtonText=Overwrite existing trace without warning +TraceControl_ImportDialogCreationError=Dialog box cannot be created +TraceControl_ImportDialogNoProjectSelectedError=No tracing project selected or available +TraceControl_ImportDialogInvalidTracingProject=Invalid tracing project. Missing directory +TraceControl_ImportDialogNoTraceSelectedError=No trace selected or available + +TraceControl_ImportDialogConfirmationTitle=Import Confirmation Dialog +TraceControl_ImportDialogConfirmationOverwriteLabel=Overwrite +TraceControl_ImportDialogConfirmationRenameLabel=Rename +TraceControl_ImportDialogConfirmationNewNameLabel=New Trace Name +TraceControl_InvalidTraceNameError=Invalid trace name +TraceControl_ImportDialogTraceAlreadyExistError=Trace already exists in project +TraceControl_ImportDialog_SelectAll=Select All +TraceControl_ImportDialog_DeselectAll=Deselect All + + +# Tree structure strings +TraceControl_KernelDomainDisplayName=Kernel +TraceControl_JULDomainDisplayName=JUL +TraceControl_UstGlobalDomainDisplayName=UST global +TraceControl_UstDisplayName=UST +TraceControl_UnknownDomainDisplayName=Unknown domain +TraceControl_AllSessionsDisplayName=Sessions +TraceControl_SessionDisplayName=Session +TraceControl_DomainDisplayName=Domain +TraceControl_BufferTypeDisplayName = Buffer Type +TraceControl_ChannelDisplayName=Channel +TraceControl_EventDisplayName=Event +TraceControl_ProviderDisplayName=Provider +TraceControl_KernelProviderDisplayName=Kernel +TraceControl_SharedBuffersDisplayName=Global shared buffers +TraceControl_PerPidBuffersDisplayName=Per PID buffers +TraceControl_PerPidBuffersTooltip=Configure per PID buffers (UST only) +TraceControl_PerUidBuffersDisplayName=Per UID buffers +TraceControl_PerUidBuffersTooltip=Configure per UID buffers (UST only) + +# Property names +TraceControl_SessionNamePropertyName=Session Name +TraceControl_EventNamePropertyName=Event Name +TraceControl_EventTypePropertyName=Event Type +TraceControl_LogLevelPropertyName=Log Level +TraceControl_FieldsPropertyName=Fields +TraceControl_FilterPropertyName=Filter +TraceControl_StatePropertyName=State +TraceControl_VersionPropertyName=Version +TraceControl_DomainNamePropertyName=Domain Name +TraceControl_BufferTypePropertyName=Buffer type +TraceControl_ChannelNamePropertyName=Channel Name +TraceControl_OverwriteModePropertyName=Overwrite Mode +TraceControl_SubBufferSizePropertyName=Sub Buffer Size +TraceControl_NbSubBuffersPropertyName=Number of Sub Buffers +TraceControl_SwitchTimerPropertyName=Switch Timer Interval +TraceControl_ReadTimerPropertyName=Read Timer Interval +TraceControl_OutputTypePropertyName=Output Type +TraceControl_HostNamePropertyName=Connection Name +TraceControl_HostAddressPropertyName=Host Name +TraceControl_SessionPathPropertyName=Session Path +TraceControl_SnapshotPathPropertyName=Snapshot Path +TraceControl_SnapshotNamePropertyName=Snapshot Name +TraceControl_SnapshotIdPropertyName=Snapshot ID +TraceControl_ProviderNamePropertyName=Provider Name +TraceControl_ProcessIdPropertyName=Process ID +TraceControl_ProbeAddressPropertyName=Address +TraceControl_ProbeOffsetPropertyName=Offset +TraceControl_ProbeSymbolPropertyName=Symbol +TraceControl_MaxSizeTraceFilesPropertyName=Maximum size of trace files +TraceControl_MaxNumTraceFilesPropertyName=Maximum number of trace files +TraceControl_ConfigureMetadataChannelName=Configure metadata channel + +# Preferences +TraceControl_TracingGroupPreference=&Tracing Group +TraceControl_LoggingPreference=&Logging +TraceControl_LogfilePath=Log file +TraceControl_CommandTimeout=Command Timeout (in seconds) +TraceControl_AppendLogfilePreference=&Append +TraceControl_VerboseLevelsPreference=&Verbose Level +TraceControl_VerboseLevelNonePreference=None +TraceControl_VerboseLevelVerbosePreference=Level 1 +TraceControl_VerboseLevelVeryVerbosePreference=Level 2 +TraceControl_VerboseLevelVeryVeryVerbosePreference=Level 3 + +TraceControl_ExecuteScriptJob=Executing command script +TraceControl_ExecuteScriptError=Error executing command script + +TraceControl_ExecuteScriptDialogTitle=Select command script +TraceControl_ExecuteScriptBrowseText=Browse... +TraceControl_ExecuteScriptSelectLabel=Select Script diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponent.java new file mode 100644 index 0000000000..0a6dacf2d0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponent.java @@ -0,0 +1,192 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model; + +import java.util.List; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.swt.graphics.Image; + +/** + *

+ * Interface for trace control components that can be displayed in the + * trace control tree viewer. + *

+ * + * @author Bernd Hufmann + */ +public interface ITraceControlComponent extends IAdaptable { + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * @return the name of the component + */ + String getName(); + /** + * Sets the name of the component to the given value. + * @param name - name to set + */ + void setName(String name); + + /** + * @return the image representing the component. + */ + Image getImage(); + /** + * Sets the image path of the component. + * @param path - path to the image location + */ + void setImage(String path); + /** + * Sets the image the component. + * @param image - image to the image location + */ + void setImage(Image image); + + /** + * @return tool tip with information about the component. + */ + String getToolTip(); + /** + * Sets the tool tip with information about the component. + * @param toolTip - the tool tip to set. + */ + void setToolTip(String toolTip); + + /** + * @return the node's connection state + */ + TargetNodeState getTargetNodeState(); + /** + * Sets the node's connection state. + * @param state - the state to set + */ + void setTargetNodeState(TargetNodeState state); + + /** + * @return returns the parent component. + */ + ITraceControlComponent getParent(); + /** + * Sets the parent component. + * @param parent - the parent to set. + */ + void setParent(ITraceControlComponent parent); + + /** + * @return the children components + */ + ITraceControlComponent[] getChildren(); + /** + * Sets the children components. + * @param children - the children to set. + */ + void setChildren(List children); + /** + * Returns the child component with given name. + * @param name - name of child to find. + * @return child component or null. + */ + ITraceControlComponent getChild(String name); + /** + * Gets children for given class type. + * @param clazz - a class type to get + * @return list of trace control components matching given class type. + */ + List getChildren(Class clazz); + + /** + * @return the LTTng control service implementation. + */ + ILttngControlService getControlService(); + + /** + * Sets the LTTng control service implementation. + * @param service - the service to set. + */ + void setControlService(ILttngControlService service); + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * Dispose any resource. + */ + void dispose(); + + /** + * Adds a child component. + * @param component - child to add. + */ + void addChild(ITraceControlComponent component); + + /** + * Removes the given child component. + * @param component - the child to remove. + */ + void removeChild(ITraceControlComponent component); + + /** + * Removes all children. + */ + void removeAllChildren(); + + /** + * Checks if child with given name exists. + * @param name - child name to search for. + * @return - true if exists else false. + */ + boolean containsChild(String name); + + /** + * Checks for children. + * @return true if one or more children exist else false + */ + boolean hasChildren(); + + /** + * Adds a component listener for notification of component changes. + * @param listener - listener interface implementation to add. + */ + void addComponentListener(ITraceControlComponentChangedListener listener); + + /** + * Removes a component listener for notification of component changes. + * @param listener - listener interface implementation to remove. + */ + void removeComponentListener(ITraceControlComponentChangedListener listener); + + /** + * Notifies listeners about the addition of a child. + * @param parent - the parent where the child was added. + * @param component - the child that was added. + */ + void fireComponentAdded(ITraceControlComponent parent, ITraceControlComponent component); + + /** + * Notifies listeners about the removal of a child. + * @param parent - the parent where the child was removed. + * @param component - the child that was removed. + */ + void fireComponentRemoved(ITraceControlComponent parent, ITraceControlComponent component); + + /** + * Notifies listeners about the change of a component. + * @param component - the component that was changed. + */ + void fireComponentChanged(ITraceControlComponent component); +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponentChangedListener.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponentChangedListener.java new file mode 100644 index 0000000000..5e60557cea --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/ITraceControlComponentChangedListener.java @@ -0,0 +1,42 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model; + +/** + *

+ * Listener interface a class can implement to be notified about changes + * of components + *

+ * + * @author Bernd Hufmann + */ +public interface ITraceControlComponentChangedListener { + /** + * Interface for notifications about the addition of a component. + * @param parent - the parent where the child was added. + * @param component - the child that was added. + */ + void componentAdded(ITraceControlComponent parent, ITraceControlComponent component); + + /** + * Interface for notifications about the removal of a child. + * @param parent - the parent where the child was removed. + * @param component - the child that was removed. + */ + void componentRemoved(ITraceControlComponent parent, ITraceControlComponent component); + /** + * NInterface for notifications about the change of a component. + * @param component - the component that was changed. + */ + void componentChanged(ITraceControlComponent component); +} + diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/BaseEventComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/BaseEventComponent.java new file mode 100644 index 0000000000..8459b3f900 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/BaseEventComponent.java @@ -0,0 +1,165 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.BaseEventPropertySource; +import org.eclipse.ui.views.properties.IPropertySource; + +/** + *

+ * Implementation of the base trace event component. + *

+ * + * @author Bernd Hufmann + */ +public class BaseEventComponent extends TraceControlComponent { + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Path to icon file for this component. + */ + public static final String TRACE_EVENT_ICON_FILE_ENABLED = "icons/obj16/event_enabled.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The Event information implementation. + */ + private IBaseEventInfo fEventInfo; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public BaseEventComponent(String name, ITraceControlComponent parent) { + super(name, parent); + setImage(TRACE_EVENT_ICON_FILE_ENABLED); + fEventInfo = new EventInfo(name); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * Sets the event information. + * @param eventInfo - the event info to set. + */ + public void setEventInfo(IBaseEventInfo eventInfo) { + fEventInfo = eventInfo; + } + + /** + * @return the event type. + */ + public TraceEventType getEventType() { + return fEventInfo.getEventType(); + } + + /** + * Sets the event type to the given value. + * @param type - type to set. + */ + public void setEventType(TraceEventType type) { + fEventInfo.setEventType(type); + } + + /** + * Sets the event type to the value specified by the give name. + * @param typeName - the type name. + */ + public void setEventType(String typeName) { + fEventInfo.setEventType(typeName); + } + + /** + * @return the trace event log level + */ + public TraceLogLevel getLogLevel() { + return fEventInfo.getLogLevel(); + } + + /** + * Sets the trace event log level to the given level + * @param level - event log level to set + */ + public void setLogLevel(TraceLogLevel level) { + fEventInfo.setLogLevel(level); + } + + /** + * Sets the trace event log level to the level specified by the given name. + * @param levelName - event log level name + */ + public void setLogLevel(String levelName) { + fEventInfo.setLogLevel(levelName); + } + + /** + * @return a String containing pairs if field name and data type + */ + public String getFieldString() { + IFieldInfo[] fields = fEventInfo.getFields(); + if ((fields != null) && (fields.length > 0)) { + StringBuffer buffer = new StringBuffer(); + for (int i = 0; i < fields.length; i++) { + buffer.append(fields[i].getName()); + buffer.append("="); //$NON-NLS-1$ + buffer.append(fields[i].getFieldType()); + if (i != fields.length-1) { + buffer.append(";"); //$NON-NLS-1$ + } + } + return buffer.toString(); + } + return null; + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) { + return new BaseEventPropertySource(this); + } + return null; + } + + /** + * @return target node component. + */ + public TargetNodeComponent getTargetNode() { + return (TargetNodeComponent) getParent().getParent(); + } + + /** + * @return if provider kernel or UST + */ + public boolean isKernel() { + return getParent() instanceof KernelProviderComponent; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/KernelProviderComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/KernelProviderComponent.java new file mode 100644 index 0000000000..803b60df98 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/KernelProviderComponent.java @@ -0,0 +1,82 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.KernelProviderPropertySource; +import org.eclipse.ui.views.properties.IPropertySource; + +/** + *

+ * Implementation of the Kernel provider component. + *

+ * + * @author Bernd Hufmann + */ +public class KernelProviderComponent extends TraceControlComponent { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * Path to icon file for this component. + */ + public static final String KERNEL_PROVIDER_ICON_FILE = "icons/obj16/targets.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public KernelProviderComponent(String name, ITraceControlComponent parent) { + super(name, parent); + setToolTip(Messages.TraceControl_ProviderDisplayName); + setImage(KERNEL_PROVIDER_ICON_FILE); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * Sets the events information for this component. + * @param eventInfos - events information to set. + */ + public void setEventInfo(List eventInfos) { + for (Iterator iterator = eventInfos.iterator(); iterator.hasNext();) { + IBaseEventInfo baseEventInfo = iterator.next(); + BaseEventComponent component = new BaseEventComponent(baseEventInfo.getName(), this); + component.setEventInfo(baseEventInfo); + addChild(component); + } + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) { + return new KernelProviderPropertySource(this); + } + return null; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java new file mode 100644 index 0000000000..1f3ccb7b8b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java @@ -0,0 +1,455 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TargetNodePropertySource; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.RemoteSystemProxy; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlServiceFactory; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.IRSECallback; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.subsystems.CommunicationsEvent; +import org.eclipse.rse.core.subsystems.ICommunicationsListener; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.views.properties.IPropertySource; + +/** + *

+ * Implementation of the trace node component. + *

+ * + * @author Bernd Hufmann + */ +public class TargetNodeComponent extends TraceControlComponent implements ICommunicationsListener { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * Path to icon file for this component (state connected). + */ + public static final String TARGET_NODE_CONNECTED_ICON_FILE = "icons/obj16/target_connected.gif"; //$NON-NLS-1$ + /** + * Path to icon file for this component (state disconnected). + */ + public static final String TARGET_NODE_DISCONNECTED_ICON_FILE = "icons/obj16/target_disconnected.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The node connection state. + */ + private TargetNodeState fState = TargetNodeState.DISCONNECTED; + /** + * The image to be displayed in state disconnected. + */ + private Image fDisconnectedImage = null; + /** + * The connection implementation. + */ + private IHost fHost = null; + /** + * The remote proxy implementation. + */ + private IRemoteSystemProxy fRemoteProxy = null; + /** + * The control service for LTTng specific commands. + */ + private ILttngControlService fService = null; + /** + * The command shell for issuing commands. + */ + private ICommandShell fShell = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param name - the name of the component + * @param parent - the parent of the component + * @param host - the host connection implementation + * @param proxy - the remote proxy implementation + */ + public TargetNodeComponent(String name, ITraceControlComponent parent, IHost host, IRemoteSystemProxy proxy) { + super(name, parent); + setImage(TARGET_NODE_CONNECTED_ICON_FILE); + fDisconnectedImage = Activator.getDefault().loadIcon(TARGET_NODE_DISCONNECTED_ICON_FILE); + fHost = host; + fRemoteProxy = proxy; + setToolTip(fHost.getHostName()); + } + + /** + * Constructor (using default proxy) + * @param name - the name of the component + * @param parent - the parent of the component + * @param host - the host connection implementation + */ + public TargetNodeComponent(String name, ITraceControlComponent parent, IHost host) { + this(name, parent, host, new RemoteSystemProxy(host)); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public Image getImage() { + if (fState == TargetNodeState.CONNECTED) { + return super.getImage(); + } + return fDisconnectedImage; + } + + @Override + public TargetNodeState getTargetNodeState() { + return fState; + } + + @Override + public void setTargetNodeState(TargetNodeState state) { + fState = state; + fireComponentChanged(TargetNodeComponent.this); + } + + @Override + public ILttngControlService getControlService() { + return fService; + } + + @Override + public void setControlService(ILttngControlService service) { + fService = service; + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) { + return new TargetNodePropertySource(this); + } + return null; + } + + /** + * @return remote host name + */ + public String getHostName() { + return fHost.getHostName(); + } + + /** + * @return remote system proxy implementation + */ + public IRemoteSystemProxy getRemoteSystemProxy() { + return fRemoteProxy; + } + + /** + * @return port of IP connection (shell) to be used + */ + public int getPort() { + return fRemoteProxy.getPort(); + } + + /** + * Sets the port of the IP connections of the shell + * @param port - the IP port to set + */ + public void setPort(int port) { + fRemoteProxy.setPort(port); + } + + /** + * @return all available sessions. + */ + public TraceSessionComponent[] getSessions() { + List compenents = getChildren(TraceSessionGroup.class); + if (compenents.size() > 0) { + TraceSessionGroup group = (TraceSessionGroup)compenents.get(0); + List sessions = group.getChildren(TraceSessionComponent.class); + return sessions.toArray(new TraceSessionComponent[sessions.size()]); + } + return new TraceSessionComponent[0]; + } + + /** + * @return node version + */ + public String getNodeVersion() { + // Control service is null during connection to node + if (getControlService() != null) { + return getControlService().getVersionString(); + } + return ""; //$NON-NLS-1$ + } + + /** + * Returns if node supports filtering of events + * @return true if node supports filtering else false + */ + public boolean isEventFilteringSupported() { + return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$ + } + + /** + * Returns if node supports networks streaming or not + * @return true if node supports filtering else false + * + */ + public boolean isNetworkStreamingSupported() { + return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$ + } + + /** + * Returns if node supports configuring buffer type or not + * @return true if node supports buffer type configuration else false + */ + public boolean isBufferTypeConfigSupported() { + return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$ + } + + /** + * Returns if node supports trace file rotation or not + * @return true if node supports trace file rotation else false + */ + public boolean isTraceFileRotationSupported() { + return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$ + } + + /** + * Returns if node supports periodical flush for metadata or not + * @return true if node supports periodical flush for metadata else false + */ + public boolean isPeriodicalMetadataFlushSupported() { + return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$ + } + /** + * Returns if node supports snapshots or not + * @return true if it supports snapshots else false + * + */ + public boolean isSnapshotSupported() { + return getControlService().isVersionSupported("2.3.0"); //$NON-NLS-1$ + } + /** + * Returns if node supports live or not + * @return true if it supports live else false + * + */ + public boolean isLiveSupported() { + return getControlService().isVersionSupported("2.4.0"); //$NON-NLS-1$; + } + /** + * Returns if node supports adding contexts on event + * @return true if it supports adding contexts on events else false + * + */ + public boolean isContextOnEventSupported() { + return !getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$ + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void communicationsStateChange(CommunicationsEvent e) { + if (e.getState() == CommunicationsEvent.AFTER_DISCONNECT || + e.getState() == CommunicationsEvent.CONNECTION_ERROR) { + handleDisconnected(); + } if ((e.getState() == CommunicationsEvent.AFTER_CONNECT) && (fState != TargetNodeState.CONNECTING)) { + handleConnected(); + } + } + + @Override + public boolean isPassiveCommunicationsListener() { + return true; + } + + @Override + public void dispose() { + fRemoteProxy.removeCommunicationListener(this); + } + + /** + * Method to connect this node component to the remote target node. + */ + public void connect() { + if (fState == TargetNodeState.DISCONNECTED) { + try { + setTargetNodeState(TargetNodeState.CONNECTING); + fRemoteProxy.connect(new IRSECallback() { + @Override + public void done(IStatus status, Object result) { + // Note: result might be null! + if(status.isOK()) { + handleConnected(); + } else { + handleDisconnected(); + } + } + }); + } catch (Exception e) { + setTargetNodeState(TargetNodeState.DISCONNECTED); + Activator.getDefault().logError(Messages.TraceControl_ConnectionFailure + " (" + getName() + "). \n", e); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + } + + /** + * Method to disconnect this node component to the remote target node. + */ + public void disconnect() { + if (fState == TargetNodeState.CONNECTED) { + try { + setTargetNodeState(TargetNodeState.DISCONNECTING); + fRemoteProxy.disconnect(); + } catch (Exception e) { + Activator.getDefault().logError(Messages.TraceControl_DisconnectionFailure + " (" + getName() + "). \n", e); //$NON-NLS-1$ //$NON-NLS-2$ + } finally { + handleDisconnected(); + } + } + } + + /** + * Retrieves the trace configuration from the target node and populates the + * information in the tree model. The execution is done in a own job. + */ + public void getConfigurationFromNode() { + Job job = new Job(Messages.TraceControl_RetrieveNodeConfigurationJob) { + @Override + protected IStatus run(IProgressMonitor monitor) { + + try { + // Get provider information from node + TraceProviderGroup providerGroup = new TraceProviderGroup(Messages.TraceControl_ProviderDisplayName, TargetNodeComponent.this); + addChild(providerGroup); + providerGroup.getProviderFromNode(monitor); + + // Get session information from node + TraceSessionGroup sessionGroup = new TraceSessionGroup(Messages.TraceControl_AllSessionsDisplayName, TargetNodeComponent.this); + addChild(sessionGroup); + sessionGroup.getSessionsFromNode(monitor); + } catch (ExecutionException e) { + removeAllChildren(); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_RetrieveNodeConfigurationFailure, e); + } + + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } + + /** + * Refresh the node configuration + */ + public void refresh() { + removeAllChildren(); + getConfigurationFromNode(); + } + + /** + * Deregisters host from registry. + */ + public void deregister() { + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + // Don't remove local host because it cannot be recreated by + // LTTng NewConnection Dialog + if (!fRemoteProxy.isLocal()) { + registry.deleteHost(fHost); + } + } + + // ------------------------------------------------------------------------ + // Helper function + // ------------------------------------------------------------------------ + + /** + * @return returns the control service for LTTng specific commands. + * @throws ExecutionException + */ + private ILttngControlService createControlService() throws ExecutionException { + if (fShell == null) { + fShell = fRemoteProxy.createCommandShell(); + fRemoteProxy.addCommunicationListener(this); + } + fService = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); + return fService; + } + + /** + * Handles the connected event. + */ + private void handleConnected() { + setTargetNodeState(TargetNodeState.CONNECTED); + try { + createControlService(); + getConfigurationFromNode(); + } catch (final ExecutionException e) { + // Disconnect only if no control service, otherwise stay connected. + if (getControlService() == null) { + disconnect(); + } + + // Notify user + Display.getDefault().asyncExec(new Runnable() { + @Override + public void run() { + ErrorDialog er = new ErrorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), + Messages.TraceControl_ErrorTitle, Messages.TraceControl_RetrieveNodeConfigurationFailure, + new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e), + IStatus.ERROR); + er.open(); + } + }); + Activator.getDefault().logError(Messages.TraceControl_RetrieveNodeConfigurationFailure + " (" + getName() + "). \n", e); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + + /** + * Handles the disconnected event. + */ + private void handleDisconnected() { + removeAllChildren(); + setTargetNodeState(TargetNodeState.DISCONNECTED); + fShell = null; + fService = null; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java new file mode 100644 index 0000000000..7316a456de --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java @@ -0,0 +1,387 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceChannelPropertySource; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.views.properties.IPropertySource; + + +/** + *

+ * Implementation of the trace channel component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceChannelComponent extends TraceControlComponent { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * Path to icon file for this component (state enabled). + */ + public static final String TRACE_CHANNEL_ICON_FILE_ENABLED = "icons/obj16/channel.gif"; //$NON-NLS-1$ + /** + * Path to icon file for this component (state disabled). + */ + public static final String TRACE_CHANNEL_ICON_FILE_DISABLED = "icons/obj16/channel_disabled.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The channel information. + */ + private IChannelInfo fChannelInfo = null; + /** + * The image to be displayed in disabled state. + */ + private Image fDisabledImage = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public TraceChannelComponent(String name, ITraceControlComponent parent) { + super(name, parent); + setImage(TRACE_CHANNEL_ICON_FILE_ENABLED); + setToolTip(Messages.TraceControl_ChannelDisplayName); + fChannelInfo = new ChannelInfo(name); + fDisabledImage = Activator.getDefault().loadIcon(TRACE_CHANNEL_ICON_FILE_DISABLED); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public Image getImage() { + if (fChannelInfo.getState() == TraceEnablement.DISABLED) { + return fDisabledImage; + } + return super.getImage(); + } + + /** + * Sets the channel information. + * + * @param channelInfo + * The channel info to assign to this component + */ + public void setChannelInfo(IChannelInfo channelInfo) { + fChannelInfo = channelInfo; + IEventInfo[] events = fChannelInfo.getEvents(); + List eventComponents = new ArrayList<>(); + for (int i = 0; i < events.length; i++) { + TraceEventComponent event = null; + if (events[i].getClass() == ProbeEventInfo.class) { + event = new TraceProbeEventComponent(events[i].getName(), this); + } else { + event = new TraceEventComponent(events[i].getName(), this); + } + + eventComponents.add(event); + event.setEventInfo(events[i]); + } + if (!eventComponents.isEmpty()) { + setChildren(eventComponents); + } + } + + /** + * @return the overwrite mode value. + */ + public boolean isOverwriteMode() { + return fChannelInfo.isOverwriteMode(); + } + /** + * Sets the overwrite mode value to the given mode. + * @param mode - mode to set. + */ + public void setOverwriteMode(boolean mode){ + fChannelInfo.setOverwriteMode(mode); + } + /** + * @return the sub-buffer size. + */ + public long getSubBufferSize() { + return fChannelInfo.getSubBufferSize(); + } + /** + * Sets the sub-buffer size to the given value. + * @param bufferSize - size to set to set. + */ + public void setSubBufferSize(long bufferSize) { + fChannelInfo.setSubBufferSize(bufferSize); + } + /** + * @return the number of sub-buffers. + */ + public int getNumberOfSubBuffers() { + return fChannelInfo.getNumberOfSubBuffers(); + } + /** + * Sets the number of sub-buffers to the given value. + * @param numberOfSubBuffers - value to set. + */ + public void setNumberOfSubBuffers(int numberOfSubBuffers) { + fChannelInfo.setNumberOfSubBuffers(numberOfSubBuffers); + } + /** + * @return the switch timer interval. + */ + public long getSwitchTimer() { + return fChannelInfo.getSwitchTimer(); + } + /** + * Sets the switch timer interval to the given value. + * @param timer - timer value to set. + */ + public void setSwitchTimer(long timer) { + fChannelInfo.setSwitchTimer(timer); + } + /** + * @return the read timer interval. + */ + public long getReadTimer() { + return fChannelInfo.getReadTimer(); + } + /** + * Sets the read timer interval to the given value. + * @param timer - timer value to set.. + */ + public void setReadTimer(long timer) { + fChannelInfo.setReadTimer(timer); + } + /** + * @return the output type. + */ + public TraceChannelOutputType getOutputType() { + return fChannelInfo.getOutputType(); + } + /** + * Sets the output type to the given value. + * @param type - type to set. + */ + public void setOutputType(TraceChannelOutputType type) { + fChannelInfo.setOutputType(type); + } + /** + * Sets the output type to the given value. + * @param type - type to set. + */ + public void setOutputType(String type) { + fChannelInfo.setOutputType(type); + } + + /** + * @return the channel state (enabled or disabled). + */ + public TraceEnablement getState() { + return fChannelInfo.getState(); + } + /** + * Sets the channel state (enablement) to the given value. + * @param state - state to set. + */ + public void setState(TraceEnablement state) { + fChannelInfo.setState(state); + } + /** + * Sets the channel state (enablement) to the value specified by the given name. + * @param stateName - state to set. + */ + public void setState(String stateName) { + fChannelInfo.setState(stateName); + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) { + return new TraceChannelPropertySource(this); + } + return null; + } + + /** + * @return session name from parent + */ + public String getSessionName() { + return ((TraceDomainComponent)getParent()).getSessionName(); + } + + /** + * @return session from parent + */ + public TraceSessionComponent getSession() { + return ((TraceDomainComponent)getParent()).getSession(); + } + + /** + * @return if domain is kernel or UST + */ + public boolean isKernel() { + return ((TraceDomainComponent)getParent()).isKernel(); + } + + /** + * @return the parent target node + */ + public TargetNodeComponent getTargetNode() { + return ((TraceDomainComponent)getParent()).getTargetNode(); + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Enables a list of events with no additional parameters. + * + * @param eventNames + * - a list of event names to enabled. + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableEvents(List eventNames, IProgressMonitor monitor) throws ExecutionException { + enableEvents(eventNames, null, monitor); + } + + /** + * Enables a list of events with no additional parameters. + * + * @param eventNames + * - a list of event names to enabled. + * @param filterExpression + * - a filter expression + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableEvents(List eventNames, String filterExpression, IProgressMonitor monitor) throws ExecutionException { + getControlService().enableEvents(getSessionName(), getName(), eventNames, isKernel(), filterExpression, monitor); + } + + /** + * Enables all syscalls (for kernel domain) + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableSyscalls(IProgressMonitor monitor) throws ExecutionException { + getControlService().enableSyscalls(getSessionName(), getName(), monitor); + } + + /** + * Enables a dynamic probe (for kernel domain) + * + * @param eventName + * - event name for probe + * @param isFunction + * - true for dynamic function entry/return probe else false + * @param probe + * - the actual probe + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableProbe(String eventName, boolean isFunction, String probe, + IProgressMonitor monitor) throws ExecutionException { + getControlService().enableProbe(getSessionName(), getName(), eventName, isFunction, probe, monitor); + } + + /** + * Enables events using log level. + * + * @param eventName + * - a event name + * @param logLevelType + * - a log level type + * @param level + * - a log level + * @param filterExpression + * - a filter expression + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableLogLevel(String eventName, LogLevelType logLevelType, + TraceLogLevel level, String filterExpression, IProgressMonitor monitor) + throws ExecutionException { + getControlService().enableLogLevel(getSessionName(), getName(), eventName, logLevelType, level, filterExpression, monitor); + } + + /** + * Enables a list of events with no additional parameters. + * + * @param eventNames + * - a list of event names to enabled. + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void disableEvent(List eventNames, IProgressMonitor monitor) + throws ExecutionException { + getControlService().disableEvent(getParent().getParent().getName(), + getName(), eventNames, isKernel(), monitor); + } + + /** + * Add contexts to given channels and or events + * + * @param contexts + * - a list of contexts to add + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void addContexts(List contexts, IProgressMonitor monitor) + throws ExecutionException { + getControlService().addContexts(getSessionName(), getName(), null, + isKernel(), contexts, monitor); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlComponent.java new file mode 100644 index 0000000000..532b47235b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlComponent.java @@ -0,0 +1,333 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.runtime.ListenerList; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponentChangedListener; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.ILttngControlService; +import org.eclipse.swt.graphics.Image; + +/** + *

+ * Base implementation for trace control component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceControlComponent implements ITraceControlComponent { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The name of the component + */ + private String fName = ""; //$NON-NLS-1$ + /** + * The image to be displayed for the component. + */ + private Image fImage = null; + /** + * The tool tip to be displayed for the component. + */ + private String fToolTip = null; + /** + * The parent component. + */ + private ITraceControlComponent fParent = null; + /** + * The list if children components. + */ + private final List fChildren = new ArrayList<>(); + /** + * The list of listeners to be notified about changes. + */ + private final ListenerList fListeners = new ListenerList(); + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param name - the name of the component. + */ + public TraceControlComponent(String name) { + this(name, null); + } + + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent component. + */ + public TraceControlComponent(String name, ITraceControlComponent parent) { + fName = name; + fParent = parent; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public String getName() { + return fName; + } + + @Override + public void setName(String name) { + fName = name; + } + + @Override + public Image getImage() { + return fImage; + } + + @Override + public void setImage(String path) { + fImage = Activator.getDefault().loadIcon(path); + } + + @Override + public void setImage(Image image) { + fImage = image; + } + + @Override + public String getToolTip() { + return fToolTip; + } + + @Override + public void setToolTip(String toolTip) { + fToolTip = toolTip; + } + + @Override + public TargetNodeState getTargetNodeState() { + if (getParent() != null) { + return getParent().getTargetNodeState(); + } + return TargetNodeState.DISCONNECTED; + } + + @Override + public void setTargetNodeState(TargetNodeState state) { + if (getParent() != null) { + getParent().setTargetNodeState(state); + } + } + + @Override + public ITraceControlComponent getParent() { + return fParent; + } + + @Override + public void setParent(ITraceControlComponent parent) { + fParent = parent; + } + + @Override + public ITraceControlComponent[] getChildren() { + return fChildren.toArray(new ITraceControlComponent[fChildren.size()]); + } + + @Override + public void setChildren(List children) { + for (Iterator iterator = children.iterator(); iterator.hasNext();) { + ITraceControlComponent traceControlComponent = iterator.next(); + fChildren.add(traceControlComponent); + fireComponentChanged(this); + } + } + + @Override + public ITraceControlComponent getChild(String name) { + ITraceControlComponent child = null; + for (int i = 0; i < fChildren.size(); i++) { + if (fChildren.get(i).getName().equals(name)) { + child = fChildren.get(i); + break; + } + } + return child; + } + + @Override + public List getChildren(Class clazz) { + List list = new ArrayList<>(); + + for (Iterator iterator = fChildren.iterator(); iterator.hasNext();) { + ITraceControlComponent child = iterator.next(); + if (child.getClass() == clazz) { + list.add(child); + } + } + return list; + } + + @Override + public ILttngControlService getControlService() { + if (getParent() != null) { + return getParent().getControlService(); + } + return null; + } + + @Override + public void setControlService(ILttngControlService service) { + if (getParent() != null) { + getParent().setControlService(service); + } + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void dispose() { + // default implementation + } + + @Override + public void addChild(ITraceControlComponent component) { + if (component != null) { + fChildren.add(component); + } + fireComponentAdded(this, component); + } + + @Override + public void removeChild(ITraceControlComponent component) { + if (component != null) { + fChildren.remove(component); + component.dispose(); + } + fireComponentRemoved(this, component); + } + + @Override + public void removeAllChildren() { + for (Iterator iterator = fChildren.iterator(); iterator.hasNext();) { + ITraceControlComponent child = iterator.next(); + child.removeAllChildren(); + } + fChildren.clear(); +// fireCompenentChanged(this); + } + + @Override + public boolean containsChild(String name) { + boolean retValue = false; + for (int i = 0; i < fChildren.size(); i++) { + if (fChildren.get(i).getName().equals(name)) { + retValue = true; + break; + } + } + return retValue; + } + + @Override + public boolean hasChildren() { + return !fChildren.isEmpty(); + } + + @Override + public void addComponentListener(ITraceControlComponentChangedListener listener) { + if (fParent != null) { + fParent.addComponentListener(listener); + } else { + fListeners.add(listener); + } + } + + @Override + public void removeComponentListener(ITraceControlComponentChangedListener listener) { + if (fParent != null) { + fParent.removeComponentListener(listener); + } else { + fListeners.remove(listener); + } + } + + @Override + public void fireComponentAdded(ITraceControlComponent parent, ITraceControlComponent component) { + if (component == null) { + return; + } + + if (fParent != null) { + fParent.fireComponentAdded(parent, component); + } else { + Object[] listeners = fListeners.getListeners(); + for (int i = 0; i < listeners.length; i++) { + ITraceControlComponentChangedListener listener = (ITraceControlComponentChangedListener) listeners[i]; + listener.componentAdded(parent, component); + } + } + } + + @Override + public void fireComponentRemoved(ITraceControlComponent parent, ITraceControlComponent component) { + if (component == null) { + return; + } + + if (fParent != null) { + fParent.fireComponentRemoved(parent, component); + } else { + Object[] listeners = fListeners.getListeners(); + for (int i = 0; i < listeners.length; i++) { + ITraceControlComponentChangedListener listener = (ITraceControlComponentChangedListener) listeners[i]; + listener.componentRemoved(parent, component); + } + } + } + + @Override + public void fireComponentChanged(ITraceControlComponent component) { + if (component == null) { + return; + } + + if (fParent != null) { + fParent.fireComponentChanged(component); + } else { + Object[] listeners = fListeners.getListeners(); + for (int i = 0; i < listeners.length; i++) { + ITraceControlComponentChangedListener listener = (ITraceControlComponentChangedListener) listeners[i]; + listener.componentChanged(component); + } + } + } + + @Override + public Object getAdapter(Class adapter) { + return null; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlContentProvider.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlContentProvider.java new file mode 100644 index 0000000000..72ea1a5ed1 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlContentProvider.java @@ -0,0 +1,68 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; + +/** + *

+ * Tree content provider implementation for trace control view. + *

+ * + * @author Bernd Hufmann + */ +public class TraceControlContentProvider implements ITreeContentProvider { + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void dispose() { + } + + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + + @Override + public Object[] getElements(Object inputElement) { + return getChildren(inputElement); + } + + @Override + public Object[] getChildren(Object parentElement) { + + if (parentElement instanceof ITraceControlComponent) { + return ((ITraceControlComponent)parentElement).getChildren(); + } + return new Object[0]; + } + + @Override + public Object getParent(Object element) { + if (element instanceof ITraceControlComponent) { + return ((ITraceControlComponent)element).getParent(); + } + return null; + } + + @Override + public boolean hasChildren(Object element) { + if (element instanceof ITraceControlComponent) { + return ((ITraceControlComponent)element).hasChildren(); + } + return false; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlLabelProvider.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlLabelProvider.java new file mode 100644 index 0000000000..2364fb56ea --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlLabelProvider.java @@ -0,0 +1,54 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.swt.graphics.Image; + +/** + *

+ * Label provider for trace control tree viewer. + *

+ * + * @author Bernd Hufmann + */ +public class TraceControlLabelProvider extends ColumnLabelProvider { + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Image getImage(Object element) { + if ((element != null) && (element instanceof ITraceControlComponent)) { + return ((ITraceControlComponent) element).getImage(); + } + return null; + } + + @Override + public String getText(Object element) { + if ((element != null) && (element instanceof ITraceControlComponent)) { + return ((ITraceControlComponent) element).getName(); + } + return "";//$NON-NLS-1$ + } + + @Override + public String getToolTipText(Object element) { + if ((element != null) && (element instanceof ITraceControlComponent)) { + return ((ITraceControlComponent) element).getToolTip(); + } + return null; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlPropertyTester.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlPropertyTester.java new file mode 100644 index 0000000000..0d49b3a9be --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlPropertyTester.java @@ -0,0 +1,44 @@ +/********************************************************************** + * Copyright (c) 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import org.eclipse.core.expressions.PropertyTester; + +/** + * + * Property Tester Implementation for Trace Control Components. + * + * @author Bernd Hufmann + */ +public class TraceControlPropertyTester extends PropertyTester { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + private static final String ADD_CONTEXT_SUPPORT_PROPERTY = "isAddContextOnEventSupported"; //$NON-NLS-1$ + + + @Override + public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { + + // Check if node supports adding contexts on event level. + if (ADD_CONTEXT_SUPPORT_PROPERTY.equals(property)) { + if ((receiver != null) && (receiver instanceof TraceEventComponent)) { + TraceEventComponent event = (TraceEventComponent) receiver; + TargetNodeComponent node = event.getTargetNode(); + return node.isContextOnEventSupported(); + } + } + return false; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlRoot.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlRoot.java new file mode 100644 index 0000000000..a02c54349a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceControlRoot.java @@ -0,0 +1,42 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + + +/** + *

+ * Root element in trace control tree. + *

+ * + * @author Bernd Hufmann + */ +public class TraceControlRoot extends TraceControlComponent { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The name of the root component + */ + public static final String TRACE_CONTROL_ROOT_NAME = "trace_control_root"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Default constructor + */ + public TraceControlRoot() { + super(TRACE_CONTROL_ROOT_NAME); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceDomainComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceDomainComponent.java new file mode 100644 index 0000000000..d233d95e2c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceDomainComponent.java @@ -0,0 +1,299 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceDomainPropertySource; +import org.eclipse.ui.views.properties.IPropertySource; + +/** + *

+ * Implementation of the trace domain component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceDomainComponent extends TraceControlComponent { + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Path to icon file for this component. + */ + public static final String TRACE_DOMAIN_ICON_FILE = "icons/obj16/domain.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The domain information. + */ + private IDomainInfo fDomainInfo = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public TraceDomainComponent(String name, ITraceControlComponent parent) { + super(name, parent); + setImage(TRACE_DOMAIN_ICON_FILE); + setToolTip(Messages.TraceControl_DomainDisplayName); + fDomainInfo = new DomainInfo(name); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * Sets the domain information. + * @param domainInfo - the domain information to set. + */ + public void setDomainInfo(IDomainInfo domainInfo) { + fDomainInfo = domainInfo; + IChannelInfo[] channels = fDomainInfo.getChannels(); + for (int i = 0; i < channels.length; i++) { + TraceChannelComponent channel = new TraceChannelComponent(channels[i].getName(), this); + channel.setChannelInfo(channels[i]); + addChild(channel); + } + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) { + return new TraceDomainPropertySource(this); + } + return null; + } + + /** + * @return session name from parent + */ + public String getSessionName() { + return ((TraceSessionComponent)getParent()).getName(); + } + + /** + * @return session from parent + */ + public TraceSessionComponent getSession() { + return (TraceSessionComponent)getParent(); + } + + /** + * @return true if domain is kernel, false for UST + */ + public boolean isKernel() { + return fDomainInfo.isKernel(); + } + + /** + * Sets whether domain is Kernel domain or UST + * @param isKernel true for kernel, false for UST + */ + public void setIsKernel(boolean isKernel) { + fDomainInfo.setIsKernel(isKernel); + } + + /** + * @return returns all available channels for this domain. + */ + public TraceChannelComponent[] getChannels() { + List channels = getChildren(TraceChannelComponent.class); + return channels.toArray(new TraceChannelComponent[channels.size()]); + } + + /** + * @return the parent target node + */ + public TargetNodeComponent getTargetNode() { + return ((TraceSessionComponent)getParent()).getTargetNode(); + } + + /** + * @return the buffer type + */ + public BufferType getBufferType(){ + return fDomainInfo.getBufferType(); + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Retrieves the session configuration from the node. + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void getConfigurationFromNode(IProgressMonitor monitor) throws ExecutionException { + TraceSessionComponent session = (TraceSessionComponent) getParent(); + session.getConfigurationFromNode(monitor); + } + + /** + * Enables channels with given names which are part of this domain. If a + * given channel doesn't exists it creates a new channel with the given + * parameters (or default values if given parameter is null). + * + * @param channelNames + * - a list of channel names to enable on this domain + * @param info + * - channel information to set for the channel (use null for + * default) + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableChannels(List channelNames, IChannelInfo info, + IProgressMonitor monitor) throws ExecutionException { + getControlService().enableChannels(getParent().getName(), channelNames, + isKernel(), info, monitor); + } + + /** + * Disables channels with given names which are part of this domain. + * + * @param channelNames + * - a list of channel names to enable on this domain + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void disableChannels(List channelNames, + IProgressMonitor monitor) throws ExecutionException { + getControlService().disableChannels(getParent().getName(), + channelNames, isKernel(), monitor); + } + + /** + * Enables a list of events with no additional parameters. + * + * @param eventNames + * - a list of event names to enabled. + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableEvents(List eventNames, IProgressMonitor monitor) + throws ExecutionException { + getControlService().enableEvents(getSessionName(), null, eventNames, + isKernel(), null, monitor); + } + + /** + * Enables all syscalls (for kernel domain) + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + + public void enableSyscalls(IProgressMonitor monitor) + throws ExecutionException { + getControlService().enableSyscalls(getSessionName(), null, monitor); + } + + /** + * Enables a dynamic probe (for kernel domain) + * + * @param eventName + * - event name for probe + * @param isFunction + * - true for dynamic function entry/return probe else false + * @param probe + * - the actual probe + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableProbe(String eventName, boolean isFunction, String probe, + IProgressMonitor monitor) throws ExecutionException { + getControlService().enableProbe(getSessionName(), null, eventName, + isFunction, probe, monitor); + } + + /** + * Enables events using log level. + * + * @param eventName + * - a event name + * @param logLevelType + * - a log level type + * @param level + * - a log level + * @param filterExpression + * - a filter expression + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableLogLevel(String eventName, LogLevelType logLevelType, + TraceLogLevel level, String filterExpression, IProgressMonitor monitor) + throws ExecutionException { + getControlService().enableLogLevel(getSessionName(), null, eventName, + logLevelType, level, filterExpression, monitor); + } + + /** + * Add contexts to given channels and or events + * + * @param contexts + * - a list of contexts to add + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void addContexts(List contexts, IProgressMonitor monitor) + throws ExecutionException { + getControlService().addContexts(getSessionName(), null, null, + isKernel(), contexts, monitor); + } + + /** + * Executes calibrate command to quantify LTTng overhead. + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void calibrate(IProgressMonitor monitor) throws ExecutionException { + getControlService().calibrate(isKernel(), monitor); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceEventComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceEventComponent.java new file mode 100644 index 0000000000..531a507cb0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceEventComponent.java @@ -0,0 +1,264 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceEventPropertySource; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.views.properties.IPropertySource; + + +/** + *

+ * Implementation of the trace channel component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceEventComponent extends TraceControlComponent { + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Path to icon file for this component (enabled state). + */ + public static final String TRACE_EVENT_ICON_FILE_ENABLED = "icons/obj16/event_enabled.gif"; //$NON-NLS-1$ + /** + * Path to icon file for this component (disabled state). + */ + public static final String TRACE_EVENT_ICON_FILE_DISABLED = "icons/obj16/event_disabled.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The event information. + */ + protected IEventInfo fEventInfo = null; + /** + * The image to be displayed when in disabled state. + */ + private Image fDisabledImage = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public TraceEventComponent(String name, ITraceControlComponent parent) { + super(name, parent); + setImage(TRACE_EVENT_ICON_FILE_ENABLED); + setToolTip(Messages.TraceControl_EventDisplayName); + fEventInfo = new EventInfo(name); + fDisabledImage = Activator.getDefault().loadIcon(TRACE_EVENT_ICON_FILE_DISABLED); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public Image getImage() { + if (fEventInfo.getState() == TraceEnablement.DISABLED) { + return fDisabledImage; + } + return super.getImage(); + } + + /** + * Sets the event information. + * @param eventInfo - the event information to set. + */ + public void setEventInfo(IEventInfo eventInfo) { + fEventInfo = eventInfo; + } + + /** + * @return the trace event type + */ + public TraceEventType getEventType() { + return fEventInfo.getEventType(); + } + + /** + * Sets the trace event type to the given type + * @param type - type to set + */ + public void setEventType(TraceEventType type) { + fEventInfo.setEventType(type); + } + + /** + * Sets the trace event type to the type specified by the given name. + * @param typeName - event type name + */ + public void setEventType(String typeName) { + fEventInfo.setEventType(typeName); + } + + /** + * @return the event state (enabled or disabled). + */ + public TraceEnablement getState() { + return fEventInfo.getState(); + } + + /** + * Sets the event state (enablement) to the given value. + * @param state - state to set. + */ + public void setState(TraceEnablement state) { + fEventInfo.setState(state); + } + + /** + * Sets the event state (enablement) to the value specified by the given name. + * @param stateName - state to set. + */ + public void setState(String stateName) { + fEventInfo.setState(stateName); + } + + /** + * @return the trace event log level + */ + public TraceLogLevel getLogLevel() { + return fEventInfo.getLogLevel(); + } + + /** + * Sets the trace event log level to the given level + * @param level - event log level to set + */ + public void setLogLevel(TraceLogLevel level) { + fEventInfo.setLogLevel(level); + } + + /** + * Sets the trace event log level to the level specified by the given name. + * @param levelName - event log level name + */ + public void setLogLevel(String levelName) { + fEventInfo.setLogLevel(levelName); + } + + /** + * Returns filter expression. + * @return filter expression + */ + public String getFilterExpression() { + return fEventInfo.getFilterExpression(); + } + + /** + * Sets the filter expression. + * @param filter The filter expression to set + */ + public void setFilterExpression(String filter) { + fEventInfo.setFilterExpression(filter); + } + + /** + * Returns the log level type + * @return event log level type + */ + public LogLevelType getLogLevelType() { + return fEventInfo.getLogLevelType(); + } + + /** + * Sets the trace event log level type to the given level type + * @param levelType - event log level type to set + */ + public void setLogLevelType(LogLevelType levelType) { + fEventInfo.setLogLevelType(levelType); + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) { + return new TraceEventPropertySource(this); + } + return null; + } + + /** + * @return target node component. + */ + public TargetNodeComponent getTargetNode() { + return ((TraceChannelComponent)getParent()).getTargetNode(); + } + + /** + * @return session name from parent + */ + public String getSessionName() { + return ((TraceChannelComponent)getParent()).getSessionName(); + } + + /** + * @return session from parent + */ + public TraceSessionComponent getSession() { + return ((TraceChannelComponent)getParent()).getSession(); + } + + /** + * @return channel name from parent + */ + public String getChannelName() { + return getParent().getName(); + } + + /** + * @return if domain is kernel or UST + */ + public boolean isKernel() { + return ((TraceChannelComponent)getParent()).isKernel(); + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Add contexts to given channels and or events + * + * @param contexts + * - a list of contexts to add + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void addContexts(List contexts, IProgressMonitor monitor) + throws ExecutionException { + getControlService().addContexts(getSessionName(), getChannelName(), + getName(), isKernel(), contexts, monitor); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProbeEventComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProbeEventComponent.java new file mode 100644 index 0000000000..a473be2478 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProbeEventComponent.java @@ -0,0 +1,121 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceProbeEventPropertySource; +import org.eclipse.ui.views.properties.IPropertySource; + + +/** + *

+ * Implementation of the trace channel component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceProbeEventComponent extends TraceEventComponent { + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public TraceProbeEventComponent(String name, ITraceControlComponent parent) { + super(name, parent); + fEventInfo = new ProbeEventInfo(name); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * Sets the event information. + * @param eventInfo - the event information to set. + */ + @Override + public void setEventInfo(IEventInfo eventInfo) { + if (eventInfo instanceof ProbeEventInfo) { + fEventInfo = eventInfo; + return; + } + throw new IllegalArgumentException("Invalid type passed. Only class of type ProbeEventInfo allowed:\n" + eventInfo.getClass()); //$NON-NLS-1$ + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) { + return new TraceProbeEventPropertySource(this); + } + return null; + } + /** + * @return the address of the probe. (null if Symbol is used) + */ + public String getAddress() { + return getEventInfo().getAddress(); + } + /** + * Sets the address of the probe. + * @param address - a address + */ + public void setAddress(String address) { + getEventInfo().setAddress(address); + } + /** + * @return the offset applied to the symbol. + */ + public String getOffset() { + return getEventInfo().getOffset(); + } + /** + * Sets the offset applied to the symbol. (valid if symbol is used) + * @param offset - a offset + */ + public void setOffset(String offset) { + getEventInfo().setOffset(offset); + } + /** + * @return the symbol name. (null if address is used) + */ + public String getSymbol() { + return getEventInfo().getSymbol(); + } + /** + * Sets the symbol name. + * @param symbol - a symbol name (null if address is used) + */ + public void setSymbol(String symbol) { + getEventInfo().setSymbol(symbol); + } + + // ------------------------------------------------------------------------ + // Helper methods + // ------------------------------------------------------------------------ + private ProbeEventInfo getEventInfo() { + return (ProbeEventInfo) fEventInfo; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProviderGroup.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProviderGroup.java new file mode 100644 index 0000000000..5fd9bc24b8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceProviderGroup.java @@ -0,0 +1,108 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; + +/** + *

+ * Implementation of the trace provider group. + *

+ * + * @author Bernd Hufmann + */ +public class TraceProviderGroup extends TraceControlComponent { + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Path to icon file for this component. + */ + public static final String TRACE_PROVIDERS_ICON_FILE = "icons/obj16/providers.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public TraceProviderGroup(String name, ITraceControlComponent parent) { + super(name, parent); + setImage(TRACE_PROVIDERS_ICON_FILE); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Gets the provider information from the target node. + * @param monitor - a progress monitor + * @throws ExecutionException If the command fails + */ + public void getProviderFromNode(IProgressMonitor monitor) throws ExecutionException { + + List eventInfos = getControlService().getKernelProvider(monitor); + + if (!eventInfos.isEmpty()) { + KernelProviderComponent component = new KernelProviderComponent(Messages.TraceControl_KernelProviderDisplayName, this); + addChild(component); + component.setEventInfo(eventInfos); + } + + List allProviders = getControlService().getUstProvider(monitor); + + for (Iterator iterator = allProviders.iterator(); iterator.hasNext();) { + IUstProviderInfo ustProviderInfo = iterator.next(); + UstProviderComponent ustComponent = new UstProviderComponent(ustProviderInfo.getName(), this); + addChild(ustComponent); + ustComponent.setUstProvider(ustProviderInfo); + } + } + + /** + * Returns whether the kernel provider is available or not + * @return true if kernel provide is available or false + */ + public boolean hasKernelProvider() { + List kernelList = getChildren(KernelProviderComponent.class); + return !kernelList.isEmpty(); + } + + /** + * Returns if node supports filtering of events + * @return true if node supports filtering else false + */ + public boolean isEventFilteringSupported() { + return ((TargetNodeComponent)getParent()).isEventFilteringSupported(); + } +} + diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java new file mode 100644 index 0000000000..eee0d7840a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java @@ -0,0 +1,473 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + * Marc-Andre Laperle - Support for opening a live session + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.TraceSessionPropertySource; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.views.properties.IPropertySource; + +/** + *

+ * Implementation of the trace session component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceSessionComponent extends TraceControlComponent { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Path to icon file for this component (inactive state). + */ + public static final String TRACE_SESSION_ICON_FILE_INACTIVE = "icons/obj16/session_inactive.gif"; //$NON-NLS-1$ + /** + * Path to icon file for this component (active state). + */ + public static final String TRACE_SESSION_ICON_FILE_ACTIVE = "icons/obj16/session_active.gif"; //$NON-NLS-1$ + /** + * Path to icon file for this component (destroyed state). + */ + public static final String TRACE_SESSION_ICON_FILE_DESTROYED = "icons/obj16/session_destroyed.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The session information. + */ + private ISessionInfo fSessionInfo = null; + /** + * A flag to indicate if session has been destroyed. + */ + private boolean fIsDestroyed = false; + /** + * The image to be displayed in state active. + */ + private Image fActiveImage = null; + /** + * The image to be displayed in state destroyed + */ + private Image fDestroyedImage = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public TraceSessionComponent(String name, ITraceControlComponent parent) { + super(name, parent); + setImage(TRACE_SESSION_ICON_FILE_INACTIVE); + setToolTip(Messages.TraceControl_SessionDisplayName); + fSessionInfo = new SessionInfo(name); + fActiveImage = Activator.getDefault().loadIcon(TRACE_SESSION_ICON_FILE_ACTIVE); + fDestroyedImage = Activator.getDefault().loadIcon(TRACE_SESSION_ICON_FILE_DESTROYED); + } + + /** + * Constructor + * + * @param sessionInfo + * the session information used to create the session + * @param parent + * the parent of this component. + */ + public TraceSessionComponent(ISessionInfo sessionInfo, ITraceControlComponent parent) { + this(sessionInfo.getName(), parent); + copyLiveInfo(sessionInfo); + } + + private void copyLiveInfo(ISessionInfo sessionInfo) { + // Since we can't retrieve this information from the node, we copy it over + fSessionInfo.setLive(sessionInfo.isLive()); + fSessionInfo.setLiveDelay(sessionInfo.getLiveDelay()); + fSessionInfo.setLivePort(sessionInfo.getLivePort()); + fSessionInfo.setLiveUrl(sessionInfo.getLiveUrl()); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public Image getImage() { + if (fIsDestroyed) { + return fDestroyedImage; + } + + if (fSessionInfo.getSessionState() == TraceSessionState.INACTIVE) { + return super.getImage(); + } + + return fActiveImage; + } + + /** + * @return the whether the session is destroyed or not. + */ + public boolean isDestroyed() { + return fIsDestroyed; + } + + /** + * Sets the session destroyed state to the given value. + * @param destroyed - value to set. + */ + public void setDestroyed(boolean destroyed) { + fIsDestroyed = destroyed; + } + + /** + * @return the session state state (active or inactive). + */ + public TraceSessionState getSessionState() { + return fSessionInfo.getSessionState(); + } + + /** + * Sets the session state to the given value. + * @param state - state to set. + */ + public void setSessionState(TraceSessionState state) { + fSessionInfo.setSessionState(state); + } + + /** + * Sets the event state to the value specified by the given name. + * @param stateName - state to set. + */ + public void setSessionState(String stateName) { + fSessionInfo.setSessionState(stateName); + } + + /** + * @return path string where session is located. + */ + public String getSessionPath() { + return fSessionInfo.getSessionPath(); + } + + /** + * Sets the path string (where session is located) to the given value. + * @param sessionPath - session path to set. + */ + public void setSessionPath(String sessionPath) { + fSessionInfo.setSessionPath(sessionPath); + } + + /** + * Returns if session is streamed over network + * @return true if streamed over network else false + */ + public boolean isStreamedTrace() { + return fSessionInfo.isStreamedTrace(); + } + + /** + * Sets whether the trace is streamed or not + * @param isStreamedTrace true if streamed over network else false + */ + public void setIsStreamedTrace(boolean isStreamedTrace) { + fSessionInfo.setStreamedTrace(isStreamedTrace); + } + + /** + * Returns whether the session is snapshot session or not + * @return true if it is snapshot session else false + */ + public boolean isSnapshotSession() { + return fSessionInfo.isSnapshotSession(); + } + + /** + * Gets the snapshot information if available whether the session is a snapshot session or not + * @return the snapshot information or null if it is not a snapshot session + */ + public ISnapshotInfo getSnapshotInfo() { + return fSessionInfo.getSnapshotInfo(); + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) { + return new TraceSessionPropertySource(this); + } + return null; + } + + /** + * @return all available domains of this session. + */ + public TraceDomainComponent[] getDomains() { + List sessions = getChildren(TraceDomainComponent.class); + return sessions.toArray(new TraceDomainComponent[sessions.size()]); + } + + /** + * @return the parent target node + */ + public TargetNodeComponent getTargetNode() { + return ((TraceSessionGroup)getParent()).getTargetNode(); + } + + /** + * Returns whether the kernel provider is available or not + * @return true if kernel provide is available or false + */ + public boolean hasKernelProvider() { + List providerGroups = getTargetNode().getChildren(TraceProviderGroup.class); + return (!providerGroups.isEmpty() ? ((TraceProviderGroup) providerGroups.get(0)).hasKernelProvider() : false); + } + + /** + * Returns if node supports filtering of events + * @return true if node supports filtering else false + */ + public boolean isEventFilteringSupported() { + return ((TargetNodeComponent)getParent().getParent()).isEventFilteringSupported(); + } + + /** + * Returns if node supports snapshots or not + * @return true if it supports snapshots else false + * + */ + public boolean isSnapshotSupported() { + return ((TargetNodeComponent)getParent().getParent()).isSnapshotSupported(); + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Retrieves the session configuration from the node. + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void getConfigurationFromNode(IProgressMonitor monitor) + throws ExecutionException { + removeAllChildren(); + ISessionInfo oldSessionInfo = fSessionInfo; + fSessionInfo = getControlService().getSession(getName(), monitor); + copyLiveInfo(oldSessionInfo); + + IDomainInfo[] domains = fSessionInfo.getDomains(); + for (int i = 0; i < domains.length; i++) { + TraceDomainComponent domainComponent = new TraceDomainComponent( + domains[i].getName(), this); + addChild(domainComponent); + domainComponent.setDomainInfo(domains[i]); + } + } + + /** + * Starts the session. + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void startSession(IProgressMonitor monitor) + throws ExecutionException { + getControlService().startSession(getName(), monitor); + } + + /** + * Starts the session. + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void stopSession(IProgressMonitor monitor) throws ExecutionException { + getControlService().stopSession(getName(), monitor); + } + + /** + * Enables channels with given names which are part of this domain. If a + * given channel doesn't exists it creates a new channel with the given + * parameters (or default values if given parameter is null). + * + * @param channelNames + * - a list of channel names to enable on this domain + * @param info + * - channel information to set for the channel (use null for + * default) + * @param isKernel + * - a flag for indicating kernel or UST. + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableChannels(List channelNames, IChannelInfo info, + boolean isKernel, IProgressMonitor monitor) + throws ExecutionException { + getControlService().enableChannels(getName(), channelNames, isKernel, + info, monitor); + } + + /** + * Enables a list of events with no additional parameters. + * + * @param eventNames + * - a list of event names to enabled. + * @param isKernel + * - a flag for indicating kernel or UST. + * @param filterExpression + * - a filter expression + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableEvents(List eventNames, boolean isKernel, + String filterExpression, IProgressMonitor monitor) throws ExecutionException { + getControlService().enableEvents(getName(), null, eventNames, isKernel, + filterExpression, monitor); + } + + /** + * Enables all syscalls (for kernel domain) + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableSyscalls(IProgressMonitor monitor) + throws ExecutionException { + getControlService().enableSyscalls(getName(), null, monitor); + } + + /** + * Enables a dynamic probe (for kernel domain) + * + * @param eventName + * - event name for probe + * @param isFunction + * - true for dynamic function entry/return probe else false + * @param probe + * - the actual probe + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableProbe(String eventName, boolean isFunction, String probe, + IProgressMonitor monitor) throws ExecutionException { + getControlService().enableProbe(getName(), null, eventName, isFunction, + probe, monitor); + } + + /** + * Enables events using log level. + * + * @param eventName + * - a event name + * @param logLevelType + * - a log level type + * @param level + * - a log level + * @param filterExpression + * - a filter expression + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void enableLogLevel(String eventName, LogLevelType logLevelType, + TraceLogLevel level, String filterExpression, IProgressMonitor monitor) + throws ExecutionException { + getControlService().enableLogLevel(getName(), null, eventName, + logLevelType, level, null, monitor); + } + + /** + * Gets all available contexts to be added to channels/events. + * + * @param monitor + * The monitor that will indicate the progress + * @return the list of available contexts + * @throws ExecutionException + * If the command fails + */ + public List getContextList(IProgressMonitor monitor) + throws ExecutionException { + return getControlService().getContextList(monitor); + } + + /** + * Records a snapshot. + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void recordSnapshot(IProgressMonitor monitor) throws ExecutionException { + getControlService().recordSnapshot(getName(), monitor); + } + + /** + * Returns if session is live. + * @return true if session if live else false + */ + public boolean isLiveTrace() { + return fSessionInfo.isLive(); + } + + /** + * Get the live URL. + * + * @return the live URL + */ + public String getLiveUrl() { + return fSessionInfo.getLiveUrl(); + } + + /** + * Get the live port. + * + * @return the live port + */ + public Integer getLivePort() { + return fSessionInfo.getLivePort(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionGroup.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionGroup.java new file mode 100644 index 0000000000..6e4a3cf0cf --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TraceSessionGroup.java @@ -0,0 +1,174 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; + +/** + *

+ * Implementation of the trace session group. + *

+ * + * @author Bernd Hufmann + */ +public class TraceSessionGroup extends TraceControlComponent { + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Path to icon file for this component. + */ + public static final String TRACE_SESSIONS_ICON_FILE = "icons/obj16/sessions.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public TraceSessionGroup(String name, ITraceControlComponent parent) { + super(name, parent); + setImage(TRACE_SESSIONS_ICON_FILE); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * @return the parent target node + */ + public TargetNodeComponent getTargetNode() { + return (TargetNodeComponent)getParent(); + } + + /** + * Returns if node supports networks streaming or not + * @return true if node supports filtering else false + */ + public boolean isNetworkStreamingSupported() { + return getTargetNode().isNetworkStreamingSupported(); + } + /** + * Returns if node supports snapshots or not + * @return true if it supports snapshots else false + * + */ public boolean isSnapshotSupported() { + return getTargetNode().isSnapshotSupported(); + } + + /** + * Returns if node supports live or not + * + * @return true if it supports live else false + */ + public boolean isLiveSupported() { + return getTargetNode().isLiveSupported(); + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * Retrieves the sessions information from the node. + * + * @throws ExecutionException + * If the command fails + */ + public void getSessionsFromNode() throws ExecutionException { + getSessionsFromNode(new NullProgressMonitor()); + } + + /** + * Retrieves the sessions information from the node. + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void getSessionsFromNode(IProgressMonitor monitor) + throws ExecutionException { + String[] sessionNames = getControlService().getSessionNames(monitor); + for (int i = 0; i < sessionNames.length; i++) { + TraceSessionComponent session = new TraceSessionComponent( + sessionNames[i], this); + addChild(session); + session.getConfigurationFromNode(monitor); + } + } + + /** + * Creates a session with given session name and location. + * + * @param sessionInf + * the session information used to create the session + * + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void createSession(ISessionInfo sessionInf, IProgressMonitor monitor) throws ExecutionException { + ISessionInfo sessionInfo = getControlService().createSession(sessionInf, monitor); + + if (sessionInfo != null) { + TraceSessionComponent session = new TraceSessionComponent(sessionInfo, TraceSessionGroup.this); + addChild(session); + session.getConfigurationFromNode(monitor); + } + } + + /** + * Command to execute a list of commands + * @param monitor + * - a progress monitor + * @param commands + * - a list of commands to execute + * @throws ExecutionException + * If the command fails + */ + public void executeCommands(IProgressMonitor monitor, List commands) throws ExecutionException { + getControlService().runCommands(monitor, commands); + getTargetNode().refresh(); + } + + /** + * Destroys a session with given session name. + * + * @param session + * - a session component to destroy + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + public void destroySession(TraceSessionComponent session, + IProgressMonitor monitor) throws ExecutionException { + getControlService().destroySession(session.getName(), monitor); + session.removeAllChildren(); + removeChild(session); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/UstProviderComponent.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/UstProviderComponent.java new file mode 100644 index 0000000000..2149f725fe --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/UstProviderComponent.java @@ -0,0 +1,104 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.ITraceControlComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.property.UstProviderPropertySource; +import org.eclipse.ui.views.properties.IPropertySource; + +/** + *

+ * Implementation of the UST provider component. + *

+ * + * @author Bernd Hufmann + */ +public class UstProviderComponent extends TraceControlComponent { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Path to icon file for this component. + */ + public static final String USTL_PROVIDER_ICON_FILE = "icons/obj16/targets.gif"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The UST provider information. + */ + private IUstProviderInfo fProviderInfo = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param name - the name of the component. + * @param parent - the parent of this component. + */ + public UstProviderComponent(String name, ITraceControlComponent parent) { + super(name, parent); + setImage(USTL_PROVIDER_ICON_FILE); + setToolTip(Messages.TraceControl_ProviderDisplayName); + fProviderInfo = new UstProviderInfo(name); + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * Sets the UST provider information to the given value. + * @param providerInfo - the provider information to set + */ + public void setUstProvider(IUstProviderInfo providerInfo) { + fProviderInfo = providerInfo; + IBaseEventInfo[] events = providerInfo.getEvents(); + for (int i = 0; i < events.length; i++) { + BaseEventComponent component = new BaseEventComponent(events[i].getName(), this); + component.setEventInfo(events[i]); + addChild(component); + } + setName(getName() + " [PID=" + fProviderInfo.getPid() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ + } + + /** + * @return the process ID of the UST provider. + */ + public int getPid() { + return fProviderInfo.getPid(); + } + + /** + * Sets the process ID of the UST provider to the given value. + * @param pid - process ID to set + */ + public void setPid(int pid) { + fProviderInfo.setPid(pid); + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) { + return new UstProviderPropertySource(this); + } + return null; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferenceInitializer.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferenceInitializer.java new file mode 100644 index 0000000000..5531645c1e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferenceInitializer.java @@ -0,0 +1,38 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; + +/** + *

+ * A class to initialize the preferences. + *

+ * + * @author Bernd Hufmann + */ +public class ControlPreferenceInitializer extends AbstractPreferenceInitializer { + + @Override + public void initializeDefaultPreferences() { + final IPreferenceStore store = ControlPreferences.getInstance().getPreferenceStore(); + + //Set default User ID if none already stored in preferences + store.setDefault(ControlPreferences.TRACE_CONTROL_TRACING_GROUP_PREF, ControlPreferences.TRACE_CONTROL_DEFAULT_TRACING_GROUP); + store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF, false); + store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_FILE_PATH_PREF, ControlPreferences.TRACE_CONTROL_DEFAULT_LOG_PATH); + store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, false); + store.setDefault(ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_NONE); + store.setDefault(ControlPreferences.TRACE_CONTROL_COMMAND_TIMEOUT_PREF, ControlPreferences.TRACE_CONTROL_DEFAULT_TIMEOUT_VALUE); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferencePage.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferencePage.java new file mode 100644 index 0000000000..1cea6a322d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferencePage.java @@ -0,0 +1,151 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences; + +import org.eclipse.jface.preference.BooleanFieldEditor; +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.preference.IntegerFieldEditor; +import org.eclipse.jface.preference.RadioGroupFieldEditor; +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.jface.util.PropertyChangeEvent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +/** + *

+ * Preference page implementation for configuring LTTng tracer control preferences. + *

+ * + * @author Bernd Hufmann + */ +public class ControlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + private RadioGroupFieldEditor fVerboseLevel; + private BooleanFieldEditor fIsAppend; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + */ + public ControlPreferencePage() { + super(FieldEditorPreferencePage.GRID); + + // Set the preference store for the preference page. + IPreferenceStore store = ControlPreferences.getInstance().getPreferenceStore(); + setPreferenceStore(store); + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void init(IWorkbench workbench) { + } + + @Override + protected void createFieldEditors() { + + StringFieldEditor tracingGroup = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_TRACING_GROUP_PREF, Messages.TraceControl_TracingGroupPreference, getFieldEditorParent()); + addField(tracingGroup); + + BooleanFieldEditor logCommand = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, Messages.TraceControl_LoggingPreference, getFieldEditorParent()); + addField(logCommand); + + StringFieldEditor logfile = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_FILE_PATH_PREF, Messages.TraceControl_LogfilePath, getFieldEditorParent()); + addField(logfile); + + fIsAppend = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF, Messages.TraceControl_AppendLogfilePreference, getFieldEditorParent()); + addField(fIsAppend); + + fVerboseLevel = new RadioGroupFieldEditor ( + ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF, + Messages.TraceControl_VerboseLevelsPreference, + 4, + new String[][] { + { + Messages.TraceControl_VerboseLevelNonePreference, + ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_NONE, + }, + { + Messages.TraceControl_VerboseLevelVerbosePreference, + ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE + }, + { + Messages.TraceControl_VerboseLevelVeryVerbosePreference, + ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE + }, + { + Messages.TraceControl_VerboseLevelVeryVeryVerbosePreference, + ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE + } + }, + getFieldEditorParent(), + true); + + addField(fVerboseLevel); + + Boolean enabled = ControlPreferences.getInstance().isLoggingEnabled(); + fVerboseLevel.setEnabled(enabled, getFieldEditorParent()); + fIsAppend.setEnabled(enabled, getFieldEditorParent()); + logfile.setEnabled(false, getFieldEditorParent()); + + IntegerFieldEditor commandTimeout = new IntegerFieldEditor(ControlPreferences.TRACE_CONTROL_COMMAND_TIMEOUT_PREF, Messages.TraceControl_CommandTimeout, getFieldEditorParent()); + commandTimeout.setValidRange(ControlPreferences.TRACE_CONTROL_MIN_TIMEOUT_VALUE, ControlPreferences.TRACE_CONTROL_MAX_TIMEOUT_VALUE); + addField(commandTimeout); + } + + @Override + public void propertyChange(PropertyChangeEvent event) { + + if (event.getProperty().equals(FieldEditor.VALUE)) { + if (event.getSource() instanceof FieldEditor) { + FieldEditor editor = (FieldEditor) event.getSource(); + if (editor.getPreferenceName().equals(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF)) { + Boolean enabled = (Boolean)event.getNewValue(); + fVerboseLevel.setEnabled(enabled, getFieldEditorParent()); + fIsAppend.setEnabled(enabled, getFieldEditorParent()); + } + } + } + super.propertyChange(event); + } + + @Override + protected void performDefaults() { + super.performDefaults(); + fVerboseLevel.setEnabled(false, getFieldEditorParent()); + fIsAppend.setEnabled(false, getFieldEditorParent()); + } + + @Override + public boolean performOk() { + boolean ret = super.performOk(); + // open or close log file + if (ControlPreferences.getInstance().isLoggingEnabled()) { + ControlCommandLogger.init(ControlPreferences.getInstance().getLogfilePath(), ControlPreferences.getInstance().isAppend()); + } else { + ControlCommandLogger.close(); + } + return ret; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferences.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferences.java new file mode 100644 index 0000000000..8d0c8d0b2f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/preferences/ControlPreferences.java @@ -0,0 +1,215 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences; + +import java.io.File; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; + +/** + *

+ * Singleton class to access LTTng tracer control preferences. + *

+ * + * @author Bernd Hufmann + */ +public class ControlPreferences { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Trace control log file + */ + public static final String TRACE_CONTROL_LOG_FILENAME = "lttng_tracer_control.log"; //$NON-NLS-1$ + + // Preference strings + /** + * The tracing group preference + */ + public static final String TRACE_CONTROL_TRACING_GROUP_PREF = "trace.control.tracing.group"; //$NON-NLS-1$ + /** + * The log commands preference + */ + public static final String TRACE_CONTROL_LOG_COMMANDS_PREF = "trace.control.log.commands"; //$NON-NLS-1$ + /** + * The log append preference + */ + public static final String TRACE_CONTROL_LOG_APPEND_PREF = "trace.control.log.append"; //$NON-NLS-1$ + /** + * The log file path preference + */ + public static final String TRACE_CONTROL_LOG_FILE_PATH_PREF = "trace.control.log.path"; //$NON-NLS-1$ + /** + * The verbose level preference + */ + public static final String TRACE_CONTROL_VERBOSE_LEVEL_PREF = "trace.control.verbose.level"; //$NON-NLS-1$ + /** + * The command time-out preference + */ + public static final String TRACE_CONTROL_COMMAND_TIMEOUT_PREF = "trace.control.command.timeout"; //$NON-NLS-1$ + /** + * The verbose level value for none + */ + public static final String TRACE_CONTROL_VERBOSE_LEVEL_NONE = "trace.control.verbose.level.none"; //$NON-NLS-1$ + /** + * The verbose level value for level 1 (-v) + */ + public static final String TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE = "trace.control.verbose.level.v"; //$NON-NLS-1$ + /** + * The verbose level value for level 2 (-vv) + */ + public static final String TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE = "trace.control.verbose.level.vv"; //$NON-NLS-1$ + /** + * The verbose level value for level 3 (-vvv) + */ + public static final String TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE = "trace.control.verbose.level.vvv"; //$NON-NLS-1$ + /** + * The default tracing group + */ + public static final String TRACE_CONTROL_DEFAULT_TRACING_GROUP = "tracing"; //$NON-NLS-1$ + /** + * The default tracing log file name with absolute path + */ + public static final String TRACE_CONTROL_DEFAULT_LOG_PATH = System.getProperty("user.home") + File.separator + TRACE_CONTROL_LOG_FILENAME; //$NON-NLS-1$ + /** + * Default timeout value used for executing commands, in seconds + */ + public static final int TRACE_CONTROL_DEFAULT_TIMEOUT_VALUE = 15; + /** + * Minimum timeout value used for executing commands, in seconds + */ + public static final int TRACE_CONTROL_MIN_TIMEOUT_VALUE = 5; + /** + * Maximum timeout value used for executing commands, in seconds + */ + public static final int TRACE_CONTROL_MAX_TIMEOUT_VALUE = 600; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The trace control preferences singleton instance. + */ + private static ControlPreferences fInstance = null; + /** + * The preference store reference + */ + private IPreferenceStore fPreferenceStore = null; + + // ------------------------------------------------------------------------ + // Constructor + // ------------------------------------------------------------------------ + /** + * Private constructor + */ + private ControlPreferences() { + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * Returns the trace control preferences singleton instance + * + * @return the trace control preferences singleton instance + */ + public static synchronized ControlPreferences getInstance() { + if (fInstance == null) { + fInstance = new ControlPreferences(); + } + return fInstance; + } + + /** + * @return the preference store + */ + public IPreferenceStore getPreferenceStore() { + return fPreferenceStore; + } + + /** + * @return true if tracing group is set to default + */ + public boolean isDefaultTracingGroup() { + return fPreferenceStore.getString(TRACE_CONTROL_TRACING_GROUP_PREF).equals(fPreferenceStore.getDefaultString(TRACE_CONTROL_TRACING_GROUP_PREF)); + } + + /** + * @return value of tracing group preference + */ + public String getTracingGroup() { + return fPreferenceStore.getString(TRACE_CONTROL_TRACING_GROUP_PREF); + } + + /** + * @return whether is logging is enabled + */ + public boolean isLoggingEnabled() { + return fPreferenceStore.getBoolean(TRACE_CONTROL_LOG_COMMANDS_PREF); + } + + /** + * @return whether an existing log file will appended or not + */ + public boolean isAppend() { + return fPreferenceStore.getBoolean(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF); + } + + /** + * @return verbose level preference + */ + public String getVerboseLevel() { + return fPreferenceStore.getString(TRACE_CONTROL_VERBOSE_LEVEL_PREF); + } + + /** + * @return absolute log file path + */ + public String getLogfilePath() { + return fPreferenceStore.getString(TRACE_CONTROL_LOG_FILE_PATH_PREF); + } + + /** + * @return command timeout value + */ + public int getCommandTimeout() { + return fPreferenceStore.getInt(TRACE_CONTROL_COMMAND_TIMEOUT_PREF); + } + + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + /** + * Initializes the control preferences (e.g. enable open log file) + * + * @param preferenceStore + * The preference store to assign + */ + public void init(IPreferenceStore preferenceStore) { + fPreferenceStore = preferenceStore; + + if (fPreferenceStore.getBoolean(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF)) { + ControlCommandLogger.init(getLogfilePath(), isAppend()); + } + } + + /** + * Disposes any resource (e.g. close log file). + */ + public void dispose() { + ControlCommandLogger.close(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BaseEventPropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BaseEventPropertySource.java new file mode 100644 index 0000000000..846bc0989b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BaseEventPropertySource.java @@ -0,0 +1,124 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertyDescriptor; + +/** + *

+ * Property source implementation for the base event component. + *

+ * + * @author Bernd Hufmann + */ +public class BaseEventPropertySource extends BasePropertySource { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * The base event 'name' property ID. + */ + public static final String BASE_EVENT_NAME_PROPERTY_ID = "base.event.name"; //$NON-NLS-1$ + /** + * The base event 'type' property ID. + */ + public static final String BASE_EVENT_TYPE_PROPERTY_ID = "base.event.type"; //$NON-NLS-1$ + /** + * The base event 'log level' property ID. + */ + public static final String BASE_EVENT_LOGLEVEL_PROPERTY_ID = "base.event.loglevel"; //$NON-NLS-1$ + /** + * The base event 'fields' property ID. + */ + public static final String BASE_EVENT_FIELDS_PROPERTY_ID = "base.event.fields"; //$NON-NLS-1$ + /** + * The base event 'name' property name. + */ + public static final String BASE_EVENT_NAME_PROPERTY_NAME = Messages.TraceControl_EventNamePropertyName; + /** + * The base event 'type' property name. + */ + public static final String BASE_EVENT_TYPE_PROPERTY_NAME = Messages.TraceControl_EventTypePropertyName; + /** + * The base event 'log level' property name. + */ + public static final String BASE_EVENT_LOGLEVEL_PROPERTY_NAME = Messages.TraceControl_LogLevelPropertyName; + /** + * The base event 'fields' property name. + */ + public static final String BASE_EVENT_FIELDS_PROPERTY_NAME = Messages.TraceControl_FieldsPropertyName; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The base event component which this property source is for. + */ + private final BaseEventComponent fBaseEvent; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param component - the base event component + */ + public BaseEventPropertySource(BaseEventComponent component) { + fBaseEvent = component; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IPropertyDescriptor[] getPropertyDescriptors() { + List list = new ArrayList<> (); + list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_NAME_PROPERTY_ID, BASE_EVENT_NAME_PROPERTY_NAME)); + list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_TYPE_PROPERTY_ID, BASE_EVENT_TYPE_PROPERTY_NAME)); + if (fBaseEvent.getLogLevel() != TraceLogLevel.LEVEL_UNKNOWN) { + list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_LOGLEVEL_PROPERTY_ID, BASE_EVENT_LOGLEVEL_PROPERTY_NAME)); + } + if (fBaseEvent.getFieldString() != null) { + list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_FIELDS_PROPERTY_ID, BASE_EVENT_FIELDS_PROPERTY_NAME)); + } + return list.toArray(new IPropertyDescriptor[list.size()]); + } + + @Override + public Object getPropertyValue(Object id) { + if(BASE_EVENT_NAME_PROPERTY_ID.equals(id)) { + return fBaseEvent.getName(); + } + if (BASE_EVENT_TYPE_PROPERTY_ID.equals(id)) { + return fBaseEvent.getEventType().name(); + } + if (BASE_EVENT_LOGLEVEL_PROPERTY_ID.equals(id)) { + return fBaseEvent.getLogLevel().name(); + } + if (BASE_EVENT_FIELDS_PROPERTY_ID.equals(id)) { + return fBaseEvent.getFieldString(); + } + return null; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BasePropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BasePropertySource.java new file mode 100644 index 0000000000..e5c7cede5f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/BasePropertySource.java @@ -0,0 +1,53 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import org.eclipse.ui.views.properties.IPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertySource; + +/** + *

+ * Base property source implementation. + *

+ * + * @author Bernd Hufmann + */ +public abstract class BasePropertySource implements IPropertySource { + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public Object getEditableValue() { + return null; + } + + @Override + public abstract IPropertyDescriptor[] getPropertyDescriptors(); + + @Override + public abstract Object getPropertyValue(Object id); + + @Override + public boolean isPropertySet(Object id) { + return false; + } + + @Override + public void resetPropertyValue(Object id) { + } + + @Override + public void setPropertyValue(Object id, Object value) { + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/KernelProviderPropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/KernelProviderPropertySource.java new file mode 100644 index 0000000000..00ae10c824 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/KernelProviderPropertySource.java @@ -0,0 +1,80 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertyDescriptor; + +/** + *

+ * Property source implementation for the kernl provider component. + *

+ * + * @author Bernd Hufmann + */ +public class KernelProviderPropertySource extends BasePropertySource { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * The kernel provider 'name' property ID. + */ + public static final String KERNEL_PROVIDER_NAME_PROPERTY_ID = "ust.provider.name"; //$NON-NLS-1$ + /** + * The kernel provider 'name' property name. + */ + public static final String KERNEL_PROVIDER_NAME_PROPERTY_NAME = Messages.TraceControl_ProviderNamePropertyName; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The kernel provider component which this property source is for. + */ + private KernelProviderComponent fProvider; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param component - the kernel provider component + */ + public KernelProviderPropertySource(KernelProviderComponent component) { + fProvider = component; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IPropertyDescriptor[] getPropertyDescriptors() { + return new IPropertyDescriptor[] { + new ReadOnlyTextPropertyDescriptor(KERNEL_PROVIDER_NAME_PROPERTY_ID, KERNEL_PROVIDER_NAME_PROPERTY_NAME)}; + } + + @Override + public Object getPropertyValue(Object id) { + if(KERNEL_PROVIDER_NAME_PROPERTY_ID.equals(id)) { + return fProvider.getName(); + } + return null; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TargetNodePropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TargetNodePropertySource.java new file mode 100644 index 0000000000..e552bb919e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TargetNodePropertySource.java @@ -0,0 +1,113 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertyDescriptor; + +/** + *

+ * Property source implementation for the target node component. + *

+ * + * @author Bernd Hufmann + */ +public class TargetNodePropertySource extends BasePropertySource { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The node name property ID. + */ + public static final String TARGET_NODE_NAME_PROPERTY_ID = "target.node.name"; //$NON-NLS-1$ + /** + * The node address property ID. + */ + public static final String TARGET_NODE_ADDRESS_PROPERTY_ID = "target.node.address"; //$NON-NLS-1$ + /** + * The state property ID. + */ + public static final String TARGET_NODE_STATE_PROPERTY_ID = "target.node.state"; //$NON-NLS-1$ + /** + * The node version property ID. + */ + public static final String TARGET_NODE_VERSION_PROPERTY_ID = "target.node.version"; //$NON-NLS-1$ + + /** + * The node name property name. + */ + public static final String TARGET_NODE_NAME_PROPERTY_NAME = Messages.TraceControl_HostNamePropertyName; + /** + * The node address property name. + */ + public static final String TARGET_NODE_ADDRESS_PROPERTY_NAME = Messages.TraceControl_HostAddressPropertyName; + /** + * The state address property name. + */ + public static final String TARGET_NODE_STATE_PROPERTY_NAME = Messages.TraceControl_StatePropertyName; + /** + * The node version property name. + */ + public static final String TARGET_NODE_VERSION_PROPERTY_NAME = Messages.TraceControl_VersionPropertyName; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The node component which this property source is for. + */ + private final TargetNodeComponent fTargetNode; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param component - the node component + */ + public TargetNodePropertySource(TargetNodeComponent component) { + fTargetNode = component; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IPropertyDescriptor[] getPropertyDescriptors() { + return new IPropertyDescriptor[] { + new ReadOnlyTextPropertyDescriptor(TARGET_NODE_NAME_PROPERTY_ID, TARGET_NODE_NAME_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TARGET_NODE_ADDRESS_PROPERTY_ID, TARGET_NODE_ADDRESS_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TARGET_NODE_STATE_PROPERTY_ID, TARGET_NODE_STATE_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TARGET_NODE_VERSION_PROPERTY_ID, TARGET_NODE_VERSION_PROPERTY_NAME)}; + } + + @Override + public Object getPropertyValue(Object id) { + if(TARGET_NODE_NAME_PROPERTY_ID.equals(id)) { + return fTargetNode.getName(); + } + if (TARGET_NODE_ADDRESS_PROPERTY_ID.equals(id)) { + return fTargetNode.getHostName(); + } + if (TARGET_NODE_STATE_PROPERTY_ID.equals(id)) { + return fTargetNode.getTargetNodeState().name(); + } + if (TARGET_NODE_VERSION_PROPERTY_ID.equals(id)) { + return fTargetNode.getNodeVersion(); + } + return null; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java new file mode 100644 index 0000000000..790a6dd01e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java @@ -0,0 +1,161 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertyDescriptor; + +/** + *

+ * Property source implementation for the trace channel component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceChannelPropertySource extends BasePropertySource { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The trace channel 'name' property ID. + */ + public static final String TRACE_CHANNEL_NAME_PROPERTY_ID = "trace.channel.name"; //$NON-NLS-1$ + /** + * The trace channel 'state' ID. + */ + public static final String TRACE_CHANNEL_STATE_PROPERTY_ID = "trace.channel.state"; //$NON-NLS-1$ + /** + * The trace channel 'overwrite mode' property ID. + */ + public static final String TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID = "trace.channel.overwrite.mode"; //$NON-NLS-1$ + /** + * The trace channel 'sub-buffer size' property ID. + */ + public static final String TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID = "trace.channel.subbuffer.size"; //$NON-NLS-1$ + /** + * The trace channel 'number of sub-buffers' property ID. + */ + public static final String TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID = "trace.channel.no.subbuffers"; //$NON-NLS-1$ + /** + * The trace channel 'switch timer interval' property ID. + */ + public static final String TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID = "trace.channel.switch.timer"; //$NON-NLS-1$ + /** + * The trace channel 'read timer interval' property ID. + */ + public static final String TRACE_CHANNEL_READ_TIMER_PROPERTY_ID = "trace.channel.read.timer"; //$NON-NLS-1$ + /** + * The trace channel 'output type' property ID. + */ + public static final String TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID = "trace.channel.output.type"; //$NON-NLS-1$ + /** + * The trace channel 'name' property name. + */ + public static final String TRACE_CHANNEL_NAME_PROPERTY_NAME = Messages.TraceControl_ChannelNamePropertyName; + /** + * The trace channel 'state' property name. + */ + public static final String TRACE_CHANNEL_STATE_PROPERTY_NAME = Messages.TraceControl_StatePropertyName; + /** + * The trace channel 'overwrite mode' property name. + */ + public static final String TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_NAME = Messages.TraceControl_OverwriteModePropertyName; + /** + * The trace channel 'sub-buffer size' property name. + */ + public static final String TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_NAME = Messages.TraceControl_SubBufferSizePropertyName; + /** + * The trace channel 'sub-buffer size' property name. + */ + public static final String TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_NAME = Messages.TraceControl_NbSubBuffersPropertyName; + /** + * The trace channel 'switch timer interval' property name. + */ + public static final String TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_NAME = Messages.TraceControl_SwitchTimerPropertyName; + /** + * The trace channel 'read timer interval' property name. + */ + public static final String TRACE_CHANNEL_READ_TIMER_PROPERTY_NAME = Messages.TraceControl_ReadTimerPropertyName; + /** + * The trace channel 'output type' property name. + */ + public static final String TRACE_CHANNEL_OUTPUT_TYPEPROPERTY_NAME = Messages.TraceControl_OutputTypePropertyName; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The channel component which this property source is for. + */ + private final TraceChannelComponent fChannel; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + /** + * Constructor + * @param component - the channel component + */ + public TraceChannelPropertySource(TraceChannelComponent component) { + fChannel = component; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IPropertyDescriptor[] getPropertyDescriptors() { + return new IPropertyDescriptor[] { + new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NAME_PROPERTY_ID, TRACE_CHANNEL_NAME_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_STATE_PROPERTY_ID, TRACE_CHANNEL_STATE_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID, TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID, TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID, TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID, TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_READ_TIMER_PROPERTY_ID, TRACE_CHANNEL_READ_TIMER_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID, TRACE_CHANNEL_OUTPUT_TYPEPROPERTY_NAME)}; + } + + @Override + public Object getPropertyValue(Object id) { + if(TRACE_CHANNEL_NAME_PROPERTY_ID.equals(id)) { + return fChannel.getName(); + } + if (TRACE_CHANNEL_STATE_PROPERTY_ID.equals(id)) { + return fChannel.getState().name(); + } + if(TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID.equals(id)) { + return String.valueOf(fChannel.isOverwriteMode()); + } + if(TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID.equals(id)) { + return String.valueOf(fChannel.getSubBufferSize()); + } + if(TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID.equals(id)) { + return String.valueOf(fChannel.getNumberOfSubBuffers()); + } + if(TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID.equals(id)) { + return String.valueOf(fChannel.getSwitchTimer()); + } + if(TRACE_CHANNEL_READ_TIMER_PROPERTY_ID.equals(id)) { + return String.valueOf(fChannel.getReadTimer()); + } + if(TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID.equals(id)) { + return fChannel.getOutputType().getInName(); + } + return null; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceDomainPropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceDomainPropertySource.java new file mode 100644 index 0000000000..630fe7f064 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceDomainPropertySource.java @@ -0,0 +1,99 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertyDescriptor; + +/** + *

+ * Property source implementation for the trace domain component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceDomainPropertySource extends BasePropertySource { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * The trace domain 'name' property ID. + */ + public static final String TRACE_DOMAIN_NAME_PROPERTY_ID = "trace.domain.name"; //$NON-NLS-1$ + /** + * The trace domain 'name' property name. + */ + public static final String TRACE_DOMAIN_NAME_PROPERTY_NAME = Messages.TraceControl_DomainNamePropertyName; + /** + * The domain 'buffer type' property ID. + */ + public static final String BUFFER_TYPE_PROPERTY_ID = "trace.domain.bufferType"; //$NON-NLS-1$ + /** + * The domain 'buffer type' property name. + */ + public static final String BUFER_TYPE_PROPERTY_NAME = Messages.TraceControl_BufferTypePropertyName; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The trace domain component which this property source is for. + */ + private final TraceDomainComponent fDomain; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param component - the trace domain component + */ + public TraceDomainPropertySource(TraceDomainComponent component) { + fDomain = component; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IPropertyDescriptor[] getPropertyDescriptors() { + if (fDomain.getBufferType() == BufferType.BUFFER_TYPE_UNKNOWN) { + return new IPropertyDescriptor[] { + new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME) }; + } + + return new IPropertyDescriptor[] { + new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(BUFFER_TYPE_PROPERTY_ID, BUFER_TYPE_PROPERTY_NAME) }; + } + + @Override + public Object getPropertyValue(Object id) { + if(BUFFER_TYPE_PROPERTY_ID.equals(id)){ + return fDomain.getBufferType().getInName(); + } + + if(TRACE_DOMAIN_NAME_PROPERTY_ID.equals(id)) { + return fDomain.getName(); + } + return null; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceEventPropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceEventPropertySource.java new file mode 100644 index 0000000000..e7cc8f5889 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceEventPropertySource.java @@ -0,0 +1,145 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertyDescriptor; + +/** + *

+ * Property source implementation for the trace event component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceEventPropertySource extends BasePropertySource { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The trace event 'name' property ID. + */ + public static final String TRACE_EVENT_NAME_PROPERTY_ID = "trace.event.name"; //$NON-NLS-1$ + /** + * The trace event 'type' property ID. + */ + public static final String TRACE_EVENT_TYPE_PROPERTY_ID = "trace.event.type"; //$NON-NLS-1$ + /** + * The trace event 'log level' property ID. + */ + public static final String TRACE_EVENT_LOGLEVEL_PROPERTY_ID = "trace.event.loglevel"; //$NON-NLS-1$ + /** + * The trace event 'state' property ID. + */ + public static final String TRACE_EVENT_STATE_PROPERTY_ID = "trace.event.state"; //$NON-NLS-1$ + /** + * The trace event 'filter' property ID. + */ + public static final String TRACE_EVENT_FILTER_PROPERTY_ID = "trace.event.filter"; //$NON-NLS-1$ + + /** + * The trace event 'name' property name. + */ + public static final String TRACE_EVENT_NAME_PROPERTY_NAME = Messages.TraceControl_EventNamePropertyName; + /** + * The trace event 'type' property name. + */ + public static final String TRACE_EVENT_TYPE_PROPERTY_NAME = Messages.TraceControl_EventTypePropertyName; + /** + * The trace event 'log level' property name. + */ + public static final String TRACE_EVENT_LOGLEVEL_PROPERTY_NAME = Messages.TraceControl_LogLevelPropertyName; + /** + * The trace event 'state' property name. + */ + public static final String TRACE_EVENT_STATE_PROPERTY_NAME = Messages.TraceControl_StatePropertyName; + /** + * The trace event 'filter' property name. + */ + public static final String TRACE_EVENT_FILTER_PROPERTY_NAME = Messages.TraceControl_FilterPropertyName; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The event component which this property source is for. + */ + protected final TraceEventComponent fEvent; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param component - the base event component + */ + public TraceEventPropertySource(TraceEventComponent component) { + fEvent = component; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IPropertyDescriptor[] getPropertyDescriptors() { + List list = new ArrayList<> (); + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_NAME_PROPERTY_ID, TRACE_EVENT_NAME_PROPERTY_NAME)); + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_TYPE_PROPERTY_ID, TRACE_EVENT_TYPE_PROPERTY_NAME)); + list.add( new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_STATE_PROPERTY_ID, TRACE_EVENT_STATE_PROPERTY_NAME)); + if (fEvent.getLogLevel() != TraceLogLevel.LEVEL_UNKNOWN) { + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_LOGLEVEL_PROPERTY_ID, TRACE_EVENT_LOGLEVEL_PROPERTY_NAME)); + } + if (fEvent.getFilterExpression() != null) { + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_FILTER_PROPERTY_ID, TRACE_EVENT_FILTER_PROPERTY_NAME)); + } + return list.toArray(new IPropertyDescriptor[list.size()]); + } + + @Override + public Object getPropertyValue(Object id) { + if(TRACE_EVENT_NAME_PROPERTY_ID.equals(id)) { + return fEvent.getName(); + } + if (TRACE_EVENT_TYPE_PROPERTY_ID.equals(id)) { + return fEvent.getEventType().name(); + } + if (TRACE_EVENT_LOGLEVEL_PROPERTY_ID.equals(id)) { + StringBuffer buffer = new StringBuffer(); + if (fEvent.getLogLevelType() != LogLevelType.LOGLEVEL_NONE) { + buffer.append(fEvent.getLogLevelType().getShortName()).append(' '); + } + buffer.append(fEvent.getLogLevel().name()); + return buffer.toString(); + } + if (TRACE_EVENT_STATE_PROPERTY_ID.equals(id)) { + return fEvent.getState().name(); + } + if (TRACE_EVENT_FILTER_PROPERTY_ID.equals(id)) { + return fEvent.getFilterExpression(); + } + + return null; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceProbeEventPropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceProbeEventPropertySource.java new file mode 100644 index 0000000000..759d43b7d2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceProbeEventPropertySource.java @@ -0,0 +1,124 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertyDescriptor; + +/** + *

+ * Property source implementation for the trace probe event component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceProbeEventPropertySource extends TraceEventPropertySource { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The trace event 'probe address' property ID. + */ + public static final String TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID = "trace.event.probe.address"; //$NON-NLS-1$ + /** + * The trace event 'probe offset' property ID. + */ + public static final String TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID = "trace.event.probe.offset"; //$NON-NLS-1$ + /** + * The trace event 'probe symbol' property ID. + */ + public static final String TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID = "trace.event.probe.symbol"; //$NON-NLS-1$ + /** + * The trace event 'probe address' property name. + */ + public static final String TRACE_EVENT_PROBE_ADDRESS_PROPERTY_NAME = Messages.TraceControl_ProbeAddressPropertyName; + /** + * The trace event 'probe offset' property ID. + */ + public static final String TRACE_EVENT_PROBE_OFFSET_PROPERTY_NAME = Messages.TraceControl_ProbeOffsetPropertyName; + /** + * The trace event 'probe symbol' property ID. + */ + public static final String TRACE_EVENT_PROBE_SYMBOL_PROPERTY_NAME = Messages.TraceControl_ProbeSymbolPropertyName; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * + * @param component + * A trace event component + */ + public TraceProbeEventPropertySource(TraceEventComponent component) { + super(component); + if (component.getClass() != TraceProbeEventComponent.class) { + throw new IllegalArgumentException("Invalid type passed. Only class of type TraceProbeEventComponent allowed:\n" + component.getClass()); //$NON-NLS-1$ + } + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IPropertyDescriptor[] getPropertyDescriptors() { + IPropertyDescriptor[] superProperties = super.getPropertyDescriptors(); + + List superList = Arrays.asList(superProperties); + ArrayList list = new ArrayList<>(); + list.addAll(superList); + + if (fEvent instanceof TraceProbeEventComponent) { + TraceProbeEventComponent event = (TraceProbeEventComponent) fEvent; + if (event.getAddress() != null) { + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID, TRACE_EVENT_PROBE_ADDRESS_PROPERTY_NAME)); + } + + if (event.getOffset() != null) { + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID, TRACE_EVENT_PROBE_OFFSET_PROPERTY_NAME)); + } + + if (event.getSymbol() != null) { + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID, TRACE_EVENT_PROBE_SYMBOL_PROPERTY_NAME)); + } + } + return list.toArray(new IPropertyDescriptor[list.size()]); + } + + @Override + public Object getPropertyValue(Object id) { + if(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID.equals(id)) { + return ((TraceProbeEventComponent)fEvent).getAddress(); + } + if (TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID.equals(id)) { + return ((TraceProbeEventComponent)fEvent).getOffset(); + } + if (TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID.equals(id)) { + return ((TraceProbeEventComponent)fEvent).getSymbol(); + } + return super.getPropertyValue(id); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceSessionPropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceSessionPropertySource.java new file mode 100644 index 0000000000..0ccb10ec38 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/TraceSessionPropertySource.java @@ -0,0 +1,147 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertyDescriptor; + +/** + *

+ * Property source implementation for the trace session component. + *

+ * + * @author Bernd Hufmann + */ +public class TraceSessionPropertySource extends BasePropertySource { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The trace session name property ID. + */ + public static final String TRACE_SESSION_NAME_PROPERTY_ID = "trace.session.name"; //$NON-NLS-1$ + /** + * The trace session path property ID. + */ + public static final String TRACE_SESSION_PATH_PROPERTY_ID = "trace.session.path"; //$NON-NLS-1$ + /** + * The trace session state ID. + */ + public static final String TRACE_SESSION_STATE_PROPERTY_ID = "trace.session.state"; //$NON-NLS-1$ + /** + * The trace snapshot path property ID. + */ + public static final String TRACE_SNAPSHOT_PATH_PROPERTY_ID = "trace.snapshot.path"; //$NON-NLS-1$ + /** + * The snapshot name property. + */ + public static final String TRACE_SNAPSHOT_NAME_PROPERTY_ID = "trace.snapshot.name"; //$NON-NLS-1$ + /** + * The snapshot ID property. + */ + public static final String TRACE_SNAPSHOT_ID_PROPERTY_ID = "trace.snapshot.id"; //$NON-NLS-1$ + + /** + * The trace session name property name. + */ + public static final String TRACE_SESSION_NAME_PROPERTY_NAME = Messages.TraceControl_SessionNamePropertyName; + /** + * The trace session path property name. + */ + public static final String TRACE_SESSION_PATH_PROPERTY_NAME = Messages.TraceControl_SessionPathPropertyName; + /** + * The trace session state property name. + */ + public static final String TRACE_SESSION_STATE_PROPERTY_NAME = Messages.TraceControl_StatePropertyName; + /** + * The snapshot path property name. + */ + public static final String TRACE_SNAPSHOT_PATH_PROPERTY_NAME = Messages.TraceControl_SnapshotPathPropertyName; + /** + * The trace snapshot name property name. + */ + public static final String TRACE_SNAPSHOT_NAME_PROPERTY_NAME = Messages.TraceControl_SnapshotNamePropertyName; + /** + * The trace snapshot ID property name. + */ + public static final String TRACE_SNAPSHOT_ID_PROPERTY_NAME = Messages.TraceControl_SnapshotIdPropertyName; + + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The session component which this property source is for. + */ + private final TraceSessionComponent fSession; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param component - the session component + */ + public TraceSessionPropertySource(TraceSessionComponent component) { + fSession = component; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IPropertyDescriptor[] getPropertyDescriptors() { + List list = new ArrayList<>(); + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SESSION_NAME_PROPERTY_ID, TRACE_SESSION_NAME_PROPERTY_NAME)); + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SESSION_STATE_PROPERTY_ID, TRACE_SESSION_STATE_PROPERTY_NAME)); + if (fSession.isSnapshotSession()) { + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SNAPSHOT_NAME_PROPERTY_ID, TRACE_SNAPSHOT_NAME_PROPERTY_NAME)); + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SNAPSHOT_PATH_PROPERTY_ID, TRACE_SNAPSHOT_PATH_PROPERTY_NAME)); + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SNAPSHOT_ID_PROPERTY_ID, TRACE_SNAPSHOT_ID_PROPERTY_NAME)); + } else { + list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SESSION_PATH_PROPERTY_ID, TRACE_SESSION_PATH_PROPERTY_NAME)); + } + return(list.toArray(new IPropertyDescriptor[list.size()])); + } + + @Override + public Object getPropertyValue(Object id) { + if(TRACE_SESSION_NAME_PROPERTY_ID.equals(id)) { + return fSession.getName(); + } + if(TRACE_SESSION_PATH_PROPERTY_ID.equals(id)) { + return fSession.getSessionPath(); + } + if (TRACE_SESSION_STATE_PROPERTY_ID.equals(id)) { + return fSession.getSessionState().name(); + } + if (TRACE_SNAPSHOT_PATH_PROPERTY_ID.equals(id)) { + return (fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getSnapshotPath() : ""); //$NON-NLS-1$ + } + if (TRACE_SNAPSHOT_NAME_PROPERTY_ID.equals(id)) { + return (fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getName() : ""); //$NON-NLS-1$ + } + if (TRACE_SNAPSHOT_ID_PROPERTY_ID.equals(id)) { + return (fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getId() : ""); //$NON-NLS-1$ + } + return null; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/UstProviderPropertySource.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/UstProviderPropertySource.java new file mode 100644 index 0000000000..bd2ad61e27 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/property/UstProviderPropertySource.java @@ -0,0 +1,91 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.property; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; +import org.eclipse.ui.views.properties.IPropertyDescriptor; + +/** + *

+ * Property source implementation for the UST provider component. + *

+ * + * @author Bernd Hufmann + */ +public class UstProviderPropertySource extends BasePropertySource { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * The UST provider 'name' property ID. + */ + public static final String UST_PROVIDER_NAME_PROPERTY_ID = "ust.provider.name"; //$NON-NLS-1$ + /** + * The UST provider 'PID' property ID. + */ + public static final String UST_PROVIDER_PID_PROPERTY_ID = "ust.provider.pid"; //$NON-NLS-1$ + /** + * The UST provider 'name' property name. + */ + public static final String UST_PROVIDER_NAME_PROPERTY_NAME = Messages.TraceControl_ProviderNamePropertyName; + /** + * The UST provider 'type' property name. + */ + public static final String UST_PROVIDER_PID_PROPERTY_NAME = Messages.TraceControl_ProcessIdPropertyName; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The UST provider component which this property source is for. + */ + private UstProviderComponent fUstProvider; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * @param component - the UST provider component + */ + public UstProviderPropertySource(UstProviderComponent component) { + fUstProvider = component; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IPropertyDescriptor[] getPropertyDescriptors() { + return new IPropertyDescriptor[] { + new ReadOnlyTextPropertyDescriptor(UST_PROVIDER_NAME_PROPERTY_ID, UST_PROVIDER_NAME_PROPERTY_NAME), + new ReadOnlyTextPropertyDescriptor(UST_PROVIDER_PID_PROPERTY_ID, UST_PROVIDER_PID_PROPERTY_NAME)}; + } + + @Override + public Object getPropertyValue(Object id) { + if(UST_PROVIDER_NAME_PROPERTY_ID.equals(id)) { + return fUstProvider.getName(); + } + if (UST_PROVIDER_PID_PROPERTY_ID.equals(id)) { + return String.valueOf(fUstProvider.getPid()); + } + return null; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandResult.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandResult.java new file mode 100644 index 0000000000..9b7c0b545d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandResult.java @@ -0,0 +1,102 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; + +import java.util.Arrays; + +/** + *

+ * Class containing command result of remote command execution. + *

+ * + * @author Bernd Hufmann + */ +public class CommandResult implements ICommandResult { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The result of the command. 0 if successful else > 0 + */ + private int fResult; + + /** + * The output as String array. + */ + private String[] fOutput = new String[0]; + private String[] fErrorOutput = new String[0]; + + // ------------------------------------------------------------------------ + // Constructor + // ------------------------------------------------------------------------ + + /** + * Constructor + * + * @param result + * The result of the command + * @param output + * The output, as an array of strings + * @param errorOutput + * THe error output as an array of strings + */ + public CommandResult(int result, String[] output, String[] errorOutput) { + fResult = result; + if (output != null) { + fOutput = Arrays.copyOf(output, output.length); + } + if (errorOutput != null) { + fErrorOutput = Arrays.copyOf(errorOutput, errorOutput.length); + } + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public int getResult() { + return fResult; + } + + @Override + public void setResult(int result) { + fResult = result; + } + + @Override + public String[] getOutput() { + return Arrays.copyOf(fOutput, fOutput.length); + } + + @Override + public void setOutput(String[] output) { + fOutput = new String[0]; + if (output != null) { + fOutput = Arrays.copyOf(output, output.length); + } + } + + @Override + public String[] getErrorOutput() { + return Arrays.copyOf(fErrorOutput, fErrorOutput.length); + } + + @Override + public void setErrorOutput(String[] output) { + fErrorOutput = new String[0]; + if (output != null) { + fErrorOutput = Arrays.copyOf(output, output.length); + } + } +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java new file mode 100644 index 0000000000..ea6cfa7ce8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java @@ -0,0 +1,335 @@ +/********************************************************************** + * Copyright (c) 2012, 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 Tasse - Initial API and implementation + * Bernd Hufmann - Updated using Executor Framework + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Random; +import java.util.concurrent.Callable; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.FutureTask; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; +import org.eclipse.rse.services.shells.HostShellProcessAdapter; +import org.eclipse.rse.services.shells.IHostShell; +import org.eclipse.rse.services.shells.IShellService; + +/** + *

+ * Implementation of remote command execution using RSE's shell service. + *

+ * + * @author Patrick Tasse + * @author Bernd Hufmann + */ +public class CommandShell implements ICommandShell { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** Sub-string to be echo'ed when running command in shell, used to indicate that the command has finished running */ + public static final String DONE_MARKUP_STRING = "--RSE:donedonedone:--"; //$NON-NLS-1$ + + /** Sub-string to be echoed when running a command in shell. */ + public static final String BEGIN_END_TAG = "BEGIN-END-TAG:"; //$NON-NLS-1$ + + /** Command delimiter for shell */ + public static final String CMD_DELIMITER = "\n"; //$NON-NLS-1$ + + /** Shell "echo" command */ + public static final String SHELL_ECHO_CMD = " echo "; //$NON-NLS-1$ + + /** Default command separator */ + public static final char CMD_SEPARATOR = ';'; + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + private IRemoteSystemProxy fProxy = null; + private IHostShell fHostShell = null; + private BufferedReader fInputBufferReader = null; + private BufferedReader fErrorBufferReader = null; + private final ExecutorService fExecutor = Executors.newFixedThreadPool(1); + private boolean fIsConnected = false; + private final Random fRandom = new Random(System.currentTimeMillis()); + private int fReturnValue; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Create a new command shell + * + * @param proxy + * The RSE proxy for this shell + */ + public CommandShell(IRemoteSystemProxy proxy) { + fProxy = proxy; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public void connect() throws ExecutionException { + IShellService shellService = fProxy.getShellService(); + Process p = null; + try { + String[] env = new String[0]; + + if (fProxy.isLocal()) { + env = shellService.getHostEnvironment(); + } + + fHostShell = shellService.launchShell("", env, new NullProgressMonitor()); //$NON-NLS-1$ + p = new HostShellProcessAdapter(fHostShell); + } catch (Exception e) { + throw new ExecutionException(Messages.TraceControl_CommandShellError, e); + } + fInputBufferReader = new BufferedReader(new InputStreamReader(p.getInputStream())); + fErrorBufferReader = new BufferedReader(new InputStreamReader(p.getErrorStream())); + fIsConnected = true; + } + + @Override + public void disconnect() { + fIsConnected = false; + try { + fInputBufferReader.close(); + fErrorBufferReader.close(); + } catch (IOException e) { + // ignore + } + } + + @Override + public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException { + return executeCommand(command, monitor, true); + } + + @Override + public ICommandResult executeCommand(final String command, final IProgressMonitor monitor, final boolean checkReturnValue) throws ExecutionException { + if (fIsConnected) { + FutureTask future = new FutureTask<>(new Callable() { + @Override + public CommandResult call() throws IOException, CancellationException { + final ArrayList result = new ArrayList<>(); + final ArrayList errorResult = new ArrayList<>(); + + synchronized (fHostShell) { + // Initialize return value which will be updated in isAliasEchoResult() + fReturnValue = 0; + + int startAlias = fRandom.nextInt(); + int endAlias = fRandom.nextInt(); + fHostShell.writeToShell(formatShellCommand(command, startAlias, endAlias)); + + String nextLine; + boolean isStartFound = false; + while ((nextLine = fInputBufferReader.readLine()) != null) { + + if (monitor.isCanceled()) { + flushInput(); + throw new CancellationException(); + } + + // check if line contains echoed start alias + if (isAliasEchoResult(nextLine, startAlias, true)) { + isStartFound = true; + continue; + } + + // check if line contains is the end mark-up. This will retrieve also + // the return value of the actual command. + if (isAliasEchoResult(nextLine, endAlias, false)) { + break; + } + + // Ignore line if + // 1) start hasn't been found or + // 2) line is an echo of the command or + // 3) line is an echo of the end mark-up + if (!isStartFound || + isCommandEcho(nextLine, command) || + nextLine.contains(getEchoResult(endAlias))) + { + continue; + } + + // Now it's time add to the result + result.add(nextLine); + } + + // Read any left over output + flushInput(); + + // Read error stream output when command failed. + if (fReturnValue != 0) { + while(fErrorBufferReader.ready()) { + if ((nextLine = fErrorBufferReader.readLine()) != null) { + errorResult.add(nextLine); + } + } + // Workaround if error stream is not available and stderr output is written + // in standard output above. This is true for the SshTerminalShell implementation. + if (errorResult.isEmpty()) { + errorResult.addAll(result); + } + } + } + return new CommandResult(fReturnValue, result.toArray(new String[result.size()]), errorResult.toArray(new String[errorResult.size()])); + } + }); + + fExecutor.execute(future); + + try { + return future.get(ControlPreferences.getInstance().getCommandTimeout(), TimeUnit.SECONDS); + } catch (java.util.concurrent.ExecutionException ex) { + throw new ExecutionException(Messages.TraceControl_ExecutionFailure, ex); + } catch (InterruptedException ex) { + throw new ExecutionException(Messages.TraceControl_ExecutionCancelled, ex); + } catch (TimeoutException ex) { + throw new ExecutionException(Messages.TraceControl_ExecutionTimeout, ex); + } + } + throw new ExecutionException(Messages.TraceControl_ShellNotConnected, null); + } + + // ------------------------------------------------------------------------ + // Helper methods + // ------------------------------------------------------------------------ + /** + * Flushes the buffer reader + * @throws IOException + */ + private void flushInput() throws IOException { + char[] cbuf = new char[1]; + while (fInputBufferReader.ready()) { + if (fInputBufferReader.read(cbuf, 0, 1) == -1) { + break; + } + } + } + + /** + * Format the command to be sent into the shell command with start and end marker strings. + * The start marker is need to know when the actual command output starts. The end marker + * string is needed so we can tell that end of output has been reached. + * + * @param cmd The actual command + * @param startAlias The command alias for start marker + * @param endAlias The command alias for end marker + * @return formatted command string + */ + private static String formatShellCommand(String cmd, int startAlias, int endAlias) { + if (cmd == null || cmd.equals("")) { //$NON-NLS-1$ + return cmd; + } + StringBuffer formattedCommand = new StringBuffer(); + // Make multi-line command. + // Wrap actual command with start marker and end marker to wrap actual command. + formattedCommand.append(getEchoCmd(startAlias)); + formattedCommand.append(CMD_DELIMITER); + formattedCommand.append(cmd); + formattedCommand.append(CMD_DELIMITER); + formattedCommand.append(getEchoCmd(endAlias)); + formattedCommand.append(CMD_DELIMITER); + return formattedCommand.toString(); + } + + /** + * Creates a echo command line in the format: echo $? + * + * @param alias The command alias integer to be included in the echoed message. + * @return the echo command line + */ + private static String getEchoCmd(int alias) { + return SHELL_ECHO_CMD + getEchoResult(alias) + "$?"; //$NON-NLS-1$ + } + + /** + * Creates the expected result for a given command alias: + * $? + * + * @param alias The command alias integer to be included in the echoed message. + * @return the expected echo result + */ + private static String getEchoResult(int alias) { + return BEGIN_END_TAG + String.valueOf(alias) + DONE_MARKUP_STRING; + } + + /** + * Verifies if given command line contains a command alias echo result. + * + * @param line The output line to test. + * @param alias The command alias + * @param checkReturnValue true to retrieve command result (previous command) false + * @return true if output line is a command alias echo result else false + */ + private boolean isAliasEchoResult(String line, int alias, boolean checkReturnValue) { + String expected = getEchoResult(alias); + if (line.startsWith(expected)) { + if (!checkReturnValue) { + try { + int k = Integer.valueOf(line.substring(expected.length())); + fReturnValue = k; + } catch (NumberFormatException e) { + // do nothing + } + } + return true; + } + int index = line.indexOf(expected); + if ((index > 0) && (line.indexOf(SHELL_ECHO_CMD) == -1)) { + return true; + } + + return false; + } + + /** + * Verifies if output line is an echo of the given command line. If the + * output line is longer then the maximum line lengths (e.g. for ssh), the + * shell adds a line break character. This method takes this in + * consideration by comparing the command line without any whitespaces. + * + * @param line + * The output line to verify + * @param cmd + * The command executed + * @return true if it's an echoed command line else + * false + */ + @SuppressWarnings("nls") + private static boolean isCommandEcho(String line, String cmd) { + String s1 = line.replaceAll("\\s",""); + String s2 = cmd.replaceAll("\\s",""); + s2 = s2.replaceAll("(\\*)", "(\\\\*)"); + String patternStr = ".*(" + s2 +")$"; + return s1.matches(patternStr); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandResult.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandResult.java new file mode 100644 index 0000000000..be1d2abe33 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandResult.java @@ -0,0 +1,64 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + *********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; + +/** + *

+ * Interface for providing command execution result. + *

+ * + * @author Bernd Hufmann + */ +public interface ICommandResult { + /** + * The result of the command. + * + * @return 0 if successful else >0 + */ + int getResult(); + + /** + * Sets the command result value. + * + * @param result + * The integer result to set + */ + void setResult(int result); + + /** + * @return returns the command output. + */ + String[] getOutput(); + + /** + * Sets the command output. + * + * @param output + * The output (as an array of Strings) to assign + */ + void setOutput(String[] output); + + /** + * The error output of the command. + * + * @return returns the command error output. + */ + String[] getErrorOutput(); + + /** + * Sets the command output. + * + * @param output + * The output (as an array of Strings) to assign + */ + void setErrorOutput(String[] output); +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java new file mode 100644 index 0000000000..ea0417c9fb --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java @@ -0,0 +1,71 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; + +/** + *

+ * Interface for a command shell implementation + *

+ * + * @author Bernd Hufmann + */ +public interface ICommandShell { + + /** + * Method to connect the command shell. + * + * @throws ExecutionException + * If the command fails + */ + void connect() throws ExecutionException; + + /** + * Method to disconnect the command shell. + */ + void disconnect(); + + /** + * Method to execute a command on the command shell. + * + * @param command + * - the command to executed + * @param monitor + * - a progress monitor + * @return the command result + * @throws ExecutionException + * If the command fails + */ + ICommandResult executeCommand(String command, + IProgressMonitor monitor) throws ExecutionException; + + /** + * Method to execute a command on the command shell. + * + * @param command + * - the command to executed + * @param monitor + * - a progress monitor + * @param checkReturnValue + * - flag to indicate that the command result should be checked. + * If false the command result will be always 0. + * @return the command result + * @throws ExecutionException + * If the command fails + */ + ICommandResult executeCommand(final String command, + final IProgressMonitor monitor, final boolean checkReturnValue) + throws ExecutionException; + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java new file mode 100644 index 0000000000..c91d82a006 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java @@ -0,0 +1,140 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.rse.core.model.IRSECallback; +import org.eclipse.rse.core.subsystems.ICommunicationsListener; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.services.shells.IShellService; +import org.eclipse.rse.services.terminals.ITerminalService; +import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; + +/** + *

+ * Remote System Proxy interface. + *

+ * + * @author Bernd Hufmann + */ +public interface IRemoteSystemProxy { + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Invalid port number for IP based connections. + */ + static final int INVALID_PORT_NUMBER = -1; + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * Find the first shell service. + * + * @return shell service object, or null if not found. + */ + IShellService getShellService(); + + /** + * Find the first terminal service. + * + * @return shell service object, or null if not found. + */ + ITerminalService getTerminalService(); + + /** + * Find the first IShellServiceSubSystem service. + * + * @return shell service subsystem, or null if not found. + */ + ISubSystem getShellServiceSubSystem(); + + /** + * Find the first ITerminalServiceSubSystem service. + * + * @return shell service subsystem, or null if not found. + */ + ISubSystem getTerminalServiceSubSystem(); + + /** + * Finds the File Service Subsystem. + * + * @return file service subsystem, or null if not found. + */ + IFileServiceSubSystem getFileServiceSubSystem(); + + /** + * @return port of IP connection to be used + */ + int getPort(); + + /** + * Sets the port of the IP connection. + * @param port - the IP port to set + */ + void setPort(int port); + + /** + * Connects the shell service sub system. + * + * @param callback + * - call-back method being called when connection was finished + * @throws ExecutionException + * If the connection fails + */ + void connect(IRSECallback callback) throws ExecutionException; + + /** + * Disconnects from the shell service sub system. + * + * @throws ExecutionException + * If the disconnect command fails + */ + void disconnect() throws ExecutionException; + + /** + * Creates a command shell. + * + * @return the command shell implementation + * @throws ExecutionException + * If the command fails + */ + ICommandShell createCommandShell() throws ExecutionException; + + /** + * Method to add a communication listener to the connector service defined + * for the given connection. + * + * @param listener + * - listener to add + */ + void addCommunicationListener(ICommunicationsListener listener); + + /** + * Method to remove a communication listener from the connector service + * defined for the given connection. + * + * @param listener + * - listener to remove + */ + void removeCommunicationListener(ICommunicationsListener listener); + + /** + * Checks whether the local host connector service is used or not. + * + * @return true if local connection else + * + */ + public boolean isLocal(); +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java new file mode 100644 index 0000000000..8ddc210ea5 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java @@ -0,0 +1,203 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Status; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.IRSECallback; +import org.eclipse.rse.core.subsystems.ICommunicationsListener; +import org.eclipse.rse.core.subsystems.IConnectorService; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.services.IService; +import org.eclipse.rse.services.shells.IShellService; +import org.eclipse.rse.services.terminals.ITerminalService; +import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; + +/** + *

+ * RemoteSystemProxy implementation. + *

+ * + * @author Bernd Hufmann + */ +public class RemoteSystemProxy implements IRemoteSystemProxy { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + private final IHost fHost; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * + * @param host + * The host of this proxy + */ + public RemoteSystemProxy(IHost host) { + fHost = host; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public IShellService getShellService() { + ISubSystem ss = getShellServiceSubSystem(); + if (ss != null) { + return (IShellService)ss.getSubSystemConfiguration().getService(fHost).getAdapter(IShellService.class); + } + return null; + } + + @Override + public ITerminalService getTerminalService() { + ISubSystem ss = getTerminalServiceSubSystem(); + if (ss != null) { + return (ITerminalService)ss.getSubSystemConfiguration().getService(fHost).getAdapter(ITerminalService.class); + } + return null; + } + + @Override + public ISubSystem getShellServiceSubSystem() { + if (fHost == null) { + return null; + } + ISubSystem[] subSystems = fHost.getSubSystems(); + IShellService ssvc = null; + for (int i = 0; subSystems != null && i < subSystems.length; i++) { + IService svc = subSystems[i].getSubSystemConfiguration().getService(fHost); + if (svc!=null) { + ssvc = (IShellService)svc.getAdapter(IShellService.class); + if (ssvc != null) { + return subSystems[i]; + } + } + } + return null; + } + + @Override + public ISubSystem getTerminalServiceSubSystem() { + if (fHost == null) { + return null; + } + ISubSystem[] subSystems = fHost.getSubSystems(); + ITerminalService ssvc = null; + for (int i = 0; subSystems != null && i < subSystems.length; i++) { + IService svc = subSystems[i].getSubSystemConfiguration().getService(fHost); + if (svc!=null) { + ssvc = (ITerminalService)svc.getAdapter(ITerminalService.class); + if (ssvc != null) { + return subSystems[i]; + } + } + } + return null; + } + + @Override + public IFileServiceSubSystem getFileServiceSubSystem() { + if (fHost == null) { + return null; + } + ISubSystem[] subSystems = fHost.getSubSystems(); + for (int i = 0; subSystems != null && i < subSystems.length; i++) { + if (subSystems[i] instanceof IFileServiceSubSystem) { + return (IFileServiceSubSystem)subSystems[i]; + } + } + return null; + } + + @Override + public int getPort() { + if (getShellServiceSubSystem() != null) { + return getShellServiceSubSystem().getConnectorService().getPort(); + } + return IRemoteSystemProxy.INVALID_PORT_NUMBER; + } + + @Override + public void setPort(int port) { + if ((getShellServiceSubSystem() != null) && (port > 0)) { + getShellServiceSubSystem().getConnectorService().setPort(port); + } + } + + @Override + public void connect(IRSECallback callback) throws ExecutionException { + ISubSystem shellSubSystem = getShellServiceSubSystem(); + if (shellSubSystem != null) { + if (!shellSubSystem.isConnected()) { + try { + shellSubSystem.connect(false, callback); + } catch (OperationCanceledException e) { + callback.done(Status.CANCEL_STATUS, null); + } + catch (Exception e) { + throw new ExecutionException(e.toString(), e); + } + } else { + callback.done(Status.OK_STATUS, null); + } + } + } + + @Override + public void disconnect() throws ExecutionException { + ISubSystem shellSubSystem = getShellServiceSubSystem(); + if (shellSubSystem != null) { + try { + shellSubSystem.disconnect(); + } catch (Exception e) { + throw new ExecutionException(e.toString(), e); + } + } + } + + @Override + public ICommandShell createCommandShell() throws ExecutionException { + ICommandShell shell = new CommandShell(this); + shell.connect(); + return shell; + } + + @Override + public void addCommunicationListener(ICommunicationsListener listener) { + IConnectorService[] css = fHost.getConnectorServices(); + for (IConnectorService cs : css) { + cs.addCommunicationsListener(listener); + } + } + + @Override + public void removeCommunicationListener(ICommunicationsListener listener) { + IConnectorService[] css = fHost.getConnectorServices(); + for (IConnectorService cs : css) { + cs.removeCommunicationsListener(listener); + } + } + + @Override + public boolean isLocal() { + return fHost.getSystemType().isLocal(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/ILttngControlService.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/ILttngControlService.java new file mode 100644 index 0000000000..1cb020c914 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/ILttngControlService.java @@ -0,0 +1,402 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; + + +/** +*

+* Interface for LTTng trace control command service. +*

+* +* @author Bernd Hufmann +*/ +public interface ILttngControlService { + + /** + * @return the LTTng version object + */ + LttngVersion getVersion(); + + /** + * @return the version string + */ + String getVersionString(); + + /** + * Checks if given version is supported by this ILTTngControlService implementation. + * + * @param version The version to check + * @return true if version is supported else false + */ + boolean isVersionSupported(String version); + + /** + * Retrieves the existing sessions names from the node. + * + * @param monitor + * - a progress monitor + * @return an array with session names. + * @throws ExecutionException + * If the command fails + */ + String[] getSessionNames(IProgressMonitor monitor) + throws ExecutionException; + + /** + * Retrieves the session information with the given name the node. + * + * @param sessionName + * - the session name + * @param monitor + * - a progress monitor + * @return session information + * @throws ExecutionException + * If the command fails + */ + ISessionInfo getSession(String sessionName, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Retrieves the snapshot output information from the node + * @param sessionName + * - the session name + * @param monitor + * - a progress monitor + * @return snapshot output information + * @throws ExecutionException + * if command fails + */ + ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Retrieves the kernel provider information (i.e. the kernel events) + * + * @param monitor + * - a progress monitor + * @return the list of existing kernel events. + * @throws ExecutionException + * If the command fails + */ + List getKernelProvider(IProgressMonitor monitor) + throws ExecutionException; + + /** + * Retrieves the UST provider information from the node. + * + * @return - the UST provider information. + * @throws ExecutionException + * If the command fails + */ + public List getUstProvider() throws ExecutionException; + + /** + * Retrieves the UST provider information from the node. + * + * @param monitor + * - a progress monitor + * @return the UST provider information. + * @throws ExecutionException + * If the command fails + */ + List getUstProvider(IProgressMonitor monitor) + throws ExecutionException; + + /** + * Creates a session with given session name and location. + * + * @param sessionInfo + * the session information used to create the session + * @param monitor + * - a progress monitor + * + * @return the session information + * @throws ExecutionException + * If the command fails + */ + ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException; + + /** + * Destroys a session with given session name. + * + * @param sessionName + * - a session name to destroy + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void destroySession(String sessionName, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Starts a session with given session name. + * + * @param sessionName + * - a session name to start + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void startSession(String sessionName, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Stops a session with given session name. + * + * @param sessionName + * - a session name to stop + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void stopSession(String sessionName, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Enables a list of channels for given session and given channel + * information (configuration). + * + * @param sessionName + * - a session name to create + * @param channelNames + * - a list of channel names to be enabled + * @param isKernel + * - a flag to indicate Kernel or UST (true for Kernel, false for + * UST) + * @param info + * - channel information used for creation of a channel (or null + * for default) + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void enableChannels(String sessionName, List channelNames, + boolean isKernel, IChannelInfo info, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Disables a list of channels for given session and given channel + * information (configuration). + * + * @param sessionName + * - a session name to create + * @param channelNames + * - a list of channel names to be enabled + * @param isKernel + * - a flag to indicate Kernel or UST (true for Kernel, false for + * UST) + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void disableChannels(String sessionName, List channelNames, + boolean isKernel, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Enables a list of events with no additional parameters. + * + * @param sessionName + * - a session name + * @param channelName + * - a channel name or null for default channel + * @param eventNames + * - a list of event names to be enabled, or null (list of size = + * 0)for all events . + * @param isKernel + * - a flag for indicating kernel or UST. + * @param filterExpression + * - a filter expression + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void enableEvents(String sessionName, String channelName, + List eventNames, boolean isKernel, String filterExpression, + IProgressMonitor monitor) + throws ExecutionException; + + + /** + * Enables all syscall events. + * + * @param sessionName + * - a session name + * @param channelName + * - a channel name or null for default channel + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void enableSyscalls(String sessionName, String channelName, + IProgressMonitor monitor) throws ExecutionException; + + /** + * Enables a dynamic probe or dynamic function entry/return probe. + * + * @param sessionName + * - a session name + * @param channelName + * - a channel name or null for default channel + * @param eventName + * - a event name + * @param isFunction + * - true for dynamic function entry/return probe else false + * @param probe + * - a dynamic probe information + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void enableProbe(String sessionName, String channelName, + String eventName, boolean isFunction, String probe, + IProgressMonitor monitor) throws ExecutionException; + + /** + * Enables events using log level + * + * @param sessionName + * - a session name + * @param channelName + * - a channel name (null for default channel) + * @param eventName + * - a event name + * @param logLevelType + * - a log level type + * @param level + * - a log level + * @param filterExpression + * - a filter expression + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void enableLogLevel(String sessionName, String channelName, + String eventName, LogLevelType logLevelType, TraceLogLevel level, + String filterExpression, + IProgressMonitor monitor) throws ExecutionException; + + /** + * Disables a list of events with no additional parameters. + * + * @param sessionName + * - a session name + * @param channelName + * - a channel name (null for default channel) + * @param eventNames + * - a list of event names to enabled. + * @param isKernel + * - a flag for indicating kernel or UST. + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void disableEvent(String sessionName, String channelName, + List eventNames, boolean isKernel, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Gets all available context names to be added to channels/events. + * + * @param monitor + * The progress monitor + * @return the list of available contexts + * @throws ExecutionException + * If the command fails + */ + List getContextList(IProgressMonitor monitor) + throws ExecutionException; + + /** + * Add contexts to given channels and or events + * + * @param sessionName + * - a session name + * @param channelName + * - a channel name (null for all channels) + * @param eventName + * - a event name (null for all events) + * @param isKernel + * - a flag for indicating kernel or UST. + * @param contexts + * - a list of name of contexts to add + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void addContexts(String sessionName, String channelName, + String eventName, boolean isKernel, List contexts, + IProgressMonitor monitor) throws ExecutionException; + + /** + * Executes calibrate command to quantify LTTng overhead. + * + * @param isKernel + * - a flag for indicating kernel or UST. + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void calibrate(boolean isKernel, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Records a snapshot. + * + * @param sessionName + * - a session name + * @param monitor + * - a progress monitor + * @throws ExecutionException + * If the command fails + */ + void recordSnapshot(String sessionName, IProgressMonitor monitor) + throws ExecutionException; + + /** + * Executes a list of commands + * + * @param monitor + * - a progress monitor + * @param commands + * - array of commands + * @throws ExecutionException + * If a command fails + */ + void runCommands(IProgressMonitor monitor, List commands) + throws ExecutionException; +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java new file mode 100644 index 0000000000..75a87ab013 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java @@ -0,0 +1,1579 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + * Simon Delisle - Updated for support of LTTng Tools 2.2 + * Marc-Andre Laperle - Support for creating a live session + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; + +/** + *

+ * Service for sending LTTng trace control commands to remote host. + *

+ * + * @author Bernd Hufmann + */ +public class LTTngControlService implements ILttngControlService { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The command shell implementation + */ + private final ICommandShell fCommandShell; + + /** + * The version string. + */ + private LttngVersion fVersion = null; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * + * @param shell + * - the command shell implementation to use + */ + public LTTngControlService(ICommandShell shell) { + fCommandShell = shell; + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + @Override + public String getVersionString() { + if (fVersion == null) { + return "Unknown"; //$NON-NLS-1$ + } + return fVersion.toString(); + } + + @Override + public LttngVersion getVersion() { + return fVersion; + } + + /** + * Sets the version of the LTTng 2.0 control service. + * + * @param version + * - a version to set + */ + public void setVersion(String version) { + fVersion = new LttngVersion(version); + } + + /** + * Sets the version of the LTTng 2.x control service. + * + * @param version + * - a version to set + */ + public void setVersion(LttngVersion version) { + fVersion = version; + } + + @Override + public boolean isVersionSupported(String version) { + LttngVersion tmp = new LttngVersion(version); + return (fVersion != null && fVersion.compareTo(tmp) >= 0) ? true : false; + } + + /** + * Returns the command shell implementation. + * + * @return the command shell implementation + */ + protected ICommandShell getCommandShell() { + return fCommandShell; + } + + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + + @Override + public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST); + + ICommandResult result = executeCommand(command.toString(), monitor); + + // Output: + // Available tracing sessions: + // 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) + // [inactive] + // 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) + // [inactive] + // + // Use lttng list for more details + + ArrayList retArray = new ArrayList<>(); + int index = 0; + while (index < result.getOutput().length) { + String line = result.getOutput()[index]; + Matcher matcher = LTTngControlServiceConstants.SESSION_PATTERN.matcher(line); + if (matcher.matches()) { + retArray.add(matcher.group(2).trim()); + } + index++; + } + return retArray.toArray(new String[retArray.size()]); + } + + /** + * Check if there is a pattern to be ignored into a sequence of string + * + * @param input + * an arrays of string + * @param pattern + * the pattern to search for + * @return if the pattern exist into the array of string + */ + protected boolean ignoredPattern(String[] input, Pattern pattern) { + for (String line : input) { + Matcher matcher = pattern.matcher(line); + if (matcher.matches()) { + return true; + } + } + return false; + } + + @Override + public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, sessionName); + ICommandResult result = executeCommand(command.toString(), monitor); + + int index = 0; + + // Output: + // Tracing session mysession2: [inactive] + // Trace path: /home/eedbhu/lttng-traces/mysession2-20120123-110330 + ISessionInfo sessionInfo = new SessionInfo(sessionName); + + while (index < result.getOutput().length) { + // Tracing session mysession2: [inactive] + // Trace path: /home/eedbhu/lttng-traces/mysession2-20120123-110330 + // + // === Domain: Kernel === + // + String line = result.getOutput()[index]; + Matcher matcher = LTTngControlServiceConstants.TRACE_SESSION_PATTERN.matcher(line); + if (matcher.matches()) { + sessionInfo.setSessionState(matcher.group(2)); + index++; + continue; + } + + matcher = LTTngControlServiceConstants.TRACE_SNAPSHOT_SESSION_PATTERN.matcher(line); + if (matcher.matches()) { + sessionInfo.setSessionState(matcher.group(2)); + // real name will be set later + ISnapshotInfo snapshotInfo = new SnapshotInfo(""); //$NON-NLS-1$ + sessionInfo.setSnapshotInfo(snapshotInfo); + index++; + continue; + } + + if (!sessionInfo.isSnapshotSession()) { + matcher = LTTngControlServiceConstants.TRACE_NETWORK_PATH_PATTERN.matcher(line); + if (matcher.matches()) { + sessionInfo.setStreamedTrace(true); + } + + matcher = LTTngControlServiceConstants.TRACE_SESSION_PATH_PATTERN.matcher(line); + if (matcher.matches()) { + sessionInfo.setSessionPath(matcher.group(1).trim()); + index++; + continue; + } + } + + matcher = LTTngControlServiceConstants.DOMAIN_KERNEL_PATTERN.matcher(line); + if (matcher.matches()) { + // Create Domain + IDomainInfo domainInfo = new DomainInfo(Messages.TraceControl_KernelDomainDisplayName); + + // set kernel flag + domainInfo.setIsKernel(true); + + // in domain kernel + ArrayList channels = new ArrayList<>(); + index = parseDomain(result.getOutput(), index, channels, domainInfo); + + if (channels.size() > 0) { + // add domain + sessionInfo.addDomain(domainInfo); + + // set channels + domainInfo.setChannels(channels); + } + continue; + } + + matcher = LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(line); + if (matcher.matches()) { + IDomainInfo domainInfo = new DomainInfo(Messages.TraceControl_UstGlobalDomainDisplayName); + + // set kernel flag + domainInfo.setIsKernel(false); + + // in domain UST + ArrayList channels = new ArrayList<>(); + index = parseDomain(result.getOutput(), index, channels, domainInfo); + + if (channels.size() > 0) { + // add domain + sessionInfo.addDomain(domainInfo); + + // set channels + domainInfo.setChannels(channels); + } + continue; + } + index++; + } + + if (sessionInfo.isSnapshotSession()) { + ISnapshotInfo snapshot = getSnapshotInfo(sessionName, monitor); + sessionInfo.setSnapshotInfo(snapshot); + } + + return sessionInfo; + } + + @Override + public ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName); + ICommandResult result = executeCommand(command.toString(), monitor); + + int index = 0; + + // Output: + // [1] snapshot-1: /home/user/lttng-traces/my-20130909-114431 + // or + // [3] snapshot-3: net4://172.0.0.1/ + ISnapshotInfo snapshotInfo = new SnapshotInfo(""); //$NON-NLS-1$ + + while (index < result.getOutput().length) { + String line = result.getOutput()[index]; + Matcher matcher = LTTngControlServiceConstants.LIST_SNAPSHOT_OUTPUT_PATTERN.matcher(line); + if (matcher.matches()) { + snapshotInfo.setId(Integer.valueOf(matcher.group(1))); + snapshotInfo.setName(matcher.group(2)); + snapshotInfo.setSnapshotPath(matcher.group(3)); + + Matcher matcher2 = LTTngControlServiceConstants.SNAPSHOT_NETWORK_PATH_PATTERN.matcher(snapshotInfo.getSnapshotPath()); + if (matcher2.matches()) { + snapshotInfo.setStreamedSnapshot(true); + } + + index++; + break; + } + index++; + } + + return snapshotInfo; + } + + @Override + public List getKernelProvider(IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_KERNEL); + ICommandResult result = executeCommand(command.toString(), monitor, false); + + List events = new ArrayList<>(); + + if (result.getErrorOutput() != null) { + // Ignore the following 2 cases: + // Spawning a session daemon + // Error: Unable to list kernel events + // or: + // Error: Unable to list kernel events + // + if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN)) { + return events; + } + } + + if (isError(result)) { + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ + } + + // Kernel events: + // ------------- + // sched_kthread_stop (type: tracepoint) + getProviderEventInfo(result.getOutput(), 0, events); + return events; + } + + @Override + public List getUstProvider() throws ExecutionException { + return getUstProvider(new NullProgressMonitor()); + } + + @Override + public List getUstProvider(IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_UST); + + if (isVersionSupported("2.1.0")) { //$NON-NLS-1$ + command.append(LTTngControlServiceConstants.OPTION_FIELDS); + } + + ICommandResult result = executeCommand(command.toString(), monitor, false); + List allProviders = new ArrayList<>(); + + // Workaround for versions 2.0.x which causes a segmentation fault for + // this command + // if LTTng Tools is compiled without UST support. + if (!isVersionSupported("2.1.0") && (result.getResult() != 0)) { //$NON-NLS-1$ + return allProviders; + } + + if (result.getErrorOutput() != null) { + // Ignore the following 2 cases: + // Spawning a session daemon + // Error: Unable to list UST events: Listing UST events failed + // or: + // Error: Unable to list UST events: Listing UST events failed + // + if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) { + return allProviders; + } + } + + if (isError(result)) { + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ + } + + // Note that field print-outs exists for version >= 2.1.0 + // + // UST events: + // ------------- + // + // PID: 3635 - Name: + // /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello + // ust_tests_hello:tptest_sighandler (loglevel: TRACE_EMERG0) (type: + // tracepoint) + // ust_tests_hello:tptest (loglevel: TRACE_EMERG0) (type: tracepoint) + // field: doublefield (float) + // field: floatfield (float) + // field: stringfield (string) + // + // PID: 6459 - Name: + // /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello + // ust_tests_hello:tptest_sighandler (loglevel: TRACE_EMERG0) (type: + // tracepoint) + // ust_tests_hello:tptest (loglevel: TRACE_EMERG0) (type: tracepoint) + // field: doublefield (float) + // field: floatfield (float) + // field: stringfield (string) + + IUstProviderInfo provider = null; + + int index = 0; + while (index < result.getOutput().length) { + String line = result.getOutput()[index]; + Matcher matcher = LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line); + if (matcher.matches()) { + provider = new UstProviderInfo(matcher.group(2).trim()); + provider.setPid(Integer.valueOf(matcher.group(1).trim())); + List events = new ArrayList<>(); + index = getProviderEventInfo(result.getOutput(), ++index, events); + provider.setEvents(events); + allProviders.add(provider); + } else { + index++; + } + } + return allProviders; + } + + @Override + public ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { + if (sessionInfo.isStreamedTrace()) { + return createStreamedSession(sessionInfo, monitor); + } + + StringBuffer command = prepareSessionCreationCommand(sessionInfo); + + ICommandResult result = executeCommand(command.toString(), monitor); + + // Session myssession2 created. + // Traces will be written in + // /home/user/lttng-traces/myssession2-20120209-095418 + String[] output = result.getOutput(); + + // Get and session name and path + String name = null; + String path = null; + + int index = 0; + while (index < output.length) { + String line = output[index]; + Matcher nameMatcher = LTTngControlServiceConstants.CREATE_SESSION_NAME_PATTERN.matcher(line); + Matcher pathMatcher = LTTngControlServiceConstants.CREATE_SESSION_PATH_PATTERN.matcher(line); + if (nameMatcher.matches()) { + name = String.valueOf(nameMatcher.group(1).trim()); + } else if (pathMatcher.matches()) { + path = String.valueOf(pathMatcher.group(1).trim()); + } + index++; + } + + // Verify session name + if ((name == null) || (!"".equals(sessionInfo.getName()) && !name.equals(sessionInfo.getName()))) { //$NON-NLS-1$ + // Unexpected name returned + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.TraceControl_UnexpectedNameError + ": " + name); //$NON-NLS-1$ + } + + sessionInfo.setName(name); + // Verify session path + if (!sessionInfo.isSnapshotSession() && + ((path == null) || ((sessionInfo.getSessionPath() != null) && (!path.contains(sessionInfo.getSessionPath()))))) { + // Unexpected path + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.TraceControl_UnexpectedPathError + ": " + name); //$NON-NLS-1$ + } + + if (sessionInfo.isSnapshotSession()) { + // Make it a snapshot session - content of snapshot info need to + // set afterwards using getSession() or getSnapshotInfo() + sessionInfo.setSnapshotInfo(new SnapshotInfo("")); //$NON-NLS-1$ + } else { + sessionInfo.setSessionPath(path); + } + + return sessionInfo; + + } + + /** + * Basic generation of command for session creation + * + * @param sessionInfo + * the session to create + * @return the basic command for command creation + */ + protected StringBuffer prepareSessionCreationCommand(ISessionInfo sessionInfo) { + String newName = formatParameter(sessionInfo.getName()); + String newPath = formatParameter(sessionInfo.getSessionPath()); + + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION, newName); + + if (newPath != null && !"".equals(newPath)) { //$NON-NLS-1$ + command.append(LTTngControlServiceConstants.OPTION_OUTPUT_PATH); + command.append(newPath); + } + + if (sessionInfo.isSnapshotSession()) { + command.append(LTTngControlServiceConstants.OPTION_SNAPSHOT); + } + return command; + } + + private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { + + StringBuffer command = prepareStreamedSessionCreationCommand(sessionInfo); + + ICommandResult result = executeCommand(command.toString(), monitor); + + // Verify output + String[] output = result.getOutput(); + + // Get and session name and path + String name = null; + String path = null; + + int index = 0; + while (index < output.length) { + String line = output[index]; + Matcher nameMatcher = LTTngControlServiceConstants.CREATE_SESSION_NAME_PATTERN.matcher(line); + Matcher pathMatcher = LTTngControlServiceConstants.CREATE_SESSION_PATH_PATTERN.matcher(line); + + if (nameMatcher.matches()) { + name = String.valueOf(nameMatcher.group(1).trim()); + } else if (pathMatcher.matches() && (sessionInfo.getNetworkUrl() != null)) { + path = String.valueOf(pathMatcher.group(1).trim()); + } + index++; + } + + // Verify session name + if ((name == null) || (!"".equals(sessionInfo.getName()) && !name.equals(sessionInfo.getName()))) { //$NON-NLS-1$ + // Unexpected name returned + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.TraceControl_UnexpectedNameError + ": " + name); //$NON-NLS-1$ + } + + sessionInfo.setName(name); + + sessionInfo.setStreamedTrace(true); + + // Verify session path + if (sessionInfo.getNetworkUrl() != null) { + if (!sessionInfo.isSnapshotSession() && (path == null)) { + // Unexpected path + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.TraceControl_UnexpectedPathError + ": " + name); //$NON-NLS-1$ + } + + if (sessionInfo.isSnapshotSession()) { + sessionInfo.setStreamedTrace(false); + } else { + sessionInfo.setSessionPath(path); + // Check file protocol + Matcher matcher = LTTngControlServiceConstants.TRACE_FILE_PROTOCOL_PATTERN.matcher(path); + if (matcher.matches()) { + sessionInfo.setStreamedTrace(false); + } + } + } + + // When using controlUrl and dataUrl the full session path is not known + // yet and will be set later on when listing the session + + return sessionInfo; + } + + /** + * Basic generation of command for streamed session creation + * + * @param sessionInfo + * the session to create + * @return the basic command for command creation + */ + protected StringBuffer prepareStreamedSessionCreationCommand(ISessionInfo sessionInfo) { + String newName = formatParameter(sessionInfo.getName()); + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION, newName); + + if (sessionInfo.isSnapshotSession()) { + command.append(LTTngControlServiceConstants.OPTION_SNAPSHOT); + } else if (sessionInfo.isLive()) { + command.append(LTTngControlServiceConstants.OPTION_LIVE); + if (sessionInfo.getLiveDelay() != LTTngControlServiceConstants.UNUSED_VALUE) { + command.append(sessionInfo.getLiveDelay()); + } + } + + if (sessionInfo.getNetworkUrl() != null) { + command.append(LTTngControlServiceConstants.OPTION_NETWORK_URL); + command.append(sessionInfo.getNetworkUrl()); + } else { + command.append(LTTngControlServiceConstants.OPTION_CONTROL_URL); + command.append(sessionInfo.getControlUrl()); + + command.append(LTTngControlServiceConstants.OPTION_DATA_URL); + command.append(sessionInfo.getDataUrl()); + } + return command; + } + + @Override + public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { + String newName = formatParameter(sessionName); + + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName); + + ICommandResult result = executeCommand(command.toString(), monitor, false); + String[] errorOutput = result.getErrorOutput(); + + boolean isError = isError(result); + if (isError && (errorOutput != null)) { + if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { + isError = false; + + } + } + + if (isError) { + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ + } + + // Session destroyed + } + + @Override + public void startSession(String sessionName, IProgressMonitor monitor) throws ExecutionException { + + String newSessionName = formatParameter(sessionName); + + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_START_SESSION, newSessionName); + + executeCommand(command.toString(), monitor); + + // Session started + } + + @Override + public void stopSession(String sessionName, IProgressMonitor monitor) throws ExecutionException { + String newSessionName = formatParameter(sessionName); + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_STOP_SESSION, newSessionName); + + executeCommand(command.toString(), monitor); + + // Session stopped + + } + + @Override + public void enableChannels(String sessionName, List channelNames, boolean isKernel, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException { + + // no channels to enable + if (channelNames.isEmpty()) { + return; + } + + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_CHANNEL); + + for (Iterator iterator = channelNames.iterator(); iterator.hasNext();) { + String channel = iterator.next(); + command.append(channel); + if (iterator.hasNext()) { + command.append(','); + } + } + + if (isKernel) { + command.append(LTTngControlServiceConstants.OPTION_KERNEL); + } else { + command.append(LTTngControlServiceConstants.OPTION_UST); + } + + String newSessionName = formatParameter(sessionName); + command.append(LTTngControlServiceConstants.OPTION_SESSION); + command.append(newSessionName); + + if (info != null) { + // --discard Discard event when buffers are full (default) + + // --overwrite Flight recorder mode + if (info.isOverwriteMode()) { + command.append(LTTngControlServiceConstants.OPTION_OVERWRITE); + } + // --subbuf-size SIZE Subbuffer size in bytes + // (default: 4096, kernel default: 262144) + if (info.getSubBufferSize() != LTTngControlServiceConstants.UNUSED_VALUE) { + command.append(LTTngControlServiceConstants.OPTION_SUB_BUFFER_SIZE); + command.append(String.valueOf(info.getSubBufferSize())); + } + + // --num-subbuf NUM Number of subbufers + if (info.getNumberOfSubBuffers() != LTTngControlServiceConstants.UNUSED_VALUE) { + command.append(LTTngControlServiceConstants.OPTION_NUM_SUB_BUFFERS); + command.append(String.valueOf(info.getNumberOfSubBuffers())); + } + + // --switch-timer USEC Switch timer interval in usec + if (info.getSwitchTimer() != LTTngControlServiceConstants.UNUSED_VALUE) { + command.append(LTTngControlServiceConstants.OPTION_SWITCH_TIMER); + command.append(String.valueOf(info.getSwitchTimer())); + } + + // --read-timer USEC Read timer interval in usec + if (info.getReadTimer() != LTTngControlServiceConstants.UNUSED_VALUE) { + command.append(LTTngControlServiceConstants.OPTION_READ_TIMER); + command.append(String.valueOf(info.getReadTimer())); + } + + if (isVersionSupported("2.2.0")) { //$NON-NLS-1$ + // --buffers-uid Every application sharing the same UID use the + // same buffers --buffers-pid Buffers are allocated per PID + if (!isKernel) { + if (info.getBufferType() == BufferType.BUFFER_PER_PID) { + command.append(LTTngControlServiceConstants.OPTION_PER_PID_BUFFERS); + + } else if (info.getBufferType() == BufferType.BUFFER_PER_UID) { + command.append(LTTngControlServiceConstants.OPTION_PER_UID_BUFFERS); + } + } + + // -C SIZE Maximum size of trace files in bytes + if (info.getMaxSizeTraceFiles() != LTTngControlServiceConstants.UNUSED_VALUE) { + command.append(LTTngControlServiceConstants.OPTION_MAX_SIZE_TRACE_FILES); + command.append(String.valueOf(info.getMaxSizeTraceFiles())); + } + + // -W NUM Maximum number of trace files + if (info.getMaxNumberTraceFiles() != LTTngControlServiceConstants.UNUSED_VALUE) { + command.append(LTTngControlServiceConstants.OPTION_MAX_TRACE_FILES); + command.append(String.valueOf(info.getMaxNumberTraceFiles())); + } + } + } + + executeCommand(command.toString(), monitor); + + } + + @Override + public void disableChannels(String sessionName, List channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException { + + // no channels to enable + if (channelNames.isEmpty()) { + return; + } + + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_CHANNEL); + + for (Iterator iterator = channelNames.iterator(); iterator.hasNext();) { + String channel = iterator.next(); + command.append(channel); + if (iterator.hasNext()) { + command.append(','); + } + } + + if (isKernel) { + command.append(LTTngControlServiceConstants.OPTION_KERNEL); + } else { + command.append(LTTngControlServiceConstants.OPTION_UST); + } + + String newSessionName = formatParameter(sessionName); + command.append(LTTngControlServiceConstants.OPTION_SESSION); + command.append(newSessionName); + + executeCommand(command.toString(), monitor); + } + + @Override + public void enableEvents(String sessionName, String channelName, List eventNames, boolean isKernel, String filterExpression, IProgressMonitor monitor) throws ExecutionException { + + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT); + + if (eventNames == null || eventNames.isEmpty()) { + command.append(LTTngControlServiceConstants.OPTION_ALL); + } else { + + StringBuffer eventNameParameter = new StringBuffer(); + for (Iterator iterator = eventNames.iterator(); iterator.hasNext();) { + String event = iterator.next(); + eventNameParameter.append(event); + if (iterator.hasNext()) { + eventNameParameter.append(','); + } + } + command.append(formatParameter(eventNameParameter.toString())); + } + + if (isKernel) { + command.append(LTTngControlServiceConstants.OPTION_KERNEL); + } else { + command.append(LTTngControlServiceConstants.OPTION_UST); + } + + String newSessionName = formatParameter(sessionName); + + command.append(LTTngControlServiceConstants.OPTION_SESSION); + command.append(newSessionName); + + if (channelName != null) { + command.append(LTTngControlServiceConstants.OPTION_CHANNEL); + command.append(channelName); + } + + command.append(LTTngControlServiceConstants.OPTION_TRACEPOINT); + + if (filterExpression != null) { + command.append(LTTngControlServiceConstants.OPTION_FILTER); + command.append('\''); + command.append(filterExpression); + command.append('\''); + } + + executeCommand(command.toString(), monitor); + + } + + @Override + public void enableSyscalls(String sessionName, String channelName, IProgressMonitor monitor) throws ExecutionException { + + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT); + + command.append(LTTngControlServiceConstants.OPTION_ALL); + command.append(LTTngControlServiceConstants.OPTION_KERNEL); + + String newSessionName = formatParameter(sessionName); + + command.append(LTTngControlServiceConstants.OPTION_SESSION); + command.append(newSessionName); + + if (channelName != null) { + command.append(LTTngControlServiceConstants.OPTION_CHANNEL); + command.append(channelName); + } + + command.append(LTTngControlServiceConstants.OPTION_SYSCALL); + + executeCommand(command.toString(), monitor); + } + + @Override + public void enableProbe(String sessionName, String channelName, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT); + + command.append(eventName); + command.append(LTTngControlServiceConstants.OPTION_KERNEL); + + String newSessionName = formatParameter(sessionName); + command.append(LTTngControlServiceConstants.OPTION_SESSION); + command.append(newSessionName); + + if (channelName != null) { + command.append(LTTngControlServiceConstants.OPTION_CHANNEL); + command.append(channelName); + } + if (isFunction) { + command.append(LTTngControlServiceConstants.OPTION_FUNCTION_PROBE); + } else { + command.append(LTTngControlServiceConstants.OPTION_PROBE); + } + + command.append(probe); + + executeCommand(command.toString(), monitor); + } + + @Override + public void enableLogLevel(String sessionName, String channelName, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExpression, IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT); + + command.append(eventName); + command.append(LTTngControlServiceConstants.OPTION_UST); + + String newSessionName = formatParameter(sessionName); + command.append(LTTngControlServiceConstants.OPTION_SESSION); + command.append(newSessionName); + + if (channelName != null) { + command.append(LTTngControlServiceConstants.OPTION_CHANNEL); + command.append(channelName); + } + + if (logLevelType == LogLevelType.LOGLEVEL) { + command.append(LTTngControlServiceConstants.OPTION_LOGLEVEL); + } else if (logLevelType == LogLevelType.LOGLEVEL_ONLY) { + command.append(LTTngControlServiceConstants.OPTION_LOGLEVEL_ONLY); + + } else { + return; + } + command.append(level.getInName()); + + executeCommand(command.toString(), monitor); + } + + @Override + public void disableEvent(String sessionName, String channelName, List eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_EVENT); + + if (eventNames == null) { + command.append(LTTngControlServiceConstants.OPTION_ALL); + } else { + // no events to disable + if (eventNames.isEmpty()) { + return; + } + + StringBuffer eventNameParameter = new StringBuffer(); + for (Iterator iterator = eventNames.iterator(); iterator.hasNext();) { + String event = iterator.next(); + eventNameParameter.append(event); + if (iterator.hasNext()) { + eventNameParameter.append(','); + } + } + command.append(formatParameter(eventNameParameter.toString())); + } + + if (isKernel) { + command.append(LTTngControlServiceConstants.OPTION_KERNEL); + } else { + command.append(LTTngControlServiceConstants.OPTION_UST); + } + + String newSessionName = formatParameter(sessionName); + command.append(LTTngControlServiceConstants.OPTION_SESSION); + command.append(newSessionName); + + if (channelName != null) { + command.append(LTTngControlServiceConstants.OPTION_CHANNEL); + command.append(channelName); + } + + executeCommand(command.toString(), monitor); + } + + @Override + public List getContextList(IProgressMonitor monitor) throws ExecutionException { + + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT, LTTngControlServiceConstants.OPTION_HELP); + + ICommandResult result = executeCommand(command.toString(), monitor); + + String[] output = result.getOutput(); + + List contexts = new ArrayList<>(0); + + int index = 0; + boolean inList = false; + while (index < output.length) { + String line = result.getOutput()[index]; + + Matcher startMatcher = LTTngControlServiceConstants.ADD_CONTEXT_HELP_CONTEXTS_INTRO.matcher(line); + Matcher endMatcher = LTTngControlServiceConstants.ADD_CONTEXT_HELP_CONTEXTS_END_LINE.matcher(line); + + if (startMatcher.matches()) { + inList = true; + } else if (endMatcher.matches()) { + break; + } else if (inList == true) { + String[] tmp = line.split(","); //$NON-NLS-1$ + for (int i = 0; i < tmp.length; i++) { + contexts.add(tmp[i].trim()); + } + } + index++; + } + return contexts; + } + + @Override + public void addContexts(String sessionName, String channelName, String eventName, boolean isKernel, List contextNames, IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT); + + String newSessionName = formatParameter(sessionName); + command.append(LTTngControlServiceConstants.OPTION_SESSION); + command.append(newSessionName); + + if (channelName != null) { + command.append(LTTngControlServiceConstants.OPTION_CHANNEL); + command.append(channelName); + } + + if (eventName != null) { + command.append(LTTngControlServiceConstants.OPTION_EVENT); + command.append(eventName); + } + + if (isKernel) { + command.append(LTTngControlServiceConstants.OPTION_KERNEL); + } else { + command.append(LTTngControlServiceConstants.OPTION_UST); + } + + for (Iterator iterator = contextNames.iterator(); iterator.hasNext();) { + String context = iterator.next(); + command.append(LTTngControlServiceConstants.OPTION_CONTEXT_TYPE); + command.append(context); + } + + executeCommand(command.toString(), monitor); + + } + + @Override + public void calibrate(boolean isKernel, IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CALIBRATE); + + if (isKernel) { + command.append(LTTngControlServiceConstants.OPTION_KERNEL); + } else { + command.append(LTTngControlServiceConstants.OPTION_UST); + } + + command.append(LTTngControlServiceConstants.OPTION_FUNCTION_PROBE); + + executeCommand(command.toString(), monitor); + } + + @Override + public void recordSnapshot(String sessionName, IProgressMonitor monitor) + throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_RECORD_SNAPSHOT); + + String newSessionName = formatParameter(sessionName); + command.append(LTTngControlServiceConstants.OPTION_SESSION); + command.append(newSessionName); + + executeCommand(command.toString(), monitor); + } + + @Override + public void runCommands(IProgressMonitor monitor, List commands) throws ExecutionException { + for (String command : commands) { + if (monitor.isCanceled()) { + return; + } + + if (command.isEmpty() || command.startsWith("#")) { //$NON-NLS-1$ + continue; + } + executeCommand(command, monitor); + } + } + + // ------------------------------------------------------------------------ + // Helper methods + // ------------------------------------------------------------------------ + + /** + * Checks if command result is an error result. + * + * @param result + * - the command result to check + * @return true if error else false + */ + protected boolean isError(ICommandResult result) { + // Check return code and length of returned strings + + if ((result.getResult()) != 0) { + return true; + } + + // Look for error pattern + int index = 0; + while (index < result.getErrorOutput().length) { + String line = result.getErrorOutput()[index]; + Matcher matcher = LTTngControlServiceConstants.ERROR_PATTERN.matcher(line); + if (matcher.matches()) { + return true; + } + index++; + } + + return false; + } + + /** + * Formats the output string as single string. + * + * @param result + * - output array + * @return - the formatted output + */ + public static String formatOutput(ICommandResult result) { + if ((result == null) || ((result.getOutput() == null || result.getOutput().length == 0) && (result.getErrorOutput() == null || result.getErrorOutput().length == 0))) { + return ""; //$NON-NLS-1$ + } + String[] output = result.getOutput(); + String[] errorOutput = result.getErrorOutput(); + StringBuffer ret = new StringBuffer(); + ret.append("Error Ouptut:\n"); //$NON-NLS-1$ + for (int i = 0; i < errorOutput.length; i++) { + ret.append(errorOutput[i]).append("\n"); //$NON-NLS-1$ + } + ret.append("Return Value: "); //$NON-NLS-1$ + ret.append(result.getResult()); + ret.append("\n"); //$NON-NLS-1$ + for (int i = 0; i < output.length; i++) { + ret.append(output[i]).append("\n"); //$NON-NLS-1$ + } + return ret.toString(); + } + + /** + * Parses the domain information. + * + * @param output + * - a command output array + * @param currentIndex + * - current index in command output array + * @param channels + * - list for returning channel information + * @param domainInfo + * - The domain information + * @return the new current index in command output array + */ + protected int parseDomain(String[] output, int currentIndex, List channels, IDomainInfo domainInfo) { + int index = currentIndex; + + // if kernel set the buffer type to shared + if (domainInfo.isKernel()) { + domainInfo.setBufferType(BufferType.BUFFER_SHARED); + } + + // Channels: + // ------------- + // - channnel1: [enabled] + // + // Attributes: + // overwrite mode: 0 + // subbufers size: 262144 + // number of subbufers: 4 + // switch timer interval: 0 + // read timer interval: 200 + // output: splice() + + while (index < output.length) { + String line = output[index]; + + if (isVersionSupported("2.2.0")) { //$NON-NLS-1$ + Matcher bufferTypeMatcher = LTTngControlServiceConstants.BUFFER_TYPE_PATTERN.matcher(line); + if (bufferTypeMatcher.matches()) { + String bufferTypeString = getAttributeValue(line); + if (BufferType.BUFFER_PER_PID.getInName().equals(bufferTypeString)) { + domainInfo.setBufferType(BufferType.BUFFER_PER_PID); + } else if (BufferType.BUFFER_PER_UID.getInName().equals(bufferTypeString)) { + domainInfo.setBufferType(BufferType.BUFFER_PER_UID); + } else { + domainInfo.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN); + } + } + } else { + domainInfo.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN); + } + Matcher outerMatcher = LTTngControlServiceConstants.CHANNELS_SECTION_PATTERN.matcher(line); + Matcher noKernelChannelMatcher = LTTngControlServiceConstants.DOMAIN_NO_KERNEL_CHANNEL_PATTERN.matcher(line); + Matcher noUstChannelMatcher = LTTngControlServiceConstants.DOMAIN_NO_UST_CHANNEL_PATTERN.matcher(line); + if (outerMatcher.matches()) { + IChannelInfo channelInfo = null; + while (index < output.length) { + String subLine = output[index]; + + Matcher innerMatcher = LTTngControlServiceConstants.CHANNEL_PATTERN.matcher(subLine); + if (innerMatcher.matches()) { + channelInfo = new ChannelInfo(""); //$NON-NLS-1$ + // get channel name + channelInfo.setName(innerMatcher.group(1)); + + // get channel enablement + channelInfo.setState(innerMatcher.group(2)); + + // set BufferType + channelInfo.setBufferType(domainInfo.getBufferType()); + + // add channel + channels.add(channelInfo); + + } else if (LTTngControlServiceConstants.OVERWRITE_MODE_ATTRIBUTE.matcher(subLine).matches()) { + String value = getAttributeValue(subLine); + if (channelInfo != null) { + channelInfo.setOverwriteMode(!LTTngControlServiceConstants.OVERWRITE_MODE_ATTRIBUTE_FALSE.equals(value)); + } + } else if (LTTngControlServiceConstants.SUBBUFFER_SIZE_ATTRIBUTE.matcher(subLine).matches()) { + if (channelInfo != null) { + channelInfo.setSubBufferSize(Long.valueOf(getAttributeValue(subLine))); + } + + } else if (LTTngControlServiceConstants.NUM_SUBBUFFERS_ATTRIBUTE.matcher(subLine).matches()) { + if (channelInfo != null) { + channelInfo.setNumberOfSubBuffers(Integer.valueOf(getAttributeValue(subLine))); + } + + } else if (LTTngControlServiceConstants.SWITCH_TIMER_ATTRIBUTE.matcher(subLine).matches()) { + if (channelInfo != null) { + channelInfo.setSwitchTimer(Long.valueOf(getAttributeValue(subLine))); + } + + } else if (LTTngControlServiceConstants.READ_TIMER_ATTRIBUTE.matcher(subLine).matches()) { + if (channelInfo != null) { + channelInfo.setReadTimer(Long.valueOf(getAttributeValue(subLine))); + } + + } else if (LTTngControlServiceConstants.OUTPUT_ATTRIBUTE.matcher(subLine).matches()) { + if (channelInfo != null) { + channelInfo.setOutputType(getAttributeValue(subLine)); + } + + } else if (LTTngControlServiceConstants.EVENT_SECTION_PATTERN.matcher(subLine).matches()) { + List events = new ArrayList<>(); + index = parseEvents(output, index, events); + if (channelInfo != null) { + channelInfo.setEvents(events); + } + // we want to stay at the current index to be able to + // exit the domain + continue; + } else if (LTTngControlServiceConstants.DOMAIN_KERNEL_PATTERN.matcher(subLine).matches()) { + return index; + + } else if (LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(subLine).matches()) { + return index; + } + index++; + } + } else if (noKernelChannelMatcher.matches() || noUstChannelMatcher.matches()) { + // domain indicates that no channels were found -> return + index++; + return index; + } + index++; + } + return index; + } + + /** + * Parses the event information within a domain. + * + * @param output + * - a command output array + * @param currentIndex + * - current index in command output array + * @param events + * - list for returning event information + * @return the new current index in command output array + */ + protected int parseEvents(String[] output, int currentIndex, List events) { + int index = currentIndex; + + while (index < output.length) { + String line = output[index]; + if (LTTngControlServiceConstants.CHANNEL_PATTERN.matcher(line).matches()) { + // end of channel + return index; + } else if (LTTngControlServiceConstants.DOMAIN_KERNEL_PATTERN.matcher(line).matches()) { + // end of domain + return index; + } else if (LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(line).matches()) { + // end of domain + return index; + } + + Matcher matcher = LTTngControlServiceConstants.EVENT_PATTERN.matcher(line); + Matcher matcher2 = LTTngControlServiceConstants.WILDCARD_EVENT_PATTERN.matcher(line); + + if (matcher.matches()) { + IEventInfo eventInfo = new EventInfo(matcher.group(1).trim()); + eventInfo.setLogLevelType(matcher.group(2).trim()); + eventInfo.setLogLevel(matcher.group(3).trim()); + eventInfo.setEventType(matcher.group(4).trim()); + eventInfo.setState(matcher.group(5)); + String filter = matcher.group(6); + if (filter != null) { + // remove '[' and ']' + filter = filter.substring(1, filter.length() - 1); + eventInfo.setFilterExpression(filter); + } + events.add(eventInfo); + index++; + } else if (matcher2.matches()) { + IEventInfo eventInfo = new EventInfo(matcher2.group(1).trim()); + eventInfo.setLogLevel(TraceLogLevel.LEVEL_UNKNOWN); + eventInfo.setEventType(matcher2.group(2).trim()); + eventInfo.setState(matcher2.group(3)); + String filter = matcher2.group(4); + if (filter != null) { + // remove '[' and ']' + filter = filter.substring(1, filter.length() - 1); + eventInfo.setFilterExpression(filter); + } + + if ((eventInfo.getEventType() == TraceEventType.PROBE) || + (eventInfo.getEventType() == TraceEventType.FUNCTION)) { + IProbeEventInfo probeEvent = new ProbeEventInfo(eventInfo.getName()); + probeEvent.setLogLevel(eventInfo.getLogLevel()); + probeEvent.setEventType(eventInfo.getEventType()); + probeEvent.setState(eventInfo.getState()); + + // Overwrite eventinfo + eventInfo = probeEvent; + + // myevent2 (type: probe) [enabled] + // addr: 0xc0101340 + // myevent0 (type: function) [enabled] + // offset: 0x0 + // symbol: init_post + index++; + while (index < output.length) { + String probeLine = output[index]; + // parse probe + Matcher addrMatcher = LTTngControlServiceConstants.PROBE_ADDRESS_PATTERN.matcher(probeLine); + Matcher offsetMatcher = LTTngControlServiceConstants.PROBE_OFFSET_PATTERN.matcher(probeLine); + Matcher symbolMatcher = LTTngControlServiceConstants.PROBE_SYMBOL_PATTERN.matcher(probeLine); + if (addrMatcher.matches()) { + String addr = addrMatcher.group(2).trim(); + probeEvent.setAddress(addr); + } else if (offsetMatcher.matches()) { + String offset = offsetMatcher.group(2).trim(); + probeEvent.setOffset(offset); + } else if (symbolMatcher.matches()) { + String symbol = symbolMatcher.group(2).trim(); + probeEvent.setSymbol(symbol); + } else if ((LTTngControlServiceConstants.EVENT_PATTERN.matcher(probeLine).matches()) || (LTTngControlServiceConstants.WILDCARD_EVENT_PATTERN.matcher(probeLine).matches())) { + break; + } else if (LTTngControlServiceConstants.CHANNEL_PATTERN.matcher(probeLine).matches()) { + break; + } else if (LTTngControlServiceConstants.DOMAIN_KERNEL_PATTERN.matcher(probeLine).matches()) { + // end of domain + break; + } else if (LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(probeLine).matches()) { + // end of domain + break; + } + index++; + } + events.add(eventInfo); + } else { + events.add(eventInfo); + index++; + continue; + } + } else { + index++; + } + } + + return index; + } + + /** + * Parses a line with attributes: : + * + * @param line + * - attribute line to parse + * @return the attribute value as string + */ + protected String getAttributeValue(String line) { + String[] temp = line.split("\\: "); //$NON-NLS-1$ + return temp[1]; + } + + /** + * Parses the event information within a provider. + * + * @param output + * - a command output array + * @param currentIndex + * - current index in command output array + * @param events + * - list for returning event information + * @return the new current index in command output array + */ + protected int getProviderEventInfo(String[] output, int currentIndex, List events) { + int index = currentIndex; + IBaseEventInfo eventInfo = null; + while (index < output.length) { + String line = output[index]; + Matcher matcher = LTTngControlServiceConstants.PROVIDER_EVENT_PATTERN.matcher(line); + if (matcher.matches()) { + // sched_kthread_stop (loglevel: TRACE_EMERG0) (type: + // tracepoint) + eventInfo = new BaseEventInfo(matcher.group(1).trim()); + eventInfo.setLogLevel(matcher.group(2).trim()); + eventInfo.setEventType(matcher.group(3).trim()); + events.add(eventInfo); + index++; + } else if (LTTngControlServiceConstants.EVENT_FIELD_PATTERN.matcher(line).matches()) { + if (eventInfo != null) { + List fields = new ArrayList<>(); + index = getFieldInfo(output, index, fields); + eventInfo.setFields(fields); + } else { + index++; + } + } + else if (LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line).matches()) { + return index; + } else { + index++; + } + } + return index; + } + + /** + * Parse a field's information. + * + * @param output + * A command output array + * @param currentIndex + * The current index in the command output array + * @param fields + * List for returning the field information + * @return The new current index in the command output array + */ + protected int getFieldInfo(String[] output, int currentIndex, List fields) { + int index = currentIndex; + IFieldInfo fieldInfo = null; + while (index < output.length) { + String line = output[index]; + Matcher matcher = LTTngControlServiceConstants.EVENT_FIELD_PATTERN.matcher(line); + if (matcher.matches()) { + // field: content (string) + fieldInfo = new FieldInfo(matcher.group(2).trim()); + fieldInfo.setFieldType(matcher.group(3).trim()); + fields.add(fieldInfo); + } else if (LTTngControlServiceConstants.PROVIDER_EVENT_PATTERN.matcher(line).matches()) { + return index; + } else if (LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line).matches()) { + return index; + } + index++; + } + return index; + } + + /** + * Formats a command parameter for the command execution i.e. adds quotes at + * the beginning and end if necessary. + * + * @param parameter + * - parameter to format + * @return formated parameter + */ + protected String formatParameter(String parameter) { + if (parameter != null) { + StringBuffer newString = new StringBuffer(); + newString.append(parameter); + + if (parameter.contains(" ") || parameter.contains("*")) { //$NON-NLS-1$ //$NON-NLS-2$ + newString.insert(0, "\""); //$NON-NLS-1$ + newString.append("\""); //$NON-NLS-1$ + } + return newString.toString(); + } + return null; + } + + /** + * @param strings + * array of string that makes up a command line + * @return string buffer with created command line + */ + protected StringBuffer createCommand(String... strings) { + StringBuffer command = new StringBuffer(); + command.append(LTTngControlServiceConstants.CONTROL_COMMAND); + command.append(getTracingGroupOption()); + command.append(getVerboseOption()); + for (String string : strings) { + command.append(string); + } + return command; + } + + /** + * @return the tracing group option if configured in the preferences + */ + protected String getTracingGroupOption() { + if (!ControlPreferences.getInstance().isDefaultTracingGroup() && !ControlPreferences.getInstance().getTracingGroup().equals("")) { //$NON-NLS-1$ + return LTTngControlServiceConstants.OPTION_TRACING_GROUP + ControlPreferences.getInstance().getTracingGroup(); + } + return ""; //$NON-NLS-1$ + } + + /** + * @return the verbose option as configured in the preferences + */ + protected String getVerboseOption() { + if (ControlPreferences.getInstance().isLoggingEnabled()) { + String level = ControlPreferences.getInstance().getVerboseLevel(); + if (ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE.equals(level)) { + return LTTngControlServiceConstants.OPTION_VERBOSE; + } + if (ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE.equals(level)) { + return LTTngControlServiceConstants.OPTION_VERY_VERBOSE; + } + if (ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE.equals(level)) { + return LTTngControlServiceConstants.OPTION_VERY_VERY_VERBOSE; + } + } + return ""; //$NON-NLS-1$ + } + + /** + * Method that logs the command and command result if logging is enabled as + * well as forwards the command execution to the shell. + * + * @param command + * - the command to execute + * @param monitor + * - a progress monitor + * @return the command result + * @throws ExecutionException + * If the command fails + */ + protected ICommandResult executeCommand(String command, + IProgressMonitor monitor) throws ExecutionException { + return executeCommand(command, monitor, true); + } + + /** + * Method that logs the command and command result if logging is enabled as + * well as forwards the command execution to the shell. + * + * @param command + * - the command to execute + * @param monitor + * - a progress monitor + * @param checkForError + * - true to verify command result, else false + * @return the command result + * @throws ExecutionException + * in case of error result + */ + protected ICommandResult executeCommand(String command, + IProgressMonitor monitor, boolean checkForError) + throws ExecutionException { + if (ControlPreferences.getInstance().isLoggingEnabled()) { + ControlCommandLogger.log(command); + } + + ICommandResult result = fCommandShell.executeCommand( + command.toString(), monitor); + + if (ControlPreferences.getInstance().isLoggingEnabled()) { + ControlCommandLogger.log(formatOutput(result)); + } + + if (checkForError && isError(result)) { + throw new ExecutionException(Messages.TraceControl_CommandError + + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ + } + + return result; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java new file mode 100644 index 0000000000..bd5856e92d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java @@ -0,0 +1,456 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Bernd Hufmann - Updated for support of LTTng Tools 2.1 + * Simon Delisle - Updated for support of LTTng Tools 2.2 + * Marc-Andre Laperle - Support for creating a live session + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; + +import java.util.regex.Pattern; + +/** + *

+ * Constants for LTTng Control Service. + *

+ * + * @author Bernd Hufmann + */ +public interface LTTngControlServiceConstants { + + // ------------------------------------------------------------------------ + // Version constants + // ------------------------------------------------------------------------ + /** + * Pattern to match the LTTng toolchain version 2.x.y. + */ + static final Pattern VERSION_2_PATTERN = Pattern.compile("(2\\.\\d+\\.\\d+).*"); //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + /** + * Unused value + */ + static final int UNUSED_VALUE = -1; + /** + * String representation of numerical true element + */ + static final String TRUE_NUMERICAL = "1"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // LTTng Machine Interface constants + // ------------------------------------------------------------------------ + + /** + * Name of the XSD to validate against the xml machine interface + * output from LTTng + */ + static final String MI_XSD_FILENAME = "mi_lttng.xsd"; //$NON-NLS-1$ + // ------------------------------------------------------------------------ + // Command constants + // ------------------------------------------------------------------------ + /** + * The lttng tools command. + */ + static final String CONTROL_COMMAND = "lttng"; //$NON-NLS-1$ + /** + * The lttng tools machine interface command. + */ + static final String CONTROL_COMMAND_MI = CONTROL_COMMAND + " --mi"; //$NON-NLS-1$ + /** + * The lttng tools XML machine interface command. + */ + static final String CONTROL_COMMAND_MI_XML = CONTROL_COMMAND_MI + " xml"; //$NON-NLS-1$ + /** + * Command: lttng version. + */ + static final String COMMAND_VERSION = " version "; //$NON-NLS-1$ + /** + * Command: lttng list. + */ + static final String COMMAND_LIST = " list "; //$NON-NLS-1$ + /** + * Command to list kernel tracer information. + */ + static final String COMMAND_LIST_KERNEL = COMMAND_LIST + "-k"; //$NON-NLS-1$ + /** + * Command to list user space trace information. + */ + static final String COMMAND_LIST_UST = COMMAND_LIST + "-u"; //$NON-NLS-1$ + /** + * Command to create a session. + */ + static final String COMMAND_CREATE_SESSION = " create "; //$NON-NLS-1$ + /** + * Command to destroy a session. + */ + static final String COMMAND_DESTROY_SESSION = " destroy "; //$NON-NLS-1$ + /** + * Command to destroy a session. + */ + static final String COMMAND_START_SESSION = " start "; //$NON-NLS-1$ + /** + * Command to destroy a session. + */ + static final String COMMAND_STOP_SESSION = " stop "; //$NON-NLS-1$ + /** + * Command to enable a channel. + */ + static final String COMMAND_ENABLE_CHANNEL = " enable-channel "; //$NON-NLS-1$ + /** + * Command to disable a channel. + */ + static final String COMMAND_DISABLE_CHANNEL = " disable-channel "; //$NON-NLS-1$ + /** + * Command to enable a event. + */ + static final String COMMAND_ENABLE_EVENT = " enable-event "; //$NON-NLS-1$ + /** + * Command to disable a event. + */ + static final String COMMAND_DISABLE_EVENT = " disable-event "; //$NON-NLS-1$ + /** + * Command to add a context to channels and/or events + */ + static final String COMMAND_ADD_CONTEXT = " add-context "; //$NON-NLS-1$ + /** + * Command to execute calibrate command to quantify LTTng overhead + */ + static final String COMMAND_CALIBRATE = " calibrate "; //$NON-NLS-1$ + /** + * Command to execute calibrate command to quantify LTTng overhead + */ + static final String COMMAND_LIST_SNAPSHOT_OUTPUT = " snapshot list-output "; //$NON-NLS-1$ + /** + * Command to execute calibrate command to quantify LTTng overhead + */ + static final String COMMAND_RECORD_SNAPSHOT = " snapshot record "; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Command line options constants + // ------------------------------------------------------------------------ + /** + * Command line option to add tracing group of user. + */ + static final String OPTION_TRACING_GROUP = " -g "; //$NON-NLS-1$ + /** + * Command line option for verbose output. + */ + static final String OPTION_VERBOSE = " -v "; //$NON-NLS-1$ + /** + * Command line option for verbose output. + */ + static final String OPTION_VERY_VERBOSE = " -vv "; //$NON-NLS-1$ + /** + * Command line option for verbose output. + */ + static final String OPTION_VERY_VERY_VERBOSE = " -vvv "; //$NON-NLS-1$ + /** + * Command line option for output path. + */ + static final String OPTION_OUTPUT_PATH = " -o "; //$NON-NLS-1$ + /** + * Command line option for output path. + */ + static final String OPTION_SNAPSHOT = " --snapshot "; //$NON-NLS-1$ + /** + * Command line option for live + */ + static final String OPTION_LIVE = " --live "; //$NON-NLS-1$ + /** + * Command line option for kernel tracer. + */ + static final String OPTION_KERNEL = " -k "; //$NON-NLS-1$ + /** + * Command line option for UST tracer. + */ + static final String OPTION_UST = " -u "; //$NON-NLS-1$ + /** + * Command line option for specifying a session. + */ + static final String OPTION_SESSION = " -s "; //$NON-NLS-1$ + /** + * Command line option for specifying a channel. + */ + static final String OPTION_CHANNEL = " -c "; //$NON-NLS-1$ + /** + * Command line option for specifying a event. + */ + static final String OPTION_EVENT = " -e "; //$NON-NLS-1$ + /** + * Command line option for specifying all events. + */ + static final String OPTION_ALL = " -a "; //$NON-NLS-1$ + /** + * Command line option for specifying a context. + */ + static final String OPTION_CONTEXT_TYPE = " -t "; //$NON-NLS-1$ + /** + * Command line option for specifying tracepoint events. + */ + static final String OPTION_TRACEPOINT = " --tracepoint "; //$NON-NLS-1$ + /** + * Command line option for specifying syscall events. + */ + static final String OPTION_SYSCALL = " --syscall "; //$NON-NLS-1$ + /** + * Command line option for specifying a dynamic probe. + */ + static final String OPTION_PROBE = " --probe "; //$NON-NLS-1$ + /** + * Command line option for specifying a dynamic function entry/return probe. + */ + static final String OPTION_FUNCTION_PROBE = " --function "; //$NON-NLS-1$ + /** + * Command line option for specifying a log level range. + */ + static final String OPTION_LOGLEVEL = " --loglevel "; //$NON-NLS-1$ + /** + * Command line option for specifying a specific log level. + */ + static final String OPTION_LOGLEVEL_ONLY = " --loglevel-only "; //$NON-NLS-1$ + /** + * Optional command line option for configuring a channel's overwrite mode. + */ + static final String OPTION_OVERWRITE = " --overwrite "; //$NON-NLS-1$ + /** + * Optional command line option for configuring a channel's number of sub buffers. + */ + static final String OPTION_NUM_SUB_BUFFERS = " --num-subbuf "; //$NON-NLS-1$ + /** + * Optional command line option for configuring a channel's sub buffer size. + */ + static final String OPTION_SUB_BUFFER_SIZE = " --subbuf-size "; //$NON-NLS-1$ + /** + * Optional command line option for configuring a channel's switch timer interval. + */ + static final String OPTION_SWITCH_TIMER = " --switch-timer "; //$NON-NLS-1$ + /** + * Optional command line option for configuring a channel's read timer interval. + */ + static final String OPTION_READ_TIMER = " --read-timer "; //$NON-NLS-1$ + /** + * Command line option for printing the help of a specif command + */ + static final String OPTION_HELP = " -h "; //$NON-NLS-1$ + /** + * Command line option for listing the fields of UST tracepoints + */ + static final String OPTION_FIELDS = " -f "; //$NON-NLS-1$ + /** + * Command line option for configuring event's filter + */ + static final String OPTION_FILTER = " --filter "; //$NON-NLS-1$ + /** + * Command line option for configuring the streaming network URL (common for control and data channel). + */ + static final String OPTION_NETWORK_URL = " -U "; //$NON-NLS-1$ + /** + * Command line option for configuring the streaming control URL. + */ + static final String OPTION_CONTROL_URL = " -C "; //$NON-NLS-1$ + /** + * Command line option for configuring the streaming data URL. + */ + static final String OPTION_DATA_URL = " -D "; //$NON-NLS-1$ + /** + * Command line option for per UID buffers + */ + static final String OPTION_PER_UID_BUFFERS = " --buffers-uid "; //$NON-NLS-1$ + /** + * Command line option for per PID buffers + */ + static final String OPTION_PER_PID_BUFFERS = " --buffers-pid "; //$NON-NLS-1$ + /** + * Command line option for maximum size of trace files + */ + static final String OPTION_MAX_SIZE_TRACE_FILES = " -C "; //$NON-NLS-1$ + /** + * Command line option for maximum trace files + */ + static final String OPTION_MAX_TRACE_FILES = " -W "; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Parsing constants + // ------------------------------------------------------------------------ + /** + * Pattern to match the version. + */ + static final Pattern VERSION_PATTERN = Pattern.compile(".*lttng\\s+version\\s+(\\d+\\.\\d+\\.\\d+).*"); //$NON-NLS-1$ + /** + * Pattern to match for error output + */ + static final Pattern ERROR_PATTERN = Pattern.compile("\\s*Error\\:.*"); //$NON-NLS-1$ + /** + * Pattern to match for session information (lttng list) + */ + static final Pattern SESSION_PATTERN = Pattern.compile("\\s+(\\d+)\\)\\s+(.*)\\s+\\((.*)\\)\\s+\\[(active|inactive).*\\].*"); //$NON-NLS-1$ + /** + * Pattern to match for session information (lttng list ) + */ + static final Pattern TRACE_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\].*"); //$NON-NLS-1$ + /** + * Pattern to match for snapshot session information (lttng list ) + */ + static final Pattern TRACE_SNAPSHOT_SESSION_PATTERN = Pattern.compile("\\s*Tracing\\s+session\\s+(.*)\\:\\s+\\[(active|inactive)\\s*snapshot\\].*"); //$NON-NLS-1$ + /** + * Pattern to match for session path information (lttng list ) + */ + static final Pattern TRACE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(.*)"); //$NON-NLS-1$ + /** + * Pattern to match session path for network tracing (lttng list ) + * Note: file for protocol is not considered as network trace since local consumer will be used. + */ + static final Pattern TRACE_NETWORK_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$ + /** + * Pattern to match session path for network tracing + * Note: file for protocol is not considered as network trace since local consumer will be used. + */ + static final Pattern TRACE_NETWORK_PATTERN = Pattern.compile("\\s*(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$ + /** + * Sub-pattern to pattern TRACE_NETWORK_PATH_PATTERN to match file protocol + */ + static final Pattern TRACE_FILE_PROTOCOL_PATTERN = Pattern.compile("(file)\\:\\/\\/(.*)"); //$NON-NLS-1$ + /** + * Pattern to match for kernel domain information (lttng list ) + */ + static final Pattern DOMAIN_KERNEL_PATTERN = Pattern.compile("=== Domain: Kernel ==="); //$NON-NLS-1$ + /** + * Pattern to match for ust domain information (lttng list ) + */ + static final Pattern DOMAIN_UST_GLOBAL_PATTERN = Pattern.compile("=== Domain: UST global ==="); //$NON-NLS-1$ + /** + * Pattern to match for matching warning about no kernel channel + */ + static final Pattern DOMAIN_NO_KERNEL_CHANNEL_PATTERN = Pattern.compile("\\s*Warning\\:\\s+No kernel\\s+channel.*"); //$NON-NLS-1$ + /** + * Pattern to match for matching warning about no UST channel + */ + static final Pattern DOMAIN_NO_UST_CHANNEL_PATTERN = Pattern.compile("\\s*Error\\:\\s+UST\\s+channel\\s+not\\s+found.*"); //$NON-NLS-1$ + /** + * Pattern to match for buffer type (lttng list ) + */ + static final Pattern BUFFER_TYPE_PATTERN = Pattern.compile("\\s*Buffer\\s+type\\:.*"); //$NON-NLS-1$ + /** + * Pattern to match for channels section (lttng list ) + */ + static final Pattern CHANNELS_SECTION_PATTERN = Pattern.compile("\\s*Channels\\:"); //$NON-NLS-1$ + /** + * Pattern to match for channel information (lttng list ) + */ + static final Pattern CHANNEL_PATTERN = Pattern.compile("\\s*-\\s+(.*)\\:\\s+\\[(enabled|disabled)\\]"); //$NON-NLS-1$ + /** + * Pattern to match for events section information (lttng list ) + */ + static final Pattern EVENT_SECTION_PATTERN = Pattern.compile("\\s*Events\\:"); //$NON-NLS-1$ + /** + * Pattern to match for event information (lttng list ) + */ + static final Pattern EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(loglevel\\s*(:|<=|==)\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$ + /** + * Pattern to match a wildcarded event information (lttng list ) + */ + static final Pattern WILDCARD_EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$ + /** + * Pattern to match a probe address information (lttng list ) + */ + static final Pattern PROBE_ADDRESS_PATTERN = Pattern.compile("\\s+(addr)\\:\\s+(0x[0-9a-fA-F]{1,16})"); //$NON-NLS-1$ + /** + * Pattern to match a probe OFFSET information (lttng list ) + */ + static final Pattern PROBE_OFFSET_PATTERN = Pattern.compile("\\s+(offset)\\:\\s+(0x[0-9a-fA-F]{1,16})"); //$NON-NLS-1$ + /** + * Pattern to match a probe SYMBOL information (lttng list ) + */ + static final Pattern PROBE_SYMBOL_PATTERN = Pattern.compile("\\s+(symbol)\\:\\s+(.+)"); //$NON-NLS-1$ + /** + * Pattern to match for channel (overwite mode) information (lttng list ) + */ + static final Pattern OVERWRITE_MODE_ATTRIBUTE = Pattern.compile("\\s+overwrite\\s+mode\\:.*"); //$NON-NLS-1$ + /** + * Pattern to match indicating false for overwrite mode + */ + static final String OVERWRITE_MODE_ATTRIBUTE_FALSE = "0"; //$NON-NLS-1$ + /** + * Pattern to match indicating false for overwrite mode in machine interface mode + */ + static final String OVERWRITE_MODE_ATTRIBUTE_FALSE_MI = "DISCARD"; //$NON-NLS-1$ + /** + * Pattern to match for channel (sub-buffer size) information (lttng list ) + */ + static final Pattern SUBBUFFER_SIZE_ATTRIBUTE = Pattern.compile("\\s+subbufers\\s+size\\:.*"); //$NON-NLS-1$ + /** + * Pattern to match for channel (number of sub-buffers) information (lttng list ) + */ + static final Pattern NUM_SUBBUFFERS_ATTRIBUTE = Pattern.compile("\\s+number\\s+of\\s+subbufers\\:.*"); //$NON-NLS-1$ + /** + * Pattern to match for channel (switch timer) information (lttng list ) + */ + static final Pattern SWITCH_TIMER_ATTRIBUTE = Pattern.compile("\\s+switch\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$ + /** + * Pattern to match for channel (read timer) information (lttng list ) + */ + static final Pattern READ_TIMER_ATTRIBUTE = Pattern.compile("\\s+read\\s+timer\\s+interval\\:.*"); //$NON-NLS-1$ + /** + * Pattern to match for channel (output type) information (lttng list ) + */ + static final Pattern OUTPUT_ATTRIBUTE = Pattern.compile("\\s+output\\:.*"); //$NON-NLS-1$ + /** + * Pattern to match for provider information (lttng list -k/-u) + */ + static final Pattern PROVIDER_EVENT_PATTERN = Pattern.compile("\\s*(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)"); //$NON-NLS-1$ + /** + * Pattern to match event fields + */ + static final Pattern EVENT_FIELD_PATTERN = Pattern.compile("\\s*(field:)\\s+(.*)\\s+\\((.*)\\)"); //$NON-NLS-1$ + /** + * Pattern to match for UST provider information (lttng list -u) + */ + static final Pattern UST_PROVIDER_PATTERN = Pattern.compile("\\s*PID\\:\\s+(\\d+)\\s+-\\s+Name\\:\\s+(.*)"); //$NON-NLS-1$ + /** + * Pattern to match for session information (lttng create ) + */ + static final Pattern CREATE_SESSION_NAME_PATTERN = Pattern.compile(".*Session\\s+(.*)\\s+created\\."); //$NON-NLS-1$ + /** + * Pattern to match for session path information (lttng create ) + */ + static final Pattern CREATE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Traces\\s+will\\s+be\\s+written\\s+in\\s+(.*).*"); //$NON-NLS-1$ + /** + * Pattern to match for session command output for "session name not found". + */ + static final Pattern SESSION_NOT_FOUND_ERROR_PATTERN = Pattern.compile("\\s*Error:\\s+Session\\s+name\\s.*not\\s+found"); //$NON-NLS-1$ + /** + * Pattern to match introduction line of context list. + */ + static final Pattern ADD_CONTEXT_HELP_CONTEXTS_INTRO = Pattern.compile("\\s*TYPE can\\s+be\\s+one\\s+of\\s+the\\s+strings\\s+below.*"); //$NON-NLS-1$ + /** + * Pattern to match introduction line of context list. + */ + static final Pattern ADD_CONTEXT_HELP_CONTEXTS_END_LINE = Pattern.compile("\\s*Example.*"); //$NON-NLS-1$ + /** + * Pattern to match error line if no kernel tracer is available or installed. + */ + static final Pattern LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN = Pattern.compile("\\s*Error:\\s+Unable\\s+to\\s+list\\s+kernel\\s+events.*"); //$NON-NLS-1$; + /** + * Pattern to match error line if no ust tracer is available or installed. + */ + static final Pattern LIST_UST_NO_UST_PROVIDER_PATTERN = Pattern.compile(".*Unable\\s*to\\s*list\\s*UST\\s*event.*"); //$NON-NLS-1$; + /** + * Pattern to match for list snapshot information (lttng snapshot list-output) + */ + static final Pattern LIST_SNAPSHOT_OUTPUT_PATTERN = Pattern.compile("\\s+\\[(\\d+)\\]\\s+(\\S*)\\:\\s+(\\S*)(.*)"); //$NON-NLS-1$ + /** + * Pattern to match snapshot path for network tracing (lttng list ) + * Note: file for protocol is not considered as network trace since local consumer will be used. + */ + static final Pattern SNAPSHOT_NETWORK_PATH_PATTERN = Pattern.compile("(net|net4|net6|tcp|tcp4|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$ + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java new file mode 100644 index 0000000000..2ac956b86a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java @@ -0,0 +1,148 @@ +/********************************************************************** + * Copyright (c) 2012, 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: + * Bernd Hufmann - Initial API and implementation + * Jonathan Rajotte - machine interface support + **********************************************************************/ +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; + +import java.util.regex.Matcher; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.logging.ControlCommandLogger; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferences; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; + +/** + * Factory to create LTTngControlService instances depending on the version of + * the LTTng Trace Control installed on the remote host. + * + * @author Bernd Hufmann + */ +public class LTTngControlServiceFactory { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + /** + * The singleton instance. + */ + private static LTTngControlServiceFactory fInstance = null; + + // ------------------------------------------------------------------------ + // Constructor + // ------------------------------------------------------------------------ + /** + * Constructor + */ + private LTTngControlServiceFactory() { + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + /** + * @return the LTTngControlServiceFactory singleton instance. + */ + public static synchronized LTTngControlServiceFactory getInstance() { + if (fInstance == null) { + fInstance = new LTTngControlServiceFactory(); + } + return fInstance; + } + + // ------------------------------------------------------------------------ + // Factory method + // ------------------------------------------------------------------------ + /** + * Gets the LTTng Control Service implementation based on the version of the + * remote LTTng Tools. + * + * @param shell + * - the shell implementation to pass to the service + * @return - LTTng Control Service implementation + * @throws ExecutionException + * If the command fails + */ + public ILttngControlService getLttngControlService(ICommandShell shell) throws ExecutionException { + // get the version + boolean machineInterfaceMode = true; + String command = LTTngControlServiceConstants.CONTROL_COMMAND + LTTngControlServiceConstants.COMMAND_VERSION; + String commandMi = LTTngControlServiceConstants.CONTROL_COMMAND_MI_XML + LTTngControlServiceConstants.COMMAND_VERSION; + + // Logging + if (ControlPreferences.getInstance().isLoggingEnabled()) { + ControlCommandLogger.log(commandMi); + } + + ICommandResult result = null; + + // Looking for a machine interface on LTTng side + try { + result = shell.executeCommand(commandMi, new NullProgressMonitor()); + } catch (ExecutionException e) { + throw new ExecutionException(Messages.TraceControl_GettingVersionError, e); + } + + // Output logging + if (ControlPreferences.getInstance().isLoggingEnabled()) { + ControlCommandLogger.log(LTTngControlService.formatOutput(result)); + } + + if (result.getResult() != 0) { + machineInterfaceMode = false; + // Fall back if no machine interface is present + + // Logging + if (ControlPreferences.getInstance().isLoggingEnabled()) { + ControlCommandLogger.log(command); + } + + try { + result = shell.executeCommand(command, new NullProgressMonitor()); + } catch (ExecutionException e) { + throw new ExecutionException(Messages.TraceControl_GettingVersionError + ": " + e); //$NON-NLS-1$ + } + + // Output logging + if (ControlPreferences.getInstance().isLoggingEnabled()) { + ControlCommandLogger.log(LTTngControlService.formatOutput(result)); + } + } + + + if ((result != null) && (result.getResult() == 0) && (result.getOutput().length >= 1)) { + if (machineInterfaceMode) { + LTTngControlServiceMI service = new LTTngControlServiceMI(shell, LTTngControlService.class.getResource(LTTngControlServiceConstants.MI_XSD_FILENAME)); + service.setVersion(result.getOutput()); + return service; + } + int index = 0; + while (index < result.getOutput().length) { + String line = result.getOutput()[index]; + Matcher versionMatcher = LTTngControlServiceConstants.VERSION_PATTERN.matcher(line); + if (versionMatcher.matches()) { + String version = versionMatcher.group(1).trim(); + Matcher matcher = LTTngControlServiceConstants.VERSION_2_PATTERN.matcher(version); + if (matcher.matches()) { + LTTngControlService service = new LTTngControlService(shell); + service.setVersion(version); + return service; + } + throw new ExecutionException(Messages.TraceControl_UnsupportedVersionError + ": " + version); //$NON-NLS-1$ + } + index++; + } + } + throw new ExecutionException(Messages.TraceControl_GettingVersionError); + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java new file mode 100644 index 0000000000..8bb18a5613 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java @@ -0,0 +1,953 @@ +/********************************************************************** + * 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: + * Jonathan Rajotte - Initial support for machine interface lttng 2.6 + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; + +import java.io.IOException; +import java.io.StringReader; +import java.math.BigInteger; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceDomainType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BaseEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.DomainInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.EventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.FieldInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.ProbeEventInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SnapshotInfo; +import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.UstProviderInfo; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.XmlMiValidationErrorHandler; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.messages.Messages; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult; +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandShell; +import org.eclipse.osgi.util.NLS; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Service for sending LTTng trace control commands to remote host via machine + * interface mode. + * + * @author Jonathan Rajotte + */ +public class LTTngControlServiceMI extends LTTngControlService { + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + private final DocumentBuilder fDocumentBuilder; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * Constructor + * + * @param shell + * the command shell implementation to use + * @param xsdUrl + * the xsd schema file for validation + * @throws ExecutionException + * if the creation of the Schema and DocumentBuilder objects + * fails + */ + public LTTngControlServiceMI(ICommandShell shell, URL xsdUrl) throws ExecutionException { + super(shell); + + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); + docBuilderFactory.setValidating(false); + + // TODO: Add xsd validation for machine interface via mi_lttng.xsd from LTTng + try { + fDocumentBuilder = docBuilderFactory.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + throw new ExecutionException(Messages.TraceControl_XmlDocumentBuilderError, e); + } + + fDocumentBuilder.setErrorHandler(new XmlMiValidationErrorHandler()); + + } + + /** + * Generate a Document object from an array of String. + * + * @param xmlStrings + * array of strings representing an xml input + * @return Document generated from strings input + * @throws ExecutionException + * when parsing has failed + */ + private Document getDocumentFromStrings(String[] xmlStrings) throws ExecutionException { + StringBuilder concatenedString = new StringBuilder(); + for (String string : xmlStrings) { + concatenedString.append(string); + } + InputSource stream = new InputSource(new StringReader(concatenedString.toString())); + + Document document; + try { + document = fDocumentBuilder.parse(stream); + } catch (SAXException | IOException e) { + throw new ExecutionException(Messages.TraceControl_XmlParsingError, e); + } + return document; + + } + + /** + * Parse, populate and set the internal LTTngVersion variable + * + * @param xmlOutput + * the mi xml output of lttng version + * @throws ExecutionException + * when xml extraction fail + */ + public void setVersion(String[] xmlOutput) throws ExecutionException { + Document doc = getDocumentFromStrings(xmlOutput); + NodeList element = doc.getElementsByTagName(MIStrings.VERSION); + int major = 0; + int minor = 0; + int patchLevel = 0; + String license = ""; //$NON-NLS-1$ + String commit = ""; //$NON-NLS-1$ + String name = ""; //$NON-NLS-1$ + String description = ""; //$NON-NLS-1$ + String url = ""; //$NON-NLS-1$ + String fullVersion = ""; //$NON-NLS-1$ + if (element.getLength() == 1) { + NodeList child = element.item(0).getChildNodes(); + // Get basic information + for (int i = 0; i < child.getLength(); i++) { + Node node = child.item(i); + switch (node.getNodeName()) { + case MIStrings.VERSION_MAJOR: + major = Integer.parseInt(node.getTextContent()); + break; + case MIStrings.VERSION_MINOR: + minor = Integer.parseInt(node.getTextContent()); + break; + case MIStrings.VERSION_PATCH_LEVEL: + patchLevel = Integer.parseInt(node.getTextContent()); + break; + case MIStrings.VERSION_COMMIT: + commit = node.getTextContent(); + break; + case MIStrings.VERSION_DESCRIPTION: + description = node.getTextContent(); + break; + case MIStrings.VERSION_LICENSE: + license = node.getTextContent(); + break; + case MIStrings.VERSION_NAME: + name = node.getTextContent(); + break; + case MIStrings.VERSION_STR: + fullVersion = node.getTextContent(); + break; + case MIStrings.VERSION_WEB: + url = node.getTextContent(); + break; + default: + break; + } + } + setVersion(new LttngVersion(major, minor, patchLevel, license, commit, name, description, url, fullVersion)); + } else { + throw new ExecutionException(Messages.TraceControl_UnsupportedVersionError); + } + } + + @Override + public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST); + ICommandResult result = executeCommand(command.toString(), monitor); + + Document doc = getDocumentFromStrings(result.getOutput()); + + NodeList elements = doc.getElementsByTagName(MIStrings.NAME); + + ArrayList retArray = new ArrayList<>(); + for (int i = 0; i < elements.getLength(); i++) { + Node node = elements.item(i); + if (node.getParentNode().getNodeName().equalsIgnoreCase(MIStrings.SESSION)) { + retArray.add(node.getTextContent()); + } + } + return retArray.toArray(new String[retArray.size()]); + } + + @Override + public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, sessionName); + ICommandResult result = executeCommand(command.toString(), monitor); + + ISessionInfo sessionInfo = new SessionInfo(sessionName); + Document document = getDocumentFromStrings(result.getOutput()); + + NodeList sessionsNode = document.getElementsByTagName(MIStrings.SESSION); + // There should be only one session + if (sessionsNode.getLength() != 1) { + throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); + } + + // Populate session information + Node rawSession = sessionsNode.item(0); + parseSession(sessionInfo, rawSession); + + // Fetch the snapshot info + if (sessionInfo.isSnapshotSession()) { + ISnapshotInfo snapshot = getSnapshotInfo(sessionName, monitor); + sessionInfo.setSnapshotInfo(snapshot); + } + + return sessionInfo; + } + + /** + * @param sessionInfo + * @param rawSession + * @throws ExecutionException + */ + private void parseSession(ISessionInfo sessionInfo, Node rawSession) throws ExecutionException { + if (!rawSession.getNodeName().equalsIgnoreCase(MIStrings.SESSION)) { + throw new ExecutionException(Messages.TraceControl_MiInvalidElementError); + } + NodeList rawSessionInfos = rawSession.getChildNodes(); + for (int i = 0; i < rawSessionInfos.getLength(); i++) { + Node rawInfo = rawSessionInfos.item(i); + switch (rawInfo.getNodeName()) { + case MIStrings.NAME: + sessionInfo.setName(rawInfo.getTextContent()); + break; + case MIStrings.PATH: + sessionInfo.setSessionPath(rawInfo.getTextContent()); + break; + case MIStrings.ENABLED: + sessionInfo.setSessionState(rawInfo.getTextContent()); + break; + case MIStrings.SNAPSHOT_MODE: + if (rawInfo.getTextContent().equals(LTTngControlServiceConstants.TRUE_NUMERICAL)) { + // real name will be set later + ISnapshotInfo snapshotInfo = new SnapshotInfo(""); //$NON-NLS-1$ + sessionInfo.setSnapshotInfo(snapshotInfo); + } + break; + case MIStrings.LIVE_TIMER_INTERVAL: + // TODO : live mode not supported yet in TMF:lttng-control + break; + case MIStrings.DOMAINS: + // Extract the domains node + NodeList rawDomains = rawInfo.getChildNodes(); + IDomainInfo domain = null; + for (int j = 0; j < rawDomains.getLength(); j++) { + if (rawDomains.item(j).getNodeName().equalsIgnoreCase(MIStrings.DOMAIN)) { + domain = parseDomain(rawDomains.item(j)); + sessionInfo.addDomain(domain); + } + } + break; + default: + break; + } + } + + if (!sessionInfo.isSnapshotSession()) { + Matcher matcher = LTTngControlServiceConstants.TRACE_NETWORK_PATTERN.matcher(sessionInfo.getSessionPath()); + if (matcher.matches()) { + sessionInfo.setStreamedTrace(true); + } + } + } + + /** + * Parse a raw domain XML node to a IDomainInfo object + * + * @param rawDomain + * a domain xml node + * @return a populated {@link DomainInfo} object + * @throws ExecutionException + * when missing required xml element (type) + */ + protected IDomainInfo parseDomain(Node rawDomain) throws ExecutionException { + IDomainInfo domain = null; + // Get the type + Node rawType = getFirstOf(rawDomain.getChildNodes(), MIStrings.TYPE); + if (rawType == null) { + throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); + } + String rawTypeString = rawType.getTextContent().toLowerCase(); + TraceDomainType domainType = TraceDomainType.valueOfString(rawTypeString); + switch (domainType) { + case KERNEL: + domain = new DomainInfo(Messages.TraceControl_KernelProviderDisplayName); + domain.setIsKernel(true); + break; + case UST: + domain = new DomainInfo(Messages.TraceControl_UstGlobalDomainDisplayName); + domain.setIsKernel(false); + break; + case JUL: + /** + * TODO: Support for JUL JUL substructure and semantic is not the + * same as a regular UST or Kernel Domain There is no channel under + * JUL domain only events. The channel is activated in UST Channel + */ + domain = new DomainInfo(Messages.TraceControl_JULDomainDisplayName); + domain.setIsKernel(false); + break; + case UNKNOWN: + domain = new DomainInfo(Messages.TraceControl_UnknownDomainDisplayName); + domain.setIsKernel(false); + break; + default: + throw new ExecutionException(Messages.TraceControl_MiInvalidElementError); + } + + NodeList rawInfos = rawDomain.getChildNodes(); + for (int i = 0; i < rawInfos.getLength(); i++) { + Node rawInfo = rawInfos.item(i); + switch (rawInfo.getNodeName()) { + case MIStrings.BUFFER_TYPE: + BufferType bufferType = BufferType.valueOfString(rawInfo.getTextContent()); + domain.setBufferType(bufferType); + break; + case MIStrings.CHANNELS: + ArrayList channels = new ArrayList<>(); + parseChannels(rawInfo.getChildNodes(), channels); + if (channels.size() > 0) { + domain.setChannels(channels); + } + break; + default: + break; + } + } + + return domain; + } + + /** + * Parse a list of raw channel XML node into an ArrayList of IChannelInfo + * + * @param rawChannes + * List of raw channel XML node + * @param channels + * the parsed channels list + * @throws ExecutionException + * when missing required xml element (type) + */ + private static void parseChannels(NodeList rawChannels, ArrayList channels) throws ExecutionException { + IChannelInfo channel = null; + for (int i = 0; i < rawChannels.getLength(); i++) { + Node rawChannel = rawChannels.item(i); + if (rawChannel.getNodeName().equalsIgnoreCase(MIStrings.CHANNEL)) { + channel = new ChannelInfo(""); //$NON-NLS-1$ + + // Populate the channel + NodeList rawInfos = rawChannel.getChildNodes(); + Node rawInfo = null; + for (int j = 0; j < rawInfos.getLength(); j++) { + rawInfo = rawInfos.item(j); + switch (rawInfo.getNodeName()) { + case MIStrings.NAME: + channel.setName(rawInfo.getTextContent()); + break; + case MIStrings.ENABLED: + channel.setState(TraceEnablement.valueOfString(rawInfo.getTextContent())); + break; + case MIStrings.EVENTS: + List events = new ArrayList<>(); + getEventInfo(rawInfo.getChildNodes(), events); + channel.setEvents(events); + break; + case MIStrings.ATTRIBUTES: + NodeList rawAttributes = rawInfo.getChildNodes(); + for (int k = 0; k < rawAttributes.getLength(); k++) { + Node attribute = rawAttributes.item(k); + switch (attribute.getNodeName()) { + case MIStrings.OVERWRITE_MODE: + channel.setOverwriteMode(!LTTngControlServiceConstants.OVERWRITE_MODE_ATTRIBUTE_FALSE_MI.equalsIgnoreCase(attribute.getTextContent())); + break; + case MIStrings.SUBBUF_SIZE: + channel.setSubBufferSize(Long.valueOf(attribute.getTextContent())); + break; + case MIStrings.NUM_SUBBUF: + channel.setNumberOfSubBuffers(Integer.valueOf(attribute.getTextContent())); + break; + case MIStrings.SWITCH_TIMER_INTERVAL: + channel.setSwitchTimer(Long.valueOf(attribute.getTextContent())); + break; + case MIStrings.READ_TIMER_INTERVAL: + channel.setReadTimer(Long.valueOf(attribute.getTextContent())); + break; + case MIStrings.OUTPUT_TYPE: + channel.setOutputType(attribute.getTextContent()); + break; + case MIStrings.TRACEFILE_SIZE: + channel.setMaxSizeTraceFiles(Integer.parseInt(attribute.getTextContent())); + break; + case MIStrings.TRACEFILE_COUNT: + channel.setMaxNumberTraceFiles(Integer.parseInt(attribute.getTextContent())); + break; + case MIStrings.LIVE_TIMER_INTERVAL: + // TODO: currently not supported by tmf + break; + default: + break; + } + } + break; + default: + break; + } + } + channels.add(channel); + } + } + + } + + @Override + public ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) throws ExecutionException { + // TODO A session can have multiple snapshot output. This need to be + // supported in the future. + // Currently the SessionInfo object does not support multiple snashot + // output. + // For now only keep the last one. + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName); + ICommandResult result = executeCommand(command.toString(), monitor); + Document doc = getDocumentFromStrings(result.getOutput()); + NodeList rawSnapshotsOutputs = doc.getElementsByTagName(MIStrings.SNAPSHOT_OUTPUTS); + + ISnapshotInfo snapshotInfo = new SnapshotInfo(""); //$NON-NLS-1$ + + // TODO: tmf does not have a notion of a ctrl url. + for (int i = 0; i < rawSnapshotsOutputs.getLength(); i++) { + NodeList rawSnapshotOutput = rawSnapshotsOutputs.item(i).getChildNodes(); + for (int j = 0; j < rawSnapshotOutput.getLength(); j++) { + Node rawInfo = rawSnapshotOutput.item(j); + switch (rawInfo.getNodeName()) { + case MIStrings.ID: + snapshotInfo.setId(Integer.parseInt(rawInfo.getTextContent())); + break; + case MIStrings.NAME: + snapshotInfo.setName(rawInfo.getTextContent()); + break; + case MIStrings.SNAPSHOT_CTRL_URL: + // The use of the ctrl_url for the snapshot path is to assure + // basic support. Refactoring is necessary in lttng and + // tmf side. + // See http://bugs.lttng.org/issues/828 (+comment) + snapshotInfo.setSnapshotPath(rawInfo.getTextContent()); + break; + default: + break; + } + } + } + + // Check if the snapshot output is Streamed + Matcher matcher2 = LTTngControlServiceConstants.TRACE_NETWORK_PATTERN.matcher(snapshotInfo.getSnapshotPath()); + if (matcher2.matches()) { + snapshotInfo.setStreamedSnapshot(true); + } + + return snapshotInfo; + } + + @Override + public List getKernelProvider(IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_KERNEL); + ICommandResult result = executeCommand(command.toString(), monitor, false); + List events = new ArrayList<>(); + + if (isError(result) && result.getErrorOutput() != null) { + // Ignore the following 2 cases: + // Spawning a session daemon + // Error: Unable to list kernel events + // or: + // Error: Unable to list kernel events + if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN)) { + return events; + } + throw new ExecutionException(Messages.TraceControl_CommandError + LTTngControlServiceConstants.COMMAND_LIST_KERNEL); + } + + Document document = getDocumentFromStrings(result.getOutput()); + NodeList rawEvents = document.getElementsByTagName(MIStrings.EVENT); + getBaseEventInfo(rawEvents, events); + return events; + } + + @Override + public List getUstProvider(IProgressMonitor monitor) throws ExecutionException { + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_UST); + // Get the field to + command.append(LTTngControlServiceConstants.OPTION_FIELDS); + + // Execute + ICommandResult result = executeCommand(command.toString(), monitor, false); + List allProviders = new ArrayList<>(); + + if (isError(result) && result.getErrorOutput() != null) { + // Ignore the following 2 cases: + // Spawning a session daemon + // Error: Unable to list UST events: Listing UST events failed + // or: + // Error: Unable to list UST events: Listing UST events failed + if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) { + return allProviders; + } + throw new ExecutionException(Messages.TraceControl_CommandError + LTTngControlServiceConstants.COMMAND_LIST_UST); + } + + Document document = getDocumentFromStrings(result.getOutput()); + NodeList rawProviders = document.getElementsByTagName(MIStrings.PID); + + IUstProviderInfo providerInfo = null; + + for (int i = 0; i < rawProviders.getLength(); i++) { + Node provider = rawProviders.item(i); + Node name = getFirstOf(provider.getChildNodes(), MIStrings.NAME); + if (name == null) { + throw new ExecutionException(Messages.TraceControl_MiInvalidProviderError); + } + providerInfo = new UstProviderInfo(name.getTextContent()); + + // Populate provider + NodeList infos = provider.getChildNodes(); + for (int j = 0; j < infos.getLength(); j++) { + Node info = infos.item(j); + switch (info.getNodeName()) { + case MIStrings.PID_ID: + providerInfo.setPid(Integer.parseInt(info.getTextContent())); + break; + case MIStrings.EVENTS: + List events = new ArrayList<>(); + NodeList rawEvents = info.getChildNodes(); + getBaseEventInfo(rawEvents, events); + providerInfo.setEvents(events); + break; + default: + break; + } + } + allProviders.add(providerInfo); + } + + return allProviders; + } + + @Override + public ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { + if (sessionInfo.isStreamedTrace()) { + return createStreamedSession(sessionInfo, monitor); + } + + StringBuffer command = prepareSessionCreationCommand(sessionInfo); + + ICommandResult result = executeCommand(command.toString(), monitor); + + Document document = getDocumentFromStrings(result.getOutput()); + NodeList sessions = document.getElementsByTagName(MIStrings.SESSION); + + // Number of session should be equal to 1 + if (sessions.getLength() != 1) { + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" //$NON-NLS-1$//$NON-NLS-2$ + + NLS.bind(Messages.TraceControl_UnexpectedNumberOfElementError, MIStrings.SESSION) + " " + sessions.getLength()); //$NON-NLS-1$ + } + + // Fetch a session from output + ISessionInfo outputSession = new SessionInfo(""); //$NON-NLS-1$ + parseSession(outputSession, sessions.item(0)); + + // Verify session name + if ((outputSession.getName().equals("")) || (!"".equals(sessionInfo.getName()) && !outputSession.getName().equals(sessionInfo.getName()))) { //$NON-NLS-1$ //$NON-NLS-2$ + // Unexpected name returned + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.TraceControl_UnexpectedNameError + ": " + outputSession.getName()); //$NON-NLS-1$ + } + + // Verify session path + if (!sessionInfo.isSnapshotSession() && + ((outputSession.getSessionPath() == null) || ((sessionInfo.getSessionPath() != null) && (!outputSession.getSessionPath().contains(sessionInfo.getSessionPath()))))) { + // Unexpected path + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.TraceControl_UnexpectedPathError + ": " + outputSession.getName()); //$NON-NLS-1$ + } + + if (sessionInfo.isSnapshotSession()) { + // Make it a snapshot session - content of snapshot info need to + // set afterwards using getSession() or getSnapshotInfo() + outputSession.setSnapshotInfo(new SnapshotInfo("")); //$NON-NLS-1$ + } + + return outputSession; + } + + private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { + + StringBuffer command = prepareStreamedSessionCreationCommand(sessionInfo); + + ICommandResult result = executeCommand(command.toString(), monitor); + + Document document = getDocumentFromStrings(result.getOutput()); + NodeList sessions = document.getElementsByTagName(MIStrings.SESSION); + + // Number of session should be equal to 1 + if (sessions.getLength() != 1) { + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" //$NON-NLS-1$//$NON-NLS-2$ + + NLS.bind(Messages.TraceControl_UnexpectedNumberOfElementError, MIStrings.SESSION) + " " + sessions.getLength()); //$NON-NLS-1$ + } + + // Fetch a session from output + ISessionInfo outputSession = new SessionInfo(""); //$NON-NLS-1$ + parseSession(outputSession, sessions.item(0)); + + // Verify session name + if ((outputSession.getName().equals("")) || (!"".equals(sessionInfo.getName()) && !outputSession.getName().equals(sessionInfo.getName()))) { //$NON-NLS-1$ //$NON-NLS-2$ + // Unexpected name returned + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.TraceControl_UnexpectedNameError + ": " + outputSession.getName()); //$NON-NLS-1$ + } + + sessionInfo.setName(outputSession.getName()); + sessionInfo.setStreamedTrace(true); + + // Verify session path + if (sessionInfo.getNetworkUrl() != null) { + if (!sessionInfo.isSnapshotSession() && (outputSession.getSessionPath() == null)) { + // Unexpected path + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.TraceControl_UnexpectedPathError + ": " + outputSession.getName()); //$NON-NLS-1$ + } + + if (sessionInfo.isSnapshotSession()) { + sessionInfo.setStreamedTrace(false); + } else { + sessionInfo.setSessionPath(outputSession.getSessionPath()); + // Check file protocol + Matcher matcher = LTTngControlServiceConstants.TRACE_FILE_PROTOCOL_PATTERN.matcher(outputSession.getSessionPath()); + if (matcher.matches()) { + sessionInfo.setStreamedTrace(false); + } + } + } + + // When using controlUrl and dataUrl the full session path is not known + // yet + // and will be set later on when listing the session + return sessionInfo; + + } + + @Override + public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { + String newName = formatParameter(sessionName); + + StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName); + + ICommandResult result = executeCommand(command.toString(), monitor, false); + String[] errorOutput = result.getErrorOutput(); + + if (isError(result) && (errorOutput != null)) { + // Don't treat this as an error + if (ignoredPattern(errorOutput, LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { + return; + + } + throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$ + } + + // Check for action effect + Document doc = getDocumentFromStrings(result.getOutput()); + NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); + if (sessions.getLength() != 1) { + throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); + } + + Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); + if (rawSessionName == null) { + throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); + } + + // Validity check + if (!rawSessionName.getTextContent().equals(sessionName)) { + throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); + } + } + + /** + * @param strings + * array of string that make up a command line + * @return string buffer with created command line + */ + @Override + protected StringBuffer createCommand(String... strings) { + StringBuffer command = new StringBuffer(); + command.append(LTTngControlServiceConstants.CONTROL_COMMAND_MI_XML); + command.append(getTracingGroupOption()); + for (String string : strings) { + command.append(string); + } + return command; + } + + /** + * @param xmlBaseEvents + * a Node list of base xml event element + * @param events + * list of event generated by the parsing of the xml event + * element + * @throws ExecutionException + * when a raw event is not a complete/valid xml event + */ + private static void getBaseEventInfo(NodeList xmlBaseEvents, List events) throws ExecutionException { + IBaseEventInfo eventInfo = null; + for (int i = 0; i < xmlBaseEvents.getLength(); i++) { + NodeList rawInfos = xmlBaseEvents.item(i).getChildNodes(); + // Search for name + if (xmlBaseEvents.item(i).getNodeName().equalsIgnoreCase(MIStrings.EVENT)) { + Node rawName = getFirstOf(rawInfos, MIStrings.NAME); + if (rawName == null) { + throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); + } + eventInfo = new BaseEventInfo(rawName.getTextContent()); + + // Populate the event + for (int j = 0; j < rawInfos.getLength(); j++) { + Node infoNode = rawInfos.item(j); + switch (infoNode.getNodeName()) { + case MIStrings.TYPE: + eventInfo.setEventType(infoNode.getTextContent()); + break; + case MIStrings.LOGLEVEL: + eventInfo.setLogLevel(infoNode.getTextContent()); + break; + case MIStrings.EVENT_FIELDS: + List fields = new ArrayList<>(); + getFieldInfo(infoNode.getChildNodes(), fields); + eventInfo.setFields(fields); + break; + default: + break; + } + } + events.add(eventInfo); + } + } + } + + /** + * @param xmlBaseEvents + * a Node list of xml event element linked to a session + * @param events + * list of event generated by the parsing of the xml event + * element + * @throws ExecutionException + * when a raw event is not a complete/valid xml event + */ + static void getEventInfo(NodeList xmlEvents, List events) throws ExecutionException { + IEventInfo eventInfo = null; + for (int i = 0; i < xmlEvents.getLength(); i++) { + NodeList rawInfos = xmlEvents.item(i).getChildNodes(); + // Search for name + if (xmlEvents.item(i).getNodeName().equalsIgnoreCase(MIStrings.EVENT)) { + Node rawName = getFirstOf(rawInfos, MIStrings.NAME); + if (rawName == null) { + throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); + } + + eventInfo = new EventInfo(rawName.getTextContent()); + + // Basic information + for (int j = 0; j < rawInfos.getLength(); j++) { + Node infoNode = rawInfos.item(j); + switch (infoNode.getNodeName()) { + case MIStrings.TYPE: + eventInfo.setEventType(infoNode.getTextContent()); + break; + case MIStrings.LOGLEVEL_TYPE: + eventInfo.setLogLevelType(LogLevelType.valueOfString(infoNode.getTextContent())); + break; + case MIStrings.LOGLEVEL: + eventInfo.setLogLevel(TraceLogLevel.valueOfString(infoNode.getTextContent())); + break; + case MIStrings.ENABLED: + eventInfo.setState(TraceEnablement.valueOfString(infoNode.getTextContent())); + break; + case MIStrings.FILTER: + // TODO + // See bug 334 http://bugs.lttng.org/issues/334 from + // LTTng + // For now we emulate the non-mi behavior and simply put + // "with filter" + eventInfo.setFilterExpression("with filter"); //$NON-NLS-1$ + break; + case MIStrings.EXCLUSION: + // TODO: Currently not supported by tmf + // ExclusionS element is ignored + break; + default: + break; + } + } + + boolean isProbeFunction = (eventInfo.getEventType().equals(TraceEventType.PROBE)) || (eventInfo.getEventType().equals(TraceEventType.FUNCTION)); + if (isProbeFunction) { + IProbeEventInfo probeEvent = new ProbeEventInfo(eventInfo); + eventInfo = probeEvent; + + Node rawDataNode = null; + switch (probeEvent.getEventType()) { + case FUNCTION: + case PROBE: { + // get attributes + Node rawAttributes = getFirstOf(rawInfos, MIStrings.ATTRIBUTES); + if (rawAttributes == null) { + throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); + } + rawDataNode = getFirstOf(rawAttributes.getChildNodes(), MIStrings.PROBE_ATTRIBUTES); + break; + } + case SYSCALL: + case TRACEPOINT: + case UNKNOWN: + default: + throw new ExecutionException(Messages.TraceControl_MiInvalidElementError); + } + + if (rawDataNode == null) { + throw new ExecutionException(Messages.TraceControl_MiInvalidElementError); + } + + // Extract info + NodeList rawDatas = rawDataNode.getChildNodes(); + for (int j = 0; j < rawDatas.getLength(); j++) { + Node rawData = rawDatas.item(j); + switch (rawData.getNodeName()) { + case MIStrings.SYMBOL_NAME: + probeEvent.setSymbol(rawData.getTextContent()); + break; + case MIStrings.ADDRESS: + probeEvent.setAddress(String.format("%#016x", new BigInteger(rawData.getTextContent()))); //$NON-NLS-1$ + break; + case MIStrings.OFFSET: + probeEvent.setOffset(String.format("%#016x", new BigInteger(rawData.getTextContent()))); //$NON-NLS-1$ + break; + default: + break; + } + } + } + + // Syscalls does not have name. + // Let put one to make sure this is user friendly via UI + if (eventInfo.getEventType().equals(TraceEventType.SYSCALL)) { + eventInfo.setName(TraceEventType.SYSCALL.getInName()); + } + + // Add the event + events.add(eventInfo); + } + } + } + + /** + * @param fieldsList + * a list of xml event_field element + * @param fields + * a list of field generated by xml parsing + * @throws ExecutionException + * when parsing fail or required elements are missing + */ + private static void getFieldInfo(NodeList fieldsList, List fields) throws ExecutionException { + IFieldInfo fieldInfo = null; + for (int i = 0; i < fieldsList.getLength(); i++) { + Node field = fieldsList.item(i); + if (field.getNodeName().equalsIgnoreCase(MIStrings.EVENT_FIELD)) { + // Get name + Node name = getFirstOf(field.getChildNodes(), MIStrings.NAME); + if (name == null) { + throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); + } + fieldInfo = new FieldInfo(name.getTextContent()); + + // Populate the field information + NodeList infos = field.getChildNodes(); + for (int j = 0; j < infos.getLength(); j++) { + Node info = infos.item(j); + switch (info.getNodeName()) { + case MIStrings.TYPE: + fieldInfo.setFieldType(info.getTextContent()); + break; + default: + break; + } + } + fields.add(fieldInfo); + } + } + } + + /** + * Retrieve the fist instance of a given node with tag name equal to tagName + * parameter + * + * @param nodeList + * the list of Node to search against + * @param tagName + * the tag name of the desired node + * @return the first occurrence of a node with a tag name equals to tagName + */ + private static Node getFirstOf(NodeList nodeList, String tagName) { + Node node = null; + for (int i = 0; i < nodeList.getLength(); i++) { + if (nodeList.item(i).getNodeName() == tagName) { + node = nodeList.item(i); + break; + } + } + return node; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LttngVersion.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LttngVersion.java new file mode 100644 index 0000000000..f992efb19e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LttngVersion.java @@ -0,0 +1,152 @@ +/********************************************************************** + * 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: + * Bernd Hufmann - Initial API and implementation + * Jonathan Rajotte - Machine interface support and new information + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; + +import org.osgi.framework.Version; + +/** + * A version implementation with a special compareTo implementation to bypass + * problems of older implementation of org.osgi.framework.Version. + * + * @author Bernd Hufmann + */ +public class LttngVersion extends Version { + + private final String fLicense; + private final String fCommit; + private final String fName; + private final String fDescription; + private final String fUrl; + private final String fFullVersion; + + /** + * Constructor + * + * @param version + * The version string + */ + public LttngVersion(String version) { + super(version); + fLicense = ""; //$NON-NLS-1$ + fCommit = ""; //$NON-NLS-1$ + fName = ""; //$NON-NLS-1$ + fDescription = ""; //$NON-NLS-1$ + fUrl = ""; //$NON-NLS-1$ + fFullVersion = ""; //$NON-NLS-1$ + } + + /** + * @param major + * major version number + * @param minor + * minor version number + * @param micro + * micro version number + * @param license + * licence text of LTTng + * @param commit + * current git commit information about LTTng + * @param name + * name of the version + * @param description + * description of the version + * @param url + * url to website + * @param fullVersion + * complete string representation of the version + */ + public LttngVersion(int major, int minor, int micro, String license, String commit, String name, String description, String url, String fullVersion) { + super(major, minor, micro); + fLicense = license; + fCommit = commit; + fName = name; + fDescription = description; + fUrl = url; + fFullVersion = fullVersion; + } + + /** + * Special compareTo method to fix problem of older implementations of + * org.osgi.framework.Version where {@code Version.compareTo} takes an + * {@code Object} instead a {@code Version} as argument. + * + * @param other + * - Other version to compare + * @return a negative integer, zero, or a positive integer if this version + * is less than, equal to, or greater than the specified + * {@code LttngVersion} object. + */ + public int compareTo(LttngVersion other) { + if (other == this) { // quicktest + return 0; + } + int result = getMajor() - other.getMajor(); + if (result != 0) { + return result; + } + + result = getMinor() - other.getMinor(); + if (result != 0) { + return result; + } + + result = getMicro() - other.getMicro(); + if (result != 0) { + return result; + } + return getQualifier().compareTo(other.getQualifier()); + } + + /** + * @return String representing the lttng license + */ + public String getLicense() { + return fLicense; + } + + /** + * @return commit id of lttng + */ + public String getCommit() { + return fCommit; + } + + /** + * @return name of lttng version + */ + public String getName() { + return fName; + } + + /** + * @return full description of lttng + */ + public String getDescription() { + return fDescription; + } + + /** + * @return url of lttng + */ + public String getUrl() { + return fUrl; + } + + /** + * @return the full_version + */ + public String getFullVersion() { + return fFullVersion; + } +} diff --git a/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/MIStrings.java b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/MIStrings.java new file mode 100644 index 0000000000..3d79248ec7 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/MIStrings.java @@ -0,0 +1,576 @@ +/******************************************************************************* + * 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: + * Jonathan Rajotte Julien - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Non-externalized strings for use with the LTTng Control services. This + * nformation is extracted from mi_lttng.xsd from lttng-tool libmi. + * + * @author Jonathan Rajotte + */ +@SuppressWarnings("nls") +@NonNullByDefault +public interface MIStrings { + + /** + * Represent the command_action xml element + */ + String COMMAND_ACTION = "snapshot_action"; + + /** + * Represent the command_add_context xml element + */ + String COMMAND_ADD_CONTEXT = "add-context"; + + /** + * Represent the command_calibrate xml element + */ + String COMMAND_CALIBRATE = "calibrate"; + + /** + * Represent the command_create xml element + */ + String COMMAND_CREATE = "create"; + + /** + * Represent the command_destroy xml element + */ + String COMMAND_DESTROY = "destroy"; + + /** + * Represent the command_disable_channel xml element + */ + String COMMAND_DISABLE_CHANNEL = "disable-channel"; + + /** + * Represent the command_disable_event xml element + */ + String COMMAND_DISABLE_EVENT = "disable-event"; + + /** + * Represent the command_enable_channels xml element + */ + String COMMAND_ENABLE_CHANNELS = "enable-channel"; + + /** + * Represent the command_enable_event xml element + */ + String COMMAND_ENABLE_EVENT = "enable-event"; + + /** + * Represent the command_list xml element + */ + String COMMAND_LIST = "list"; + + /** + * Represent the command_load xml element + */ + String COMMAND_LOAD = "load"; + + /** + * Represent the command_name xml element + */ + String COMMAND_NAME = "name"; + + /** + * Represent the command_output xml element + */ + String COMMAND_OUTPUT = "output"; + + /** + * Represent the command_save xml element + */ + String COMMAND_SAVE = "save"; + + /** + * Represent the command_set_session xml element + */ + String COMMAND_SET_SESSION = "set-session"; + + /** + * Represent the command_snapshot xml element + */ + String COMMAND_SNAPSHOT = "snapshot"; + + /** + * Represent the command_snapshot_add xml element + */ + String COMMAND_SNAPSHOT_ADD = "add_snapshot"; + + /** + * Represent the command_snapshot_del xml element + */ + String COMMAND_SNAPSHOT_DEL = "del_snapshot"; + + /** + * Represent the command_snapshot_list xml element + */ + String COMMAND_SNAPSHOT_LIST = "list_snapshot"; + + /** + * Represent the command_snapshot_record xml element + */ + String COMMAND_SNAPSHOT_RECORD = "record_snapshot"; + + /** + * Represent the command_start xml element + */ + String COMMAND_START = "start"; + + /** + * Represent the command_stop xml element + */ + String COMMAND_STOP = "stop"; + + /** + * Represent the command_success xml element + */ + String COMMAND_SUCCESS = "success"; + + /** + * Represent the command_version xml element + */ + String COMMAND_VERSION = "version"; + + /** + * Represent the version xml element + */ + String VERSION = "version"; + + /** + * Represent the version_commit xml element + */ + String VERSION_COMMIT = "commit"; + + /** + * Represent the version_description xml element + */ + String VERSION_DESCRIPTION = "description"; + + /** + * Represent the version_license xml element + */ + String VERSION_LICENSE = "license"; + + /** + * Represent the version_major xml element + */ + String VERSION_MAJOR = "major"; + + /** + * Represent the version_minor xml element + */ + String VERSION_MINOR = "minor"; + + /** + * Represent the version_patch_level xml element + */ + String VERSION_PATCH_LEVEL = "patchLevel"; + + /** + * Represent the version_str xml element + */ + String VERSION_STR = "string"; + + /** + * Represent the version_web xml element + */ + String VERSION_WEB = "url"; + + /** + * Represent the version_name xml element + */ + String VERSION_NAME = "name"; + /* String related to a lttng_event_field */ + + /** + * Represent the event_field xml element + */ + String EVENT_FIELD = "event_field"; + + /** + * Represent the event_fields xml element + */ + String EVENT_FIELDS = "event_fields"; + + /** + * Represent the perf_counter_context xml element + */ + String PERF_COUNTER_CONTEXT = "perf_counter_context"; + + // ------------------------------------------------------------------------ + // String related to pid + // ------------------------------------------------------------------------/ + + /** + * Represent the pids xml element + */ + String PIDS = "pids"; + + /** + * Represent the pid xml element + */ + String PID = "pid"; + + /** + * Represent the pid_id xml element + */ + String PID_ID = "id"; + + // ------------------------------------------------------------------------ + // String related to save command + // ------------------------------------------------------------------------ + /** + * Represent the save xml element + */ + String SAVE = "save"; + + // ------------------------------------------------------------------------ + // String related to load command + // ------------------------------------------------------------------------ + /** + * Represent the load xml element + */ + String LOAD = "load"; + + // ------------------------------------------------------------------------ + // String related to general element of mi_lttng + // ------------------------------------------------------------------------ + /** + * Represent the empty xml element + */ + String EMPTY = ""; + + /** + * Represent the id xml element + */ + String ID = "id"; + + /** + * Represent the nowrite xml element + */ + String NOWRITE = "nowrite"; + + /** + * Represent the success xml element + */ + String SUCCESS = "success"; + + /** + * Represent the type_enum xml element + */ + String TYPE_ENUM = "ENUM"; + + /** + * Represent the type_float xml element + */ + String TYPE_FLOAT = "FLOAT"; + + /** + * Represent the type_integer xml element + */ + String TYPE_INTEGER = "INTEGER"; + + /** + * Represent the type_other xml element + */ + String TYPE_OTHER = "OTHER"; + + /** + * Represent the type_string xml element + */ + String TYPE_STRING = "STRING"; + + // ------------------------------------------------------------------------ + // String related to lttng_calibrate + // ------------------------------------------------------------------------ + /** + * Represent the calibrate xml element + */ + String CALIBRATE = "calibrate"; + + /** + * Represent the calibrate_function xml element + */ + String CALIBRATE_FUNCTION = "FUNCTION"; + + // ------------------------------------------------------------------------ + // String related to a lttng_snapshot_output + // ------------------------------------------------------------------------ + /** + * Represent the snapshot_ctrl_url xml element + */ + String SNAPSHOT_CTRL_URL = "ctrl_url"; + + /** + * Represent the snapshot_data_url xml element + */ + String SNAPSHOT_DATA_URL = "data_url"; + + /** + * Represent the snapshot_max_size xml element + */ + + String SNAPSHOT_MAX_SIZE = "max_size"; + + /** + * Represent the snapshot_n_ptr xml element + */ + String SNAPSHOT_N_PTR = "n_ptr"; + + /** + * Represent the snapshot_session_name xml element + */ + String SNAPSHOT_SESSION_NAME = "session_name"; + + /** + * Represent the snapshots xml element + */ + String SNAPSHOTS = "snapshots"; + /** + * Represent the channel xml element + */ + String CHANNEL = "channel"; + + /** + * Represent the channels xml element + */ + String CHANNELS = "channels"; + + /** + * Represent the domain xml element + */ + String DOMAIN = "domain"; + + /** + * Represent the domains xml element + */ + String DOMAINS = "domains"; + + /** + * Represent the event xml element + */ + String EVENT = "event"; + + /** + * Represent the events xml element + */ + String EVENTS = "events"; + + /** + * Represent the context xml element + */ + String CONTEXT = "context"; + + /** + * Represent the contexts xml element + */ + String CONTEXTS = "contexts"; + + /** + * Represent the attributes xml element + */ + String ATTRIBUTES = "attributes"; + + /** + * Represent the exclusion xml element + */ + String EXCLUSION = "exclusion"; + + /** + * Represent the exclusions xml element + */ + String EXCLUSIONS = "exclusions"; + + /** + * Represent the function_attributes xml element + */ + String FUNCTION_ATTRIBUTES = "function_attributes"; + + /** + * Represent the probe_attributes xml element + */ + String PROBE_ATTRIBUTES = "probe_attributes"; + + /** + * Represent the symbol_name xml element + */ + String SYMBOL_NAME = "symbol_name"; + + /** + * Represent the address xml element + */ + String ADDRESS = "address"; + + /** + * Represent the offset xml element + */ + String OFFSET = "offset"; + + /** + * Represent the name xml element + */ + String NAME = "name"; + + /** + * Represent the enabled xml element + */ + String ENABLED = "enabled"; + + /** + * Represent the overwrite_mode xml element + */ + String OVERWRITE_MODE = "overwrite_mode"; + + /** + * Represent the subbuf_size xml element + */ + String SUBBUF_SIZE = "subbuffer_size"; + + /** + * Represent the num_subbuf xml element + */ + String NUM_SUBBUF = "subbuffer_count"; + + /** + * Represent the switch_timer_interval xml element + */ + String SWITCH_TIMER_INTERVAL = "switch_timer_interval"; + + /** + * Represent the read_timer_interval xml element + */ + String READ_TIMER_INTERVAL = "read_timer_interval"; + + /** + * Represent the output xml element + */ + String OUTPUT = "output"; + + /** + * Represent the output_type xml element + */ + String OUTPUT_TYPE = "output_type"; + + /** + * Represent the tracefile_size xml element + */ + String TRACEFILE_SIZE = "tracefile_size"; + + /** + * Represent the tracefile_count xml element + */ + String TRACEFILE_COUNT = "tracefile_count"; + + /** + * Represent the live_timer_interval xml element + */ + String LIVE_TIMER_INTERVAL = "live_timer_interval"; + + /** + * Represent the type xml element + */ + String TYPE = "type"; + + /** + * Represent the buffer_type xml element + */ + String BUFFER_TYPE = "buffer_type"; + + /** + * Represent the session xml element + */ + String SESSION = "session"; + + /** + * Represent the sessions xml element + */ + String SESSIONS = "sessions"; + + /** + * Represent the perf xml element + */ + String PERF = "perf"; + + /** + * Represent the config xml element + */ + String CONFIG = "config"; + + /** + * Represent the started xml element + */ + String STARTED = "started"; + + /** + * Represent the snapshot_mode xml element + */ + String SNAPSHOT_MODE = "snapshot_mode"; + + /** + * Represent the loglevel xml element + */ + String LOGLEVEL = "loglevel"; + + /** + * Represent the loglevel_type xml element + */ + String LOGLEVEL_TYPE = "loglevel_type"; + + /** + * Represent the filter xml element + */ + String FILTER = "filter"; + + /** + * Represent the snapshot_outputs xml element + */ + String SNAPSHOT_OUTPUTS = "snapshot"; + + /** + * Represent the consumer_output xml element + */ + String CONSUMER_OUTPUT = "consumer_output"; + + /** + * Represent the destination xml element + */ + String DESTINATION = "destination"; + + /** + * Represent the path xml element + */ + String PATH = "path"; + + /** + * Represent the net_output xml element + */ + String NET_OUTPUT = "net_output"; + + /** + * Represent the control_uri xml element + */ + String CONTROL_URI = "control_uri"; + + /** + * Represent the data_uri xml element + */ + String DATA_URI = "data_uri"; + + /** + * Represent the max_size xml element + */ + String MAX_SIZE = "max_size"; +} diff --git a/org.eclipse.tracecompass.lttng2.control/.project b/org.eclipse.tracecompass.lttng2.control/.project new file mode 100644 index 0000000000..746cab5f9c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control/.project @@ -0,0 +1,17 @@ + + + org.eclipse.tracecompass.lttng2.control + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/org.eclipse.tracecompass.lttng2.control/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.control/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.control/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.control/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.control/build.properties b/org.eclipse.tracecompass.lttng2.control/build.properties new file mode 100644 index 0000000000..fc36845ab8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control/build.properties @@ -0,0 +1,16 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +bin.includes = feature.xml,\ + feature.properties,\ + p2.inf +src.includes = sourceTemplateFeature/p2.inf diff --git a/org.eclipse.tracecompass.lttng2.control/feature.properties b/org.eclipse.tracecompass.lttng2.control/feature.properties new file mode 100644 index 0000000000..1b8199f8ac --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control/feature.properties @@ -0,0 +1,21 @@ +############################################################################### +# 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: +# Ericsson - Initial API and implementation +############################################################################### + +featureName=Trace Compass LTTng Tracer Control + +description=Plug-ins to integrate LTTng tracer control into the workbench. \ +Includes the TMF (Tracing and Monitoring Framework) and CTF (Common Trace Format) features. + +featureProvider=Eclipse Trace Compass + +copyright=Copyright 2013 Ericsson + diff --git a/org.eclipse.tracecompass.lttng2.control/feature.xml b/org.eclipse.tracecompass.lttng2.control/feature.xml new file mode 100644 index 0000000000..59027d2b3c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control/feature.xml @@ -0,0 +1,62 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.control/p2.inf b/org.eclipse.tracecompass.lttng2.control/p2.inf new file mode 100644 index 0000000000..23d394a8da --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control/p2.inf @@ -0,0 +1,5 @@ +instructions.configure=\ +org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:0,name:Linux Tools,enabled:false); \ +org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:1,name:Linux Tools,enabled:false); + +update.matchExp=providedCapabilities.exists(pc | pc.namespace == 'org.eclipse.equinox.p2.iu' && (pc.name == 'org.eclipse.linuxtools.lttng2.feature.group' || pc.name == 'org.eclipse.linuxtools.lttng2.control.feature.group')) diff --git a/org.eclipse.tracecompass.lttng2.control/pom.xml b/org.eclipse.tracecompass.lttng2.control/pom.xml new file mode 100644 index 0000000000..1370b542b3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.control + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + eclipse-feature + + Trace Compass LTTng (Linux Tracing Toolkit) Feature + + + + + org.eclipse.tycho.extras + tycho-source-feature-plugin + + + source-feature + package + + source-feature + + + + + + + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + attached-p2-metadata + package + + p2-metadata + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.control/sourceTemplateFeature/p2.inf b/org.eclipse.tracecompass.lttng2.control/sourceTemplateFeature/p2.inf new file mode 100644 index 0000000000..2ba3d5afca --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.control/sourceTemplateFeature/p2.inf @@ -0,0 +1,5 @@ +instructions.configure=\ +org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:0,name:Linux Tools,enabled:false); \ +org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:1,name:Linux Tools,enabled:false); + +update.matchExp=providedCapabilities.exists(pc | pc.namespace == 'org.eclipse.equinox.p2.iu' && (pc.name == 'org.eclipse.linuxtools.lttng2.source.feature.group' || pc.name == 'org.eclipse.linuxtools.lttng2.control.source.feature.group')) diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/.classpath b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.classpath new file mode 100644 index 0000000000..4f3836cfa9 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/.project b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.project new file mode 100644 index 0000000000..26161b2653 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.kernel.core.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..f3fc64575b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,393 @@ +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=enabled +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..62cfa90dee --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.kernel.core.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..3b12c225a8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/META-INF/MANIFEST.MF @@ -0,0 +1,27 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.kernel.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.linuxtools.tmf.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.core.tests;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.ctf.core, + org.eclipse.linuxtools.tmf.ctf.core.tests, + org.eclipse.tracecompass.lttng2.kernel.core;bundle-version="3.1.0", + org.eclipse.core.resources, + org.eclipse.linuxtools.statesystem.core, + org.eclipse.tracecompass.lttng2.control.core +Export-Package: org.eclipse.linuxtools.lttng2.kernel.core.tests, + org.eclipse.linuxtools.lttng2.kernel.core.tests.analysis;x-internal:=true, + org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync;x-internal:=true, + org.eclipse.linuxtools.lttng2.kernel.core.tests.perf, + org.eclipse.linuxtools.lttng2.kernel.core.tests.perf.analysis;x-internal:=true, + org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider;x-internal:=true +Import-Package: com.google.common.collect, + org.eclipse.test.performance diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/about.html b/org.eclipse.tracecompass.lttng2.kernel.core.tests/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/build.properties b/org.eclipse.tracecompass.lttng2.kernel.core.tests/build.properties new file mode 100644 index 0000000000..34a39c903e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/build.properties @@ -0,0 +1,21 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +source.. = src/,\ + perf/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties +src.includes = about.html +additional.bundles = org.eclipse.jdt.annotation +jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/AllPerfTests.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/AllPerfTests.java new file mode 100644 index 0000000000..09cfb5f109 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/AllPerfTests.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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 implementation and API + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.perf; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Run all performance test suites. + * + * @author Alexandre Montplaisir + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + org.eclipse.linuxtools.lttng2.kernel.core.tests.perf.analysis.AllPerfTests.class, + org.eclipse.linuxtools.lttng2.kernel.core.tests.perf.event.matching.AllPerfTests.class +}) +public class AllPerfTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AllPerfTests.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AllPerfTests.java new file mode 100644 index 0000000000..44293ef5b7 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AllPerfTests.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.tests.perf.analysis; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Test suite + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + AnalysisBenchmark.class +}) +public class AllPerfTests { +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AnalysisBenchmark.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AnalysisBenchmark.java new file mode 100644 index 0000000000..ae37bf0da1 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/analysis/AnalysisBenchmark.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * 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 + * Alexandre Montplaisir - Convert to org.eclipse.test.performance test + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.perf.analysis; + +import static org.junit.Assert.fail; +import static org.junit.Assume.assumeTrue; + +import java.io.File; + +import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; +import org.eclipse.linuxtools.lttng2.kernel.core.trace.LttngKernelTrace; +import org.eclipse.linuxtools.tmf.core.analysis.IAnalysisModule; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; +import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestHelper; +import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.eclipse.test.performance.Dimension; +import org.eclipse.test.performance.Performance; +import org.eclipse.test.performance.PerformanceMeter; +import org.junit.Test; + +/** + * This is a test of the time to build a kernel state system + * + * @author Genevieve Bastien + */ +public class AnalysisBenchmark { + + private static final String TEST_ID = "org.eclipse.linuxtools#LTTng kernel analysis"; + private static final int LOOP_COUNT = 25; + + /** + * Run the benchmark with "trace2" + */ + @Test + public void testTrace2() { + runTest(CtfTmfTestTrace.TRACE2, "Trace2"); + } + + private static void runTest(CtfTmfTestTrace testTrace, String testName) { + assumeTrue(testTrace.exists()); + + Performance perf = Performance.getDefault(); + PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + '#' + testName); + perf.tagAsSummary(pm, "LTTng Kernel Analysis: " + testName, Dimension.CPU_TIME); + + if (testTrace == CtfTmfTestTrace.TRACE2) { + /* Do not show all traces in the global summary */ + perf.tagAsGlobalSummary(pm, "LTTng Kernel Analysis: " + testName, Dimension.CPU_TIME); + } + + for (int i = 0; i < LOOP_COUNT; i++) { + try (IAnalysisModule module = new LttngKernelAnalysisModule(); + LttngKernelTrace trace = new LttngKernelTrace()) { + module.setId("test"); + trace.initTrace(null, testTrace.getPath(), CtfTmfEvent.class); + module.setTrace(trace); + + pm.start(); + TmfTestHelper.executeAnalysis(module); + pm.stop(); + + /* + * Delete the supplementary files, so that the next iteration + * rebuilds the state system. + */ + File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(trace)); + for (File file : suppDir.listFiles()) { + file.delete(); + } + + } catch (TmfAnalysisException | TmfTraceException e) { + fail(e.getMessage()); + } + + } + pm.commit(); + testTrace.dispose(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/AllPerfTests.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/AllPerfTests.java new file mode 100644 index 0000000000..a275c6a0c0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/AllPerfTests.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.tests.perf.event.matching; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Test suite + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + EventMatchingBenchmark.class, + TraceSynchronizationBenchmark.class +}) +public class AllPerfTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/EventMatchingBenchmark.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/EventMatchingBenchmark.java new file mode 100644 index 0000000000..8ccd66ff71 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/EventMatchingBenchmark.java @@ -0,0 +1,120 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.tests.perf.event.matching; + +import static org.junit.Assume.assumeTrue; + +import java.util.Set; + +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfNetworkEventMatching; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.eclipse.test.performance.Dimension; +import org.eclipse.test.performance.Performance; +import org.eclipse.test.performance.PerformanceMeter; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.google.common.collect.ImmutableSet; + +/** + * Benchmark simple event matching, without trace synchronization + * + * @author Geneviève Bastien + */ +public class EventMatchingBenchmark { + + private static final String TEST_ID = "org.eclipse.linuxtools#Event matching#"; + private static final String TIME = " (time)"; + private static final String MEMORY = " (memory usage)"; + private static final String TEST_SUMMARY = "Event matching"; + + /** + * Initialize some data + */ + @BeforeClass + public static void setUp() { + TmfEventMatching.registerMatchObject(new TcpEventMatching()); + TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); + } + + /** + * Run the benchmark with 2 small traces + */ + @Test + public void testSmallTraces() { + assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); + assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); + try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); + CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { + Set traces = ImmutableSet.of((ITmfTrace) trace1, trace2); + runCpuTest(traces, "Match TCP events", 100); + } + } + + /** + * Run the benchmark with 3 bigger traces + */ + @Test + public void testDjangoTraces() { + assumeTrue(CtfTmfTestTrace.DJANGO_CLIENT.exists()); + assumeTrue(CtfTmfTestTrace.DJANGO_DB.exists()); + assumeTrue(CtfTmfTestTrace.DJANGO_HTTPD.exists()); + try (CtfTmfTrace trace1 = CtfTmfTestTrace.DJANGO_CLIENT.getTrace(); + CtfTmfTrace trace2 = CtfTmfTestTrace.DJANGO_DB.getTrace(); + CtfTmfTrace trace3 = CtfTmfTestTrace.DJANGO_HTTPD.getTrace();) { + Set traces = ImmutableSet.of((ITmfTrace) trace1, trace2, trace3); + runCpuTest(traces, "Django traces", 10); + runMemoryTest(traces, "Django traces", 10); + } + } + + private static void runCpuTest(Set testTraces, String testName, int loop_count) { + Performance perf = Performance.getDefault(); + PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + TIME); + perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + TIME, Dimension.CPU_TIME); + + for (int i = 0; i < loop_count; i++) { + TmfNetworkEventMatching traceMatch = new TmfNetworkEventMatching(testTraces); + + pm.start(); + traceMatch.matchEvents(); + pm.stop(); + } + pm.commit(); + + } + + /* Benchmark memory used by the algorithm */ + private static void runMemoryTest(Set testTraces, String testName, int loop_count) { + Performance perf = Performance.getDefault(); + PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + MEMORY); + perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + MEMORY, Dimension.USED_JAVA_HEAP); + + for (int i = 0; i < loop_count; i++) { + TmfNetworkEventMatching traceMatch = new TmfNetworkEventMatching(testTraces); + + System.gc(); + pm.start(); + traceMatch.matchEvents(); + System.gc(); + pm.stop(); + } + pm.commit(); + + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java new file mode 100644 index 0000000000..f4ab323eb6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.tests.perf.event.matching; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assume.assumeTrue; + +import java.util.Arrays; + +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; +import org.eclipse.linuxtools.tmf.core.synchronization.SynchronizationAlgorithm; +import org.eclipse.linuxtools.tmf.core.synchronization.SynchronizationManager; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.eclipse.test.performance.Dimension; +import org.eclipse.test.performance.Performance; +import org.eclipse.test.performance.PerformanceMeter; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Benchmark trace synchronization + * + * @author Geneviève Bastien + */ +public class TraceSynchronizationBenchmark { + + private static final String TEST_ID = "org.eclipse.linuxtools#Trace synchronization#"; + private static final String TIME = " (time)"; + private static final String MEMORY = " (memory usage)"; + private static final String TEST_SUMMARY = "Trace synchronization"; + + /** + * Initialize some data + */ + @BeforeClass + public static void setUp() { + TmfEventMatching.registerMatchObject(new TcpEventMatching()); + TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); + } + + /** + * Run the benchmark with 2 small traces + */ + @Test + public void testSmallTraces() { + assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); + assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); + try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); + CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { + ITmfTrace[] traces = { trace1, trace2 }; + runCpuTest(traces, "Match TCP events", 40); + } + } + + /** + * Run the benchmark with 3 bigger traces + */ + @Test + public void testDjangoTraces() { + assumeTrue(CtfTmfTestTrace.DJANGO_CLIENT.exists()); + assumeTrue(CtfTmfTestTrace.DJANGO_DB.exists()); + assumeTrue(CtfTmfTestTrace.DJANGO_HTTPD.exists()); + try (CtfTmfTrace trace1 = CtfTmfTestTrace.DJANGO_CLIENT.getTrace(); + CtfTmfTrace trace2 = CtfTmfTestTrace.DJANGO_DB.getTrace(); + CtfTmfTrace trace3 = CtfTmfTestTrace.DJANGO_HTTPD.getTrace();) { + ITmfTrace[] traces = { trace1, trace2, trace3 }; + runCpuTest(traces, "Django traces", 10); + runMemoryTest(traces, "Django traces", 10); + } + } + + private static void runCpuTest(ITmfTrace[] testTraces, String testName, int loop_count) { + Performance perf = Performance.getDefault(); + PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + TIME); + perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + TIME, Dimension.CPU_TIME); + + for (int i = 0; i < loop_count; i++) { + pm.start(); + SynchronizationManager.synchronizeTraces(null, Arrays.asList(testTraces), true); + pm.stop(); + } + pm.commit(); + + } + + /* Benchmark memory used by the algorithm */ + private static void runMemoryTest(ITmfTrace[] testTraces, String testName, int loop_count) { + Performance perf = Performance.getDefault(); + PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + MEMORY); + perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + MEMORY, Dimension.USED_JAVA_HEAP); + + for (int i = 0; i < loop_count; i++) { + + System.gc(); + pm.start(); + SynchronizationAlgorithm algo = SynchronizationManager.synchronizeTraces(null, Arrays.asList(testTraces), true); + assertNotNull(algo); + + System.gc(); + pm.stop(); + } + pm.commit(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/plugin.properties b/org.eclipse.tracecompass.lttng2.kernel.core.tests/plugin.properties new file mode 100644 index 0000000000..33f34268ec --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Kernel Analysis Core Tests Plug-in diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/pom.xml b/org.eclipse.tracecompass.lttng2.kernel.core.tests/pom.xml new file mode 100644 index 0000000000..2fe7f7f105 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/pom.xml @@ -0,0 +1,73 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.kernel.core.tests + 3.1.0-SNAPSHOT + eclipse-test-plugin + + Trace Compass LTTng Kernel Analysis Core Tests Plug-in + + + + + + src + + **/*.java + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + + + prepare + validate + + + + + + + run + + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + + **/AllTests.* + + false + false + org.eclipse.platform.ide + + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/ActivatorTest.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/ActivatorTest.java new file mode 100644 index 0000000000..e1af96c5f6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/ActivatorTest.java @@ -0,0 +1,96 @@ +/******************************************************************************* + * Copyright (c) 2012 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.linuxtools.lttng2.kernel.core.tests; + +import junit.framework.TestCase; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * ActivatorTest + *

+ * Test suite for the Activator class + *

+ */ +@SuppressWarnings("javadoc") +public class ActivatorTest extends TestCase { + + // ------------------------------------------------------------------------ + // JUnit + // ------------------------------------------------------------------------ + + @BeforeClass + public static void setUpBeforeClass() { + } + + @AfterClass + public static void tearDownAfterClass() { + } + + /** + * @throws java.lang.Exception + */ + @Before + @Override + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + @Override + public void tearDown() throws Exception { + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#Activator()}. + */ + @Test + public void testActivator() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#getDefault()}. + */ + @Test + public void testGetDefault() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#start(org.osgi.framework.BundleContext)}. + */ + @Test + public void testStartBundleContext() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#stop(org.osgi.framework.BundleContext)}. + */ + @Test + public void testStopBundleContext() { + assertTrue(true); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/AllTests.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/AllTests.java new file mode 100644 index 0000000000..0356df6b3c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/AllTests.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.tests; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Runner for the lttng2.kernel unit tests. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ActivatorTest.class, + org.eclipse.linuxtools.lttng2.kernel.core.tests.analysis.AllTests.class, + org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider.TestAll.class, + org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync.AllTests.class +}) +public class AllTests { } diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/AllTests.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/AllTests.java new file mode 100644 index 0000000000..4198b6832e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/AllTests.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.tests.analysis; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Test suite for org.eclipse.linuxtools.lttng2.kernel.core.analysis package + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + LttngKernelAnalysisTest.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/LttngKernelAnalysisTest.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/LttngKernelAnalysisTest.java new file mode 100644 index 0000000000..e63a907da0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/analysis/LttngKernelAnalysisTest.java @@ -0,0 +1,180 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.tests.analysis; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +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 static org.junit.Assume.assumeTrue; + +import java.util.List; +import java.util.Set; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.LttngStrings; +import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; +import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; +import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestHelper; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.google.common.collect.ImmutableSet; + +/** + * Test the {@link LttngKernelAnalysisModule} class + * + * @author Geneviève Bastien + */ +public class LttngKernelAnalysisTest { + + private ITmfTrace fTrace; + private LttngKernelAnalysisModule fKernelAnalysisModule; + + /** + * Class setup + */ + @BeforeClass + public static void setUpClass() { + assumeTrue(CtfTmfTestTrace.KERNEL.exists()); + } + + /** + * Set-up the test + */ + @Before + public void setUp() { + fKernelAnalysisModule = new LttngKernelAnalysisModule(); + fTrace = CtfTmfTestTrace.KERNEL.getTrace(); + } + + /** + * Dispose test objects + */ + @After + public void tearDown() { + fTrace.dispose(); + fKernelAnalysisModule.dispose(); + } + + /** + * Test the LTTng kernel analysis execution + */ + @Test + public void testAnalysisExecution() { + fKernelAnalysisModule.setId("test"); + try { + fKernelAnalysisModule.setTrace(fTrace); + } catch (TmfAnalysisException e) { + fail(e.getMessage()); + } + // Assert the state system has not been initialized yet + ITmfStateSystem ss = fKernelAnalysisModule.getStateSystem(); + assertNull(ss); + + assertTrue(TmfTestHelper.executeAnalysis(fKernelAnalysisModule)); + + ss = fKernelAnalysisModule.getStateSystem(); + assertNotNull(ss); + + List quarks = ss.getQuarks("*"); + assertFalse(quarks.isEmpty()); + } + + /** + * Test the canExecute method on valid and invalid traces + */ + @Test + public void testCanExecute() { + /* Test with a valid kernel trace */ + assertNotNull(fTrace); + assertTrue(fKernelAnalysisModule.canExecute(fTrace)); + + /* Test with a CTF trace that does not have required events */ + assumeTrue(CtfTmfTestTrace.CYG_PROFILE.exists()); + try (CtfTmfTrace trace = CtfTmfTestTrace.CYG_PROFILE.getTrace();) { + /* + * TODO: This should be false, but for now there is no mandatory + * events in the kernel analysis so it will return true. + */ + assertTrue(fKernelAnalysisModule.canExecute(trace)); + } + } + + /** + * Test for {@link LttngKernelAnalysisModule#getAnalysisRequirements()} + */ + @Test + public void testGetAnalysisRequirements() { + Iterable requirements = fKernelAnalysisModule.getAnalysisRequirements(); + assertNotNull(requirements); + + /* There should be the event and domain type */ + TmfAnalysisRequirement eventReq = null; + TmfAnalysisRequirement domainReq = null; + int numberOfRequirement = 0; + for (TmfAnalysisRequirement requirement : requirements) { + ++numberOfRequirement; + if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_EVENT)) { + eventReq = requirement; + } else if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN)) { + domainReq = requirement; + } + } + assertNotNull(eventReq); + assertNotNull(domainReq); + + /* There should be two requirements */ + assertEquals(2, numberOfRequirement); + + /* Verify the content of the requirements themselves */ + /* Domain should be kernel */ + assertEquals(1, domainReq.getValues().size()); + for (String domain : domainReq.getValues()) { + assertEquals(SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL, domain); + } + + /* Events */ + Set expectedEvents = ImmutableSet.of( + LttngStrings.EXIT_SYSCALL, + LttngStrings.IRQ_HANDLER_ENTRY, + LttngStrings.IRQ_HANDLER_EXIT, + LttngStrings.SOFTIRQ_ENTRY, + LttngStrings.SOFTIRQ_EXIT, + LttngStrings.SOFTIRQ_RAISE, + LttngStrings.SCHED_SWITCH, + LttngStrings.SCHED_PROCESS_FORK, + LttngStrings.SCHED_PROCESS_EXIT, + LttngStrings.SCHED_PROCESS_FREE, + LttngStrings.STATEDUMP_PROCESS_STATE, + LttngStrings.SCHED_WAKEUP, + LttngStrings.SCHED_WAKEUP_NEW, + /* Add the prefix for syscalls */ + LttngStrings.SYSCALL_PREFIX + ); + + assertEquals(14, eventReq.getValues().size()); + for (String event : eventReq.getValues()) { + assertTrue("Unexpected event " + event, expectedEvents.contains(event)); + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/AllTests.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/AllTests.java new file mode 100644 index 0000000000..e3d58507f4 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/AllTests.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2013 É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 implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Test suite for org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matching + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ExperimentSyncTest.class, + MatchAndSyncTest.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/ExperimentSyncTest.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/ExperimentSyncTest.java new file mode 100644 index 0000000000..1e7b2447b7 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/ExperimentSyncTest.java @@ -0,0 +1,112 @@ +/******************************************************************************* + * Copyright (c) 2013 É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 implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assume.assumeTrue; + +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; +import org.eclipse.linuxtools.tmf.core.synchronization.ITmfTimestampTransform; +import org.eclipse.linuxtools.tmf.core.synchronization.SynchronizationAlgorithm; +import org.eclipse.linuxtools.tmf.core.synchronization.TimestampTransformFactory; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.core.trace.TmfExperiment; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests for experiment syncing + * + * @author Geneviève Bastien + */ +@SuppressWarnings("nls") +public class ExperimentSyncTest { + + private static final String EXPERIMENT = "MyExperiment"; + private static int BLOCK_SIZE = 1000; + + /** + * Initialize some data + */ + @BeforeClass + public static void setUp() { + TmfEventMatching.registerMatchObject(new TcpEventMatching()); + TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); + } + + /** + * Testing experiment synchronization + */ + @Test + public void testExperimentSync() { + assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); + assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); + try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); + CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { + + ITmfTrace[] traces = { trace1, trace2 }; + TmfExperiment experiment = new TmfExperiment(traces[0].getEventType(), EXPERIMENT, traces, BLOCK_SIZE); + + SynchronizationAlgorithm syncAlgo = experiment.synchronizeTraces(true); + + ITmfTimestampTransform tt1 = syncAlgo.getTimestampTransform(trace1); + ITmfTimestampTransform tt2 = syncAlgo.getTimestampTransform(trace2); + + trace1.setTimestampTransform(tt1); + trace2.setTimestampTransform(tt2); + + assertEquals("TmfTimestampLinear [ slope = 0.9999413783703139011056845831168394, offset = 79796507913179.33347660124688298171 ]", tt1.toString()); + assertEquals(TimestampTransformFactory.getDefaultTransform(), tt2); + + assertEquals(syncAlgo.getTimestampTransform(trace1.getHostId()), trace1.getTimestampTransform()); + assertEquals(syncAlgo.getTimestampTransform(trace2.getHostId()), trace2.getTimestampTransform()); + + } + } + + /** + * Testing synchronization with 3 traces, one of which synchronizes with + * both other + */ + @Test + public void testDjangoExperimentSync() { + assumeTrue(CtfTmfTestTrace.DJANGO_CLIENT.exists()); + assumeTrue(CtfTmfTestTrace.DJANGO_DB.exists()); + assumeTrue(CtfTmfTestTrace.DJANGO_HTTPD.exists()); + try (CtfTmfTrace trace1 = CtfTmfTestTrace.DJANGO_CLIENT.getTrace(); + CtfTmfTrace trace2 = CtfTmfTestTrace.DJANGO_DB.getTrace(); + CtfTmfTrace trace3 = CtfTmfTestTrace.DJANGO_HTTPD.getTrace();) { + ITmfTrace[] traces = { trace1, trace2, trace3 }; + TmfExperiment experiment = new TmfExperiment(traces[0].getEventType(), EXPERIMENT, traces, BLOCK_SIZE); + + SynchronizationAlgorithm syncAlgo = experiment.synchronizeTraces(true); + + ITmfTimestampTransform tt1 = syncAlgo.getTimestampTransform(trace1); + ITmfTimestampTransform tt2 = syncAlgo.getTimestampTransform(trace2); + ITmfTimestampTransform tt3 = syncAlgo.getTimestampTransform(trace3); + + trace1.setTimestampTransform(tt1); + trace2.setTimestampTransform(tt2); + trace3.setTimestampTransform(tt3); + + assertEquals(TimestampTransformFactory.getDefaultTransform(), tt1); + assertEquals("TmfTimestampLinear [ slope = 0.9999996313017589597204633828681240, offset = 498490309972.0038068817738527724192 ]", tt2.toString()); + assertEquals("TmfTimestampLinear [ slope = 1.000000119014882262265342419815932, offset = -166652893534.6189900382736187431134 ]", tt3.toString()); + + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/MatchAndSyncTest.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/MatchAndSyncTest.java new file mode 100644 index 0000000000..e8e7b514ab --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/event/matchandsync/MatchAndSyncTest.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2013 É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 implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matchandsync; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfNetworkEventMatching; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.junit.Test; + +/** + * Tests for {@link TcpEventMatching} + * + * @author Geneviève Bastien + */ +@SuppressWarnings("nls") +public class MatchAndSyncTest { + + /** + * Testing the packet matching + */ + @Test + public void testMatching() { + final String cr = System.getProperty("line.separator"); + assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); + assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); + try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); + CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { + + List tracearr = new LinkedList<>(); + tracearr.add(trace1); + tracearr.add(trace2); + + TmfEventMatching.registerMatchObject(new TcpEventMatching()); + TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); + + TmfNetworkEventMatching twoTraceMatch = new TmfNetworkEventMatching(tracearr); + assertTrue(twoTraceMatch.matchEvents()); + + String stats = twoTraceMatch.toString(); + assertEquals("TmfEventMatches [ Number of matches found: 46 ]" + + "Trace 0:" + cr + + " 3 unmatched incoming events" + cr + + " 2 unmatched outgoing events" + cr + + "Trace 1:" + cr + + " 2 unmatched incoming events" + cr + + " 1 unmatched outgoing events" + cr, stats); + + } + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/GenerateTestValues.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/GenerateTestValues.java new file mode 100644 index 0000000000..dd85c0e477 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/GenerateTestValues.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * 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: + * Alexandre Montplaisir - Initial API and implementation + ******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; + +import java.io.File; +import java.io.FileWriter; +import java.io.PrintWriter; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; + +/** + * Small program to regenerate the values used in "TestValues.java" from the + * current LTTng-kernel state provider. + * + * It will write its output the a file called 'TestValues.java' in your + * temporary files directory. + * + * @author Alexandre Montplaisir + */ +public class GenerateTestValues { + + private static CtfTmfTestTrace testTrace = CtfTmfTestTrace.TRACE2; + private static final long targetTimestamp = 18670067372290L + 1331649577946812237L; + private static final String INDENT = " "; + + /** + * Run the program + * + * @param args + * Command-line arguments, unused. + * @throws Exception + * I'm messing with Exception. Come at me bro! + */ + public static void main(String[] args) throws Exception { + if (!testTrace.exists()) { + System.err.println("Trace files not present."); + return; + } + + /* Prepare the files */ + File logFile = File.createTempFile("TestValues", ".java"); + try (final CtfTmfTrace trace = testTrace.getTrace(); + PrintWriter writer = new PrintWriter(new FileWriter(logFile), true); + /* Build and query the state system */ + TmfStateSystemAnalysisModule module = new TmfStateSystemAnalysisModule() { + @Override + protected ITmfStateProvider createStateProvider() { + return new LttngKernelStateProvider(trace); + } + + @Override + protected String getSsFileName() { + return "test-values"; + } + };) { + module.setTrace(trace); + module.setId("test-values"); + module.schedule(); + module.waitForCompletion(); + ITmfStateSystem ssq = module.getStateSystem(); + if (ssq == null) { + throw new IllegalStateException(); + } + + List fullState = ssq.queryFullState(targetTimestamp); + + /* Start printing the java file's contents */ + writer.println("interface TestValues {"); + writer.println(); + writer.println(INDENT + "static final int size = " + fullState.size() + ";"); + writer.println(); + + /* Print the array contents */ + writer.println(INDENT + "static final long[] startTimes = {"); + for (ITmfStateInterval interval : fullState) { + writer.println(INDENT + INDENT + String.valueOf(interval.getStartTime()) + "L,"); + } + writer.println(INDENT + "};"); + writer.println(); + + writer.println(INDENT + "static final long[] endTimes = {"); + for (ITmfStateInterval interval : fullState) { + writer.println(INDENT + INDENT + String.valueOf(interval.getEndTime()) + "L,"); + } + writer.println(INDENT + "};"); + writer.println(); + + writer.println(INDENT + "static final ITmfStateValue[] values = {"); + for (ITmfStateInterval interval : fullState) { + ITmfStateValue val = interval.getStateValue(); + writer.print(INDENT + INDENT); + + switch (val.getType()) { + case NULL: + writer.println("TmfStateValue.nullValue(),"); + break; + case INTEGER: + writer.println("TmfStateValue.newValueInt(" + val.unboxInt() + "),"); + break; + case LONG: + writer.println("TmfStateValue.newValueLong(" + val.unboxLong() + "),"); + break; + case DOUBLE: + writer.println("TmfStateValue.newValueDouble(" + val.unboxDouble() + "),"); + break; + case STRING: + writer.println("TmfStateValue.newValueString(\"" + val.unboxStr() + "\"),"); + break; + default: + writer.println(val.toString()); + break; + } + } + writer.println(INDENT + "};"); + + writer.println("}"); + writer.println(); + + } + System.exit(0); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/LttngKernelStateProviderTest.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/LttngKernelStateProviderTest.java new file mode 100644 index 0000000000..e6e8074ed0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/LttngKernelStateProviderTest.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2012, 2013 Ericsson + * Copyright (c) 2010, 2011 École Polytechnique de Montréal + * Copyright (c) 2010, 2011 Alexandre Montplaisir + * + * 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.linuxtools.lttng2.kernel.core.tests.stateprovider; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assume.assumeTrue; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests for the {@link LttngKernelStateProvider} + * + * @author Alexandre Montplaisir + */ +public class LttngKernelStateProviderTest { + + private static final CtfTmfTestTrace testTrace = CtfTmfTestTrace.TRACE2; + + private static ITmfStateProvider input; + + /** + * Set-up. + */ + @BeforeClass + public static void initialize() { + assumeTrue(testTrace.exists()); + input = new LttngKernelStateProvider(testTrace.getTrace()); + + } + + /** + * Test loading the state provider. + */ + @Test + public void testOpening() { + long testStartTime; + testStartTime = input.getStartTime(); + assertEquals(testStartTime, StateSystemTest.startTime); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java new file mode 100644 index 0000000000..5e33dcdbd6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * 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: + * Alexandre Montplaisir - Initial API and implementation + * Bernd Hufmann - Use state system analysis module instead of factory + ******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.junit.After; +import org.junit.Test; + +/** + * State system tests using a partial history. + * + * @author Alexandre Montplaisir + */ +public class PartialStateSystemTest extends StateSystemTest { + + private static final @NonNull String TEST_FILE_NAME = "test-partial"; + + private File stateFile; + private TestLttngKernelAnalysisModule module; + + @Override + protected ITmfStateSystem initialize() { + stateFile = new File(TmfTraceManager.getSupplementaryFileDir(testTrace.getTrace()) + TEST_FILE_NAME); + if (stateFile.exists()) { + stateFile.delete(); + } + + module = new TestLttngKernelAnalysisModule(TEST_FILE_NAME); + try { + module.setTrace(testTrace.getTrace()); + } catch (TmfAnalysisException e) { + fail(); + } + module.schedule(); + assertTrue(module.waitForCompletion()); + return module.getStateSystem(); + } + + /** + * Class clean-up + */ + @After + public void cleanup() { + if (module != null) { + module.close(); + } + if (stateFile != null) { + stateFile.delete(); + } + } + + /** + * Partial histories cannot get the intervals' end times. The fake value that + * is returned is equal to the query's timestamp. So override this here + * so that {@link #testFullQueryThorough} keeps working. + */ + @Override + protected long getEndTimes(int idx) { + return interestingTimestamp1; + } + + // ------------------------------------------------------------------------ + // Skip tests using single-queries (unsupported in partial history) + // ------------------------------------------------------------------------ + + @Override + @Test(expected = UnsupportedOperationException.class) + public void testSingleQuery1() { + super.testSingleQuery1(); + } + + @Override + @Test(expected = UnsupportedOperationException.class) + public void testRangeQuery1() { + super.testRangeQuery1(); + } + + @Override + @Test(expected = UnsupportedOperationException.class) + public void testRangeQuery2() { + super.testRangeQuery2(); + } + + @Override + @Test(expected = UnsupportedOperationException.class) + public void testRangeQuery3() { + super.testRangeQuery3(); + } + + @Override + @Test(expected = UnsupportedOperationException.class) + public void testSingleQueryInvalidTime1() throws TimeRangeException { + super.testSingleQueryInvalidTime1(); + } + + @Override + @Test(expected = UnsupportedOperationException.class) + public void testSingleQueryInvalidTime2() throws TimeRangeException { + super.testSingleQueryInvalidTime2(); + } + + @Override + @Test(expected = UnsupportedOperationException.class) + public void testRangeQueryInvalidTime1() throws TimeRangeException { + super.testRangeQueryInvalidTime1(); + } + + @Override + @Test(expected = UnsupportedOperationException.class) + public void testRangeQueryInvalidTime2() throws TimeRangeException { + super.testRangeQueryInvalidTime2(); + } + + @NonNullByDefault + private static class TestLttngKernelAnalysisModule extends TmfStateSystemAnalysisModule { + + private final String htFileName; + + /** + * Constructor adding the views to the analysis + * @param htFileName + * The History File Name + */ + public TestLttngKernelAnalysisModule(String htFileName) { + super(); + this.htFileName = htFileName; + } + + @Override + public void setTrace(@Nullable ITmfTrace trace) throws TmfAnalysisException { + if (!(trace instanceof CtfTmfTrace)) { + throw new IllegalStateException("TestLttngKernelAnalysisModule: trace should be of type CtfTmfTrace"); //$NON-NLS-1$ + } + super.setTrace(trace); + } + + @Override + protected ITmfStateProvider createStateProvider() { + return new LttngKernelStateProvider(getTrace()); + } + + @Override + protected StateSystemBackendType getBackendType() { + return StateSystemBackendType.PARTIAL; + } + + @Override + protected String getSsFileName() { + return htFileName; + } + + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java new file mode 100644 index 0000000000..a8a0f62db7 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java @@ -0,0 +1,180 @@ +/******************************************************************************* + * Copyright (c) 2012, 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 + * Bernd Hufmann - Use state system analysis module instead of factory + ******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.junit.After; +import org.junit.Test; + +/** + * State system tests using a full history back-end and the LTTng kernel state + * input. + * + * @author Alexandre Montplaisir + */ +public class StateSystemFullHistoryTest extends StateSystemTest { + + private static final @NonNull String TEST_FILE_NAME = "test.ht"; + private static final @NonNull String BENCHMARK_FILE_NAME = "test.benchmark.ht"; + + private File stateFile; + private File stateFileBenchmark; + private TestLttngKernelAnalysisModule module; + + @Override + protected ITmfStateSystem initialize() { + stateFile = createStateFile(TEST_FILE_NAME); + stateFileBenchmark = createStateFile(BENCHMARK_FILE_NAME); + + module = new TestLttngKernelAnalysisModule(TEST_FILE_NAME); + try { + module.setTrace(testTrace.getTrace()); + } catch (TmfAnalysisException e) { + fail(); + } + module.schedule(); + assertTrue(module.waitForCompletion()); + return module.getStateSystem(); + } + + /** + * Clean-up + */ + @After + public void cleanup() { + if (module != null) { + module.close(); + } + if (stateFile != null) { + stateFile.delete(); + } + if (stateFileBenchmark != null) { + stateFileBenchmark.delete(); + } + } + + // ------------------------------------------------------------------------ + // Tests specific to a full-history + // ------------------------------------------------------------------------ + + /** + * Rebuild independently so we can benchmark it. Too bad JUnit doesn't allow + * us to @Test the @BeforeClass... + */ + @Test + public void testBuild() { + try (TestLttngKernelAnalysisModule module2 = + new TestLttngKernelAnalysisModule(BENCHMARK_FILE_NAME);) { + try { + module2.setTrace(testTrace.getTrace()); + } catch (TmfAnalysisException e) { + fail(); + } + module2.schedule(); + assertTrue(module2.waitForCompletion()); + ITmfStateSystem ssb2 = module2.getStateSystem(); + + assertNotNull(ssb2); + assertEquals(startTime, ssb2.getStartTime()); + assertEquals(endTime, ssb2.getCurrentEndTime()); + } + } + + /** + * Test re-opening the existing file. + */ + @Test + public void testOpenExistingStateFile() { + /* 'newStateFile' should have already been created */ + try (TestLttngKernelAnalysisModule module2 = new TestLttngKernelAnalysisModule(TEST_FILE_NAME);) { + try { + module2.setTrace(testTrace.getTrace()); + } catch (TmfAnalysisException e) { + fail(); + } + module2.schedule(); + assertTrue(module2.waitForCompletion()); + ITmfStateSystem ssb2 = module2.getStateSystem(); + + assertNotNull(ssb2); + assertEquals(startTime, ssb2.getStartTime()); + assertEquals(endTime, ssb2.getCurrentEndTime()); + } + } + + @NonNullByDefault + private static class TestLttngKernelAnalysisModule extends TmfStateSystemAnalysisModule { + + private final String htFileName; + + /** + * Constructor adding the views to the analysis + * @param htFileName + * The History File Name + */ + public TestLttngKernelAnalysisModule(String htFileName) { + super(); + this.htFileName = htFileName; + } + + @Override + public void setTrace(@Nullable ITmfTrace trace) throws TmfAnalysisException { + if (!(trace instanceof CtfTmfTrace)) { + throw new IllegalStateException("TestLttngKernelAnalysisModule: trace should be of type CtfTmfTrace"); //$NON-NLS-1$ + } + super.setTrace(trace); + } + + @Override + protected ITmfStateProvider createStateProvider() { + return new LttngKernelStateProvider(getTrace()); + } + + @Override + protected StateSystemBackendType getBackendType() { + return StateSystemBackendType.FULL; + } + + @Override + protected String getSsFileName() { + return htFileName; + } + } + + private static File createStateFile(String name) { + File file = new File(TmfTraceManager.getSupplementaryFileDir(testTrace.getTrace()) + name); + if (file.exists()) { + file.delete(); + } + return file; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java new file mode 100644 index 0000000000..80cec1cbd7 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java @@ -0,0 +1,87 @@ +/******************************************************************************* + * 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: + * Alexandre Montplaisir - Initial API and implementation + * Bernd Hufmann - Use state system analysis module instead of factory + ******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.junit.After; + +/** + * State system tests using the in-memory back-end. + * + * @author Alexandre Montplaisir + */ +public class StateSystemInMemoryTest extends StateSystemTest { + + private TestLttngKernelAnalysisModule module; + + @Override + protected ITmfStateSystem initialize() { + module = new TestLttngKernelAnalysisModule(); + try { + module.setTrace(testTrace.getTrace()); + } catch (TmfAnalysisException e) { + fail(); + } + module.schedule(); + assertTrue(module.waitForCompletion()); + return module.getStateSystem(); + } + + /** + * Class cleanup + */ + @After + public void cleanup() { + if (module != null) { + module.close(); + } + } + + private static class TestLttngKernelAnalysisModule extends TmfStateSystemAnalysisModule { + + /** + * Constructor adding the views to the analysis + */ + public TestLttngKernelAnalysisModule() { + super(); + } + + @Override + public void setTrace(ITmfTrace trace) throws TmfAnalysisException { + if (!(trace instanceof CtfTmfTrace)) { + throw new IllegalStateException("TestLttngKernelAnalysisModule: trace should be of type CtfTmfTrace"); //$NON-NLS-1$ + } + super.setTrace(trace); + } + + @Override + protected ITmfStateProvider createStateProvider() { + return new LttngKernelStateProvider(getTrace()); + } + + @Override + protected StateSystemBackendType getBackendType() { + return StateSystemBackendType.INMEM; + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java new file mode 100644 index 0000000000..32e1ed23f7 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java @@ -0,0 +1,431 @@ +/******************************************************************************* + * Copyright (c) 2012, 2014 Ericsson + * Copyright (c) 2010, 2011 École Polytechnique de Montréal + * Copyright (c) 2010, 2011 Alexandre Montplaisir + * + * 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.linuxtools.lttng2.kernel.core.tests.stateprovider; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.junit.Assume.assumeTrue; + +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestRule; +import org.junit.rules.Timeout; + +/** + * Base unit tests for the StateHistorySystem. Extension can be made to test + * different state back-end types or configurations. + * + * @author Alexandre Montplaisir + */ +@SuppressWarnings("javadoc") +public abstract class StateSystemTest { + + /** Timeout the tests after 2 minutes */ + @Rule + public TestRule timeoutRule = new Timeout(120000); + + /** Test trace used for these tests */ + protected static final CtfTmfTestTrace testTrace = CtfTmfTestTrace.TRACE2; + + /** Expected start time of the test trace/state history */ + protected static final long startTime = 1331668247314038062L; + + /** Expected end time of the state history built from the test trace */ + protected static final long endTime = 1331668259054285979L; + + /** Offset in the trace + start time of the trace */ + protected static final long interestingTimestamp1 = 18670067372290L + 1331649577946812237L; + + /** Number of nanoseconds in one second */ + private static final long NANOSECS_PER_SEC = 1000000000L; + + private ITmfStateSystem fixture; + + + /** + * Class set-up + */ + @Before + public void setUp() { + assumeTrue(testTrace.exists()); + fixture = this.initialize(); + assertNotNull(fixture); + } + + protected abstract ITmfStateSystem initialize(); + + @After + public void tearDown() { + if (fixture != null) { + fixture.dispose(); + } + fixture = null; + } + + @Test + public void testFullQuery1() { + List list; + ITmfStateInterval interval; + int quark, valueInt; + String valueStr; + + try { + list = fixture.queryFullState(interestingTimestamp1); + + quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + interval = list.get(quark); + valueInt = interval.getStateValue().unboxInt(); + assertEquals(1397, valueInt); + + quark = fixture.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.EXEC_NAME); + interval = list.get(quark); + valueStr = interval.getStateValue().unboxStr(); + assertEquals("gdbus", valueStr); + + quark = fixture.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.SYSTEM_CALL); + interval = list.get(quark); + valueStr = interval.getStateValue().unboxStr(); + assertTrue(valueStr.equals("sys_poll")); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + @Test + public void testSingleQuery1() { + long timestamp = interestingTimestamp1; + int quark; + ITmfStateInterval interval; + String valueStr; + + try { + quark = fixture.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.EXEC_NAME); + interval = fixture.querySingleState(timestamp, quark); + valueStr = interval.getStateValue().unboxStr(); + assertEquals("gdbus", valueStr); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + /** + * Test a range query (with no resolution parameter, so all intervals) + */ + @Test + public void testRangeQuery1() { + long time1 = interestingTimestamp1; + long time2 = time1 + 1L * NANOSECS_PER_SEC; + int quark; + List intervals; + + try { + quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + intervals = fixture.queryHistoryRange(quark, time1, time2); + assertEquals(487, intervals.size()); /* Number of context switches! */ + assertEquals(1685, intervals.get(100).getStateValue().unboxInt()); + assertEquals(1331668248427681372L, intervals.get(205).getEndTime()); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + /** + * Range query, but with a t2 far off the end of the trace. The result + * should still be valid. + */ + @Test + public void testRangeQuery2() { + List intervals; + + try { + int quark = fixture.getQuarkAbsolute(Attributes.RESOURCES, Attributes.IRQS, "1"); + long ts1 = fixture.getStartTime(); /* start of the trace */ + long ts2 = startTime + 20L * NANOSECS_PER_SEC; /* invalid, but ignored */ + + intervals = fixture.queryHistoryRange(quark, ts1, ts2); + + /* Activity of IRQ 1 over the whole trace */ + assertEquals(65, intervals.size()); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + /** + * Test a range query with a resolution + */ + @Test + public void testRangeQuery3() { + long time1 = interestingTimestamp1; + long time2 = time1 + 1L * NANOSECS_PER_SEC; + long resolution = 1000000; /* One query every millisecond */ + int quark; + List intervals; + + try { + quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + intervals = fixture.queryHistoryRange(quark, time1, time2, resolution, null); + assertEquals(126, intervals.size()); /* Number of context switches! */ + assertEquals(1452, intervals.get(50).getStateValue().unboxInt()); + assertEquals(1331668248815698779L, intervals.get(100).getEndTime()); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + /** + * Ask for a time range outside of the trace's range + */ + @Test(expected = TimeRangeException.class) + public void testFullQueryInvalidTime1() throws TimeRangeException, + StateSystemDisposedException { + long ts = startTime + 20L * NANOSECS_PER_SEC; + fixture.queryFullState(ts); + } + + @Test(expected = TimeRangeException.class) + public void testFullQueryInvalidTime2() throws TimeRangeException, + StateSystemDisposedException { + long ts = startTime - 20L * NANOSECS_PER_SEC; + fixture.queryFullState(ts); + } + + @Test(expected = TimeRangeException.class) + public void testSingleQueryInvalidTime1() throws TimeRangeException { + try { + int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + long ts = startTime + 20L * NANOSECS_PER_SEC; + fixture.querySingleState(ts, quark); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + @Test(expected = TimeRangeException.class) + public void testSingleQueryInvalidTime2() throws TimeRangeException { + try { + int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + long ts = startTime - 20L * NANOSECS_PER_SEC; + fixture.querySingleState(ts, quark); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + @Test(expected = TimeRangeException.class) + public void testRangeQueryInvalidTime1() throws TimeRangeException { + try { + int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + long ts1 = startTime - 20L * NANOSECS_PER_SEC; /* invalid */ + long ts2 = startTime + 1L * NANOSECS_PER_SEC; /* valid */ + fixture.queryHistoryRange(quark, ts1, ts2); + + } catch (AttributeNotFoundException e) { + fail(); + } catch (StateSystemDisposedException e) { + fail(); + } + } + + @Test(expected = TimeRangeException.class) + public void testRangeQueryInvalidTime2() throws TimeRangeException { + try { + int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + long ts1 = startTime - 1L * NANOSECS_PER_SEC; /* invalid */ + long ts2 = startTime + 20L * NANOSECS_PER_SEC; /* invalid */ + fixture.queryHistoryRange(quark, ts1, ts2); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + /** + * Ask for a non-existing attribute + * + * @throws AttributeNotFoundException + */ + @Test(expected = AttributeNotFoundException.class) + public void testQueryInvalidAttribute() throws AttributeNotFoundException { + fixture.getQuarkAbsolute("There", "is", "no", "cow", "level"); + } + + /** + * Query but with the wrong State Value type + */ + @Test(expected = StateValueTypeException.class) + public void testQueryInvalidValuetype1() throws StateValueTypeException { + List list; + ITmfStateInterval interval; + int quark; + + try { + list = fixture.queryFullState(interestingTimestamp1); + quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + interval = list.get(quark); + + /* This is supposed to be an int value */ + interval.getStateValue().unboxStr(); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + @Test(expected = StateValueTypeException.class) + public void testQueryInvalidValuetype2() throws StateValueTypeException { + List list; + ITmfStateInterval interval; + int quark; + + try { + list = fixture.queryFullState(interestingTimestamp1); + quark = fixture.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.EXEC_NAME); + interval = list.get(quark); + + /* This is supposed to be a String value */ + interval.getStateValue().unboxInt(); + + } catch (AttributeNotFoundException | StateSystemDisposedException e) { + fail(); + } + } + + @Test + public void testFullAttributeName() { + try { + int quark = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + String name = fixture.getFullAttributePath(quark); + assertEquals(name, "CPUs/0/Current_thread"); + + } catch (AttributeNotFoundException e) { + fail(); + } + } + + @Test + public void testGetQuarks_begin() { + List list = fixture.getQuarks("*", "1577", Attributes.EXEC_NAME); + + assertEquals(1, list.size()); + } + + @Test + public void testGetQuarks_middle() { + List list = fixture.getQuarks(Attributes.THREADS, "*", Attributes.EXEC_NAME); + + /* Number of different kernel threads in the trace */ + assertEquals(168, list.size()); + } + + @Test + public void testGetQuarks_end() { + List list = fixture.getQuarks(Attributes.THREADS, "1577", "*"); + + /* There should be 4 sub-attributes for each Thread node */ + assertEquals(4, list.size()); + } + + // ------------------------------------------------------------------------ + // Tests verifying the *complete* results of a full queries + // ------------------------------------------------------------------------ + + protected long getStartTimes(int idx) { + return TestValues.startTimes[idx]; + } + + protected long getEndTimes(int idx) { + return TestValues.endTimes[idx]; + } + + protected ITmfStateValue getStateValues(int idx) { + return TestValues.values[idx]; + } + + @Test + public void testFullQueryThorough() { + try { + List state = fixture.queryFullState(interestingTimestamp1); + assertEquals(TestValues.size, state.size()); + + for (int i = 0; i < state.size(); i++) { + /* Test each component of the intervals */ + assertEquals(getStartTimes(i), state.get(i).getStartTime()); + assertEquals(getEndTimes(i), state.get(i).getEndTime()); + assertEquals(i, state.get(i).getAttribute()); + assertEquals(getStateValues(i), state.get(i).getStateValue()); + } + + } catch (StateSystemDisposedException e) { + fail(); + } + } + + @Test + public void testFirstIntervalIsConsidered() { + try { + List list = fixture.queryFullState(1331668248014135800L); + ITmfStateInterval interval = list.get(233); + assertEquals(1331668247516664825L, interval.getStartTime()); + + int valueInt = interval.getStateValue().unboxInt(); + assertEquals(1, valueInt); + + } catch (StateSystemDisposedException e) { + fail(); + } + } + + @Test + public void testParentAttribute() { + String[] path = { "CPUs/0/Current_thread", + "CPUs/0", + "CPUs" }; + try { + int q = fixture.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD); + for (int i = 0; i < path.length; i++) { + String name = fixture.getFullAttributePath(q); + assertEquals(path[i], name); + q = fixture.getParentAttributeQuark(q); + } + assertEquals(-1, q); + q = fixture.getParentAttributeQuark(q); + assertEquals(-1, q); + } catch (AttributeNotFoundException e) { + fail(); + } + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java new file mode 100644 index 0000000000..a6c1d58926 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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 implementation + ******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Runner for the LTTng kernel state system tests. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + LttngKernelStateProviderTest.class, + PartialStateSystemTest.class, + StateSystemFullHistoryTest.class, + StateSystemInMemoryTest.class +}) +public class TestAll { + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestValues.java b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestValues.java new file mode 100644 index 0000000000..97d469f433 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestValues.java @@ -0,0 +1,2625 @@ +/******************************************************************************* + * Copyright (c) 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.linuxtools.lttng2.kernel.core.tests.stateprovider; + +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.statesystem.core.statevalue.TmfStateValue; + +/** + * Expected return values of querying test trace #1's state system at time + * "18670067372290L + 1331649577946812237L" + * + * @author Alexandre Montplaisir + */ +interface TestValues { + + static final int size = 863; + + static final long[] startTimes = { + 1331668247314038062L, + 1331668247314038062L, + 1331668248014145796L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247399757985L, + 1331668247316320929L, + 1331668247316334243L, + 1331668247314046266L, + 1331668247314038062L, + 1331668248014183954L, + 1331668247314038062L, + 1331668247327098502L, + 1331668247327098502L, + 1331668247327098502L, + 1331668247327098502L, + 1331668247314038062L, + 1331668247415001807L, + 1331668247415001807L, + 1331668247415001807L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668248013353414L, + 1331668248004935409L, + 1331668247314038062L, + 1331668247314038062L, + 1331668248014184526L, + 1331668248014130616L, + 1331668247314038062L, + 1331668247314038062L, + 1331668248011125682L, + 1331668247314038062L, + 1331668247931793142L, + 1331668247959041965L, + 1331668248011129576L, + 1331668247314038062L, + 1331668247335106720L, + 1331668247335106720L, + 1331668247335106720L, + 1331668247335106720L, + 1331668247931782426L, + 1331668247315274351L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247335112802L, + 1331668247335112802L, + 1331668247335112802L, + 1331668247335112802L, + 1331668247314038062L, + 1331668248004705322L, + 1331668247314038062L, + 1331668248004935409L, + 1331668248004925240L, + 1331668247316553071L, + 1331668247314038062L, + 1331668247399743968L, + 1331668247316925661L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247999256178L, + 1331668247999250697L, + 1331668247318567561L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247999336085L, + 1331668247999327778L, + 1331668247318631139L, + 1331668247314038062L, + 1331668247960265258L, + 1331668247314038062L, + 1331668247903884233L, + 1331668247903869067L, + 1331668247328403934L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247908495390L, + 1331668247908464125L, + 1331668247328921944L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247903840082L, + 1331668247903831313L, + 1331668247329404733L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247960291263L, + 1331668247314038062L, + 1331668247330548245L, + 1331668247314038062L, + 1331668247340039213L, + 1331668247340083580L, + 1331668247966976915L, + 1331668247314038062L, + 1331668248004729173L, + 1331668247314038062L, + 1331668247371137735L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247387196023L, + 1331668247387191465L, + 1331668247376420842L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247400231496L, + 1331668247400218303L, + 1331668247378430187L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247751186217L, + 1331668247314038062L, + 1331668247387136191L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247415047817L, + 1331668247415047817L, + 1331668247415047817L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247400095883L, + 1331668247400085049L, + 1331668247399991225L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247401441000L, + 1331668247401428073L, + 1331668247400779449L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247410754305L, + 1331668247314038062L, + 1331668247519727372L, + 1331668247314038062L, + 1331668247412887695L, + 1331668247314038062L, + 1331668247413704524L, + 1331668247412877246L, + 1331668247410583861L, + 1331668247314038062L, + 1331668247410735104L, + 1331668247410594291L, + 1331668247314038062L, + 1331668247413682702L, + 1331668247410844189L, + 1331668247314038062L, + 1331668247519712481L, + 1331668247411099759L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247924029486L, + 1331668247924012402L, + 1331668247412302666L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247924105876L, + 1331668247924098044L, + 1331668247417574343L, + 1331668247314038062L, + 1331668247314038062L, + 1331668248014184526L, + 1331668248014130616L, + 1331668247417635948L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247928627023L, + 1331668247928621067L, + 1331668247417978805L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247928556625L, + 1331668247928529840L, + 1331668247418470511L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247930341625L, + 1331668247314038062L, + 1331668248014184526L, + 1331668248013793850L, + 1331668247419578477L, + 1331668247314038062L, + 1331668247930328175L, + 1331668247419655652L, + 1331668247314038062L, + 1331668247314038062L, + 1331668248013753736L, + 1331668248013749389L, + 1331668247420382626L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247930579872L, + 1331668247930574368L, + 1331668247420451876L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247926378321L, + 1331668247926367737L, + 1331668247423543945L, + 1331668247314038062L, + 1331668247619316825L, + 1331668247619491008L, + 1331668247314038062L, + 1331668247619505885L, + 1331668247619495072L, + 1331668247434248026L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247434551326L, + 1331668247434546203L, + 1331668247434365352L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247908325947L, + 1331668247908319810L, + 1331668247467380509L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247908677700L, + 1331668247908640244L, + 1331668247467447781L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247869556425L, + 1331668247869544380L, + 1331668247503177108L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247504321893L, + 1331668247504319470L, + 1331668247503423094L, + 1331668247314038062L, + 1331668247314038062L, + 1331668248014183954L, + 1331668248014183954L, + 1331668247512172527L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247539381562L, + 1331668247539369787L, + 1331668247539325848L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247735177820L, + 1331668247735170303L, + 1331668247735128110L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247735168206L, + 1331668247735161964L, + 1331668247735152717L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247775218227L, + 1331668247314038062L, + 1331668247775231079L, + 1331668247775205377L, + 1331668247775191569L, + 1331668247314038062L, + 1331668247775223776L, + 1331668247775218227L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247869483379L, + 1331668247869477795L, + 1331668247869457807L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247941667986L, + 1331668247941650415L, + 1331668247941620894L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + 1331668247314038062L, + }; + + static final long[] endTimes = { + 1331668259054285979L, + 1331668259054285979L, + 1331668248014620024L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054130388L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248014185078L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248014620024L, + 1331668248014620024L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248014548923L, + 1331668248014188534L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248015040151L, + 1331668259054285979L, + 1331668248482983146L, + 1331668248015041609L, + 1331668248015176320L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248483009726L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248015959980L, + 1331668259054285979L, + 1331668248016172023L, + 1331668248016194935L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054136697L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248016556933L, + 1331668248016592456L, + 1331668252511012367L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248016623209L, + 1331668248016645047L, + 1331668252843104826L, + 1331668259054285979L, + 1331668248486545657L, + 1331668259054285979L, + 1331668248502954816L, + 1331668248503000162L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248020364249L, + 1331668248020419523L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248020866943L, + 1331668248020888352L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248531200073L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668257323835062L, + 1331668257323879563L, + 1331668248021867385L, + 1331668259054285979L, + 1331668248175307354L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259051873438L, + 1331668259051879701L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248751061201L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259051838247L, + 1331668259051846351L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668257325265220L, + 1331668257325277639L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668250005943125L, + 1331668259054285979L, + 1331668248014565260L, + 1331668259054285979L, + 1331668250006219013L, + 1331668259054285979L, + 1331668250004649129L, + 1331668250006228246L, + 1331668259054285979L, + 1331668259054285979L, + 1331668250005962644L, + 1331668259054285979L, + 1331668259054285979L, + 1331668250004668081L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248014624125L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248414826115L, + 1331668248414875444L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248420327828L, + 1331668248420342919L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248015353903L, + 1331668248015428919L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248420617453L, + 1331668248420709272L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248421112139L, + 1331668248421137268L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248421291701L, + 1331668259054285979L, + 1331668248014188534L, + 1331668248014188534L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248421940554L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248014548923L, + 1331668248014550770L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248422509298L, + 1331668248422523601L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248424325503L, + 1331668248424394073L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248140683324L, + 1331668248140686546L, + 1331668259054285979L, + 1331668248140727269L, + 1331668248140780012L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251031789570L, + 1331668251031812282L, + 1331668252047037657L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248269586770L, + 1331668248269613258L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248141167328L, + 1331668248141400164L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248141004006L, + 1331668248141028631L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248141324868L, + 1331668248141345677L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248014185078L, + 1331668248014185078L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248539549580L, + 1331668248539579511L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668255234884605L, + 1331668255234905622L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668255234936617L, + 1331668255234941684L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252778982101L, + 1331668259054285979L, + 1331668252779007563L, + 1331668252781320133L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252781341690L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248869653287L, + 1331668248869679933L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248941858743L, + 1331668248941885421L, + 1331668252782929207L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248207116451L, + 1331668248207177650L, + 1331668248207163589L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248207165629L, + 1331668248207212201L, + 1331668248207197204L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248763171129L, + 1331668259054285979L, + 1331668248763179780L, + 1331668259054285979L, + 1331668259054285979L, + 1331668248895005379L, + 1331668248895062414L, + 1331668248895035146L, + 1331668259054285979L, + 1331668259054285979L, + 1331668249000328909L, + 1331668249000373092L, + 1331668249000350716L, + 1331668259054285979L, + 1331668249548101920L, + 1331668259054285979L, + 1331668249947171998L, + 1331668249947269897L, + 1331668249947249018L, + 1331668259054285979L, + 1331668259054285979L, + 1331668249951033184L, + 1331668249951077605L, + 1331668249951058138L, + 1331668259054285979L, + 1331668259054285979L, + 1331668249959079406L, + 1331668259054285979L, + 1331668249959100633L, + 1331668259054285979L, + 1331668259054285979L, + 1331668249970937981L, + 1331668259054285979L, + 1331668249970963407L, + 1331668259054285979L, + 1331668259054285979L, + 1331668250007423753L, + 1331668250007449251L, + 1331668250007428034L, + 1331668259054285979L, + 1331668259054285979L, + 1331668250231124169L, + 1331668250231169946L, + 1331668250231148973L, + 1331668259054285979L, + 1331668259054285979L, + 1331668250326525622L, + 1331668250329519305L, + 1331668250329507458L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251063191270L, + 1331668251063256143L, + 1331668251063222335L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251065026369L, + 1331668251065048462L, + 1331668251065030498L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251065058051L, + 1331668251065091761L, + 1331668251065069765L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251065364590L, + 1331668251065412381L, + 1331668251065407607L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251065462500L, + 1331668251065477027L, + 1331668251065465604L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251065780572L, + 1331668251065836719L, + 1331668251065829440L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251065899750L, + 1331668251065913891L, + 1331668251065902892L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251066057402L, + 1331668251066070617L, + 1331668251066060363L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251066495616L, + 1331668251066520321L, + 1331668251066506338L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251066532840L, + 1331668251066546436L, + 1331668251066535866L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251066658006L, + 1331668251066671812L, + 1331668251066660635L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251066883302L, + 1331668251066906446L, + 1331668251066887423L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251067153808L, + 1331668251067176405L, + 1331668251067157534L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251067407214L, + 1331668251067420770L, + 1331668251067410220L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251067763731L, + 1331668251067818612L, + 1331668251067811009L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251067884367L, + 1331668251067897382L, + 1331668251067887136L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251068275691L, + 1331668251068288692L, + 1331668251068278423L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251068706355L, + 1331668251068719015L, + 1331668251068709290L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251069067645L, + 1331668251069122518L, + 1331668251069116275L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251069178617L, + 1331668251069191305L, + 1331668251069181300L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251069664884L, + 1331668251069684555L, + 1331668251069668097L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251069682852L, + 1331668251069708201L, + 1331668251069690226L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251715054925L, + 1331668259054285979L, + 1331668251715066022L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251803784493L, + 1331668251803827591L, + 1331668251803808547L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251983438636L, + 1331668251983448709L, + 1331668251983441583L, + 1331668259054285979L, + 1331668259054285979L, + 1331668251992993580L, + 1331668251993008591L, + 1331668251992998928L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252022091542L, + 1331668252022091542L, + 1331668252022091542L, + 1331668252022091542L, + 1331668259054285979L, + 1331668252031771660L, + 1331668252031777595L, + 1331668252031773847L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252032463013L, + 1331668252032502964L, + 1331668252032497700L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252032506884L, + 1331668252032559227L, + 1331668252032539402L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252039535067L, + 1331668259054285979L, + 1331668252039537404L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252044008981L, + 1331668252044014257L, + 1331668252044010861L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252044059151L, + 1331668252044064004L, + 1331668252044060420L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252179391423L, + 1331668252184781913L, + 1331668252184772369L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252193425490L, + 1331668252193432385L, + 1331668252193427706L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252253575716L, + 1331668252253592491L, + 1331668252253581852L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252472449352L, + 1331668252472474547L, + 1331668252472458163L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252487295286L, + 1331668252487300925L, + 1331668252487297683L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252495759849L, + 1331668252495766026L, + 1331668252495762178L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252496219924L, + 1331668252496245837L, + 1331668252496228816L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252523291829L, + 1331668252523482082L, + 1331668252523469395L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252764810964L, + 1331668252764829827L, + 1331668252764814570L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252765021775L, + 1331668252765026623L, + 1331668252765023841L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252769399706L, + 1331668259054285979L, + 1331668252769401404L, + 1331668259054285979L, + 1331668252769446847L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252769456141L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252784988923L, + 1331668259054285979L, + 1331668252785262589L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252795062126L, + 1331668259054285979L, + 1331668252795122600L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252828832090L, + 1331668259054285979L, + 1331668252828859292L, + 1331668252828904216L, + 1331668252828866041L, + 1331668259054285979L, + 1331668252829060434L, + 1331668252828992804L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252829505108L, + 1331668259054285979L, + 1331668252829527974L, + 1331668252829719292L, + 1331668252829638887L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252829643060L, + 1331668259054285979L, + 1331668252829660274L, + 1331668259054285979L, + 1331668252829683896L, + 1331668259054285979L, + 1331668252829799248L, + 1331668259054285979L, + 1331668252829802278L, + 1331668259054285979L, + 1331668252829821642L, + 1331668259054285979L, + 1331668252829840961L, + 1331668259054285979L, + 1331668252829859256L, + 1331668259054285979L, + 1331668252829976501L, + 1331668252830107659L, + 1331668252830085595L, + 1331668259054285979L, + 1331668252830154848L, + 1331668252830139534L, + 1331668259054285979L, + 1331668252830212497L, + 1331668252830194969L, + 1331668259054285979L, + 1331668252830382459L, + 1331668252830368625L, + 1331668259054285979L, + 1331668252830526491L, + 1331668252830499169L, + 1331668259054285979L, + 1331668252830576634L, + 1331668252830564658L, + 1331668259054285979L, + 1331668252831112505L, + 1331668252831083126L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252831228714L, + 1331668252831318123L, + 1331668252831301843L, + 1331668259054285979L, + 1331668252831543926L, + 1331668252831527998L, + 1331668259054285979L, + 1331668252831834393L, + 1331668252831817197L, + 1331668259054285979L, + 1331668252832056760L, + 1331668252832046333L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252883172744L, + 1331668252883172744L, + 1331668252883172744L, + 1331668252883172744L, + 1331668259054285979L, + 1331668252885827603L, + 1331668252885827603L, + 1331668252885827603L, + 1331668252885827603L, + 1331668259054285979L, + 1331668252889337098L, + 1331668259054285979L, + 1331668252889396688L, + 1331668252889396688L, + 1331668252889396688L, + 1331668252889396688L, + 1331668252901232798L, + 1331668252901118256L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252901540914L, + 1331668252901540914L, + 1331668252901540914L, + 1331668252901540914L, + 1331668259054285979L, + 1331668252901573889L, + 1331668252901586635L, + 1331668252901577276L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252906764880L, + 1331668252906764880L, + 1331668252906764880L, + 1331668252906764880L, + 1331668259054285979L, + 1331668252912042743L, + 1331668259054285979L, + 1331668252912048618L, + 1331668259054285979L, + 1331668259054285979L, + 1331668252927449371L, + 1331668252927449371L, + 1331668252927449371L, + 1331668252927449371L, + 1331668259054285979L, + 1331668252947156908L, + 1331668252947156908L, + 1331668252947156908L, + 1331668252947156908L, + 1331668259054285979L, + 1331668252947197386L, + 1331668252947197386L, + 1331668252947197386L, + 1331668252947197386L, + 1331668259054285979L, + 1331668253035499713L, + 1331668253035499713L, + 1331668253035499713L, + 1331668253035499713L, + 1331668259054285979L, + 1331668253036766769L, + 1331668253036766769L, + 1331668253036766769L, + 1331668253036766769L, + 1331668259054285979L, + 1331668253037890651L, + 1331668253037890651L, + 1331668253037890651L, + 1331668253037890651L, + 1331668259054285979L, + 1331668253051945128L, + 1331668253051945128L, + 1331668253051945128L, + 1331668253051945128L, + 1331668259054285979L, + 1331668253054627961L, + 1331668253054627961L, + 1331668253054627961L, + 1331668253054627961L, + 1331668259054285979L, + 1331668253057609433L, + 1331668253057609433L, + 1331668253057609433L, + 1331668253057609433L, + 1331668259054285979L, + 1331668253062222314L, + 1331668253062222314L, + 1331668253062222314L, + 1331668253062222314L, + 1331668259054285979L, + 1331668253097239708L, + 1331668253097239708L, + 1331668253097239708L, + 1331668253097239708L, + 1331668259054285979L, + 1331668253097518746L, + 1331668253097518746L, + 1331668253097518746L, + 1331668253097518746L, + 1331668259054285979L, + 1331668253267104284L, + 1331668253267117055L, + 1331668253267107624L, + 1331668259054285979L, + 1331668259054285979L, + 1331668253267342015L, + 1331668253267378405L, + 1331668253267367303L, + 1331668259054285979L, + 1331668259054285979L, + 1331668253278218713L, + 1331668253278218713L, + 1331668253278218713L, + 1331668253278218713L, + 1331668259054285979L, + 1331668253324119756L, + 1331668253324119756L, + 1331668253324119756L, + 1331668253324119756L, + 1331668259054285979L, + 1331668253614347227L, + 1331668253614347227L, + 1331668253614347227L, + 1331668253614347227L, + 1331668259054285979L, + 1331668253619459320L, + 1331668253619459320L, + 1331668253619459320L, + 1331668253619459320L, + 1331668259054285979L, + 1331668253619867625L, + 1331668253619867625L, + 1331668253619867625L, + 1331668253619867625L, + 1331668259054285979L, + 1331668253621486721L, + 1331668253621508851L, + 1331668253621491536L, + 1331668259054285979L, + 1331668259054285979L, + 1331668253622429608L, + 1331668253622429608L, + 1331668253622429608L, + 1331668253622429608L, + 1331668259054285979L, + 1331668253857465365L, + 1331668253857465365L, + 1331668253857465365L, + 1331668253857465365L, + 1331668259054285979L, + 1331668253858125091L, + 1331668253858125091L, + 1331668253858125091L, + 1331668253858125091L, + 1331668259054285979L, + 1331668253910194540L, + 1331668253910194540L, + 1331668253910194540L, + 1331668253910194540L, + 1331668259054285979L, + 1331668253910329721L, + 1331668253910329721L, + 1331668253910329721L, + 1331668253910329721L, + 1331668259054285979L, + 1331668253984922308L, + 1331668253984922308L, + 1331668253984922308L, + 1331668253984922308L, + 1331668259054285979L, + 1331668254004098152L, + 1331668254004098152L, + 1331668254004098152L, + 1331668254004098152L, + 1331668259054285979L, + 1331668254047839900L, + 1331668254047839900L, + 1331668254047839900L, + 1331668254047839900L, + 1331668259054285979L, + 1331668254093066195L, + 1331668254093066195L, + 1331668254093066195L, + 1331668254093066195L, + 1331668259054285979L, + 1331668254106326339L, + 1331668254106326339L, + 1331668254106326339L, + 1331668254106326339L, + 1331668259054285979L, + 1331668255052411647L, + 1331668255052411647L, + 1331668255052411647L, + 1331668255052411647L, + 1331668259054285979L, + 1331668255157088064L, + 1331668255157101973L, + 1331668255157091812L, + 1331668259054285979L, + 1331668259054285979L, + 1331668256244508635L, + 1331668256244508635L, + 1331668256244508635L, + 1331668256244508635L, + 1331668259054285979L, + 1331668257246987050L, + 1331668257247036372L, + 1331668257247027684L, + 1331668259054285979L, + 1331668259054285979L, + 1331668259045096840L, + 1331668259045096840L, + 1331668259045096840L, + 1331668259045096840L, + 1331668259054285979L, + 1331668259052126585L, + 1331668259052126585L, + 1331668259052126585L, + 1331668259052126585L, + 1331668259054285979L, + 1331668259053345550L, + 1331668259054285979L, + 1331668259053349544L, + 1331668259054285979L, + }; + + static final ITmfStateValue[] values = { + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1397), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("lttng-consumerd"), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(5), + TmfStateValue.newValueString("swapper/1"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1432), + TmfStateValue.newValueInt(2), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("lttng-consumerd"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_ppoll"), + TmfStateValue.newValueString("alsa-sink"), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("sys_epoll_wait"), + TmfStateValue.newValueString("lttng-sessiond"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_futex"), + TmfStateValue.newValueString("firefox"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("firefox"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("gnome-terminal"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_select"), + TmfStateValue.newValueString("Xorg"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("metacity"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("kworker/0:1"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("ksoftirqd/0"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_read"), + TmfStateValue.newValueString("rsyslogd"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_futex"), + TmfStateValue.newValueString("rs:main Q:Reg"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("kworker/1:1"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_select"), + TmfStateValue.newValueString("rsyslogd"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_read"), + TmfStateValue.newValueString("bash"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("bamfdaemon"), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("gnome-settings-"), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("unity-2d-shell"), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("unity-2d-panel"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("indicator-multi"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("gdbus"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("dbus-daemon"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("gdbus"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("indicator-appli"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(3), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("gdbus"), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("gdbus"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(5), + TmfStateValue.newValueString("sys_futex"), + TmfStateValue.newValueString("unity-panel-ser"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("hud-service"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("gdbus"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("openvpn"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("firefox"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_futex"), + TmfStateValue.newValueString("thunderbird-bin"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("thunderbird-bin"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("thunderbird-bin"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_futex"), + TmfStateValue.newValueString("thunderbird-bin"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(2), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("gdbus"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_nanosleep"), + TmfStateValue.newValueString("gvfs-afc-volume"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("rtkit-daemon"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("rtkit-daemon"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("thunderbird-bin"), + TmfStateValue.nullValue(), + TmfStateValue.newValueString("sys_poll"), + TmfStateValue.newValueString("thunderbird-bin"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_futex"), + TmfStateValue.newValueString("thunderbird-bin"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("sys_futex"), + TmfStateValue.newValueString("firefox"), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + TmfStateValue.nullValue(), + }; +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/.classpath b/org.eclipse.tracecompass.lttng2.kernel.core/.classpath new file mode 100644 index 0000000000..098194ca4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/.project b/org.eclipse.tracecompass.lttng2.kernel.core/.project new file mode 100644 index 0000000000..6883fd5415 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.kernel.core + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..9f3662cd78 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,394 @@ +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.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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..d92b94fd4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.kernel.core/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..ef74b8cccc --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/META-INF/MANIFEST.MF @@ -0,0 +1,23 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.kernel.core;singleton:=true +Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.tracecompass.ctf.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.ctf.core, + org.eclipse.tracecompass.lttng2.control.core +Export-Package: org.eclipse.linuxtools.internal.lttng2.kernel.core;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui,org.eclipse.tracecompass.lttng2.kernel.core.tests", + org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui,org.eclipse.tracecompass.lttng2.kernel.core.tests", + org.eclipse.linuxtools.lttng2.kernel.core.analysis, + org.eclipse.linuxtools.lttng2.kernel.core.cpuusage, + org.eclipse.linuxtools.lttng2.kernel.core.event.matching, + org.eclipse.linuxtools.lttng2.kernel.core.trace +Import-Package: com.google.common.collect diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/about.html b/org.eclipse.tracecompass.lttng2.kernel.core/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/build.properties b/org.eclipse.tracecompass.lttng2.kernel.core/build.properties new file mode 100644 index 0000000000..244c9d8e3e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/build.properties @@ -0,0 +1,22 @@ +############################################################################### +# 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 +############################################################################### + +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/plugin.properties b/org.eclipse.tracecompass.lttng2.kernel.core/plugin.properties new file mode 100644 index 0000000000..49100d405a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/plugin.properties @@ -0,0 +1,20 @@ +############################################################################### +# 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 +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Kernel Analysis Core Plug-in + +tracetype.type.kernel = LTTng Kernel Trace +analysis.lttngkernel = LTTng Kernel Analysis + +cpuusage.lttng.kernel = CPU usage + diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/plugin.xml b/org.eclipse.tracecompass.lttng2.kernel.core/plugin.xml new file mode 100644 index 0000000000..f74134c622 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/plugin.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/pom.xml b/org.eclipse.tracecompass.lttng2.kernel.core/pom.xml new file mode 100644 index 0000000000..b0a25b0d67 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.kernel.core + 3.1.0-SNAPSHOT + eclipse-plugin + + Trace Compass LTTng Kernel Analysis Core Plug-in + + + + + + src + + **/*.java + + + + + + org.eclipse.tycho + tycho-source-plugin + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Activator.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Activator.java new file mode 100644 index 0000000000..8629784bc4 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Activator.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.core; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; +import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; +import org.osgi.framework.BundleContext; + +/** + * Activator + *

+ * 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.linuxtools.lttng2.core"; //$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; + TmfEventMatching.registerMatchObject(new TcpEventMatching()); + TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = 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)); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Attributes.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Attributes.java new file mode 100644 index 0000000000..1df281e8c8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/Attributes.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * 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.linuxtools.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"; +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/LttngStrings.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/LttngStrings.java new file mode 100644 index 0000000000..044ec9fd29 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/LttngStrings.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.core; + +/** + * This file defines all the known event and field names for LTTng 2.0 kernel + * traces. + * + * Once again, these should not be externalized, since they need to match + * exactly what the tracer outputs. If you want to localize them in a view, you + * should do a mapping in the viewer itself. + * + * @author alexmont + */ +@SuppressWarnings({"javadoc", "nls"}) +public interface LttngStrings { + + /* Event names */ + static final String EXIT_SYSCALL = "exit_syscall"; + static final String IRQ_HANDLER_ENTRY = "irq_handler_entry"; + static final String IRQ_HANDLER_EXIT = "irq_handler_exit"; + static final String SOFTIRQ_ENTRY = "softirq_entry"; + static final String SOFTIRQ_EXIT = "softirq_exit"; + static final String SOFTIRQ_RAISE = "softirq_raise"; + static final String SCHED_SWITCH = "sched_switch"; + static final String SCHED_WAKEUP = "sched_wakeup"; + static final String SCHED_WAKEUP_NEW = "sched_wakeup_new"; + static final String SCHED_PROCESS_FORK = "sched_process_fork"; + static final String SCHED_PROCESS_EXIT = "sched_process_exit"; + static final String SCHED_PROCESS_FREE = "sched_process_free"; + static final String STATEDUMP_PROCESS_STATE = "lttng_statedump_process_state"; + + /* System call names */ + static final String SYSCALL_PREFIX = "sys_"; + static final String COMPAT_SYSCALL_PREFIX = "compat_sys_"; + static final String SYS_CLONE = "sys_clone"; + + /* Field names */ + static final String IRQ = "irq"; + static final String COMM = "comm"; + static final String NAME = "name"; + static final String PID = "pid"; + static final String TID = "tid"; + static final String PPID = "ppid"; + static final String STATUS = "status"; + static final String VEC = "vec"; + static final String PREV_COMM = "prev_comm"; + static final String PREV_TID = "prev_tid"; + static final String PREV_STATE = "prev_state"; + static final String NEXT_COMM = "next_comm"; + static final String NEXT_TID = "next_tid"; + static final String PARENT_TID = "parent_tid"; + static final String CHILD_COMM = "child_comm"; + static final String CHILD_TID = "child_tid"; +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/StateValues.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/StateValues.java new file mode 100644 index 0000000000..53a4efb498 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/StateValues.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.core; + +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.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); +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/TcpEventStrings.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/TcpEventStrings.java new file mode 100644 index 0000000000..2891210aa4 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/TcpEventStrings.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * Copyright (c) 2013 É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.linuxtools.internal.lttng2.kernel.core; + +/** + * This file defines all the known event and field names used to trace socket + * connection for both the addons module method ( + * {@link org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching} + * ) and the net_data_experimental branch ( + * {@link org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching} + * ). + * + * These events should be eventually mainlined and when this happens, this class + * won't be necessary anymore and they should be moved to {@link LttngStrings} + * class + * + * + * @author Geneviève Bastien + */ +@SuppressWarnings({ "javadoc", "nls" }) +public interface TcpEventStrings { + + /* Event names */ + public static final String INET_CONNECT = "inet_connect"; + public static final String INET_SOCK_CREATE = "inet_sock_create"; + public static final String INET_SOCK_LOCAL_OUT = "inet_sock_local_out"; + public static final String INET_SOCK_LOCAL_IN = "inet_sock_local_in"; + public static final String INET_SOCK_CLONE = "inet_sock_clone"; + public static final String INET_ACCEPT = "inet_accept"; + public static final String INET_SOCK_DELETE = "inet_sock_delete"; + public static final String NETIF_RECEIVE_SKB = "netif_receive_skb"; + public static final String NET_DEV_QUEUE = "net_dev_queue"; + + /* Field names */ + public static final String SEQ = "seq"; + public static final String SK = "sk"; + public static final String OSK = "osk"; + public static final String NSK = "nsk"; + public static final String SPORT = "sport"; + public static final String DPORT = "dport"; + public static final String SADDR = "saddr"; + public static final String DADDR = "daddr"; + public static final String ACKSEQ = "ack_seq"; + public static final String CHECK = "check"; + public static final String WINDOW = "window"; + public static final String FLAGS = "flags"; + public static final String TRANSPORT_FIELDS = "transport_fields"; + public static final String TYPE_TCP = "thtype_tcp"; + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/LttngKernelStateProvider.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/LttngKernelStateProvider.java new file mode 100644 index 0000000000..7bceb2878e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/LttngKernelStateProvider.java @@ -0,0 +1,559 @@ +/******************************************************************************* + * Copyright (c) 2012, 2014 Ericsson + * Copyright (c) 2010, 2011 École Polytechnique de Montréal + * Copyright (c) 2010, 2011 Alexandre Montplaisir + * + * 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.linuxtools.internal.lttng2.kernel.core.stateprovider; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.LttngStrings; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.StateValues; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystemBuilder; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.statesystem.core.statevalue.TmfStateValue; +import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; +import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; +import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; + +/** + * 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 { + + /** + * 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 = 4; + + // ------------------------------------------------------------------------ + // Constructor + // ------------------------------------------------------------------------ + + /** + * Instantiate a new state provider plugin. + * + * @param trace + * The LTTng 2.0 kernel trace directory + */ + public LttngKernelStateProvider(ITmfTrace trace) { + super(trace, ITmfEvent.class, "LTTng Kernel"); //$NON-NLS-1$ + } + + // ------------------------------------------------------------------------ + // 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()); + } + + @Override + protected void eventHandle(ITmfEvent event) { + /* + * AbstractStateChangeInput should have already checked for the correct + * class type + */ + + final String eventName = event.getType().getName(); + final long ts = event.getTimestamp().getValue(); + + try { + /* Shortcut for the "current CPU" attribute node */ + final Integer currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(), event.getSource()); + + /* + * 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 Integer currentThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), String.valueOf(thread)); + + /* + * Feed event to the history system if it's known to cause a state + * transition. + */ + switch (eventName) { + + case LttngStrings.EXIT_SYSCALL: + /* Fields: int64 ret */ + { + /* 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; + + case LttngStrings.IRQ_HANDLER_ENTRY: + /* Fields: int32 irq, string name */ + { + Integer irqId = ((Long) event.getContent().getField(LttngStrings.IRQ).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(), irqId.toString()); + value = TmfStateValue.newValueInt(Integer.parseInt(event.getSource())); + 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 LttngStrings.IRQ_HANDLER_EXIT: + /* Fields: int32 irq, int32 ret */ + { + Integer irqId = ((Long) event.getContent().getField(LttngStrings.IRQ).getValue()).intValue(); + + /* Put this IRQ back to inactive in the resource tree */ + quark = ss.getQuarkRelativeAndAdd(getNodeIRQs(), irqId.toString()); + value = TmfStateValue.nullValue(); + ss.modifyAttribute(ts, value, quark); + + /* Set the previous process back to running */ + setProcessToRunning(ts, currentThreadNode); + + /* Set the CPU status back to running or "idle" */ + cpuExitInterrupt(ts, currentCPUNode, currentThreadNode); + } + break; + + case LttngStrings.SOFTIRQ_ENTRY: + /* Fields: int32 vec */ + { + Integer softIrqId = ((Long) event.getContent().getField(LttngStrings.VEC).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(), softIrqId.toString()); + value = TmfStateValue.newValueInt(Integer.parseInt(event.getSource())); + 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 LttngStrings.SOFTIRQ_EXIT: + /* Fields: int32 vec */ + { + Integer softIrqId = ((Long) event.getContent().getField(LttngStrings.VEC).getValue()).intValue(); + + /* Put this SoftIRQ back to inactive (= -1) in the resource tree */ + quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(), softIrqId.toString()); + value = TmfStateValue.nullValue(); + ss.modifyAttribute(ts, value, quark); + + /* Set the previous process back to running */ + setProcessToRunning(ts, currentThreadNode); + + /* Set the CPU status back to "busy" or "idle" */ + cpuExitInterrupt(ts, currentCPUNode, currentThreadNode); + } + break; + + case LttngStrings.SOFTIRQ_RAISE: + /* Fields: int32 vec */ + { + Integer softIrqId = ((Long) event.getContent().getField(LttngStrings.VEC).getValue()).intValue(); + + /* Mark this SoftIRQ as *raised* in the resource tree. + * State value = -2 */ + quark = ss.getQuarkRelativeAndAdd(getNodeSoftIRQs(), softIrqId.toString()); + value = StateValues.SOFT_IRQ_RAISED_VALUE; + ss.modifyAttribute(ts, value, quark); + } + break; + + case LttngStrings.SCHED_SWITCH: + /* + * 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(); + Integer prevTid = ((Long) content.getField(LttngStrings.PREV_TID).getValue()).intValue(); + Long prevState = (Long) content.getField(LttngStrings.PREV_STATE).getValue(); + String nextProcessName = (String) content.getField(LttngStrings.NEXT_COMM).getValue(); + Integer nextTid = ((Long) content.getField(LttngStrings.NEXT_TID).getValue()).intValue(); + + Integer formerThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), prevTid.toString()); + Integer newCurrentThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), 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(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 LttngStrings.SCHED_PROCESS_FORK: + /* Fields: string parent_comm, int32 parent_tid, + * string child_comm, int32 child_tid */ + { + ITmfEventField content = event.getContent(); + // String parentProcessName = (String) event.getFieldValue("parent_comm"); + String childProcessName = (String) content.getField(LttngStrings.CHILD_COMM).getValue(); + // assert ( parentProcessName.equals(childProcessName) ); + + Integer parentTid = ((Long) content.getField(LttngStrings.PARENT_TID).getValue()).intValue(); + Integer childTid = ((Long) content.getField(LttngStrings.CHILD_TID).getValue()).intValue(); + + Integer parentTidNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), parentTid.toString()); + Integer childTidNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), 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(LttngStrings.SYS_CLONE); + } + quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.SYSTEM_CALL); + ss.modifyAttribute(ts, value, quark); + } + break; + + case LttngStrings.SCHED_PROCESS_EXIT: + /* Fields: string comm, int32 tid, int32 prio */ + break; + + case LttngStrings.SCHED_PROCESS_FREE: + /* Fields: string comm, int32 tid, int32 prio */ + /* + * A sched_process_free will always happen after the sched_switch + * that will remove the process from the cpu for the last time. So + * this is when we should delete everything wrt to the process. + */ + { + Integer tid = ((Long) event.getContent().getField(LttngStrings.TID).getValue()).intValue(); + /* + * Remove the process and all its sub-attributes from the + * current state + */ + quark = ss.getQuarkRelativeAndAdd(getNodeThreads(), tid.toString()); + ss.removeAttribute(ts, quark); + } + break; + + case LttngStrings.STATEDUMP_PROCESS_STATE: + /* Fields: + * int32 type, int32 mode, int32 pid, int32 submode, int32 vpid, + * int32 ppid, int32 tid, string name, int32 status, int32 vtid */ + { + ITmfEventField content = event.getContent(); + int tid = ((Long) content.getField(LttngStrings.TID).getValue()).intValue(); + int pid = ((Long) content.getField(LttngStrings.PID).getValue()).intValue(); + int ppid = ((Long) content.getField(LttngStrings.PPID).getValue()).intValue(); + int status = ((Long) content.getField(LttngStrings.STATUS).getValue()).intValue(); + String name = (String) content.getField(LttngStrings.NAME).getValue(); + /* + * "mode" could be interesting too, but it doesn't seem to be + * populated with anything relevant for now. + */ + + int curThreadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), 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 LttngStrings.SCHED_WAKEUP: + case LttngStrings.SCHED_WAKEUP_NEW: + /* Fields (same fields for both types): + * string comm, int32 pid, int32 prio, int32 success, + * int32 target_cpu */ + { + final int tid = ((Long) event.getContent().getField(LttngStrings.TID).getValue()).intValue(); + final int threadNode = ss.getQuarkRelativeAndAdd(getNodeThreads(), 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(LttngStrings.SYSCALL_PREFIX) + || eventName.startsWith(LttngStrings.COMPAT_SYSCALL_PREFIX)) { + /* + * This is a replacement for the old sys_enter event. Now + * syscall names are listed into the event type + */ + + /* 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); + } + } + 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 int getNodeCPUs() { + return ss.getQuarkAbsoluteAndAdd(Attributes.CPUS); + } + + private int getNodeThreads() { + return ss.getQuarkAbsoluteAndAdd(Attributes.THREADS); + } + + private int getNodeIRQs() { + return ss.getQuarkAbsoluteAndAdd(Attributes.RESOURCES, Attributes.IRQS); + } + + private int getNodeSoftIRQs() { + return ss.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 void setProcessToRunning(long ts, int currentThreadNode) + throws AttributeNotFoundException, TimeRangeException, + StateValueTypeException { + int quark; + ITmfStateValue value; + + quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.SYSTEM_CALL); + if (ss.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 = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS); + ss.modifyAttribute(ts, value, quark); + } + + /** + * Similar logic as above, but to set the CPU's status when it's coming out + * of an interruption. + */ + private void cpuExitInterrupt(long ts, int currentCpuNode, int currentThreadNode) + throws StateValueTypeException, AttributeNotFoundException, + TimeRangeException { + int quark; + ITmfStateValue value; + + quark = ss.getQuarkRelativeAndAdd(currentCpuNode, Attributes.CURRENT_THREAD); + if (ss.queryOngoingState(quark).unboxInt() > 0) { + /* There was a process on the CPU */ + quark = ss.getQuarkRelative(currentThreadNode, Attributes.SYSTEM_CALL); + if (ss.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 = ss.getQuarkRelativeAndAdd(currentCpuNode, Attributes.STATUS); + ss.modifyAttribute(ts, value, quark); + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/LttngKernelAnalysisModule.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/LttngKernelAnalysisModule.java new file mode 100644 index 0000000000..3d27e7931f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/LttngKernelAnalysisModule.java @@ -0,0 +1,103 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.analysis; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.LttngStrings; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider; +import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; +import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement; +import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; + +import com.google.common.collect.ImmutableSet; + +/** + * State System Module for lttng kernel traces + * + * @author Geneviève Bastien + * @since 3.0 + */ +public class LttngKernelAnalysisModule 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 REQUIRED_EVENTS = ImmutableSet.of(); + + private static final ImmutableSet OPTIONAL_EVENTS = ImmutableSet.of( + 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 ImmutableSet 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 = ImmutableSet.of(domainReq, eventReq); + } + + @Override + @NonNull + protected ITmfStateProvider createStateProvider() { + return new LttngKernelStateProvider(getTrace()); + } + + @Override + @NonNull + protected String getSsFileName() { + return HISTORY_TREE_FILE_NAME; + } + + @Override + protected String getFullHelpText() { + return Messages.LttngKernelAnalysisModule_Help; + } + + @Override + public Iterable getAnalysisRequirements() { + return REQUIREMENTS; + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/Messages.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/Messages.java new file mode 100644 index 0000000000..01696e2d84 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/Messages.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.analysis; + +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.linuxtools.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() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/messages.properties b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/messages.properties new file mode 100644 index 0000000000..6933aa637e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/analysis/messages.properties @@ -0,0 +1,13 @@ +############################################################################### +# 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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuStateProvider.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuStateProvider.java new file mode 100644 index 0000000000..b6c2b3b5bf --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuStateProvider.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.cpuusage; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.LttngStrings; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.statesystem.core.statevalue.TmfStateValue; +import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; +import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; +import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; + +/** + * 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 LttngKernelCpuStateProvider extends AbstractTmfStateProvider { + + private static final int VERSION = 1; + + /* For each CPU, maps the last time a thread was scheduled in */ + private final Map fLastStartTimes = new HashMap<>(); + private final long fTraceStart; + + /** + * Constructor + * + * @param trace + * The trace from which to get the CPU usage + */ + public LttngKernelCpuStateProvider(ITmfTrace trace) { + super(trace, ITmfEvent.class, "LTTng Kernel CPU usage"); //$NON-NLS-1$ + fTraceStart = trace.getStartTime().getValue(); + } + + // ------------------------------------------------------------------------ + // ITmfStateProvider + // ------------------------------------------------------------------------ + + @Override + public int getVersion() { + return VERSION; + } + + @Override + public LttngKernelCpuStateProvider getNewInstance() { + return new LttngKernelCpuStateProvider(this.getTrace()); + } + + @Override + protected void eventHandle(ITmfEvent event) { + final String eventName = event.getType().getName(); + + if (eventName.equals(LttngStrings.SCHED_SWITCH)) { + /* + * 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(); + String cpu = event.getSource(); + + Long prevTid = (Long) content.getField(LttngStrings.PREV_TID).getValue(); + + try { + Integer currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(), cpu); + + /* + * 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 = 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 int getNodeCPUs() { + return ss.getQuarkAbsoluteAndAdd(Attributes.CPUS); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuUsageAnalysis.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuUsageAnalysis.java new file mode 100644 index 0000000000..eb6da69f05 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/cpuusage/LttngKernelCpuUsageAnalysis.java @@ -0,0 +1,254 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.core.cpuusage; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; +import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; + +/** + * 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() { + return new LttngKernelCpuStateProvider(getTrace()); + } + + @Override + protected StateSystemBackendType getBackendType() { + return StateSystemBackendType.FULL; + } + + @Override + protected boolean executeAnalysis(IProgressMonitor monitor) { + /* + * This analysis depends on the LTTng kernel analysis, so we'll start + * that build at the same time + */ + LttngKernelAnalysisModule module = getTrace().getAnalysisModuleOfClass(LttngKernelAnalysisModule.class, LttngKernelAnalysisModule.ID); + if (module != null) { + module.schedule(); + } + return super.executeAnalysis(monitor); + } + + /** + * 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 getCpuUsageInRange(long start, long end) { + Map map = new HashMap<>(); + Map totalMap = new HashMap<>(); + + ITmfTrace trace = getTrace(); + ITmfStateSystem cpuSs = getStateSystem(); + if (trace == null || cpuSs == null) { + return map; + } + ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysisModule.ID); + 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> 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 kernelEndState = kernelSs.queryFullState(endTime); + List endState = cpuSs.queryFullState(endTime); + List kernelStartState = kernelSs.queryFullState(startTime); + List startState = cpuSs.queryFullState(startTime); + + long countAtStart, countAtEnd; + + for (Entry> entry : tidsPerCpu.entrySet()) { + int cpuNode = entry.getKey(); + List 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 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 map, String key, Long value) { + Long addTo = map.get(key); + if (addTo == null) { + map.put(key, value); + } else { + map.put(key, addTo + value); + } + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpEventMatching.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpEventMatching.java new file mode 100644 index 0000000000..339779b3ad --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpEventMatching.java @@ -0,0 +1,113 @@ +/******************************************************************************* + * 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 implementation and API + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.event.matching; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.TcpEventStrings; +import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; +import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; +import org.eclipse.linuxtools.tmf.core.event.matching.ITmfNetworkMatchDefinition; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching.MatchingType; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfNetworkEventMatching.Direction; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.core.trace.TmfEventTypeCollectionHelper; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; + +import com.google.common.collect.ImmutableSet; + +/** + * Class to match tcp type events. This matching class applies to traces + * obtained with the 'addons' lttng module. This module can be obtained with + * lttng-modules to generate traces at + * https://github.com/giraldeau/lttng-modules/tree/addons + * + * Note: this module only allows to generate traces to be read and analyzed by + * TMF, no code from this module is being used here + * + * @author Geneviève Bastien + * @since 3.0 + */ +public class TcpEventMatching implements ITmfNetworkMatchDefinition { + + private static final ImmutableSet REQUIRED_EVENTS = ImmutableSet.of( + TcpEventStrings.INET_SOCK_LOCAL_IN, + TcpEventStrings.INET_SOCK_LOCAL_OUT); + + private static boolean canMatchPacket(final ITmfEvent event) { + /* Make sure all required fields are present to match with this event */ + ITmfEventField content = event.getContent(); + if ((content.getField(TcpEventStrings.SEQ) != null) && + (content.getField(TcpEventStrings.ACKSEQ) != null) && (content.getField(TcpEventStrings.FLAGS) != null)) { + return true; + } + return false; + } + + @Override + public Direction getDirection(ITmfEvent event) { + String evname = event.getType().getName(); + + if (!canMatchPacket(event)) { + return null; + } + + /* Is the event a tcp socket in or out event */ + if (evname.equals(TcpEventStrings.INET_SOCK_LOCAL_IN)) { + return Direction.IN; + } else if (evname.equals(TcpEventStrings.INET_SOCK_LOCAL_OUT)) { + return Direction.OUT; + } + return null; + } + + /** + * The key to uniquely identify a TCP packet depends on many fields. This + * method computes the key for a given event. + * + * @param event + * The event for which to compute the key + * @return the unique key for this event + */ + @Override + public List getUniqueField(ITmfEvent event) { + List keys = new ArrayList<>(); + + keys.add(event.getContent().getField(TcpEventStrings.SEQ).getValue()); + keys.add(event.getContent().getField(TcpEventStrings.ACKSEQ).getValue()); + keys.add(event.getContent().getField(TcpEventStrings.FLAGS).getValue()); + + return keys; + } + + @Override + public boolean canMatchTrace(ITmfTrace trace) { + if (!(trace instanceof CtfTmfTrace)) { + return false; + } + CtfTmfTrace ktrace = (CtfTmfTrace) trace; + + Set traceEvents = TmfEventTypeCollectionHelper.getEventNames(ktrace.getContainedEventTypes()); + traceEvents.retainAll(REQUIRED_EVENTS); + return !traceEvents.isEmpty(); + } + + @Override + public MatchingType[] getApplicableMatchingTypes() { + MatchingType[] types = { MatchingType.NETWORK }; + return types; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpLttngEventMatching.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpLttngEventMatching.java new file mode 100644 index 0000000000..9c35b41a00 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/event/matching/TcpLttngEventMatching.java @@ -0,0 +1,126 @@ +/******************************************************************************* + * 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 implementation and API + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.event.matching; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.TcpEventStrings; +import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; +import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; +import org.eclipse.linuxtools.tmf.core.event.TmfEventField; +import org.eclipse.linuxtools.tmf.core.event.matching.ITmfNetworkMatchDefinition; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching.MatchingType; +import org.eclipse.linuxtools.tmf.core.event.matching.TmfNetworkEventMatching.Direction; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.core.trace.TmfEventTypeCollectionHelper; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; + +import com.google.common.collect.ImmutableSet; + +/** + * Class to match tcp type events. This class applies to traces obtained with + * the full network tracepoint data available from an experimental branch of + * lttng-modules. This branch is often rebased on lttng-modules master and is + * available at + * http://git.dorsal.polymtl.ca/~gbastien?p=lttng-modules.git;a=summary + * net_data_experimental branch. + * + * @author Geneviève Bastien + * @since 3.0 + */ +public class TcpLttngEventMatching implements ITmfNetworkMatchDefinition { + + private static final String[] key_seq = { TcpEventStrings.TRANSPORT_FIELDS, TcpEventStrings.TYPE_TCP, TcpEventStrings.SEQ }; + private static final String[] key_ackseq = { TcpEventStrings.TRANSPORT_FIELDS, TcpEventStrings.TYPE_TCP, TcpEventStrings.ACKSEQ }; + private static final String[] key_flags = { TcpEventStrings.TRANSPORT_FIELDS, TcpEventStrings.TYPE_TCP, TcpEventStrings.FLAGS }; + + private static final ImmutableSet REQUIRED_EVENTS = ImmutableSet.of( + TcpEventStrings.NET_DEV_QUEUE, + TcpEventStrings.NETIF_RECEIVE_SKB); + + private static boolean canMatchPacket(final ITmfEvent event) { + TmfEventField field = (TmfEventField) event.getContent(); + + String[] tcp_data = { TcpEventStrings.TRANSPORT_FIELDS, TcpEventStrings.TYPE_TCP }; + ITmfEventField data = field.getSubField(tcp_data); + if (data != null) { + return (data.getValue() != null); + } + return false; + } + + /** + * The key to uniquely identify a TCP packet depends on many fields. This + * method computes the key for a given event. + * + * @param event + * The event for which to compute the key + * @return the unique key for this event + */ + @Override + public List getUniqueField(ITmfEvent event) { + List keys = new ArrayList<>(); + + TmfEventField field = (TmfEventField) event.getContent(); + ITmfEventField data; + + data = field.getSubField(key_seq); + if (data != null) { + keys.add(data.getValue()); + } + data = field.getSubField(key_ackseq); + if (data != null) { + keys.add(data.getValue()); + } + data = field.getSubField(key_flags); + if (data != null) { + keys.add(data.getValue()); + } + + return keys; + } + + @Override + public boolean canMatchTrace(ITmfTrace trace) { + if (!(trace instanceof CtfTmfTrace)) { + return false; + } + CtfTmfTrace ktrace = (CtfTmfTrace) trace; + + Set traceEvents = TmfEventTypeCollectionHelper.getEventNames(ktrace.getContainedEventTypes()); + traceEvents.retainAll(REQUIRED_EVENTS); + return !traceEvents.isEmpty(); + } + + @Override + public Direction getDirection(ITmfEvent event) { + String evname = event.getType().getName(); + + /* Is the event a tcp socket in or out event */ + if (evname.equals(TcpEventStrings.NETIF_RECEIVE_SKB) && canMatchPacket(event)) { + return Direction.IN; + } else if (evname.equals(TcpEventStrings.NET_DEV_QUEUE) && canMatchPacket(event)) { + return Direction.OUT; + } + return null; + } + + @Override + public MatchingType[] getApplicableMatchingTypes() { + MatchingType[] types = { MatchingType.NETWORK }; + return types; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/LttngKernelTrace.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/LttngKernelTrace.java new file mode 100644 index 0000000000..7853e6c2e4 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/LttngKernelTrace.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (c) 2012, 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 + * Matthew Khouzam - Improved validation + ******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.trace; + +import java.nio.BufferOverflowException; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException; +import org.eclipse.linuxtools.ctf.core.trace.CTFTrace; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator; +import org.eclipse.linuxtools.tmf.core.trace.TraceValidationStatus; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; + +/** + * This is the specification of CtfTmfTrace for use with LTTng 2.x kernel + * traces. + * + * @author Alexandre Montplaisir + * @since 2.0 + */ +public class LttngKernelTrace extends CtfTmfTrace { + + private static final int CONFIDENCE = 100; + + /** + * Default constructor + */ + public LttngKernelTrace() { + super(); + } + + /** + * {@inheritDoc} + *

+ * This implementation sets the confidence to 100 if the trace is a valid + * CTF trace in the "kernel" domain. + */ + @Override + public IStatus validate(final IProject project, final String path) { + /* + * Make sure the trace is openable as a CTF trace. We do this here + * instead of calling super.validate() to keep the reference to "temp". + */ + try (CTFTrace temp = new CTFTrace(path);) { + /* Make sure the domain is "kernel" in the trace's env vars */ + String dom = temp.getEnvironment().get("domain"); //$NON-NLS-1$ + if (dom != null && dom.equals("\"kernel\"")) { //$NON-NLS-1$ + return new TraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID); + } + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngKernelTrace_DomainError); + + } catch (CTFReaderException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); + } catch (NullPointerException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); + } catch (final BufferOverflowException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngKernelTrace_TraceReadError + ": " + Messages.LttngKernelTrace_MalformedTrace); //$NON-NLS-1$ + } + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java new file mode 100644 index 0000000000..e3372101c0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 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: + * Matthew Khouzam - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.core.trace; + +import org.eclipse.osgi.util.NLS; + +/** + * Message bundle for lttng2.kernel.core.trace + * + * @author Matthew Khouzam + * @since 2.0 + */ +public class Messages extends NLS { + + private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng2.kernel.core.trace.messages"; //$NON-NLS-1$ + + /** + * The domain is not "kernel" + */ + public static String LttngKernelTrace_DomainError; + /** + * Malformed trace (buffer overflow maybe?) + * @since 2.1 + */ + public static String LttngKernelTrace_MalformedTrace; + /** + * Trace read error + * @since 2.1 + */ + public static String LttngKernelTrace_TraceReadError; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/messages.properties b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/messages.properties new file mode 100644 index 0000000000..460105a03e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/messages.properties @@ -0,0 +1,15 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +LttngKernelTrace_DomainError=Domain mismatch, the environment should be 'kernel'. +LttngKernelTrace_MalformedTrace=Buffer overflow exception, trace is malformed +LttngKernelTrace_TraceReadError=Lttng trace read error diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.classpath b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.classpath new file mode 100644 index 0000000000..3bc247511f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.gitignore b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.gitignore new file mode 100644 index 0000000000..750e145aa2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.gitignore @@ -0,0 +1 @@ +screenshots/ diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.project b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.project new file mode 100644 index 0000000000..2955b91c4e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..f3fc64575b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,393 @@ +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=enabled +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..62cfa90dee --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..0715e2998d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/META-INF/MANIFEST.MF @@ -0,0 +1,28 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests;singleton:=true +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests +Require-Bundle: org.apache.log4j, + org.eclipse.core.resources, + org.eclipse.core.runtime, + org.eclipse.tracecompass.lttng2.kernel.core, + org.eclipse.tracecompass.lttng2.kernel.ui, + org.eclipse.tracecompass.lttng2.control.ui, + org.eclipse.linuxtools.tmf.core, + org.eclipse.linuxtools.tmf.core.tests, + org.eclipse.linuxtools.tmf.ctf.core, + org.eclipse.linuxtools.tmf.ctf.core.tests, + org.eclipse.linuxtools.tmf.ui, + org.eclipse.linuxtools.tmf.ui.swtbot.tests, + org.eclipse.swtbot.eclipse.finder, + org.eclipse.swtbot.junit4_x, + org.eclipse.ui, + org.eclipse.ui.ide, + org.eclipse.ui.views, + org.junit diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/about.html b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/build.properties b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/build.properties new file mode 100644 index 0000000000..9b275765a2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/build.properties @@ -0,0 +1,16 @@ +############################################################################### +# 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: +# Ericsson - Initial API and implementation +############################################################################### + +source.. = src/ +bin.includes = META-INF/,\ + .,\ + plugin.properties diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/plugin.properties b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/plugin.properties new file mode 100644 index 0000000000..2e8033d034 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# 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 +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Kernel UI SWTBot Tests Plug-in diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/pom.xml b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/pom.xml new file mode 100644 index 0000000000..240f2fe19e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/pom.xml @@ -0,0 +1,51 @@ + + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests + 3.1.0-SNAPSHOT + eclipse-test-plugin + + Trace Compass LTTng Kernel UI SWTBot Tests Plug-in + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests + org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests.AllTests + true + false + ${tycho.testArgLine} ${base.ui.test.vmargs} + org.eclipse.platform.ide + + + 0 + + + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/AllTests.java b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/AllTests.java new file mode 100644 index 0000000000..dd242a71d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/AllTests.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * 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: + * Matthew Khouzam - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Test suite for UI on the lttng kernel perspective + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ImportAndReadKernelSmokeTest.class, + KernelPerspectiveChecker.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java new file mode 100644 index 0000000000..449fbe0a8d --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * 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: + * Matthew Khouzam - Initial API and implementation + * Marc-Andre Laperle + * Patrick Tasse - Add support for folder elements + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + +import java.util.List; + +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.Logger; +import org.apache.log4j.SimpleLayout; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesView; +import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; +import org.eclipse.linuxtools.tmf.core.signal.TmfTimeSynchSignal; +import org.eclipse.linuxtools.tmf.core.trace.ITmfContext; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.eclipse.linuxtools.tmf.ui.editors.TmfEventsEditor; +import org.eclipse.linuxtools.tmf.ui.swtbot.tests.SWTBotUtil; +import org.eclipse.linuxtools.tmf.ui.swtbot.tests.conditions.ConditionHelpers; +import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView; +import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; +import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory; +import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView; +import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; +import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; +import org.eclipse.swtbot.swt.finder.results.BoolResult; +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.ui.IEditorPart; +import org.eclipse.ui.IEditorReference; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IViewReference; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.WorkbenchException; +import org.hamcrest.Matcher; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * SWTBot Smoke test for LTTng Kernel UI. + * + * @author Matthew Khouzam + */ +@RunWith(SWTBotJunit4ClassRunner.class) +public class ImportAndReadKernelSmokeTest { + + private static final String TRACE_TYPE = "org.eclipse.linuxtools.lttng2.kernel.tracetype"; + private static final String KERNEL_PERSPECTIVE_ID = "org.eclipse.linuxtools.lttng2.kernel.ui.perspective"; + private static final String TRACE_PROJECT_NAME = "test"; + + private static SWTWorkbenchBot fBot; + public static CtfTmfTestTrace ctt = CtfTmfTestTrace.SYNTHETIC_TRACE; + private ITmfEvent fDesired1; + private ITmfEvent fDesired2; + + /** The Log4j logger instance. */ + private static final Logger fLogger = Logger.getRootLogger(); + + /** + * Test Class setup + */ + @BeforeClass + public static void init() { + SWTBotUtil.failIfUIThread(); + + /* set up for swtbot */ + SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */ + fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT)); + fBot = new SWTWorkbenchBot(); + + final List openViews = fBot.views(); + for (SWTBotView view : openViews) { + if (view.getTitle().equals("Welcome")) { + view.close(); + fBot.waitUntil(ConditionHelpers.ViewIsClosed(view)); + } + } + /* Switch perspectives */ + switchKernelPerspective(); + /* Finish waiting for eclipse to load */ + SWTBotUtil.waitForJobs(); + } + + private static void switchKernelPerspective() { + final Exception retE[] = new Exception[1]; + if (!UIThreadRunnable.syncExec(new BoolResult() { + @Override + public Boolean run() { + try { + PlatformUI.getWorkbench().showPerspective(KERNEL_PERSPECTIVE_ID, + PlatformUI.getWorkbench().getActiveWorkbenchWindow()); + } catch (WorkbenchException e) { + retE[0] = e; + return false; + } + return true; + } + })) { + fail(retE[0].getMessage()); + } + + } + + /** + * Main test case + */ + @Test + public void test() { + SWTBotUtil.createProject(TRACE_PROJECT_NAME); + SWTBotUtil.openTrace(TRACE_PROJECT_NAME, ctt.getPath(), TRACE_TYPE); + openEditor(); + testHV(getViewPart("Histogram")); + testCFV((ControlFlowView) getViewPart("Control Flow")); + testRV((ResourcesView) getViewPart("Resources")); + + fBot.closeAllEditors(); + SWTBotUtil.deleteProject(TRACE_PROJECT_NAME, fBot); + } + + private void openEditor() { + Matcher matcher = WidgetMatcherFactory.withPartName(ctt.getTrace().getName()); + IEditorPart iep = fBot.editor(matcher).getReference().getEditor(true); + fDesired1 = getEvent(100); + fDesired2 = getEvent(10000); + final TmfEventsEditor tmfEd = (TmfEventsEditor) iep; + UIThreadRunnable.syncExec(new VoidResult() { + @Override + public void run() { + tmfEd.setFocus(); + tmfEd.selectionChanged(new SelectionChangedEvent(tmfEd, new StructuredSelection(fDesired1))); + } + }); + + SWTBotUtil.waitForJobs(); + SWTBotUtil.delay(1000); + assertNotNull(tmfEd); + } + + private static void testCFV(ControlFlowView vp) { + assertNotNull(vp); + } + + private void testHV(IViewPart vp) { + SWTBotView hvBot = (new SWTWorkbenchBot()).viewById(HistogramView.ID); + List hvTools = hvBot.getToolbarButtons(); + for (SWTBotToolbarButton hvTool : hvTools) { + if (hvTool.getToolTipText().toLowerCase().contains("lost")) { + hvTool.click(); + } + } + HistogramView hv = (HistogramView) vp; + final TmfTimeSynchSignal signal = new TmfTimeSynchSignal(hv, fDesired1.getTimestamp()); + final TmfTimeSynchSignal signal2 = new TmfTimeSynchSignal(hv, fDesired2.getTimestamp()); + hv.updateTimeRange(100000); + SWTBotUtil.waitForJobs(); + hv.currentTimeUpdated(signal); + hv.broadcast(signal); + SWTBotUtil.waitForJobs(); + SWTBotUtil.delay(1000); + + hv.updateTimeRange(1000000000); + SWTBotUtil.waitForJobs(); + hv.currentTimeUpdated(signal2); + hv.broadcast(signal2); + SWTBotUtil.waitForJobs(); + SWTBotUtil.delay(1000); + assertNotNull(hv); + } + + private static void testRV(ResourcesView vp) { + assertNotNull(vp); + } + + private static CtfTmfEvent getEvent(int rank) { + try (CtfTmfTrace trace = CtfTmfTestTrace.SYNTHETIC_TRACE.getTrace()) { + ITmfContext ctx = trace.seekEvent(0); + for (int i = 0; i < rank; i++) { + trace.getNext(ctx); + } + return trace.getNext(ctx); + } + + } + + private static IViewPart getViewPart(final String viewTile) { + final IViewPart[] vps = new IViewPart[1]; + UIThreadRunnable.syncExec(new VoidResult() { + @Override + public void run() { + IViewReference[] viewRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences(); + for (IViewReference viewRef : viewRefs) { + IViewPart vp = viewRef.getView(true); + if (vp.getTitle().equals(viewTile)) { + vps[0] = vp; + return; + } + } + } + }); + + return vps[0]; + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/KernelPerspectiveChecker.java b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/KernelPerspectiveChecker.java new file mode 100644 index 0000000000..524f4d1a34 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/swtbot/tests/KernelPerspectiveChecker.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * 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: + * Matthew Khouzam - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests; + +import java.util.ArrayList; +import java.util.Arrays; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.PerspectiveFactory; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesView; +import org.eclipse.linuxtools.tmf.ui.swtbot.tests.AbstractPerspectiveChecker; +import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView; +import org.eclipse.linuxtools.tmf.ui.views.statistics.TmfStatisticsView; +import org.eclipse.ui.IPageLayout; +import org.junit.Before; + +/** + * Tracing perspective view checker + * + * @author Matthew Khouzam + */ +public class KernelPerspectiveChecker extends AbstractPerspectiveChecker { + + /** + * Set up arrays for test + */ + @Before + public void init() { + fPerspectiveId = PerspectiveFactory.ID; + fViewIds = new ArrayList<>(); + fViewIds.addAll(Arrays.asList(new String[] { + // LTTng views + HistogramView.ID, + ControlView.ID, + ControlFlowView.ID, + ResourcesView.ID, + TmfStatisticsView.ID, + // Standard Eclipse views + IPageLayout.ID_PROJECT_EXPLORER, + IPageLayout.ID_PROP_SHEET, + IPageLayout.ID_BOOKMARKS + })); + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.classpath b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.classpath new file mode 100644 index 0000000000..098194ca4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.project b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.project new file mode 100644 index 0000000000..ab30197ac1 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.kernel.ui.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..f3fc64575b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,393 @@ +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=enabled +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..62cfa90dee --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..87a3748dd2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.kernel.ui.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.ui, + org.eclipse.tracecompass.lttng2.kernel.ui;bundle-version="3.1.0" +Export-Package: org.eclipse.linuxtools.lttng2.kernel.ui.tests diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/about.html b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/build.properties b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/build.properties new file mode 100644 index 0000000000..f7a0b9854e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/build.properties @@ -0,0 +1,18 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties +src.includes = about.html diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/plugin.properties b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/plugin.properties new file mode 100644 index 0000000000..bb9fd16dac --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Kernel Analysis UI Tests Plug-in diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/pom.xml b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/pom.xml new file mode 100644 index 0000000000..67b168ee3e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/pom.xml @@ -0,0 +1,54 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.kernel.ui.tests + 3.1.0-SNAPSHOT + eclipse-test-plugin + + Trace Compass LTTng Kernel Analysis UI Tests Plug-in + + + + + + src + + **/*.java + + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + org.eclipse.tracecompass.lttng2.kernel.ui.tests + org.eclipse.linuxtools.lttng2.kernel.ui.tests.AllTests + true + true + ${tycho.testArgLine} ${base.ui.test.vmargs} + org.eclipse.platform.ide + + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/ActivatorTest.java b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/ActivatorTest.java new file mode 100644 index 0000000000..8a83b521d7 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/ActivatorTest.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.kernel.ui.tests; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Test suite for the Activator class + */ +public class ActivatorTest { + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#Activator()}. + */ + @Test + public void testActivator() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#getDefault()}. + */ + @Test + public void testGetDefault() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#start}. + */ + @Test + public void testStartBundleContext() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#stop}. + */ + @Test + public void testStopBundleContext() { + assertTrue(true); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/AllTests.java b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/AllTests.java new file mode 100644 index 0000000000..f37fdf03f0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui.tests/src/org/eclipse/linuxtools/lttng2/kernel/ui/tests/AllTests.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * 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 + * Alexandre Montplaisir - Port to JUnit4 + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.kernel.ui.tests; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Run the lttng2.ui unit tests. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ActivatorTest.class, +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/.classpath b/org.eclipse.tracecompass.lttng2.kernel.ui/.classpath new file mode 100644 index 0000000000..098194ca4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/.project b/org.eclipse.tracecompass.lttng2.kernel.ui/.project new file mode 100644 index 0000000000..9206b866ed --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.kernel.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..9f3662cd78 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,394 @@ +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.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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..d92b94fd4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.kernel.ui/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..0b26564cc9 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/META-INF/MANIFEST.MF @@ -0,0 +1,26 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.kernel.ui;singleton:=true +Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.kernel.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.linuxtools.tmf.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.ui;bundle-version="3.1.0", + org.eclipse.tracecompass.lttng2.control.core;bundle-version="3.1.0", + org.eclipse.tracecompass.lttng2.control.ui;bundle-version="3.1.0", + org.eclipse.tracecompass.lttng2.kernel.core;bundle-version="3.1.0" +Export-Package: org.eclipse.linuxtools.internal.lttng2.kernel.ui;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.tests", + org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events;x-internal:=true, + org.eclipse.linuxtools.internal.lttng2.kernel.ui.views;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests", + org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests", + org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.cpuusage;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests", + org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources;x-friends:="org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests" +Import-Package: com.google.common.collect diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/about.html b/org.eclipse.tracecompass.lttng2.kernel.ui/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/build.properties b/org.eclipse.tracecompass.lttng2.kernel.ui/build.properties new file mode 100644 index 0000000000..9775951f3b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/build.properties @@ -0,0 +1,23 @@ +############################################################################### +# 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 +############################################################################### + +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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/icons/eview16/control_flow_view.gif b/org.eclipse.tracecompass.lttng2.kernel.ui/icons/eview16/control_flow_view.gif new file mode 100644 index 0000000000..3971b50765 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.kernel.ui/icons/eview16/control_flow_view.gif differ diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/icons/eview16/resources_view.gif b/org.eclipse.tracecompass.lttng2.kernel.ui/icons/eview16/resources_view.gif new file mode 100644 index 0000000000..234486172c Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.kernel.ui/icons/eview16/resources_view.gif differ diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/icons/obj16/garland16.png b/org.eclipse.tracecompass.lttng2.kernel.ui/icons/obj16/garland16.png new file mode 100644 index 0000000000..74f9751638 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.kernel.ui/icons/obj16/garland16.png differ diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/plugin.properties b/org.eclipse.tracecompass.lttng2.kernel.ui/plugin.properties new file mode 100644 index 0000000000..96a73ce0ea --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/plugin.properties @@ -0,0 +1,23 @@ +############################################################################### +# 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 +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Kernel Analysis UI Plug-in + +kernel.perspective.name = LTTng Kernel + +controlflow.view.name = Control Flow +resources.view.name = Resources +cpuusage.view.name = CPU Usage + +tracetype.type.kernel = LTTng Kernel Trace +analysis.lttngkernel = LTTng Kernel Analysis diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/plugin.xml b/org.eclipse.tracecompass.lttng2.kernel.ui/plugin.xml new file mode 100644 index 0000000000..32138b69f3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/plugin.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/pom.xml b/org.eclipse.tracecompass.lttng2.kernel.ui/pom.xml new file mode 100644 index 0000000000..456b9dfdd8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.kernel.ui + 3.1.0-SNAPSHOT + eclipse-plugin + + Trace Compass LTTng Kernel Analysis UI Plug-in + + + + + + src + + **/*.java + + + + + + org.eclipse.tycho + tycho-source-plugin + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Activator.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Activator.java new file mode 100644 index 0000000000..1dd6e7b579 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Activator.java @@ -0,0 +1,184 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.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.linuxtools.lttng2.kernel.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)); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Messages.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Messages.java new file mode 100644 index 0000000000..a7d1f87162 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Messages.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * 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.linuxtools.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.linuxtools.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() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/messages.properties b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/messages.properties new file mode 100644 index 0000000000..03b880ebfe --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/messages.properties @@ -0,0 +1,43 @@ +############################################################################### +# 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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LttngEventTableColumns.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LttngEventTableColumns.java new file mode 100644 index 0000000000..da8b20f532 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/LttngEventTableColumns.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.ui.viewers.events; + +import java.util.Collection; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; +import org.eclipse.linuxtools.tmf.ui.viewers.events.columns.ITmfEventTableColumns; +import org.eclipse.linuxtools.tmf.ui.viewers.events.columns.TmfEventTableColumn; + +import com.google.common.collect.ImmutableList; + +/** + * Event table columns for LTTng 2.x kernel traces + */ +public class LttngEventTableColumns implements ITmfEventTableColumns { + + // ------------------------------------------------------------------------ + // Column definition + // ------------------------------------------------------------------------ + + @SuppressWarnings("null") + private static final @NonNull String CHANNEL_HEADER = Messages.EventsTable_channelColumn; + + @SuppressWarnings("null") + private static final @NonNull Collection LTTNG_COLUMNS = + ImmutableList. of( + TmfEventTableColumn.BaseColumns.TIMESTAMP, + new LttngChannelColumn(), + TmfEventTableColumn.BaseColumns.EVENT_TYPE, + TmfEventTableColumn.BaseColumns.CONTENTS); + + private static class LttngChannelColumn extends TmfEventTableColumn { + + public LttngChannelColumn() { + super(CHANNEL_HEADER); + } + + @Override + public String getItemString(ITmfEvent event) { + String ret = event.getReference(); + return (ret == null ? EMPTY_STRING : ret); + } + + @Override + public String getFilterFieldId() { + return ITmfEvent.EVENT_FIELD_REFERENCE; + } + } + + // ------------------------------------------------------------------------ + // Constructor + // ------------------------------------------------------------------------ + + @Override + public Collection getEventTableColumns() { + return LTTNG_COLUMNS; + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/Messages.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/Messages.java new file mode 100644 index 0000000000..d8c49487dc --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/Messages.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 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: + * Patrick Tassé - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events; + +import org.eclipse.osgi.util.NLS; + +@SuppressWarnings("javadoc") +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events.messages"; //$NON-NLS-1$ + public static String EventsTable_channelColumn; + public static String EventsTable_timestampColumn; + public static String EventsTable_typeColumn; + public static String EventsTable_contentColumn; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/messages.properties b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/messages.properties new file mode 100644 index 0000000000..faeb249dcf --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/viewers/events/messages.properties @@ -0,0 +1,16 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +EventsTable_channelColumn=Channel +EventsTable_timestampColumn=Timestamp +EventsTable_typeColumn=Event Type +EventsTable_contentColumn=Content diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/PerspectiveFactory.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/PerspectiveFactory.java new file mode 100644 index 0000000000..13bc181afb --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/PerspectiveFactory.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.ui.views; + +import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesView; +import org.eclipse.linuxtools.tmf.ui.project.wizards.NewTmfProjectWizard; +import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView; +import org.eclipse.linuxtools.tmf.ui.views.statistics.TmfStatisticsView; +import org.eclipse.ui.IFolderLayout; +import org.eclipse.ui.IPageLayout; +import org.eclipse.ui.IPerspectiveFactory; + +/** + * The default LTTng perspective. + */ +public class PerspectiveFactory implements IPerspectiveFactory { + + /** Perspective ID */ + public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.perspective"; //$NON-NLS-1$ + + // LTTng views + private static final String HISTOGRAM_VIEW_ID = HistogramView.ID; + private static final String CONTROL_VIEW_ID = ControlView.ID; + private static final String CONTROLFLOW_VIEW_ID = ControlFlowView.ID; + private static final String RESOURCES_VIEW_ID = ResourcesView.ID; + private static final String STATISTICS_VIEW_ID = TmfStatisticsView.ID; + + // Standard Eclipse views + private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER; + private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET; + private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS; + + @Override + public void createInitialLayout(IPageLayout layout) { + + layout.setEditorAreaVisible(true); + + addFastViews(layout); + addViewShortcuts(layout); + addPerspectiveShortcuts(layout); + + // Create the top left folder + IFolderLayout topLeftFolder = layout.createFolder( + "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ + topLeftFolder.addView(PROJECT_VIEW_ID); + + // Create the bottom left folder + IFolderLayout bottomLeftFolder = layout.createFolder( + "bottomLeftFolder", IPageLayout.BOTTOM, 0.70f, "topLeftFolder"); //$NON-NLS-1$ //$NON-NLS-2$ + bottomLeftFolder.addView(CONTROL_VIEW_ID); + + // Create the top right folder + IFolderLayout topRightFolder = layout.createFolder( + "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ + topRightFolder.addView(CONTROLFLOW_VIEW_ID); + topRightFolder.addView(RESOURCES_VIEW_ID); + topRightFolder.addView(STATISTICS_VIEW_ID); + + // Create the bottom right folder + IFolderLayout bottomRightFolder = layout.createFolder( + "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ + bottomRightFolder.addView(HISTOGRAM_VIEW_ID); + bottomRightFolder.addView(PROPERTIES_VIEW_ID); + bottomRightFolder.addView(BOOKMARKS_VIEW_ID); + + layout.addNewWizardShortcut(NewTmfProjectWizard.ID); + } + + /** + * Add fast views to the perspective + * + * @param layout + */ + private void addFastViews(IPageLayout layout) { + } + + /** + * Add view shortcuts to the perspective + * + * @param layout + */ + private void addViewShortcuts(IPageLayout layout) { + } + + /** + * Add perspective shortcuts to the perspective + * + * @param layout + */ + private void addPerspectiveShortcuts(IPageLayout layout) { + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowEntry.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowEntry.java new file mode 100644 index 0000000000..01145fd372 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowEntry.java @@ -0,0 +1,96 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.ui.views.controlflow; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.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$ + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowPresentationProvider.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowPresentationProvider.java new file mode 100644 index 0000000000..22fa932dc0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowPresentationProvider.java @@ -0,0 +1,211 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.ui.views.controlflow; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.StateValues; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages; +import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.StateItem; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.graphics.Rectangle; + +/** + * 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 getEventHoverToolTipInfo(ITimeEvent event) { + Map 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(), LttngKernelAnalysisModule.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 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(), LttngKernelAnalysisModule.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)); + Utils.drawText(gc, state.toString().substring(4), 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 */ + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java new file mode 100644 index 0000000000..3627e80aa9 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java @@ -0,0 +1,592 @@ +/******************************************************************************* + * 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.linuxtools.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.Nullable; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages; +import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; +import org.eclipse.linuxtools.tmf.ui.views.timegraph.AbstractTimeGraphView; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ILinkEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeGraphEntry; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeLinkEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils.Resolution; +import org.eclipse.linuxtools.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 { + + @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) { + if (trace == null) { + return; + } + ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysisModule.ID); + if (ssq == null) { + return; + } + + List entryList = new ArrayList<>(); + Map 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 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 execNameIntervals; + try { + execNameQuark = ssq.getQuarkRelative(threadQuark, Attributes.EXEC_NAME); + execNameIntervals = ssq.queryHistoryRange(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 = ssq.querySingleState(startTime, ppidQuark); + } catch (AttributeNotFoundException e) { + /* No info, keep PPID at -1 */ + } catch (StateSystemDisposedException e) { + /* SS is closing down, time to bail */ + break; + } + int ppid = -1; + if (!(ppidInterval == null) && !ppidInterval.getStateValue().isNull()) { + 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 entryList, ITmfTrace parentTrace) { + List rootListToAdd = new ArrayList<>(); + List rootListToRemove = new ArrayList<>(); + List rootList = getEntryList(parentTrace); + + for (ControlFlowEntry entry : entryList) { + boolean root = (entry.getParent() == null); + if (root && entry.getParentThreadId() > 0) { + for (ControlFlowEntry parent : entryList) { + if (parent.getThreadId() == entry.getParentThreadId() && + entry.getStartTime() >= parent.getStartTime() && + entry.getStartTime() <= parent.getEndTime()) { + 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, IProgressMonitor monitor, long start, long end) { + if (start < entry.getEndTime() && end > entry.getStartTime()) { + ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysisModule.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 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 getEventList(TimeGraphEntry tgentry, long startTime, long endTime, long resolution, IProgressMonitor monitor) { + List 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; + } + ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysisModule.ID); + if (ssq == null) { + return null; + } + try { + int statusQuark = ssq.getQuarkRelative(entry.getThreadQuark(), Attributes.STATUS); + List statusIntervals = ssq.queryHistoryRange(statusQuark, realStart, realEnd - 1, 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 (AttributeNotFoundException | TimeRangeException e) { + e.printStackTrace(); + } catch (StateSystemDisposedException e) { + /* Ignored */ + } + 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, LttngKernelAnalysisModule.ID); + if (ssq == null) { + continue; + } + if (time >= ssq.getStartTime() && time <= ssq.getCurrentEndTime()) { + List 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 getLinkList(long startTime, long endTime, long resolution, IProgressMonitor monitor) { + List list = new ArrayList<>(); + ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace()); + List entryList = getEntryList(getTrace()); + if (traces == null || entryList == null) { + return list; + } + for (ITmfTrace trace : traces) { + if (trace == null) { + continue; + } + ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysisModule.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 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 currentThreadIntervals = ssq.queryHistoryRange(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 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; + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageComposite.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageComposite.java new file mode 100644 index 0000000000..a56b3f3e83 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageComposite.java @@ -0,0 +1,321 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.ui.views.cpuusage; + +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.jdt.annotation.NonNull; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerComparator; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; +import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; +import org.eclipse.linuxtools.lttng2.kernel.core.cpuusage.LttngKernelCpuUsageAnalysis; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; +import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ui.viewers.tree.AbstractTmfTreeViewer; +import org.eclipse.linuxtools.tmf.ui.viewers.tree.ITmfTreeColumnDataProvider; +import org.eclipse.linuxtools.tmf.ui.viewers.tree.ITmfTreeViewerEntry; +import org.eclipse.linuxtools.tmf.ui.viewers.tree.TmfTreeColumnData; +import org.eclipse.linuxtools.tmf.ui.viewers.tree.TmfTreeColumnData.ITmfColumnPercentageProvider; +import org.eclipse.linuxtools.tmf.ui.viewers.tree.TmfTreeViewerEntry; +import org.eclipse.osgi.util.NLS; +import org.eclipse.swt.widgets.Composite; + +/** + * 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 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 getColumnData() { + /* All columns are sortable */ + List 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())) { + @SuppressWarnings("null") + @NonNull List list = Collections.singletonList(entry); + super.setSelection(list); + return; + } + } + } + } + } + + @Override + public void initializeDataSource() { + fModule = getTrace().getAnalysisModuleOfClass(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 cpuUsageMap = fModule.getCpuUsageInRange(Math.max(start, getStartTime()), Math.min(end, getEndTime())); + + TmfTreeViewerEntry root = new TmfTreeViewerEntry(""); //$NON-NLS-1$ + List entryList = root.getChildren(); + + for (Entry 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, LttngKernelAnalysisModule.ID); + if (kernelSs == null) { + return tid; + } + + try { + int cpusNode = kernelSs.getQuarkAbsolute(Attributes.THREADS); + + /* Get the quarks for each cpu */ + List cpuNodes = kernelSs.getSubAttributes(cpusNode, false); + + for (Integer tidQuark : cpuNodes) { + if (kernelSs.getAttributeName(tidQuark).equals(tid)) { + int execNameQuark; + List execNameIntervals; + try { + execNameQuark = kernelSs.getQuarkRelative(tidQuark, Attributes.EXEC_NAME); + execNameIntervals = kernelSs.queryHistoryRange(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; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageEntry.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageEntry.java new file mode 100644 index 0000000000..79bb0ce26e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageEntry.java @@ -0,0 +1,86 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.ui.views.cpuusage; + +import org.eclipse.linuxtools.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; + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageView.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageView.java new file mode 100644 index 0000000000..d2d8a1ed23 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageView.java @@ -0,0 +1,103 @@ +/******************************************************************************* + * 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.linuxtools.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.linuxtools.tmf.core.signal.TmfTraceSelectedSignal; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ui.views.TmfView; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; + +/** + * 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(); + } + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageXYViewer.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageXYViewer.java new file mode 100644 index 0000000000..e2167ef594 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/CpuUsageXYViewer.java @@ -0,0 +1,210 @@ +/******************************************************************************* + * 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.linuxtools.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.linuxtools.internal.lttng2.kernel.ui.Activator; +import org.eclipse.linuxtools.lttng2.kernel.core.cpuusage.LttngKernelCpuUsageAnalysis; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.tmf.ui.viewers.xycharts.linecharts.TmfCommonXLineChartViewer; +import org.eclipse.swt.widgets.Composite; + +/** + * 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 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 = getTrace().getAnalysisModuleOfClass(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 cpuUsageMap = fModule.getCpuUsageInRange(Math.max(start, traceStart), Math.min(end, traceEnd)); + Map 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 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 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 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(); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/Messages.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/Messages.java new file mode 100644 index 0000000000..6b70d8cd28 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/Messages.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * 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.linuxtools.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.linuxtools.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() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/messages.properties b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/messages.properties new file mode 100644 index 0000000000..bca6d6ab3c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/cpuusage/messages.properties @@ -0,0 +1,23 @@ +############################################################################### +# 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 diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java new file mode 100644 index 0000000000..c67d0e6263 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.ui.views.resources; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeGraphEntry; + +/** + * An entry, or row, in the resource view + * + * @author Patrick Tasse + */ +public class ResourcesEntry extends TimeGraphEntry implements Comparable { + + /** 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()); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesPresentationProvider.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesPresentationProvider.java new file mode 100644 index 0000000000..fc326f501f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesPresentationProvider.java @@ -0,0 +1,368 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.kernel.ui.views.resources; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.StateValues; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type; +import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.StateItem; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.NullTimeEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.ITmfTimeGraphDrawingHelper; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils.Resolution; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat; +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; + +/** + * 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 getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) { + + Map 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(), LttngKernelAnalysisModule.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 fullState = ss.queryFullState(event.getTime()); + List 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 fullState = ss.queryFullState(event.getTime()); + List 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(), LttngKernelAnalysisModule.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; + beginIndex = 4; // skip the 'sys_' + } + 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; + } +} diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java new file mode 100644 index 0000000000..798a0e49c9 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java @@ -0,0 +1,321 @@ +/******************************************************************************* + * 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.linuxtools.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.linuxtools.internal.lttng2.kernel.core.Attributes; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages; +import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type; +import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ui.views.timegraph.AbstractTimeGraphView; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.NullTimeEvent; +import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent; +import org.eclipse.linuxtools.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) { + if (trace == null) { + return; + } + ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysisModule.ID); + if (ssq == null) { + return; + } + Comparator comparator = new Comparator() { + @Override + public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) { + return ((ResourcesEntry) o1).compareTo(o2); + } + }; + + Map 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 entryList = Collections.singletonList(traceEntry); + addToEntryList(parentTrace, entryList); + } else { + traceEntry.updateEndTime(endTime); + } + + List 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 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 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 eventList = getEventList(entry, start, endTime, resolution, monitor); + if (eventList != null) { + for (ITimeEvent event : eventList) { + entry.addEvent(event); + } + } + redraw(); + } + } + + start = end; + } + } + + @Override + protected @Nullable List getEventList(TimeGraphEntry entry, + long startTime, long endTime, long resolution, + IProgressMonitor monitor) { + ResourcesEntry resourcesEntry = (ResourcesEntry) entry; + ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(resourcesEntry.getTrace(), LttngKernelAnalysisModule.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 eventList = null; + int quark = resourcesEntry.getQuark(); + + try { + if (resourcesEntry.getType().equals(Type.CPU)) { + int statusQuark = ssq.getQuarkRelative(quark, Attributes.STATUS); + List statusIntervals = ssq.queryHistoryRange(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 irqIntervals = ssq.queryHistoryRange(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 softIrqIntervals = ssq.queryHistoryRange(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; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.kernel/.project b/org.eclipse.tracecompass.lttng2.kernel/.project new file mode 100644 index 0000000000..2c8611bfd5 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel/.project @@ -0,0 +1,17 @@ + + + org.eclipse.tracecompass.lttng2.kernel + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/org.eclipse.tracecompass.lttng2.kernel/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.kernel/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.kernel/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.kernel/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.kernel/build.properties b/org.eclipse.tracecompass.lttng2.kernel/build.properties new file mode 100644 index 0000000000..c0db4e0a72 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel/build.properties @@ -0,0 +1,15 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +bin.includes = feature.xml,\ + feature.properties,\ + p2.inf diff --git a/org.eclipse.tracecompass.lttng2.kernel/feature.properties b/org.eclipse.tracecompass.lttng2.kernel/feature.properties new file mode 100644 index 0000000000..00d592ccb2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel/feature.properties @@ -0,0 +1,22 @@ +############################################################################### +# Copyright (c) 2009, 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: +# Ericsson - Initial API and implementation +############################################################################### + +featureName=LTTng Kernel Analysis + +description=Plug-ins to integrate LTTng kernel analysis tools into the workbench. \ +Includes the LTTng (Linux Tracing Toolkit), TMF (Tracing and Monitoring Framework) \ +and CTF (Common Trace Format) features. + +featureProvider=Eclipse Linux Tools + +copyright=Copyright 2013 Ericsson + diff --git a/org.eclipse.tracecompass.lttng2.kernel/feature.xml b/org.eclipse.tracecompass.lttng2.kernel/feature.xml new file mode 100644 index 0000000000..153f30a87e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel/feature.xml @@ -0,0 +1,71 @@ + + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.kernel/p2.inf b/org.eclipse.tracecompass.lttng2.kernel/p2.inf new file mode 100644 index 0000000000..5246a0c824 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel/p2.inf @@ -0,0 +1,3 @@ +instructions.configure=\ +org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:0,name:Linux Tools,enabled:false); \ +org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:1,name:Linux Tools,enabled:false); diff --git a/org.eclipse.tracecompass.lttng2.kernel/pom.xml b/org.eclipse.tracecompass.lttng2.kernel/pom.xml new file mode 100644 index 0000000000..12bc034feb --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.kernel/pom.xml @@ -0,0 +1,64 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.kernel + 3.2.0-SNAPSHOT + eclipse-feature + + Trace Compass LTTng Kernel Analysis Feature + + org.eclipse.tracecompass + + + + + org.eclipse.tycho.extras + tycho-source-feature-plugin + + + source-feature + package + + source-feature + + + + + + + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + attached-p2-metadata + package + + p2-metadata + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/.classpath b/org.eclipse.tracecompass.lttng2.ust.core.tests/.classpath new file mode 100644 index 0000000000..098194ca4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/.project b/org.eclipse.tracecompass.lttng2.ust.core.tests/.project new file mode 100644 index 0000000000..1ebf5c3a05 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.ust.core.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..f3fc64575b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,393 @@ +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=enabled +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..62cfa90dee --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.ust.core.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..01a0499a2c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.ust.core.tests;singleton:=true +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.junit;bundle-version="4.0.0", + org.eclipse.core.resources, + org.eclipse.core.runtime, + org.eclipse.linuxtools.tmf.core, + org.eclipse.linuxtools.tmf.core.tests;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.ctf.core, + org.eclipse.linuxtools.tmf.ctf.core.tests, + org.eclipse.tracecompass.lttng2.ust.core, + org.eclipse.tracecompass.lttng2.control.core +Export-Package: org.eclipse.linuxtools.lttng2.ust.core.tests, + org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack +Import-Package: com.google.common.collect diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/about.html b/org.eclipse.tracecompass.lttng2.ust.core.tests/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/build.properties b/org.eclipse.tracecompass.lttng2.ust.core.tests/build.properties new file mode 100644 index 0000000000..ddfbe617f6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/build.properties @@ -0,0 +1,19 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties +src.includes = about.html diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/plugin.properties b/org.eclipse.tracecompass.lttng2.ust.core.tests/plugin.properties new file mode 100644 index 0000000000..d07c5e70f2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Userspace Tracer Analysis Core Tests Plug-in diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/pom.xml b/org.eclipse.tracecompass.lttng2.ust.core.tests/pom.xml new file mode 100644 index 0000000000..45edebee97 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/pom.xml @@ -0,0 +1,42 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.ust.core.tests + 3.1.0-SNAPSHOT + eclipse-test-plugin + + Trace Compass LTTng Userspace Tracer Analysis Core Test Plug-in + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + false + false + org.eclipse.platform.ide + + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/ActivatorTest.java b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/ActivatorTest.java new file mode 100644 index 0000000000..31014bc395 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/ActivatorTest.java @@ -0,0 +1,96 @@ +/******************************************************************************* + * Copyright (c) 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.linuxtools.lttng2.ust.core.tests; + +import junit.framework.TestCase; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * ActivatorTest + *

+ * Test suite for the Activator class + *

+ */ +@SuppressWarnings("javadoc") +public class ActivatorTest extends TestCase { + + // ------------------------------------------------------------------------ + // JUnit + // ------------------------------------------------------------------------ + + @BeforeClass + public static void setUpBeforeClass() { + } + + @AfterClass + public static void tearDownAfterClass() { + } + + /** + * @throws java.lang.Exception + */ + @Before + @Override + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + @Override + public void tearDown() throws Exception { + } + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#Activator()}. + */ + @Test + public void testActivator() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#getDefault()}. + */ + @Test + public void testGetDefault() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#start(org.osgi.framework.BundleContext)}. + */ + @Test + public void testStartBundleContext() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.core.Activator#stop(org.osgi.framework.BundleContext)}. + */ + @Test + public void testStopBundleContext() { + assertTrue(true); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/AllTests.java b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/AllTests.java new file mode 100644 index 0000000000..62e904d9f3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/AllTests.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 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.linuxtools.lttng2.ust.core.tests; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Runner for the lttng2.kernel unit tests. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ActivatorTest.class, + org.eclipse.linuxtools.lttng2.ust.core.tests.analysis.memory.AllTests.class, + org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack.AllTests.class +}) +public class AllTests { } diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/AllTests.java b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/AllTests.java new file mode 100644 index 0000000000..98924bc4d6 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/AllTests.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * 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: + * Guilliano Molaire - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.ust.core.tests.analysis.memory; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Test suite. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + UstMemoryAnalysisModuleTest.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/UstMemoryAnalysisModuleTest.java b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/UstMemoryAnalysisModuleTest.java new file mode 100644 index 0000000000..cbf456347a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/analysis/memory/UstMemoryAnalysisModuleTest.java @@ -0,0 +1,101 @@ +/******************************************************************************* + * 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: + * Guilliano Molaire - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.ust.core.tests.analysis.memory; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Set; + +import org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage.UstMemoryStrings; +import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; +import org.eclipse.linuxtools.lttng2.ust.core.analysis.memory.UstMemoryAnalysisModule; +import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement; +import org.junit.Before; +import org.junit.Test; + +import com.google.common.collect.ImmutableSet; + +/** + * Tests for the {@link UstMemoryAnalysisModule} + * + * @author Guilliano Molaire + */ +public class UstMemoryAnalysisModuleTest { + + /** The analysis module */ + private UstMemoryAnalysisModule fUstAnalysisModule; + + /** + * Set-up the test + */ + @Before + public void setup() { + fUstAnalysisModule = new UstMemoryAnalysisModule(); + } + + /** + * Test for {@link UstMemoryAnalysisModule#getAnalysisRequirements()} + */ + @Test + public void testGetAnalysisRequirements() { + Iterable requirements = fUstAnalysisModule.getAnalysisRequirements(); + assertNotNull(requirements); + assertTrue(requirements.iterator().hasNext()); + + /* There should be the event and domain type */ + TmfAnalysisRequirement eventReq = null; + TmfAnalysisRequirement domainReq = null; + int numberOfRequirement = 0; + for (TmfAnalysisRequirement requirement : requirements) { + ++numberOfRequirement; + if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_EVENT)) { + eventReq = requirement; + } else if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN)) { + domainReq = requirement; + } + } + assertNotNull(eventReq); + assertNotNull(domainReq); + + /* There should be two requirements */ + assertEquals(2, numberOfRequirement); + + /* Verify the content of the requirements themselves */ + /* Domain should be kernel */ + assertEquals(1, domainReq.getValues().size()); + for (String domain : domainReq.getValues()) { + assertEquals(SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST, domain); + } + + /* Events */ + Set expectedEvents = ImmutableSet.of( + UstMemoryStrings.MALLOC, + UstMemoryStrings.FREE, + UstMemoryStrings.CALLOC, + UstMemoryStrings.REALLOC, + UstMemoryStrings.MEMALIGN, + UstMemoryStrings.POSIX_MEMALIGN + ); + + assertEquals(6, eventReq.getValues().size()); + for (String event : eventReq.getValues()) { + assertTrue("Unexpected event " + event, expectedEvents.contains(event)); + } + + Set infos = eventReq.getInformation(); + assertEquals(2, infos.size()); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java new file mode 100644 index 0000000000..68841f0f16 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java @@ -0,0 +1,281 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.ust.core.tests.trace.callstack; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; +import java.util.List; + +import org.eclipse.linuxtools.internal.lttng2.ust.core.trace.callstack.LttngUstCallStackProvider; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; +import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp; +import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestRule; +import org.junit.rules.Timeout; + +/** + * Base class for the UST callstack state provider tests. + * + * @author Alexandre Montplaisir + */ +public abstract class AbstractProviderTest { + + /** Time-out tests after 20 seconds */ + @Rule public TestRule globalTimeout= new Timeout(20000); + + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + private static final CtfTmfTestTrace otherUstTrace = CtfTmfTestTrace.HELLO_LOST; + + private CtfTmfTrace fTrace = null; + private ITmfStateSystem fSS = null; + private TestLttngCallStackModule fModule; + + + // ------------------------------------------------------------------------ + // Abstract methods + // ------------------------------------------------------------------------ + + /** + * @return The test trace to use for this test + */ + protected abstract CtfTmfTestTrace getTestTrace(); + + /** + * @return The name of the executable process in that particular trace + */ + protected abstract String getProcName(); + + /** + * Get the list of timestamps to query in that trace. + * + * @param index + * Which of the test timestamps? + * @return That particular timestamp + */ + protected abstract long getTestTimestamp(int index); + + // ------------------------------------------------------------------------ + // Maintenance + // ------------------------------------------------------------------------ + + /** + * Perform pre-class initialization. + */ + @Before + public void setUp() { + CtfTmfTestTrace testTrace = getTestTrace(); + + fTrace = testTrace.getTrace(); + fModule = new TestLttngCallStackModule(); + try { + fModule.setTrace(fTrace); + } catch (TmfAnalysisException e) { + fail(); + } + fModule.schedule(); + assertTrue(fModule.waitForCompletion()); + + fSS = fModule.getStateSystem(); + assertNotNull(fSS); + } + + /** + * Perform post-class clean-up. + */ + @After + public void tearDown() { + fModule.close(); + if (fTrace != null) { + fTrace.dispose(); + File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(fTrace)); + deleteDirectory(suppDir); + } + } + + // ------------------------------------------------------------------------ + // Test methods + // ------------------------------------------------------------------------ + + /** + * Test the handling of generic UST traces who do not contain the required + * information. + */ + @Test + public void testOtherUstTrace() { + /* Initialize the trace and analysis module */ + File suppDir; + try (CtfTmfTrace ustTrace = otherUstTrace.getTrace();) { + try (TestLttngCallStackModule module = new TestLttngCallStackModule();) { + try { + module.setTrace(ustTrace); + } catch (TmfAnalysisException e) { + fail(); + } + module.schedule(); + assertTrue(module.waitForCompletion()); + + /* Make sure the generated state system exists, but is empty */ + ITmfStateSystem ss = module.getStateSystem(); + assertNotNull(ss); + assertTrue(ss.getStartTime() >= ustTrace.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue()); + assertEquals(0, ss.getNbAttributes()); + } + suppDir = new File(TmfTraceManager.getSupplementaryFileDir(ustTrace)); + } + deleteDirectory(suppDir); + assertFalse(suppDir.exists()); + } + + /** + * Test that the callstack state system is there and contains data. + */ + @Test + public void testConstruction() { + assertNotNull(fSS); + assertTrue(fSS.getNbAttributes() > 0); + } + + /** + * Test the callstack at the beginning of the state system. + */ + @Test + public void testCallStackBegin() { + long start = fSS.getStartTime(); + String[] cs = getCallStack(fSS, getProcName(), start); + assertEquals(1, cs.length); + + assertEquals("40472b", cs[0]); + } + + /** + * Test the callstack somewhere in the trace. + */ + @Test + public void testCallStack1() { + String[] cs = getCallStack(fSS, getProcName(), getTestTimestamp(0)); + assertEquals(2, cs.length); + + assertEquals("40472b", cs[0]); + assertEquals("403d60", cs[1]); + } + + /** + * Test the callstack somewhere in the trace. + */ + @Test + public void testCallStack2() { + String[] cs = getCallStack(fSS, getProcName(), getTestTimestamp(1)); + assertEquals(3, cs.length); + + assertEquals("40472b", cs[0]); + assertEquals("403b14", cs[1]); + assertEquals("401b23", cs[2]); + } + + /** + * Test the callstack somewhere in the trace. + */ + @Test + public void testCallStack3() { + String[] cs = getCallStack(fSS, getProcName(), getTestTimestamp(2)); + assertEquals(4, cs.length); + + assertEquals("40472b", cs[0]); + assertEquals("4045c8", cs[1]); + assertEquals("403760", cs[2]); + assertEquals("401aac", cs[3]); + } + + /** + * Test the callstack at the end of the trace/state system. + */ + @Test + public void testCallStackEnd() { + long end = fSS.getCurrentEndTime(); + String[] cs = getCallStack(fSS, getProcName(), end); + assertEquals(3, cs.length); + + assertEquals("40472b", cs[0]); + assertEquals("4045c8", cs[1]); + assertEquals("403760", cs[2]); + } + + // ------------------------------------------------------------------------ + // Utility methods + // ------------------------------------------------------------------------ + + /** Empty and delete a directory */ + private static void deleteDirectory(File dir) { + /* Assuming the dir only contains file or empty directories */ + for (File file : dir.listFiles()) { + file.delete(); + } + dir.delete(); + } + + /** Get the callstack for the given timestamp, for this particular trace */ + private static String[] getCallStack(ITmfStateSystem ss, String processName, long timestamp) { + try { + int stackAttribute = ss.getQuarkAbsolute("Threads", processName, "CallStack"); + List state = ss.queryFullState(timestamp); + int depth = state.get(stackAttribute).getStateValue().unboxInt(); + + int stackTop = ss.getQuarkRelative(stackAttribute, String.valueOf(depth)); + ITmfStateValue top = state.get(stackTop).getStateValue(); + assertEquals(top, ss.querySingleStackTop(timestamp, stackAttribute).getStateValue()); + + String[] ret = new String[depth]; + for (int i = 0; i < depth; i++) { + int quark = ss.getQuarkRelative(stackAttribute, String.valueOf(i + 1)); + ret[i] = state.get(quark).getStateValue().unboxStr(); + } + return ret; + + } catch (AttributeNotFoundException e) { + fail(e.getMessage()); + } catch (StateSystemDisposedException e) { + fail(e.getMessage()); + } + fail(); + return null; + } + + private class TestLttngCallStackModule extends TmfStateSystemAnalysisModule { + + @Override + protected ITmfStateProvider createStateProvider() { + return new LttngUstCallStackProvider(getTrace()); + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AllTests.java b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AllTests.java new file mode 100644 index 0000000000..d34690034f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AllTests.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 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 implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Test suite for org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + LttngUstCallStackProviderFastTest.class, + LttngUstCallStackProviderTest.class +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderFastTest.java b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderFastTest.java new file mode 100644 index 0000000000..fccfd93ec2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderFastTest.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * 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: + * Alexandre Montplaisir - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack; + +import static org.junit.Assume.assumeTrue; + +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.junit.BeforeClass; + +/** + * Test suite for the UST callstack state provider, using the trace of a program + * instrumented with lttng-ust-cyg-profile-fast.so tracepoints. These do not + * contain the function addresses in the func_exit events. + * + * @author Alexandre Montplaisir + */ +public class LttngUstCallStackProviderFastTest extends AbstractProviderTest { + + private static final long[] timestamps = { 1379361250310000000L, + 1379361250498400000L, + 1379361250499759000L }; + + /** + * Class setup + */ + @BeforeClass + public static void setUpClass() { + assumeTrue(CtfTmfTestTrace.CYG_PROFILE_FAST.exists()); + } + + @Override + protected CtfTmfTestTrace getTestTrace() { + return CtfTmfTestTrace.CYG_PROFILE_FAST; + } + + @Override + protected String getProcName() { + return "glxgears-29822"; + } + + @Override + protected long getTestTimestamp(int index) { + return timestamps[index]; + } + +} \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderTest.java b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderTest.java new file mode 100644 index 0000000000..e27e7627b9 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/LttngUstCallStackProviderTest.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * 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: + * Alexandre Montplaisir - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.ust.core.tests.trace.callstack; + +import static org.junit.Assume.assumeTrue; + +import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; +import org.junit.BeforeClass; + +/** + * Test suite for the UST callstack state provider, using the trace of a program + * instrumented with lttng-ust-cyg-profile.so tracepoints. + * + * @author Alexandre Montplaisir + */ +public class LttngUstCallStackProviderTest extends AbstractProviderTest { + + private static final long[] timestamps = { 1378850463600000000L, + 1378850463770000000L, + 1378850463868753000L }; + + /** + * Class setup + */ + @BeforeClass + public static void setUpClass() { + assumeTrue(CtfTmfTestTrace.CYG_PROFILE.exists()); + } + + @Override + protected CtfTmfTestTrace getTestTrace() { + return CtfTmfTestTrace.CYG_PROFILE; + } + + @Override + protected String getProcName() { + return "glxgears-16073"; + } + + @Override + protected long getTestTimestamp(int index) { + return timestamps[index]; + } + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core/.classpath b/org.eclipse.tracecompass.lttng2.ust.core/.classpath new file mode 100644 index 0000000000..098194ca4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.ust.core/.project b/org.eclipse.tracecompass.lttng2.ust.core/.project new file mode 100644 index 0000000000..4293adb77e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.ust.core + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..9f3662cd78 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,394 @@ +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.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 diff --git a/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..d92b94fd4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.core/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.ust.core/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..02964ccc9f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.ust.core;singleton:=true +Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.ust.core.Activator +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: org.eclipse.linuxtools.internal.lttng2.ust.core;x-internal:=true, + org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui,org.eclipse.tracecompass.lttng2.ust.core.tests", + org.eclipse.linuxtools.internal.lttng2.ust.core.trace.callstack;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui,org.eclipse.tracecompass.lttng2.ust.core.tests", + org.eclipse.linuxtools.lttng2.ust.core.analysis.memory, + org.eclipse.linuxtools.lttng2.ust.core.trace +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.tracecompass.ctf.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.ctf.core, + org.eclipse.tracecompass.lttng2.control.core +Import-Package: com.google.common.collect diff --git a/org.eclipse.tracecompass.lttng2.ust.core/about.html b/org.eclipse.tracecompass.lttng2.ust.core/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.ust.core/build.properties b/org.eclipse.tracecompass.lttng2.ust.core/build.properties new file mode 100644 index 0000000000..61172cf72c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/build.properties @@ -0,0 +1,20 @@ +############################################################################### +# 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 +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + plugin.xml +src.includes = about.html diff --git a/org.eclipse.tracecompass.lttng2.ust.core/plugin.properties b/org.eclipse.tracecompass.lttng2.ust.core/plugin.properties new file mode 100644 index 0000000000..db7013a862 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/plugin.properties @@ -0,0 +1,16 @@ +############################################################################### +# 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 +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Userspace Tracer Analysis Core Plug-in + +tracetype.type.ust = LTTng UST Trace diff --git a/org.eclipse.tracecompass.lttng2.ust.core/plugin.xml b/org.eclipse.tracecompass.lttng2.ust.core/plugin.xml new file mode 100644 index 0000000000..8d536c340e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/plugin.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.ust.core/pom.xml b/org.eclipse.tracecompass.lttng2.ust.core/pom.xml new file mode 100644 index 0000000000..af958d3343 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/pom.xml @@ -0,0 +1,36 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.ust.core + 3.1.0-SNAPSHOT + eclipse-plugin + + Trace Compass LTTng Userspace Tracer Analysis Core Plug-in + + + + + org.eclipse.tycho + tycho-source-plugin + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/Activator.java b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/Activator.java new file mode 100644 index 0000000000..cdc004e903 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/Activator.java @@ -0,0 +1,137 @@ +/******************************************************************************* + * Copyright (c) 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.linuxtools.internal.lttng2.ust.core; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; +import org.osgi.framework.BundleContext; + +/** + * Activator + *

+ * 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.linuxtools.lttng2.ust.core"; //$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); + } + + /** + * 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)); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java new file mode 100644 index 0000000000..eadbc058c3 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java @@ -0,0 +1,200 @@ +/********************************************************************** + * Copyright (c) 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: + * Matthew Khouzam - Initial API and implementation + * Geneviève Bastien - Memory is per thread and only total is kept + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.linuxtools.lttng2.ust.core.trace.LttngUstTrace; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.statesystem.core.statevalue.TmfStateValue; +import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; +import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; +import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent; + +/** + * State provider to track the memory of the threads using the UST libc wrapper + * memory events. + * + * @author Matthew Khouzam + * @author Geneviève Bastien + */ +public class MemoryUsageStateProvider extends AbstractTmfStateProvider { + + /* Version of this state provider */ + private static final int VERSION = 1; + + /* Maps a pointer to a memory zone to the size of the memory */ + private final Map fMemory = new HashMap<>(); + + private static final Long MINUS_ONE = Long.valueOf(-1); + private static final Long ZERO = Long.valueOf(0); + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ + + /** + * Constructor + * + * @param trace + * trace + */ + public MemoryUsageStateProvider(LttngUstTrace trace) { + super(trace, CtfTmfEvent.class, "Ust:Memory"); //$NON-NLS-1$ + } + + @Override + protected void eventHandle(ITmfEvent event) { + String name = event.getType().getName(); + switch (name) { + case UstMemoryStrings.MALLOC: { + Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); + if (ZERO.equals(ptr)) { + return; + } + Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); + setMem(event, ptr, size); + } + break; + case UstMemoryStrings.FREE: { + Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); + if (ZERO.equals(ptr)) { + return; + } + setMem(event, ptr, ZERO); + } + break; + case UstMemoryStrings.CALLOC: { + Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); + if (ZERO.equals(ptr)) { + return; + } + Long nmemb = (Long) event.getContent().getField(UstMemoryStrings.FIELD_NMEMB).getValue(); + Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); + setMem(event, ptr, size * nmemb); + } + break; + case UstMemoryStrings.REALLOC: { + Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); + if (ZERO.equals(ptr)) { + return; + } + Long newPtr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_INPTR).getValue(); + Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); + setMem(event, ptr, ZERO); + setMem(event, newPtr, size); + } + break; + case UstMemoryStrings.MEMALIGN: { + Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_PTR).getValue(); + if (ZERO.equals(ptr)) { + return; + } + Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); + setMem(event, ptr, size); + } + break; + case UstMemoryStrings.POSIX_MEMALIGN: { + Long ptr = (Long) event.getContent().getField(UstMemoryStrings.FIELD_OUTPTR).getValue(); + if (ZERO.equals(ptr)) { + return; + } + Long size = (Long) event.getContent().getField(UstMemoryStrings.FIELD_SIZE).getValue(); + setMem(event, ptr, size); + } + break; + default: + break; + } + + } + + @Override + public ITmfStateProvider getNewInstance() { + return new MemoryUsageStateProvider(getTrace()); + } + + @Override + public LttngUstTrace getTrace() { + return (LttngUstTrace) super.getTrace(); + } + + @Override + public int getVersion() { + return VERSION; + } + + private static Long getVtid(ITmfEvent event) { + ITmfEventField field = event.getContent().getField(UstMemoryStrings.CONTEXT_VTID); + if (field == null) { + return MINUS_ONE; + } + return (Long) field.getValue(); + } + + private static String getProcname(ITmfEvent event) { + ITmfEventField field = event.getContent().getField(UstMemoryStrings.CONTEXT_PROCNAME); + if (field == null) { + return EMPTY_STRING; + } + return (String) field.getValue(); + } + + private void setMem(ITmfEvent event, Long ptr, Long size) { + long ts = event.getTimestamp().getValue(); + Long tid = getVtid(event); + + Long memoryDiff = size; + /* Size is 0, it means it was deleted */ + if (ZERO.equals(size)) { + Long memSize = fMemory.remove(ptr); + if (memSize == null) { + return; + } + memoryDiff = -memSize; + } else { + fMemory.put(ptr, size); + } + try { + int tidQuark = ss.getQuarkAbsoluteAndAdd(tid.toString()); + int tidMemQuark = ss.getQuarkRelativeAndAdd(tidQuark, UstMemoryStrings.UST_MEMORY_MEMORY_ATTRIBUTE); + + ITmfStateValue prevMem = ss.queryOngoingState(tidMemQuark); + /* First time we set this value */ + if (prevMem.isNull()) { + int procNameQuark = ss.getQuarkRelativeAndAdd(tidQuark, UstMemoryStrings.UST_MEMORY_PROCNAME_ATTRIBUTE); + String procName = getProcname(event); + /* + * No tid/procname for the event for the event, added to a + * 'others' thread + */ + if (tid.equals(MINUS_ONE)) { + procName = UstMemoryStrings.OTHERS; + } + ss.modifyAttribute(ts, TmfStateValue.newValueString(procName), procNameQuark); + prevMem = TmfStateValue.newValueLong(0); + } + + long prevMemValue = prevMem.unboxLong(); + prevMemValue += memoryDiff.longValue(); + ss.modifyAttribute(ts, TmfStateValue.newValueLong(prevMemValue), tidMemQuark); + } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) { + throw new IllegalStateException(e); + } + } + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/UstMemoryStrings.java b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/UstMemoryStrings.java new file mode 100644 index 0000000000..30ee6d33bf --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/UstMemoryStrings.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 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: + * Matthew Khouzam, Geneviève Bastien - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage; + +/** + * Strings for the memory usage state system using the LTTng UST libc + * instrumentation + * + * @author Matthew Khouzam + * @author Geneviève Bastien + */ +@SuppressWarnings({ "nls", "javadoc" }) +public interface UstMemoryStrings { + + /** Memory state system attribute name */ + static final String UST_MEMORY_MEMORY_ATTRIBUTE = "Memory"; //$NON-NLS-1$ + /** Procname state system attribute name */ + static final String UST_MEMORY_PROCNAME_ATTRIBUTE = "Procname"; //$NON-NLS-1$ + /** Name of the attribute to store memory usage of events with no context */ + static final String OTHERS = "Others"; + + /* UST_libc event names */ + static final String MALLOC = "ust_libc:malloc"; + static final String CALLOC = "ust_libc:calloc"; + static final String REALLOC = "ust_libc:realloc"; + static final String FREE = "ust_libc:free"; + static final String MEMALIGN = "ust_libc:memalign"; + static final String POSIX_MEMALIGN = "ust_libc:posix_memalign"; + + /* Possible contexts */ + static final String CONTEXT_VTID = "context._vtid"; + static final String CONTEXT_PROCNAME = "context._procname"; + + /* Event fields */ + static final String FIELD_PTR = "ptr"; + static final String FIELD_NMEMB = "nmemb"; + static final String FIELD_SIZE = "size"; + static final String FIELD_OUTPTR = "out_ptr"; + static final String FIELD_INPTR = "in_ptr"; + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/trace/callstack/LttngUstCallStackProvider.java b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/trace/callstack/LttngUstCallStackProvider.java new file mode 100644 index 0000000000..15bc30a1aa --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/trace/callstack/LttngUstCallStackProvider.java @@ -0,0 +1,171 @@ +/******************************************************************************* + * 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: + * Alexandre Montplaisir - Initial API and implementation + * Patrick Tasse - Add support for thread id + *******************************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.ust.core.trace.callstack; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.linuxtools.tmf.core.callstack.CallStackStateProvider; +import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; +import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent; + +/** + * Callstack provider for LTTng-UST traces. + * + * If the traces contains 'func_entry' and 'func_exit' event (see the + * lttng-ust-cyg-profile manpage), AND contains vtid and procname contexts, we + * can use this information to populate the TMF Callstack View. + * + * Granted, most UST traces will not contain this information. In this case, + * this will simply build an empty state system, and the view will remain + * unavailable. + * + * @author Alexandre Montplaisir + */ +public class LttngUstCallStackProvider extends CallStackStateProvider { + + // ------------------------------------------------------------------------ + // Event strings + // ------------------------------------------------------------------------ + + /** Name of the fake field for the vtid contexts */ + private static final String CONTEXT_VTID = "context._vtid"; //$NON-NLS-1$ + + /** Name of the fake field for the procname context */ + private static final String CONTEXT_PROCNAME = "context._procname"; //$NON-NLS-1$ + + /** Field name for the target function address */ + private static final String FIELD_ADDR = "addr"; //$NON-NLS-1$ + + /** Event names indicating function entry */ + private static final Set FUNC_ENTRY_EVENTS = new HashSet<>(); + + /** Event names indicating function exit */ + private static final Set FUNC_EXIT_EVENTS = new HashSet<>(); + + static { + /* This seems overkill, but it will be checked every event. Gotta go FAST! */ + FUNC_ENTRY_EVENTS.add("lttng_ust_cyg_profile:func_entry"); //$NON-NLS-1$ + FUNC_ENTRY_EVENTS.add("lttng_ust_cyg_profile_fast:func_entry"); //$NON-NLS-1$ + + FUNC_EXIT_EVENTS.add("lttng_ust_cyg_profile:func_exit"); //$NON-NLS-1$ + FUNC_EXIT_EVENTS.add("lttng_ust_cyg_profile_fast:func_exit"); //$NON-NLS-1$ + } + + /** + * 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 = 2; + + // ------------------------------------------------------------------------ + // Constructor + // ------------------------------------------------------------------------ + + /** + * Constructor + * + * @param trace + * The UST trace + */ + public LttngUstCallStackProvider(ITmfTrace trace) { + super(trace); + } + + // ------------------------------------------------------------------------ + // Methods from AbstractTmfStateProvider + // ------------------------------------------------------------------------ + + @Override + public LttngUstCallStackProvider getNewInstance() { + return new LttngUstCallStackProvider(getTrace()); + } + + @Override + public int getVersion() { + return VERSION; + } + + // ------------------------------------------------------------------------ + // Methods from CallStackStateProvider + // ------------------------------------------------------------------------ + + /** + * Check that this event contains the required information we need to be + * used in the call stack view. We need at least the "procname" and "vtid" + * contexts. + */ + @Override + protected boolean considerEvent(ITmfEvent event) { + if (!(event instanceof CtfTmfEvent)) { + return false; + } + ITmfEventField content = ((CtfTmfEvent) event).getContent(); + if (content.getField(CONTEXT_VTID) == null || + content.getField(CONTEXT_PROCNAME) == null) { + return false; + } + return true; + } + + @Override + public String functionEntry(ITmfEvent event) { + String eventName = event.getType().getName(); + if (!FUNC_ENTRY_EVENTS.contains(eventName)) { + return null; + } + Long address = (Long) event.getContent().getField(FIELD_ADDR).getValue(); + return Long.toHexString(address); + } + + @Override + public String functionExit(ITmfEvent event) { + String eventName = event.getType().getName(); + if (!FUNC_EXIT_EVENTS.contains(eventName)) { + return null; + } + /* + * The 'addr' field may or may not be present in func_exit events, + * depending on if cyg-profile.so or cyg-profile-fast.so was used. + */ + ITmfEventField field = event.getContent().getField(FIELD_ADDR); + if (field == null) { + return CallStackStateProvider.UNDEFINED; + } + Long address = (Long) field.getValue(); + return Long.toHexString(address); + } + + @Override + public String getThreadName(ITmfEvent event) { + /* Class type and content was already checked if we get called here */ + ITmfEventField content = ((CtfTmfEvent) event).getContent(); + String procName = (String) content.getField(CONTEXT_PROCNAME).getValue(); + Long vtid = (Long) content.getField(CONTEXT_VTID).getValue(); + + if (procName == null || vtid == null) { + throw new IllegalStateException(); + } + + return new String(procName + '-' + vtid.toString()); + } + + @Override + protected Long getThreadId(ITmfEvent event) { + ITmfEventField content = ((CtfTmfEvent) event).getContent(); + return (Long) content.getField(CONTEXT_VTID).getValue(); + } +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/Messages.java b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/Messages.java new file mode 100644 index 0000000000..90f39b747b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/Messages.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * 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: + * Guilliano Molaire - Initial API and implementation + *******************************************************************************/ +package org.eclipse.linuxtools.lttng2.ust.core.analysis.memory; + +import org.eclipse.osgi.util.NLS; + +/** + * Message bundle for the ust memory analysis module + * + * @author Guilliano Molaire + * @since 3.0 + */ +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng2.ust.core.analysis.memory.messages"; //$NON-NLS-1$ + + /** Information regarding events loading prior to the analysis execution */ + public static String UstMemoryAnalysisModule_EventsLoadingInformation; + + /** Example of how to execute the application with the libc wrapper */ + public static String UstMemoryAnalysisModule_EventsLoadingExampleInformation; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java new file mode 100644 index 0000000000..e4b3bd2167 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java @@ -0,0 +1,94 @@ +/******************************************************************************* + * 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 + * Guilliano Molaire - Provide the requirements of the analysis + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.ust.core.analysis.memory; + +import org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage.MemoryUsageStateProvider; +import org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage.UstMemoryStrings; +import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings; +import org.eclipse.linuxtools.lttng2.ust.core.trace.LttngUstTrace; +import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement; +import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; + +import com.google.common.collect.ImmutableSet; + +/** + * This analysis build a state system from the libc memory instrumentation on a + * UST trace + * + * @author Geneviève Bastien + * @since 3.0 + */ +public class UstMemoryAnalysisModule extends TmfStateSystemAnalysisModule { + + /** + * Analysis ID, it should match that in the plugin.xml file + */ + public static String ID = "org.eclipse.linuxtools.lttng2.ust.analysis.memory"; //$NON-NLS-1$ + + private static final ImmutableSet REQUIRED_EVENTS = ImmutableSet.of( + UstMemoryStrings.MALLOC, + UstMemoryStrings.FREE, + UstMemoryStrings.CALLOC, + UstMemoryStrings.REALLOC, + UstMemoryStrings.MEMALIGN, + UstMemoryStrings.POSIX_MEMALIGN + ); + + /** The requirements as an immutable set */ + private static final ImmutableSet REQUIREMENTS; + + static { + /* Initialize the requirements for the analysis: domain and events */ + TmfAnalysisRequirement eventsReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT, REQUIRED_EVENTS, ValuePriorityLevel.MANDATORY); + /* + * In order to have these events, the libc wrapper with probes should be + * loaded + */ + eventsReq.addInformation(Messages.UstMemoryAnalysisModule_EventsLoadingInformation); + eventsReq.addInformation(Messages.UstMemoryAnalysisModule_EventsLoadingExampleInformation); + + /* The domain type of the analysis */ + TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN); + domainReq.addValue(SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST, ValuePriorityLevel.MANDATORY); + + REQUIREMENTS = ImmutableSet.of(domainReq, eventsReq); + } + + @Override + protected ITmfStateProvider createStateProvider() { + return new MemoryUsageStateProvider(getTrace()); + } + + @Override + public void setTrace(ITmfTrace trace) throws TmfAnalysisException { + if (!(trace instanceof LttngUstTrace)) { + throw new IllegalStateException("UstMemoryAnalysisModule: trace should be of type LttngUstTrace"); //$NON-NLS-1$ + } + super.setTrace(trace); + } + + @Override + protected LttngUstTrace getTrace() { + return (LttngUstTrace) super.getTrace(); + } + + @Override + public Iterable getAnalysisRequirements() { + return REQUIREMENTS; + } +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/messages.properties b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/messages.properties new file mode 100644 index 0000000000..fdc32e0300 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/analysis/memory/messages.properties @@ -0,0 +1,2 @@ +UstMemoryAnalysisModule_EventsLoadingInformation=The libc wrapper should be loaded in order to get the events in the trace output. +UstMemoryAnalysisModule_EventsLoadingExampleInformation=Start the application to trace with: LD_PRELOAD=/path/to/liblttng-ust-libc-wrapper.so ./myProgram. diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/LttngUstTrace.java b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/LttngUstTrace.java new file mode 100644 index 0000000000..2d89837f55 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/LttngUstTrace.java @@ -0,0 +1,69 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial API and implementation + * Alexandre Montplaisir - Add UST callstack state system + * Marc-Andre Laperle - Handle BufferOverflowException (Bug 420203) + **********************************************************************/ + +package org.eclipse.linuxtools.lttng2.ust.core.trace; + +import java.nio.BufferOverflowException; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException; +import org.eclipse.linuxtools.ctf.core.trace.CTFTrace; +import org.eclipse.linuxtools.internal.lttng2.ust.core.Activator; +import org.eclipse.linuxtools.tmf.core.trace.TraceValidationStatus; +import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; + +/** + * Class to contain LTTng-UST traces + * + * @author Matthew Khouzam + * @since 2.1 + */ +public class LttngUstTrace extends CtfTmfTrace { + + private static final int CONFIDENCE = 100; + + /** + * Default constructor + */ + public LttngUstTrace() { + super(); + } + + /** + * {@inheritDoc} + *

+ * This implementation sets the confidence to 100 if the trace is a valid + * CTF trace in the "ust" domain. + */ + @Override + public IStatus validate(final IProject project, final String path) { + try (CTFTrace temp = new CTFTrace(path);) { + /* Make sure the domain is "ust" in the trace's env vars */ + String dom = temp.getEnvironment().get("domain"); //$NON-NLS-1$ + if (dom != null && dom.equals("\"ust\"")) { //$NON-NLS-1$ + return new TraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID); + } + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngUstTrace_DomainError); + + } catch (CTFReaderException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); + } catch (NullPointerException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e); + } catch (final BufferOverflowException e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngUstTrace_TraceReadError + ": " + Messages.LttngUstTrace_MalformedTrace); //$NON-NLS-1$ + } + } +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/Messages.java b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/Messages.java new file mode 100644 index 0000000000..bd36c13aed --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/Messages.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 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: + * Matthew Khouzam - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.lttng2.ust.core.trace; + +import org.eclipse.osgi.util.NLS; + +/** + * Message bundle for lttng2.kernel.core.trace + * + * @author Matthew Khouzam + * @since 2.1 + */ +public class Messages extends NLS { + + private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng2.ust.core.trace.messages"; //$NON-NLS-1$ + + /** + * The domain is not "ust" + */ + public static String LttngUstTrace_DomainError; + + /** + * Malformed trace (buffer overflow maybe?) + */ + public static String LttngUstTrace_MalformedTrace; + + /** + * Trace read error + */ + public static String LttngUstTrace_TraceReadError; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/messages.properties b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/messages.properties new file mode 100644 index 0000000000..d170bb9a2f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/linuxtools/lttng2/ust/core/trace/messages.properties @@ -0,0 +1,15 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +LttngUstTrace_DomainError=Domain mismatch, the environment should be 'ust'. +LttngUstTrace_MalformedTrace=Buffer overflow exception, trace is malformed +LttngUstTrace_TraceReadError=Lttng UST trace read error \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/.classpath b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.classpath new file mode 100644 index 0000000000..098194ca4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/.project b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.project new file mode 100644 index 0000000000..bbd5f4d7b2 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.ust.ui.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..f3fc64575b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,393 @@ +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=enabled +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..62cfa90dee --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.ust.ui.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..97fcbd0856 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.ust.ui.tests;singleton:=true +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.junit;bundle-version="4.0.0", + org.eclipse.ui, + org.eclipse.core.resources, + org.eclipse.core.runtime, + org.eclipse.tracecompass.lttng2.ust.ui;bundle-version="3.1.0" +Export-Package: org.eclipse.linuxtools.lttng2.ust.ui.tests diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/about.html b/org.eclipse.tracecompass.lttng2.ust.ui.tests/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/build.properties b/org.eclipse.tracecompass.lttng2.ust.ui.tests/build.properties new file mode 100644 index 0000000000..f7a0b9854e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/build.properties @@ -0,0 +1,18 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties +src.includes = about.html diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/plugin.properties b/org.eclipse.tracecompass.lttng2.ust.ui.tests/plugin.properties new file mode 100644 index 0000000000..988d200550 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Userspace Tracer Analysis UI Tests Plug-in diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/pom.xml b/org.eclipse.tracecompass.lttng2.ust.ui.tests/pom.xml new file mode 100644 index 0000000000..31e653fa82 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.ust.ui.tests + 3.1.0-SNAPSHOT + eclipse-test-plugin + + Trace Compass LTTng Userspace Tracer Analysis UI Tests Plug-in + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + org.eclipse.tracecompass.lttng2.ust.ui.tests + org.eclipse.linuxtools.lttng2.ust.ui.tests.AllTests + true + true + ${tycho.testArgLine} ${base.ui.test.vmargs} + org.eclipse.platform.ide + + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/ActivatorTest.java b/org.eclipse.tracecompass.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/ActivatorTest.java new file mode 100644 index 0000000000..3541ae3dcc --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/ActivatorTest.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * Copyright (c) 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.linuxtools.lttng2.ust.ui.tests; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Test suite for the Activator class + */ +public class ActivatorTest { + + // ------------------------------------------------------------------------ + // Tests + // ------------------------------------------------------------------------ + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator#Activator()}. + */ + @Test + public void testActivator() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator#getDefault()}. + */ + @Test + public void testGetDefault() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator#start}. + */ + @Test + public void testStartBundleContext() { + assertTrue(true); + } + + /** + * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator#stop}. + */ + @Test + public void testStopBundleContext() { + assertTrue(true); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/AllTests.java b/org.eclipse.tracecompass.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/AllTests.java new file mode 100644 index 0000000000..b469599244 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui.tests/src/org/eclipse/linuxtools/lttng2/ust/ui/tests/AllTests.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 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.linuxtools.lttng2.ust.ui.tests; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Run the lttng2.ust.ui unit tests. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ActivatorTest.class, +}) +public class AllTests { + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/.classpath b/org.eclipse.tracecompass.lttng2.ust.ui/.classpath new file mode 100644 index 0000000000..098194ca4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/.project b/org.eclipse.tracecompass.lttng2.ust.ui/.project new file mode 100644 index 0000000000..9dc8aa479f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.lttng2.ust.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..9f3662cd78 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,394 @@ +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.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 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.pde.prefs b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..d92b94fd4b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +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 diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/META-INF/MANIFEST.MF b/org.eclipse.tracecompass.lttng2.ust.ui/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..f5e836b5ac --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.ust.ui;singleton:=true +Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.eclipse.core.resources, + org.eclipse.core.runtime, + org.eclipse.ui, + org.eclipse.tracecompass.lttng2.ust.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.core;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.ui;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.ctf.core +Export-Package: org.eclipse.linuxtools.internal.lttng2.ust.ui;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui.tests", + org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui.tests", + org.eclipse.linuxtools.lttng2.ust.ui.analysis.callstack diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/about.html b/org.eclipse.tracecompass.lttng2.ust.ui/about.html new file mode 100644 index 0000000000..c258ef55d8 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

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 http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

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 http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/build.properties b/org.eclipse.tracecompass.lttng2.ust.ui/build.properties new file mode 100644 index 0000000000..1046daa0a1 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/build.properties @@ -0,0 +1,23 @@ +############################################################################### +# 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 +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + icons/,\ + .,\ + plugin.xml,\ + about.html,\ + plugin.properties +src.includes = about.html +additional.bundles = org.eclipse.jdt.annotation +jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/icons/obj16/garland16.png b/org.eclipse.tracecompass.lttng2.ust.ui/icons/obj16/garland16.png new file mode 100644 index 0000000000..74f9751638 Binary files /dev/null and b/org.eclipse.tracecompass.lttng2.ust.ui/icons/obj16/garland16.png differ diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/plugin.properties b/org.eclipse.tracecompass.lttng2.ust.ui/plugin.properties new file mode 100644 index 0000000000..3884adeef0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/plugin.properties @@ -0,0 +1,19 @@ +############################################################################### +# 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 +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass +Bundle-Name = Trace Compass LTTng Userspace Tracer Analysis UI Plug-in + +tracetype.type.ust = LTTng UST Trace +memoryusage.view.name = UST Memory Usage + +analysis.callstack = LTTng-UST CallStack Analysis diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/plugin.xml b/org.eclipse.tracecompass.lttng2.ust.ui/plugin.xml new file mode 100644 index 0000000000..35df526b5b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/plugin.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/pom.xml b/org.eclipse.tracecompass.lttng2.ust.ui/pom.xml new file mode 100644 index 0000000000..b54ec62784 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/pom.xml @@ -0,0 +1,36 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.ust.ui + 3.1.0-SNAPSHOT + eclipse-plugin + + Trace Compass LTTng Userspace Tracer Analysis UI Plug-in + + + + + org.eclipse.tycho + tycho-source-plugin + + + + + org.eclipse.tracecompass + diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/Activator.java b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/Activator.java new file mode 100644 index 0000000000..93eef4cb9f --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/Activator.java @@ -0,0 +1,184 @@ +/******************************************************************************* + * Copyright (c) 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.linuxtools.internal.lttng2.ust.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.linuxtools.lttng2.ust.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)); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageView.java b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageView.java new file mode 100644 index 0000000000..aacb49aa37 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageView.java @@ -0,0 +1,44 @@ +/********************************************************************** + * 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: + * Matthew Khouzam - Initial API and implementation + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage; + +import org.eclipse.linuxtools.tmf.ui.views.TmfChartView; +import org.eclipse.swt.widgets.Composite; + +/** + * Memory Usage View + * + * @author Matthew Khouzam + */ +public class MemoryUsageView extends TmfChartView { + + /** ID string */ + public static final String ID = "org.eclipse.linuxtools.lttng2.ust.memoryusage"; //$NON-NLS-1$ + + /** + * Constructor + */ + public MemoryUsageView() { + super(Messages.MemoryUsageView_Title); + } + + @Override + public void createPartControl(Composite parent) { + setChartViewer( new MemoryUsageViewer(parent)); + super.createPartControl(parent); + } + + @Override + public void setFocus() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageViewer.java b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageViewer.java new file mode 100644 index 0000000000..fcb2c06ed0 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/MemoryUsageViewer.java @@ -0,0 +1,158 @@ +/********************************************************************** + * Copyright (c) 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: + * Bernd Hufmann - Initial API and implementation + * Geneviève Bastien - Create and use base class for XY plots + **********************************************************************/ + +package org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage.UstMemoryStrings; +import org.eclipse.linuxtools.internal.tmf.core.Activator; +import org.eclipse.linuxtools.lttng2.ust.core.analysis.memory.UstMemoryAnalysisModule; +import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem; +import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException; +import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException; +import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException; +import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue; +import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule; +import org.eclipse.linuxtools.tmf.ui.viewers.xycharts.linecharts.TmfCommonXLineChartViewer; +import org.eclipse.swt.widgets.Composite; + +/** + * Memory usage view + * + * @author Matthew Khouzam + */ +@SuppressWarnings("restriction") +public class MemoryUsageViewer extends TmfCommonXLineChartViewer { + + private TmfStateSystemAnalysisModule fModule = null; + + private final Map fYValues = new HashMap<>(); + private final Map fMemoryQuarks = new HashMap<>(); + private final Map fSeriesName = new HashMap<>(); + + private static final int BYTES_TO_KB = 1024; + + // Timeout between updates in the updateData thread + private static final long BUILD_UPDATE_TIMEOUT = 500; + + /** + * Constructor + * + * @param parent + * parent view + */ + public MemoryUsageViewer(Composite parent) { + super(parent, Messages.MemoryUsageViewer_Title, Messages.MemoryUsageViewer_XAxis, Messages.MemoryUsageViewer_YAxis); + } + + @Override + protected void initializeDataSource() { + if (getTrace() != null) { + fModule = getTrace().getAnalysisModuleOfClass(TmfStateSystemAnalysisModule.class, UstMemoryAnalysisModule.ID); + if (fModule == null) { + return; + } + fModule.schedule(); + } + } + + @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(); + /* Don't wait for the module completion, when it's ready, we'll know */ + if (ss == null) { + return; + } + + double[] xvalues = getXAxis(start, end, nb); + setXAxis(xvalues); + + boolean complete = false; + long currentEnd = start; + + while (!complete && currentEnd < end) { + if (monitor.isCanceled()) { + return; + } + complete = ss.waitUntilBuilt(BUILD_UPDATE_TIMEOUT); + currentEnd = ss.getCurrentEndTime(); + List tidQuarks = ss.getSubAttributes(-1, false); + long traceStart = getStartTime(); + long traceEnd = getEndTime(); + long offset = this.getTimeOffset(); + + /* Initialize quarks and series names */ + for (int quark : tidQuarks) { + fYValues.put(quark, new double[xvalues.length]); + fMemoryQuarks.put(quark, ss.getQuarkRelative(quark, UstMemoryStrings.UST_MEMORY_MEMORY_ATTRIBUTE)); + int procNameQuark = ss.getQuarkRelative(quark, UstMemoryStrings.UST_MEMORY_PROCNAME_ATTRIBUTE); + try { + ITmfStateValue procnameValue = ss.querySingleState(start, procNameQuark).getStateValue(); + String procname = new String(); + if (!procnameValue.isNull()) { + procname = procnameValue.unboxStr(); + } + fSeriesName.put(quark, new String(procname + ' ' + '(' + ss.getAttributeName(quark) + ')').trim()); + } catch (TimeRangeException e) { + fSeriesName.put(quark, '(' + ss.getAttributeName(quark) + ')'); + } + } + + /* + * TODO: It should only show active threads in the time range. If a + * tid does not have any memory value (only 1 interval in the time + * range with value null or 0), then its series should not be + * displayed. + */ + double yvalue = 0.0; + for (int i = 0; i < xvalues.length; i++) { + if (monitor.isCanceled()) { + return; + } + double x = xvalues[i]; + long time = (long) x + offset; + // make sure that time is in the trace range after double to + // long conversion + time = time < traceStart ? traceStart : time; + time = time > traceEnd ? traceEnd : time; + + for (int quark : tidQuarks) { + try { + yvalue = ss.querySingleState(time, fMemoryQuarks.get(quark)).getStateValue().unboxLong() / BYTES_TO_KB; + fYValues.get(quark)[i] = yvalue; + } catch (TimeRangeException e) { + fYValues.get(quark)[i] = 0; + } + } + } + for (int quark : tidQuarks) { + setSeries(fSeriesName.get(quark), fYValues.get(quark)); + } + updateDisplay(); + } + } catch (AttributeNotFoundException | StateValueTypeException | StateSystemDisposedException e) { + Activator.logError("Error updating the data of the Memory usage view", e); //$NON-NLS-1$ + } + } + +} diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/Messages.java b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/Messages.java new file mode 100644 index 0000000000..29a4bbfa68 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/Messages.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * 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.linuxtools.internal.lttng2.ust.ui.views.memusage; + +import org.eclipse.osgi.util.NLS; + +/** + * Translatable strings for the ust memory usage view + * + * @author Geneviève Bastien + */ +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage.messages"; //$NON-NLS-1$ + /** Title of the memory usage xy view */ + public static String MemoryUsageView_Title; + + /** Title of the memory viewer */ + public static String MemoryUsageViewer_Title; + /** X axis caption */ + public static String MemoryUsageViewer_XAxis; + /** Y axis caption */ + public static String MemoryUsageViewer_YAxis; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/messages.properties b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/messages.properties new file mode 100644 index 0000000000..2de2271a0b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/internal/lttng2/ust/ui/views/memusage/messages.properties @@ -0,0 +1,15 @@ +############################################################################### +# 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: +# Ericsson - Initial API and implementation +############################################################################### +MemoryUsageView_Title=Memory Usage +MemoryUsageViewer_Title=Memory Allocation vs Time +MemoryUsageViewer_XAxis=Time +MemoryUsageViewer_YAxis=Usage (KB) diff --git a/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/lttng2/ust/ui/analysis/callstack/LttngUstCallStackAnalysis.java b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/lttng2/ust/ui/analysis/callstack/LttngUstCallStackAnalysis.java new file mode 100644 index 0000000000..f1b0ec08aa --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/linuxtools/lttng2/ust/ui/analysis/callstack/LttngUstCallStackAnalysis.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * 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.linuxtools.lttng2.ust.ui.analysis.callstack; + +import org.eclipse.linuxtools.internal.lttng2.ust.core.trace.callstack.LttngUstCallStackProvider; +import org.eclipse.linuxtools.lttng2.ust.core.trace.LttngUstTrace; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; +import org.eclipse.linuxtools.tmf.ui.views.callstack.AbstractCallStackAnalysis; + +/** + * Call-stack analysis to populate the TMF CallStack View from UST cyg-profile + * events. + * + * @author Alexandre Montplaisir + * @since 3.0 + */ +public class LttngUstCallStackAnalysis extends AbstractCallStackAnalysis { + + @Override + public void setTrace(ITmfTrace trace) throws TmfAnalysisException { + if (!(trace instanceof LttngUstTrace)) { + throw new IllegalArgumentException("Trace should be of type LttngUstTrace"); //$NON-NLS-1$ + } + super.setTrace(trace); + } + + @Override + protected LttngUstTrace getTrace() { + return (LttngUstTrace) super.getTrace(); + } + + @Override + protected ITmfStateProvider createStateProvider() { + return new LttngUstCallStackProvider(getTrace()); + } + +} diff --git a/org.eclipse.tracecompass.lttng2.ust/.project b/org.eclipse.tracecompass.lttng2.ust/.project new file mode 100644 index 0000000000..d13cfd5353 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust/.project @@ -0,0 +1,17 @@ + + + org.eclipse.tracecompass.lttng2.ust + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/org.eclipse.tracecompass.lttng2.ust/.settings/org.eclipse.core.resources.prefs b/org.eclipse.tracecompass.lttng2.ust/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.tracecompass.lttng2.ust/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.tracecompass.lttng2.ust/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.tracecompass.lttng2.ust/build.properties b/org.eclipse.tracecompass.lttng2.ust/build.properties new file mode 100644 index 0000000000..c0db4e0a72 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust/build.properties @@ -0,0 +1,15 @@ +############################################################################### +# Copyright (c) 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: +# Ericsson - Initial API and implementation +############################################################################### + +bin.includes = feature.xml,\ + feature.properties,\ + p2.inf diff --git a/org.eclipse.tracecompass.lttng2.ust/feature.properties b/org.eclipse.tracecompass.lttng2.ust/feature.properties new file mode 100644 index 0000000000..9bc9dbe7e5 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust/feature.properties @@ -0,0 +1,22 @@ +############################################################################### +# Copyright (c) 2009, 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: +# Ericsson - Initial API and implementation +############################################################################### + +featureName=Trace Compass LTTng Userspace Analysis + +description=Plug-ins to integrate LTTng-UST analysis tools into the workbench. \ +Includes the LTTng (Linux Tracing Toolkit), TMF (Tracing and Monitoring Framework) \ +and CTF (Common Trace Format) features. + +featureProvider=Eclipse Trace Compass + +copyright=Copyright 2013 Ericsson + diff --git a/org.eclipse.tracecompass.lttng2.ust/feature.xml b/org.eclipse.tracecompass.lttng2.ust/feature.xml new file mode 100644 index 0000000000..8fc8df9f2e --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust/feature.xml @@ -0,0 +1,68 @@ + + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.tracecompass.lttng2.ust/p2.inf b/org.eclipse.tracecompass.lttng2.ust/p2.inf new file mode 100644 index 0000000000..5246a0c824 --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust/p2.inf @@ -0,0 +1,3 @@ +instructions.configure=\ +org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:0,name:Linux Tools,enabled:false); \ +org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-nightly,type:1,name:Linux Tools,enabled:false); diff --git a/org.eclipse.tracecompass.lttng2.ust/pom.xml b/org.eclipse.tracecompass.lttng2.ust/pom.xml new file mode 100644 index 0000000000..71ebfb759b --- /dev/null +++ b/org.eclipse.tracecompass.lttng2.ust/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + + + org.eclipse.tracecompass.lttng2.ust + org.eclipse.tracecompass + 3.2.0-SNAPSHOT + eclipse-feature + + Trace Compass LTTng Userspace Tracer Analysis Feature + + + + + org.eclipse.tycho.extras + tycho-source-feature-plugin + + + source-feature + package + + source-feature + + + + + + + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + attached-p2-metadata + package + + p2-metadata + + + + + + + diff --git a/org.eclipse.tracecompass.releng-site/category.xml b/org.eclipse.tracecompass.releng-site/category.xml index 9832632bd5..0efeef09b6 100644 --- a/org.eclipse.tracecompass.releng-site/category.xml +++ b/org.eclipse.tracecompass.releng-site/category.xml @@ -3,10 +3,10 @@ Nightly builds of Trace Compass project. - + - + diff --git a/pom.xml b/pom.xml index 090acb024b..7326abf78c 100644 --- a/pom.xml +++ b/pom.xml @@ -145,24 +145,24 @@ org.eclipse.tracecompass.target org.eclipse.linuxtools.lttng.testing - org.eclipse.linuxtools.lttng2.control - org.eclipse.linuxtools.lttng2.control.core - org.eclipse.linuxtools.lttng2.control.core.tests - org.eclipse.linuxtools.lttng2.control.ui - org.eclipse.linuxtools.lttng2.control.ui.tests + org.eclipse.tracecompass.lttng2.control + org.eclipse.tracecompass.lttng2.control.core + org.eclipse.tracecompass.lttng2.control.core.tests + org.eclipse.tracecompass.lttng2.control.ui + org.eclipse.tracecompass.lttng2.control.ui.tests - org.eclipse.linuxtools.lttng2.kernel - org.eclipse.linuxtools.lttng2.kernel.core - org.eclipse.linuxtools.lttng2.kernel.core.tests - org.eclipse.linuxtools.lttng2.kernel.ui - org.eclipse.linuxtools.lttng2.kernel.ui.tests - org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests + org.eclipse.tracecompass.lttng2.kernel + org.eclipse.tracecompass.lttng2.kernel.core + org.eclipse.tracecompass.lttng2.kernel.core.tests + org.eclipse.tracecompass.lttng2.kernel.ui + org.eclipse.tracecompass.lttng2.kernel.ui.tests + org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests - org.eclipse.linuxtools.lttng2.ust - org.eclipse.linuxtools.lttng2.ust.core - org.eclipse.linuxtools.lttng2.ust.core.tests - org.eclipse.linuxtools.lttng2.ust.ui - org.eclipse.linuxtools.lttng2.ust.ui.tests + org.eclipse.tracecompass.lttng2.ust + org.eclipse.tracecompass.lttng2.ust.core + org.eclipse.tracecompass.lttng2.ust.core.tests + org.eclipse.tracecompass.lttng2.ust.ui + org.eclipse.tracecompass.lttng2.ust.ui.tests org.eclipse.tracecompass.gdbtrace org.eclipse.tracecompass.gdbtrace.core