org.eclipse.linuxtools.ctf.core.tests;bundle-version="2.1.0",
org.eclipse.linuxtools.gdbtrace.core.tests;bundle-version="1.1.0",
org.eclipse.linuxtools.gdbtrace.ui.tests;bundle-version="1.1.0",
- org.eclipse.linuxtools.lttng2.core.tests;bundle-version="2.1.0",
- org.eclipse.linuxtools.lttng2.ui.tests;bundle-version="2.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.0.0",
org.eclipse.linuxtools.lttng2.kernel.ui.tests;bundle-version="2.1.0",
org.eclipse.linuxtools.ctf.parser.tests.AllCtfParserTests.class,
org.eclipse.linuxtools.gdbtrace.core.tests.AllGdbTraceCoreTests.class,
org.eclipse.linuxtools.gdbtrace.ui.tests.AllGdbTraceUITests.class,
- org.eclipse.linuxtools.lttng2.core.tests.AllTests.class,
- org.eclipse.linuxtools.lttng2.ui.tests.AllTests.class,
+ org.eclipse.linuxtools.lttng2.control.core.tests.AllTests.class,
+ org.eclipse.linuxtools.lttng2.control.ui.tests.AllTests.class,
org.eclipse.linuxtools.lttng2.kernel.core.tests.AllTests.class,
org.eclipse.linuxtools.lttng2.kernel.ui.tests.AllTests.class,
org.eclipse.linuxtools.lttng2.ust.core.tests.AllTests.class,
** ''Plug-ins'': org.eclipse.linuxtools.tmf.core, org.eclipse.linuxtools.tmf.ui
* '''LTTng''' - The wrapper for the LTTng tracer control. Can be used for kernel or application tracing.
-** ''Feature'': org.eclipse.linuxtools.lttng2
-** ''Plug-ins'': org.eclipse.linuxtools.lttng2.core, org.eclipse.linuxtools.lttng2.ui
+** ''Feature'': org.eclipse.linuxtools.lttng2.control
+** ''Plug-ins'': org.eclipse.linuxtools.lttng2.control.core, org.eclipse.linuxtools.lttng2.control.ui
* '''LTTng Kernel''' - Analysis components specific to Linux kernel traces
** ''Feature'': org.eclipse.linuxtools.lttng2.kernel
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+bin/
+target/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.lttng2.control.core.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
--- /dev/null
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+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=ignore
+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=error
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=250
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
--- /dev/null
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_tmf-style
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
--- /dev/null
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
--- /dev/null
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 3.0.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.0.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
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2013 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms 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
--- /dev/null
+###############################################################################
+# 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
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>linuxtools-lttng-parent</artifactId>
+ <groupId>org.eclipse.linuxtools.lttng</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.linuxtools.lttng2.control.core.tests</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <name>Linux Tools LTTng Control Core Tests Plug-in</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <testSuite>org.eclipse.linuxtools.lttng2.control.core.tests</testSuite>
+ <testClass>org.eclipse.linuxtools.lttng2.control.core.tests.AllTests</testClass>
+ <useUIHarness>false</useUIHarness>
+ <useUIThread>false</useUIThread>
+ <product>org.eclipse.platform.ide</product>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <groupId>org.eclipse.linuxtools.lttng2</groupId>
+</project>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ * 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);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ * 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 {
+
+}
--- /dev/null
+/*******************************************************************************
+ * 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 {
+
+}
--- /dev/null
+/**********************************************************************
+ * 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 <code>BaseEventInfoTest</code> contains test for the class
+ * <code>{@link BaseEventInfo}</code>.
+ */
+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("TRACE_DEBUG", result.getInName());
+ assertEquals("TRACE_DEBUG", result.name());
+ assertEquals(14, 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<IFieldInfo> 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
--- /dev/null
+/**********************************************************************
+ * 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.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 <code>ChannelInfoTest</code> contains tests for the class
+ * <code>{@link ChannelInfo}</code>.
+ */
+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("", 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();
+ 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();
+ 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<IEventInfo>) 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<IEventInfo> 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)])]", 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
--- /dev/null
+/**********************************************************************
+ * 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 <code>ChannelInfoTest</code> contains tests for the class
+ * <code>{@link DomainInfo}</code>.
+ */
+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<IChannelInfo> 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)])],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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.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 <code>EventInfoTest</code> contains test for the class
+ * <code>{@link EventInfo}</code>.
+ */
+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 BaseEventInfo() 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());
+
+ }
+
+ /**
+ * 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());
+ }
+
+ /**
+ * 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("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());
+
+ // 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());
+ }
+
+ /**
+ * 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)]", 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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 <code>FieldInfoTest</code> contains test for the class
+ * <code>{@link FieldInfo}</code>.
+ */
+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
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.setState(TraceEnablement.ENABLED);
+
+ fEventInfo2 = new EventInfo("event2");
+ 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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 <code>ProbEventInfoTest</code> contains test for the class
+ * <code>{@link ProbeEventInfo}</code>.
+ */
+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)],fAddress=0xc1231234)]", fEventInfo1.toString());
+ assertEquals("[ProbeEventInfo([EventInfo([BaseEventInfo([TraceInfo(Name=probeEvent2)],type=FUNCTION,level=TRACE_DEBUG)],State=DISABLED)],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
--- /dev/null
+/**********************************************************************
+ * 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 <code>ChannelInfoTest</code> contains tests for the class
+ * <code>{@link SessionInfo}</code>.
+ */
+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<IDomainInfo> 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)])],"
+ + "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)])],"
+ + "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
--- /dev/null
+/**********************************************************************
+ * 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 <code>SnapshotInfoTest</code> contains test for the class
+ * <code>{@link SnapshotInfo}</code>.
+ */
+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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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 <code>TraceInfoTest</code> contains test for the class
+ * <code>{@link TraceInfo}</code>.
+ */
+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
--- /dev/null
+/**********************************************************************
+ * 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 <code>ChannelInfoTest</code> contains tests for the class
+ * <code>{@link UstProviderInfo}</code>.
+ */
+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<IBaseEventInfo>) method test.
+ */
+ @Test
+ public void testSetEvents_1() {
+ UstProviderInfo fixture = new UstProviderInfo("test");
+ fixture.setPid(2468);
+ List<IBaseEventInfo> 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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 {
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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<ISessionInfo> 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());
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+ <!--***************************************************************************\r
+ * Copyright(C) 2014 École Polytechnique de Montréal\r
+ *\r
+ * All rights reserved. This program and the accompanying materials are\r
+ * made available under the terms of the Eclipse Public License v1.0 which\r
+ * accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Guilliano Molaire - Initial API and implementation\r
+ ***************************************************************************\r
+ This is an invalid session configuration file. The domain type\r
+ is missing.-->\r
+<sessions>\r
+ <session>\r
+ <name>auto-20140323-130527</name>\r
+ <started>false</started>\r
+ <domains>\r
+ <domain>\r
+ <buffer_type>GLOBAL</buffer_type>\r
+ <channels>\r
+ <channel>\r
+ <name>channel0</name>\r
+ <overwrite_mode>DISCARD</overwrite_mode>\r
+ <subbuffer_count>4</subbuffer_count>\r
+ <switch_timer_interval>0</switch_timer_interval>\r
+ <tracefile_size>0</tracefile_size>\r
+ <tracefile_count>0</tracefile_count>\r
+ <live_timer_interval>0</live_timer_interval>\r
+ <enabled>false</enabled>\r
+ <subbuffer_size>262144</subbuffer_size>\r
+ <read_timer_interval>200000</read_timer_interval>\r
+ <output_type>SPLICE</output_type>\r
+ <events>\r
+ <event>\r
+ <name>exit_syscall</name>\r
+ <enabled>true</enabled>\r
+ <type>TRACEPOINT</type>\r
+ </event>\r
+ </events>\r
+ </channel>\r
+ </channels>\r
+ </domain>\r
+ </domains>\r
+ <output>\r
+ <consumer_output>\r
+ <enabled>true</enabled>\r
+ <destination>\r
+ <path>/home/user/folder</path>\r
+ </destination>\r
+ </consumer_output>\r
+ </output>\r
+ </session>\r
+</sessions>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+ <!--***************************************************************************\r
+ * Copyright(C) 2014 École Polytechnique de Montréal\r
+ *\r
+ * All rights reserved. This program and the accompanying materials are\r
+ * made available under the terms of the Eclipse Public License v1.0 which\r
+ * accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Guilliano Molaire - Initial API and implementation\r
+ ***************************************************************************\r
+ This is a valid session configuration file. All mandatory\r
+ elements are provided.-->\r
+<sessions>\r
+ <session>\r
+ <name>auto-20140323-130527</name>\r
+ <started>false</started>\r
+ <domains>\r
+ <domain>\r
+ <type>KERNEL</type>\r
+ <buffer_type>GLOBAL</buffer_type>\r
+ <channels>\r
+ <channel>\r
+ <name>channel0</name>\r
+ <overwrite_mode>DISCARD</overwrite_mode>\r
+ <subbuffer_count>4</subbuffer_count>\r
+ <switch_timer_interval>0</switch_timer_interval>\r
+ <tracefile_size>0</tracefile_size>\r
+ <tracefile_count>0</tracefile_count>\r
+ <live_timer_interval>0</live_timer_interval>\r
+ <enabled>false</enabled>\r
+ <subbuffer_size>262144</subbuffer_size>\r
+ <read_timer_interval>200000</read_timer_interval>\r
+ <output_type>SPLICE</output_type>\r
+ <events>\r
+ <event>\r
+ <name>exit_syscall</name>\r
+ <enabled>true</enabled>\r
+ <type>TRACEPOINT</type>\r
+ </event>\r
+ </events>\r
+ </channel>\r
+ </channels>\r
+ </domain>\r
+ </domains>\r
+ <output>\r
+ <consumer_output>\r
+ <enabled>true</enabled>\r
+ <destination>\r
+ <path>/home/user/folder</path>\r
+ </destination>\r
+ </consumer_output>\r
+ </output>\r
+ </session>\r
+</sessions>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+bin/
+target/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.lttng2.control.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
--- /dev/null
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=error
+org.eclipse.jdt.core.compiler.problem.deprecation=error
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+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=ignore
+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=error
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=250
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
--- /dev/null
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_tmf-style
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
--- /dev/null
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
--- /dev/null
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=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=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 3.0.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
+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.lttng2.control.core.session
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2013 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms 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
--- /dev/null
+###############################################################################
+# 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
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>linuxtools-lttng-parent</artifactId>
+ <groupId>org.eclipse.linuxtools.lttng</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.linuxtools.lttng2.control.core</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Linux Tools LTTng Control Core Plug-in</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <groupId>org.eclipse.linuxtools.lttng2</groupId>
+</project>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.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;
+
+/**
+ * <b><u>Activator</u></b>
+ * <p>
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ /**
+ * The plug-in ID
+ */
+ public static final String PLUGIN_ID = "org.eclipse.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));
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for retrieval of basic trace event information.
+ * </p>
+ *
+ * @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<IFieldInfo> fields);
+
+ /**
+ * Returns filter expression.
+ * @return filter expression
+ */
+ String getFilterExpression();
+
+ /**
+ * Sets the filter expression.
+ * @param filter The filter expression to set
+ */
+ void setFilterExpression(String filter);
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for retrieval of trace channel information.
+ * </p>
+ *
+ * @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.
+ */
+ String getOutputType();
+ /**
+ * Sets the output type to the given value.
+ * @param type - type to set.
+ */
+ void setOutputType(String 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<IEventInfo> 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();
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for retrieval of trace domain information.
+ * </p>
+ *
+ * @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<IChannelInfo> 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);
+
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.core.model;
+
+/**
+ * <p>
+ * Interface for retrieval of trace event information.
+ * </p>
+ *
+ * @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);
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.core.model;
+
+/**
+ * <p>
+ * Interface for retrieval of event field information.
+ * </p>
+ *
+ * @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);
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.core.model;
+
+/**
+ * <p>
+ * Interface for retrieval of probe event information.
+ * </p>
+ *
+ * @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);
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for retrieval of trace session information.
+ * </p>
+ *
+ * @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<IDomainInfo> domains);
+
+ /**
+ * Adds a single domain information.
+ * @param domainInfo domain information to add.
+ */
+ void addDomain(IDomainInfo domainInfo);
+
+ /**
+ * Returns if session is streamed over network
+ * @return <code>true</code> if streamed over network else <code>false</code>
+ */
+ boolean isStreamedTrace();
+
+ /**
+ * Sets whether the trace is streamed or not
+ * @param isStreamedTrace <code>true</code> if streamed over network else <code>false</code>
+ */
+ void setStreamedTrace(boolean isStreamedTrace);
+
+ /**
+ * Returns whether the session is snapshot session or not
+ * @return <code>true</code> if it is snapshot session else <code>false</code>
+ */
+ 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 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);
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+
+/**
+ * <p>
+ * Interface for retrieval of snapshot information of a session.
+ * </p>
+ *
+ * @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 - <code>true</code> if streamed else <code>false</code>
+ */
+ void setStreamedSnapshot(boolean isStreamed);
+
+ /**
+ * Gets whether snapshot is streamed over the network or stored locally
+ * at the tracers host.
+ *
+ * @return <code>true</code> if streamed else <code>false</code>
+ */
+ boolean isStreamedSnapshot();
+
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Interface for retrieve trace comon information.
+ * </p>
+ *
+ * @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);
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.core.model;
+
+import java.util.List;
+
+/**
+ * <p>
+ * Interface for retrieval of UST provider information.
+ * </p>
+ *
+ * @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<IBaseEventInfo> events);
+
+ /**
+ * Adds a single event information.
+ * @param event - event information to add.
+ */
+ void addEvent(IBaseEventInfo event);
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Type of log Level enumeration.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public enum LogLevelType {
+
+ // ------------------------------------------------------------------------
+ // Enum definition
+ // ------------------------------------------------------------------------
+ /** range of log levels [0,logLevel] */
+ LOGLEVEL,
+
+ /** single log level */
+ LOGLEVEL_ONLY,
+
+ /** no log level */
+ LOGLEVEL_NONE;
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Enumeration for the node connection state.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public enum TargetNodeState {
+ /** State when disconnected */
+ DISCONNECTED,
+ /** State while disconnecting */
+ DISCONNECTING,
+ /** State when connected */
+ CONNECTED,
+ /** State while connecting */
+ CONNECTING;
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Enumeration for enabled/disabled states.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public enum TraceEnablement {
+
+ // ------------------------------------------------------------------------
+ // Enum definition
+ // ------------------------------------------------------------------------
+ /** Tracing is disabled */
+ DISABLED("disabled"), //$NON-NLS-1$
+ /** Tracing is enabled */
+ ENABLED("enabled"); //$NON-NLS-1$
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+ /**
+ * Name of enum
+ */
+ private final String fInName;
+
+ // ------------------------------------------------------------------------
+ // Constuctors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Private constructor
+ * @param name the name of state
+ */
+ private TraceEnablement(String name) {
+ fInName = name;
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+ /**
+ * @return state name
+ */
+ public String getInName() {
+ return fInName;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.core.model;
+
+/**
+ * <p>
+ * Trace event type enumeration.
+ * </p>
+ *
+ * @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;
+ }
+}
+
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Log Level enumeration.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Session state enumeration.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public enum TraceSessionState {
+
+ // ------------------------------------------------------------------------
+ // Enum definition
+ // ------------------------------------------------------------------------
+ /** Trace session inactive */
+ INACTIVE("inactive"), //$NON-NLS-1$
+ /** Trace session active */
+ ACTIVE("active"); //$NON-NLS-1$
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+ /**
+ * Name of enum.
+ */
+ private final String fInName;
+
+ // ------------------------------------------------------------------------
+ // Constuctors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Private constructor
+ * @param name the name of state
+ */
+ private TraceSessionState(String name) {
+ fInName = name;
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+ /**
+ * @return state name
+ */
+ public String getInName() {
+ return fInName;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+* <p>
+* Implementation of the basic trace event interface (IEventInfo) to store event
+* related data.
+* </p>
+*
+* @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<IFieldInfo> 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;
+ for (Iterator<IFieldInfo> 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().equals(typeName)) {
+ fEventType = TraceEventType.TRACEPOINT;
+ } else if(TraceEventType.SYSCALL.getInName().equals(typeName)) {
+ fEventType = TraceEventType.SYSCALL;
+ } else if (TraceEventType.PROBE.getInName().equals(typeName)) {
+ fEventType = TraceEventType.PROBE;
+ } else if (TraceEventType.FUNCTION.getInName().equals(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) {
+ if(TraceLogLevel.TRACE_EMERG.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_EMERG;
+ } else if(TraceLogLevel.TRACE_ALERT.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_ALERT;
+ } else if(TraceLogLevel.TRACE_CRIT.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_CRIT;
+ } else if(TraceLogLevel.TRACE_ERR.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_ERR;
+ } else if(TraceLogLevel.TRACE_WARNING.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_WARNING;
+ } else if(TraceLogLevel.TRACE_NOTICE.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_NOTICE;
+ } else if(TraceLogLevel.TRACE_INFO.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_INFO;
+ } else if(TraceLogLevel.TRACE_DEBUG_SYSTEM.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_SYSTEM;
+ } else if(TraceLogLevel.TRACE_DEBUG_PROGRAM.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_PROGRAM;
+ } else if(TraceLogLevel.TRACE_DEBUG_PROCESS.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_PROCESS;
+ } else if(TraceLogLevel.TRACE_DEBUG_MODULE.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_MODULE;
+ } else if(TraceLogLevel.TRACE_DEBUG_UNIT.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_UNIT;
+ } else if(TraceLogLevel.TRACE_DEBUG_FUNCTION.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_FUNCTION;
+ } else if(TraceLogLevel.TRACE_DEBUG_LINE.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_LINE;
+ } else if(TraceLogLevel.TRACE_DEBUG.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG;
+ } else if(TraceLogLevel.LEVEL_UNKNOWN.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.LEVEL_UNKNOWN;
+ } else {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG;
+ }
+ }
+
+ @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<IFieldInfo> fields) {
+ fFields.clear();
+ for (Iterator<IFieldInfo> 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<IFieldInfo> 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();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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:
+ * Simon Delisle - Initial API and implementation
+ * Bernd Hufmann - Updated to enum definition
+ **********************************************************************/
+
+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"), //$NON-NLS-1$
+ /**
+ * Buffer type : per PID
+ */
+ BUFFER_PER_PID("per PID"), //$NON-NLS-1$
+ /**
+ * 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;
+
+ // ------------------------------------------------------------------------
+ // Constuctors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Private constructor
+ * @param name the name of state
+ */
+ private BufferType(String name) {
+ fInName = name;
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+ /**
+ * @return state name
+ */
+ public String getInName() {
+ return fInName;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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.TraceEnablement;
+
+/**
+ * <p>
+ * Implementation of the trace channel interface (IChannelInfo) to store channel
+ * related data.
+ * </p>
+ *
+ * @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 String fOutputType = ""; //$NON-NLS-1$
+ /**
+ * The channel enable state.
+ */
+ private TraceEnablement fState = TraceEnablement.DISABLED;
+ /**
+ * The events information of the channel.
+ */
+ private final List<IEventInfo> 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 : String.valueOf(other.fOutputType));
+ fState = other.fState;
+ for (Iterator<IEventInfo> 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 String getOutputType() {
+ return fOutputType;
+ }
+
+ @Override
+ public void setOutputType(String 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.ENABLED;
+ if (TraceEnablement.DISABLED.getInName().equals(stateName)) {
+ fState = TraceEnablement.DISABLED;
+ } else if (TraceEnablement.ENABLED.getInName().equals(stateName)) {
+ fState = TraceEnablement.ENABLED;
+ }
+ }
+
+ @Override
+ public IEventInfo[] getEvents() {
+ return fEvents.toArray(new IEventInfo[fEvents.size()]);
+ }
+
+ @Override
+ public void setEvents(List<IEventInfo> events) {
+ fEvents.clear();
+ for (Iterator<IEventInfo> 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);
+ 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<IEventInfo> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the trace domain interface (IDomainInfo) to store domain
+ * related data.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class DomainInfo extends TraceInfo implements IDomainInfo {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+ /**
+ * The channels information of the domain.
+ */
+ private final List<IChannelInfo> 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<IChannelInfo> channels) {
+ fChannels.clear();
+ for (Iterator<IChannelInfo> 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<IChannelInfo> 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();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.TraceEnablement;
+
+/**
+* <p>
+* Implementation of the trace event interface (IEventInfo) to store event
+* related data.
+* </p>
+*
+* @author Bernd Hufmann
+*/
+public class EventInfo extends BaseEventInfo implements IEventInfo {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+ /**
+ * The enable state of the event.
+ */
+ private TraceEnablement fState = TraceEnablement.DISABLED;
+
+ // ------------------------------------------------------------------------
+ // 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;
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ @Override
+ public TraceEnablement getState() {
+ return fState;
+ }
+
+ @Override
+ public void setState(TraceEnablement state) {
+ fState = state;
+ }
+
+ @Override
+ public void setState(String stateName) {
+ fState = TraceEnablement.DISABLED;
+ if (TraceEnablement.DISABLED.getInName().equals(stateName)) {
+ fState = TraceEnablement.DISABLED;
+ } else if (TraceEnablement.ENABLED.getInName().equals(stateName)) {
+ fState = TraceEnablement.ENABLED;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((fState == null) ? 0 : (fState.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;
+ }
+ EventInfo other = (EventInfo) obj;
+ if (fState != other.fState) {
+ 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(")]");
+ return output.toString();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+* <p>
+* Implementation of the basic trace event interface (IEventInfo) to store event
+* related data.
+* </p>
+*
+* @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;
+ }
+
+ @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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.IProbeEventInfo;
+
+/**
+* <p>
+* Implementation of the trace event interface (IProbeEventInfo) to store probe event
+* related data.
+* </p>
+*
+* @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;
+ }
+
+ // ------------------------------------------------------------------------
+ // 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();
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * 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.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;
+
+/**
+ * <p>
+ * Implementation of the trace session interface (ISessionInfo) to store session
+ * related data.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class SessionInfo extends TraceInfo implements ISessionInfo {
+
+ // ------------------------------------------------------------------------
+ // 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<IDomainInfo> 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;
+
+
+ // ------------------------------------------------------------------------
+ // 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<IDomainInfo> 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) {
+ if (TraceSessionState.INACTIVE.getInName().equals(stateName)) {
+ fState = TraceSessionState.INACTIVE;
+ } else if (TraceSessionState.ACTIVE.getInName().equals(stateName)) {
+ fState = TraceSessionState.ACTIVE;
+ }
+ }
+
+ @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<IDomainInfo> domains) {
+ fDomains.clear();
+ for (Iterator<IDomainInfo> iterator = domains.iterator(); iterator.hasNext();) {
+ IDomainInfo domainInfo = iterator.next();
+ fDomains.add(domainInfo);
+ }
+ }
+
+ @Override
+ public boolean isStreamedTrace() {
+ 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;
+ }
+
+ // ------------------------------------------------------------------------
+ // 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<IDomainInfo> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the snapshot interface (ISnapshotInfo) to store snapshot
+ * related data.
+ * </p>
+ *
+ * @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();
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the base trace information interface (ITraceInfo) to
+ * store common data.
+ * </p>
+ *
+ * @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
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the Ust Provider interface (IUstProviderInfo) to store UST
+ * provider related data.
+ * </p>
+ *
+ * @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<IBaseEventInfo> 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<IBaseEventInfo> 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<IBaseEventInfo> events) {
+ fEvents.clear();
+ for (Iterator<IBaseEventInfo> 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<IBaseEventInfo> iterator = fEvents.iterator(); iterator.hasNext();) {
+ IBaseEventInfo event = iterator.next();
+ output.append(event.toString());
+ }
+ }
+ output.append(")]");
+ return output.toString();
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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() {
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.
+ * <p>
+ * Kernel session configuration example:
+ *
+ * <pre>
+ * {@code
+ * <sessions>
+ * <session>
+ * <name>test_kernel</name>
+ * <domains>
+ * <domain>
+ * <type>KERNEL</type>
+ * <buffer_type>GLOBAL</buffer_type>
+ * <channels>
+ * <channel>
+ * <name>channel0</name>
+ * <enabled>false</enabled>
+ * <overwrite_mode>DISCARD</overwrite_mode>
+ * <subbuffer_size>262144</subbuffer_size>
+ * <subbuffer_count>4</subbuffer_count>
+ * <switch_timer_interval>0</switch_timer_interval>
+ * <read_timer_interval>200000</read_timer_interval>
+ * <output_type>SPLICE</output_type>
+ * <tracefile_size>0</tracefile_size>
+ * <tracefile_count>0</tracefile_count>
+ * <live_timer_interval>0</live_timer_interval>
+ * <events>
+ * <event>
+ * <enabled>true</enabled>
+ * <type>SYSCALL</type>
+ * </event>
+ * <event>
+ * <name>snd_soc_cache_sync</name>
+ * <enabled>true</enabled>
+ * <type>TRACEPOINT</type>
+ * </event>
+ * </events>
+ * </channel>
+ * </channels>
+ * </domain>
+ * </domains>
+ * <started>false</started>
+ * <output>
+ * <consumer_output>
+ * <enabled>true</enabled>
+ * <destination>
+ * <path>/home/user/lttng-traces/test_kernel</path>
+ * </destination>
+ * </consumer_output>
+ * </output>
+ * </session>
+ * </sessions>
+ * }
+ * </pre>
+ *
+ * </p>
+ *
+ * @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<ISessionInfo> 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<ISessionInfo> 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().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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2014 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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";
+}
--- /dev/null
+###############################################################################
+# Copyright (c) 2014 École Polytechnique de Montréal
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# 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}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2014 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+elementFormDefault="qualified" version="2.5">
+
+<xs:simpleType name="name_type">
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="uint64_type">
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="0"/>
+ <xs:maxInclusive value="18446744073709551615"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="uint32_type">
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="0"/>
+ <xs:maxInclusive value="4294967295"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<xs:simpleType name="channel_overwrite_mode_type">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="DISCARD"/>
+ <xs:enumeration value="OVERWRITE"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<!-- Maps to the lttng_event_output enum -->
+<xs:simpleType name="event_output_type">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="SPLICE"/>
+ <xs:enumeration value="MMAP"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<!-- Maps to the lttng_loglevel_type enum -->
+<xs:simpleType name="loglevel_type">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ALL"/>
+ <xs:enumeration value="RANGE"/>
+ <xs:enumeration value="SINGLE"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<!-- Maps to the lttng_event_type enum -->
+<xs:simpleType name="event_type_type">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ALL"/>
+ <xs:enumeration value="TRACEPOINT"/>
+ <xs:enumeration value="PROBE"/>
+ <xs:enumeration value="FUNCTION"/>
+ <xs:enumeration value="FUNCTION_ENTRY"/>
+ <xs:enumeration value="NOOP"/>
+ <xs:enumeration value="SYSCALL"/>
+ <xs:enumeration value="KPROBE"/>
+ <xs:enumeration value="KRETPROBE"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<xs:complexType name="event_probe_attributes_type">
+ <xs:all>
+ <xs:element name="symbol_name" type="name_type" minOccurs="0"/>
+ <xs:element name="address" type="uint64_type" minOccurs="0"/>
+ <xs:element name="offset" type="uint64_type" minOccurs="0"/>
+ </xs:all>
+</xs:complexType>
+
+<xs:complexType name="event_ftrace_attributes_type">
+ <xs:all>
+ <xs:element name="symbol_name" type="name_type"/>
+ </xs:all>
+</xs:complexType>
+
+<xs:complexType name="event_attributes_type">
+ <xs:choice>
+ <xs:element name="probe_attributes" type="event_probe_attributes_type"/>
+ <xs:element name="function_attributes" type="event_ftrace_attributes_type"/>
+ </xs:choice>
+</xs:complexType>
+
+<xs:complexType name="event_exclusion_list_type">
+ <xs:sequence>
+ <xs:element name="exclusion" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="event_type">
+ <xs:all>
+ <xs:element name="name" type="name_type" minOccurs="0"/>
+ <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0"/>
+ <xs:element name="type" type="event_type_type" default="TRACEPOINT" minOccurs="0"/>
+ <xs:element name="loglevel_type" type="loglevel_type" default="ALL" minOccurs="0"/>
+ <xs:element name="loglevel" type="xs:int" default="-1" minOccurs="0"/>
+ <xs:element name="filter" type="xs:string" minOccurs="0"/>
+ <xs:element name="exclusions" type="event_exclusion_list_type" minOccurs="0"/>
+ <xs:element name="attributes" type="event_attributes_type" minOccurs="0"/>
+ </xs:all>
+</xs:complexType>
+
+<xs:complexType name="event_list_type">
+ <xs:sequence>
+ <xs:element name="event" type="event_type" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="event_perf_context_type">
+ <xs:all>
+ <xs:element name="type" type="uint32_type"/>
+ <xs:element name="config" type="uint64_type"/>
+ <xs:element name="name" type="name_type"/>
+ </xs:all>
+</xs:complexType>
+
+<!-- Maps to the lttng_event_context_type enum -->
+<xs:simpleType name="event_context_type_type">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="PID"/>
+ <xs:enumeration value="PROCNAME"/>
+ <xs:enumeration value="PRIO"/>
+ <xs:enumeration value="NICE"/>
+ <xs:enumeration value="VPID"/>
+ <xs:enumeration value="TID"/>
+ <xs:enumeration value="VTID"/>
+ <xs:enumeration value="PPID"/>
+ <xs:enumeration value="VPPID"/>
+ <xs:enumeration value="PTHREAD_ID"/>
+ <xs:enumeration value="HOSTNAME"/>
+ <xs:enumeration value="IP"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<xs:complexType name="event_context_type">
+ <xs:choice>
+ <xs:element name="type" type="event_context_type_type"/>
+ <xs:element name="perf" type="event_perf_context_type"/>
+ </xs:choice>
+</xs:complexType>
+
+<xs:complexType name="event_context_list_type">
+ <xs:sequence>
+ <xs:element name="context" type="event_context_type" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+</xs:complexType>
+
+<!-- Maps to struct lttng_channel -->
+<xs:complexType name="channel_type">
+ <xs:all>
+ <xs:element name="name" type="name_type"/>
+ <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0"/>
+ <xs:element name="overwrite_mode" type="channel_overwrite_mode_type" default="DISCARD" minOccurs="0"/>
+ <xs:element name="subbuffer_size" type="uint64_type" minOccurs="0"/> <!-- bytes -->
+ <xs:element name="subbuffer_count" type="uint64_type" default="4" minOccurs="0"/>
+ <xs:element name="switch_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
+ <xs:element name="read_timer_interval" type="uint32_type"/> <!-- usec -->
+ <xs:element name="output_type" type="event_output_type"/>
+ <xs:element name="tracefile_size" type="uint64_type" default="0" minOccurs="0"/> <!-- bytes -->
+ <xs:element name="tracefile_count" type="uint64_type" default="0" minOccurs="0"/>
+ <xs:element name="live_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
+ <xs:element name="events" type="event_list_type" minOccurs="0"/>
+ <xs:element name="contexts" type="event_context_list_type" minOccurs="0"/>
+ </xs:all>
+</xs:complexType>
+
+<!-- Maps to the lttng_domain_type enum -->
+<xs:simpleType name="domain_type_type">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="KERNEL"/>
+ <xs:enumeration value="UST"/>
+ <xs:enumeration value="JUL"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<!-- Maps to the lttng_buffer_type enum -->
+<xs:simpleType name="domain_buffer_type">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="PER_PID"/>
+ <xs:enumeration value="PER_UID"/>
+ <xs:enumeration value="GLOBAL"/>
+ </xs:restriction>
+</xs:simpleType>
+
+<xs:complexType name="channel_list_type">
+ <xs:sequence>
+ <xs:element name="channel" type="channel_type" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+</xs:complexType>
+
+<!-- Maps to struct lttng_domain and contains channels -->
+<xs:complexType name="domain_type">
+ <xs:all>
+ <xs:element name="type" type="domain_type_type"/>
+ <xs:element name="buffer_type" type="domain_buffer_type"/>
+ <xs:element name="channels" type="channel_list_type" minOccurs="0"/>
+ </xs:all>
+</xs:complexType>
+
+<xs:complexType name="session_attributes_type">
+ <xs:choice>
+ <xs:element name="snapshot_mode" type="xs:boolean"/>
+ <xs:element name="live_timer_interval" type="uint32_type"/> <!-- usec -->
+ </xs:choice>
+</xs:complexType>
+
+<xs:complexType name="domain_list_type">
+ <xs:sequence>
+ <xs:element name="domain" type="domain_type" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="net_output_type">
+ <xs:all>
+ <xs:element name="control_uri" type="xs:string"/>
+ <xs:element name="data_uri" type="xs:string"/>
+ </xs:all>
+</xs:complexType>
+
+<xs:complexType name="destination_type">
+ <xs:choice>
+ <xs:element name="path" type="xs:string"/>
+ <xs:element name="net_output" type="net_output_type"/>
+ </xs:choice>
+</xs:complexType>
+
+<xs:complexType name="consumer_output_type">
+ <xs:all>
+ <xs:element name="enabled" type="xs:boolean" default="true"/>
+ <xs:element name="destination" type="destination_type"/>
+ </xs:all>
+</xs:complexType>
+
+<xs:complexType name="snapshot_output_type">
+ <xs:all>
+ <xs:element name="name" type="name_type"/>
+ <xs:element name="max_size" type="uint64_type"/>
+ <xs:element name="consumer_output" type="consumer_output_type"/>
+ </xs:all>
+</xs:complexType>
+
+<xs:complexType name="snapshot_output_list_type">
+ <xs:sequence>
+ <xs:element name="output" type="snapshot_output_type" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="session_output_type">
+ <xs:choice>
+ <xs:element name="snapshot_outputs" type="snapshot_output_list_type"/>
+ <xs:element name="consumer_output" type="consumer_output_type"/>
+ </xs:choice>
+</xs:complexType>
+
+<xs:complexType name="session_type">
+ <xs:all>
+ <xs:element name="name" type="name_type"/>
+ <xs:element name="domains" type="domain_list_type" minOccurs="0"/>
+ <xs:element name="started" type="xs:boolean" default="0" minOccurs="0"/>
+ <xs:element name="attributes" type="session_attributes_type" minOccurs="0"/>
+ <xs:element name="output" type="session_output_type" minOccurs="0"/>
+ </xs:all>
+</xs:complexType>
+
+<xs:element name="sessions">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="session" type="session_type" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:element>
+
+</xs:schema>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="stubs"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+bin/
+target/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.lttng2.control.ui.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
--- /dev/null
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+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=ignore
+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=error
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=250
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
--- /dev/null
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_tmf-style
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
--- /dev/null
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
--- /dev/null
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 3.0.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.0.0",
+ org.eclipse.linuxtools.lttng2.control.ui;bundle-version="3.0.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
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2013 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms 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
--- /dev/null
+###############################################################################
+# 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
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>linuxtools-lttng-parent</artifactId>
+ <groupId>org.eclipse.linuxtools.lttng</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.linuxtools.lttng2.control.ui.tests</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <name>Linux Tools LTTng Control UI Tests Plug-in</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <testSuite>org.eclipse.linuxtools.lttng2.control.ui.tests</testSuite>
+ <testClass>org.eclipse.linuxtools.lttng2.control.ui.tests.AllTests</testClass>
+ <useUIHarness>true</useUIHarness>
+ <useUIThread>true</useUIThread>
+ <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
+ <product>org.eclipse.platform.ide</product>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <groupId>org.eclipse.linuxtools.lttng2</groupId>
+</project>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.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);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ * 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 {
+
+}
--- /dev/null
+/*******************************************************************************
+ * 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,
+ TraceControlKernelProviderTests.class,
+ TraceControlKernelSessionTests.class,
+ TraceControlPropertiesTest.class,
+ TraceControlTreeModelNoProvidersTest.class,
+ TraceControlTreeModelTest.class,
+ TraceControlUstProviderTests.class,
+ TraceControlUstSessionTests.class,
+ TraceControlUstSessionTests2.class,
+ TraceControlSnapshotSessionTests.class
+})
+public class AllTests {
+
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * 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.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.junit.Test;
+
+/**
+ * The class <code>TraceControlComponentTest</code> contains tests for the class
+ * <code>{@link TraceControlComponent}</code>.
+ */
+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<Object> 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);
+
+ 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>)/ITraceControlComponent[] getChildren() method test.
+ */
+ @Test
+ public void testGetAndSetChildren() {
+ TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
+ fixture.setToolTip("");
+ List<ITraceControlComponent> 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
--- /dev/null
+/**********************************************************************
+ * 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.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.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 <code>TraceControlKernelSessionTests</code> contains Kernel session/channel/event
+ * handling test cases.
+ */
+
+@SuppressWarnings("javadoc")
+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";
+
+ // ------------------------------------------------------------------------
+ // 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.
+ *
+ * @throws Exception
+ * if the clean-up fails for some reason
+ *
+ */
+ @After
+ public void tearDown() {
+ fFacility.waitForJobs();
+ }
+
+ /**
+ * Run the TraceControlComponent.
+ */
+ @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());
+
+ // 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("mysession", session.getName());
+ 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("mysession", session.getName());
+ 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("mysession", session.getName());
+ 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("mysession", session.getName());
+ 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);
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.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 <code>TraceControlKernelProviderTests</code> 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());
+ 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
--- /dev/null
+/**********************************************************************
+ * 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.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 <code>TraceControlKernelSessionTests</code> 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());
+ 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());
+ 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<String> 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<String> 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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 <code>TraceControlPropertiesTest</code> contains tests for the all
+ * property class</code>.
+ */
+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());
+
+ //-------------------------------------------------------------------------
+ // Delete node
+ //-------------------------------------------------------------------------
+ node.disconnect();
+ node.getParent().removeChild(node);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2013, 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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 <code>TraceControlSnapshotSessionTests</code> 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<String,String> 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
--- /dev/null
+/*******************************************************************************
+ * 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.SWT;
+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()) {
+ if ("cocoa".equals (SWT.getPlatform ())) {
+ // The display needs to be woken up because it's possible
+ // to get in a state where nothing will wake up the UI thread
+ display.asyncExec(null);
+ }
+ display.sleep();
+ }
+ 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");
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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 <code>TraceControlTreeModelNoProvidersTest</code> 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.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.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 <code>TraceControlTreeModelTest</code> 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());
+ 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());
+ 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());
+ 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());
+ 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(2, ustEvents.length);
+
+ event = (TraceEventComponent) ustEvents[0];
+ assertEquals("ust_tests_hello:tptest_sighandler", event.getName());
+ assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.DISABLED, event.getState());
+
+ event = (TraceEventComponent) ustEvents[1];
+ assertEquals("*", ustEvents[1].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();
+ String 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());
+
+ 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.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 <code>TraceControlUstProviderTests</code> 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());
+ 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
--- /dev/null
+/**********************************************************************
+ * 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.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 <code>TraceControlUstSessionTests</code> 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());
+ 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());
+ 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<String> 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(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
--- /dev/null
+/**********************************************************************
+ * 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 <code>TraceControlUstSessionTests</code> 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
--- /dev/null
+/*******************************************************************************
+ * 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
+})
+public class AllTests {
+
+}
--- /dev/null
+/**********************************************************************
+ * 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.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.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 <code>LTTngControlServiceTest</code> contains test for the class
+ * <code>{@link LTTngControlService}</code>.
+ */
+@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";
+ private 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_STREAMED_SNAPSHOT_SESSION = "CreateSessionStreamedSnapshot";
+ private static final String SCEN_CREATE_SNAPSHOT_SESSION_ERRORS = "CreateSessionSnapshotErrors";
+
+ // ------------------------------------------------------------------------
+ // Test data
+ // ------------------------------------------------------------------------
+
+ private CommandShellFactory fShellFactory;
+ private String fTestfile;
+ private LTTngToolsFileShell fShell;
+ private 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(DIRECTORY + File.separator + TEST_STREAM), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ fTestfile = testfile.getAbsolutePath();
+
+ fShell = fShellFactory.getFileShell();
+ fShell.loadScenarioFile(fTestfile);
+ fService = new LTTngControlService(fShell);
+
+ ControlPreferences.getInstance().init(Activator.getDefault().getPreferenceStore());
+ }
+
+ @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.getVersion());
+ } 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.getVersion());
+ } 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());
+ 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());
+ 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());
+ 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());
+ 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(TraceLogLevel.LEVEL_UNKNOWN, 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());
+ }
+ }
+
+ public void testGetKernelProvider() {
+ try {
+ fShell.setScenario(SCEN_GET_KERNEL_PROVIDER1);
+ List<IBaseEventInfo> 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<IBaseEventInfo> 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<IBaseEventInfo> 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<IBaseEventInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> contexts = new ArrayList<>();
+ contexts.add("prio");
+ contexts.add("pid");
+
+ fShell.setScenario(SCEN_CONTEXT_HANDLING);
+
+ List<String> availContexts = fService.getContextList(new NullProgressMonitor());
+ assertNotNull(availContexts);
+ assertEquals(12, availContexts.size());
+
+ // A very "hard-coded" way to verify but it works ...
+ Set<String> 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<String> 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());
+ }
+ }
+
+ 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
+ }
+ }
+
+ 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);
+ }
+
+
+}
--- /dev/null
+/**********************************************************************
+ * 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<String> fAvailableContexts = null;
+ private List<String> fContexts = null;
+
+ @Override
+ public int open() {
+ return 0;
+ }
+
+ @Override
+ public void setAvalibleContexts(List<String> contexts) {
+ fAvailableContexts = new HashSet<>();
+ fAvailableContexts.addAll(contexts);
+ }
+
+ @Override
+ public List<String> getContexts() {
+ List<String> ret = new ArrayList<>();
+ ret.addAll(fContexts);
+ return ret;
+ }
+
+ public void setContexts(List<String> contexts) throws IllegalArgumentException{
+ fContexts = new ArrayList<>();
+ fContexts.addAll(contexts);
+ // If availableContexts are null we cannot verify
+ if (fAvailableContexts != null) {
+ for (Iterator<String> iterator = fContexts.iterator(); iterator.hasNext();) {
+ String string = iterator.next();
+ if (!fAvailableContexts.contains(string)) {
+ throw new IllegalArgumentException();
+ }
+ }
+ }
+ }
+}
+
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ * Bernd Hufmann - Updated for support of LTTng Tools 2.1
+ **********************************************************************/
+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;
+
+ @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;
+ }
+
+ @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.setSnapshot(fIsSnapshot);
+
+ return sessionInfo;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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
--- /dev/null
+/**********************************************************************
+ * 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<String> 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<String> 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<String> 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+ }
+}
+
--- /dev/null
+/**********************************************************************
+ * 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();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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) {
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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 = "<SCENARIO>";
+ private final static String SCENARIO_END_KEY = "</SCENARIO>";
+ private final static String INPUT_KEY = "<COMMAND_INPUT>";
+ private final static String INPUT_END_KEY = "</COMMAND_INPUT>";
+ private final static String RESULT_KEY = "<COMMAND_RESULT>";
+ private final static String OUTPUT_KEY = "<COMMAND_OUTPUT>";
+ private final static String OUTPUT_END_KEY = "</COMMAND_OUTPUT>";
+ 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<String, Map<String, ICommandResult>> fScenarioMap = new HashMap<>();
+ private final Map<String, Integer> 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_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)
+ *
+ * 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<Map<String, ICommandResult>> values = fScenarioMap.values();
+ for (Iterator<Map<String, ICommandResult>> iterator = values.iterator(); iterator.hasNext();) {
+ Map<String, ICommandResult> 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
+ // <session> commands.
+ // The numbers are per scenario.
+ Map<String, Integer> 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<String, ICommandResult> commandMap = new HashMap<>();
+ fScenarioMap.put(scenario, commandMap);
+ List<String> output = null;
+ String input = null;
+ boolean inOutput = 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
+ // <session"-comamand
+ Matcher matcher = LTTNG_LIST_SESSION_PATTERN.matcher(strLine);
+ if (matcher.matches() && !input.matches(LTTNG_LIST_PROVIDER_PATTERN)) {
+ String sessionName = matcher.group(1).trim();
+ Integer i = tmpSessionNameMap.get(sessionName);
+ if (i != null) {
+ i++;
+ } else {
+ i = 0;
+ }
+ tmpSessionNameMap.put(sessionName, i);
+ input += String.valueOf(i);
+ }
+ } else if (INPUT_END_KEY.equals(strLine)) {
+ // Initialize output array
+ output = 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) {
+ commandMap.put(input, new CommandResult(result, output.toArray(new String[output.size()])));
+ }
+ inOutput = false;
+ } else if (OUTPUT_KEY.equals(strLine)) {
+ // first line of output
+ inOutput = true;
+ strLine = br.readLine();
+
+ // Ignore comments
+ while (isComment(strLine)) {
+ strLine = br.readLine();
+ }
+ if (output != null) {
+ output.add(strLine);
+ }
+ } else if (inOutput) {
+ // subsequent lines of output
+ 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<String, ICommandResult> 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);
+ // For verification of setters of class CommandResult
+ result.setOutput(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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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]);
+ }
+}
--- /dev/null
+####################################################################
+# 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
+####################################################################
+<SCENARIO>
+Initialize
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+lttng version 2.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Currently no available tracing session
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -u
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng create <session> with LTTng 2.1 options
+####################################################################
+##################################################################
+<SCENARIO>
+CreateSessionFileProto
+<COMMAND_INPUT>
+lttng create mysession -U file:///tmp
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in file:///tmp
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+ Trace path: file:///tmp
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+##################################################################
+<SCENARIO>
+CreateSessionControlData
+<COMMAND_INPUT>
+lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+ Trace path: tcp://172.0.0.1:5342 [data: 5343]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+##################################################################
+<SCENARIO>
+CreateSessionNetwork
+<COMMAND_INPUT>
+lttng create mysession -U net://172.0.0.1:1234:2345
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in net://172.0.0.1:1234:2345
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+ Trace path: net://172.0.0.1:1234 [data: 2345]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession2 destroyed.
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+##################################################################
+<SCENARIO>
+CreateSessionNetwork2
+<COMMAND_INPUT>
+lttng create mysession -U net6://[ffff::eeee:dddd:cccc:0]
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in net6://[ffff::eeee:dddd:cccc:0]
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+ Trace path: net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession2 destroyed.
+</COMMAND_OUTPUT>
+
+</SCENARIO>
\ No newline at end of file
--- /dev/null
+####################################################################
+# 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
+####################################################################
+<SCENARIO>
+Initialize
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Currently no available tracing session
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -u -f
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng create <session> --snapshot" LTTng 2.3
+####################################################################
+<SCENARIO>
+ScenCreateSession
+<COMMAND_INPUT>
+lttng create mysession --snapshot
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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.
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive snapshot]
+ Trace path:
+
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng snapshot list-output -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Snapshot output list for session mysession
+ [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng start mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing started for session mysession.
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng snapshot record -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+ Snapshot recorded successfully for session mysession
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng stop mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing stopped for session mysession.
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+</SCENARIO>
--- /dev/null
+####################################################################
+# Copyright (c) 2012, 2013 Ericsson
+#
+# All rights reserved. This program and the accompanying materials are
+# made available under the terms of the Eclipse Public License v1.0 which
+# accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Bernd Hufmann - Initial API and implementation
+####################################################################
+####################################################################
+# Scenario: Initialize
+####################################################################
+<SCENARIO>
+Initialize
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+lttng version 2.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Currently no available tracing session
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -u
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Create and destroy session
+####################################################################
+<SCENARIO>
+SessionHandling
+<SCENARIO>
+<COMMAND_INPUT>
+lttng create mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in /home/user/lttng-traces/mysession-20120314-132824
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+ Trace path: /home/user/lttng-traces/mysession-20120314-132824
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng start mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing started for session mysession.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng stop mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing stopped for session mysession.
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+####################################################################
+# Scenario: Create and destroy session
+####################################################################
+<SCENARIO>
+SessionHandlingWithPath
+<SCENARIO>
+<COMMAND_INPUT>
+lttng create mysession -o /home/user/temp
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in /home/user/temp
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+ Trace path: /home/user/temp
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+
+####################################################################
+# Scenario: Enable events from kernel provider events
+####################################################################
+<SCENARIO>
+Scenario1
+
+
+<COMMAND_INPUT>
+lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k -s mysession --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event sched_kthread_stop created in channel channel0
+kernel sched_kthread_stop_ret created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng disable-event sched_kthread_stop_ret,sched_kthread_stop -k -s mysession -c channel0
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event sched_kthread_stop_ret disabled in channel channel0
+kernel event sched_kthread_stop disabled in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event sched_kthread_stop -k -s mysession -c channel0 --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event sched_kthread_stop enabled in channel channel0
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+####################################################################
+# Scenario: Enable events from UST provider events
+####################################################################
+<SCENARIO>
+Scenario2
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel -u -s mysession --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel mychannel enabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event ust_tests_hello:tptest_sighandler,ust_tests_hello:tptest -u -s mysession --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event ust_tests_hello:tptest_sighandler in channel channel0
+UST sched_ust_tests_hello:tptest created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng disable-event ust_tests_hello:tptest -u -s mysession -c mychannel
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event ust_tests_hello:tptest in channel mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event ust_tests_hello:tptest -u -s mysession -c mychannel --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event ust_tests_hello:tptest enabled in channel mychannel
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+<SCENARIO>
+Scenario3
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel -k -s mysession --overwrite --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel channel mychannel enabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel2 -k -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel channel mychannel2 enabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+
+<COMMAND_INPUT>
+lttng disable-channel mychannel,mychannel2 -k -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel channel mychannel disabled for session mysession
+Kernel channel mychannel2 disabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel,mychannel2 -k -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel channel mychannel enabled for session mysession
+Kernel channel mychannel2 enabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k -s mysession --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event sched_kthread_stop created in channel channel0
+kernel sched_kthread_stop_ret created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event sched_wakeup_new -k -s mysession --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event sched_wakeup_new created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event -a -k -s mysession -c mychannel2 --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All kernel event sched_kthread_stop created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event -a -k -s mysession -c mychannel --syscall
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All kernel system calls are enabled in channel mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event -a -k -s mysession --syscall
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All kernel system calls are enabled in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event -a -k -s mysession --syscall
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All kernel system calls are enabled in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent1 -k -s mysession --probe 0xc0101280
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event myevent1 created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent2 -k -s mysession -c channel0 --probe init_post
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event myevent2 created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent3 -k -s mysession --probe init_post:0x1000
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event myevent2 created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent4 -k -s mysession --function create_dev
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event myevent4 created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent5 -k -s mysession --function create_dev:0x2000
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event myevent5 created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent -k -s mysession -c mychannel --function create_dev:0x2000
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event myevent created in channel mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Available tracing sessions:
+ 1) mysession (/home/eedbhu/lttng-traces/mysession-20120321-115617) [inactive]
+
+Use lttng list <session_name> for more details
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -u
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context -h
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context -s mysession -k -t prio -t perf:branch-misses -t perf:cache-misses
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context -h
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context -s mysession -c mychannel -k -t prio -t perf:branch-misses -t perf:cache-misses
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context -h
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context -s mysession -c channel0 -e sched_kthread_stop_ret -k -t prio -t perf:branch-misses -t perf:cache-misses
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng calibrate -k --function
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel calibration done
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+<SCENARIO>
+Scenario4
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel -u -s mysession --overwrite --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel mychannel enabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel2 -u -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel mychannel2 enabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event ust_tests_hello:tptest_sighandler created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event ust_tests_hello:tptest -u -s mysession --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event ust_tests_hello:tptest created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event -a -u -s mysession -c mychannel2 --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All UST events created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event "ust*" -u -s mysession -c mychannel --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event ust* created in channel mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event "ust*" -u -s mysession --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event ust* created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event "u*" -u -s mysession --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event u* created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+
+<COMMAND_INPUT>
+lttng enable-event myevent1 -u -s mysession --loglevel TRACE_WARNING
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event myevent1 created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent2 -u -s mysession --loglevel-only TRACE_DEBUG_FUNCTION
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event myevent2 created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent0 -u -s mysession -c mychannel --loglevel-only TRACE_DEBUG_FUNCTION
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event myevent0 created in channel mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+
+
+</SCENARIO>
+
+
+
--- /dev/null
+####################################################################
+# 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
+####################################################################
+<SCENARIO>
+Initialize
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+lttng version 2.2.0 - Cuda
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Currently no available tracing session
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -u -f
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Session and channel with per-UID UST buffers
+####################################################################
+<SCENARIO>
+ScenPerUidTest
+<COMMAND_INPUT>
+lttng create mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+ Trace path: /home/user/lttng-traces/mysession-20130812-113358
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session my destroyed.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel -u -s mysession --buffers-uid
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel mychannel enabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+####################################################################
+# Scenario: Session and channel with per-PID UST buffers
+####################################################################
+<SCENARIO>
+ScenPerPidTest
+<COMMAND_INPUT>
+lttng create mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+ Trace path: /home/user/lttng-traces/mysession-20130812-113358
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel -u -s mysession --buffers-pid
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel mychannel enabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+####################################################################
+# Scenario: Session and channel with per-PID UST buffers with option -C -W
+####################################################################
+<SCENARIO>
+ScenBufSizeTest
+<COMMAND_INPUT>
+lttng create mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession: [inactive]
+ Trace path: /home/user/lttng-traces/mysession-20130812-113358
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel -u -s mysession -C 1024 -W 10
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Warning: Tracefile size rounded up from (1024) to subbuffer size (8388608)
+UST channel mychannel enabled for session mysession
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+
+
--- /dev/null
+####################################################################
+# 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
+####################################################################
+<SCENARIO>
+LttngNotInstalled
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Command not found
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test lttng version
+####################################################################
+<SCENARIO>
+LttngVersion
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+lttng version 2.1.0 - Basse Messe
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test lttng version
+# output with prompt
+####################################################################
+<SCENARIO>
+LttngVersionWithPrompt
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test lttng version (unsupported version)
+####################################################################
+<SCENARIO>
+LttngUnsupportedVersion
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+lttng version 200.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+
+####################################################################
+# Scenario: Test lttng version (noversion)
+####################################################################
+<SCENARIO>
+LttngNoVersion
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test no sessions available
+####################################################################
+<SCENARIO>
+NoSessionAvailable
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Currently no available tracing session
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test get sessions
+####################################################################
+<SCENARIO>
+GetSessionNames1
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_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 <session_name> for more details
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test lttng list <name> where session doesn't exist
+####################################################################
+<SCENARIO>
+GetSessionNameNotExist
+<COMMAND_INPUT>
+lttng list test
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session test not found
+Error: Session name not found
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test lttng -vvv list <name> where session doesn't exist
+####################################################################
+<SCENARIO>
+GetSessionNameNotExistVerbose
+<COMMAND_INPUT>
+lttng -vvv list test
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test lttng list with garbage output
+####################################################################
+<SCENARIO>
+GetSessionGarbageOut
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+asdfaereafsdcv 12333456434&*89**(())(^%$*
+@#$%^&*()@#$%^&*()0834523094578kj;djkfs
+a;sdf094v5u dsafj;sd9
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test lttng list <name> with sample outputs
+####################################################################
+<SCENARIO>
+GetSession1
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+
+</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng list mysession1
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession1: [inactive]
+ Trace path: /home/user/lttng-traces/mysession1-20120203-133225
+
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with sample output
+####################################################################
+<SCENARIO>
+GetKernelProvider1
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel and no session daemon
+####################################################################
+<SCENARIO>
+ListWithNoKernel1
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Spawning session daemon
+Error: Unable to list kernel events
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel and with session daemon
+####################################################################
+<SCENARIO>
+ListWithNoKernel2
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Error: Unable to list kernel events
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel, with session daemon and verbose
+####################################################################
+<SCENARIO>
+ListWithNoKernelVerbose
+<COMMAND_INPUT>
+lttng -vvv list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng list -u" with sample output
+####################################################################
+<SCENARIO>
+GetUstProvider1
+<COMMAND_INPUT>
+lttng list -u
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng list -u" with no UST provider available
+####################################################################
+<SCENARIO>
+GetUstProvider2
+<COMMAND_INPUT>
+lttng list -u
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST events:
+-------------
+None
+
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng list -u" with no UST available (LTTng 2.0.x)
+####################################################################
+<SCENARIO>
+ListWithNoUst1
+<COMMAND_INPUT>
+lttng list -u
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST events:
+-------------
+None
+Segmentation Fault
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng list -u" with no UST available and no session daemon
+####################################################################
+<SCENARIO>
+ListWithNoUst2
+<COMMAND_INPUT>
+lttng list -u -f
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Spawning a session daemon
+Error: Unable to list UST events: Listing UST events failed
+Error: Command Error
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel and with session daemon
+####################################################################
+<SCENARIO>
+ListWithNoUst3
+<COMMAND_INPUT>
+lttng list -u -f
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Error: Unable to list UST events: Listing UST events failed
+Error: Command Error
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng list -u" with no kernel, with session daemon and verbose
+####################################################################
+<SCENARIO>
+ListWithNoUstVerbose
+<COMMAND_INPUT>
+lttng -vvv list -u -f
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+
+####################################################################
+# Scenario: Test "lttng list -u -f" with sample output (version 2.1.0)
+####################################################################
+<SCENARIO>
+GetUstProvider3
+<COMMAND_INPUT>
+lttng list -u -f
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+
+####################################################################
+# Scenario: Test "lttng create <session>
+####################################################################
+<SCENARIO>
+CreateSession1
+<COMMAND_INPUT>
+lttng create mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession2 created.
+Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng create <session>
+####################################################################
+<SCENARIO>
+CreateSessionWithPrompt
+<COMMAND_INPUT>
+lttng create mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Prompt> Session mysession2 created.
+Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng create <session> with different variants
+# and errors
+####################################################################
+<SCENARIO>
+CreateSessionVariants
+<COMMAND_INPUT>
+lttng create alreadyExist
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Error: Session name already exist
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng create "session with spaces"
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session session with spaces created.
+Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng create wrongName
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session auto created.
+Traces will be written in /home/user/lttng-traces/auto-20120209-095418
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng create wrongPath -o /home/user/hallo
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session wrongPath created.
+Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng create pathWithSpaces -o "/home/user/hallo user/here"
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session pathWithSpaces created.
+Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng destroy <session>
+####################################################################
+
+<SCENARIO>
+DestroySession1
+<COMMAND_INPUT>
+lttng destroy mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession2 destroyed.
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng -vvv destroy <session>"
+####################################################################
+
+<SCENARIO>
+DestroySessionVerbose
+<COMMAND_INPUT>
+lttng -vvv destroy mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+
+####################################################################
+# Scenario: Test "lttng enable-channel ..." with different inputs
+####################################################################
+
+<SCENARIO>
+ChannelHandling
+<COMMAND_INPUT>
+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
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel channel mychannel0 enabled for session mysession2
+Kernel channel mychannel1 enabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel channel mychannel0 enabled for session mysession2
+Kernel channel mychannel1 enabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel channel0 enabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel channel0 enabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+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
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel channel0 enabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel ustChannel -u -s mysession2 --overwrite --buffers-pid
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel ustChannel enabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel channel0 enabled for session mysession2
+</COMMAND_OUTPUT>
+
+
+<COMMAND_INPUT>
+lttng enable-channel mychannel0,mychannel1 -k -s mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel channel mychannel0 enabled for session mysession2
+Kernel channel mychannel1 enabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-channel ustChannel -u -s mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel mychannel0 enabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng disable-channel mychannel0,mychannel1 -k -s mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel channel mychannel0 disabled for session mysession2
+Kernel channel mychannel1 disabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng disable-channel ustChannel -u -s mysession2
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel mychannel0 enabled for session mysession2
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+
+####################################################################
+# Scenario: Test "lttng enable-events ..." with different inputs
+####################################################################
+<SCENARIO>
+EventHandling
+
+# Tracepoint test cases
+
+<COMMAND_INPUT>
+lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All kernel tracepoints are enabled in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event ust_tests_hello:tptest_sighandler created in channel mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint --filter 'intfield==10'
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event ust_tests_hello:tptest_sighandler created in channel mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All UST tracepoints are enabled in channel mychannel
+</COMMAND_OUTPUT>
+
+# Syscall test cases
+
+<COMMAND_INPUT>
+lttng enable-event -a -k -s mysession2 --syscall
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All kernel system calls are enabled in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event -a -k -s mysession2 -c mychannel --syscall
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All kernel system calls are enabled in channel mychannel
+</COMMAND_OUTPUT>
+
+# dynamic probe/function probe test cases
+
+<COMMAND_INPUT>
+lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event myevent0 created in channel mychannel
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+kernel event myevent1 created in channel mychannel
+</COMMAND_OUTPUT>
+
+# log level test cases
+
+<COMMAND_INPUT>
+lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event myevent4 created in channel channel0
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST event myevent5 created in channel mychannel
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs
+####################################################################
+
+<SCENARIO>
+ContextHandling
+
+<COMMAND_INPUT>
+lttng add-context -h
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+<SCENARIO>
+ContextErrorHandling
+
+<COMMAND_INPUT>
+lttng add-context -h
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+<SCENARIO>
+CalibrateHandling
+<COMMAND_INPUT>
+lttng calibrate -k --function
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel calibration done
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng calibrate -u --function
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel calibration done
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng create <session> with LTTng 2.1 options
+####################################################################
+<SCENARIO>
+CreateSessionLttng2.1
+
+<COMMAND_INPUT>
+lttng create mysession -U net://172.0.0.1
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in net://172.0.0.1
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng create mysession -U file:///tmp
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in file:///tmp
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng create mysession -U net://172.0.0.1:1234:2345
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession created.
+Traces will be written in net://172.0.0.1:1234:2345
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng -vvv create mysession -U net://172.0.0.1
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng -vvv create <session> with LTTng 2.1 options"
+####################################################################
+<SCENARIO>
+CreateSessionLttngVerbose2.1
+<COMMAND_INPUT>
+lttng -vvv create mysession -U net://172.0.0.1
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng -vvv destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng create <session> --snapshot (LTTng 2.3)
+####################################################################
+<SCENARIO>
+CreateSessionSnapshot
+<COMMAND_INPUT>
+lttng create mysession --snapshot
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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.
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng snapshot list-output -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Snapshot output list for session mysession
+ [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+ 1) mysession () [inactive snapshot]
+
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng snapshot record -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+ Snapshot recorded successfully for session mysession
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng create <session> --snapshot -U <URL> (LTTng 2.3)
+####################################################################
+<SCENARIO>
+CreateSessionStreamedSnapshot
+<COMMAND_INPUT>
+lttng create mysession --snapshot -U net://172.0.0.1
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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.
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng snapshot list-output -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Snapshot output list for session mysession
+ [2] snapshot-2: net4://172.0.0.1:5342/
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+ 1) mysession () [inactive snapshot]
+
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng snapshot record -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+ Snapshot recorded successfully for session mysession
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+</SCENARIO>
+
+
+
+
+####################################################################
+# Scenario: Test "lttng create <session> --snapshot (LTTng 2.3)
+####################################################################
+<SCENARIO>
+CreateSessionSnapshotErrors
+<COMMAND_INPUT>
+lttng snapshot list-output -s blabla
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Error: Session name not found
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+#next is not an error case but good to be tested
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+ 1) mysession () [active snapshot]
+
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng snapshot record -s blabla
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+ Error: Session name not found
+</COMMAND_OUTPUT>
+#------------------------------------------------------------------------------
+<COMMAND_INPUT>
+lttng snapshot record -s mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+ Error: Session needs to be started once
+</COMMAND_OUTPUT>
+
+</SCENARIO>
\ No newline at end of file
--- /dev/null
+####################################################################
+# 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 <name> with sample outputs
+####################################################################
+<SCENARIO>
+ListInfoTest
+
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+lttng version 2.1.0 - Basse Messe
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_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 <session_name> for more details
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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]
+ * (type: tracepoint) [enabled]
+
+</COMMAND_OUTPUT>
+<COMMAND_INPUT>
+lttng list mysession1
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Tracing session mysession1: [inactive]
+ Trace path: /home/user/lttng-traces/mysession1-20120203-133225
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -u -f
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
+
+####################################################################
+# Scenario: Test "lttng list -k" with no kernel and no session daemon
+####################################################################
+<SCENARIO>
+ListInfoTestNoKernel
+
+<COMMAND_INPUT>
+lttng version
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+lttng version 2.0.0 - Annedd'ale
+Web site: http://lttng.org/
+
+lttng is free software and under the GPL license and part LGPL
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Currently no available tracing session
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -k
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+1
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Error: Unable to list kernel events
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng list -u
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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)
+
+</COMMAND_OUTPUT>
+
+</SCENARIO>
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+bin/
+target/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.lttng2.control.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
--- /dev/null
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=error
+org.eclipse.jdt.core.compiler.problem.deprecation=error
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+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=ignore
+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=error
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=250
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
--- /dev/null
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_tmf-style
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
--- /dev/null
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
--- /dev/null
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=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=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 3.0.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.0.0",
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.ui;bundle-version="3.0.0"
+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.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: 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
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2013 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms 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
--- /dev/null
+###############################################################################
+# 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.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
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ id="org.eclipse.linuxtools.lttng2.ui.views"
+ point="org.eclipse.ui.views">
+ <category
+ id="org.eclipse.linuxtools.lttng2.ui.views.category"
+ name="%views.category.name">
+ </category>
+ <view
+ allowMultiple="false"
+ category="org.eclipse.linuxtools.lttng2.ui.views.category"
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView"
+ icon="icons/eview16/control_view.gif"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.views.control"
+ name="%control.view.name"
+ restorable="true">
+ </view>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ description="%commands.control.category.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ name="%commands.control.category">
+ </category>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.new.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.newConnection"
+ name="%commands.control.new">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.connect.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.connect"
+ name="%commands.control.connect">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.disconnect.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disconnect"
+ name="%commands.control.disconnect">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.refresh.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.refresh"
+ name="%commands.control.refresh">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.delete.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.delete"
+ name="%commands.control.delete">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.create.session.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.createSession"
+ name="%commands.control.create.session">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.destroy.session.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.destroySession"
+ name="%commands.control.destroy.session">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.import.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import"
+ name="%commands.control.import">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.enable.channelOnSession.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnSession"
+ name="%commands.control.enable.channelOnSession">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.enable.channelOnDomain.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnDomain"
+ name="%commands.control.enable.channelOnDomain">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.enable.channel.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannel"
+ name="%commands.control.enable.channel">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.disable.channel.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableChannel"
+ name="%commands.control.disable.channel">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.start.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.start"
+ name="%commands.control.start">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.stop.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.stop"
+ name="%commands.control.stop">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.assign.event.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.assign.event"
+ name="%commands.control.assign.event">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.enable.event.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEvent"
+ name="%commands.control.enable.event">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.disable.event.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableEvent"
+ name="%commands.control.disable.event">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.enable.eventOnChannel.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnChannel"
+ name="%commands.control.enable.eventOnChannel">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.enable.eventOnDomain.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnDomain"
+ name="%commands.control.enable.eventOnDomain">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.enable.eventOnSession.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnSession"
+ name="%commands.control.enable.eventOnSession">
+ </command>
+
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.add.context.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnDomain"
+ name="%commands.control.add.context">
+ </command>
+
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.add.context.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnChannel"
+ name="%commands.control.add.context">
+ </command>
+
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.add.context.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnEvent"
+ name="%commands.control.add.context">
+ </command>
+
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.import.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import"
+ name="%commands.control.import">
+ </command>
+
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.calibrate.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.calibrate"
+ name="%commands.control.calibrate">
+ </command>
+
+ <command
+ categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
+ description="%commands.control.snapshot.description"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.snapshot"
+ name="%commands.control.snapshot">
+ </command>
+
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="toolbar:org.eclipse.linuxtools.internal.lttng2.ui.views.control">
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.newConnection"
+ icon="icons/elcl16/target_add.gif"
+ label="%commands.control.new"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.connect"
+ icon="icons/elcl16/connect.gif"
+ label="%commands.control.connect"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disconnect"
+ icon="icons/elcl16/disconnect.gif"
+ label="%commands.control.disconnect"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.refresh"
+ icon="icons/elcl16/refresh.gif"
+ label="%commands.control.refresh"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.delete"
+ icon="icons/elcl16/target_delete.gif"
+ label="%commands.control.delete"
+ style="push">
+ </command>
+ <separator
+ name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.toolbar.separator1"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.start"
+ icon="icons/elcl16/start_trace.gif"
+ label="%commands.control.start"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.stop"
+ icon="icons/elcl16/pause_trace.gif"
+ label="%commands.control.stop"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.destroySession"
+ icon="icons/elcl16/delete_trace.gif"
+ label="%commands.control.destroy.session"
+ style="push">
+ </command>
+ <separator
+ name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.toolbar.separator2"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.snapshot"
+ icon="icons/elcl16/snapshot.gif"
+ label="%commands.control.snapshot"
+ style="push">
+ </command>
+ <separator
+ name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.toolbar.separator3"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import"
+ icon="icons/elcl16/import_trace.gif"
+ label="%commands.control.import"
+ style="push">
+ </command>
+
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.linuxtools.internal.lttng2.ui.views.control">
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.connect"
+ icon="icons/elcl16/connect.gif"
+ label="%commands.control.connect"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disconnect"
+ icon="icons/elcl16/disconnect.gif"
+ label="%commands.control.disconnect"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.refresh"
+ icon="icons/elcl16/refresh.gif"
+ label="%commands.control.refresh"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.delete"
+ icon="icons/elcl16/target_delete.gif"
+ label="%commands.control.delete"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.createSession"
+ icon="icons/elcl16/add_button.gif"
+ label="%commands.control.create.session"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.start"
+ icon="icons/elcl16/start_trace.gif"
+ label="%commands.control.start"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.stop"
+ icon="icons/elcl16/pause_trace.gif"
+ label="%commands.control.stop"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.destroySession"
+ icon="icons/elcl16/delete_trace.gif"
+ label="%commands.control.destroy.session"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <separator
+ name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.popup.separator1"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import"
+ icon="icons/elcl16/import_trace.gif"
+ label="%commands.control.import"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <separator
+ name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.popup.separator2"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnSession"
+ icon="icons/elcl16/add_button.gif"
+ label="%commands.control.enable.channelOnSession"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ <not>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent">
+ </instanceof>
+ </iterate>
+ </not>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnSession"
+ icon="icons/obj16/event_enabled.gif"
+ label="%commands.control.enable.eventOnDomain"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnDomain"
+ icon="icons/elcl16/add_button.gif"
+ label="%commands.control.enable.channelOnDomain"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent">
+ </instanceof>
+ </iterate>
+ <not>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </not>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnDomain"
+ icon="icons/elcl16/enable_event.gif"
+ label="%commands.control.enable.eventOnDomain"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannel"
+ icon="icons/elcl16/enable.gif"
+ label="%commands.control.enable.channel"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableChannel"
+ icon="icons/elcl16/disable.gif"
+ label="%commands.control.disable.channel"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.assign.event"
+ icon="icons/elcl16/enable_event.gif"
+ label="%commands.control.assign.event"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEvent"
+ icon="icons/elcl16/enable_event.gif"
+ label="%commands.control.enable.event"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableEvent"
+ icon="icons/elcl16/disable_event.gif"
+ label="%commands.control.disable.event"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnChannel"
+ icon="icons/elcl16/enable_event.gif"
+ label="%commands.control.enable.eventOnChannel"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnDomain"
+ icon="icons/elcl16/add-context.gif"
+ label="%commands.control.add.context"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnChannel"
+ icon="icons/elcl16/add-context.gif"
+ label="%commands.control.add.context"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnEvent"
+ icon="icons/elcl16/add-context.gif"
+ label="%commands.control.add.context"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <and>
+ <or>
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent">
+ </instanceof>
+ </or>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.isAddContextOnEventSupported">
+ </test>
+ </and>
+ </iterate>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.calibrate"
+ icon="icons/elcl16/calibrate.gif"
+ label="%commands.control.calibrate"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+
+ <command
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.snapshot"
+ icon="icons/elcl16/snapshot.gif"
+ label="%commands.control.snapshot"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+
+ </menuContribution>
+
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.NewConnectionHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.newConnection">
+ <activeWhen>
+ <with
+ variable="activePart">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView">
+ </instanceof>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.ConnectHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.connect">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.DisconnectHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disconnect">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.RefreshHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.refresh">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.DeleteHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.delete">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.CreateSessionHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.createSession">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.DestroySessionHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.destroySession">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.ImportHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import">
+ <activeWhen>
+ <with
+ variable="selection">
+ <and>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.EnableChannelOnSessionHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnSession">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.EnableChannelOnDomainHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnDomain">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.EnableChannelHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannel">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.DisableChannelHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableChannel">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.StartHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.start">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.StopHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.stop">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.SnaphshotHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.snapshot">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.AssignEventHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.assign.event">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.BaseEventComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.EnableEventHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEvent">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.DisableEventHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableEvent">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.EnableEventOnChannelHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnChannel">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.EnableEventOnDomainHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnDomain">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.EnableEventOnSessionHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnSession">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.AddContextOnDomainHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnDomain">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.CalibrateHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.calibrate">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.AddContextOnChannelHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnChannel">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.handlers.AddContextOnEventHandler"
+ commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnEvent">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceEventComponent">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+
+ </extension>
+
+ <extension
+ point="org.eclipse.rse.core.systemTypes">
+ <systemType
+ description="%trace.control.rse.system.type.description"
+ icon="icons/obj16/systemlttng2.gif"
+ iconLive="icons/obj16/systemlttng2-live.gif"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.control.systemType"
+ label="%trace.control.rse.system.type.name"
+ name="org.eclipse.linuxtools.internal.lttng2.ui.control.systemType"
+ subsystemConfigurationIds="ssh.shells;ssh.files;ssh.terminals;processes.shell.linux">
+ </systemType>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.linuxtools.tmf.ui.TmfTracingPreferences"
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferencePage"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences"
+ name="%preference.page.control.name">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.preferences.ControlPreferenceInitializer">
+ </initializer>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlPropertyTester"
+ id="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.propertyTester"
+ namespace="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model"
+ properties="isAddContextOnEventSupported"
+ type="org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceControlComponent">
+ </propertyTester>
+ </extension>
+
+
+</plugin>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>linuxtools-lttng-parent</artifactId>
+ <groupId>org.eclipse.linuxtools.lttng</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.linuxtools.lttng2.control.ui</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Linux Tools LTTng Control UI Plug-in</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <groupId>org.eclipse.linuxtools.lttng2</groupId>
+</project>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.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.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());
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ ControlPreferences.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));
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * 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;
+
+/**
+ * <p>
+ * View implementation for Trace Control.
+ * </p>
+ *
+ * @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.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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Dialog box for collecting information about contexts to be added to channels/events.
+ * </p>
+ *
+ * @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<String> 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<String> contexts) {
+ fContextModel.setAvalibleContexts(contexts);
+ }
+
+ @Override
+ public List<String> getContexts() {
+ List<String> 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<String> 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<Context> 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<String> contexts) {
+ fAvailableContexts = new ArrayList<>();
+ if (contexts != null) {
+ for (Iterator<String> 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();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Confirmation dialog implementation.
+ * </p>
+ *
+ * @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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.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.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.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+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;
+
+/**
+ * <p>
+ * Dialog box for collecting session creation information.
+ * </p>
+ *
+ * @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$
+
+ /**
+ * Supported network protocols for streaming
+ */
+ private enum StreamingProtocol {
+ /** Default network protocol for IPv4 (TCP)*/
+ net,
+ /** Default network protocol for IPv6 (TCP)*/
+ net6,
+ /** File */
+ file,
+ }
+
+ 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 snapshot session
+ */
+ private Button fSnapshotButton = null;
+ /**
+ * The Group for stream configuration.
+ */
+ private Group fMainStreamingGroup = null;
+ /**
+ * The button to show streaming options.
+ */
+ private Button fConfigureStreamingButton = 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 = null;
+ /**
+ * The session path string.
+ */
+ private String fSessionPath = null;
+ /**
+ * Flag whether the session is snapshot or not
+ */
+ private boolean fIsSnapshot = false;
+ /**
+ * Flag whether default location (path) shall be used or not
+ */
+ private boolean fIsDefaultPath = true;
+ /**
+ * Flag whether the trace is streamed or not
+ */
+ private boolean fIsStreamedTrace = 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;
+
+ // ------------------------------------------------------------------------
+ // 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;
+ fSessionName = null;
+ fSessionPath = null;
+ fIsSnapshot = false;
+ fIsDefaultPath = true;
+ fIsStreamedTrace = 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);
+
+ fSessionPathLabel = new Label(sessionGroup, SWT.RIGHT);
+ fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel);
+ fSessionPathText = new Text(sessionGroup, SWT.NONE);
+ fSessionPathText.setToolTipText(Messages.TraceControl_CreateSessionPathTooltip);
+ fSessionPathText.addModifyListener(fUpdateEnablementModifyListener);
+
+ if (fParent.isSnapshotSupported()) {
+ fSnapshotButton = new Button(sessionGroup, SWT.CHECK);
+ fSnapshotButton.setText(Messages.TraceControl_CreateSessionSnapshotLabel);
+ fSnapshotButton.setToolTipText(Messages.TraceControl_CreateSessionSnapshotTooltip);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 4;
+ fSnapshotButton.setData(data);
+ }
+
+ // layout widgets
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 3;
+
+ fSessionNameText.setLayoutData(data);
+
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 3;
+ fSessionPathText.setLayoutData(data);
+
+ if (fParent.isNetworkStreamingSupported()) {
+ createAdvancedOptionsComposite();
+ }
+
+ return fDialogComposite;
+ }
+
+ private void createAdvancedOptionsComposite() {
+
+ fMainStreamingGroup = new Group(fDialogComposite, SWT.SHADOW_NONE);
+ fMainStreamingGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
+ fMainStreamingGroup.setLayout(new GridLayout(1, true));
+
+ fConfigureStreamingButton = new Button(fMainStreamingGroup, SWT.PUSH);
+ fConfigureStreamingButton.setText(Messages.TraceControl_CreateSessionConfigureStreamingButtonText + " >>>"); //$NON-NLS-1$
+ fConfigureStreamingButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip);
+ fConfigureStreamingButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (fIsStreamedTrace) {
+ fIsStreamedTrace = false;
+ fConfigureStreamingButton.setText(">>> " + Messages.TraceControl_CreateSessionConfigureStreamingButtonText); //$NON-NLS-1$
+ fConfigureStreamingButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip);
+ fSessionPathText.setEnabled(true);
+ fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel);
+ disposeConfigureStreamingComposite();
+ } else {
+ fIsStreamedTrace = true;
+ fConfigureStreamingButton.setText("<<< " + Messages.TraceControl_CreateSessionNoStreamingButtonText); //$NON-NLS-1$
+ fConfigureStreamingButton.setToolTipText(Messages.TraceControl_CreateSessionNoStreamingButtonTooltip);
+ fSessionPathText.setEnabled(false);
+ fSessionPathText.setText(""); //$NON-NLS-1$
+ fSessionPathLabel.setText(""); //$NON-NLS-1$
+ createConfigureStreamingComposite();
+ }
+
+ updateEnablement();
+ getShell().pack();
+ }
+ });
+ }
+
+ private void createConfigureStreamingComposite() {
+ if (fStreamingComposite == null) {
+ fStreamingComposite = new Composite(fMainStreamingGroup, SWT.NONE);
+ GridLayout layout = new GridLayout(1, true);
+ fStreamingComposite.setLayout(layout);
+ fStreamingComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Group urlGroup = new Group(fStreamingComposite, SWT.SHADOW_NONE);
+ layout = new GridLayout(7, true);
+ urlGroup.setLayout(layout);
+ urlGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Label tracePathLabel = new Label(urlGroup, SWT.RIGHT);
+ tracePathLabel.setText(Messages.TraceControl_CreateSessionTracePathText);
+ fTracePathText = new Text(urlGroup, 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(urlGroup, 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(urlGroup, SWT.NONE);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 1;
+ label.setLayoutData(data);
+
+ label = new Label(urlGroup, SWT.NONE);
+ label.setText(Messages.TraceControl_CreateSessionProtocolLabelText);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 1;
+ label.setLayoutData(data);
+
+ label = new Label(urlGroup, SWT.NONE);
+ label.setText(Messages.TraceControl_CreateSessionAddressLabelText);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 4;
+ label.setLayoutData(data);
+
+ label = new Label(urlGroup, SWT.NONE);
+ label.setText(Messages.TraceControl_CreateSessionPortLabelText);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 1;
+ label.setLayoutData(data);
+
+ label = new Label(urlGroup, SWT.RIGHT);
+ label.setText(Messages.TraceControl_CreateSessionControlUrlLabel);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 1;
+ label.setLayoutData(data);
+
+ fControlProtocolCombo = new CCombo(urlGroup, 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(urlGroup, 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(urlGroup, 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(urlGroup, SWT.RIGHT);
+ label.setText(Messages.TraceControl_CreateSessionDataUrlLabel);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 1;
+ label.setLayoutData(data);
+
+ fDataProtocolCombo = new CCombo(urlGroup, 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);
+
+ String items[] = new String[StreamingProtocol.values().length];
+ for (int i = 0; i < items.length; i++) {
+ items[i] = StreamingProtocol.values()[i].name();
+ }
+ fControlProtocolCombo.setItems(items);
+ fDataProtocolCombo.setItems(items);
+
+ fDataHostAddressText = new Text(urlGroup, 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(urlGroup, 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);
+
+ // Get previous selection and validate
+ int currentSelection = fControlProtocolCombo.getSelectionIndex() <= COMMON_URL_LAST_INDEX ?
+ fControlProtocolCombo.getSelectionIndex() : DEFAULT_URL_INDEX;
+
+ // Update combo box items
+ fControlProtocolCombo.removeAll();
+ String[] controlItems = new String[StreamingProtocol.values().length];
+ for (int i = 0; i < controlItems.length; i++) {
+ controlItems[i] = StreamingProtocol.values()[i].name();
+ }
+ fControlProtocolCombo.setItems(controlItems);
+ fDataProtocolCombo.setItems(controlItems);
+
+ // Set selection
+ fControlProtocolCombo.select(currentSelection);
+ fDataProtocolCombo.select(currentSelection);
+ 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);
+
+ // Update combo box items
+ int currentSelection = fControlProtocolCombo.getSelectionIndex();
+ fControlProtocolCombo.removeAll();
+ String[] controlItems = new String[StreamingProtocol2.values().length];
+ for (int i = 0; i < controlItems.length; i++) {
+ controlItems[i] = StreamingProtocol2.values()[i].name();
+ }
+ fControlProtocolCombo.setItems(controlItems);
+ fDataProtocolCombo.setItems(controlItems);
+
+ // Set selection
+ fControlProtocolCombo.select(currentSelection);
+ fDataProtocolCombo.select(currentSelection);
+
+ // 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 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 (!"".equals(fSessionPath)) { //$NON-NLS-1$
+ // validate sessionPath
+ if (!fIsStreamedTrace) {
+ 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 (fIsStreamedTrace && fStreamingComposite != null) {
+ // Validate input data
+ 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);
+ }
+ }
+
+ // 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);
+
+ if (fIsStreamedTrace) {
+ sessionInfo.setNetworkUrl(fNetworkUrl);
+ sessionInfo.setControlUrl(fControlUrl);
+ sessionInfo.setDataUrl(fDataUrl);
+ sessionInfo.setStreamedTrace(true);
+ } else if (!fIsDefaultPath) {
+ sessionInfo.setSessionPath(fSessionPath);
+ }
+
+ sessionInfo.setSnapshot(fIsSnapshot);
+
+ return sessionInfo;
+ }
+
+ private final class UpdateEnablementModifyListener implements ModifyListener {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ updateEnablement();
+ }
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Dialog box for collecting channel information when enabling a channel (which will be created).
+ * </p>
+ *
+ * @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;
+ }
+ }
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Dialog box for collecting information events to be enabled.
+ * </p>
+ *
+ * @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<String> 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();
+ }
+ }
+ });
+
+ 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;
+ }
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * A composite for collecting information about kernel events to be enabled.
+ * </p>
+ *
+ * @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<String> 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<String> 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<ITraceControlComponent> 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<ITraceControlComponent> 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);
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * A composite for collecting information about UST events to be enabled.
+ * </p>
+ *
+ * @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<String> 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<String> 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<String> 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<ITraceControlComponent> children = ((ITraceControlComponent)parentElement).getChildren(TraceProviderGroup.class);
+ return children.toArray(new ITraceControlComponent[children.size()]);
+ }
+ if (parentElement instanceof TraceProviderGroup) {
+ List<ITraceControlComponent> 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);
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Dialog box for collecting information about the events to enable.
+ * </p>
+ *
+ * @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();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs;
+
+import java.util.List;
+
+/**
+ * <p>
+ * Interface for providing information about contexts to be added to channels/events.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public interface IAddContextDialog {
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Sets the available contexts to choose from.
+ * @param contexts - a list of available contexts.
+ */
+ void setAvalibleContexts(List<String> contexts);
+
+ /**
+ * @return array of contexts to be added
+ */
+ List<String> getContexts();
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+ /**
+ * @return returns the open return value
+ */
+ int open();
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs;
+
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * <p>
+ * Interface for a confirmation dialog.
+ * </p>
+ *
+ * @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);
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for create session dialog.
+ * </p>
+ *
+ * @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();
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for the enable channel dialog when domain is known.
+ * </p>
+ *
+ * @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();
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for providing information about Kernel or UST events to be enabled.
+ * </p>
+ *
+ * @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();
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs;
+
+import java.util.List;
+
+/**
+ * <p>
+ * Interface for providing information about kernel events to be enabled.
+ * </p>
+ *
+ * @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<String> 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for providing information about UST events to be enabled.
+ * </p>
+ *
+ * @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<String> 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();
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for a dialog box for collecting information about the events to enable.
+ * </p>
+ *
+ * @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();
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs;
+
+/**
+ * <p>
+ * Interface for dialog box for updating file import information.
+ * </p>
+ *
+ * @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();
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for import traces dialog.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public interface IImportDialog {
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+ /**
+ * @return a list of trace paths to import.
+ */
+ List<ImportFileInfo> 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();
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for connection information dialog.
+ * </p>
+ *
+ * @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();
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Dialog box for collecting session creation information.
+ * </p>
+ *
+ * @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();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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.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.TmfTraceFolder;
+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;
+
+/**
+ * <p>
+ * Dialog box for collecting trace import information.
+ * </p>
+ *
+ * @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$
+
+ /** Default name of kernel traces */
+ public static final String DEFAULT_KERNEL_TRACE_NAME = "kernel"; //$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<IProject> 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<ImportFileInfo> 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<ImportFileInfo> getTracePathes() {
+ List<ImportFileInfo> 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(TmfTraceFolder.TRACE_FOLDER_NAME);
+
+ if (!traceFolder.exists()) {
+ // Invalid LTTng 2.0 project
+ MessageDialog.openError(getShell(),
+ Messages.TraceControl_ImportDialogTitle,
+ Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTraceFolder.TRACE_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();
+ boolean isKernel = false;
+ if (trace.getName().equals(DEFAULT_KERNEL_TRACE_NAME)) {
+ isKernel = true;
+ }
+ StringBuffer traceName = new StringBuffer();
+ traceName.append(trace.getName());
+ traceName.insert(0, '-');
+
+ String path = fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getSnapshotPath() : fSession.getSessionPath();
+ path = getUnifiedPath(path);
+ String parentPath = getUnifiedPath(parent.getAbsolutePath());
+
+ while (!parentPath.equals(path)) {
+ traceName.insert(0, parent.getName());
+ traceName.insert(0, '-');
+ parent = parent.getParentRemoteFile();
+ parentPath = getUnifiedPath(parent.getAbsolutePath());
+ }
+ traceName.insert(0, parent.getName());
+
+ ImportFileInfo info = new ImportFileInfo(trace, traceName.toString(), overwriteAll, isKernel);
+ IFolder folder = traceFolder.getFolder(traceName.toString());
+
+ // 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(traceName.toString());
+
+ // 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<String> 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();
+ }
+ }
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs;
+
+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
+
+/**
+ * <p>
+ * Helper class for storing information about a remote file to import.
+ * </p>
+ *
+ * @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;
+
+ private boolean fIsKernel;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+ /**
+ * Standard constructor
+ *
+ * @param file
+ * A remote file reference
+ * @param traceName
+ * A trace name
+ * @param isOverwrite
+ * global overwrite flag
+ * @param isKernel
+ * <code>true</code> if it is a kernel trace else
+ * <code>false</code>
+ */
+ public ImportFileInfo(IRemoteFile file, String traceName, boolean isOverwrite, boolean isKernel) {
+ fRemoteFile = file;
+ fLocalTraceName = traceName;
+ fIsOverwrite = isOverwrite;
+ fIsKernel = isKernel;
+ }
+
+ // ------------------------------------------------------------------------
+ // 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 whether it is a kernel trace or not
+ *
+ * @return <code>true</code> if it is a kernel trace else <code>false</code>
+ */
+ public boolean isKernel() {
+ return fIsKernel;
+ }
+
+ /**
+ * Sets whether it is a kernel trace or not
+ *
+ * @param isKernel
+ * <code>true</code> for kernel trace else <code>false</code>
+ */
+ public void setKernel(boolean isKernel) {
+ fIsKernel = isKernel;
+ }
+}
+
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Dialog box for connection information.
+ * </p>
+ *
+ * @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();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs;
+
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * <p>
+ * Factory for generating dialog boxes. It allows to overwrite the dialog implementation.
+ * Useful also for testing purposes.
+ * </p>
+ *
+ * @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 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;
+ }
+
+ /**
+ * 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;
+ }
+}
+
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to add contexts to a given channel and all of its events.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class AddContextOnChannelHandler extends BaseAddContextHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void addContexts(CommandParameter param, List<String> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to add contexts to all channels and all events.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class AddContextOnDomainHandler extends BaseAddContextHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void addContexts(CommandParameter param, List<String> 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;
+ }
+
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to add contexts to a given event.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class AddContextOnEventHandler extends BaseAddContextHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void addContexts(CommandParameter param, List<String> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to assign events to a session and channel and enable/configure them.
+ * This is done on the trace provider level.
+ * </p>
+ *
+ * @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<String> eventNames = new ArrayList<>();
+ List<BaseEventComponent> events = param.getEvents();
+ // Create list of event names
+ for (Iterator<BaseEventComponent> 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<BaseEventComponent> 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<BaseEventComponent> 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<BaseEventComponent> 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<BaseEventComponent> getEvents() {
+ return fEvents;
+ }
+
+ public boolean isKernel() {
+ return fIsKernel;
+ }
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Base command handler implementation to add contexts.
+ * </p>
+ *
+ * @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<String> 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<String> 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<String> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Abstract Command handler implementation for all control view handlers.
+ * </p>
+ *
+ * @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
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Base implementation of a command handler to enable a trace channel.
+ * </p>
+ *
+ * @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<String> 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<String> 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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Base command handler implementation to enable events.
+ * </p>
+ *
+ * @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<String> 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<ITraceControlComponent> 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<String> 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<String> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to delete a target host.
+ * </p>
+ *
+ * @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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to execute command calibrate to quantify LTTng overhead.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Abstract command handler implementation to enable or disabling a trace channel.
+ * </p>
+ *
+ * @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<String> 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<TraceChannelComponent> kernelChannels = param.getKernelChannels();
+
+ if (kernelDomain != null) {
+ session = (TraceSessionComponent)kernelDomain.getParent();
+ List<String> channelNames = new ArrayList<>();
+ for (Iterator<TraceChannelComponent> 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<TraceChannelComponent> iterator = kernelChannels.iterator(); iterator.hasNext();) {
+ // Enable all selected channels which are disabled
+ TraceChannelComponent channel = iterator.next();
+ channel.setState(getNewState());
+ }
+ }
+
+ TraceDomainComponent ustDomain = param.getUstDomain();
+ List<TraceChannelComponent> ustChannels = param.getUstChannels();
+ if (ustDomain != null) {
+ if (session == null) {
+ session = (TraceSessionComponent)ustDomain.getParent();
+ }
+
+ List<String> channelNames = new ArrayList<>();
+ for (Iterator<TraceChannelComponent> 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<TraceChannelComponent> 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<TraceChannelComponent> kernelChannels = new ArrayList<>();
+ List<TraceChannelComponent> 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<TraceChannelComponent> fKernelChannels;
+ /**
+ * The list of UST channel components the command is to be executed on.
+ */
+ protected final List<TraceChannelComponent> 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<TraceChannelComponent> kernelChannels, List<TraceChannelComponent> 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<TraceChannelComponent> getKernelChannels() {
+ return fKernelChannels;
+ }
+
+ /**
+ * @return the list of UST channel components.
+ */
+ public List<TraceChannelComponent> getUstChannels() {
+ return fUstChannels;
+ }
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Base Command handler implementation to enable or disabling a trace channel.
+ * </p>
+ *
+ * @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<String> 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<String> eventNames = new ArrayList<>();
+ List<TraceEventComponent> events = param.getEvents();
+
+ for (Iterator<TraceEventComponent> 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<TraceEventComponent> 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<TraceEventComponent> 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<TraceEventComponent> fEvents = new ArrayList<>();
+
+ /**
+ * Constructor
+ * @param channel - a channel component
+ * @param events - a list of event components
+ */
+ public Parameter(TraceChannelComponent channel, List<TraceEventComponent> 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<TraceEventComponent> getEvents() {
+ return fEvents;
+ }
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Abstract command handler implementation to start or stop one or more trace sessions.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public abstract class ChangeSessionStateHandler extends BaseControlViewHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+ /**
+ * The list of session components the command is to be executed on.
+ */
+ protected List<TraceSessionComponent> 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<TraceSessionComponent> sessions = new ArrayList<>();
+ sessions.addAll(fSessions);
+
+ Job job = new Job(Messages.TraceControl_ChangeSessionStateJob) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ for (Iterator<TraceSessionComponent> 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<TraceSessionComponent> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to connect to a target host.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to create a trace session.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to delete a target host.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to destroy one or more trace sessions.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class DestroySessionHandler extends BaseControlViewHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+ /**
+ * The list of session components the command is to be executed on.
+ */
+ private final List<TraceSessionComponent> 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();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to disable one or more trace channels per session and domain.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class DisableChannelHandler extends ChangeChannelStateHandler {
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected TraceEnablement getNewState() {
+ return TraceEnablement.DISABLED;
+ }
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException {
+ domain.disableChannels(channelNames, monitor);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to disable one or more events session, domain and channel.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class DisableEventHandler extends ChangeEventStateHandler {
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected TraceEnablement getNewState() {
+ return TraceEnablement.DISABLED;
+ }
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected void changeState(TraceChannelComponent channel, List<String> eventNames, IProgressMonitor monitor) throws ExecutionException{
+ channel.disableEvent(eventNames, monitor);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to disconnect from a target host.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to enable one or more trace channels per session and domain.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class EnableChannelHandler extends ChangeChannelStateHandler {
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected TraceEnablement getNewState() {
+ return TraceEnablement.ENABLED;
+ }
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException {
+ domain.enableChannels(channelNames, null, monitor);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to enable a trace channel for known domain.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class EnableChannelOnDomainHandler extends BaseEnableChannelHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void enableChannel(CommandParameter param, List<String> 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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to enable a trace channel for unknown domain
+ * (on session level).
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void enableChannel(CommandParameter param, List<String> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to enable one or more events session, domain and channel.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class EnableEventHandler extends ChangeEventStateHandler {
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected TraceEnablement getNewState() {
+ return TraceEnablement.ENABLED;
+ }
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ protected void changeState(TraceChannelComponent channel, List<String> eventNames, IProgressMonitor monitor) throws ExecutionException{
+ channel.enableEvents(eventNames, monitor);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to enable events for a known channel.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class EnableEventOnChannelHandler extends BaseEnableEventHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void enableEvents(CommandParameter param, List<String> 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;
+ }
+}
+
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to enable events for a known domain and default channel 'channel0'
+ * (which will be created if doesn't exist).
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class EnableEventOnDomainHandler extends BaseEnableEventHandler {
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void enableEvents(CommandParameter param, List<String> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to enable events for a known session and default channel 'channel0'
+ * (which will be created if doesn't exist).
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class EnableEventOnSessionHandler extends BaseEnableEventHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ //-------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void enableEvents(CommandParameter param, List<String> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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
--- /dev/null
+/**********************************************************************
+ * 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.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.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.URIUtil;
+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.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.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.tmf.core.TmfCommonConstants;
+import org.eclipse.linuxtools.tmf.core.project.model.TmfTraceType;
+import org.eclipse.linuxtools.tmf.core.project.model.TraceTypeHelper;
+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.TmfTraceFolder;
+import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceTypeUIUtils;
+import org.eclipse.linuxtools.tmf.ui.project.wizards.importtrace.BatchImportTraceWizard;
+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.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * <p>
+ * Command handler implementation to import traces from a (remote) session to a tracing project.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class ImportHandler extends BaseControlViewHandler {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ /** Trace Type ID for LTTng Kernel traces */
+ private static final String LTTNG_KERNEL_TRACE_TYPE = "org.eclipse.linuxtools.lttng2.kernel.tracetype"; //$NON-NLS-1$
+ /** Trace Type ID for Generic CTF traces */
+ private static final String GENERIC_CTF_TRACE_TYPE = "org.eclipse.linuxtools.tmf.ui.type.ctf"; //$NON-NLS-1$
+ /** Name of default project to import traces to */
+ public static final String DEFAULT_REMOTE_PROJECT_NAME = "Remote"; //$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().isStreamedTrace()) {
+ // Streamed trace
+ TmfProjectElement projectElement = TmfProjectRegistry.getProject(project, true);
+ TmfTraceFolder traceFolder = projectElement.getTracesFolder();
+
+ BatchImportTraceWizard wizard = new BatchImportTraceWizard();
+ 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<ImportFileInfo> traces = dialog.getTracePathes();
+ IProject selectedProject = dialog.getProject();
+ for (Iterator<ImportFileInfo> iterator = traces.iterator(); iterator.hasNext();) {
+ try {
+ ImportFileInfo remoteFile = iterator.next();
+
+ downloadTrace(remoteFile, selectedProject, monitor);
+
+ // Set trace type
+ IFolder traceFolder = selectedProject.getFolder(TmfTraceFolder.TRACE_FOLDER_NAME);
+
+ if (monitor.isCanceled()) {
+ status.add(Status.CANCEL_STATUS);
+ break;
+ }
+
+ IResource file = traceFolder.findMember(remoteFile.getLocalTraceName());
+
+ TraceTypeHelper helper = null;
+
+ if (remoteFile.isKernel()) {
+ helper = TmfTraceType.getInstance().getTraceType(LTTNG_KERNEL_TRACE_TYPE);
+ } else {
+ helper = TmfTraceType.getInstance().getTraceType(GENERIC_CTF_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.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(TmfTraceFolder.TRACE_FOLDER_NAME);
+ if (!traceFolder.exists()) {
+ throw new ExecutionException(Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTraceFolder.TRACE_FOLDER_NAME + ")"); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ String traceName = trace.getLocalTraceName();
+ IFolder folder = traceFolder.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()).toString();
+ 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);
+ }
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Command handler for creation new connection for trace control.
+ * </p>
+ *
+ * @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<IHost> result = new ArrayList<>();
+ ArrayList<IHost> shellConnections = new ArrayList<>(
+ Arrays.asList(RSECorePlugin.getTheSystemRegistry()
+ .getHostsBySubSystemConfigurationCategory("shells"))); //$NON-NLS-1$
+
+ for (IHost connection : shellConnections) {
+ if (!connection.getSystemType().isLocal()) {
+ 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to refresh node configuration.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2013, 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to record a snapshot.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class SnaphshotHandler extends BaseControlViewHandler {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+ /**
+ * The list of session components the command is to be executed on.
+ */
+ protected List<TraceSessionComponent> fSessions = new ArrayList<>();
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ fLock.lock();
+ try {
+ // Make a copy for thread safety
+ final List<TraceSessionComponent> 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<TraceSessionComponent> 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<TraceSessionComponent> 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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to start one or more trace sessions.
+ * </p>
+ *
+ * @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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Command handler implementation to stop one or more trace sessions.
+ * </p>
+ *
+ * @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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Class to log control commands.
+ * </p>
+ *
+ * @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;
+ }
+}
+
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * <p>
+ * Messages file for the trace control package.
+ * </p>
+ *
+ * @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;
+
+ // 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_UnsupportedVersionError;
+ public static String TraceControl_GettingVersionError;
+
+ // 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_CreateSessionSnapshotLabel;
+ public static String TraceControl_CreateSessionSnapshotTooltip;
+
+ 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_InvalidSessionNameError;
+ public static String TraceControl_SessionAlreadyExistsError;
+ public static String TraceControl_SessionPathAlreadyExistsError;
+ public static String TraceControl_InvalidSessionPathError;
+ 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_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_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;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
--- /dev/null
+###############################################################################
+# Copyright (c) 2012, 2013 Ericsson.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Bernd Hufmann - initial API and implementation
+###############################################################################
+
+EnableChannelDialog_DefaultMessage=Default
+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_UnsupportedVersionError=Unsupported LTTng Tracer Control version
+TraceControl_GettingVersionError=Could not get version of LTTng Tracer Control
+
+# Commands
+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_CreateSessionSnapshotLabel=Snapshot Mode
+TraceControl_CreateSessionSnapshotTooltip=Configure session in snapshot 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_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_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_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_UstGlobalDomainDisplayName=UST global
+TraceControl_UstDisplayName=UST
+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
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for trace control components that can be displayed in the
+ * trace control tree viewer.
+ * </p>
+ *
+ * @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<ITraceControlComponent> 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<ITraceControlComponent> getChildren(Class<? extends ITraceControlComponent> 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);
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model;
+
+/**
+ * <p>
+ * Listener interface a class can implement to be notified about changes
+ * of components
+ * </p>
+ *
+ * @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);
+}
+
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the base trace event component.
+ * </p>
+ *
+ * @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
+ // ------------------------------------------------------------------------
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the Kernel provider component.
+ * </p>
+ *
+ * @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<IBaseEventInfo> eventInfos) {
+ for (Iterator<IBaseEventInfo> 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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the trace node component.
+ * </p>
+ *
+ * @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<ITraceControlComponent> compenents = getChildren(TraceSessionGroup.class);
+ if (compenents.size() > 0) {
+ TraceSessionGroup group = (TraceSessionGroup)compenents.get(0);
+ List<ITraceControlComponent> 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().getVersion();
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns if node supports filtering of events
+ * @return <code>true</code> if node supports filtering else <code>false</code>
+ */
+ public boolean isEventFilteringSupported() {
+ return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns if node supports networks streaming or not
+ * @return <code>true</code> if node supports filtering else <code>false</code>
+ *
+ */
+ public boolean isNetworkStreamingSupported() {
+ return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns if node supports configuring buffer type or not
+ * @return <code>true</code> if node supports buffer type configuration else <code>false</code>
+ */
+ public boolean isBufferTypeConfigSupported() {
+ return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns if node supports trace file rotation or not
+ * @return <code>true</code> if node supports trace file rotation else <code>false</code>
+ */
+ public boolean isTraceFileRotationSupported() {
+ return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns if node supports periodical flush for metadata or not
+ * @return <code>true</code> if node supports periodical flush for metadata else <code>false</code>
+ */
+ public boolean isPeriodicalMetadataFlushSupported() {
+ return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
+ }
+ /**
+ * Returns if node supports snapshots or not
+ * @return <code>true</code> if it supports snapshots else <code>false</code>
+ *
+ */
+ public boolean isSnapshotSupported() {
+ return getControlService().isVersionSupported("2.3.0"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns if node supports adding contexts on event
+ * @return <code>true</code> if it supports adding contexts on events else <code>false</code>
+ *
+ */
+ 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();
+ 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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.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;
+
+
+/**
+ * <p>
+ * Implementation of the trace channel component.
+ * </p>
+ *
+ * @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<ITraceControlComponent> 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 String getOutputType() {
+ return fChannelInfo.getOutputType();
+ }
+ /**
+ * 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<String> 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<String> 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<String> 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<String> contexts, IProgressMonitor monitor)
+ throws ExecutionException {
+ getControlService().addContexts(getSessionName(), getName(), null,
+ isKernel(), contexts, monitor);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Base implementation for trace control component.
+ * </p>
+ *
+ * @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<ITraceControlComponent> 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<ITraceControlComponent> children) {
+ for (Iterator<ITraceControlComponent> 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<ITraceControlComponent> getChildren(Class<? extends ITraceControlComponent> clazz) {
+ List<ITraceControlComponent> list = new ArrayList<>();
+
+ for (Iterator<ITraceControlComponent> 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<ITraceControlComponent> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Tree content provider implementation for trace control view.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Label provider for trace control tree viewer.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl;
+
+
+/**
+ * <p>
+ * Root element in trace control tree.
+ * </p>
+ *
+ * @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);
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the trace domain component.
+ * </p>
+ *
+ * @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<ITraceControlComponent> 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<String> 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<String> 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<String> 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<String> 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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.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;
+
+
+/**
+ * <p>
+ * Implementation of the trace channel component.
+ * </p>
+ *
+ * @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);
+ }
+
+ @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<String> contexts, IProgressMonitor monitor)
+ throws ExecutionException {
+ getControlService().addContexts(getSessionName(), getChannelName(),
+ getName(), isKernel(), contexts, monitor);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+
+/**
+ * <p>
+ * Implementation of the trace channel component.
+ * </p>
+ *
+ * @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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the trace provider group.
+ * </p>
+ *
+ * @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<IBaseEventInfo> eventInfos = getControlService().getKernelProvider(monitor);
+
+ if (!eventInfos.isEmpty()) {
+ KernelProviderComponent component = new KernelProviderComponent(Messages.TraceControl_KernelProviderDisplayName, this);
+ addChild(component);
+ component.setEventInfo(eventInfos);
+ }
+
+ List<IUstProviderInfo> allProviders = getControlService().getUstProvider(monitor);
+
+ for (Iterator<IUstProviderInfo> 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 <code>true</code> if kernel provide is available or <code>false</code>
+ */
+ public boolean hasKernelProvider() {
+ List<ITraceControlComponent> kernelList = getChildren(KernelProviderComponent.class);
+ return !kernelList.isEmpty();
+ }
+
+ /**
+ * Returns if node supports filtering of events
+ * @return <code>true</code> if node supports filtering else <code>false</code>
+ */
+ public boolean isEventFilteringSupported() {
+ return ((TargetNodeComponent)getParent()).isEventFilteringSupported();
+ }
+}
+
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.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;
+
+/**
+ * <p>
+ * Implementation of the trace session component.
+ * </p>
+ *
+ * @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);
+ }
+
+ // ------------------------------------------------------------------------
+ // 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 <code>true</code> if streamed over network else <code>false</code>
+ */
+ public boolean isStreamedTrace() {
+ return fSessionInfo.isStreamedTrace();
+ }
+
+ /**
+ * Sets whether the trace is streamed or not
+ * @param isStreamedTrace <code>true</code> if streamed over network else <code>false</code>
+ */
+ public void setIsStreamedTrace(boolean isStreamedTrace) {
+ fSessionInfo.setStreamedTrace(isStreamedTrace);
+ }
+
+ /**
+ * Returns whether the session is snapshot session or not
+ * @return <code>true</code> if it is snapshot session else <code>false</code>
+ */
+ 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<ITraceControlComponent> 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 <code>true</code> if kernel provide is available or <code>false</code>
+ */
+ public boolean hasKernelProvider() {
+ List<ITraceControlComponent> providerGroups = getTargetNode().getChildren(TraceProviderGroup.class);
+ return (!providerGroups.isEmpty() ? ((TraceProviderGroup) providerGroups.get(0)).hasKernelProvider() : false);
+ }
+
+ /**
+ * Returns if node supports filtering of events
+ * @return <code>true</code> if node supports filtering else <code>false</code>
+ */
+ public boolean isEventFilteringSupported() {
+ return ((TargetNodeComponent)getParent().getParent()).isEventFilteringSupported();
+ }
+
+ /**
+ * Returns if node supports snapshots or not
+ * @return <code>true</code> if it supports snapshots else <code>false</code>
+ *
+ */
+ 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();
+ fSessionInfo = getControlService().getSession(getName(), monitor);
+
+ 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<String> 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<String> 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<String> 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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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.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;
+
+/**
+ * <p>
+ * Implementation of the trace session group.
+ * </p>
+ *
+ * @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 <code>true</code> if node supports filtering else <code>false</code>
+ */
+ public boolean isNetworkStreamingSupported() {
+ return getTargetNode().isNetworkStreamingSupported();
+ }
+ /**
+ * Returns if node supports snapshots or not
+ * @return <code>true</code> if it supports snapshots else <code>false</code>
+ *
+ */ public boolean isSnapshotSupported() {
+ return getTargetNode().isSnapshotSupported();
+ }
+
+ // ------------------------------------------------------------------------
+ // 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.getName(), TraceSessionGroup.this);
+ addChild(session);
+ session.getConfigurationFromNode(monitor);
+ }
+ }
+
+ /**
+ * 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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Implementation of the UST provider component.
+ * </p>
+ *
+ * @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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * A class to initialize the preferences.
+ * </p>
+ *
+ * @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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Preference page implementation for configuring LTTng tracer control preferences.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Singleton class to access LTTng tracer control preferences.
+ * </p>
+ *
+ * @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();
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Property source implementation for the base event component.
+ * </p>
+ *
+ * @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<IPropertyDescriptor> 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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Base property source implementation.
+ * </p>
+ *
+ * @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) {
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Property source implementation for the kernl provider component.
+ * </p>
+ *
+ * @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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Property source implementation for the target node component.
+ * </p>
+ *
+ * @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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Property source implementation for the trace channel component.
+ * </p>
+ *
+ * @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();
+ }
+ return null;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Property source implementation for the trace domain component.
+ * </p>
+ *
+ * @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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * 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.TraceEventComponent;
+import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+
+/**
+ * <p>
+ * Property source implementation for the trace event component.
+ * </p>
+ *
+ * @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<IPropertyDescriptor> 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)) {
+ return fEvent.getLogLevel().name();
+ }
+ 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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Property source implementation for the trace probe event component.
+ * </p>
+ *
+ * @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<IPropertyDescriptor> superList = Arrays.asList(superProperties);
+ ArrayList<IPropertyDescriptor> 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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Property source implementation for the trace session component.
+ * </p>
+ *
+ * @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<IPropertyDescriptor> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Property source implementation for the UST provider component.
+ * </p>
+ *
+ * @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;
+ }
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote;
+
+import java.util.Arrays;
+
+/**
+ * <p>
+ * Class containing command result of remote command execution.
+ * </p>
+ *
+ * @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];
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ *
+ * @param result
+ * The result of the command
+ * @param output
+ * The output, as an array of strings
+ */
+ public CommandResult(int result, String[] output) {
+ fResult = result;
+ if (output != null) {
+ fOutput = Arrays.copyOf(output, output.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);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/**********************************************************************
+ * 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;
+
+/**
+ * <p>
+ * Implementation of remote command execution using RSE's shell service.
+ * </p>
+ *
+ * @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 {
+ fHostShell = shellService.launchShell("", new String[0], 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<CommandResult> future = new FutureTask<>(new Callable<CommandResult>() {
+ @Override
+ public CommandResult call() throws IOException, CancellationException {
+ final ArrayList<String> result = 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) {
+ result.add(nextLine);
+ }
+ }
+ }
+ }
+ return new CommandResult(fReturnValue, result.toArray(new String[result.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 <start tag> <alias> <end tag> $?
+ *
+ * @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:
+ * <start tag> <alias> <end tag> $?
+ *
+ * @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 <code>true</code> to retrieve command result (previous command) <code>false</code>
+ * @return <code>true</code> if output line is a command alias echo result else <code>false</code>
+ */
+ 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 <code>true</code> if it's an echoed command line else
+ * <code>false</code>
+ */
+ @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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bernd Hufmann - Initial API and implementation
+ *********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote;
+
+/**
+ * <p>
+ * Interface for providing command execution result.
+ * </p>
+ *
+ * @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);
+}
\ No newline at end of file
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Interface for a command shell implementation
+ * </p>
+ *
+ * @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;
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * Remote System Proxy interface.
+ * </p>
+ *
+ * @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 <code>null</code> if not found.
+ */
+ IShellService getShellService();
+
+ /**
+ * Find the first terminal service.
+ *
+ * @return shell service object, or <code>null</code> if not found.
+ */
+ ITerminalService getTerminalService();
+
+ /**
+ * Find the first IShellServiceSubSystem service.
+ *
+ * @return shell service subsystem, or <code>null</code> if not found.
+ */
+ ISubSystem getShellServiceSubSystem();
+
+ /**
+ * Find the first ITerminalServiceSubSystem service.
+ *
+ * @return shell service subsystem, or <code>null</code> if not found.
+ */
+ ISubSystem getTerminalServiceSubSystem();
+
+ /**
+ * Finds the File Service Subsystem.
+ *
+ * @return file service subsystem, or <code>null</code> 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);
+
+}
\ No newline at end of file
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+/**
+ * <p>
+ * RemoteSystemProxy implementation.
+ * </p>
+ *
+ * @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);
+ }
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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;
+
+
+/**
+* <p>
+* Interface for LTTng trace control command service.
+* </p>
+*
+* @author Bernd Hufmann
+*/
+public interface ILttngControlService {
+
+ /**
+ * @return the version string.
+ */
+ String getVersion();
+
+ /**
+ * Checks if given version is supported by this ILTTngControlService implementation.
+ *
+ * @param version The version to check
+ * @return <code>true</code> if version is supported else <code>false</code>
+ */
+ 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<IBaseEventInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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;
+}
--- /dev/null
+/**********************************************************************
+ * 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
+ **********************************************************************/
+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 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;
+
+/**
+ * <p>
+ * Service for sending LTTng trace control commands to remote host.
+ * </p>
+ *
+ * @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 getVersion() {
+ if (fVersion == null) {
+ return "Unknown"; //$NON-NLS-1$
+ }
+ return fVersion.toString();
+ }
+
+ /**
+ * 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);
+ }
+
+ @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 <session_name> for more details
+
+ ArrayList<String> 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()]);
+ }
+
+ @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<IChannelInfo> 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<IChannelInfo> 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<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException {
+ StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_KERNEL);
+ ICommandResult result = executeCommand(command.toString(), monitor, false);
+
+ List<IBaseEventInfo> events = new ArrayList<>();
+
+ if (result.getOutput() != null) {
+ // Ignore the following 2 cases:
+ // Spawning a session daemon
+ // Error: Unable to list kernel events
+ // or:
+ // Error: Unable to list kernel events
+ //
+ int index = 0;
+ while (index < result.getOutput().length) {
+ String line = result.getOutput()[index];
+ Matcher matcher = LTTngControlServiceConstants.LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN.matcher(line);
+ if (matcher.matches()) {
+ return events;
+ }
+ index++;
+ }
+ }
+
+ 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<IUstProviderInfo> getUstProvider() throws ExecutionException {
+ return getUstProvider(new NullProgressMonitor());
+ }
+
+ @Override
+ public List<IUstProviderInfo> 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<IUstProviderInfo> 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.getOutput() != 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
+ //
+ int index = 0;
+ while (index < result.getOutput().length) {
+ String line = result.getOutput()[index];
+ Matcher matcher = LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN.matcher(line);
+ if (matcher.matches()) {
+ return allProviders;
+ }
+ index++;
+ }
+ }
+
+ 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<IBaseEventInfo> 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);
+ }
+
+ 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);
+ }
+
+ 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;
+
+ }
+
+ private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException {
+
+ String newName = formatParameter(sessionInfo.getName());
+ StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION, newName);
+
+ if (sessionInfo.isSnapshotSession()) {
+ command.append(LTTngControlServiceConstants.OPTION_SNAPSHOT);
+ }
+
+ 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());
+ }
+
+ 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;
+ }
+
+ @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[] output = result.getOutput();
+
+ boolean isError = isError(result);
+ if (isError && (output != null)) {
+ int index = 0;
+ while (index < output.length) {
+ String line = output[index];
+ Matcher matcher = LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN.matcher(line);
+ if (matcher.matches()) {
+ // Don't treat this as an error
+ isError = false;
+ }
+ index++;
+ }
+ }
+
+ if (isError) {
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ //Session <sessionName> 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 <sessionName> 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 <sessionName> stopped
+
+ }
+
+ @Override
+ public void enableChannels(String sessionName, List<String> 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<String> 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<String> channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
+
+ // no channels to enable
+ if (channelNames.isEmpty()) {
+ return;
+ }
+
+ StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_CHANNEL);
+
+ for (Iterator<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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);
+ }
+
+ // ------------------------------------------------------------------------
+ // 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 || (result.getOutput().length < 1)) {
+ return true;
+ }
+
+ // Look for error pattern
+ int index = 0;
+ while (index < result.getOutput().length) {
+ String line = result.getOutput()[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) {
+ return ""; //$NON-NLS-1$
+ }
+ String[] output = result.getOutput();
+ StringBuffer ret = new StringBuffer();
+ 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<IChannelInfo> 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<IEventInfo> 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<IEventInfo> 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.setLogLevel(matcher.group(2).trim());
+ eventInfo.setEventType(matcher.group(3).trim());
+ eventInfo.setState(matcher.group(4));
+ String filter = matcher.group(5);
+ if (filter != null) {
+ filter = filter.substring(1, filter.length() - 1); // remove '[' and ']'
+ 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) {
+ filter = filter.substring(1, filter.length() - 1); // remove '[' and ']'
+ 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: <attribute Name>: <attribute value>
+ *
+ * @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<IBaseEventInfo> 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<IFieldInfo> 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<IFieldInfo> 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;
+ }
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 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
+ **********************************************************************/
+package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service;
+
+import java.util.regex.Pattern;
+
+/**
+ * <p>
+ * Constants for LTTng Control Service.
+ * </p>
+ *
+ * @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;
+
+ // ------------------------------------------------------------------------
+ // Command constants
+ // ------------------------------------------------------------------------
+ /**
+ * The lttng tools command.
+ */
+ static final String CONTROL_COMMAND = "lttng"; //$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 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 <session>)
+ */
+ 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 <session>)
+ */
+ 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 <session>)
+ */
+ 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 <session>)
+ * 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|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 <session>)
+ */
+ static final Pattern DOMAIN_KERNEL_PATTERN = Pattern.compile("=== Domain: Kernel ==="); //$NON-NLS-1$
+ /**
+ * Pattern to match for ust domain information (lttng list <session>)
+ */
+ 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 <session>)
+ */
+ static final Pattern BUFFER_TYPE_PATTERN = Pattern.compile("\\s*Buffer\\s+type\\:.*"); //$NON-NLS-1$
+ /**
+ * Pattern to match for channels section (lttng list <session>)
+ */
+ static final Pattern CHANNELS_SECTION_PATTERN = Pattern.compile("\\s*Channels\\:"); //$NON-NLS-1$
+ /**
+ * Pattern to match for channel information (lttng list <session>)
+ */
+ static final Pattern CHANNEL_PATTERN = Pattern.compile("\\s*-\\s+(.*)\\:\\s+\\[(enabled|disabled)\\]"); //$NON-NLS-1$
+ /**
+ * Pattern to match for events section information (lttng list <session>)
+ */
+ static final Pattern EVENT_SECTION_PATTERN = Pattern.compile("\\s*Events\\:"); //$NON-NLS-1$
+ /**
+ * Pattern to match for event information (lttng list <session>)
+ */
+ static final Pattern EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$
+ /**
+ * Pattern to match a wildcarded event information (lttng list <session>)
+ */
+ 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 <session>)
+ */
+ static final Pattern PROBE_ADDRESS_PATTERN = Pattern.compile("\\s+(addr)\\:\\s+(0x[0-9a-fA-F]{1,8})"); //$NON-NLS-1$
+ /**
+ * Pattern to match a probe OFFSET information (lttng list <session>)
+ */
+ static final Pattern PROBE_OFFSET_PATTERN = Pattern.compile("\\s+(offset)\\:\\s+(0x[0-9a-fA-F]{1,8})"); //$NON-NLS-1$
+ /**
+ * Pattern to match a probe SYMBOL information (lttng list <session>)
+ */
+ static final Pattern PROBE_SYMBOL_PATTERN = Pattern.compile("\\s+(symbol)\\:\\s+(.+)"); //$NON-NLS-1$
+ /**
+ * Pattern to match for channel (overwite mode) information (lttng list <session>)
+ */
+ 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 for channel (sub-buffer size) information (lttng list <session>)
+ */
+ 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 <session>)
+ */
+ 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 <session>)
+ */
+ 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 <session>)
+ */
+ 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 <session>)
+ */
+ 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 <session name>)
+ */
+ 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 <session name>)
+ */
+ 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+(.*)"); //$NON-NLS-1$
+ /**
+ * Pattern to match snapshot path for network tracing (lttng list <session>)
+ * 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|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
+
+}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 2013. 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.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.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;
+
+/**
+ * <p>
+ * Factory to create LTTngControlService instances depending on the version of the LTTng Trace Control
+ * installed on the remote host.
+ * </p>
+ *
+ * @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
+ String command = LTTngControlServiceConstants.CONTROL_COMMAND + LTTngControlServiceConstants.COMMAND_VERSION;
+
+ if (ControlPreferences.getInstance().isLoggingEnabled()) {
+ ControlCommandLogger.log(command);
+ }
+ ICommandResult result = null;
+
+ try {
+ result = shell.executeCommand(command, new NullProgressMonitor());
+ } catch (ExecutionException e) {
+ throw new ExecutionException(Messages.TraceControl_GettingVersionError + ": " + e); //$NON-NLS-1$
+ }
+
+ if (ControlPreferences.getInstance().isLoggingEnabled()) {
+ ControlCommandLogger.log(LTTngControlService.formatOutput(result));
+ }
+
+ if ((result != null) && (result.getResult() == 0) && (result.getOutput().length >= 1)) {
+ 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);
+ }
+}
--- /dev/null
+/**********************************************************************
+ * 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.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 {
+
+ /**
+ * Constructor
+ *
+ * @param version
+ * The version string
+ */
+ public LttngVersion(String version) {
+ super(version);
+ }
+
+ /**
+ * 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());
+ }
+}
--- /dev/null
+bin
+@dot
+javaCompiler...args
+build.xml
+target
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.lttng2.control</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
--- /dev/null
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+###############################################################################
+# 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
--- /dev/null
+###############################################################################
+# Copyright (c) 2012, 2013 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# 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
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.lttng2.control"
+ label="%featureName"
+ version="3.0.0.qualifier"
+ provider-name="%featureProvider"
+ license-feature="org.eclipse.license"
+ license-feature-version="0.0.0">
+
+ <description url="http://www.example.com/description">
+ %description
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="Linux Tools Update Site" url="http://download.eclipse.org/linuxtools/update"/>
+ </url>
+
+ <includes
+ id="org.eclipse.linuxtools.tmf.ctf"
+ version="0.0.0"/>
+
+ <requires>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.linuxtools.lttng2.control.core" version="3.0.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.linuxtools.tmf.core" version="3.0.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.linuxtools.tmf.ui" version="3.0.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.help"/>
+ <import feature="org.eclipse.rse" version="3.1.100" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.linuxtools.lttng2.control.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.lttng2.control.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.lttng.help"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
--- /dev/null
+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.id = org.eclipse.linuxtools.lttng2.feature.group
+update.range = 0.0.0
+update.severity = 0
+update.description = Transition to the new feature name lttng2.control
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>linuxtools-lttng-parent</artifactId>
+ <groupId>org.eclipse.linuxtools.lttng</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.linuxtools.lttng2.control</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+
+ <name>Linux Tools LTTng (Linux Tracing Toolkit) Feature</name>
+
+ <groupId>org.eclipse.linuxtools.lttng2</groupId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-source-feature-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>source-feature</id>
+ <phase>package</phase>
+ <goals>
+ <goal>source-feature</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <plugin id="org.eclipse.linuxtools.lttng.help"/>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <executions>
+ <execution>
+ <id>attached-p2-metadata</id>
+ <phase>package</phase>
+ <goals>
+ <goal>p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
--- /dev/null
+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.id = org.eclipse.linuxtools.lttng2.source.feature.group
+update.range = 0.0.0
+update.severity = 0
+update.description = Transition to the new feature name lttng2.control
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+++ /dev/null
-bin
-@dot
-javaCompiler...args
-build.xml
-target
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.linuxtools.lttng2.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
+++ /dev/null
-eclipse.preferences.version=1
-line.separator=\n
+++ /dev/null
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-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=ignore
-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=error
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
-org.eclipse.jdt.core.compiler.source=1.7
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=false
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=250
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+++ /dev/null
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_tmf-style
-formatter_settings_version=12
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=false
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=false
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+++ /dev/null
-ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
-ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
-API_USE_SCAN_FIELD_SEVERITY=Error
-API_USE_SCAN_METHOD_SEVERITY=Error
-API_USE_SCAN_TYPE_SEVERITY=Error
-CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
-CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
-CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
-CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
-CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
-ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
-ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
-ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
-FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
-FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
-FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
-FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
-ILLEGAL_EXTEND=Warning
-ILLEGAL_IMPLEMENT=Warning
-ILLEGAL_INSTANTIATE=Warning
-ILLEGAL_OVERRIDE=Warning
-ILLEGAL_REFERENCE=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-INVALID_JAVADOC_TAG=Warning
-INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
-LEAK_EXTEND=Warning
-LEAK_FIELD_DECL=Warning
-LEAK_IMPLEMENT=Warning
-LEAK_METHOD_PARAM=Warning
-LEAK_METHOD_RETURN_TYPE=Warning
-METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
-METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-MISSING_EE_DESCRIPTIONS=Ignore
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
-UNUSED_PROBLEM_FILTERS=Warning
-automatically_removed_unused_problem_filters=false
-eclipse.preferences.version=1
-incompatible_api_component_version=Error
-incompatible_api_component_version_include_major_without_breaking_change=Disabled
-incompatible_api_component_version_include_minor_without_api_change=Disabled
-invalid_since_tag_version=Error
-malformed_since_tag=Error
-missing_since_tag=Error
-report_api_breakage_when_major_version_incremented=Disabled
-report_resolution_errors_api_component=Warning
+++ /dev/null
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=2
-compilers.p.missing-version-export-package=2
-compilers.p.missing-version-import-package=2
-compilers.p.missing-version-require-bundle=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=2
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+++ /dev/null
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 3.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.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.core;bundle-version="3.0.0",
- org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0"
-Export-Package: org.eclipse.linuxtools.lttng2.core.tests;x-friends:="org.eclipse.linuxtools.lttng.alltests",
- org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;x-internal:=true
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-###############################################################################
-# Copyright (c) 2013 Ericsson
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms 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
+++ /dev/null
-###############################################################################
-# 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.core.tests
-Bundle-Vendor = Eclipse Linux Tools
-Bundle-Name = Linux Tools LTTng Core Tests Plug-in
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (C) 2011, Red Hat, Inc.
-
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
--->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>linuxtools-lttng-parent</artifactId>
- <groupId>org.eclipse.linuxtools.lttng</groupId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>org.eclipse.linuxtools.lttng2.core.tests</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <packaging>eclipse-test-plugin</packaging>
-
- <name>Linux Tools LTTng Core Tests Plug-in</name>
-
- <build>
- <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 -->
- <resources>
- <resource>
- <directory>src</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <id>prepare</id>
- <phase>validate</phase>
- <configuration>
- <target>
- <echo message="prepare phase" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <testSuite>org.eclipse.linuxtools.lttng2.core.tests</testSuite>
- <testClass>org.eclipse.linuxtools.lttng2.core.tests.AllTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <groupId>org.eclipse.linuxtools.lttng2</groupId>
-</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.linuxtools.lttng2.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.core.Activator#Activator()}.
- */
- @Test
- public void testActivator() {
- assertTrue(true);
- }
-
- /**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.core.Activator#getDefault()}.
- */
- @Test
- public void testGetDefault() {
- assertTrue(true);
- }
-
- /**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.core.Activator#start(org.osgi.framework.BundleContext)}.
- */
- @Test
- public void testStartBundleContext() {
- assertTrue(true);
- }
-
- /**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.core.Activator#stop(org.osgi.framework.BundleContext)}.
- */
- @Test
- public void testStopBundleContext() {
- assertTrue(true);
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.linuxtools.lttng2.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Run all the tests in the lttng2.core plugin.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ActivatorTest.class,
- org.eclipse.linuxtools.lttng2.core.tests.control.model.impl.AllTests.class,
- org.eclipse.linuxtools.lttng2.core.tests.session.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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.core.tests.control.model.impl;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Runner for the LTTng2.core unit tests
- */
-@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 {
-
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.tests.control.model.impl;
-
-import static org.junit.Assert.*;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.FieldInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>BaseEventInfoTest</code> contains test for the class
- * <code>{@link BaseEventInfo}</code>.
- */
-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("TRACE_DEBUG", result.getInName());
- assertEquals("TRACE_DEBUG", result.name());
- assertEquals(14, 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<IFieldInfo> 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
+++ /dev/null
-/**********************************************************************
- * 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.core.tests.control.model.impl;
-
-import static org.junit.Assert.*;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>ChannelInfoTest</code> contains tests for the class
- * <code>{@link ChannelInfo}</code>.
- */
-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("", 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();
- 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();
- 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<IEventInfo>) 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<IEventInfo> 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)])]", 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
+++ /dev/null
-/**********************************************************************
- * 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.core.tests.control.model.impl;
-
-import static org.junit.Assert.*;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.DomainInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>ChannelInfoTest</code> contains tests for the class
- * <code>{@link DomainInfo}</code>.
- */
-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<IChannelInfo> 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)])],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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.core.tests.control.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.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>EventInfoTest</code> contains test for the class
- * <code>{@link EventInfo}</code>.
- */
-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 BaseEventInfo() 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());
-
- }
-
- /**
- * 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());
- }
-
- /**
- * 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("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());
-
- // 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());
- }
-
- /**
- * 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)]", 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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
-
-import static org.junit.Assert.*;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.FieldInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>FieldInfoTest</code> contains test for the class
- * <code>{@link FieldInfo}</code>.
- */
-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
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IProbeEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.DomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.FieldInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ProbeEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.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.setState(TraceEnablement.ENABLED);
-
- fEventInfo2 = new EventInfo("event2");
- 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
-
-import static org.junit.Assert.*;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IProbeEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ProbeEventInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>ProbEventInfoTest</code> contains test for the class
- * <code>{@link ProbeEventInfo}</code>.
- */
-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)],fAddress=0xc1231234)]", fEventInfo1.toString());
- assertEquals("[ProbeEventInfo([EventInfo([BaseEventInfo([TraceInfo(Name=probeEvent2)],type=FUNCTION,level=TRACE_DEBUG)],State=DISABLED)],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
+++ /dev/null
-/**********************************************************************
- * 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.core.tests.control.model.impl;
-
-import static org.junit.Assert.*;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>ChannelInfoTest</code> contains tests for the class
- * <code>{@link SessionInfo}</code>.
- */
-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<IDomainInfo> 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)])],"
- + "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)])],"
- + "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
+++ /dev/null
-/**********************************************************************
- * 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.core.tests.control.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.core.control.model.ISnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.TraceInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>SnapshotInfoTest</code> contains test for the class
- * <code>{@link SnapshotInfo}</code>.
- */
-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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
-
-import static org.junit.Assert.*;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ITraceInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.TraceInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>TraceInfoTest</code> contains test for the class
- * <code>{@link TraceInfo}</code>.
- */
-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
+++ /dev/null
-/**********************************************************************
- * 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.core.tests.control.model.impl;
-
-import static org.junit.Assert.*;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.UstProviderInfo;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * The class <code>ChannelInfoTest</code> contains tests for the class
- * <code>{@link UstProviderInfo}</code>.
- */
-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<IBaseEventInfo>) method test.
- */
- @Test
- public void testSetEvents_1() {
- UstProviderInfo fixture = new UstProviderInfo("test");
- fixture.setPid(2468);
- List<IBaseEventInfo> 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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Guilliano Molaire - Initial API and implementation
- *********************************************************************/
-package org.eclipse.linuxtools.lttng2.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 {
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Guilliano Molaire - Initial API and implementation
- *********************************************************************/
-package org.eclipse.linuxtools.lttng2.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.core.Activator;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
-import org.eclipse.linuxtools.lttng2.core.session.SessionConfigGenerator;
-import org.eclipse.linuxtools.lttng2.core.session.SessionConfigStrings;
-import org.eclipse.linuxtools.lttng2.core.tests.control.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.core.tests/test_session_config_files/test_valid.lttng");
- private static final File INVALID_SESSION_FILE = new File("../org.eclipse.linuxtools.lttng2.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<ISessionInfo> 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());
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
- <!--***************************************************************************\r
- * Copyright(C) 2014 École Polytechnique de Montréal\r
- *\r
- * All rights reserved. This program and the accompanying materials are\r
- * made available under the terms of the Eclipse Public License v1.0 which\r
- * accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * Guilliano Molaire - Initial API and implementation\r
- ***************************************************************************\r
- This is an invalid session configuration file. The domain type\r
- is missing.-->\r
-<sessions>\r
- <session>\r
- <name>auto-20140323-130527</name>\r
- <started>false</started>\r
- <domains>\r
- <domain>\r
- <buffer_type>GLOBAL</buffer_type>\r
- <channels>\r
- <channel>\r
- <name>channel0</name>\r
- <overwrite_mode>DISCARD</overwrite_mode>\r
- <subbuffer_count>4</subbuffer_count>\r
- <switch_timer_interval>0</switch_timer_interval>\r
- <tracefile_size>0</tracefile_size>\r
- <tracefile_count>0</tracefile_count>\r
- <live_timer_interval>0</live_timer_interval>\r
- <enabled>false</enabled>\r
- <subbuffer_size>262144</subbuffer_size>\r
- <read_timer_interval>200000</read_timer_interval>\r
- <output_type>SPLICE</output_type>\r
- <events>\r
- <event>\r
- <name>exit_syscall</name>\r
- <enabled>true</enabled>\r
- <type>TRACEPOINT</type>\r
- </event>\r
- </events>\r
- </channel>\r
- </channels>\r
- </domain>\r
- </domains>\r
- <output>\r
- <consumer_output>\r
- <enabled>true</enabled>\r
- <destination>\r
- <path>/home/user/folder</path>\r
- </destination>\r
- </consumer_output>\r
- </output>\r
- </session>\r
-</sessions>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
- <!--***************************************************************************\r
- * Copyright(C) 2014 École Polytechnique de Montréal\r
- *\r
- * All rights reserved. This program and the accompanying materials are\r
- * made available under the terms of the Eclipse Public License v1.0 which\r
- * accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * Guilliano Molaire - Initial API and implementation\r
- ***************************************************************************\r
- This is a valid session configuration file. All mandatory\r
- elements are provided.-->\r
-<sessions>\r
- <session>\r
- <name>auto-20140323-130527</name>\r
- <started>false</started>\r
- <domains>\r
- <domain>\r
- <type>KERNEL</type>\r
- <buffer_type>GLOBAL</buffer_type>\r
- <channels>\r
- <channel>\r
- <name>channel0</name>\r
- <overwrite_mode>DISCARD</overwrite_mode>\r
- <subbuffer_count>4</subbuffer_count>\r
- <switch_timer_interval>0</switch_timer_interval>\r
- <tracefile_size>0</tracefile_size>\r
- <tracefile_count>0</tracefile_count>\r
- <live_timer_interval>0</live_timer_interval>\r
- <enabled>false</enabled>\r
- <subbuffer_size>262144</subbuffer_size>\r
- <read_timer_interval>200000</read_timer_interval>\r
- <output_type>SPLICE</output_type>\r
- <events>\r
- <event>\r
- <name>exit_syscall</name>\r
- <enabled>true</enabled>\r
- <type>TRACEPOINT</type>\r
- </event>\r
- </events>\r
- </channel>\r
- </channels>\r
- </domain>\r
- </domains>\r
- <output>\r
- <consumer_output>\r
- <enabled>true</enabled>\r
- <destination>\r
- <path>/home/user/folder</path>\r
- </destination>\r
- </consumer_output>\r
- </output>\r
- </session>\r
-</sessions>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+++ /dev/null
-bin
-@dot
-javaCompiler...args
-build.xml
-target
+++ /dev/null
-org.eclipse.linuxtools.lttng.core/debug=false
-org.eclipse.linuxtools.lttng.core/info=false
-org.eclipse.linuxtools.lttng.core/warn=false
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.linuxtools.lttng2.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
+++ /dev/null
-eclipse.preferences.version=1
-line.separator=\n
+++ /dev/null
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
-org.eclipse.jdt.core.compiler.problem.deadCode=error
-org.eclipse.jdt.core.compiler.problem.deprecation=error
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
-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=ignore
-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=error
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
-org.eclipse.jdt.core.compiler.source=1.7
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=false
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=250
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+++ /dev/null
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_tmf-style
-formatter_settings_version=12
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=false
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=false
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+++ /dev/null
-ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
-ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
-API_USE_SCAN_FIELD_SEVERITY=Error
-API_USE_SCAN_METHOD_SEVERITY=Error
-API_USE_SCAN_TYPE_SEVERITY=Error
-CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
-CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
-CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
-CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
-CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
-ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
-ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
-ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
-FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
-FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
-FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
-FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
-ILLEGAL_EXTEND=Warning
-ILLEGAL_IMPLEMENT=Warning
-ILLEGAL_INSTANTIATE=Warning
-ILLEGAL_OVERRIDE=Warning
-ILLEGAL_REFERENCE=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-INVALID_JAVADOC_TAG=Warning
-INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
-LEAK_EXTEND=Warning
-LEAK_FIELD_DECL=Warning
-LEAK_IMPLEMENT=Warning
-LEAK_METHOD_PARAM=Warning
-LEAK_METHOD_RETURN_TYPE=Warning
-METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
-METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-MISSING_EE_DESCRIPTIONS=Ignore
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
-UNUSED_PROBLEM_FILTERS=Warning
-automatically_removed_unused_problem_filters=false
-eclipse.preferences.version=1
-incompatible_api_component_version=Error
-incompatible_api_component_version_include_major_without_breaking_change=Disabled
-incompatible_api_component_version_include_minor_without_api_change=Disabled
-invalid_since_tag_version=Error
-malformed_since_tag=Error
-missing_since_tag=Error
-report_api_breakage_when_major_version_incremented=Disabled
-report_resolution_errors_api_component=Warning
+++ /dev/null
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=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=2
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+++ /dev/null
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 3.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.core;singleton:=true
-Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.core.Activator
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0"
-Export-Package: org.eclipse.linuxtools.internal.lttng2.core;x-friends:="org.eclipse.linuxtools.lttng2.core.tests",
- org.eclipse.linuxtools.internal.lttng2.core.control.model;x-friends:="org.eclipse.linuxtools.lttng2.ui,org.eclipse.linuxtools.lttng2.ui.tests,org.eclipse.linuxtools.lttng2.core.tests",
- org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;x-friends:="org.eclipse.linuxtools.lttng2.ui,org.eclipse.linuxtools.lttng2.ui.tests,org.eclipse.linuxtools.lttng2.core.tests",
- org.eclipse.linuxtools.lttng2.core.session
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-###############################################################################
-# Copyright (c) 2013 Ericsson
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms 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
+++ /dev/null
-###############################################################################
-# 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.core
-Bundle-Vendor = Eclipse Linux Tools
-Bundle-Name = Linux Tools LTTng Core Plug-in
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (C) 2011, Red Hat, Inc.
-
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
--->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>linuxtools-lttng-parent</artifactId>
- <groupId>org.eclipse.linuxtools.lttng</groupId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>org.eclipse.linuxtools.lttng2.core</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-
- <name>Linux Tools LTTng Core Plug-in</name>
-
- <build>
- <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 -->
- <resources>
- <resource>
- <directory>src</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-source-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <groupId>org.eclipse.linuxtools.lttng2</groupId>
-</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.internal.lttng2.core;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-/**
- * <b><u>Activator</u></b>
- * <p>
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends Plugin {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.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;
- }
-
- @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));
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model;
-
-import java.util.List;
-
-/**
- * <p>
- * Interface for retrieval of basic trace event information.
- * </p>
- *
- * @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<IFieldInfo> fields);
-
- /**
- * Returns filter expression.
- * @return filter expression
- */
- String getFilterExpression();
-
- /**
- * Sets the filter expression.
- * @param filter The filter expression to set
- */
- void setFilterExpression(String filter);
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Simon Delisle - Updated for support of LTTng Tools 2.2
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model;
-
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-
-/**
- * <p>
- * Interface for retrieval of trace channel information.
- * </p>
- *
- * @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.
- */
- String getOutputType();
- /**
- * Sets the output type to the given value.
- * @param type - type to set.
- */
- void setOutputType(String 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<IEventInfo> 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();
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model;
-
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-
-/**
- * <p>
- * Interface for retrieval of trace domain information.
- * </p>
- *
- * @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<IChannelInfo> 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);
-
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model;
-
-/**
- * <p>
- * Interface for retrieval of trace event information.
- * </p>
- *
- * @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);
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model;
-
-/**
- * <p>
- * Interface for retrieval of event field information.
- * </p>
- *
- * @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);
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model;
-
-/**
- * <p>
- * Interface for retrieval of probe event information.
- * </p>
- *
- * @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);
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model;
-
-import java.util.List;
-
-/**
- * <p>
- * Interface for retrieval of trace session information.
- * </p>
- *
- * @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<IDomainInfo> domains);
-
- /**
- * Adds a single domain information.
- * @param domainInfo domain information to add.
- */
- void addDomain(IDomainInfo domainInfo);
-
- /**
- * Returns if session is streamed over network
- * @return <code>true</code> if streamed over network else <code>false</code>
- */
- boolean isStreamedTrace();
-
- /**
- * Sets whether the trace is streamed or not
- * @param isStreamedTrace <code>true</code> if streamed over network else <code>false</code>
- */
- void setStreamedTrace(boolean isStreamedTrace);
-
- /**
- * Returns whether the session is snapshot session or not
- * @return <code>true</code> if it is snapshot session else <code>false</code>
- */
- 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 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);
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model;
-
-
-/**
- * <p>
- * Interface for retrieval of snapshot information of a session.
- * </p>
- *
- * @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 - <code>true</code> if streamed else <code>false</code>
- */
- void setStreamedSnapshot(boolean isStreamed);
-
- /**
- * Gets whether snapshot is streamed over the network or stored locally
- * at the tracers host.
- *
- * @return <code>true</code> if streamed else <code>false</code>
- */
- boolean isStreamedSnapshot();
-
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model;
-
-/**
- * <p>
- * Interface for retrieve trace comon information.
- * </p>
- *
- * @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);
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model;
-
-import java.util.List;
-
-/**
- * <p>
- * Interface for retrieval of UST provider information.
- * </p>
- *
- * @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<IBaseEventInfo> events);
-
- /**
- * Adds a single event information.
- * @param event - event information to add.
- */
- void addEvent(IBaseEventInfo event);
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model;
-
-/**
- * <p>
- * Type of log Level enumeration.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public enum LogLevelType {
-
- // ------------------------------------------------------------------------
- // Enum definition
- // ------------------------------------------------------------------------
- /** range of log levels [0,logLevel] */
- LOGLEVEL,
-
- /** single log level */
- LOGLEVEL_ONLY,
-
- /** no log level */
- LOGLEVEL_NONE;
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model;
-
-/**
- * <p>
- * Enumeration for the node connection state.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public enum TargetNodeState {
- /** State when disconnected */
- DISCONNECTED,
- /** State while disconnecting */
- DISCONNECTING,
- /** State when connected */
- CONNECTED,
- /** State while connecting */
- CONNECTING;
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model;
-
-/**
- * <p>
- * Enumeration for enabled/disabled states.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public enum TraceEnablement {
-
- // ------------------------------------------------------------------------
- // Enum definition
- // ------------------------------------------------------------------------
- /** Tracing is disabled */
- DISABLED("disabled"), //$NON-NLS-1$
- /** Tracing is enabled */
- ENABLED("enabled"); //$NON-NLS-1$
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
- /**
- * Name of enum
- */
- private final String fInName;
-
- // ------------------------------------------------------------------------
- // Constuctors
- // ------------------------------------------------------------------------
-
- /**
- * Private constructor
- * @param name the name of state
- */
- private TraceEnablement(String name) {
- fInName = name;
- }
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
- /**
- * @return state name
- */
- public String getInName() {
- return fInName;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model;
-
-/**
- * <p>
- * Trace event type enumeration.
- * </p>
- *
- * @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;
- }
-}
-
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model;
-
-/**
- * <p>
- * Log Level enumeration.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model;
-
-/**
- * <p>
- * Session state enumeration.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public enum TraceSessionState {
-
- // ------------------------------------------------------------------------
- // Enum definition
- // ------------------------------------------------------------------------
- /** Trace session inactive */
- INACTIVE("inactive"), //$NON-NLS-1$
- /** Trace session active */
- ACTIVE("active"); //$NON-NLS-1$
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
- /**
- * Name of enum.
- */
- private final String fInName;
-
- // ------------------------------------------------------------------------
- // Constuctors
- // ------------------------------------------------------------------------
-
- /**
- * Private constructor
- * @param name the name of state
- */
- private TraceSessionState(String name) {
- fInName = name;
- }
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
- /**
- * @return state name
- */
- public String getInName() {
- return fInName;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model.impl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-
-/**
-* <p>
-* Implementation of the basic trace event interface (IEventInfo) to store event
-* related data.
-* </p>
-*
-* @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<IFieldInfo> 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;
- for (Iterator<IFieldInfo> 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().equals(typeName)) {
- fEventType = TraceEventType.TRACEPOINT;
- } else if(TraceEventType.SYSCALL.getInName().equals(typeName)) {
- fEventType = TraceEventType.SYSCALL;
- } else if (TraceEventType.PROBE.getInName().equals(typeName)) {
- fEventType = TraceEventType.PROBE;
- } else if (TraceEventType.FUNCTION.getInName().equals(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) {
- if(TraceLogLevel.TRACE_EMERG.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_EMERG;
- } else if(TraceLogLevel.TRACE_ALERT.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_ALERT;
- } else if(TraceLogLevel.TRACE_CRIT.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_CRIT;
- } else if(TraceLogLevel.TRACE_ERR.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_ERR;
- } else if(TraceLogLevel.TRACE_WARNING.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_WARNING;
- } else if(TraceLogLevel.TRACE_NOTICE.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_NOTICE;
- } else if(TraceLogLevel.TRACE_INFO.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_INFO;
- } else if(TraceLogLevel.TRACE_DEBUG_SYSTEM.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_DEBUG_SYSTEM;
- } else if(TraceLogLevel.TRACE_DEBUG_PROGRAM.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_DEBUG_PROGRAM;
- } else if(TraceLogLevel.TRACE_DEBUG_PROCESS.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_DEBUG_PROCESS;
- } else if(TraceLogLevel.TRACE_DEBUG_MODULE.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_DEBUG_MODULE;
- } else if(TraceLogLevel.TRACE_DEBUG_UNIT.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_DEBUG_UNIT;
- } else if(TraceLogLevel.TRACE_DEBUG_FUNCTION.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_DEBUG_FUNCTION;
- } else if(TraceLogLevel.TRACE_DEBUG_LINE.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_DEBUG_LINE;
- } else if(TraceLogLevel.TRACE_DEBUG.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_DEBUG;
- } else if(TraceLogLevel.LEVEL_UNKNOWN.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.LEVEL_UNKNOWN;
- } else {
- fLogLevel = TraceLogLevel.TRACE_DEBUG;
- }
- }
-
- @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<IFieldInfo> fields) {
- fFields.clear();
- for (Iterator<IFieldInfo> 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<IFieldInfo> 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();
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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:
- * Simon Delisle - Initial API and implementation
- * Bernd Hufmann - Updated to enum definition
- **********************************************************************/
-
-package org.eclipse.linuxtools.internal.lttng2.core.control.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"), //$NON-NLS-1$
- /**
- * Buffer type : per PID
- */
- BUFFER_PER_PID("per PID"), //$NON-NLS-1$
- /**
- * 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;
-
- // ------------------------------------------------------------------------
- // Constuctors
- // ------------------------------------------------------------------------
-
- /**
- * Private constructor
- * @param name the name of state
- */
- private BufferType(String name) {
- fInName = name;
- }
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
- /**
- * @return state name
- */
- public String getInName() {
- return fInName;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model.impl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-
-/**
- * <p>
- * Implementation of the trace channel interface (IChannelInfo) to store channel
- * related data.
- * </p>
- *
- * @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 String fOutputType = ""; //$NON-NLS-1$
- /**
- * The channel enable state.
- */
- private TraceEnablement fState = TraceEnablement.DISABLED;
- /**
- * The events information of the channel.
- */
- private final List<IEventInfo> 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 : String.valueOf(other.fOutputType));
- fState = other.fState;
- for (Iterator<IEventInfo> 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 String getOutputType() {
- return fOutputType;
- }
-
- @Override
- public void setOutputType(String 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.ENABLED;
- if (TraceEnablement.DISABLED.getInName().equals(stateName)) {
- fState = TraceEnablement.DISABLED;
- } else if (TraceEnablement.ENABLED.getInName().equals(stateName)) {
- fState = TraceEnablement.ENABLED;
- }
- }
-
- @Override
- public IEventInfo[] getEvents() {
- return fEvents.toArray(new IEventInfo[fEvents.size()]);
- }
-
- @Override
- public void setEvents(List<IEventInfo> events) {
- fEvents.clear();
- for (Iterator<IEventInfo> 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);
- 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<IEventInfo> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model.impl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-
-/**
- * <p>
- * Implementation of the trace domain interface (IDomainInfo) to store domain
- * related data.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class DomainInfo extends TraceInfo implements IDomainInfo {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
- /**
- * The channels information of the domain.
- */
- private final List<IChannelInfo> 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<IChannelInfo> channels) {
- fChannels.clear();
- for (Iterator<IChannelInfo> 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<IChannelInfo> 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();
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-
-/**
-* <p>
-* Implementation of the trace event interface (IEventInfo) to store event
-* related data.
-* </p>
-*
-* @author Bernd Hufmann
-*/
-public class EventInfo extends BaseEventInfo implements IEventInfo {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
- /**
- * The enable state of the event.
- */
- private TraceEnablement fState = TraceEnablement.DISABLED;
-
- // ------------------------------------------------------------------------
- // 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;
- }
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- @Override
- public TraceEnablement getState() {
- return fState;
- }
-
- @Override
- public void setState(TraceEnablement state) {
- fState = state;
- }
-
- @Override
- public void setState(String stateName) {
- fState = TraceEnablement.DISABLED;
- if (TraceEnablement.DISABLED.getInName().equals(stateName)) {
- fState = TraceEnablement.DISABLED;
- } else if (TraceEnablement.ENABLED.getInName().equals(stateName)) {
- fState = TraceEnablement.ENABLED;
- }
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((fState == null) ? 0 : (fState.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;
- }
- EventInfo other = (EventInfo) obj;
- if (fState != other.fState) {
- 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(")]");
- return output.toString();
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
-
-/**
-* <p>
-* Implementation of the basic trace event interface (IEventInfo) to store event
-* related data.
-* </p>
-*
-* @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;
- }
-
- @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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IProbeEventInfo;
-
-/**
-* <p>
-* Implementation of the trace event interface (IProbeEventInfo) to store probe event
-* related data.
-* </p>
-*
-* @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;
- }
-
- // ------------------------------------------------------------------------
- // 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();
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model.impl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-
-/**
- * <p>
- * Implementation of the trace session interface (ISessionInfo) to store session
- * related data.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class SessionInfo extends TraceInfo implements ISessionInfo {
-
- // ------------------------------------------------------------------------
- // 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<IDomainInfo> 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;
-
-
- // ------------------------------------------------------------------------
- // 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<IDomainInfo> 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) {
- if (TraceSessionState.INACTIVE.getInName().equals(stateName)) {
- fState = TraceSessionState.INACTIVE;
- } else if (TraceSessionState.ACTIVE.getInName().equals(stateName)) {
- fState = TraceSessionState.ACTIVE;
- }
- }
-
- @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<IDomainInfo> domains) {
- fDomains.clear();
- for (Iterator<IDomainInfo> iterator = domains.iterator(); iterator.hasNext();) {
- IDomainInfo domainInfo = iterator.next();
- fDomains.add(domainInfo);
- }
- }
-
- @Override
- public boolean isStreamedTrace() {
- 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;
- }
-
- // ------------------------------------------------------------------------
- // 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<IDomainInfo> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model.impl;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISnapshotInfo;
-
-/**
- * <p>
- * Implementation of the snapshot interface (ISnapshotInfo) to store snapshot
- * related data.
- * </p>
- *
- * @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();
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ITraceInfo;
-
-/**
- * <p>
- * Implementation of the base trace information interface (ITraceInfo) to
- * store common data.
- * </p>
- *
- * @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
+++ /dev/null
-/**********************************************************************
- * 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.core.control.model.impl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
-
-/**
- * <p>
- * Implementation of the Ust Provider interface (IUstProviderInfo) to store UST
- * provider related data.
- * </p>
- *
- * @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<IBaseEventInfo> 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<IBaseEventInfo> 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<IBaseEventInfo> events) {
- fEvents.clear();
- for (Iterator<IBaseEventInfo> 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<IBaseEventInfo> iterator = fEvents.iterator(); iterator.hasNext();) {
- IBaseEventInfo event = iterator.next();
- output.append(event.toString());
- }
- }
- output.append(")]");
- return output.toString();
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Guilliano Molaire - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.lttng2.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.core.control.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() {
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Guilliano Molaire - Initial API and implementation
- *********************************************************************/
-package org.eclipse.linuxtools.lttng2.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.core.Activator;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.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.
- * <p>
- * Kernel session configuration example:
- *
- * <pre>
- * {@code
- * <sessions>
- * <session>
- * <name>test_kernel</name>
- * <domains>
- * <domain>
- * <type>KERNEL</type>
- * <buffer_type>GLOBAL</buffer_type>
- * <channels>
- * <channel>
- * <name>channel0</name>
- * <enabled>false</enabled>
- * <overwrite_mode>DISCARD</overwrite_mode>
- * <subbuffer_size>262144</subbuffer_size>
- * <subbuffer_count>4</subbuffer_count>
- * <switch_timer_interval>0</switch_timer_interval>
- * <read_timer_interval>200000</read_timer_interval>
- * <output_type>SPLICE</output_type>
- * <tracefile_size>0</tracefile_size>
- * <tracefile_count>0</tracefile_count>
- * <live_timer_interval>0</live_timer_interval>
- * <events>
- * <event>
- * <enabled>true</enabled>
- * <type>SYSCALL</type>
- * </event>
- * <event>
- * <name>snd_soc_cache_sync</name>
- * <enabled>true</enabled>
- * <type>TRACEPOINT</type>
- * </event>
- * </events>
- * </channel>
- * </channels>
- * </domain>
- * </domains>
- * <started>false</started>
- * <output>
- * <consumer_output>
- * <enabled>true</enabled>
- * <destination>
- * <path>/home/user/lttng-traces/test_kernel</path>
- * </destination>
- * </consumer_output>
- * </output>
- * </session>
- * </sessions>
- * }
- * </pre>
- *
- * </p>
- *
- * @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<ISessionInfo> 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<ISessionInfo> 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().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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Guilliano Molaire - Initial API and implementation
- *********************************************************************/
-package org.eclipse.linuxtools.lttng2.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";
-}
+++ /dev/null
-###############################################################################
-# Copyright (c) 2014 École Polytechnique de Montréal
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# 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}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2014 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
-elementFormDefault="qualified" version="2.5">
-
-<xs:simpleType name="name_type">
- <xs:restriction base="xs:string">
- <xs:maxLength value="255"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:simpleType name="uint64_type">
- <xs:restriction base="xs:integer">
- <xs:minInclusive value="0"/>
- <xs:maxInclusive value="18446744073709551615"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:simpleType name="uint32_type">
- <xs:restriction base="xs:integer">
- <xs:minInclusive value="0"/>
- <xs:maxInclusive value="4294967295"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:simpleType name="channel_overwrite_mode_type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="DISCARD"/>
- <xs:enumeration value="OVERWRITE"/>
- </xs:restriction>
-</xs:simpleType>
-
-<!-- Maps to the lttng_event_output enum -->
-<xs:simpleType name="event_output_type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="SPLICE"/>
- <xs:enumeration value="MMAP"/>
- </xs:restriction>
-</xs:simpleType>
-
-<!-- Maps to the lttng_loglevel_type enum -->
-<xs:simpleType name="loglevel_type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ALL"/>
- <xs:enumeration value="RANGE"/>
- <xs:enumeration value="SINGLE"/>
- </xs:restriction>
-</xs:simpleType>
-
-<!-- Maps to the lttng_event_type enum -->
-<xs:simpleType name="event_type_type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ALL"/>
- <xs:enumeration value="TRACEPOINT"/>
- <xs:enumeration value="PROBE"/>
- <xs:enumeration value="FUNCTION"/>
- <xs:enumeration value="FUNCTION_ENTRY"/>
- <xs:enumeration value="NOOP"/>
- <xs:enumeration value="SYSCALL"/>
- <xs:enumeration value="KPROBE"/>
- <xs:enumeration value="KRETPROBE"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:complexType name="event_probe_attributes_type">
- <xs:all>
- <xs:element name="symbol_name" type="name_type" minOccurs="0"/>
- <xs:element name="address" type="uint64_type" minOccurs="0"/>
- <xs:element name="offset" type="uint64_type" minOccurs="0"/>
- </xs:all>
-</xs:complexType>
-
-<xs:complexType name="event_ftrace_attributes_type">
- <xs:all>
- <xs:element name="symbol_name" type="name_type"/>
- </xs:all>
-</xs:complexType>
-
-<xs:complexType name="event_attributes_type">
- <xs:choice>
- <xs:element name="probe_attributes" type="event_probe_attributes_type"/>
- <xs:element name="function_attributes" type="event_ftrace_attributes_type"/>
- </xs:choice>
-</xs:complexType>
-
-<xs:complexType name="event_exclusion_list_type">
- <xs:sequence>
- <xs:element name="exclusion" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="event_type">
- <xs:all>
- <xs:element name="name" type="name_type" minOccurs="0"/>
- <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0"/>
- <xs:element name="type" type="event_type_type" default="TRACEPOINT" minOccurs="0"/>
- <xs:element name="loglevel_type" type="loglevel_type" default="ALL" minOccurs="0"/>
- <xs:element name="loglevel" type="xs:int" default="-1" minOccurs="0"/>
- <xs:element name="filter" type="xs:string" minOccurs="0"/>
- <xs:element name="exclusions" type="event_exclusion_list_type" minOccurs="0"/>
- <xs:element name="attributes" type="event_attributes_type" minOccurs="0"/>
- </xs:all>
-</xs:complexType>
-
-<xs:complexType name="event_list_type">
- <xs:sequence>
- <xs:element name="event" type="event_type" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="event_perf_context_type">
- <xs:all>
- <xs:element name="type" type="uint32_type"/>
- <xs:element name="config" type="uint64_type"/>
- <xs:element name="name" type="name_type"/>
- </xs:all>
-</xs:complexType>
-
-<!-- Maps to the lttng_event_context_type enum -->
-<xs:simpleType name="event_context_type_type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="PID"/>
- <xs:enumeration value="PROCNAME"/>
- <xs:enumeration value="PRIO"/>
- <xs:enumeration value="NICE"/>
- <xs:enumeration value="VPID"/>
- <xs:enumeration value="TID"/>
- <xs:enumeration value="VTID"/>
- <xs:enumeration value="PPID"/>
- <xs:enumeration value="VPPID"/>
- <xs:enumeration value="PTHREAD_ID"/>
- <xs:enumeration value="HOSTNAME"/>
- <xs:enumeration value="IP"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:complexType name="event_context_type">
- <xs:choice>
- <xs:element name="type" type="event_context_type_type"/>
- <xs:element name="perf" type="event_perf_context_type"/>
- </xs:choice>
-</xs:complexType>
-
-<xs:complexType name="event_context_list_type">
- <xs:sequence>
- <xs:element name="context" type="event_context_type" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
-</xs:complexType>
-
-<!-- Maps to struct lttng_channel -->
-<xs:complexType name="channel_type">
- <xs:all>
- <xs:element name="name" type="name_type"/>
- <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0"/>
- <xs:element name="overwrite_mode" type="channel_overwrite_mode_type" default="DISCARD" minOccurs="0"/>
- <xs:element name="subbuffer_size" type="uint64_type" minOccurs="0"/> <!-- bytes -->
- <xs:element name="subbuffer_count" type="uint64_type" default="4" minOccurs="0"/>
- <xs:element name="switch_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
- <xs:element name="read_timer_interval" type="uint32_type"/> <!-- usec -->
- <xs:element name="output_type" type="event_output_type"/>
- <xs:element name="tracefile_size" type="uint64_type" default="0" minOccurs="0"/> <!-- bytes -->
- <xs:element name="tracefile_count" type="uint64_type" default="0" minOccurs="0"/>
- <xs:element name="live_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
- <xs:element name="events" type="event_list_type" minOccurs="0"/>
- <xs:element name="contexts" type="event_context_list_type" minOccurs="0"/>
- </xs:all>
-</xs:complexType>
-
-<!-- Maps to the lttng_domain_type enum -->
-<xs:simpleType name="domain_type_type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="KERNEL"/>
- <xs:enumeration value="UST"/>
- <xs:enumeration value="JUL"/>
- </xs:restriction>
-</xs:simpleType>
-
-<!-- Maps to the lttng_buffer_type enum -->
-<xs:simpleType name="domain_buffer_type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="PER_PID"/>
- <xs:enumeration value="PER_UID"/>
- <xs:enumeration value="GLOBAL"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:complexType name="channel_list_type">
- <xs:sequence>
- <xs:element name="channel" type="channel_type" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
-</xs:complexType>
-
-<!-- Maps to struct lttng_domain and contains channels -->
-<xs:complexType name="domain_type">
- <xs:all>
- <xs:element name="type" type="domain_type_type"/>
- <xs:element name="buffer_type" type="domain_buffer_type"/>
- <xs:element name="channels" type="channel_list_type" minOccurs="0"/>
- </xs:all>
-</xs:complexType>
-
-<xs:complexType name="session_attributes_type">
- <xs:choice>
- <xs:element name="snapshot_mode" type="xs:boolean"/>
- <xs:element name="live_timer_interval" type="uint32_type"/> <!-- usec -->
- </xs:choice>
-</xs:complexType>
-
-<xs:complexType name="domain_list_type">
- <xs:sequence>
- <xs:element name="domain" type="domain_type" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="net_output_type">
- <xs:all>
- <xs:element name="control_uri" type="xs:string"/>
- <xs:element name="data_uri" type="xs:string"/>
- </xs:all>
-</xs:complexType>
-
-<xs:complexType name="destination_type">
- <xs:choice>
- <xs:element name="path" type="xs:string"/>
- <xs:element name="net_output" type="net_output_type"/>
- </xs:choice>
-</xs:complexType>
-
-<xs:complexType name="consumer_output_type">
- <xs:all>
- <xs:element name="enabled" type="xs:boolean" default="true"/>
- <xs:element name="destination" type="destination_type"/>
- </xs:all>
-</xs:complexType>
-
-<xs:complexType name="snapshot_output_type">
- <xs:all>
- <xs:element name="name" type="name_type"/>
- <xs:element name="max_size" type="uint64_type"/>
- <xs:element name="consumer_output" type="consumer_output_type"/>
- </xs:all>
-</xs:complexType>
-
-<xs:complexType name="snapshot_output_list_type">
- <xs:sequence>
- <xs:element name="output" type="snapshot_output_type" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="session_output_type">
- <xs:choice>
- <xs:element name="snapshot_outputs" type="snapshot_output_list_type"/>
- <xs:element name="consumer_output" type="consumer_output_type"/>
- </xs:choice>
-</xs:complexType>
-
-<xs:complexType name="session_type">
- <xs:all>
- <xs:element name="name" type="name_type"/>
- <xs:element name="domains" type="domain_list_type" minOccurs="0"/>
- <xs:element name="started" type="xs:boolean" default="0" minOccurs="0"/>
- <xs:element name="attributes" type="session_attributes_type" minOccurs="0"/>
- <xs:element name="output" type="session_output_type" minOccurs="0"/>
- </xs:all>
-</xs:complexType>
-
-<xs:element name="sessions">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="session" type="session_type" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-</xs:element>
-
-</xs:schema>
org.eclipse.core.runtime,
org.eclipse.linuxtools.lttng2.kernel.core,
org.eclipse.linuxtools.lttng2.kernel.ui,
- org.eclipse.linuxtools.lttng2.ui,
+ org.eclipse.linuxtools.lttng2.control.ui,
org.eclipse.linuxtools.tmf.core,
org.eclipse.linuxtools.tmf.core.tests,
org.eclipse.linuxtools.tmf.ctf.core,
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.internal.lttng2.ui.views.control.ControlView;
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;
org.eclipse.core.runtime,
org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
org.eclipse.linuxtools.tmf.ui;bundle-version="3.0.0",
- org.eclipse.linuxtools.lttng2.core;bundle-version="3.0.0",
- org.eclipse.linuxtools.lttng2.ui;bundle-version="3.0.0",
+ org.eclipse.linuxtools.lttng2.control.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.lttng2.control.ui;bundle-version="3.0.0",
org.eclipse.linuxtools.lttng2.kernel.core;bundle-version="3.0.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,
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.internal.lttng2.ui.views.control.ControlView;
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;
</url>
<includes
- id="org.eclipse.linuxtools.lttng2"
+ id="org.eclipse.linuxtools.lttng2.control"
version="0.0.0"
name="Linux Tracing Toolkit next generation (LTTng)"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.ui.ide"/>
<import plugin="org.eclipse.linuxtools.tmf.ui" version="3.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.linuxtools.lttng2.core" version="3.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.linuxtools.lttng2.ui" version="3.0.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.linuxtools.lttng2.control.core" version="3.0.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.linuxtools.lttng2.control.ui" version="3.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.linuxtools.lttng2.kernel.core" version="3.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.help"/>
</requires>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="stubs"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+++ /dev/null
-bin
-@dot
-javaCompiler...args
-build.xml
-target
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.linuxtools.lttng2.ui.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
+++ /dev/null
-eclipse.preferences.version=1
-line.separator=\n
+++ /dev/null
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-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=ignore
-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=error
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
-org.eclipse.jdt.core.compiler.source=1.7
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=false
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=250
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+++ /dev/null
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_tmf-style
-formatter_settings_version=12
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=false
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=false
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+++ /dev/null
-ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
-ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
-API_USE_SCAN_FIELD_SEVERITY=Error
-API_USE_SCAN_METHOD_SEVERITY=Error
-API_USE_SCAN_TYPE_SEVERITY=Error
-CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
-CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
-CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
-CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
-CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
-ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
-ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
-ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
-FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
-FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
-FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
-FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
-ILLEGAL_EXTEND=Warning
-ILLEGAL_IMPLEMENT=Warning
-ILLEGAL_INSTANTIATE=Warning
-ILLEGAL_OVERRIDE=Warning
-ILLEGAL_REFERENCE=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-INVALID_JAVADOC_TAG=Warning
-INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
-LEAK_EXTEND=Warning
-LEAK_FIELD_DECL=Warning
-LEAK_IMPLEMENT=Warning
-LEAK_METHOD_PARAM=Warning
-LEAK_METHOD_RETURN_TYPE=Warning
-METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
-METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-MISSING_EE_DESCRIPTIONS=Ignore
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
-UNUSED_PROBLEM_FILTERS=Warning
-automatically_removed_unused_problem_filters=false
-eclipse.preferences.version=1
-incompatible_api_component_version=Error
-incompatible_api_component_version_include_major_without_breaking_change=Disabled
-incompatible_api_component_version_include_minor_without_api_change=Disabled
-invalid_since_tag_version=Error
-malformed_since_tag=Error
-missing_since_tag=Error
-report_api_breakage_when_major_version_incremented=Disabled
-report_resolution_errors_api_component=Warning
+++ /dev/null
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=2
-compilers.p.missing-version-export-package=2
-compilers.p.missing-version-import-package=2
-compilers.p.missing-version-require-bundle=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=2
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+++ /dev/null
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 3.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.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.core;bundle-version="3.0.0",
- org.eclipse.linuxtools.lttng2.ui;bundle-version="3.0.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.stubs.dialogs;x-internal:=true,
- org.eclipse.linuxtools.internal.lttng2.stubs.service;x-internal:=true,
- org.eclipse.linuxtools.internal.lttng2.stubs.shells;x-internal:=true,
- org.eclipse.linuxtools.lttng2.ui.tests;x-friends:="org.eclipse.linuxtools.lttng.alltests",
- org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;x-internal:=true,
- org.eclipse.linuxtools.lttng2.ui.tests.control.service;x-internal:=true
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-###############################################################################
-# Copyright (c) 2013 Ericsson
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms 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
+++ /dev/null
-###############################################################################
-# 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.ui.tests
-Bundle-Vendor = Eclipse Linux Tools
-Bundle-Name = Linux Tools LTTng UI Tests Plug-in
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (C) 2011, Red Hat, Inc.
-
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
--->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>linuxtools-lttng-parent</artifactId>
- <groupId>org.eclipse.linuxtools.lttng</groupId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>org.eclipse.linuxtools.lttng2.ui.tests</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <packaging>eclipse-test-plugin</packaging>
-
- <name>Linux Tools LTTng UI Tests Plug-in</name>
-
- <build>
- <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 -->
- <resources>
- <resource>
- <directory>src</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <testSuite>org.eclipse.linuxtools.lttng2.ui.tests</testSuite>
- <testClass>org.eclipse.linuxtools.lttng2.ui.tests.AllTests</testClass>
- <useUIHarness>true</useUIHarness>
- <useUIThread>true</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <groupId>org.eclipse.linuxtools.lttng2</groupId>
-</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.lttng2.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.ui.Activator#Activator}.
- */
- @Test
- public void testActivator() {
- assertTrue(true);
- }
-
- /**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#getDefault}.
- */
- @Test
- public void testGetDefault() {
- assertTrue(true);
- }
-
- /**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#start}.
- */
- @Test
- public void testStartBundleContext() {
- assertTrue(true);
- }
-
- /**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#stop}.
- */
- @Test
- public void testStopBundleContext() {
- assertTrue(true);
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.linuxtools.lttng2.ui.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Runner for the lttng2.ui unit tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ActivatorTest.class,
- org.eclipse.linuxtools.lttng2.ui.tests.control.model.component.AllTests.class,
- org.eclipse.linuxtools.lttng2.ui.tests.control.service.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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.ui.tests.control.model.component;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Runner for the control.model.component unit tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TraceControlComponentTest.class,
- TraceControlCreateSessionTests.class,
- TraceControlKernelProviderTests.class,
- TraceControlKernelSessionTests.class,
- TraceControlPropertiesTest.class,
- TraceControlTreeModelNoProvidersTest.class,
- TraceControlTreeModelTest.class,
- TraceControlUstProviderTests.class,
- TraceControlUstSessionTests.class,
- TraceControlUstSessionTests2.class,
- TraceControlSnapshotSessionTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.tests.control.model.component;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.tests.control.model.component;
-
-import static org.junit.Assert.*;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponentChangedListener;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlRoot;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlService;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.junit.Test;
-
-/**
- * The class <code>TraceControlComponentTest</code> contains tests for the class
- * <code>{@link TraceControlComponent}</code>.
- */
-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<Object> 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);
-
- 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>)/ITraceControlComponent[] getChildren() method test.
- */
- @Test
- public void testGetAndSetChildren() {
- TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
- fixture.setToolTip("");
- List<ITraceControlComponent> 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
+++ /dev/null
-/**********************************************************************
- * 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.ui.tests.control.model.component;
-
-import java.io.File;
-import java.net.URL;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlKernelSessionTests</code> contains Kernel session/channel/event
- * handling test cases.
- */
-
-@SuppressWarnings("javadoc")
-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";
-
- // ------------------------------------------------------------------------
- // 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.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
- */
- @After
- public void tearDown() {
- fFacility.waitForJobs();
- }
-
- /**
- * Run the TraceControlComponent.
- */
- @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());
-
- // 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("mysession", session.getName());
- 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("mysession", session.getName());
- 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("mysession", session.getName());
- 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("mysession", session.getName());
- 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);
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.ui.tests.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.KernelProviderComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProviderGroup;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlKernelProviderTests</code> 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());
- 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
+++ /dev/null
-/**********************************************************************
- * 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.ui.tests.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.AddContextDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableEventsDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProbeEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlKernelSessionTests</code> 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());
- 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());
- 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<String> 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<String> 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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.ui.tests.control.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.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.KernelProviderComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProbeEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.UstProviderComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BaseEventPropertySource;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.KernelProviderPropertySource;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TargetNodePropertySource;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceChannelPropertySource;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceDomainPropertySource;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceEventPropertySource;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceProbeEventPropertySource;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceSessionPropertySource;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlPropertiesTest</code> contains tests for the all
- * property class</code>.
- */
-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());
-
- //-------------------------------------------------------------------------
- // Delete node
- //-------------------------------------------------------------------------
- node.disconnect();
- node.getParent().removeChild(node);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2013, 2014 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.ui.tests.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlSnapshotSessionTests</code> 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<String,String> 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
+++ /dev/null
-/*******************************************************************************
- * 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.ui.tests.control.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.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.swt.SWT;
-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()) {
- if ("cocoa".equals (SWT.getPlatform ())) {
- // The display needs to be woken up because it's possible
- // to get in a state where nothing will wake up the UI thread
- display.asyncExec(null);
- }
- display.sleep();
- }
- 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");
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.ui.tests.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProviderGroup;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.UstProviderComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlTreeModelNoProvidersTest</code> 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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.ui.tests.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.KernelProviderComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProbeEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProviderGroup;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.UstProviderComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlTreeModelTest</code> 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());
- 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());
- 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());
- 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());
- 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(2, ustEvents.length);
-
- event = (TraceEventComponent) ustEvents[0];
- assertEquals("ust_tests_hello:tptest_sighandler", event.getName());
- assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.DISABLED, event.getState());
-
- event = (TraceEventComponent) ustEvents[1];
- assertEquals("*", ustEvents[1].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();
- String 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());
-
- 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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- **********************************************************************/
-
-package org.eclipse.linuxtools.lttng2.ui.tests.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.KernelProviderComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlUstProviderTests</code> 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());
- 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
+++ /dev/null
-/**********************************************************************
- * 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.ui.tests.control.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.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableEventsDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlUstSessionTests</code> 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());
- 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());
- 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<String> 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(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
+++ /dev/null
-/**********************************************************************
- * 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.ui.tests.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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 <code>TraceControlUstSessionTests</code> 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
+++ /dev/null
-/*******************************************************************************
- * 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.ui.tests.control.service;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Runner for the control.service unit tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- LTTngControlServiceTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.tests.control.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.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.stubs.service.CommandShellFactory;
-import org.eclipse.linuxtools.internal.lttng2.stubs.shells.LTTngToolsFileShell;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.logging.ControlCommandLogger;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferences;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlService;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlServiceFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.FrameworkUtil;
-
-/**
- * The class <code>LTTngControlServiceTest</code> contains test for the class
- * <code>{@link LTTngControlService}</code>.
- */
-@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";
- private 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_STREAMED_SNAPSHOT_SESSION = "CreateSessionStreamedSnapshot";
- private static final String SCEN_CREATE_SNAPSHOT_SESSION_ERRORS = "CreateSessionSnapshotErrors";
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
-
- private CommandShellFactory fShellFactory;
- private String fTestfile;
- private LTTngToolsFileShell fShell;
- private 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(DIRECTORY + File.separator + TEST_STREAM), null);
- File testfile = new File(FileLocator.toFileURL(location).toURI());
- fTestfile = testfile.getAbsolutePath();
-
- fShell = fShellFactory.getFileShell();
- fShell.loadScenarioFile(fTestfile);
- fService = new LTTngControlService(fShell);
-
- ControlPreferences.getInstance().init(Activator.getDefault().getPreferenceStore());
- }
-
- @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.getVersion());
- } 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.getVersion());
- } 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());
- 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());
- 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());
- 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());
- 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(TraceLogLevel.LEVEL_UNKNOWN, 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());
- }
- }
-
- public void testGetKernelProvider() {
- try {
- fShell.setScenario(SCEN_GET_KERNEL_PROVIDER1);
- List<IBaseEventInfo> 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<IBaseEventInfo> 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<IBaseEventInfo> 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<IBaseEventInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> contexts = new ArrayList<>();
- contexts.add("prio");
- contexts.add("pid");
-
- fShell.setScenario(SCEN_CONTEXT_HANDLING);
-
- List<String> availContexts = fService.getContextList(new NullProgressMonitor());
- assertNotNull(availContexts);
- assertEquals(12, availContexts.size());
-
- // A very "hard-coded" way to verify but it works ...
- Set<String> 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<String> 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());
- }
- }
-
- 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
- }
- }
-
- 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);
- }
-
-
-}
+++ /dev/null
-/**********************************************************************
- * 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.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.ui.views.control.dialogs.IAddContextDialog;
-
-/**
- * Add Context dialog stub.
- */
-@SuppressWarnings("javadoc")
-public class AddContextDialogStub implements IAddContextDialog {
-
- private Set<String> fAvailableContexts = null;
- private List<String> fContexts = null;
-
- @Override
- public int open() {
- return 0;
- }
-
- @Override
- public void setAvalibleContexts(List<String> contexts) {
- fAvailableContexts = new HashSet<>();
- fAvailableContexts.addAll(contexts);
- }
-
- @Override
- public List<String> getContexts() {
- List<String> ret = new ArrayList<>();
- ret.addAll(fContexts);
- return ret;
- }
-
- public void setContexts(List<String> contexts) throws IllegalArgumentException{
- fContexts = new ArrayList<>();
- fContexts.addAll(contexts);
- // If availableContexts are null we cannot verify
- if (fAvailableContexts != null) {
- for (Iterator<String> iterator = fContexts.iterator(); iterator.hasNext();) {
- String string = iterator.next();
- if (!fAvailableContexts.contains(string)) {
- throw new IllegalArgumentException();
- }
- }
- }
- }
-}
-
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.stubs.dialogs;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.ICreateSessionDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
- @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;
- }
-
- @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.setSnapshot(fIsSnapshot);
-
- return sessionInfo;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.stubs.dialogs;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.stubs.dialogs;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableChannelDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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
+++ /dev/null
-/**********************************************************************
- * 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.stubs.dialogs;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableEventsDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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<String> 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<String> 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<String> 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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.stubs.dialogs;
-
-import java.util.Arrays;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IGetEventInfoDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
- }
-}
-
+++ /dev/null
-/**********************************************************************
- * 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.stubs.service;
-
-import org.eclipse.linuxtools.internal.lttng2.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();
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.stubs.service;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.linuxtools.internal.lttng2.stubs.shells.LTTngToolsFileShell;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandShell;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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) {
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.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.ui.views.control.remote.CommandResult;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandResult;
-
-@SuppressWarnings("javadoc")
-public class LTTngToolsFileShell extends TestCommandShell {
-
- // ------------------------------------------------------------------------
- // CONSTANTS
- // ------------------------------------------------------------------------
- private final static String SCENARIO_KEY = "<SCENARIO>";
- private final static String SCENARIO_END_KEY = "</SCENARIO>";
- private final static String INPUT_KEY = "<COMMAND_INPUT>";
- private final static String INPUT_END_KEY = "</COMMAND_INPUT>";
- private final static String RESULT_KEY = "<COMMAND_RESULT>";
- private final static String OUTPUT_KEY = "<COMMAND_OUTPUT>";
- private final static String OUTPUT_END_KEY = "</COMMAND_OUTPUT>";
- 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<String, Map<String, ICommandResult>> fScenarioMap = new HashMap<>();
- private final Map<String, Integer> 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_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)
- *
- * 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<Map<String, ICommandResult>> values = fScenarioMap.values();
- for (Iterator<Map<String, ICommandResult>> iterator = values.iterator(); iterator.hasNext();) {
- Map<String, ICommandResult> 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
- // <session> commands.
- // The numbers are per scenario.
- Map<String, Integer> 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<String, ICommandResult> commandMap = new HashMap<>();
- fScenarioMap.put(scenario, commandMap);
- List<String> output = null;
- String input = null;
- boolean inOutput = 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
- // <session"-comamand
- Matcher matcher = LTTNG_LIST_SESSION_PATTERN.matcher(strLine);
- if (matcher.matches() && !input.matches(LTTNG_LIST_PROVIDER_PATTERN)) {
- String sessionName = matcher.group(1).trim();
- Integer i = tmpSessionNameMap.get(sessionName);
- if (i != null) {
- i++;
- } else {
- i = 0;
- }
- tmpSessionNameMap.put(sessionName, i);
- input += String.valueOf(i);
- }
- } else if (INPUT_END_KEY.equals(strLine)) {
- // Initialize output array
- output = 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) {
- commandMap.put(input, new CommandResult(result, output.toArray(new String[output.size()])));
- }
- inOutput = false;
- } else if (OUTPUT_KEY.equals(strLine)) {
- // first line of output
- inOutput = true;
- strLine = br.readLine();
-
- // Ignore comments
- while (isComment(strLine)) {
- strLine = br.readLine();
- }
- if (output != null) {
- output.add(strLine);
- }
- } else if (inOutput) {
- // subsequent lines of output
- 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<String, ICommandResult> 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);
- // For verification of setters of class CommandResult
- result.setOutput(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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.stubs.shells;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.CommandResult;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandResult;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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]);
- }
-}
+++ /dev/null
-####################################################################
-# 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
-####################################################################
-<SCENARIO>
-Initialize
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-lttng version 2.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Currently no available tracing session
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -u
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng create <session> with LTTng 2.1 options
-####################################################################
-##################################################################
-<SCENARIO>
-CreateSessionFileProto
-<COMMAND_INPUT>
-lttng create mysession -U file:///tmp
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in file:///tmp
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
- Trace path: file:///tmp
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-##################################################################
-<SCENARIO>
-CreateSessionControlData
-<COMMAND_INPUT>
-lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
- Trace path: tcp://172.0.0.1:5342 [data: 5343]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-##################################################################
-<SCENARIO>
-CreateSessionNetwork
-<COMMAND_INPUT>
-lttng create mysession -U net://172.0.0.1:1234:2345
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in net://172.0.0.1:1234:2345
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
- Trace path: net://172.0.0.1:1234 [data: 2345]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession2 destroyed.
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-##################################################################
-<SCENARIO>
-CreateSessionNetwork2
-<COMMAND_INPUT>
-lttng create mysession -U net6://[ffff::eeee:dddd:cccc:0]
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in net6://[ffff::eeee:dddd:cccc:0]
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
- Trace path: net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession2 destroyed.
-</COMMAND_OUTPUT>
-
-</SCENARIO>
\ No newline at end of file
+++ /dev/null
-####################################################################
-# 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
-####################################################################
-<SCENARIO>
-Initialize
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Currently no available tracing session
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -u -f
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng create <session> --snapshot" LTTng 2.3
-####################################################################
-<SCENARIO>
-ScenCreateSession
-<COMMAND_INPUT>
-lttng create mysession --snapshot
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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.
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive snapshot]
- Trace path:
-
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng snapshot list-output -s mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Snapshot output list for session mysession
- [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng start mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing started for session mysession.
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng snapshot record -s mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
- Snapshot recorded successfully for session mysession
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng stop mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing stopped for session mysession.
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-</SCENARIO>
+++ /dev/null
-####################################################################
-# Copyright (c) 2012, 2013 Ericsson
-#
-# All rights reserved. This program and the accompanying materials are
-# made available under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Bernd Hufmann - Initial API and implementation
-####################################################################
-####################################################################
-# Scenario: Initialize
-####################################################################
-<SCENARIO>
-Initialize
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-lttng version 2.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Currently no available tracing session
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -u
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Create and destroy session
-####################################################################
-<SCENARIO>
-SessionHandling
-<SCENARIO>
-<COMMAND_INPUT>
-lttng create mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20120314-132824
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
- Trace path: /home/user/lttng-traces/mysession-20120314-132824
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng start mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing started for session mysession.
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng stop mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing stopped for session mysession.
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-####################################################################
-# Scenario: Create and destroy session
-####################################################################
-<SCENARIO>
-SessionHandlingWithPath
-<SCENARIO>
-<COMMAND_INPUT>
-lttng create mysession -o /home/user/temp
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in /home/user/temp
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
- Trace path: /home/user/temp
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-
-####################################################################
-# Scenario: Enable events from kernel provider events
-####################################################################
-<SCENARIO>
-Scenario1
-
-
-<COMMAND_INPUT>
-lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k -s mysession --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event sched_kthread_stop created in channel channel0
-kernel sched_kthread_stop_ret created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng disable-event sched_kthread_stop_ret,sched_kthread_stop -k -s mysession -c channel0
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event sched_kthread_stop_ret disabled in channel channel0
-kernel event sched_kthread_stop disabled in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event sched_kthread_stop -k -s mysession -c channel0 --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event sched_kthread_stop enabled in channel channel0
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-####################################################################
-# Scenario: Enable events from UST provider events
-####################################################################
-<SCENARIO>
-Scenario2
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel mychannel enabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest_sighandler,ust_tests_hello:tptest -u -s mysession --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event ust_tests_hello:tptest_sighandler in channel channel0
-UST sched_ust_tests_hello:tptest created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng disable-event ust_tests_hello:tptest -u -s mysession -c mychannel
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event ust_tests_hello:tptest in channel mychannel
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest -u -s mysession -c mychannel --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event ust_tests_hello:tptest enabled in channel mychannel
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-<SCENARIO>
-Scenario3
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel -k -s mysession --overwrite --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel channel mychannel enabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel2 -k -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel channel mychannel2 enabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-
-<COMMAND_INPUT>
-lttng disable-channel mychannel,mychannel2 -k -s mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel channel mychannel disabled for session mysession
-Kernel channel mychannel2 disabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel,mychannel2 -k -s mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel channel mychannel enabled for session mysession
-Kernel channel mychannel2 enabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k -s mysession --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event sched_kthread_stop created in channel channel0
-kernel sched_kthread_stop_ret created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event sched_wakeup_new -k -s mysession --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event sched_wakeup_new created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession -c mychannel2 --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-All kernel event sched_kthread_stop created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession -c mychannel --syscall
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-All kernel system calls are enabled in channel mychannel
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession --syscall
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-All kernel system calls are enabled in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession --syscall
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-All kernel system calls are enabled in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent1 -k -s mysession --probe 0xc0101280
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event myevent1 created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent2 -k -s mysession -c channel0 --probe init_post
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event myevent2 created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent3 -k -s mysession --probe init_post:0x1000
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event myevent2 created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent4 -k -s mysession --function create_dev
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event myevent4 created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent5 -k -s mysession --function create_dev:0x2000
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event myevent5 created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent -k -s mysession -c mychannel --function create_dev:0x2000
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event myevent created in channel mychannel
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Available tracing sessions:
- 1) mysession (/home/eedbhu/lttng-traces/mysession-20120321-115617) [inactive]
-
-Use lttng list <session_name> for more details
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -u
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng add-context -h
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng add-context -s mysession -k -t prio -t perf:branch-misses -t perf:cache-misses
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng add-context -h
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng add-context -s mysession -c mychannel -k -t prio -t perf:branch-misses -t perf:cache-misses
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng add-context -h
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng add-context -s mysession -c channel0 -e sched_kthread_stop_ret -k -t prio -t perf:branch-misses -t perf:cache-misses
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng calibrate -k --function
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel calibration done
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-<SCENARIO>
-Scenario4
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession --overwrite --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel mychannel enabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel2 -u -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel mychannel2 enabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event ust_tests_hello:tptest_sighandler created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest -u -s mysession --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event ust_tests_hello:tptest created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event -a -u -s mysession -c mychannel2 --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-All UST events created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event "ust*" -u -s mysession -c mychannel --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event ust* created in channel mychannel
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event "ust*" -u -s mysession --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event ust* created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event "u*" -u -s mysession --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event u* created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-
-<COMMAND_INPUT>
-lttng enable-event myevent1 -u -s mysession --loglevel TRACE_WARNING
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event myevent1 created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent2 -u -s mysession --loglevel-only TRACE_DEBUG_FUNCTION
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event myevent2 created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent0 -u -s mysession -c mychannel --loglevel-only TRACE_DEBUG_FUNCTION
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event myevent0 created in channel mychannel
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-
-
-</SCENARIO>
-
-
-
+++ /dev/null
-####################################################################
-# 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
-####################################################################
-<SCENARIO>
-Initialize
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-lttng version 2.2.0 - Cuda
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Currently no available tracing session
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -u -f
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Session and channel with per-UID UST buffers
-####################################################################
-<SCENARIO>
-ScenPerUidTest
-<COMMAND_INPUT>
-lttng create mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
- Trace path: /home/user/lttng-traces/mysession-20130812-113358
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session my destroyed.
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession --buffers-uid
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel mychannel enabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-####################################################################
-# Scenario: Session and channel with per-PID UST buffers
-####################################################################
-<SCENARIO>
-ScenPerPidTest
-<COMMAND_INPUT>
-lttng create mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
- Trace path: /home/user/lttng-traces/mysession-20130812-113358
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession --buffers-pid
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel mychannel enabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-####################################################################
-# Scenario: Session and channel with per-PID UST buffers with option -C -W
-####################################################################
-<SCENARIO>
-ScenBufSizeTest
-<COMMAND_INPUT>
-lttng create mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20130812-113358
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
- Trace path: /home/user/lttng-traces/mysession-20130812-113358
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession -C 1024 -W 10
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Warning: Tracefile size rounded up from (1024) to subbuffer size (8388608)
-UST channel mychannel enabled for session mysession
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-
-
+++ /dev/null
-####################################################################
-# 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
-####################################################################
-<SCENARIO>
-LttngNotInstalled
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Command not found
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test lttng version
-####################################################################
-<SCENARIO>
-LttngVersion
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-lttng version 2.1.0 - Basse Messe
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test lttng version
-# output with prompt
-####################################################################
-<SCENARIO>
-LttngVersionWithPrompt
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test lttng version (unsupported version)
-####################################################################
-<SCENARIO>
-LttngUnsupportedVersion
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-lttng version 200.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-
-####################################################################
-# Scenario: Test lttng version (noversion)
-####################################################################
-<SCENARIO>
-LttngNoVersion
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test no sessions available
-####################################################################
-<SCENARIO>
-NoSessionAvailable
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Currently no available tracing session
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test get sessions
-####################################################################
-<SCENARIO>
-GetSessionNames1
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_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 <session_name> for more details
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test lttng list <name> where session doesn't exist
-####################################################################
-<SCENARIO>
-GetSessionNameNotExist
-<COMMAND_INPUT>
-lttng list test
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session test not found
-Error: Session name not found
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test lttng -vvv list <name> where session doesn't exist
-####################################################################
-<SCENARIO>
-GetSessionNameNotExistVerbose
-<COMMAND_INPUT>
-lttng -vvv list test
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test lttng list with garbage output
-####################################################################
-<SCENARIO>
-GetSessionGarbageOut
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-asdfaereafsdcv 12333456434&*89**(())(^%$*
-@#$%^&*()@#$%^&*()0834523094578kj;djkfs
-a;sdf094v5u dsafj;sd9
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test lttng list <name> with sample outputs
-####################################################################
-<SCENARIO>
-GetSession1
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-
-</COMMAND_OUTPUT>
-<COMMAND_INPUT>
-lttng list mysession1
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession1: [inactive]
- Trace path: /home/user/lttng-traces/mysession1-20120203-133225
-
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with sample output
-####################################################################
-<SCENARIO>
-GetKernelProvider1
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel and no session daemon
-####################################################################
-<SCENARIO>
-ListWithNoKernel1
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Spawning session daemon
-Error: Unable to list kernel events
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel and with session daemon
-####################################################################
-<SCENARIO>
-ListWithNoKernel2
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Error: Unable to list kernel events
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel, with session daemon and verbose
-####################################################################
-<SCENARIO>
-ListWithNoKernelVerbose
-<COMMAND_INPUT>
-lttng -vvv list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng list -u" with sample output
-####################################################################
-<SCENARIO>
-GetUstProvider1
-<COMMAND_INPUT>
-lttng list -u
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng list -u" with no UST provider available
-####################################################################
-<SCENARIO>
-GetUstProvider2
-<COMMAND_INPUT>
-lttng list -u
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST events:
--------------
-None
-
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng list -u" with no UST available (LTTng 2.0.x)
-####################################################################
-<SCENARIO>
-ListWithNoUst1
-<COMMAND_INPUT>
-lttng list -u
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST events:
--------------
-None
-Segmentation Fault
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng list -u" with no UST available and no session daemon
-####################################################################
-<SCENARIO>
-ListWithNoUst2
-<COMMAND_INPUT>
-lttng list -u -f
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Spawning a session daemon
-Error: Unable to list UST events: Listing UST events failed
-Error: Command Error
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel and with session daemon
-####################################################################
-<SCENARIO>
-ListWithNoUst3
-<COMMAND_INPUT>
-lttng list -u -f
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Error: Unable to list UST events: Listing UST events failed
-Error: Command Error
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng list -u" with no kernel, with session daemon and verbose
-####################################################################
-<SCENARIO>
-ListWithNoUstVerbose
-<COMMAND_INPUT>
-lttng -vvv list -u -f
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-
-####################################################################
-# Scenario: Test "lttng list -u -f" with sample output (version 2.1.0)
-####################################################################
-<SCENARIO>
-GetUstProvider3
-<COMMAND_INPUT>
-lttng list -u -f
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-
-####################################################################
-# Scenario: Test "lttng create <session>
-####################################################################
-<SCENARIO>
-CreateSession1
-<COMMAND_INPUT>
-lttng create mysession2
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession2 created.
-Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng create <session>
-####################################################################
-<SCENARIO>
-CreateSessionWithPrompt
-<COMMAND_INPUT>
-lttng create mysession2
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Prompt> Session mysession2 created.
-Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng create <session> with different variants
-# and errors
-####################################################################
-<SCENARIO>
-CreateSessionVariants
-<COMMAND_INPUT>
-lttng create alreadyExist
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Error: Session name already exist
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng create "session with spaces"
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session session with spaces created.
-Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng create wrongName
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session auto created.
-Traces will be written in /home/user/lttng-traces/auto-20120209-095418
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng create wrongPath -o /home/user/hallo
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session wrongPath created.
-Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng create pathWithSpaces -o "/home/user/hallo user/here"
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session pathWithSpaces created.
-Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng destroy <session>
-####################################################################
-
-<SCENARIO>
-DestroySession1
-<COMMAND_INPUT>
-lttng destroy mysession2
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession2 destroyed.
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng -vvv destroy <session>"
-####################################################################
-
-<SCENARIO>
-DestroySessionVerbose
-<COMMAND_INPUT>
-lttng -vvv destroy mysession2
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-
-####################################################################
-# Scenario: Test "lttng enable-channel ..." with different inputs
-####################################################################
-
-<SCENARIO>
-ChannelHandling
-<COMMAND_INPUT>
-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
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel channel mychannel0 enabled for session mysession2
-Kernel channel mychannel1 enabled for session mysession2
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel channel mychannel0 enabled for session mysession2
-Kernel channel mychannel1 enabled for session mysession2
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel channel0 enabled for session mysession2
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel channel0 enabled for session mysession2
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-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
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel channel0 enabled for session mysession2
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2 --overwrite --buffers-pid
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel ustChannel enabled for session mysession2
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel channel0 enabled for session mysession2
-</COMMAND_OUTPUT>
-
-
-<COMMAND_INPUT>
-lttng enable-channel mychannel0,mychannel1 -k -s mysession2
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel channel mychannel0 enabled for session mysession2
-Kernel channel mychannel1 enabled for session mysession2
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel mychannel0 enabled for session mysession2
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng disable-channel mychannel0,mychannel1 -k -s mysession2
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel channel mychannel0 disabled for session mysession2
-Kernel channel mychannel1 disabled for session mysession2
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng disable-channel ustChannel -u -s mysession2
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST channel mychannel0 enabled for session mysession2
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-
-####################################################################
-# Scenario: Test "lttng enable-events ..." with different inputs
-####################################################################
-<SCENARIO>
-EventHandling
-
-# Tracepoint test cases
-
-<COMMAND_INPUT>
-lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-All kernel tracepoints are enabled in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event ust_tests_hello:tptest_sighandler created in channel mychannel
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint --filter 'intfield==10'
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event ust_tests_hello:tptest_sighandler created in channel mychannel
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-All UST tracepoints are enabled in channel mychannel
-</COMMAND_OUTPUT>
-
-# Syscall test cases
-
-<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession2 --syscall
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-All kernel system calls are enabled in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession2 -c mychannel --syscall
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-All kernel system calls are enabled in channel mychannel
-</COMMAND_OUTPUT>
-
-# dynamic probe/function probe test cases
-
-<COMMAND_INPUT>
-lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event myevent0 created in channel mychannel
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-kernel event myevent1 created in channel mychannel
-</COMMAND_OUTPUT>
-
-# log level test cases
-
-<COMMAND_INPUT>
-lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event myevent4 created in channel channel0
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-UST event myevent5 created in channel mychannel
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs
-####################################################################
-
-<SCENARIO>
-ContextHandling
-
-<COMMAND_INPUT>
-lttng add-context -h
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-<SCENARIO>
-ContextErrorHandling
-
-<COMMAND_INPUT>
-lttng add-context -h
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-<SCENARIO>
-CalibrateHandling
-<COMMAND_INPUT>
-lttng calibrate -k --function
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel calibration done
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng calibrate -u --function
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Kernel calibration done
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng create <session> with LTTng 2.1 options
-####################################################################
-<SCENARIO>
-CreateSessionLttng2.1
-
-<COMMAND_INPUT>
-lttng create mysession -U net://172.0.0.1
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in net://172.0.0.1
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng create mysession -U file:///tmp
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in file:///tmp
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng create mysession -U net://172.0.0.1:1234:2345
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in net://172.0.0.1:1234:2345
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng -vvv create mysession -U net://172.0.0.1
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng -vvv create <session> with LTTng 2.1 options"
-####################################################################
-<SCENARIO>
-CreateSessionLttngVerbose2.1
-<COMMAND_INPUT>
-lttng -vvv create mysession -U net://172.0.0.1
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng -vvv destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng create <session> --snapshot (LTTng 2.3)
-####################################################################
-<SCENARIO>
-CreateSessionSnapshot
-<COMMAND_INPUT>
-lttng create mysession --snapshot
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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.
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng snapshot list-output -s mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Snapshot output list for session mysession
- [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
- 1) mysession () [inactive snapshot]
-
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng snapshot record -s mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
- Snapshot recorded successfully for session mysession
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-####################################################################
-# Scenario: Test "lttng create <session> --snapshot -U <URL> (LTTng 2.3)
-####################################################################
-<SCENARIO>
-CreateSessionStreamedSnapshot
-<COMMAND_INPUT>
-lttng create mysession --snapshot -U net://172.0.0.1
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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.
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng snapshot list-output -s mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Snapshot output list for session mysession
- [2] snapshot-2: net4://172.0.0.1:5342/
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
- 1) mysession () [inactive snapshot]
-
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng snapshot record -s mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
- Snapshot recorded successfully for session mysession
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-</SCENARIO>
-
-
-
-
-####################################################################
-# Scenario: Test "lttng create <session> --snapshot (LTTng 2.3)
-####################################################################
-<SCENARIO>
-CreateSessionSnapshotErrors
-<COMMAND_INPUT>
-lttng snapshot list-output -s blabla
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Error: Session name not found
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-#next is not an error case but good to be tested
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
- 1) mysession () [active snapshot]
-
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng snapshot record -s blabla
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
- Error: Session name not found
-</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
-<COMMAND_INPUT>
-lttng snapshot record -s mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
- Error: Session needs to be started once
-</COMMAND_OUTPUT>
-
-</SCENARIO>
\ No newline at end of file
+++ /dev/null
-####################################################################
-# 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 <name> with sample outputs
-####################################################################
-<SCENARIO>
-ListInfoTest
-
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-lttng version 2.1.0 - Basse Messe
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_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 <session_name> for more details
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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]
- * (type: tracepoint) [enabled]
-
-</COMMAND_OUTPUT>
-<COMMAND_INPUT>
-lttng list mysession1
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession1: [inactive]
- Trace path: /home/user/lttng-traces/mysession1-20120203-133225
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -u -f
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
-
-####################################################################
-# Scenario: Test "lttng list -k" with no kernel and no session daemon
-####################################################################
-<SCENARIO>
-ListInfoTestNoKernel
-
-<COMMAND_INPUT>
-lttng version
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-lttng version 2.0.0 - Annedd'ale
-Web site: http://lttng.org/
-
-lttng is free software and under the GPL license and part LGPL
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Currently no available tracing session
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -k
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-1
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Error: Unable to list kernel events
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list -u
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-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)
-
-</COMMAND_OUTPUT>
-
-</SCENARIO>
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+++ /dev/null
-bin
-@dot
-javaCompiler...args
-build.xml
-target
+++ /dev/null
-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
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.linuxtools.lttng2.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
+++ /dev/null
-eclipse.preferences.version=1
-line.separator=\n
+++ /dev/null
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
-org.eclipse.jdt.core.compiler.problem.deadCode=error
-org.eclipse.jdt.core.compiler.problem.deprecation=error
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
-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=ignore
-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=error
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
-org.eclipse.jdt.core.compiler.source=1.7
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=false
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=250
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+++ /dev/null
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_tmf-style
-formatter_settings_version=12
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=false
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=false
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+++ /dev/null
-ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
-ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
-API_USE_SCAN_FIELD_SEVERITY=Error
-API_USE_SCAN_METHOD_SEVERITY=Error
-API_USE_SCAN_TYPE_SEVERITY=Error
-CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
-CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
-CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
-CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
-CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
-ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
-ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
-ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
-FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
-FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
-FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
-FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
-ILLEGAL_EXTEND=Warning
-ILLEGAL_IMPLEMENT=Warning
-ILLEGAL_INSTANTIATE=Warning
-ILLEGAL_OVERRIDE=Warning
-ILLEGAL_REFERENCE=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-INVALID_JAVADOC_TAG=Warning
-INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
-LEAK_EXTEND=Warning
-LEAK_FIELD_DECL=Warning
-LEAK_IMPLEMENT=Warning
-LEAK_METHOD_PARAM=Warning
-LEAK_METHOD_RETURN_TYPE=Warning
-METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
-METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-MISSING_EE_DESCRIPTIONS=Ignore
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
-UNUSED_PROBLEM_FILTERS=Warning
-automatically_removed_unused_problem_filters=false
-eclipse.preferences.version=1
-incompatible_api_component_version=Error
-incompatible_api_component_version_include_major_without_breaking_change=Disabled
-incompatible_api_component_version_include_minor_without_api_change=Disabled
-invalid_since_tag_version=Error
-malformed_since_tag=Error
-missing_since_tag=Error
-report_api_breakage_when_major_version_incremented=Disabled
-report_resolution_errors_api_component=Warning
+++ /dev/null
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=1
-compilers.p.build.bin.includes=1
-compilers.p.build.encodings=2
-compilers.p.build.java.compiler=2
-compilers.p.build.java.compliance=1
-compilers.p.build.missing.output=2
-compilers.p.build.output.library=1
-compilers.p.build.source.library=1
-compilers.p.build.src.includes=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=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=2
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
+++ /dev/null
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 3.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ui;singleton:=true
-Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.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.core;bundle-version="3.0.0",
- org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
- org.eclipse.linuxtools.tmf.ui;bundle-version="3.0.0"
-Export-Package: org.eclipse.linuxtools.internal.lttng2.ui;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.ui.views.control;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui,org.eclipse.linuxtools.lttng2.ui.tests,org.eclipse.linuxtools.lttng2.kernel.ui.swtbot.tests",
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;x-internal:=true,
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.logging;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages;x-internal:=true,
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.model;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
- org.eclipse.linuxtools.internal.lttng2.ui.views.control.service;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests"
-Import-Package: 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
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-###############################################################################
-# Copyright (c) 2013 Ericsson
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms 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
+++ /dev/null
-###############################################################################
-# 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.ui
-Bundle-Vendor = Eclipse Linux Tools
-Bundle-Name = Linux Tools LTTng 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.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
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- id="org.eclipse.linuxtools.lttng2.ui.views"
- point="org.eclipse.ui.views">
- <category
- id="org.eclipse.linuxtools.lttng2.ui.views.category"
- name="%views.category.name">
- </category>
- <view
- allowMultiple="false"
- category="org.eclipse.linuxtools.lttng2.ui.views.category"
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView"
- icon="icons/eview16/control_view.gif"
- id="org.eclipse.linuxtools.internal.lttng2.ui.views.control"
- name="%control.view.name"
- restorable="true">
- </view>
- </extension>
-
- <extension
- point="org.eclipse.ui.commands">
- <category
- description="%commands.control.category.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- name="%commands.control.category">
- </category>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.new.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.newConnection"
- name="%commands.control.new">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.connect.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.connect"
- name="%commands.control.connect">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.disconnect.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disconnect"
- name="%commands.control.disconnect">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.refresh.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.refresh"
- name="%commands.control.refresh">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.delete.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.delete"
- name="%commands.control.delete">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.create.session.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.createSession"
- name="%commands.control.create.session">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.destroy.session.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.destroySession"
- name="%commands.control.destroy.session">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.import.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import"
- name="%commands.control.import">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.enable.channelOnSession.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnSession"
- name="%commands.control.enable.channelOnSession">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.enable.channelOnDomain.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnDomain"
- name="%commands.control.enable.channelOnDomain">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.enable.channel.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannel"
- name="%commands.control.enable.channel">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.disable.channel.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableChannel"
- name="%commands.control.disable.channel">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.start.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.start"
- name="%commands.control.start">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.stop.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.stop"
- name="%commands.control.stop">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.assign.event.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.assign.event"
- name="%commands.control.assign.event">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.enable.event.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEvent"
- name="%commands.control.enable.event">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.disable.event.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableEvent"
- name="%commands.control.disable.event">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.enable.eventOnChannel.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnChannel"
- name="%commands.control.enable.eventOnChannel">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.enable.eventOnDomain.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnDomain"
- name="%commands.control.enable.eventOnDomain">
- </command>
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.enable.eventOnSession.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnSession"
- name="%commands.control.enable.eventOnSession">
- </command>
-
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.add.context.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnDomain"
- name="%commands.control.add.context">
- </command>
-
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.add.context.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnChannel"
- name="%commands.control.add.context">
- </command>
-
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.add.context.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnEvent"
- name="%commands.control.add.context">
- </command>
-
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.import.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import"
- name="%commands.control.import">
- </command>
-
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.calibrate.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.calibrate"
- name="%commands.control.calibrate">
- </command>
-
- <command
- categoryId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.category"
- description="%commands.control.snapshot.description"
- id="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.snapshot"
- name="%commands.control.snapshot">
- </command>
-
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="false"
- locationURI="toolbar:org.eclipse.linuxtools.internal.lttng2.ui.views.control">
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.newConnection"
- icon="icons/elcl16/target_add.gif"
- label="%commands.control.new"
- style="push">
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.connect"
- icon="icons/elcl16/connect.gif"
- label="%commands.control.connect"
- style="push">
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disconnect"
- icon="icons/elcl16/disconnect.gif"
- label="%commands.control.disconnect"
- style="push">
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.refresh"
- icon="icons/elcl16/refresh.gif"
- label="%commands.control.refresh"
- style="push">
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.delete"
- icon="icons/elcl16/target_delete.gif"
- label="%commands.control.delete"
- style="push">
- </command>
- <separator
- name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.toolbar.separator1"
- visible="true">
- </separator>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.start"
- icon="icons/elcl16/start_trace.gif"
- label="%commands.control.start"
- style="push">
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.stop"
- icon="icons/elcl16/pause_trace.gif"
- label="%commands.control.stop"
- style="push">
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.destroySession"
- icon="icons/elcl16/delete_trace.gif"
- label="%commands.control.destroy.session"
- style="push">
- </command>
- <separator
- name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.toolbar.separator2"
- visible="true">
- </separator>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.snapshot"
- icon="icons/elcl16/snapshot.gif"
- label="%commands.control.snapshot"
- style="push">
- </command>
- <separator
- name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.toolbar.separator3"
- visible="true">
- </separator>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import"
- icon="icons/elcl16/import_trace.gif"
- label="%commands.control.import"
- style="push">
- </command>
-
- </menuContribution>
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.linuxtools.internal.lttng2.ui.views.control">
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.connect"
- icon="icons/elcl16/connect.gif"
- label="%commands.control.connect"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disconnect"
- icon="icons/elcl16/disconnect.gif"
- label="%commands.control.disconnect"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.refresh"
- icon="icons/elcl16/refresh.gif"
- label="%commands.control.refresh"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.delete"
- icon="icons/elcl16/target_delete.gif"
- label="%commands.control.delete"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.createSession"
- icon="icons/elcl16/add_button.gif"
- label="%commands.control.create.session"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.start"
- icon="icons/elcl16/start_trace.gif"
- label="%commands.control.start"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.stop"
- icon="icons/elcl16/pause_trace.gif"
- label="%commands.control.stop"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.destroySession"
- icon="icons/elcl16/delete_trace.gif"
- label="%commands.control.destroy.session"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <separator
- name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.popup.separator1"
- visible="true">
- </separator>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import"
- icon="icons/elcl16/import_trace.gif"
- label="%commands.control.import"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
- <separator
- name="org.eclipse.linuxtools.internal.lttng2.ui.views.control.popup.separator2"
- visible="true">
- </separator>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnSession"
- icon="icons/elcl16/add_button.gif"
- label="%commands.control.enable.channelOnSession"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- <not>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent">
- </instanceof>
- </iterate>
- </not>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnSession"
- icon="icons/obj16/event_enabled.gif"
- label="%commands.control.enable.eventOnDomain"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnDomain"
- icon="icons/elcl16/add_button.gif"
- label="%commands.control.enable.channelOnDomain"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent">
- </instanceof>
- </iterate>
- <not>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </not>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnDomain"
- icon="icons/elcl16/enable_event.gif"
- label="%commands.control.enable.eventOnDomain"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent">
- </instanceof>
- </iterate>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannel"
- icon="icons/elcl16/enable.gif"
- label="%commands.control.enable.channel"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableChannel"
- icon="icons/elcl16/disable.gif"
- label="%commands.control.disable.channel"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
-
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.assign.event"
- icon="icons/elcl16/enable_event.gif"
- label="%commands.control.assign.event"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
-
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEvent"
- icon="icons/elcl16/enable_event.gif"
- label="%commands.control.enable.event"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
-
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableEvent"
- icon="icons/elcl16/disable_event.gif"
- label="%commands.control.disable.event"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnChannel"
- icon="icons/elcl16/enable_event.gif"
- label="%commands.control.enable.eventOnChannel"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent">
- </instanceof>
- </iterate>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnDomain"
- icon="icons/elcl16/add-context.gif"
- label="%commands.control.add.context"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent">
- </instanceof>
- </iterate>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnChannel"
- icon="icons/elcl16/add-context.gif"
- label="%commands.control.add.context"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent">
- </instanceof>
- </iterate>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnEvent"
- icon="icons/elcl16/add-context.gif"
- label="%commands.control.add.context"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <count
- value="1">
- </count>
- <iterate
- ifEmpty="false"
- operator="and">
- <and>
- <or>
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent">
- </instanceof>
- </or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.isAddContextOnEventSupported">
- </test>
- </and>
- </iterate>
- </and>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.calibrate"
- icon="icons/elcl16/calibrate.gif"
- label="%commands.control.calibrate"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent">
- </instanceof>
- </iterate>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
-
- <command
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.snapshot"
- icon="icons/elcl16/snapshot.gif"
- label="%commands.control.snapshot"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- <count
- value="1">
- </count>
- </and>
- </with>
- </visibleWhen>
- </command>
-
- </menuContribution>
-
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.NewConnectionHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.newConnection">
- <activeWhen>
- <with
- variable="activePart">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView">
- </instanceof>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.ConnectHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.connect">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.DisconnectHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disconnect">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.RefreshHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.refresh">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.DeleteHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.delete">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.CreateSessionHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.createSession">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.DestroySessionHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.destroySession">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.ImportHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.import">
- <activeWhen>
- <with
- variable="selection">
- <and>
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- <count
- value="1">
- </count>
- </and>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.EnableChannelOnSessionHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnSession">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.EnableChannelOnDomainHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannelOnDomain">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.EnableChannelHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableChannel">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.DisableChannelHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableChannel">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.StartHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.start">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.StopHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.stop">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.SnaphshotHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.snapshot">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.AssignEventHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.assign.event">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.EnableEventHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEvent">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.DisableEventHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.disableEvent">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.EnableEventOnChannelHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnChannel">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.EnableEventOnDomainHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnDomain">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.EnableEventOnSessionHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.enableEventOnSession">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.AddContextOnDomainHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnDomain">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.CalibrateHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.calibrate">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.AddContextOnChannelHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnChannel">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- <handler
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.AddContextOnEventHandler"
- commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.addContextOnEvent">
- <activeWhen>
- <with
- variable="selection">
- <iterate
- operator="or">
- <instanceof
- value="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent">
- </instanceof>
- </iterate>
- </with>
- </activeWhen>
- </handler>
-
- </extension>
-
- <extension
- point="org.eclipse.rse.core.systemTypes">
- <systemType
- description="%trace.control.rse.system.type.description"
- icon="icons/obj16/systemlttng2.gif"
- iconLive="icons/obj16/systemlttng2-live.gif"
- id="org.eclipse.linuxtools.internal.lttng2.ui.control.systemType"
- label="%trace.control.rse.system.type.name"
- name="org.eclipse.linuxtools.internal.lttng2.ui.control.systemType"
- subsystemConfigurationIds="ssh.shells;ssh.files;ssh.terminals;processes.shell.linux">
- </systemType>
- </extension>
-
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- category="org.eclipse.linuxtools.tmf.ui.TmfTracingPreferences"
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferencePage"
- id="org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences"
- name="%preference.page.control.name">
- </page>
- </extension>
- <extension
- point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferenceInitializer">
- </initializer>
- </extension>
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlPropertyTester"
- id="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.propertyTester"
- namespace="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model"
- properties="isAddContextOnEventSupported"
- type="org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent">
- </propertyTester>
- </extension>
-
-
-</plugin>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (C) 2011, Red Hat, Inc.
-
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
--->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>linuxtools-lttng-parent</artifactId>
- <groupId>org.eclipse.linuxtools.lttng</groupId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>org.eclipse.linuxtools.lttng2.ui</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-
- <name>Linux Tools LTTng UI Plug-in</name>
-
- <build>
- <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 -->
- <resources>
- <resource>
- <directory>src</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-source-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <groupId>org.eclipse.linuxtools.lttng2</groupId>
-</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.internal.lttng2.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.ui.views.control.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.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());
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- ControlPreferences.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));
- }
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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.ui.views.control;
-
-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.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponentChangedListener;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlContentProvider;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlLabelProvider;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * View implementation for Trace Control.
- * </p>
- *
- * @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.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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * Dialog box for collecting information about contexts to be added to channels/events.
- * </p>
- *
- * @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<String> 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<String> contexts) {
- fContextModel.setAvalibleContexts(contexts);
- }
-
- @Override
- public List<String> getContexts() {
- List<String> 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<String> 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<Context> 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<String> contexts) {
- fAvailableContexts = new ArrayList<>();
- if (contexts != null) {
- for (Iterator<String> 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();
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * <p>
- * Confirmation dialog implementation.
- * </p>
- *
- * @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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.IRemoteSystemProxy;
-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.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-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;
-
-/**
- * <p>
- * Dialog box for collecting session creation information.
- * </p>
- *
- * @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$
-
- /**
- * Supported network protocols for streaming
- */
- private enum StreamingProtocol {
- /** Default network protocol for IPv4 (TCP)*/
- net,
- /** Default network protocol for IPv6 (TCP)*/
- net6,
- /** File */
- file,
- }
-
- 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 snapshot session
- */
- private Button fSnapshotButton = null;
- /**
- * The Group for stream configuration.
- */
- private Group fMainStreamingGroup = null;
- /**
- * The button to show streaming options.
- */
- private Button fConfigureStreamingButton = 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 = null;
- /**
- * The session path string.
- */
- private String fSessionPath = null;
- /**
- * Flag whether the session is snapshot or not
- */
- private boolean fIsSnapshot = false;
- /**
- * Flag whether default location (path) shall be used or not
- */
- private boolean fIsDefaultPath = true;
- /**
- * Flag whether the trace is streamed or not
- */
- private boolean fIsStreamedTrace = 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;
-
- // ------------------------------------------------------------------------
- // 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;
- fSessionName = null;
- fSessionPath = null;
- fIsSnapshot = false;
- fIsDefaultPath = true;
- fIsStreamedTrace = 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);
-
- fSessionPathLabel = new Label(sessionGroup, SWT.RIGHT);
- fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel);
- fSessionPathText = new Text(sessionGroup, SWT.NONE);
- fSessionPathText.setToolTipText(Messages.TraceControl_CreateSessionPathTooltip);
- fSessionPathText.addModifyListener(fUpdateEnablementModifyListener);
-
- if (fParent.isSnapshotSupported()) {
- fSnapshotButton = new Button(sessionGroup, SWT.CHECK);
- fSnapshotButton.setText(Messages.TraceControl_CreateSessionSnapshotLabel);
- fSnapshotButton.setToolTipText(Messages.TraceControl_CreateSessionSnapshotTooltip);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 4;
- fSnapshotButton.setData(data);
- }
-
- // layout widgets
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
-
- fSessionNameText.setLayoutData(data);
-
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- fSessionPathText.setLayoutData(data);
-
- if (fParent.isNetworkStreamingSupported()) {
- createAdvancedOptionsComposite();
- }
-
- return fDialogComposite;
- }
-
- private void createAdvancedOptionsComposite() {
-
- fMainStreamingGroup = new Group(fDialogComposite, SWT.SHADOW_NONE);
- fMainStreamingGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
- fMainStreamingGroup.setLayout(new GridLayout(1, true));
-
- fConfigureStreamingButton = new Button(fMainStreamingGroup, SWT.PUSH);
- fConfigureStreamingButton.setText(Messages.TraceControl_CreateSessionConfigureStreamingButtonText + " >>>"); //$NON-NLS-1$
- fConfigureStreamingButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip);
- fConfigureStreamingButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (fIsStreamedTrace) {
- fIsStreamedTrace = false;
- fConfigureStreamingButton.setText(">>> " + Messages.TraceControl_CreateSessionConfigureStreamingButtonText); //$NON-NLS-1$
- fConfigureStreamingButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip);
- fSessionPathText.setEnabled(true);
- fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel);
- disposeConfigureStreamingComposite();
- } else {
- fIsStreamedTrace = true;
- fConfigureStreamingButton.setText("<<< " + Messages.TraceControl_CreateSessionNoStreamingButtonText); //$NON-NLS-1$
- fConfigureStreamingButton.setToolTipText(Messages.TraceControl_CreateSessionNoStreamingButtonTooltip);
- fSessionPathText.setEnabled(false);
- fSessionPathText.setText(""); //$NON-NLS-1$
- fSessionPathLabel.setText(""); //$NON-NLS-1$
- createConfigureStreamingComposite();
- }
-
- updateEnablement();
- getShell().pack();
- }
- });
- }
-
- private void createConfigureStreamingComposite() {
- if (fStreamingComposite == null) {
- fStreamingComposite = new Composite(fMainStreamingGroup, SWT.NONE);
- GridLayout layout = new GridLayout(1, true);
- fStreamingComposite.setLayout(layout);
- fStreamingComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Group urlGroup = new Group(fStreamingComposite, SWT.SHADOW_NONE);
- layout = new GridLayout(7, true);
- urlGroup.setLayout(layout);
- urlGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label tracePathLabel = new Label(urlGroup, SWT.RIGHT);
- tracePathLabel.setText(Messages.TraceControl_CreateSessionTracePathText);
- fTracePathText = new Text(urlGroup, 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(urlGroup, 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(urlGroup, SWT.NONE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- label.setLayoutData(data);
-
- label = new Label(urlGroup, SWT.NONE);
- label.setText(Messages.TraceControl_CreateSessionProtocolLabelText);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- label.setLayoutData(data);
-
- label = new Label(urlGroup, SWT.NONE);
- label.setText(Messages.TraceControl_CreateSessionAddressLabelText);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 4;
- label.setLayoutData(data);
-
- label = new Label(urlGroup, SWT.NONE);
- label.setText(Messages.TraceControl_CreateSessionPortLabelText);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- label.setLayoutData(data);
-
- label = new Label(urlGroup, SWT.RIGHT);
- label.setText(Messages.TraceControl_CreateSessionControlUrlLabel);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- label.setLayoutData(data);
-
- fControlProtocolCombo = new CCombo(urlGroup, 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(urlGroup, 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(urlGroup, 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(urlGroup, SWT.RIGHT);
- label.setText(Messages.TraceControl_CreateSessionDataUrlLabel);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- label.setLayoutData(data);
-
- fDataProtocolCombo = new CCombo(urlGroup, 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);
-
- String items[] = new String[StreamingProtocol.values().length];
- for (int i = 0; i < items.length; i++) {
- items[i] = StreamingProtocol.values()[i].name();
- }
- fControlProtocolCombo.setItems(items);
- fDataProtocolCombo.setItems(items);
-
- fDataHostAddressText = new Text(urlGroup, 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(urlGroup, 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);
-
- // Get previous selection and validate
- int currentSelection = fControlProtocolCombo.getSelectionIndex() <= COMMON_URL_LAST_INDEX ?
- fControlProtocolCombo.getSelectionIndex() : DEFAULT_URL_INDEX;
-
- // Update combo box items
- fControlProtocolCombo.removeAll();
- String[] controlItems = new String[StreamingProtocol.values().length];
- for (int i = 0; i < controlItems.length; i++) {
- controlItems[i] = StreamingProtocol.values()[i].name();
- }
- fControlProtocolCombo.setItems(controlItems);
- fDataProtocolCombo.setItems(controlItems);
-
- // Set selection
- fControlProtocolCombo.select(currentSelection);
- fDataProtocolCombo.select(currentSelection);
- 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);
-
- // Update combo box items
- int currentSelection = fControlProtocolCombo.getSelectionIndex();
- fControlProtocolCombo.removeAll();
- String[] controlItems = new String[StreamingProtocol2.values().length];
- for (int i = 0; i < controlItems.length; i++) {
- controlItems[i] = StreamingProtocol2.values()[i].name();
- }
- fControlProtocolCombo.setItems(controlItems);
- fDataProtocolCombo.setItems(controlItems);
-
- // Set selection
- fControlProtocolCombo.select(currentSelection);
- fDataProtocolCombo.select(currentSelection);
-
- // 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 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 (!"".equals(fSessionPath)) { //$NON-NLS-1$
- // validate sessionPath
- if (!fIsStreamedTrace) {
- 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 (fIsStreamedTrace && fStreamingComposite != null) {
- // Validate input data
- 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);
- }
- }
-
- // 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);
-
- if (fIsStreamedTrace) {
- sessionInfo.setNetworkUrl(fNetworkUrl);
- sessionInfo.setControlUrl(fControlUrl);
- sessionInfo.setDataUrl(fDataUrl);
- sessionInfo.setStreamedTrace(true);
- } else if (!fIsDefaultPath) {
- sessionInfo.setSessionPath(fSessionPath);
- }
-
- sessionInfo.setSnapshot(fIsSnapshot);
-
- return sessionInfo;
- }
-
- private final class UpdateEnablementModifyListener implements ModifyListener {
- @Override
- public void modifyText(ModifyEvent e) {
- updateEnablement();
- }
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Simon Delisle - Updated for support of LTTng Tools 2.2
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * Dialog box for collecting channel information when enabling a channel (which will be created).
- * </p>
- *
- * @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;
- }
- }
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * Dialog box for collecting information events to be enabled.
- * </p>
- *
- * @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<String> 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();
- }
- }
- });
-
- 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;
- }
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.KernelProviderComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlContentProvider;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlLabelProvider;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * A composite for collecting information about kernel events to be enabled.
- * </p>
- *
- * @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<String> 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<String> 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<ITraceControlComponent> 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<ITraceControlComponent> 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);
- }
- }
- }
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlContentProvider;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlLabelProvider;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProviderGroup;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * A composite for collecting information about UST events to be enabled.
- * </p>
- *
- * @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<String> 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<String> 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<String> 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<ITraceControlComponent> children = ((ITraceControlComponent)parentElement).getChildren(TraceProviderGroup.class);
- return children.toArray(new ITraceControlComponent[children.size()]);
- }
- if (parentElement instanceof TraceProviderGroup) {
- List<ITraceControlComponent> 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);
- }
- }
- }
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * Dialog box for collecting information about the events to enable.
- * </p>
- *
- * @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();
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import java.util.List;
-
-/**
- * <p>
- * Interface for providing information about contexts to be added to channels/events.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public interface IAddContextDialog {
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- /**
- * Sets the available contexts to choose from.
- * @param contexts - a list of available contexts.
- */
- void setAvalibleContexts(List<String> contexts);
-
- /**
- * @return array of contexts to be added
- */
- List<String> getContexts();
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
- /**
- * @return returns the open return value
- */
- int open();
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * <p>
- * Interface for a confirmation dialog.
- * </p>
- *
- * @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);
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup;
-
-/**
- * <p>
- * Interface for create session dialog.
- * </p>
- *
- * @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();
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-
-/**
- * <p>
- * Interface for the enable channel dialog when domain is known.
- * </p>
- *
- * @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();
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProviderGroup;
-
-/**
- * <p>
- * Interface for providing information about Kernel or UST events to be enabled.
- * </p>
- *
- * @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();
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import java.util.List;
-
-/**
- * <p>
- * Interface for providing information about kernel events to be enabled.
- * </p>
- *
- * @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<String> 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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-
-/**
- * <p>
- * Interface for providing information about UST events to be enabled.
- * </p>
- *
- * @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<String> 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();
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-
-/**
- * <p>
- * Interface for a dialog box for collecting information about the events to enable.
- * </p>
- *
- * @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();
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-/**
- * <p>
- * Interface for dialog box for updating file import information.
- * </p>
- *
- * @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();
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-
-/**
- * <p>
- * Interface for import traces dialog.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public interface IImportDialog {
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
- /**
- * @return a list of trace paths to import.
- */
- List<ImportFileInfo> 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();
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.rse.core.model.IHost;
-
-/**
- * <p>
- * Interface for connection information dialog.
- * </p>
- *
- * @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();
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * Dialog box for collecting session creation information.
- * </p>
- *
- * @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();
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.IRemoteSystemProxy;
-import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceFolder;
-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;
-
-/**
- * <p>
- * Dialog box for collecting trace import information.
- * </p>
- *
- * @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$
-
- /** Default name of kernel traces */
- public static final String DEFAULT_KERNEL_TRACE_NAME = "kernel"; //$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<IProject> 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<ImportFileInfo> 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<ImportFileInfo> getTracePathes() {
- List<ImportFileInfo> 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(TmfTraceFolder.TRACE_FOLDER_NAME);
-
- if (!traceFolder.exists()) {
- // Invalid LTTng 2.0 project
- MessageDialog.openError(getShell(),
- Messages.TraceControl_ImportDialogTitle,
- Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTraceFolder.TRACE_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();
- boolean isKernel = false;
- if (trace.getName().equals(DEFAULT_KERNEL_TRACE_NAME)) {
- isKernel = true;
- }
- StringBuffer traceName = new StringBuffer();
- traceName.append(trace.getName());
- traceName.insert(0, '-');
-
- String path = fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getSnapshotPath() : fSession.getSessionPath();
- path = getUnifiedPath(path);
- String parentPath = getUnifiedPath(parent.getAbsolutePath());
-
- while (!parentPath.equals(path)) {
- traceName.insert(0, parent.getName());
- traceName.insert(0, '-');
- parent = parent.getParentRemoteFile();
- parentPath = getUnifiedPath(parent.getAbsolutePath());
- }
- traceName.insert(0, parent.getName());
-
- ImportFileInfo info = new ImportFileInfo(trace, traceName.toString(), overwriteAll, isKernel);
- IFolder folder = traceFolder.getFolder(traceName.toString());
-
- // 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(traceName.toString());
-
- // 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<String> 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();
- }
- }
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
-
-/**
- * <p>
- * Helper class for storing information about a remote file to import.
- * </p>
- *
- * @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;
-
- private boolean fIsKernel;
-
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
- /**
- * Standard constructor
- *
- * @param file
- * A remote file reference
- * @param traceName
- * A trace name
- * @param isOverwrite
- * global overwrite flag
- * @param isKernel
- * <code>true</code> if it is a kernel trace else
- * <code>false</code>
- */
- public ImportFileInfo(IRemoteFile file, String traceName, boolean isOverwrite, boolean isKernel) {
- fRemoteFile = file;
- fLocalTraceName = traceName;
- fIsOverwrite = isOverwrite;
- fIsKernel = isKernel;
- }
-
- // ------------------------------------------------------------------------
- // 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 whether it is a kernel trace or not
- *
- * @return <code>true</code> if it is a kernel trace else <code>false</code>
- */
- public boolean isKernel() {
- return fIsKernel;
- }
-
- /**
- * Sets whether it is a kernel trace or not
- *
- * @param isKernel
- * <code>true</code> for kernel trace else <code>false</code>
- */
- public void setKernel(boolean isKernel) {
- fIsKernel = isKernel;
- }
-}
-
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * Dialog box for connection information.
- * </p>
- *
- * @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();
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
-
-import org.eclipse.ui.PlatformUI;
-
-/**
- * <p>
- * Factory for generating dialog boxes. It allows to overwrite the dialog implementation.
- * Useful also for testing purposes.
- * </p>
- *
- * @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 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;
- }
-
- /**
- * 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;
- }
-}
-
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to add contexts to a given channel and all of its events.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class AddContextOnChannelHandler extends BaseAddContextHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- public void addContexts(CommandParameter param, List<String> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to add contexts to all channels and all events.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class AddContextOnDomainHandler extends BaseAddContextHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- public void addContexts(CommandParameter param, List<String> 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;
- }
-
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to add contexts to a given event.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class AddContextOnEventHandler extends BaseAddContextHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- public void addContexts(CommandParameter param, List<String> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IGetEventInfoDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.KernelProviderComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.UstProviderComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to assign events to a session and channel and enable/configure them.
- * This is done on the trace provider level.
- * </p>
- *
- * @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<String> eventNames = new ArrayList<>();
- List<BaseEventComponent> events = param.getEvents();
- // Create list of event names
- for (Iterator<BaseEventComponent> 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<BaseEventComponent> 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<BaseEventComponent> 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<BaseEventComponent> 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<BaseEventComponent> getEvents() {
- return fEvents;
- }
-
- public boolean isKernel() {
- return fIsKernel;
- }
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IAddContextDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * <p>
- * Base command handler implementation to add contexts.
- * </p>
- *
- * @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<String> 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<String> 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<String> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * <p>
- * Abstract Command handler implementation for all control view handlers.
- * </p>
- *
- * @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
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableChannelDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-
-/**
- * <p>
- * Base implementation of a command handler to enable a trace channel.
- * </p>
- *
- * @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<String> 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<String> 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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableEventsDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProviderGroup;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * <p>
- * Base command handler implementation to enable events.
- * </p>
- *
- * @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<String> 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<ITraceControlComponent> 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<String> 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<String> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to delete a target host.
- * </p>
- *
- * @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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * <p>
- * Command handler implementation to execute command calibrate to quantify LTTng overhead.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * <p>
- * Abstract command handler implementation to enable or disabling a trace channel.
- * </p>
- *
- * @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<String> 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<TraceChannelComponent> kernelChannels = param.getKernelChannels();
-
- if (kernelDomain != null) {
- session = (TraceSessionComponent)kernelDomain.getParent();
- List<String> channelNames = new ArrayList<>();
- for (Iterator<TraceChannelComponent> 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<TraceChannelComponent> iterator = kernelChannels.iterator(); iterator.hasNext();) {
- // Enable all selected channels which are disabled
- TraceChannelComponent channel = iterator.next();
- channel.setState(getNewState());
- }
- }
-
- TraceDomainComponent ustDomain = param.getUstDomain();
- List<TraceChannelComponent> ustChannels = param.getUstChannels();
- if (ustDomain != null) {
- if (session == null) {
- session = (TraceSessionComponent)ustDomain.getParent();
- }
-
- List<String> channelNames = new ArrayList<>();
- for (Iterator<TraceChannelComponent> 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<TraceChannelComponent> 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<TraceChannelComponent> kernelChannels = new ArrayList<>();
- List<TraceChannelComponent> 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<TraceChannelComponent> fKernelChannels;
- /**
- * The list of UST channel components the command is to be executed on.
- */
- protected final List<TraceChannelComponent> 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<TraceChannelComponent> kernelChannels, List<TraceChannelComponent> 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<TraceChannelComponent> getKernelChannels() {
- return fKernelChannels;
- }
-
- /**
- * @return the list of UST channel components.
- */
- public List<TraceChannelComponent> getUstChannels() {
- return fUstChannels;
- }
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * <p>
- * Base Command handler implementation to enable or disabling a trace channel.
- * </p>
- *
- * @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<String> 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<String> eventNames = new ArrayList<>();
- List<TraceEventComponent> events = param.getEvents();
-
- for (Iterator<TraceEventComponent> 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<TraceEventComponent> 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<TraceEventComponent> 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<TraceEventComponent> fEvents = new ArrayList<>();
-
- /**
- * Constructor
- * @param channel - a channel component
- * @param events - a list of event components
- */
- public Parameter(TraceChannelComponent channel, List<TraceEventComponent> 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<TraceEventComponent> getEvents() {
- return fEvents;
- }
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * <p>
- * Abstract command handler implementation to start or stop one or more trace sessions.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public abstract class ChangeSessionStateHandler extends BaseControlViewHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
- /**
- * The list of session components the command is to be executed on.
- */
- protected List<TraceSessionComponent> 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<TraceSessionComponent> sessions = new ArrayList<>();
- sessions.addAll(fSessions);
-
- Job job = new Job(Messages.TraceControl_ChangeSessionStateJob) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- for (Iterator<TraceSessionComponent> 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<TraceSessionComponent> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
-
-/**
- * <p>
- * Command handler implementation to connect to a target host.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.ICreateSessionDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to create a trace session.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-
-/**
- * <p>
- * Command handler implementation to delete a target host.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IConfirmDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * <p>
- * Command handler implementation to destroy one or more trace sessions.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class DestroySessionHandler extends BaseControlViewHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
- /**
- * The list of session components the command is to be executed on.
- */
- private final List<TraceSessionComponent> 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();
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-
-/**
- * <p>
- * Command handler implementation to disable one or more trace channels per session and domain.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class DisableChannelHandler extends ChangeChannelStateHandler {
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- @Override
- protected TraceEnablement getNewState() {
- return TraceEnablement.DISABLED;
- }
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- protected void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException {
- domain.disableChannels(channelNames, monitor);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-
-/**
- * <p>
- * Command handler implementation to disable one or more events session, domain and channel.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class DisableEventHandler extends ChangeEventStateHandler {
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- @Override
- protected TraceEnablement getNewState() {
- return TraceEnablement.DISABLED;
- }
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- protected void changeState(TraceChannelComponent channel, List<String> eventNames, IProgressMonitor monitor) throws ExecutionException{
- channel.disableEvent(eventNames, monitor);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
-
-/**
- * <p>
- * Command handler implementation to disconnect from a target host.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-
-/**
- * <p>
- * Command handler implementation to enable one or more trace channels per session and domain.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class EnableChannelHandler extends ChangeChannelStateHandler {
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- @Override
- protected TraceEnablement getNewState() {
- return TraceEnablement.ENABLED;
- }
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- protected void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException {
- domain.enableChannels(channelNames, null, monitor);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to enable a trace channel for known domain.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class EnableChannelOnDomainHandler extends BaseEnableChannelHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- public void enableChannel(CommandParameter param, List<String> 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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to enable a trace channel for unknown domain
- * (on session level).
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- @Override
- public void enableChannel(CommandParameter param, List<String> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-
-/**
- * <p>
- * Command handler implementation to enable one or more events session, domain and channel.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class EnableEventHandler extends ChangeEventStateHandler {
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- @Override
- protected TraceEnablement getNewState() {
- return TraceEnablement.ENABLED;
- }
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- protected void changeState(TraceChannelComponent channel, List<String> eventNames, IProgressMonitor monitor) throws ExecutionException{
- channel.enableEvents(eventNames, monitor);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to enable events for a known channel.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class EnableEventOnChannelHandler extends BaseEnableEventHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- public void enableEvents(CommandParameter param, List<String> 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;
- }
-}
-
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to enable events for a known domain and default channel 'channel0'
- * (which will be created if doesn't exist).
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class EnableEventOnDomainHandler extends BaseEnableEventHandler {
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- public void enableEvents(CommandParameter param, List<String> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to enable events for a known session and default channel 'channel0'
- * (which will be created if doesn't exist).
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class EnableEventOnSessionHandler extends BaseEnableEventHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- public void enableEvents(CommandParameter param, List<String> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.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.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.core.runtime.URIUtil;
-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.jface.wizard.WizardDialog;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IImportDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.ImportFileInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
-import org.eclipse.linuxtools.tmf.core.project.model.TmfTraceType;
-import org.eclipse.linuxtools.tmf.core.project.model.TraceTypeHelper;
-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.TmfTraceFolder;
-import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceTypeUIUtils;
-import org.eclipse.linuxtools.tmf.ui.project.wizards.importtrace.BatchImportTraceWizard;
-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.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * <p>
- * Command handler implementation to import traces from a (remote) session to a tracing project.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class ImportHandler extends BaseControlViewHandler {
-
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
- /** Trace Type ID for LTTng Kernel traces */
- private static final String LTTNG_KERNEL_TRACE_TYPE = "org.eclipse.linuxtools.lttng2.kernel.tracetype"; //$NON-NLS-1$
- /** Trace Type ID for Generic CTF traces */
- private static final String GENERIC_CTF_TRACE_TYPE = "org.eclipse.linuxtools.tmf.ui.type.ctf"; //$NON-NLS-1$
- /** Name of default project to import traces to */
- public static final String DEFAULT_REMOTE_PROJECT_NAME = "Remote"; //$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().isStreamedTrace()) {
- // Streamed trace
- TmfProjectElement projectElement = TmfProjectRegistry.getProject(project, true);
- TmfTraceFolder traceFolder = projectElement.getTracesFolder();
-
- BatchImportTraceWizard wizard = new BatchImportTraceWizard();
- 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<ImportFileInfo> traces = dialog.getTracePathes();
- IProject selectedProject = dialog.getProject();
- for (Iterator<ImportFileInfo> iterator = traces.iterator(); iterator.hasNext();) {
- try {
- ImportFileInfo remoteFile = iterator.next();
-
- downloadTrace(remoteFile, selectedProject, monitor);
-
- // Set trace type
- IFolder traceFolder = selectedProject.getFolder(TmfTraceFolder.TRACE_FOLDER_NAME);
-
- if (monitor.isCanceled()) {
- status.add(Status.CANCEL_STATUS);
- break;
- }
-
- IResource file = traceFolder.findMember(remoteFile.getLocalTraceName());
-
- TraceTypeHelper helper = null;
-
- if (remoteFile.isKernel()) {
- helper = TmfTraceType.getInstance().getTraceType(LTTNG_KERNEL_TRACE_TYPE);
- } else {
- helper = TmfTraceType.getInstance().getTraceType(GENERIC_CTF_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.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(TmfTraceFolder.TRACE_FOLDER_NAME);
- if (!traceFolder.exists()) {
- throw new ExecutionException(Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTraceFolder.TRACE_FOLDER_NAME + ")"); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- String traceName = trace.getLocalTraceName();
- IFolder folder = traceFolder.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()).toString();
- 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);
- }
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.INewConnectionDialog;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * Command handler for creation new connection for trace control.
- * </p>
- *
- * @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<IHost> result = new ArrayList<>();
- ArrayList<IHost> shellConnections = new ArrayList<>(
- Arrays.asList(RSECorePlugin.getTheSystemRegistry()
- .getHostsBySubSystemConfigurationCategory("shells"))); //$NON-NLS-1$
-
- for (IHost connection : shellConnections) {
- if (!connection.getSystemType().isLocal()) {
- 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to refresh node configuration.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2013, 2014 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to record a snapshot.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class SnaphshotHandler extends BaseControlViewHandler {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
- /**
- * The list of session components the command is to be executed on.
- */
- protected List<TraceSessionComponent> fSessions = new ArrayList<>();
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- fLock.lock();
- try {
- // Make a copy for thread safety
- final List<TraceSessionComponent> 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<TraceSessionComponent> 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<TraceSessionComponent> 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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-
-/**
- * <p>
- * Command handler implementation to start one or more trace sessions.
- * </p>
- *
- * @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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-
-/**
- * <p>
- * Command handler implementation to stop one or more trace sessions.
- * </p>
- *
- * @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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.logging;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-
-/**
- * <p>
- * Class to log control commands.
- * </p>
- *
- * @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;
- }
-}
-
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- *******************************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * <p>
- * Messages file for the trace control package.
- * </p>
- *
- * @author Bernd Hufmann
- */
-@SuppressWarnings("javadoc")
-final public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.messages"; //$NON-NLS-1$
-
- public static String EnableChannelDialog_DefaultMessage;
-
- // 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_UnsupportedVersionError;
- public static String TraceControl_GettingVersionError;
-
- // 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_CreateSessionSnapshotLabel;
- public static String TraceControl_CreateSessionSnapshotTooltip;
-
- 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_InvalidSessionNameError;
- public static String TraceControl_SessionAlreadyExistsError;
- public static String TraceControl_SessionPathAlreadyExistsError;
- public static String TraceControl_InvalidSessionPathError;
- 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_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_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;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
+++ /dev/null
-###############################################################################
-# Copyright (c) 2012, 2013 Ericsson.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Bernd Hufmann - initial API and implementation
-###############################################################################
-
-EnableChannelDialog_DefaultMessage=Default
-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_UnsupportedVersionError=Unsupported LTTng Tracer Control version
-TraceControl_GettingVersionError=Could not get version of LTTng Tracer Control
-
-# Commands
-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_CreateSessionSnapshotLabel=Snapshot Mode
-TraceControl_CreateSessionSnapshotTooltip=Configure session in snapshot 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_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_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_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_UstGlobalDomainDisplayName=UST global
-TraceControl_UstDisplayName=UST
-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
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * <p>
- * Interface for trace control components that can be displayed in the
- * trace control tree viewer.
- * </p>
- *
- * @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<ITraceControlComponent> 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<ITraceControlComponent> getChildren(Class<? extends ITraceControlComponent> 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);
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model;
-
-/**
- * <p>
- * Listener interface a class can implement to be notified about changes
- * of components
- * </p>
- *
- * @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);
-}
-
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BaseEventPropertySource;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * <p>
- * Implementation of the base trace event component.
- * </p>
- *
- * @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
- // ------------------------------------------------------------------------
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.KernelProviderPropertySource;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * <p>
- * Implementation of the Kernel provider component.
- * </p>
- *
- * @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<IBaseEventInfo> eventInfos) {
- for (Iterator<IBaseEventInfo> 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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TargetNodePropertySource;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandShell;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.IRemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.RemoteSystemProxy;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * Implementation of the trace node component.
- * </p>
- *
- * @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<ITraceControlComponent> compenents = getChildren(TraceSessionGroup.class);
- if (compenents.size() > 0) {
- TraceSessionGroup group = (TraceSessionGroup)compenents.get(0);
- List<ITraceControlComponent> 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().getVersion();
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Returns if node supports filtering of events
- * @return <code>true</code> if node supports filtering else <code>false</code>
- */
- public boolean isEventFilteringSupported() {
- return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$
- }
-
- /**
- * Returns if node supports networks streaming or not
- * @return <code>true</code> if node supports filtering else <code>false</code>
- *
- */
- public boolean isNetworkStreamingSupported() {
- return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$
- }
-
- /**
- * Returns if node supports configuring buffer type or not
- * @return <code>true</code> if node supports buffer type configuration else <code>false</code>
- */
- public boolean isBufferTypeConfigSupported() {
- return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
- }
-
- /**
- * Returns if node supports trace file rotation or not
- * @return <code>true</code> if node supports trace file rotation else <code>false</code>
- */
- public boolean isTraceFileRotationSupported() {
- return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
- }
-
- /**
- * Returns if node supports periodical flush for metadata or not
- * @return <code>true</code> if node supports periodical flush for metadata else <code>false</code>
- */
- public boolean isPeriodicalMetadataFlushSupported() {
- return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
- }
- /**
- * Returns if node supports snapshots or not
- * @return <code>true</code> if it supports snapshots else <code>false</code>
- *
- */
- public boolean isSnapshotSupported() {
- return getControlService().isVersionSupported("2.3.0"); //$NON-NLS-1$
- }
-
- /**
- * Returns if node supports adding contexts on event
- * @return <code>true</code> if it supports adding contexts on events else <code>false</code>
- *
- */
- 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();
- 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ProbeEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceChannelPropertySource;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-
-/**
- * <p>
- * Implementation of the trace channel component.
- * </p>
- *
- * @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<ITraceControlComponent> 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 String getOutputType() {
- return fChannelInfo.getOutputType();
- }
- /**
- * 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<String> 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<String> 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<String> 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<String> contexts, IProgressMonitor monitor)
- throws ExecutionException {
- getControlService().addContexts(getSessionName(), getName(), null,
- isKernel(), contexts, monitor);
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.core.control.model.TargetNodeState;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponentChangedListener;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * <p>
- * Base implementation for trace control component.
- * </p>
- *
- * @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<ITraceControlComponent> 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<ITraceControlComponent> children) {
- for (Iterator<ITraceControlComponent> 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<ITraceControlComponent> getChildren(Class<? extends ITraceControlComponent> clazz) {
- List<ITraceControlComponent> list = new ArrayList<>();
-
- for (Iterator<ITraceControlComponent> 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<ITraceControlComponent> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-
-/**
- * <p>
- * Tree content provider implementation for trace control view.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * <p>
- * Label provider for trace control tree viewer.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-
-/**
- * <p>
- * Root element in trace control tree.
- * </p>
- *
- * @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);
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.DomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceDomainPropertySource;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * <p>
- * Implementation of the trace domain component.
- * </p>
- *
- * @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<ITraceControlComponent> 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<String> 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<String> 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<String> 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<String> 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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceEventPropertySource;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-
-/**
- * <p>
- * Implementation of the trace channel component.
- * </p>
- *
- * @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);
- }
-
- @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<String> contexts, IProgressMonitor monitor)
- throws ExecutionException {
- getControlService().addContexts(getSessionName(), getChannelName(),
- getName(), isKernel(), contexts, monitor);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ProbeEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceProbeEventPropertySource;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-
-/**
- * <p>
- * Implementation of the trace channel component.
- * </p>
- *
- * @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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-
-/**
- * <p>
- * Implementation of the trace provider group.
- * </p>
- *
- * @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<IBaseEventInfo> eventInfos = getControlService().getKernelProvider(monitor);
-
- if (!eventInfos.isEmpty()) {
- KernelProviderComponent component = new KernelProviderComponent(Messages.TraceControl_KernelProviderDisplayName, this);
- addChild(component);
- component.setEventInfo(eventInfos);
- }
-
- List<IUstProviderInfo> allProviders = getControlService().getUstProvider(monitor);
-
- for (Iterator<IUstProviderInfo> 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 <code>true</code> if kernel provide is available or <code>false</code>
- */
- public boolean hasKernelProvider() {
- List<ITraceControlComponent> kernelList = getChildren(KernelProviderComponent.class);
- return !kernelList.isEmpty();
- }
-
- /**
- * Returns if node supports filtering of events
- * @return <code>true</code> if node supports filtering else <code>false</code>
- */
- public boolean isEventFilteringSupported() {
- return ((TargetNodeComponent)getParent()).isEventFilteringSupported();
- }
-}
-
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceSessionPropertySource;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * <p>
- * Implementation of the trace session component.
- * </p>
- *
- * @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);
- }
-
- // ------------------------------------------------------------------------
- // 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 <code>true</code> if streamed over network else <code>false</code>
- */
- public boolean isStreamedTrace() {
- return fSessionInfo.isStreamedTrace();
- }
-
- /**
- * Sets whether the trace is streamed or not
- * @param isStreamedTrace <code>true</code> if streamed over network else <code>false</code>
- */
- public void setIsStreamedTrace(boolean isStreamedTrace) {
- fSessionInfo.setStreamedTrace(isStreamedTrace);
- }
-
- /**
- * Returns whether the session is snapshot session or not
- * @return <code>true</code> if it is snapshot session else <code>false</code>
- */
- 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<ITraceControlComponent> 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 <code>true</code> if kernel provide is available or <code>false</code>
- */
- public boolean hasKernelProvider() {
- List<ITraceControlComponent> providerGroups = getTargetNode().getChildren(TraceProviderGroup.class);
- return (!providerGroups.isEmpty() ? ((TraceProviderGroup) providerGroups.get(0)).hasKernelProvider() : false);
- }
-
- /**
- * Returns if node supports filtering of events
- * @return <code>true</code> if node supports filtering else <code>false</code>
- */
- public boolean isEventFilteringSupported() {
- return ((TargetNodeComponent)getParent().getParent()).isEventFilteringSupported();
- }
-
- /**
- * Returns if node supports snapshots or not
- * @return <code>true</code> if it supports snapshots else <code>false</code>
- *
- */
- 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();
- fSessionInfo = getControlService().getSession(getName(), monitor);
-
- 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<String> 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<String> 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<String> 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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-
-/**
- * <p>
- * Implementation of the trace session group.
- * </p>
- *
- * @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 <code>true</code> if node supports filtering else <code>false</code>
- */
- public boolean isNetworkStreamingSupported() {
- return getTargetNode().isNetworkStreamingSupported();
- }
- /**
- * Returns if node supports snapshots or not
- * @return <code>true</code> if it supports snapshots else <code>false</code>
- *
- */ public boolean isSnapshotSupported() {
- return getTargetNode().isSnapshotSupported();
- }
-
- // ------------------------------------------------------------------------
- // 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.getName(), TraceSessionGroup.this);
- addChild(session);
- session.getConfigurationFromNode(monitor);
- }
- }
-
- /**
- * 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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.UstProviderInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.UstProviderPropertySource;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * <p>
- * Implementation of the UST provider component.
- * </p>
- *
- * @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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * <p>
- * A class to initialize the preferences.
- * </p>
- *
- * @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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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.ui.views.control.logging.ControlCommandLogger;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * <p>
- * Preference page implementation for configuring LTTng tracer control preferences.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences;
-
-import java.io.File;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.logging.ControlCommandLogger;
-
-/**
- * <p>
- * Singleton class to access LTTng tracer control preferences.
- * </p>
- *
- * @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();
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.property;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent;
-import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * <p>
- * Property source implementation for the base event component.
- * </p>
- *
- * @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<IPropertyDescriptor> 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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * <p>
- * Base property source implementation.
- * </p>
- *
- * @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) {
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.KernelProviderComponent;
-import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * <p>
- * Property source implementation for the kernl provider component.
- * </p>
- *
- * @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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
-import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * <p>
- * Property source implementation for the target node component.
- * </p>
- *
- * @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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
-import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * <p>
- * Property source implementation for the trace channel component.
- * </p>
- *
- * @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();
- }
- return null;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
-import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * <p>
- * Property source implementation for the trace domain component.
- * </p>
- *
- * @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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.property;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * <p>
- * Property source implementation for the trace event component.
- * </p>
- *
- * @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<IPropertyDescriptor> 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)) {
- return fEvent.getLogLevel().name();
- }
- 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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.property;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProbeEventComponent;
-import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * <p>
- * Property source implementation for the trace probe event component.
- * </p>
- *
- * @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<IPropertyDescriptor> superList = Arrays.asList(superProperties);
- ArrayList<IPropertyDescriptor> 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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.property;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * <p>
- * Property source implementation for the trace session component.
- * </p>
- *
- * @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<IPropertyDescriptor> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
-
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.UstProviderComponent;
-import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * <p>
- * Property source implementation for the UST provider component.
- * </p>
- *
- * @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;
- }
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote;
-
-import java.util.Arrays;
-
-/**
- * <p>
- * Class containing command result of remote command execution.
- * </p>
- *
- * @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];
-
- // ------------------------------------------------------------------------
- // Constructor
- // ------------------------------------------------------------------------
-
- /**
- * Constructor
- *
- * @param result
- * The result of the command
- * @param output
- * The output, as an array of strings
- */
- public CommandResult(int result, String[] output) {
- fResult = result;
- if (output != null) {
- fOutput = Arrays.copyOf(output, output.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);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferences;
-import org.eclipse.rse.services.shells.HostShellProcessAdapter;
-import org.eclipse.rse.services.shells.IHostShell;
-import org.eclipse.rse.services.shells.IShellService;
-
-/**
- * <p>
- * Implementation of remote command execution using RSE's shell service.
- * </p>
- *
- * @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 {
- fHostShell = shellService.launchShell("", new String[0], 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<CommandResult> future = new FutureTask<>(new Callable<CommandResult>() {
- @Override
- public CommandResult call() throws IOException, CancellationException {
- final ArrayList<String> result = 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) {
- result.add(nextLine);
- }
- }
- }
- }
- return new CommandResult(fReturnValue, result.toArray(new String[result.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 <start tag> <alias> <end tag> $?
- *
- * @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:
- * <start tag> <alias> <end tag> $?
- *
- * @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 <code>true</code> to retrieve command result (previous command) <code>false</code>
- * @return <code>true</code> if output line is a command alias echo result else <code>false</code>
- */
- 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 <code>true</code> if it's an echoed command line else
- * <code>false</code>
- */
- @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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- *********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote;
-
-/**
- * <p>
- * Interface for providing command execution result.
- * </p>
- *
- * @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);
-}
\ No newline at end of file
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * <p>
- * Interface for a command shell implementation
- * </p>
- *
- * @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;
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * Remote System Proxy interface.
- * </p>
- *
- * @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 <code>null</code> if not found.
- */
- IShellService getShellService();
-
- /**
- * Find the first terminal service.
- *
- * @return shell service object, or <code>null</code> if not found.
- */
- ITerminalService getTerminalService();
-
- /**
- * Find the first IShellServiceSubSystem service.
- *
- * @return shell service subsystem, or <code>null</code> if not found.
- */
- ISubSystem getShellServiceSubSystem();
-
- /**
- * Find the first ITerminalServiceSubSystem service.
- *
- * @return shell service subsystem, or <code>null</code> if not found.
- */
- ISubSystem getTerminalServiceSubSystem();
-
- /**
- * Finds the File Service Subsystem.
- *
- * @return file service subsystem, or <code>null</code> 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);
-
-}
\ No newline at end of file
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.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;
-
-/**
- * <p>
- * RemoteSystemProxy implementation.
- * </p>
- *
- * @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);
- }
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Updated for support of LTTng Tools 2.1
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-
-
-/**
-* <p>
-* Interface for LTTng trace control command service.
-* </p>
-*
-* @author Bernd Hufmann
-*/
-public interface ILttngControlService {
-
- /**
- * @return the version string.
- */
- String getVersion();
-
- /**
- * Checks if given version is supported by this ILTTngControlService implementation.
- *
- * @param version The version to check
- * @return <code>true</code> if version is supported else <code>false</code>
- */
- 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<IBaseEventInfo> 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<IUstProviderInfo> 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<IUstProviderInfo> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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;
-}
+++ /dev/null
-/**********************************************************************
- * 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
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.regex.Matcher;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IProbeEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.DomainInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.FieldInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ProbeEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SnapshotInfo;
-import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.UstProviderInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.logging.ControlCommandLogger;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferences;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandResult;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandShell;
-
-/**
- * <p>
- * Service for sending LTTng trace control commands to remote host.
- * </p>
- *
- * @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 getVersion() {
- if (fVersion == null) {
- return "Unknown"; //$NON-NLS-1$
- }
- return fVersion.toString();
- }
-
- /**
- * 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);
- }
-
- @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 <session_name> for more details
-
- ArrayList<String> 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()]);
- }
-
- @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<IChannelInfo> 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<IChannelInfo> 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<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_KERNEL);
- ICommandResult result = executeCommand(command.toString(), monitor, false);
-
- List<IBaseEventInfo> events = new ArrayList<>();
-
- if (result.getOutput() != null) {
- // Ignore the following 2 cases:
- // Spawning a session daemon
- // Error: Unable to list kernel events
- // or:
- // Error: Unable to list kernel events
- //
- int index = 0;
- while (index < result.getOutput().length) {
- String line = result.getOutput()[index];
- Matcher matcher = LTTngControlServiceConstants.LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN.matcher(line);
- if (matcher.matches()) {
- return events;
- }
- index++;
- }
- }
-
- 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<IUstProviderInfo> getUstProvider() throws ExecutionException {
- return getUstProvider(new NullProgressMonitor());
- }
-
- @Override
- public List<IUstProviderInfo> 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<IUstProviderInfo> 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.getOutput() != 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
- //
- int index = 0;
- while (index < result.getOutput().length) {
- String line = result.getOutput()[index];
- Matcher matcher = LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN.matcher(line);
- if (matcher.matches()) {
- return allProviders;
- }
- index++;
- }
- }
-
- 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<IBaseEventInfo> 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);
- }
-
- 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);
- }
-
- 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;
-
- }
-
- private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException {
-
- String newName = formatParameter(sessionInfo.getName());
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION, newName);
-
- if (sessionInfo.isSnapshotSession()) {
- command.append(LTTngControlServiceConstants.OPTION_SNAPSHOT);
- }
-
- 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());
- }
-
- 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;
- }
-
- @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[] output = result.getOutput();
-
- boolean isError = isError(result);
- if (isError && (output != null)) {
- int index = 0;
- while (index < output.length) {
- String line = output[index];
- Matcher matcher = LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN.matcher(line);
- if (matcher.matches()) {
- // Don't treat this as an error
- isError = false;
- }
- index++;
- }
- }
-
- if (isError) {
- throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- //Session <sessionName> 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 <sessionName> 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 <sessionName> stopped
-
- }
-
- @Override
- public void enableChannels(String sessionName, List<String> 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<String> 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<String> channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
-
- // no channels to enable
- if (channelNames.isEmpty()) {
- return;
- }
-
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_CHANNEL);
-
- for (Iterator<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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);
- }
-
- // ------------------------------------------------------------------------
- // 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 || (result.getOutput().length < 1)) {
- return true;
- }
-
- // Look for error pattern
- int index = 0;
- while (index < result.getOutput().length) {
- String line = result.getOutput()[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) {
- return ""; //$NON-NLS-1$
- }
- String[] output = result.getOutput();
- StringBuffer ret = new StringBuffer();
- 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<IChannelInfo> 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<IEventInfo> 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<IEventInfo> 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.setLogLevel(matcher.group(2).trim());
- eventInfo.setEventType(matcher.group(3).trim());
- eventInfo.setState(matcher.group(4));
- String filter = matcher.group(5);
- if (filter != null) {
- filter = filter.substring(1, filter.length() - 1); // remove '[' and ']'
- 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) {
- filter = filter.substring(1, filter.length() - 1); // remove '[' and ']'
- 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: <attribute Name>: <attribute value>
- *
- * @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<IBaseEventInfo> 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<IFieldInfo> 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<IFieldInfo> 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;
- }
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * 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
- **********************************************************************/
-package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service;
-
-import java.util.regex.Pattern;
-
-/**
- * <p>
- * Constants for LTTng Control Service.
- * </p>
- *
- * @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;
-
- // ------------------------------------------------------------------------
- // Command constants
- // ------------------------------------------------------------------------
- /**
- * The lttng tools command.
- */
- static final String CONTROL_COMMAND = "lttng"; //$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 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 <session>)
- */
- 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 <session>)
- */
- 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 <session>)
- */
- 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 <session>)
- * 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|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 <session>)
- */
- static final Pattern DOMAIN_KERNEL_PATTERN = Pattern.compile("=== Domain: Kernel ==="); //$NON-NLS-1$
- /**
- * Pattern to match for ust domain information (lttng list <session>)
- */
- 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 <session>)
- */
- static final Pattern BUFFER_TYPE_PATTERN = Pattern.compile("\\s*Buffer\\s+type\\:.*"); //$NON-NLS-1$
- /**
- * Pattern to match for channels section (lttng list <session>)
- */
- static final Pattern CHANNELS_SECTION_PATTERN = Pattern.compile("\\s*Channels\\:"); //$NON-NLS-1$
- /**
- * Pattern to match for channel information (lttng list <session>)
- */
- static final Pattern CHANNEL_PATTERN = Pattern.compile("\\s*-\\s+(.*)\\:\\s+\\[(enabled|disabled)\\]"); //$NON-NLS-1$
- /**
- * Pattern to match for events section information (lttng list <session>)
- */
- static final Pattern EVENT_SECTION_PATTERN = Pattern.compile("\\s*Events\\:"); //$NON-NLS-1$
- /**
- * Pattern to match for event information (lttng list <session>)
- */
- static final Pattern EVENT_PATTERN = Pattern.compile("\\s+(.*)\\s+\\(loglevel:\\s+(.*)\\s+\\(\\d*\\)\\)\\s+\\(type:\\s+(.*)\\)\\s+\\[(enabled|disabled)\\]\\s*(\\[.*\\]){0,1}.*"); //$NON-NLS-1$
- /**
- * Pattern to match a wildcarded event information (lttng list <session>)
- */
- 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 <session>)
- */
- static final Pattern PROBE_ADDRESS_PATTERN = Pattern.compile("\\s+(addr)\\:\\s+(0x[0-9a-fA-F]{1,8})"); //$NON-NLS-1$
- /**
- * Pattern to match a probe OFFSET information (lttng list <session>)
- */
- static final Pattern PROBE_OFFSET_PATTERN = Pattern.compile("\\s+(offset)\\:\\s+(0x[0-9a-fA-F]{1,8})"); //$NON-NLS-1$
- /**
- * Pattern to match a probe SYMBOL information (lttng list <session>)
- */
- static final Pattern PROBE_SYMBOL_PATTERN = Pattern.compile("\\s+(symbol)\\:\\s+(.+)"); //$NON-NLS-1$
- /**
- * Pattern to match for channel (overwite mode) information (lttng list <session>)
- */
- 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 for channel (sub-buffer size) information (lttng list <session>)
- */
- 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 <session>)
- */
- 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 <session>)
- */
- 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 <session>)
- */
- 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 <session>)
- */
- 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 <session name>)
- */
- 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 <session name>)
- */
- 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+(.*)"); //$NON-NLS-1$
- /**
- * Pattern to match snapshot path for network tracing (lttng list <session>)
- * 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|tcp6)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 2013. 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.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.ui.views.control.service;
-
-import java.util.regex.Matcher;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.logging.ControlCommandLogger;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferences;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandResult;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandShell;
-
-/**
- * <p>
- * Factory to create LTTngControlService instances depending on the version of the LTTng Trace Control
- * installed on the remote host.
- * </p>
- *
- * @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
- String command = LTTngControlServiceConstants.CONTROL_COMMAND + LTTngControlServiceConstants.COMMAND_VERSION;
-
- if (ControlPreferences.getInstance().isLoggingEnabled()) {
- ControlCommandLogger.log(command);
- }
- ICommandResult result = null;
-
- try {
- result = shell.executeCommand(command, new NullProgressMonitor());
- } catch (ExecutionException e) {
- throw new ExecutionException(Messages.TraceControl_GettingVersionError + ": " + e); //$NON-NLS-1$
- }
-
- if (ControlPreferences.getInstance().isLoggingEnabled()) {
- ControlCommandLogger.log(LTTngControlService.formatOutput(result));
- }
-
- if ((result != null) && (result.getResult() == 0) && (result.getOutput().length >= 1)) {
- 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);
- }
-}
+++ /dev/null
-/**********************************************************************
- * 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.ui.views.control.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 {
-
- /**
- * Constructor
- *
- * @param version
- * The version string
- */
- public LttngVersion(String version) {
- super(version);
- }
-
- /**
- * 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());
- }
-}
</url>
<includes
- id="org.eclipse.linuxtools.lttng2"
+ id="org.eclipse.linuxtools.lttng2.control"
version="0.0.0"
name="Linux Tracing Toolkit next generation (LTTng)"/>
+++ /dev/null
-bin
-@dot
-javaCompiler...args
-build.xml
-target
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.linuxtools.lttng2</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
+++ /dev/null
-eclipse.preferences.version=1
-line.separator=\n
+++ /dev/null
-###############################################################################
-# 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
+++ /dev/null
-###############################################################################
-# Copyright (c) 2012, 2013 Ericsson
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Ericsson - Initial API and implementation
-###############################################################################
-
-featureName=LTTng - Linux Tracing Toolkit
-
-description=Plug-ins to integrate LTTng tools into the workbench. \
-Includes the TMF (Tracing and Monitoring Framework) and CTF (Common Trace Format) features.
-
-featureProvider=Eclipse Linux Tools
-
-copyright=Copyright 2013 Ericsson
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.linuxtools.lttng2"
- label="%featureName"
- version="3.0.0.qualifier"
- provider-name="%featureProvider"
- license-feature="org.eclipse.license"
- license-feature-version="0.0.0">
-
- <description url="http://www.example.com/description">
- %description
- </description>
-
- <copyright url="http://www.example.com/copyright">
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <url>
- <update label="Linux Tools Update Site" url="http://download.eclipse.org/linuxtools/update"/>
- </url>
-
- <includes
- id="org.eclipse.linuxtools.tmf.ctf"
- version="0.0.0"/>
-
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.linuxtools.lttng2.core" version="3.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.linuxtools.tmf.core" version="3.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.linuxtools.tmf.ui" version="3.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.help"/>
- <import feature="org.eclipse.rse" version="3.1.100" match="greaterOrEqual"/>
- </requires>
-
- <plugin
- id="org.eclipse.linuxtools.lttng2.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.linuxtools.lttng2.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.linuxtools.lttng.help"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
+++ /dev/null
-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);
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (C) 2011, Red Hat, Inc.
-
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
--->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>linuxtools-lttng-parent</artifactId>
- <groupId>org.eclipse.linuxtools.lttng</groupId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>org.eclipse.linuxtools.lttng2</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <packaging>eclipse-feature</packaging>
-
- <name>Linux Tools LTTng (Linux Tracing Toolkit) Feature</name>
-
- <groupId>org.eclipse.linuxtools.lttng2</groupId>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho.extras</groupId>
- <artifactId>tycho-source-feature-plugin</artifactId>
- <executions>
- <execution>
- <id>source-feature</id>
- <phase>package</phase>
- <goals>
- <goal>source-feature</goal>
- </goals>
- <configuration>
- <excludes>
- <plugin id="org.eclipse.linuxtools.lttng.help"/>
- </excludes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-p2-plugin</artifactId>
- <version>${tycho-version}</version>
- <executions>
- <execution>
- <id>attached-p2-metadata</id>
- <phase>package</phase>
- <goals>
- <goal>p2-metadata</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
<feature id="org.eclipse.linuxtools.tracing.rcp"/>
<feature id="org.eclipse.linuxtools.lttng2.kernel"/>
<feature id="org.eclipse.linuxtools.lttng2.ust"/>
- <feature id="org.eclipse.linuxtools.lttng2"/>
+ <feature id="org.eclipse.linuxtools.lttng2.control"/>
<feature id="org.eclipse.equinox.p2.core.feature"/>
<feature id="org.eclipse.rse.local"/>
<feature id="org.eclipse.rse.dstore"/>
<module>org.eclipse.linuxtools.tmf.analysis.xml.ui</module>
<module>org.eclipse.linuxtools.tmf.analysis.xml.ui.tests</module>
- <module>org.eclipse.linuxtools.lttng2</module>
- <module>org.eclipse.linuxtools.lttng2.core</module>
- <module>org.eclipse.linuxtools.lttng2.core.tests</module>
- <module>org.eclipse.linuxtools.lttng2.ui</module>
- <module>org.eclipse.linuxtools.lttng2.ui.tests</module>
<module>org.eclipse.linuxtools.lttng.help</module>
+ <module>org.eclipse.linuxtools.lttng2.control</module>
+ <module>org.eclipse.linuxtools.lttng2.control.core</module>
+ <module>org.eclipse.linuxtools.lttng2.control.core.tests</module>
+ <module>org.eclipse.linuxtools.lttng2.control.ui</module>
+ <module>org.eclipse.linuxtools.lttng2.control.ui.tests</module>
+
<module>org.eclipse.linuxtools.lttng2.kernel</module>
<module>org.eclipse.linuxtools.lttng2.kernel.core</module>
<module>org.eclipse.linuxtools.lttng2.kernel.core.tests</module>
<module>org.eclipse.linuxtools.lttng2.ust.ui</module>
<module>org.eclipse.linuxtools.lttng2.ust.ui.tests</module>
-
<module>org.eclipse.linuxtools.gdbtrace</module>
<module>org.eclipse.linuxtools.gdbtrace.core</module>
<module>org.eclipse.linuxtools.gdbtrace.core.tests</module>