diff --git a/Dockerfile b/Dockerfile index 8fd3f1886..1496966fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,7 @@ WORKDIR /app/ RUN mvn clean install -DskipTests -FROM alpine:3.16.0 +FROM alpine:3.18.0 ENV JAVA_HOME=/opt/java-minimal ENV PATH="$PATH:$JAVA_HOME/bin" diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.classpath b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.classpath new file mode 100644 index 000000000..1015d463e --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.classpath @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.gitignore b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.gitignore new file mode 100644 index 000000000..ae3c17260 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.project b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.project new file mode 100644 index 000000000..586bb985d --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.tracecompass.incubator.gpu.core.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.core.resources.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.core.runtime.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 000000000..5a0ad22d2 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.jdt.core.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..0482be35b --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,428 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes=f +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=error +org.eclipse.jdt.core.compiler.problem.deadCode=error +org.eclipse.jdt.core.compiler.problem.deprecation=error +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=error +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=error +org.eclipse.jdt.core.compiler.problem.finalParameterBound=error +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=error +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=error +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=enabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error +org.eclipse.jdt.core.compiler.problem.parameterAssignment=error +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error +org.eclipse.jdt.core.compiler.problem.potentialNullReference=error +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=error +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +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=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=error +org.eclipse.jdt.core.compiler.problem.unusedLabel=error +org.eclipse.jdt.core.compiler.problem.unusedLocal=error +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +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_expressions_in_for_loop_header=0 +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_parameterized_type_references=0 +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=16 +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_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +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_lambda_body=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_enum_constant=insert +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_after_type_annotation=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_lambda_arrow=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_lambda_arrow=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.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +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_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.jdt.ui.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..dbbef8b06 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,60 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_tmf-test-style +formatter_settings_version=12 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=false +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=false +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=false +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.pde.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..c367d4bd0 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=0 +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=0 +compilers.p.build.src.includes=0 +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 diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/META-INF/MANIFEST.MF b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..ff4c561e6 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-SymbolicName: org.eclipse.tracecompass.incubator.gpu.core.tests +Bundle-Version: 0.1.0.qualifier +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.tracecompass.common.core, + org.eclipse.tracecompass.incubator.gpu.core, + org.junit, + org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional +Export-Package: org.eclipse.tracecompass.incubator.gpu.core.tests +Automatic-Module-Name: org.eclipse.tracecompass.incubator.gpu.core.tests diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/about.html b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/about.html new file mode 100644 index 000000000..164f781a8 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/about.html @@ -0,0 +1,36 @@ + + + + +About + + +

About This Content

+ +

November 30, 2017

+

License

+ +

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

+ +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/build.properties b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/build.properties new file mode 100644 index 000000000..2728cc2dd --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/build.properties @@ -0,0 +1,17 @@ +############################################################################### +# Copyright (c) 2024 É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 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/plugin.properties b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/plugin.properties new file mode 100644 index 000000000..b9a971800 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/plugin.properties @@ -0,0 +1,13 @@ +############################################################################### +# Copyright (c) 2024 É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 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass Incubator +Bundle-Name = Trace Compass Incubator GPU Core Tests Plug-in diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/src/org/eclipse/tracecompass/incubator/gpu/core/tests/ActivatorTest.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/src/org/eclipse/tracecompass/incubator/gpu/core/tests/ActivatorTest.java new file mode 100644 index 000000000..cee8e9449 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core.tests/src/org/eclipse/tracecompass/incubator/gpu/core/tests/ActivatorTest.java @@ -0,0 +1,122 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.tracecompass.incubator.gpu.core.tests; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.tracecompass.common.core.TraceCompassActivator; +import org.eclipse.tracecompass.incubator.internal.gpu.core.Activator; +import org.junit.Test; +import org.osgi.framework.BundleContext; + +/** + * Test the activator name. This class is there mostly to create a non empty + * test plugin + * + * @author Geneviève Bastien + */ +public class ActivatorTest extends Plugin { + // ------------------------------------------------------------------------ + // Attributes + // ------------------------------------------------------------------------ + + /** + * The plug-in ID + */ + public static final String PLUGIN_ID = "org.eclipse.tracecompass.incubator.gpu.core.tests"; //$NON-NLS-1$ + + /** + * The shared instance + */ + private static Plugin PLUGIN; + + // ------------------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------------------ + + /** + * The constructor + */ + public ActivatorTest() { + } + + // ------------------------------------------------------------------------ + // Accessors + // ------------------------------------------------------------------------ + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Plugin 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); + } + + /** + * Test Activator + */ + @Test + public void testActivator() { + TraceCompassActivator instance = Activator.getInstance(); + assertEquals("org.eclipse.tracecompass.incubator.gpu.core", instance.getPluginId()); + } + + /** + * Return a path to a file relative to this plugin's base directory + * + * @param relativePath + * The path relative to the plugin's root directory + * @return The path corresponding to the relative path in parameter + */ + public static IPath getAbsoluteFilePath(String relativePath) { + Plugin plugin = getDefault(); + if (plugin == null) { + /* + * Shouldn't happen but at least throw something to get the test to + * fail early + */ + throw new IllegalStateException(); + } + URL location = FileLocator.find(plugin.getBundle(), new Path(relativePath), null); + try { + return new Path(FileLocator.toFileURL(location).getPath()); + } catch (IOException e) { + throw new IllegalStateException(); + } + } + +} + diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/.classpath b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.classpath new file mode 100644 index 000000000..1015d463e --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.classpath @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/.gitignore b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.gitignore new file mode 100644 index 000000000..ae3c17260 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/.project b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.project new file mode 100644 index 000000000..30229e1d5 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.project @@ -0,0 +1,34 @@ + + + org.eclipse.tracecompass.incubator.gpu.core + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.core.resources.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.core.runtime.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 000000000..5a0ad22d2 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.jdt.core.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..9b22a6801 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,433 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes=f +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +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.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=error +org.eclipse.jdt.core.compiler.problem.deadCode=error +org.eclipse.jdt.core.compiler.problem.deprecation=error +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=error +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=error +org.eclipse.jdt.core.compiler.problem.finalParameterBound=error +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=error +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=error +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=enabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=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.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error +org.eclipse.jdt.core.compiler.problem.potentialNullReference=error +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=error +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=error +org.eclipse.jdt.core.compiler.problem.unusedLabel=error +org.eclipse.jdt.core.compiler.problem.unusedLocal=error +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=error +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=error +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +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_expressions_in_for_loop_header=0 +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_parameterized_type_references=0 +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=16 +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_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +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_lambda_body=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_enum_constant=insert +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_after_type_annotation=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_lambda_arrow=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_lambda_arrow=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.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +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_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.jdt.ui.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..232a3fd76 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,60 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_tmf-style +formatter_settings_version=12 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=false +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=false +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=false +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.pde.api.tools.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 000000000..3c9b07acf --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,99 @@ +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_FIELD=Ignore +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_DEFAULT_METHOD=Ignore +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_JAVADOC_TAG=Warning +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +MISSING_EE_DESCRIPTIONS=Ignore +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.pde.prefs b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..01d624df1 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=0 +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=0 +compilers.p.build.src.includes=0 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=1 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/META-INF/MANIFEST.MF b/analyses/org.eclipse.tracecompass.incubator.gpu.core/META-INF/MANIFEST.MF new file mode 100644 index 000000000..c52608e7d --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-SymbolicName: org.eclipse.tracecompass.incubator.gpu.core;singleton:=true +Bundle-Version: 0.1.0.qualifier +Bundle-Localization: plugin +Bundle-Activator: org.eclipse.tracecompass.incubator.internal.gpu.core.Activator +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.tracecompass.common.core, + org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional, + org.eclipse.tracecompass.tmf.core, + org.eclipse.tracecompass.segmentstore.core, + org.eclipse.tracecompass.analysis.timing.core, + org.eclipse.tracecompass.analysis.profiling.core +Export-Package: org.eclipse.tracecompass.incubator.gpu.core.trace, + org.eclipse.tracecompass.incubator.internal.gpu.core;x-friends:="org.eclipse.tracecompass.incubator.gpu.core.tests" +Automatic-Module-Name: org.eclipse.tracecompass.incubator.gpu.core diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/about.html b/analyses/org.eclipse.tracecompass.incubator.gpu.core/about.html new file mode 100644 index 000000000..164f781a8 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/about.html @@ -0,0 +1,36 @@ + + + + +About + + +

About This Content

+ +

November 30, 2017

+

License

+ +

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

+ +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/build.properties b/analyses/org.eclipse.tracecompass.incubator.gpu.core/build.properties new file mode 100644 index 000000000..ae7c9d8b8 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/build.properties @@ -0,0 +1,18 @@ +############################################################################### +# Copyright (c) 2024 É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 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + plugin.xml diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/plugin.properties b/analyses/org.eclipse.tracecompass.incubator.gpu.core/plugin.properties new file mode 100644 index 000000000..a3c5eca51 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/plugin.properties @@ -0,0 +1,13 @@ +############################################################################### +# Copyright (c) 2024 É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 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass Incubator +Bundle-Name = Trace Compass GPU Core Plug-in (Incubator) diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/plugin.xml b/analyses/org.eclipse.tracecompass.incubator.gpu.core/plugin.xml new file mode 100644 index 000000000..00aeb8837 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/plugin.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/analysis/GpuCallStackAnalysis.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/analysis/GpuCallStackAnalysis.java new file mode 100644 index 000000000..8b61353da --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/analysis/GpuCallStackAnalysis.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.tracecompass.incubator.gpu.core.analysis; + +import java.util.Collection; +import java.util.Collections; +import java.util.Objects; + +import org.eclipse.tracecompass.analysis.profiling.core.instrumented.InstrumentedCallStackAnalysis; +import org.eclipse.tracecompass.incubator.gpu.core.handlers.ApiEventHandler; +import org.eclipse.tracecompass.incubator.gpu.core.handlers.IGpuEventHandler; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTrace; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; +import org.eclipse.tracecompass.tmf.core.statesystem.AbstractTmfStateProvider; +import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; + +/** + * This class defines an analysis module to generate a timeline for traces from + * GPU runtimes. It will organize calls to the API, memory copies and GPU kernel + * launches in separated callstacks for each CPU thread. + */ +public class GpuCallStackAnalysis extends InstrumentedCallStackAnalysis { + + private static final String ID = "org.eclipse.tracecompass.incubator.gpu.core.analysis.callstack"; //$NON-NLS-1$ + private static final String EDGES = "EDGES"; //$NON-NLS-1$ + /** Name of the root attribute */ + public static final String ROOT = "root"; //$NON-NLS-1$ + /** Name of the sub-attribute where the name of the operation is stored */ + public static final String NAME = "name"; //$NON-NLS-1$ + /** Name of the sub-attribute where the correlation id is stored */ + public static final String CORRELATION_ID = "correlation_id"; //$NON-NLS-1$ + /** Name of the sub-attribute where the operations are stored */ + public static final String OPERATION_QUEUES = "operation_queues"; //$NON-NLS-1$ + + @Override + protected Collection getEdgeQuarks() { + ITmfStateSystem ss = getStateSystem(); + if (ss == null) { + return Collections.emptyList(); + } + int edgeQuark = ss.optQuarkAbsolute(EDGES); + if (edgeQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { + return Collections.emptyList(); + } + return ss.getSubAttributes(edgeQuark, false); + } + + @Override + protected ITmfStateProvider createStateProvider() { + return new GpuCallStackStateProvider(Objects.requireNonNull(getTrace())); + } + + private class GpuCallStackStateProvider extends AbstractTmfStateProvider { + + private final IGpuTraceEventLayout fLayout; + private IGpuEventHandler fApiEventHandler; + + public GpuCallStackStateProvider(ITmfTrace trace) { + super(trace, ID); + fLayout = ((IGpuTrace) trace).getGpuTraceEventLayout(); + fApiEventHandler = new ApiEventHandler(); + } + + @Override + public int getVersion() { + return 0; + } + + @Override + public ITmfStateProvider getNewInstance() { + return new GpuCallStackStateProvider(getTrace()); + } + + @Override + protected void eventHandle(ITmfEvent event) { + ITmfStateSystemBuilder ssb = getStateSystemBuilder(); + if (ssb == null) { + return; + } + if (fLayout.isApiEvent(event)) { + fApiEventHandler.handleEvent(event, ssb, fLayout, this); + } + } + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/analysis/package-info.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/analysis/package-info.java new file mode 100644 index 000000000..2d1bc3741 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/analysis/package-info.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +@org.eclipse.jdt.annotation.NonNullByDefault +package org.eclipse.tracecompass.incubator.gpu.core.analysis; diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/handlers/ApiEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/handlers/ApiEventHandler.java new file mode 100644 index 000000000..f7ab076cd --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/handlers/ApiEventHandler.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.tracecompass.incubator.gpu.core.handlers; + +import org.eclipse.tracecompass.analysis.profiling.core.callstack.CallStackAnalysis; +import org.eclipse.tracecompass.analysis.profiling.core.callstack.CallStackStateProvider; +import org.eclipse.tracecompass.incubator.gpu.core.analysis.GpuCallStackAnalysis; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout.IApiEventLayout; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; +import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider.FutureEventType; + +/** + * Handler for All APIs used to pilot the GPU. + * + * This handler handles all API calls that are written to call stacks. + */ +public class ApiEventHandler implements IGpuEventHandler { + + @Override + public void handleEvent(ITmfEvent event, ITmfStateSystemBuilder ssb, IGpuTraceEventLayout layout, ITmfStateProvider stateProvider) { + Long tid = event.getContent().getFieldValue(Long.class, layout.fieldThreadId()); + if (tid == null) { + return; + } + int rootQuark = ssb.getQuarkAbsoluteAndAdd(GpuCallStackAnalysis.ROOT, CallStackStateProvider.PROCESSES); + int processQuark = ssb.getQuarkRelativeAndAdd(rootQuark, tid.toString()); + + IApiEventLayout apiLayout = layout.getCorrespondingApiLayout(event); + int apiQuark = ssb.getQuarkRelativeAndAdd(processQuark, apiLayout.getApiName()); + int callStackQuark = ssb.getQuarkRelativeAndAdd(apiQuark, CallStackAnalysis.CALL_STACK); + + if (apiLayout.isBeginEvent(event)) { + ssb.pushAttribute(event.getTimestamp().getValue(), apiLayout.getEventName(event), callStackQuark); + } else { + ssb.popAttribute(event.getTimestamp().getValue(), callStackQuark); + } + if (!layout.fieldDuration().equals("")) { //$NON-NLS-1$ + Long duration = event.getContent().getFieldValue(Long.class, layout.fieldDuration()); + if (duration == null) { + duration = 1L; + } + stateProvider.addFutureEvent(event.getTimestamp().getValue() + duration, event, callStackQuark, FutureEventType.POP); + } + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/handlers/IGpuEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/handlers/IGpuEventHandler.java new file mode 100644 index 000000000..40d4bb57e --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/handlers/IGpuEventHandler.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.tracecompass.incubator.gpu.core.handlers; + +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; +import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; + +/** + * Interface to use for the event handlers. + * + * @author Arnaud Fiorini + */ +public interface IGpuEventHandler { + + /** + * Default function to handle events. + * + * @param event + * The event to handle + * @param ssb + * The state system builder + * @param layout + * The layout of the events + * @param stateProvider + * The state provider that calls this event handler + */ + public void handleEvent(ITmfEvent event, ITmfStateSystemBuilder ssb, IGpuTraceEventLayout layout, ITmfStateProvider stateProvider); +} diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/handlers/package-info.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/handlers/package-info.java new file mode 100644 index 000000000..350613a44 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/handlers/package-info.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +@org.eclipse.jdt.annotation.NonNullByDefault +package org.eclipse.tracecompass.incubator.gpu.core.handlers; diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/trace/IGpuTrace.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/trace/IGpuTrace.java new file mode 100644 index 000000000..cf7a82391 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/trace/IGpuTrace.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.tracecompass.incubator.gpu.core.trace; + +import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; + +/** + * Interface to use for traces which include GPU events and API events used to + * pilot the GPU. + * + * @author Arnaud Fiorini + */ +public interface IGpuTrace extends ITmfTrace { + + /** + * Get the event layout of this trace. Many known concepts from the Linux + * kernel may be exported under different names, depending on the tracer. + * + * @return The event layout + */ + IGpuTraceEventLayout getGpuTraceEventLayout(); +} diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/trace/IGpuTraceEventLayout.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/trace/IGpuTraceEventLayout.java new file mode 100644 index 000000000..d8cd04fb9 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/trace/IGpuTraceEventLayout.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.tracecompass.incubator.gpu.core.trace; + +import java.util.Collection; + +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; + +/** + * Interface to define the layout of the events and their fields. + * + * @author Arnaud Fiorini + */ +public interface IGpuTraceEventLayout { + + /** + * This function returns the layout for each API in this trace type. + * + * @return a collection of api event layout + */ + public abstract Collection getApiLayouts(); + + /** + * This function returns the API corresponding to the API call that this + * event describes. + * + * @param event + * the event object + * @return the api layout corresponding to that event + */ + public abstract IApiEventLayout getCorrespondingApiLayout(ITmfEvent event); + + /** + * This function returns whether or not this event is a call that will + * result in a memory copy between the host and a device or between two + * devices. + * + * @param event + * the event object + * @return whether the event corresponds to a memory copy + */ + public abstract boolean isMemcpyBegin(ITmfEvent event); + + /** + * This function returns whether or not this event is a call that will + * result in a kernel launch that will happen on a GPU. + * + * @param event + * the event object + * @return whether the event corresponds to a kernel launch + */ + public abstract boolean isLaunchBegin(ITmfEvent event); + + /** + * This function returns whether or not this event is corresponding to an + * API function call. + * + * @param event + * the event object + * @return whether the event corresponds to an API call + */ + public abstract boolean isApiEvent(ITmfEvent event); + + /** + * This API layout is used to describe the fields of the events related to + * one API. + */ + public interface IApiEventLayout { + /** + * This function returns wether or not this event describes the + * beginning of a call. + * + * @param event + * the event object + * @return whether the event timestamp is the beginning + */ + public abstract boolean isBeginEvent(ITmfEvent event); + + /** + * This function extracts the name of the event. + * + * @param event + * the event object + * @return the event name + */ + public abstract String getEventName(ITmfEvent event); + + /** + * This function returns the name of the API that this layout describes. + * + * @return the API name + */ + public abstract String getApiName(); + } + + /** + * This function returns the field to get the thread ID. + * + * @return the field name or empty string if not applicable + */ + public abstract String fieldThreadId(); + + /** + * This function returns the field to get the duration of the call. + * + * @return the field name or empty string if not applicable + */ + public abstract String fieldDuration(); +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/analysis/dependency/package-info.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/trace/package-info.java similarity index 54% rename from analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/analysis/dependency/package-info.java rename to analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/trace/package-info.java index 378d575e7..f8985320f 100644 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/analysis/dependency/package-info.java +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/gpu/core/trace/package-info.java @@ -1,12 +1,13 @@ -/********************************************************************** - * Copyright (c) 2022 École Polytechnique de Montréal +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License 2.0 which + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which * accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ + *******************************************************************************/ -package org.eclipse.tracecompass.incubator.rocm.core.analysis.dependency; +@org.eclipse.jdt.annotation.NonNullByDefault +package org.eclipse.tracecompass.incubator.gpu.core.trace; diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/internal/gpu/core/Activator.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/internal/gpu/core/Activator.java new file mode 100644 index 000000000..44f8d087d --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/internal/gpu/core/Activator.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.tracecompass.incubator.internal.gpu.core; + +import org.eclipse.tracecompass.common.core.TraceCompassActivator; + +/** + * Activator + */ +public class Activator extends TraceCompassActivator { + + /** The plug-in ID */ + public static final String PLUGIN_ID = "org.eclipse.tracecompass.incubator.gpu.core"; //$NON-NLS-1$ + + /** + * The constructor + */ + public Activator() { + super(PLUGIN_ID); + } + + /** + * Returns the instance of this plug-in + * + * @return The plugin instance + */ + public static TraceCompassActivator getInstance() { + return TraceCompassActivator.getInstance(PLUGIN_ID); + } + + @Override + protected void startActions() { + } + + @Override + protected void stopActions() { + } +} + diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/internal/gpu/core/package-info.java b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/internal/gpu/core/package-info.java new file mode 100644 index 000000000..9e8243b48 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu.core/src/org/eclipse/tracecompass/incubator/internal/gpu/core/package-info.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2024 Ecole Polytechnique de Montreal + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +@org.eclipse.jdt.annotation.NonNullByDefault +package org.eclipse.tracecompass.incubator.internal.gpu.core; diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu/.project b/analyses/org.eclipse.tracecompass.incubator.gpu/.project new file mode 100644 index 000000000..081e27259 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu/.project @@ -0,0 +1,17 @@ + + + org.eclipse.tracecompass.incubator.gpu + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu/build.properties b/analyses/org.eclipse.tracecompass.incubator.gpu/build.properties new file mode 100644 index 000000000..f05b3e5b7 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu/build.properties @@ -0,0 +1,13 @@ +############################################################################### +# Copyright (c) 2024 É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 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### + +bin.includes = feature.xml,\ + feature.properties diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu/feature.properties b/analyses/org.eclipse.tracecompass.incubator.gpu/feature.properties new file mode 100644 index 000000000..c9b4a77d3 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu/feature.properties @@ -0,0 +1,18 @@ +############################################################################### +# Copyright (c) 2024 É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 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### + +featureName=Trace Compass GPU (Incubation) + +description= + +featureProvider=Eclipse Trace Compass Incubator + +copyright=École Polytechnique de Montréal diff --git a/analyses/org.eclipse.tracecompass.incubator.gpu/feature.xml b/analyses/org.eclipse.tracecompass.incubator.gpu/feature.xml new file mode 100644 index 000000000..7d874b393 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.gpu/feature.xml @@ -0,0 +1,30 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + + + diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/META-INF/MANIFEST.MF b/analyses/org.eclipse.tracecompass.incubator.rocm.core/META-INF/MANIFEST.MF index 020c5f60e..a2b03acb6 100644 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/META-INF/MANIFEST.MF +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/META-INF/MANIFEST.MF @@ -12,23 +12,21 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, org.eclipse.tracecompass.common.core, org.eclipse.tracecompass.tmf.core, + org.eclipse.tracecompass.tmf.ctf.core, + org.eclipse.tracecompass.ctf.core, org.eclipse.tracecompass.segmentstore.core, + org.eclipse.tracecompass.statesystem.core, org.eclipse.tracecompass.analysis.timing.core, org.eclipse.tracecompass.analysis.os.linux.core, - org.eclipse.tracecompass.incubator.analysis.core, - org.eclipse.tracecompass.incubator.callstack.core, - org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional, - org.eclipse.tracecompass.tmf.ctf.core -Export-Package: org.eclipse.tracecompass.incubator.internal.rocm.core;x-friends:="org.eclipse.tracecompass.incubator.rocm.core.tests", - org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old, - org.eclipse.tracecompass.incubator.rocm.core.analysis.dependency, - org.eclipse.tracecompass.incubator.rocm.core.trace, - org.eclipse.tracecompass.incubator.rocm.core.trace.old + org.eclipse.tracecompass.analysis.profiling.core, + org.eclipse.tracecompass.analysis.counters.core, + org.eclipse.tracecompass.incubator.gpu.core, + org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional +Export-Package: org.eclipse.tracecompass.incubator.internal.rocm.core, + org.eclipse.tracecompass.incubator.rocm.core.trace Automatic-Module-Name: org.eclipse.tracecompass.incubator.rocm.ctf.core Import-Package: com.google.common.annotations, com.google.common.base, com.google.common.collect, com.google.common.hash, - org.apache.commons.lang3, - org.eclipse.tracecompass.analysis.counters.core, - org.eclipse.tracecompass.analysis.counters.core.aspects + org.apache.commons.lang3 diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/plugin.properties b/analyses/org.eclipse.tracecompass.incubator.rocm.core/plugin.properties index 3c0dfce54..df90860fc 100644 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/plugin.properties +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/plugin.properties @@ -13,3 +13,4 @@ Bundle-Vendor = Eclipse Trace Compass Incubator Bundle-Name = Trace Compass ROCm CTF Core Plug-in (Incubator) trace.rocm.old = ROCm Trace (old) +trace.rocm = ROCm Trace diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/plugin.xml b/analyses/org.eclipse.tracecompass.incubator.rocm.core/plugin.xml index 148cb7339..31d37daea 100644 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/plugin.xml +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/plugin.xml @@ -1,61 +1,23 @@ - - - - - - - - - - - - + name="Exatracer Trace" + trace_type="org.eclipse.tracecompass.incubator.rocm.core.exatracer.trace.RocmExatracerTrace"> + + - - - - - - - - - - diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/RocmCallStackAnalysis.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/RocmCallStackAnalysis.java new file mode 100644 index 000000000..f48a5dfac --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/RocmCallStackAnalysis.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis; + +import java.util.Collection; +import java.util.Collections; +import java.util.Objects; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.tracecompass.analysis.profiling.core.instrumented.InstrumentedCallStackAnalysis; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem; +import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; + +/** + * This analysis is a callstack analysis which summarizes the execution of a + * ROCm GPU program. + * + * It separates the execution into two categories: the GPU queues and the system + * API calls. Furthermore, some dependencies were modeled using arrows to show + * the user how these abstract layers relate to each other. + * + * @author Arnaud Fiorini + */ +public class RocmCallStackAnalysis extends InstrumentedCallStackAnalysis { + + private static final String EDGES = "EDGES"; //$NON-NLS-1$ + + @Override + protected @NonNull Collection getEdgeQuarks() { + ITmfStateSystem ss = getStateSystem(); + if (ss == null) { + return Collections.emptyList(); + } + int edgeQuark = ss.optQuarkAbsolute(EDGES); + if (edgeQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { + return Collections.emptyList(); + } + return ss.getSubAttributes(edgeQuark, false); + } + + @Override + protected @NonNull ITmfStateProvider createStateProvider() { + return new RocmCallStackStateProvider(Objects.requireNonNull(getTrace()), new RocmEventLayout()); + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/RocmCallStackStateProvider.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/RocmCallStackStateProvider.java new file mode 100644 index 000000000..f2d953b94 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/RocmCallStackStateProvider.java @@ -0,0 +1,102 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.ApiEventHandler; +import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.IRocmEventHandler; +import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.OperationEventHandler; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; +import org.eclipse.tracecompass.tmf.core.statesystem.AbstractTmfStateProvider; +import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; +import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; + +/** + * This state provider creates callstacks and apply different event handlers. + * There are multiple types of events, each described in their respective + * handler. + * + * Attribute tree: + * + *
+ * |- OperationQueues
+ * |  |- 
+ * |  |  |-  -> Each depth represents one operation that has been queued,
+ * |  |  |             other depths are for other queued operations.
+ * |- Root
+ * |  |- Processes
+ * |  |  |- 
+ * |  |  |  |-  -> Each API is a callstack showing which API call is executed.
+ * |  |- Queues
+ * |  |  |  |- 
+ * |  |  |  |  |-  -> Each queue implemented as a callstack with corresponding
+ * |  |  |  |  |             compute kernel activity.
+ * 
+ * + * @author Arnaud Fiorini + */ +public class RocmCallStackStateProvider extends AbstractTmfStateProvider { + + private static final String ID = "org.eclipse.tracecompass.incubator.rocm.core.stateprovider.atomic"; //$NON-NLS-1$ + /** Name of the root attribute */ + public static final String ROOT = "root"; //$NON-NLS-1$ + /** Name of the sub-attribute where the name of the operation is stored */ + public static final String NAME = "name"; //$NON-NLS-1$ + /** Name of the sub-attribute where the correlation id is stored */ + public static final String CORRELATION_ID = "correlation_id"; //$NON-NLS-1$ + /** Name of the sub-attribute where the operations are stored */ + public static final String HIP_OPERATION_QUEUES = "hip_operation_queues"; //$NON-NLS-1$ + + private final RocmEventLayout fLayout; + private IRocmEventHandler fApiEventHandler; + private IRocmEventHandler fOperationEventHandler; + + /** + * Constructor + * + * @param trace + * Trace to follow + * @param layout + * The layout of the events + */ + public RocmCallStackStateProvider(ITmfTrace trace, RocmEventLayout layout) { + super(trace, ID); + fLayout = layout; + fApiEventHandler = new ApiEventHandler(); + fOperationEventHandler = new OperationEventHandler(); + } + + @Override + public int getVersion() { + return 0; + } + + @Override + public @NonNull ITmfStateProvider getNewInstance() { + return new RocmCallStackStateProvider(getTrace(), fLayout); + } + + @Override + protected void eventHandle(ITmfEvent event) { + ITmfStateSystemBuilder ssb = getStateSystemBuilder(); + if (ssb == null) { + return; + } + if (event.getName().equals(fLayout.getHsaOperationBegin()) || event.getName().equals(fLayout.getHsaOperationEnd())) { + fOperationEventHandler.handleEvent(event, ssb, fLayout); + } else if (event.getName().equals(fLayout.getHipOperationBegin()) || event.getName().equals(fLayout.getHipOperationEnd())) { + fOperationEventHandler.handleEvent(event, ssb, fLayout); + } else if (event.getName().startsWith(fLayout.getHipPrefix()) || event.getName().startsWith(fLayout.getHsaPrefix())) { + fApiEventHandler.handleEvent(event, ssb, fLayout); + } + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/RocmEventLayout.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/RocmEventLayout.java new file mode 100644 index 000000000..1fe2699dd --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/RocmEventLayout.java @@ -0,0 +1,318 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis; + +/** + * Event Layout for ROCm events generated by the CTF plugin + * + * @author Arnaud Fiorini + */ +public class RocmEventLayout { + + /* Event name variables */ + private static final String HIP_PREFIX = "hip"; //$NON-NLS-1$ + private static final String HIP_BEGIN_SUFFIX = "Begin"; //$NON-NLS-1$ + private static final String HIP_END_SUFFIX = "End"; //$NON-NLS-1$ + private static final String HSA_PREFIX = "hsa"; //$NON-NLS-1$ + private static final String HSA_BEGIN_SUFFIX = "_begin"; //$NON-NLS-1$ + private static final String HSA_END_SUFFIX = "_end"; //$NON-NLS-1$ + private static final String HIP_OPERATION_BEGIN = "hip_op_begin"; //$NON-NLS-1$ + private static final String HIP_OPERATION_END = "hip_op_end"; //$NON-NLS-1$ + private static final String HSA_OPERATION_BEGIN = "hsa_op_begin"; //$NON-NLS-1$ + private static final String HSA_OPERATION_END = "hsa_op_end"; //$NON-NLS-1$ + + private static final String HIP_LAUNCH_PREFIX = "hipLaunch"; //$NON-NLS-1$ + private static final String HIP_EXT_LAUNCH_PREFIX = "hipExtLaunch"; //$NON-NLS-1$ + private static final String HIP_MEMCPY_PREFIX = "hipMemcpy"; //$NON-NLS-1$ + private static final String HIP_MEMCPY_BEGIN = "hipMemcpyBegin"; //$NON-NLS-1$ + private static final String HIP_MEMCPY_END = "hipMemcpyEnd"; //$NON-NLS-1$ + private static final String HIP_LAUNCH_KERNEL_BEGIN = "hipLaunchKernelBegin"; //$NON-NLS-1$ + private static final String HIP_LAUNCH_KERNEL_END = "hipLaunchKernelEnd"; //$NON-NLS-1$ + private static final String HIP_STREAM_SYNCHRONIZE_BEGIN = "hipStreamSynchronizeBegin"; //$NON-NLS-1$ + private static final String HIP_STREAM_SYNCHRONIZE_END = "hipStreamSynchronizeEnd"; //$NON-NLS-1$ + + private static final String HSA_HANDLE_TYPE = "hsa_handle_type"; //$NON-NLS-1$ + + /* Common event field names */ + private static final String THREAD_ID = "context._thread_id"; //$NON-NLS-1$ + private static final String QUEUE_ID = "context._queue_id"; //$NON-NLS-1$ + private static final String AGENT_ID = "context._agent_id"; //$NON-NLS-1$ + private static final String CORRELATION_ID = "context._correlation_id"; //$NON-NLS-1$ + + /* HIP event field names */ + private static final String KERNEL_NAME = "context._kernel_name"; //$NON-NLS-1$ + private static final String MEMCPY_KIND = "kind"; //$NON-NLS-1$ + + /* HSA event field names */ + + /* HIP operation event field names */ + private static final String OP_KERNEL_NAME = "kernel_name"; //$NON-NLS-1$ + + /* HSA operation event field names */ + + // ------------------------------------------------------------------------ + // Event names + // ------------------------------------------------------------------------ + + /** + * This event occurs after a call to hipMemcpy which initiates a memory copy + * that involves a GPU. + * + * @return the event name + */ + public String hipMemcpyBegin() { + return HIP_MEMCPY_BEGIN; + } + + /** + * This event occurs right before the call to hipMemcpy ended. + * + * @return the event name + */ + public String hipMemcpyEnd() { + return HIP_MEMCPY_END; + } + + /** + * This event occurs after a call to hipMemcpy which initiates a kernel + * launch to a ROCm Agent. + * + * @return the event name + */ + public String hipLaunchKernelBegin() { + return HIP_LAUNCH_KERNEL_BEGIN; + } + + /** + * This event occurs right before the call to hipLaunchKernel ended. + * + * @return the event name + */ + public String hipLaunchKernelEnd() { + return HIP_LAUNCH_KERNEL_END; + } + + /** + * This event occurs after a call to hipStreamSynchronize which initiates a + * barrier call on a HIP stream. + * + * @return the event name + */ + public String hipStreamSynchronizeBegin() { + return HIP_STREAM_SYNCHRONIZE_BEGIN; + } + + /** + * This event occurs right before the call to hipStreamSynchronize ended. + * + * @return the event name + */ + public String hipStreamSynchronizeEnd() { + return HIP_STREAM_SYNCHRONIZE_END; + } + + /** + * This function returns the prefix of each HIP API event name. + * + * @return the prefix + */ + public String getHipPrefix() { + return HIP_PREFIX; + } + + /** + * This function returns the suffix of each HIP API begin event name. + * + * @return the suffix + */ + public String getHipBeginSuffix() { + return HIP_BEGIN_SUFFIX; + } + + /** + * This function returns the suffix of each HIP API end event name. + * + * @return the suffix + */ + public String getHipEndSuffix() { + return HIP_END_SUFFIX; + } + + /** + * This function returns the prefix of each HSA API event name. + * + * @return the prefix + */ + public String getHsaPrefix() { + return HSA_PREFIX; + } + + /** + * This function returns the suffix of each HSA API begin event name. + * + * @return the suffix + */ + public String getHsaBeginSuffix() { + return HSA_BEGIN_SUFFIX; + } + + /** + * This function returns the suffix of each HSA API end event name. + * + * @return the suffix + */ + public String getHsaEndSuffix() { + return HSA_END_SUFFIX; + } + + /** + * This event occurs when a HIP operation has begun on one of the ROCm + * Agents. + * + * @return the event name + */ + public String getHipOperationBegin() { + return HIP_OPERATION_BEGIN; + } + + /** + * This event occurs when a HIP operation has ended on one of the ROCm + * Agents. + * + * @return the event name + */ + public String getHipOperationEnd() { + return HIP_OPERATION_END; + } + + /** + * This event occurs when a HSA operation has begun on one of the ROCm + * Agents. + * + * @return the event name + */ + public String getHsaOperationBegin() { + return HSA_OPERATION_BEGIN; + } + + /** + * This event occurs when a HSA operation has ended on one of the ROCm + * Agents. + * + * @return the event name + */ + public String getHsaOperationEnd() { + return HSA_OPERATION_END; + } + + /** + * This event is emitted during the initialization phase to identify the + * different agents during the execution. + * + * @return the event name + */ + public String getHsaHandleType() { + return HSA_HANDLE_TYPE; + } + + /** + * This event is a call that will result in a memory copy between the host + * and a device or between two devices. + * + * @param eventName + * the event name + * @return whether the event corresponds to a memory copy + */ + public boolean isMemcpyBegin(String eventName) { + return eventName.startsWith(HIP_MEMCPY_PREFIX) && eventName.endsWith(HIP_BEGIN_SUFFIX); + } + + /** + * This event is a call that will result in a kernel launch that will happen + * on a ROCm agent. + * + * @param eventName + * the event name + * @return whether the event corresponds to a kernel launch + */ + public boolean isLaunchBegin(String eventName) { + return (eventName.startsWith(HIP_LAUNCH_PREFIX) || eventName.startsWith(HIP_EXT_LAUNCH_PREFIX)) && eventName.endsWith(HIP_BEGIN_SUFFIX); + } + + // ------------------------------------------------------------------------ + // Event field names + // ------------------------------------------------------------------------ + + /** + * Field indicating the Thread ID where the event described happened. + * + * @return the field name + */ + public String fieldThreadId() { + return THREAD_ID; + } + + /** + * Field indicating the Queue ID where the event was dispatched. + * + * @return the field name + */ + public String fieldQueueId() { + return QUEUE_ID; + } + + /** + * Field indicating the Agent ID where the event has happened. + * + * @return the field name + */ + public String fieldAgentId() { + return AGENT_ID; + } + + /** + * Field indicating an identification number that match one API call to a + * HIP or HSA operation. + * + * @return the field name + */ + public String fieldCorrelationId() { + return CORRELATION_ID; + } + + /** + * Field indicating the kernel function name. + * + * @return the field name + */ + public String fieldKernelName() { + return KERNEL_NAME; + } + + /** + * Field indicating the kind of memory copy, i.e. whether it is from or to + * the host or between GPUs. + * + * @return the field name + */ + public String fieldMemcpyKind() { + return MEMCPY_KIND; + } + + /** + * Field indicating the kernel function name for operation events. + * + * @return the field name + */ + public String fieldOperationName() { + return OP_KERNEL_NAME; + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/dependency/AbstractDependencyMaker.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/dependency/AbstractDependencyMaker.java deleted file mode 100644 index 636cd8847..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/dependency/AbstractDependencyMaker.java +++ /dev/null @@ -1,73 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.dependency; - -import java.util.List; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread; -import org.eclipse.tracecompass.incubator.callstack.core.base.EdgeStateValue; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.incubator.rocm.core.analysis.dependency.IDependencyMaker; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; - -/** - * This dependency maker adds default methods for dependencies - * - * @author Arnaud Fiorini - */ -public abstract class AbstractDependencyMaker implements IDependencyMaker { - - /** - * DependencyMake constructor - */ - protected AbstractDependencyMaker() { - } - - /** - * Creates and adds an arrow to the state system - * - * @param ssb - * The state system to add the arrows - * @param startTime - * The start time of the arrow - * @param endTime - * The end time of the arrow - * @param id - * The id to identify the arrow - * @param src - * The source hostThread - * @param dest - * The destination hostThread - */ - public static void addArrow(ITmfStateSystemBuilder ssb, Long startTime, Long endTime, int id, - @NonNull HostThread src, @NonNull HostThread dest) { - int edgeQuark = getAvailableEdgeQuark(ssb, startTime); - Object edgeStateValue = new EdgeStateValue(id, src, dest); - ssb.modifyAttribute(startTime, edgeStateValue, edgeQuark); - ssb.modifyAttribute(endTime, (Object) null, edgeQuark); - } - - private static int getAvailableEdgeQuark(ITmfStateSystemBuilder ssb, long startTime) { - int edgeRoot = ssb.getQuarkAbsoluteAndAdd(RocmStrings.EDGES); - List<@NonNull Integer> subQuarks = ssb.getSubAttributes(edgeRoot, false); - - for (int quark : subQuarks) { - long start = ssb.getOngoingStartTime(quark); - Object value = ssb.queryOngoing(quark); - if (value == null && start <= startTime) { - return quark; - } - } - return ssb.getQuarkRelativeAndAdd(edgeRoot, Integer.toString(subQuarks.size())); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/dependency/HipApiHipActivityDependencyMaker.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/dependency/HipApiHipActivityDependencyMaker.java deleted file mode 100644 index 84a7d3e1e..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/dependency/HipApiHipActivityDependencyMaker.java +++ /dev/null @@ -1,262 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.dependency; - -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.PriorityQueue; -import java.util.Queue; - -import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread; -import org.eclipse.tracecompass.incubator.internal.rocm.core.Activator; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.AbstractGpuEventHandler; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.ApiEventHandler; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.HostThreadIdentifier; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.HostThreadIdentifier.KERNEL_CATEGORY; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.util.Pair; - -/** - * As the dependencies relies on specific information depending on the types of - * event that are available, one class is implemented for each use case. - * - * In this case this dependency maker works in the case where both the HIP API - * events and the HIP activity events are available. - * - * @author Arnaud Fiorini - */ -public class HipApiHipActivityDependencyMaker extends AbstractDependencyMaker { - - private final Map fApiEventCorrelationMap = new HashMap<>(); - private List fWaitEventPerThread = new LinkedList<>(); - private final Queue> fInFlightEvents = new PriorityQueue<>(new EventComparator()); - - /** - * This event comparator will sort pairs on API events and their - * corresponding activity event. This is useful to derive forward - * dependencies in the correct order. - * - * @author Arnaud Fiorini - */ - public static class EventComparator implements Comparator> { - @Override - public int compare(Pair pair1, Pair pair2) { - Long endTime1 = AbstractGpuEventHandler.getEndTime(pair1.getSecond()); - Long endTime2 = AbstractGpuEventHandler.getEndTime(pair2.getSecond()); - if (endTime1 == null || endTime2 == null) { - return -1; - } - return (int) (endTime1 - endTime2); - } - } - - @Override - public void processEvent(ITmfEvent event, ITmfStateSystemBuilder ssb) { - // Remove events that ended before this event - removeInFlightEvents(event); - // The eventName is the API function name where the event type name is - // the API name (HIP/HSA) - String eventName; - switch (event.getName()) { - case RocmStrings.HIP_API: - eventName = ApiEventHandler.getFunctionApiName(event); - // GPU Kernel dispatch - if (eventName.equals(RocmStrings.KERNEL_LAUNCH)) { - addGpuActivityDispatch(event, 7); - } - // Memory Copy dispatch - else if (eventName.equals("hipMemcpy")) { //$NON-NLS-1$ - addGpuActivityDispatch(event, 4); - } - // Wait Api Events - else if (eventName.equals(RocmStrings.HIP_DEVICE_SYNCHRONIZE)) { - addWaitDependencies(event, ssb); - } - break; - case RocmStrings.HIP_ACTIVITY: - eventName = event.getContent().getFieldValue(String.class, RocmStrings.NAME); - if (eventName != null && eventName.equals("KernelExecution")) { //$NON-NLS-1$ - addKernelDependency(event, ssb); - } else if (eventName != null && eventName.startsWith("Copy")) { //$NON-NLS-1$ - addMemoryDependency(event, ssb); - } - Long correlationId = event.getContent().getFieldValue(Long.class, RocmStrings.CORRELATION_ID); - fApiEventCorrelationMap.remove(correlationId); - break; - default: - } - } - - private void addGpuActivityDispatch(ITmfEvent event, int argPosition) { - Long correlationId = Long.parseLong(ApiEventHandler.getArg(event.getContent(), argPosition)); - fApiEventCorrelationMap.put(correlationId, event); - } - - private void addKernelDependency(ITmfEvent hipActivityEvent, ITmfStateSystemBuilder ssb) { - // Add Kernel Launch Dependency - Integer queueId = hipActivityEvent.getContent().getFieldValue(Integer.class, RocmStrings.QUEUE_ID); - Long correlationId = hipActivityEvent.getContent().getFieldValue(Long.class, RocmStrings.CORRELATION_ID); - Long gpuId = hipActivityEvent.getContent().getFieldValue(Long.class, RocmStrings.DEVICE_ID); - if (correlationId != null && queueId != null && gpuId != null) { - ITmfEvent hipEvent = fApiEventCorrelationMap.get(correlationId); - if (hipEvent == null) { - return; // no correlation - } - addInFlightEvent(hipEvent, hipActivityEvent, ssb); - Integer tid = hipEvent.getContent().getFieldValue(Integer.class, RocmStrings.TID); - if (tid == null) { - return; - } - int hipStreamId = Integer.parseInt(ApiEventHandler.getArg(hipEvent.getContent(), 4)); - HostThreadIdentifier srcHostThreadIdentifier = new HostThreadIdentifier(hipEvent, tid); - HostThreadIdentifier dstStreamHostThreadIdentifier = new HostThreadIdentifier(hipStreamId, KERNEL_CATEGORY.STREAM, gpuId.intValue()); - HostThreadIdentifier dstQueueHostThreadIdentifier = new HostThreadIdentifier(queueId.intValue(), KERNEL_CATEGORY.QUEUE, gpuId.intValue()); - // HostThreads - HostThread src = new HostThread(hipEvent.getTrace().getHostId(), srcHostThreadIdentifier.hashCode()); - HostThread destStream = new HostThread(hipEvent.getTrace().getHostId(), dstStreamHostThreadIdentifier.hashCode()); - HostThread destQueue = new HostThread(hipEvent.getTrace().getHostId(), dstQueueHostThreadIdentifier.hashCode()); - // Arrows - Long hipStreamEventEndTimestamp = AbstractGpuEventHandler.getEndTime(hipEvent); - if (hipStreamEventEndTimestamp != null) { - addArrow(ssb, hipStreamEventEndTimestamp - 1, hipActivityEvent.getTimestamp().getValue(), - Math.toIntExact(correlationId), src, destQueue); - addArrow(ssb, hipStreamEventEndTimestamp - 1, hipActivityEvent.getTimestamp().getValue(), - Math.toIntExact(correlationId), src, destStream); - } - } - } - - private void addMemoryDependency(ITmfEvent hipActivityEvent, ITmfStateSystemBuilder ssb) { - Long correlationId = hipActivityEvent.getContent().getFieldValue(Long.class, RocmStrings.CORRELATION_ID); - if (correlationId == null) { - return; - } - ITmfEvent hipEvent = fApiEventCorrelationMap.get(correlationId); - if (hipEvent == null) { - return; // no correlation - } - addInFlightEvent(hipEvent, hipActivityEvent, ssb); - Integer tid = hipEvent.getContent().getFieldValue(Integer.class, RocmStrings.TID); - if (tid == null) { - return; - } - HostThreadIdentifier srcHostThreadIdentifier = new HostThreadIdentifier(hipEvent, tid); - HostThreadIdentifier dstHostThreadIdentifier = new HostThreadIdentifier(); - // HostThreads - HostThread src = new HostThread(hipEvent.getTrace().getHostId(), srcHostThreadIdentifier.hashCode()); - HostThread dst = new HostThread(hipEvent.getTrace().getHostId(), dstHostThreadIdentifier.hashCode()); - // Arrow - addArrow(ssb, hipEvent.getTimestamp().getValue(), hipActivityEvent.getTimestamp().getValue(), - Math.toIntExact(correlationId), src, dst); - } - - private void addInFlightEvent(ITmfEvent hipApiEvent, ITmfEvent hipActivityEvent, ITmfStateSystemBuilder ssb) { - fInFlightEvents.add(new Pair<>(hipApiEvent, hipActivityEvent)); - - Long beginTs = hipApiEvent.getTimestamp().getValue(); - Long endTs = AbstractGpuEventHandler.getEndTime(hipApiEvent); - // Check all waiting events to see if we are already waiting for this - // operation. - Iterator waitEventIterator = fWaitEventPerThread.iterator(); - while (waitEventIterator.hasNext()) { - ITmfEvent waitEvent = waitEventIterator.next(); - Long dependencyBeginTs = waitEvent.getTimestamp().getValue(); - Long dependencyEndTs = AbstractGpuEventHandler.getEndTime(waitEvent); - if (beginTs > dependencyEndTs) { - // The wait event has finished without any other activity so - // there can be no wait dependency beyond this point. - waitEventIterator.remove(); - continue; - } - if (beginTs > dependencyBeginTs) { - // The wait event had already begun before the operation was - // queued. - // Therefore there is no dependency. - continue; - } - if (beginTs < dependencyBeginTs && endTs > dependencyBeginTs) { - // AFAIK, this case should not be possible. - Activator.getInstance().logError("If you see this message, the wait dependencies behavior should be changed."); //$NON-NLS-1$ - } - addWaitDependencies(waitEvent, ssb); - } - } - - private void addWaitDependencies(ITmfEvent hipWaitEvent, ITmfStateSystemBuilder ssb) { - String apiFunctionName = ApiEventHandler.getFunctionApiName(hipWaitEvent); - - Integer waitTid = hipWaitEvent.getContent().getFieldValue(Integer.class, RocmStrings.TID); - if (waitTid == null) { - return; - } - // Add the wait event for already queued operation that we cannot make - // dependencies for yet. - if (!fWaitEventPerThread.contains(hipWaitEvent)) { - fWaitEventPerThread.add(hipWaitEvent); - } - if (apiFunctionName.equals(RocmStrings.HIP_DEVICE_SYNCHRONIZE)) { - // Make arrows for current activity - // TODO register deviceId per thread - int waitingForDevice = 0; - for (Pair inFlightEventPair : fInFlightEvents) { - Integer deviceId = inFlightEventPair.getSecond().getContent().getFieldValue(Integer.class, RocmStrings.DEVICE_ID); - if (deviceId != null && deviceId == waitingForDevice) { - int hipStreamId = Integer.parseInt(ApiEventHandler.getArg(inFlightEventPair.getFirst().getContent(), 4)); - addWaitArrow(ssb, inFlightEventPair.getSecond(), hipWaitEvent, waitTid, waitingForDevice, hipStreamId); - } - } - } - } - - private static void addWaitArrow(ITmfStateSystemBuilder ssb, ITmfEvent deviceEvent, ITmfEvent waitEvent, int waitTid, int deviceId, int hipStreamId) { - Integer queueId = deviceEvent.getContent().getFieldValue(Integer.class, RocmStrings.QUEUE_ID); - if (queueId == null) { - return; - } - HostThreadIdentifier srcHostThreadIdentifier = new HostThreadIdentifier(waitEvent, waitTid); - HostThreadIdentifier dstStreamHostThreadIdentifier = new HostThreadIdentifier(hipStreamId, KERNEL_CATEGORY.STREAM, deviceId); - HostThreadIdentifier dstQueueHostThreadIdentifier = new HostThreadIdentifier(queueId, KERNEL_CATEGORY.QUEUE, deviceId); - // HostThreads - HostThread destThread = new HostThread(waitEvent.getTrace().getHostId(), srcHostThreadIdentifier.hashCode()); - HostThread srcStream = new HostThread(deviceEvent.getTrace().getHostId(), dstStreamHostThreadIdentifier.hashCode()); - HostThread srcQueue = new HostThread(deviceEvent.getTrace().getHostId(), dstQueueHostThreadIdentifier.hashCode()); - // Arrows - Long hipStreamEventEndTimestamp = AbstractGpuEventHandler.getEndTime(waitEvent) - 1; - Long correlationId = deviceEvent.getContent().getFieldValue(Long.class, RocmStrings.CORRELATION_ID); - if (correlationId != null) { - addArrow(ssb, AbstractGpuEventHandler.getEndTime(deviceEvent) - 1, hipStreamEventEndTimestamp, - Math.toIntExact(correlationId), srcStream, destThread); - addArrow(ssb, AbstractGpuEventHandler.getEndTime(deviceEvent) - 1, hipStreamEventEndTimestamp, - Math.toIntExact(correlationId), srcQueue, destThread); - } - } - - private void removeInFlightEvents(ITmfEvent event) { - Long currentTime = event.getTimestamp().getValue(); - Pair inFlightEvent = fInFlightEvents.peek(); - while (inFlightEvent != null && (currentTime >= AbstractGpuEventHandler.getEndTime(inFlightEvent.getSecond()))) { - fInFlightEvents.remove(); - inFlightEvent = fInFlightEvents.peek(); - } - } - - @Override - public Map getApiEventCorrelationMap() { - return fApiEventCorrelationMap; - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/ApiEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/ApiEventHandler.java new file mode 100644 index 000000000..0a4b0099e --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/ApiEventHandler.java @@ -0,0 +1,137 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers; + +import org.eclipse.tracecompass.analysis.profiling.core.callstack.CallStackStateProvider; +import org.eclipse.tracecompass.analysis.profiling.core.instrumented.InstrumentedCallStackAnalysis; +import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.RocmCallStackStateProvider; +import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.RocmEventLayout; +import org.eclipse.tracecompass.incubator.rocm.core.ctfplugin.trace.RocmCtfPluginTrace; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; +import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; + +/** + * Handler for All APIs (HSA and HIP). + * + * This handler handles all API calls that are written to call stacks and are + * also used to provide other information for the GPU operations. + * + * @author Arnaud Fiorini + */ +public class ApiEventHandler implements IRocmEventHandler { + + private static final String HIP = "HIP"; //$NON-NLS-1$ + private static final String HSA = "HSA"; //$NON-NLS-1$ + + private boolean fIsThreadIdProvidedHSA = false; + private boolean fIsThreadIdProvidedHIP = false; + + private static void provideThreadId(ITmfEvent event, ITmfStateSystemBuilder ssb, int quark, RocmEventLayout layout) { + Integer tid = event.getContent().getFieldValue(Integer.class, layout.fieldThreadId()); + ssb.modifyAttribute(event.getTimestamp().getValue(), tid, quark); + } + + @Override + public void handleEvent(ITmfEvent event, ITmfStateSystemBuilder ssb, RocmEventLayout layout) { + Integer tid = event.getContent().getFieldValue(Integer.class, layout.fieldThreadId()); + if (tid == null) { + return; + } + int rootQuark = ssb.getQuarkAbsoluteAndAdd(RocmCallStackStateProvider.ROOT, CallStackStateProvider.PROCESSES); + int processQuark = ssb.getQuarkRelativeAndAdd(rootQuark, tid.toString()); + addEventToOperationQueue(event, ssb, layout); + boolean isEndEvent = false; + + int callStackQuark = ITmfStateSystem.INVALID_ATTRIBUTE; + if (event.getName().startsWith(layout.getHipPrefix())) { + int apiQuark = ssb.getQuarkRelativeAndAdd(processQuark, HIP); + callStackQuark = ssb.getQuarkRelativeAndAdd(apiQuark, InstrumentedCallStackAnalysis.CALL_STACK); + isEndEvent = event.getName().endsWith(layout.getHipEndSuffix()); + if (!fIsThreadIdProvidedHIP) { + provideThreadId(event, ssb, processQuark, layout); + provideThreadId(event, ssb, apiQuark, layout); + fIsThreadIdProvidedHIP = true; + } + } else if (event.getName().startsWith(layout.getHsaPrefix())) { + if (event.getName().equals(layout.getHsaHandleType())) { + return; + } + int apiQuark = ssb.getQuarkRelativeAndAdd(processQuark, HSA); + callStackQuark = ssb.getQuarkRelativeAndAdd(apiQuark, InstrumentedCallStackAnalysis.CALL_STACK); + isEndEvent = event.getName().endsWith(layout.getHsaEndSuffix()); + if (!fIsThreadIdProvidedHSA) { + provideThreadId(event, ssb, processQuark, layout); + provideThreadId(event, ssb, apiQuark, layout); + fIsThreadIdProvidedHSA = true; + } + } + if (isEndEvent) { + ssb.popAttribute(event.getTimestamp().getValue(), callStackQuark); + return; + } + // Trimming the begin out of the event name + String eventName = event.getName().startsWith(layout.getHipPrefix()) ? event.getName().substring(0, event.getName().length() - layout.getHipBeginSuffix().length()) + : event.getName().substring(0, event.getName().length() - layout.getHsaBeginSuffix().length()); + ssb.pushAttribute(event.getTimestamp().getValue(), eventName, callStackQuark); + } + + private static void addEventToOperationQueue(ITmfEvent event, ITmfStateSystemBuilder ssb, RocmEventLayout layout) { + Long correlationId = event.getContent().getFieldValue(Long.class, layout.fieldCorrelationId()); + if (correlationId == null) { + return; + } + int operationsQuark = ssb.getQuarkAbsoluteAndAdd(RocmCallStackStateProvider.HIP_OPERATION_QUEUES); + long ts = event.getTimestamp().getValue(); + + if (layout.isMemcpyBegin(event.getName()) || (event.getName().equals(layout.hipLaunchKernelBegin()) && ((RocmCtfPluginTrace) event.getTrace()).isContainingKernelGpuActivity()) + || event.getName().equals(layout.hipStreamSynchronizeBegin())) { + int depth = 1; + int subQuark = ssb.getQuarkRelativeAndAdd(operationsQuark, String.valueOf(depth)); + // While there is already activity on the quark + while (!ssb.queryOngoingState(subQuark).isNull()) { + depth += 1; + subQuark = ssb.getQuarkRelativeAndAdd(operationsQuark, String.valueOf(depth)); + } + // Register event name in the call stack + ssb.modifyAttribute(ts, correlationId, subQuark); + int nameQuark = ssb.getQuarkRelativeAndAdd(subQuark, RocmCallStackStateProvider.NAME); + if (layout.isMemcpyBegin(event.getName())) { + ssb.modifyAttribute(ts, event.getContent().getFieldValue(String.class, layout.fieldMemcpyKind()), nameQuark); + } else if (event.getName().equals(layout.hipLaunchKernelBegin())) { + ssb.modifyAttribute(ts, event.getContent().getFieldValue(String.class, layout.fieldKernelName()), nameQuark); + } else if (event.getName().equals(layout.hipStreamSynchronizeBegin())) { + ssb.modifyAttribute(ts, event.getName().substring(0, event.getName().length() - layout.getHipBeginSuffix().length()), nameQuark); + } + } + if (event.getName().equals(layout.hipStreamSynchronizeEnd())) { + int depth = 1; + int subQuark; + try { + subQuark = ssb.getQuarkRelative(operationsQuark, String.valueOf(depth)); + // While there is already activity on the quark + while (correlationId != ssb.queryOngoingState(subQuark).unboxLong()) { + depth += 1; + subQuark = ssb.optQuarkRelative(operationsQuark, String.valueOf(depth)); + if (subQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { + return; + } + } + ssb.modifyAttribute(ts, null, subQuark); + int nameQuark = ssb.getQuarkRelative(subQuark, RocmCallStackStateProvider.NAME); + ssb.modifyAttribute(ts, null, nameQuark); + } catch (AttributeNotFoundException e) { + e.printStackTrace(); + } + } + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/IRocmEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/IRocmEventHandler.java new file mode 100644 index 000000000..0026475be --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/IRocmEventHandler.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers; + +import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.RocmEventLayout; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; + +/** + * Interface to use for the event handlers. + * + * @author Arnaud Fiorini + */ +public interface IRocmEventHandler { + + /** + * Default function to handle events. + * + * @param event + * The event to handle + * @param ssb + * The state system builder + * @param layout + * The layout of the events + */ + public void handleEvent(ITmfEvent event, ITmfStateSystemBuilder ssb, RocmEventLayout layout); +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/OperationEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/OperationEventHandler.java new file mode 100644 index 000000000..5573e1402 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/OperationEventHandler.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers; + +import org.eclipse.tracecompass.analysis.profiling.core.instrumented.InstrumentedCallStackAnalysis; +import org.eclipse.tracecompass.incubator.internal.rocm.core.Activator; +import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.RocmCallStackStateProvider; +import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.RocmEventLayout; +import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; +import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; + +/** + * Handles GPU operations from HIP calls. + * + * It uses state system information from the ApiEventHandler to access the + * operation name + * + * @author Arnaud Fiorini + */ +public class OperationEventHandler implements IRocmEventHandler { + + private static final String QUEUES = "Queues"; //$NON-NLS-1$ + private static final String ROCM_AGENT = "ROCm Agent "; //$NON-NLS-1$ + private static final String QUEUE = "Queue "; //$NON-NLS-1$ + private static final String UNKNOWN = "Unknown Operation"; //$NON-NLS-1$ + + @Override + public void handleEvent(ITmfEvent event, ITmfStateSystemBuilder ssb, RocmEventLayout layout) { + Long timestamp = event.getTimestamp().toNanos(); + boolean isHipOperationBegin = event.getName().equals(layout.getHipOperationBegin()); + boolean isHipOperationEnd = event.getName().equals(layout.getHipOperationEnd()); + if (isHipOperationBegin || isHipOperationEnd) { + String operationName = ""; //$NON-NLS-1$ + if (isHipOperationBegin) { + try { + operationName = getCorrespondingHipCall(event, ssb, layout); + if (operationName.equals("")) { //$NON-NLS-1$ + operationName = event.getContent().getFieldValue(String.class, layout.fieldOperationName()); + } + } catch (AttributeNotFoundException e) { + Activator.getInstance().logError(e.getMessage()); + } + } + // Create or find call stack quark + Integer agentId = event.getContent().getFieldValue(Integer.class, layout.fieldAgentId()); + Integer queueId = event.getContent().getFieldValue(Integer.class, layout.fieldQueueId()); + Long correlationId = event.getContent().getFieldValue(Long.class, layout.fieldCorrelationId()); + if (agentId == null || queueId == null || correlationId == null) { + return; + } + int rootQuark = ssb.getQuarkAbsoluteAndAdd(RocmCallStackStateProvider.ROOT, QUEUES); + int agentQuark = ssb.getQuarkRelativeAndAdd(rootQuark, ROCM_AGENT + agentId.toString()); + int queueQuark = ssb.getQuarkRelativeAndAdd(agentQuark, QUEUE + queueId.toString()); + int callStackQuark = ssb.getQuarkRelativeAndAdd(queueQuark, InstrumentedCallStackAnalysis.CALL_STACK); + + // Add the operation to the queue if we are treating a begin event + if (isHipOperationBegin) { + int depth = 1; + int subQuark = ssb.getQuarkRelativeAndAdd(callStackQuark, String.valueOf(depth)); + // While there is already activity on the quark + while (!ssb.queryOngoingState(subQuark).isNull()) { + depth += 1; + subQuark = ssb.getQuarkRelativeAndAdd(callStackQuark, String.valueOf(depth)); + } + // Register event name in the call stack + ssb.modifyAttribute(timestamp, operationName, subQuark); + // Set call stack depth + ssb.modifyAttribute(timestamp, depth, callStackQuark); + // Set correlation id + int correlationIdQuark = ssb.getQuarkRelativeAndAdd(subQuark, RocmCallStackStateProvider.CORRELATION_ID); + ssb.modifyAttribute(timestamp, correlationId, correlationIdQuark); + // Else if we have an end event, move all operations after the + // one we received up. + } else { + int depth = 1; + int maxDepth = ssb.queryOngoingState(callStackQuark).unboxInt(); + int subQuark = ssb.getQuarkRelativeAndAdd(callStackQuark, String.valueOf(depth)); + try { + // While there is already activity on the quark, go through + // each level + while (ssb.queryOngoingState(ssb.getQuarkRelative(subQuark, RocmCallStackStateProvider.CORRELATION_ID)).unboxLong() != correlationId) { + depth += 1; + subQuark = ssb.getQuarkRelative(callStackQuark, String.valueOf(depth)); + } + + int previousQuark = -1; + while (!ssb.queryOngoingState(subQuark).isNull()) { + if (depth >= maxDepth) { + ssb.modifyAttribute(timestamp, null, subQuark); + ssb.modifyAttribute(timestamp, depth - 1, callStackQuark); + break; + } + // Getting previous quark + previousQuark = subQuark; + // Getting next level quark + depth += 1; + subQuark = ssb.getQuarkRelative(callStackQuark, String.valueOf(depth)); + int nextCorrelationIdQuark = ssb.getQuarkRelativeAndAdd(subQuark, RocmCallStackStateProvider.CORRELATION_ID); + Long nextCorrelationId = ssb.queryOngoingState(nextCorrelationIdQuark).unboxLong(); + // Move operation down 1 level (inserting null to force the creation of a new interval + ssb.modifyAttribute(timestamp, null, previousQuark); + ssb.modifyAttribute(timestamp, ssb.queryOngoingState(subQuark).unboxValue(), previousQuark); + ssb.modifyAttribute(timestamp, nextCorrelationId, ssb.getQuarkRelativeAndAdd(previousQuark, RocmCallStackStateProvider.CORRELATION_ID)); + } + } catch (AttributeNotFoundException e) { + e.printStackTrace(); + } + } + } + } + + private static String getCorrespondingHipCall(ITmfEvent event, ITmfStateSystemBuilder ssb, RocmEventLayout layout) throws AttributeNotFoundException { + Long correlationId = event.getContent().getFieldValue(Long.class, layout.fieldCorrelationId()); + if (correlationId == null) { + return UNKNOWN; + } + int operationsQuark = ssb.getQuarkAbsoluteAndAdd(RocmCallStackStateProvider.HIP_OPERATION_QUEUES); + long ts = event.getTimestamp().getValue(); + int depth = 1; + int subQuark = ssb.getQuarkRelative(operationsQuark, String.valueOf(depth)); + // While there is already activity on the quark + while (correlationId != ssb.queryOngoingState(subQuark).unboxLong()) { + depth += 1; + subQuark = ssb.getQuarkRelative(operationsQuark, String.valueOf(depth)); + } + ssb.modifyAttribute(ts, null, subQuark); + int nameQuark = ssb.getQuarkRelative(subQuark, RocmCallStackStateProvider.NAME); + String hipOperationName = ssb.queryOngoingState(nameQuark).unboxStr(); + ssb.modifyAttribute(ts, null, nameQuark); + return hipOperationName; + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/AbstractGpuEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/AbstractGpuEventHandler.java deleted file mode 100644 index e5e41776c..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/AbstractGpuEventHandler.java +++ /dev/null @@ -1,133 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmCallStackStateProvider; -import org.eclipse.tracecompass.internal.analysis.timing.core.Activator; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; -import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace; - -/** - * The base class for all GPU events handler. - * - * These handlers are used by the RocmCallStackStateProvider but they are not - * responsible for dependency matching which is done by the DependencyMaker - * classes. - * - * @author Arnaud Fiorini - */ -public abstract class AbstractGpuEventHandler { - - private Set fHostIdDefined = new HashSet<>(); - /** - * The state provider that is calling to this event handler - */ - protected final RocmCallStackStateProvider fStateProvider; - - /** - * @param stateProvider - * The state provider that is using this event handler - */ - protected AbstractGpuEventHandler(RocmCallStackStateProvider stateProvider) { - fStateProvider = stateProvider; - } - - /** - * Handle a specific gpu event. - * - * @param ssb - * the state system to write to - * @param event - * the event - * @throws AttributeNotFoundException - * if the attribute is not yet create - */ - public abstract void handleEvent(ITmfStateSystemBuilder ssb, ITmfEvent event) throws AttributeNotFoundException; - - /** - * Add the host id (unique id per callstack to identify arrow source and - * target) to the state system - * - * @param ssb - * the state system to write to - * @param trace - * the trace being read - * @param hostThreadIdentifier - * the host thread identifier element that computes a unique id - * @param quark - * the quark of the call stack - */ - public void addHostIdToStateSystemIfNotDefined(ITmfStateSystemBuilder ssb, ITmfTrace trace, HostThreadIdentifier hostThreadIdentifier, int quark) { - if (fHostIdDefined.contains(hostThreadIdentifier.hashCode())) { - return; - } - int parentQuark = ssb.getParentAttributeQuark(quark); - this.fHostIdDefined.add(hostThreadIdentifier.hashCode()); - ssb.modifyAttribute(trace.getStartTime().toNanos(), hostThreadIdentifier.hashCode(), parentQuark); - } - - /** - * @param ssb - * The state system builder used - * @param callStackQuark - * the quark to push to - * @param eventName - * the gpu activity name (usually the compute kernel name) - * @param ts - * the begin timestamp - * @param endTs - * the end timestamp - */ - public void pushParallelActivityOnCallStack(ITmfStateSystemBuilder ssb, int callStackQuark, String eventName, Long ts, Long endTs) { - try { - int depth = 1; - int subQuark = ssb.getQuarkRelativeAndAdd(callStackQuark, String.valueOf(depth)); - if (ts < ssb.getStartTime()) { - // do nothing - return; - } - // While there is already activity on the quark - while (ssb.querySingleState(ts, subQuark).getValue() != null) { - depth += 1; - subQuark = ssb.getQuarkRelativeAndAdd(callStackQuark, String.valueOf(depth)); - } - // Register stack depth on call stack quark - ssb.modifyAttribute(ts, depth, callStackQuark); - fStateProvider.addFutureEvent(endTs, null, callStackQuark); - // Register event name in the call stack - ssb.modifyAttribute(ts, eventName, subQuark); - fStateProvider.addFutureEvent(endTs, null, subQuark); - } catch (StateSystemDisposedException e) { - Activator.getInstance().logError(e.getMessage()); - } - } - - /** - * @param event - * the event to get the end time of - * @return the end time - */ - public static Long getEndTime(ITmfEvent event) { - Long timestampEnd = event.getContent().getFieldValue(Long.class, "end"); //$NON-NLS-1$ - if (timestampEnd != null) { - return ((CtfTmfTrace) event.getTrace()).timestampCyclesToNanos(timestampEnd); - } - return 0l; - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/ApiEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/ApiEventHandler.java deleted file mode 100644 index 2aa80aba9..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/ApiEventHandler.java +++ /dev/null @@ -1,145 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old; - -import java.util.Collection; - -import org.apache.commons.lang3.StringUtils; -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackStateProvider; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.InstrumentedCallStackAnalysis; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmCallStackStateProvider; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmMetadataStateProvider; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.event.ITmfEventField; -import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider.FutureEventType; -import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider; -import org.eclipse.tracecompass.tmf.core.symbols.SymbolProviderManager; -import org.eclipse.tracecompass.tmf.core.symbols.SymbolProviderUtils; -import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace; - -/** - * This event handler will handle any event that originates from a ROCm API. In - * ROCm there exists multiple APIs: HIP, HSA and KFD. - *
    - *
  • HIP: Heterogeneous-computing Interface for Portability
  • - *
  • HSA: Heterogeneous Software Architecture
  • - *
  • KFD: Kernel Fusion Driver
  • - *
- * - * @author Arnaud Fiorini - */ -public class ApiEventHandler extends AbstractGpuEventHandler { - - /** - * @param stateProvider - * The state provider that is using this event handler - */ - public ApiEventHandler(RocmCallStackStateProvider stateProvider) { - super(stateProvider); - } - - @Override - public void handleEvent(ITmfStateSystemBuilder ssb, ITmfEvent event) throws AttributeNotFoundException { - // Select the correct quark - int systemQuark = ssb.getQuarkAbsoluteAndAdd(CallStackStateProvider.PROCESSES, RocmStrings.SYSTEM); - Long threadId = event.getContent().getFieldValue(Long.class, RocmStrings.TID); - if (threadId == null) { - threadId = 0l; - } - int threadQuark = ssb.getQuarkRelativeAndAdd(systemQuark, RocmStrings.THREAD + threadId.toString()); - int apiQuark = ssb.getQuarkRelativeAndAdd(threadQuark, event.getName().toUpperCase()); - int callStackQuark = ssb.getQuarkRelativeAndAdd(apiQuark, InstrumentedCallStackAnalysis.CALL_STACK); - - // Retrieve event information - ITmfEventField content = event.getContent(); - Long timestamp = event.getTimestamp().toNanos(); - Integer functionID = RocmMetadataStateProvider.getFunctionId(event); - - // Push the api function name to the call stack quark - ssb.pushAttribute(timestamp, functionID, callStackQuark); - Long timestampEnd = content.getFieldValue(Long.class, RocmStrings.END); - - if (timestampEnd != null) { - fStateProvider.addFutureEvent(((CtfTmfTrace) event.getTrace()).timestampCyclesToNanos(timestampEnd), - timestampEnd, callStackQuark, FutureEventType.POP); - } - - // Get and add HostThreadIdentifier if necessary - Integer tid = content.getFieldValue(Integer.class, RocmStrings.TID); - if (tid == null) { - return; - } - HostThreadIdentifier hostThreadIdentifier = new HostThreadIdentifier(event, tid); - addHostIdToStateSystemIfNotDefined(ssb, event.getTrace(), hostThreadIdentifier, callStackQuark); - } - - /** - * A standard function to parse the args strings and get the correct - * positioned argument - * - * @param content - * The content of the event - * @param argPosition - * The position of the argument - * @return the string value of the argument when the API function was called - */ - public static String getArg(ITmfEventField content, int argPosition) { - String args = content.getFieldValue(String.class, RocmStrings.ARGS); - if (args == null) { - return StringUtils.EMPTY; - } - int currentIndex = 0; - int argIndex = -1; - int currentPosition = 0; - int depth = 0; // '(' increases depth, ')' decreases it - while (currentIndex < args.length() && currentPosition <= argPosition) { - if (args.charAt(currentIndex) == ',' && depth == 0) { - currentPosition += 1; - } - if (args.charAt(currentIndex) == '(' || args.charAt(currentIndex) == '{' || args.charAt(currentIndex) == '<') { - depth += 1; - } - if (args.charAt(currentIndex) == ')' || args.charAt(currentIndex) == '}' || args.charAt(currentIndex) == '>') { - depth -= 1; - } - if (currentPosition == argPosition && argIndex < 0) { - if (argPosition > 0) { // if there is a comma - argIndex = currentIndex + 1; // do not select it - } else { - argIndex = currentIndex; - } - } - currentIndex += 1; - } - if (currentPosition > argPosition) { - currentIndex -= 1; // move back before the comma - } - if (argIndex >= 0) { - return args.substring(argIndex, currentIndex).strip(); - } - return StringUtils.EMPTY; - } - - /** - * @param event - * The event - * @return the function name of the API call for this event - */ - public static String getFunctionApiName(ITmfEvent event) { - Collection<@NonNull ISymbolProvider> providers = SymbolProviderManager.getInstance().getSymbolProviders(event.getTrace()); - return SymbolProviderUtils.getSymbolText(providers, RocmMetadataStateProvider.getFunctionId(event)); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HipActivityEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HipActivityEventHandler.java deleted file mode 100644 index 83cc6ab31..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HipActivityEventHandler.java +++ /dev/null @@ -1,151 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old; - -import java.util.Map; - -import org.apache.commons.lang3.StringUtils; -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackStateProvider; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.InstrumentedCallStackAnalysis; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.HostThreadIdentifier.KERNEL_CATEGORY; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmCallStackStateProvider; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.incubator.rocm.core.analysis.dependency.IDependencyMaker; -import org.eclipse.tracecompass.incubator.rocm.core.trace.GpuAspect; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.event.ITmfEventField; -import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider.FutureEventType; -import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils; -import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace; - -/** - * The HIP activity event handler It is possible to have different backends - * generate the GPU activity events. This event handler is for the GPU activity - * events generated by HIP. - * - * @author Arnaud Fiorini - */ -public class HipActivityEventHandler extends AbstractGpuEventHandler { - - /** - * @param stateProvider - * The state provider that is using this event handler - */ - public HipActivityEventHandler(RocmCallStackStateProvider stateProvider) { - super(stateProvider); - } - - @Override - public void handleEvent(ITmfStateSystemBuilder ssb, ITmfEvent event) throws AttributeNotFoundException { - // Can be memory tranfer event or kernel execution event - int callStackQuark = getCallStackQuark(ssb, event); - - ITmfEventField content = event.getContent(); - Long timestamp = event.getTimestamp().toNanos(); - String eventName = content.getFieldValue(String.class, RocmStrings.NAME); - - if (eventName != null && eventName.equals(RocmStrings.KERNEL_EXECUTION)) { - int hipStreamCallStackQuark = -1; - Long correlationId = content.getFieldValue(Long.class, RocmStrings.CORRELATION_ID); - int gpuId = getGpuId(event); - int hipStreamId = -1; - // Placeholder value in case we do not match any api event. - String kernelName = RocmStrings.KERNEL_EXECUTION; - IDependencyMaker dependencyMaker = fStateProvider.getDependencyMaker(); - if (dependencyMaker != null) { - Map apiEventCorrelationMap = dependencyMaker.getApiEventCorrelationMap(); - ITmfEvent apiEvent = apiEventCorrelationMap.get(correlationId); - if (apiEvent != null) { - hipStreamId = Integer.parseInt(ApiEventHandler.getArg(apiEvent.getContent(), 4)); - hipStreamCallStackQuark = getHipStreamCallStackQuark(ssb, apiEvent, gpuId); - kernelName = ApiEventHandler.getArg(apiEvent.getContent(), 6); - } - } - Integer queueId = content.getFieldValue(Integer.class, RocmStrings.QUEUE_ID); - if (queueId == null || correlationId == null) { - return; - } - Long timestampEnd = content.getFieldValue(Long.class, RocmStrings.END); - if (timestampEnd != null) { - pushParallelActivityOnCallStack(ssb, callStackQuark, kernelName, timestamp, - ((CtfTmfTrace) event.getTrace()).timestampCyclesToNanos(timestampEnd)); - if (hipStreamCallStackQuark > 0) { - pushParallelActivityOnCallStack(ssb, hipStreamCallStackQuark, kernelName, - timestamp, ((CtfTmfTrace) event.getTrace()).timestampCyclesToNanos(timestampEnd)); - } - } - - // Add Host Thread Identifier for dependency arrows - HostThreadIdentifier queueHostThreadIdentifier = new HostThreadIdentifier(queueId.intValue(), KERNEL_CATEGORY.QUEUE, gpuId); - addHostIdToStateSystemIfNotDefined(ssb, event.getTrace(), queueHostThreadIdentifier, callStackQuark); - if (hipStreamCallStackQuark > 0) { - HostThreadIdentifier streamHostThreadIdentifier = new HostThreadIdentifier(hipStreamId, KERNEL_CATEGORY.STREAM, gpuId); - addHostIdToStateSystemIfNotDefined(ssb, event.getTrace(), streamHostThreadIdentifier, hipStreamCallStackQuark); - } - } else { - if (eventName == null) { - ssb.modifyAttribute(timestamp, null, callStackQuark); - return; - } - Long timestampEnd = content.getFieldValue(Long.class, RocmStrings.END); - ssb.pushAttribute(timestamp, eventName, callStackQuark); - if (timestampEnd != null) { - fStateProvider.addFutureEvent(((CtfTmfTrace) event.getTrace()).timestampCyclesToNanos(timestampEnd), - timestampEnd, callStackQuark, FutureEventType.POP); - } - // Add CallStack Identifier (tid equivalent) for the memory quark - HostThreadIdentifier hostThreadIdentifier = new HostThreadIdentifier(); - addHostIdToStateSystemIfNotDefined(ssb, event.getTrace(), hostThreadIdentifier, callStackQuark); - } - } - - private static int getCallStackQuark(ITmfStateSystemBuilder ssb, ITmfEvent event) { - String eventName = event.getContent().getFieldValue(String.class, RocmStrings.NAME); - if (eventName == null) { - return -1; - } - if (eventName.equals(RocmStrings.KERNEL_EXECUTION)) { - Long queueId = event.getContent().getFieldValue(Long.class, RocmStrings.QUEUE_ID); - Long gpuId = event.getContent().getFieldValue(Long.class, RocmStrings.DEVICE_ID); - if (queueId == null || gpuId == null) { - return -1; - } - int gpuQuark = ssb.getQuarkAbsoluteAndAdd(CallStackStateProvider.PROCESSES, RocmStrings.GPU + gpuId.toString()); - int queuesQuark = ssb.getQuarkRelativeAndAdd(gpuQuark, RocmStrings.QUEUES); - int queueQuark = ssb.getQuarkRelativeAndAdd(queuesQuark, RocmStrings.QUEUE + Long.toString(queueId)); - return ssb.getQuarkRelativeAndAdd(queueQuark, InstrumentedCallStackAnalysis.CALL_STACK); - } - int copyQuark = ssb.getQuarkAbsoluteAndAdd(CallStackStateProvider.PROCESSES, RocmStrings.MEMORY); - int tempQuark1 = ssb.getQuarkRelativeAndAdd(copyQuark, StringUtils.EMPTY); - int tempQuark2 = ssb.getQuarkRelativeAndAdd(tempQuark1, RocmStrings.MEMORY_TRANSFERS); - return ssb.getQuarkRelativeAndAdd(tempQuark2, InstrumentedCallStackAnalysis.CALL_STACK); - } - - private static int getHipStreamCallStackQuark(ITmfStateSystemBuilder ssb, @NonNull ITmfEvent event, Integer gpuId) { - int gpuQuark = ssb.getQuarkAbsoluteAndAdd(CallStackStateProvider.PROCESSES, RocmStrings.GPU + gpuId.toString()); - int hipStreamsQuark = ssb.getQuarkRelativeAndAdd(gpuQuark, RocmStrings.STREAMS); - int hipStreamId = Integer.parseInt(ApiEventHandler.getArg(event.getContent(), 4)); - int hipStreamQuark = ssb.getQuarkRelativeAndAdd(hipStreamsQuark, RocmStrings.STREAM + Integer.toString(hipStreamId)); - return ssb.getQuarkRelativeAndAdd(hipStreamQuark, InstrumentedCallStackAnalysis.CALL_STACK); - } - - private static int getGpuId(ITmfEvent event) { - Integer gpuId = (Integer) TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), GpuAspect.class, event); - if (gpuId != null) { - return gpuId; - } - return -1; - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HostThreadIdentifier.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HostThreadIdentifier.java deleted file mode 100644 index eab8ae4c7..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HostThreadIdentifier.java +++ /dev/null @@ -1,126 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old; - -import java.util.Objects; - -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.tracecompass.incubator.rocm.core.trace.old.RocmTrace; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; - -/** - * This class is used to identify the correct lane when defining dependencies. - * - * @author Arnaud Fiorini - */ -public class HostThreadIdentifier { - /** - * Each kernel is executed in a stream (logical separation) and a queue - * (hardware separation) We create for each activity two state intervals: - * one for the queue and one for the stream - * - * @author Arnaud Fiorini - */ - public enum KERNEL_CATEGORY { - /** - * Activity mapped to the hardware queue designated by the ROCm runtime. - */ - QUEUE, - /** - * Stream chosen by the user to execute its compute kernel. - */ - STREAM - } - - /** - * ROCm categories used to differentiate memory transfers and API calls - * - * @author Arnaud Fiorini - */ - public enum ROCM_CATEGORY { - /** - * API calls - */ - SYSTEM, - /** - * Memory transfers - */ - MEMORY - } - - private final int fApiId; // Api type, Queue id, Stream id - private final int fThreadId; // Tid, Queue type, Stream type - private final int fCategoryId; // System, Memory, GPU id - - private HostThreadIdentifier(int apiId, int threadId, int categoryId) { - fApiId = apiId; - fThreadId = threadId; - fCategoryId = categoryId; - } - - /** - * Constructor for Memory transfer events, as there is only one call stack - * for this, there is no parameters - * - */ - public HostThreadIdentifier() { - this(0, 0, ROCM_CATEGORY.MEMORY.ordinal()); - } - - /** - * Constructor for GPU events - * - * @param categoryId - * stream id or queue id - * @param category - * Either queues or streams - * @param gpuId - * the id of the GPU - */ - public HostThreadIdentifier(int categoryId, KERNEL_CATEGORY category, int gpuId) { - // There are other categories (system, memory), this will separate the - // GPU categories. - this(categoryId, category.ordinal(), gpuId + ROCM_CATEGORY.values().length); - } - - /** - * Constructor for API events - * - * @param event - * the event from which we create the HostThreadIdentifier - * @param tid - * the tid of this event - */ - public HostThreadIdentifier(ITmfEvent event, int tid) { - this(((RocmTrace) event.getTrace()).getApiId(event.getName()), tid, ROCM_CATEGORY.SYSTEM.ordinal()); - } - - @Override - public int hashCode() { - return Objects.hash(fApiId, fThreadId, fCategoryId); - } - - @Override - public boolean equals(@Nullable Object other) { - if (this == other) { - return true; - } - if (other == null) { - return false; - } - if (this.getClass() != other.getClass()) { - return false; - } - HostThreadIdentifier that = (HostThreadIdentifier) other; - return (fApiId == that.fApiId) && (fThreadId == that.fThreadId) && (fCategoryId == that.fCategoryId); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HsaActivityEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HsaActivityEventHandler.java deleted file mode 100644 index d2f101483..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HsaActivityEventHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old; - -import org.apache.commons.lang3.StringUtils; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackStateProvider; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.InstrumentedCallStackAnalysis; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmCallStackStateProvider; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider.FutureEventType; - -/** - * The HSA activity event handler.
- * It is possible to have different backends generate the GPU activity events. - * This event handler is for the GPU activity events generated by HSA. - * - * @author Arnaud Fiorini - */ -public class HsaActivityEventHandler extends AbstractGpuEventHandler { - - /** - * @param stateProvider - * The state provider that is using this event handler - */ - public HsaActivityEventHandler(RocmCallStackStateProvider stateProvider) { - super(stateProvider); - } - - @Override - public void handleEvent(ITmfStateSystemBuilder ssb, ITmfEvent event) throws AttributeNotFoundException { - int copyQuark = ssb.getQuarkAbsoluteAndAdd(CallStackStateProvider.PROCESSES, RocmStrings.MEMORY); - int tempQuark1 = ssb.getQuarkRelativeAndAdd(copyQuark, StringUtils.EMPTY); - int tempQuark2 = ssb.getQuarkRelativeAndAdd(tempQuark1, RocmStrings.MEMORY_TRANSFERS); - int callStackQuark = ssb.getQuarkRelativeAndAdd(tempQuark2, InstrumentedCallStackAnalysis.CALL_STACK); - - Long timestamp = event.getTimestamp().toNanos(); - Long timestampEnd = AbstractGpuEventHandler.getEndTime(event); - ssb.pushAttribute(timestamp, RocmStrings.COPY, callStackQuark); - if (timestampEnd != null) { - fStateProvider.addFutureEvent(timestampEnd, null, callStackQuark, FutureEventType.POP); - } - // Add CallStack Identifier (tid equivalent) for the memory quark - HostThreadIdentifier hostThreadIdentifier = new HostThreadIdentifier(); - addHostIdToStateSystemIfNotDefined(ssb, event.getTrace(), hostThreadIdentifier, callStackQuark); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HsaKernelEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HsaKernelEventHandler.java deleted file mode 100644 index d9b09c570..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/HsaKernelEventHandler.java +++ /dev/null @@ -1,62 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old; - -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackStateProvider; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.InstrumentedCallStackAnalysis; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.HostThreadIdentifier.KERNEL_CATEGORY; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmCallStackStateProvider; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace; - -/** - * Handles compute kernel events generated with ROCProfiler that are not GPU - * activity events. - * - * @author Arnaud Fiorini - */ -public class HsaKernelEventHandler extends AbstractGpuEventHandler { - - /** - * @param stateProvider - * The state provider that is using this event handler - */ - public HsaKernelEventHandler(RocmCallStackStateProvider stateProvider) { - super(stateProvider); - } - - @Override - public void handleEvent(ITmfStateSystemBuilder ssb, ITmfEvent event) throws AttributeNotFoundException { - String kernelName = event.getContent().getFieldValue(String.class, RocmStrings.KERNEL_NAME); - Long queueId = event.getContent().getFieldValue(Long.class, RocmStrings.QUEUE_ID); - Long gpuId = event.getContent().getFieldValue(Long.class, RocmStrings.GPU_ID); - if (queueId == null || gpuId == null) { - return; - } - int gpuQuark = ssb.getQuarkAbsoluteAndAdd(CallStackStateProvider.PROCESSES, RocmStrings.GPU + gpuId.toString()); - int queuesQuark = ssb.getQuarkRelativeAndAdd(gpuQuark, RocmStrings.QUEUES); - int queueQuark = ssb.getQuarkRelativeAndAdd(queuesQuark, RocmStrings.QUEUE + Long.toString(queueId)); - int callStackQuark = ssb.getQuarkRelativeAndAdd(queueQuark, InstrumentedCallStackAnalysis.CALL_STACK); - Long timestamp = event.getTimestamp().toNanos(); - Long timestampEnd = event.getContent().getFieldValue(Long.class, "complete_time"); //$NON-NLS-1$ - if (timestampEnd != null) { - timestampEnd = ((CtfTmfTrace) event.getTrace()).timestampCyclesToNanos(timestampEnd); - pushParallelActivityOnCallStack(ssb, callStackQuark, kernelName, timestamp, timestampEnd); - } - // Add Host Thread Identifier for dependency arrows - HostThreadIdentifier queueHostThreadIdentifier = new HostThreadIdentifier(queueId.intValue(), KERNEL_CATEGORY.QUEUE, gpuId.intValue()); - addHostIdToStateSystemIfNotDefined(ssb, event.getTrace(), queueHostThreadIdentifier, callStackQuark); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/RoctxEventHandler.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/RoctxEventHandler.java deleted file mode 100644 index 9e45697cc..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/RoctxEventHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old; - -import org.apache.commons.lang3.StringUtils; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackStateProvider; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.InstrumentedCallStackAnalysis; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmCallStackStateProvider; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; - -/** - * This event handler is used for ROCtx events which are custom tracepoints - * defined by the user. - * - * @author Arnaud Fiorini - */ -public class RoctxEventHandler extends AbstractGpuEventHandler { - - /** - * @param stateProvider - * The state provider that is using this event handler - */ - public RoctxEventHandler(RocmCallStackStateProvider stateProvider) { - super(stateProvider); - } - - @Override - public void handleEvent(ITmfStateSystemBuilder ssb, ITmfEvent event) throws AttributeNotFoundException { - // Select the correct quark - int systemQuark = ssb.getQuarkAbsoluteAndAdd(CallStackStateProvider.PROCESSES, RocmStrings.SYSTEM); - Long threadId = event.getContent().getFieldValue(Long.class, RocmStrings.TID); - if (threadId == null) { - threadId = 0l; - } - int threadQuark = ssb.getQuarkRelativeAndAdd(systemQuark, RocmStrings.THREAD + threadId.toString()); - int apiQuark = ssb.getQuarkRelativeAndAdd(threadQuark, "RocTX"); //$NON-NLS-1$ - int callStackQuark = ssb.getQuarkRelativeAndAdd(apiQuark, InstrumentedCallStackAnalysis.CALL_STACK); - // Push message - Long timestamp = event.getTimestamp().getValue(); - String message = event.getContent().getFieldValue(String.class, RocmStrings.MESSAGE); - if (message == null || message.equals(StringUtils.EMPTY)) { - ssb.popAttribute(timestamp, callStackQuark); - return; - } - ssb.pushAttribute(timestamp, message, callStackQuark); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/package-info.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/package-info.java similarity index 80% rename from analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/package-info.java rename to analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/package-info.java index 6b966bfe8..1bdcb3936 100644 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/old/package-info.java +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/handlers/package-info.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2022 École Polytechnique de Montréal + * Copyright (c) 2024 É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 2.0 which @@ -8,5 +8,5 @@ * * SPDX-License-Identifier: EPL-2.0 **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old; +@org.eclipse.jdt.annotation.NonNullByDefault +package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers; diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmCallStackAnalysis.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmCallStackAnalysis.java deleted file mode 100644 index fcca1ec1e..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmCallStackAnalysis.java +++ /dev/null @@ -1,81 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackSeries; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackSeries.IThreadIdResolver; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackStateProvider; -import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.InstrumentedCallStackAnalysis; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem; -import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; - -import com.google.common.collect.ImmutableList; - -/** - * This analysis is a callstack analysis which summarizes the execution of a - * ROCm GPU program. - * - * It separates the execution into 3 categories: the GPU, the memory transfers, - * and the system API calls. Furthermore, some dependencies were modeled using - * arrows to show the user how these abstract layers relate to each other. - * - * @author Arnaud Fiorini - */ -public class RocmCallStackAnalysis extends InstrumentedCallStackAnalysis { - /** - * Call stack analysis ID - */ - public static final @NonNull String ID = "org.eclipse.tracecompass.incubator.rocm.core.analysis.interval"; //$NON-NLS-1$ - - @Override - protected @NonNull ITmfStateProvider createStateProvider() { - return new RocmCallStackStateProvider(Objects.requireNonNull(getTrace())); - } - - @Override - protected @Nullable IThreadIdResolver getCallStackTidResolver() { - return new CallStackSeries.AttributeValueThreadResolver(2); - } - - @Override - protected @NonNull Collection<@NonNull Integer> getEdgeQuarks() { - ITmfStateSystem ss = getStateSystem(); - if (ss == null) { - return Collections.emptyList(); - } - int edgeQuark = ss.optQuarkAbsolute(RocmStrings.EDGES); - if (edgeQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { - return Collections.emptyList(); - } - return ss.getSubAttributes(edgeQuark, false); - } - - /** - * Get the patterns for the GPUs, threads and categories - * - * @return The patterns for the different levels in the state system - */ - @Override - protected List getPatterns() { - return ImmutableList.of( - new String[] { CallStackStateProvider.PROCESSES, "*" }, //$NON-NLS-1$ - new String[] { "*" }, //$NON-NLS-1$ - new String[] { "*" }); //$NON-NLS-1$ - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmCallStackStateProvider.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmCallStackStateProvider.java deleted file mode 100644 index aac1c928d..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmCallStackStateProvider.java +++ /dev/null @@ -1,145 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old; - -import java.util.Map; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.tracecompass.common.core.NonNullUtils; -import org.eclipse.tracecompass.incubator.internal.rocm.core.Activator; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.dependency.HipApiHipActivityDependencyMaker; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.AbstractGpuEventHandler; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.ApiEventHandler; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.HipActivityEventHandler; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.HsaActivityEventHandler; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.HsaKernelEventHandler; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.RoctxEventHandler; -import org.eclipse.tracecompass.incubator.rocm.core.analysis.dependency.IDependencyMaker; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.event.ITmfEventType; -import org.eclipse.tracecompass.tmf.core.statesystem.AbstractTmfStateProvider; -import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; -import org.eclipse.tracecompass.tmf.core.trace.ITmfTraceWithPreDefinedEvents; - -import com.google.common.collect.ImmutableMap; - -/** - * This state provider creates callstacks and apply different event handlers. - * There are multiple types of events, each described in their respective - * handler. - * - * Attribute tree: - * - *
- * |- Processes
- * |  |- 
- * |  |  |- HIP Streams
- * |  |  |  |-  -> Each stream implemented as a callstack with corresponding
- * |  |  |  |              compute kernel activity.
- * |  |  |- Queues
- * |  |  |  |-  -> Each queue implemented as a callstack with corresponding
- * |  |  |  |             compute kernel activity.
- * |  |- Memory
- * |  |  |  |- Memory transfers -> Callstack with every memory transfer activity.
- * |  |- System
- * |  |  |- 
- * |  |  |  |-  -> Each API is a callstack showing which API call is executed.
- * 
- * - * @author Arnaud Fiorini - */ -public class RocmCallStackStateProvider extends AbstractTmfStateProvider { - - private static final String ID = "org.eclipse.tracecompass.incubator.rocm.core.stateprovider.interval"; //$NON-NLS-1$ - - private IDependencyMaker fDependencyMaker; - private Map fEventNames; - - /** - * @param trace - * trace to follow - */ - public RocmCallStackStateProvider(@NonNull ITmfTrace trace) { - super(trace, ID); - fDependencyMaker = getDependencyMaker((ITmfTraceWithPreDefinedEvents) trace); - fEventNames = buildEventNames(); - } - - private Map buildEventNames() { - ImmutableMap.Builder builder = ImmutableMap.builder(); - - builder.put(RocmStrings.HIP_API, new ApiEventHandler(this)); - builder.put(RocmStrings.HSA_API, new ApiEventHandler(this)); - builder.put(RocmStrings.HIP_ACTIVITY, new HipActivityEventHandler(this)); - builder.put(RocmStrings.ROCTX, new RoctxEventHandler(this)); - builder.put(RocmStrings.HSA_ACTIVITY, new HsaActivityEventHandler(this)); - if (fDependencyMaker == null) { // Disable HSA Activity in case we have - // hip activity events - builder.put(RocmStrings.KERNEL_EVENT, new HsaKernelEventHandler(this)); - } - - return builder.build(); - } - - private static IDependencyMaker getDependencyMaker(ITmfTraceWithPreDefinedEvents trace) { - IDependencyMaker dependencyMaker = null; - for (ITmfEventType eventType : (trace).getContainedEventTypes()) { - if (eventType.getName().equals(RocmStrings.HIP_ACTIVITY)) { - dependencyMaker = new HipApiHipActivityDependencyMaker(); - break; - } - } - return dependencyMaker; - } - - @Override - public int getVersion() { - return 1; - } - - @Override - public @NonNull ITmfStateProvider getNewInstance() { - return new RocmCallStackStateProvider(getTrace()); - } - - @Override - protected void eventHandle(@NonNull ITmfEvent event) { - String eventName = event.getName(); - ITmfStateSystemBuilder ssb = NonNullUtils.checkNotNull(getStateSystemBuilder()); - try { - AbstractGpuEventHandler handler = fEventNames.get(eventName); - if (handler != null) { - handler.handleEvent(ssb, event); - } - } catch (AttributeNotFoundException e) { - Activator.getInstance().logError("Exception while building the RocmCallStack state system", e); //$NON-NLS-1$ - } - if (fDependencyMaker != null) { - fDependencyMaker.processEvent(event, ssb); - } - } - - /** - * Accessor for the current dependency maker. - * - * The dependency maker is instantiated in the constructor depending the - * event types present in the rocm trace. - * - * @return dependency maker - */ - public IDependencyMaker getDependencyMaker() { - return fDependencyMaker; - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmMetadataAnalysis.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmMetadataAnalysis.java deleted file mode 100644 index a03bbcc43..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmMetadataAnalysis.java +++ /dev/null @@ -1,59 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old; - -import java.util.Objects; -import java.util.Set; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement; -import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement.PriorityLevel; -import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAnalysisEventRequirement; -import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule; - -import com.google.common.collect.ImmutableSet; - -/** - * This analysis is used to store metadata of ROCm traces in the state system. - * For now it is only used to store mappings of function names and their - * corresponding cids. - * - * @author Arnaud Fiorini - */ -public class RocmMetadataAnalysis extends TmfStateSystemAnalysisModule { - - /** - * The ID of this analysis - */ - public static final String ID = "org.eclipse.tracecompass.incubator.rocm.core.analysis.functionname"; //$NON-NLS-1$ - - private Set<@NonNull TmfAbstractAnalysisRequirement> fAnalysisRequirements; - - @Override - protected @NonNull ITmfStateProvider createStateProvider() { - return new RocmMetadataStateProvider(Objects.requireNonNull(getTrace())); - } - - @Override - public Iterable<@NonNull TmfAbstractAnalysisRequirement> getAnalysisRequirements() { - Set<@NonNull TmfAbstractAnalysisRequirement> requirements = fAnalysisRequirements; - if (requirements == null) { - /* Initialize the requirements for the analysis */ - requirements = ImmutableSet.of(new TmfAnalysisEventRequirement( - ImmutableSet.of(RocmStrings.HIP_FUNCTION_NAME, RocmStrings.HSA_FUNCTION_NAME), - PriorityLevel.AT_LEAST_ONE)); - fAnalysisRequirements = requirements; - } - return requirements; - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmMetadataStateProvider.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmMetadataStateProvider.java deleted file mode 100644 index e89b4027f..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmMetadataStateProvider.java +++ /dev/null @@ -1,104 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.tracecompass.incubator.rocm.core.trace.old.RocmTrace; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.statesystem.AbstractTmfStateProvider; -import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; -import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; - -/** - * This state provider stores each function name in the state system ordered - * with the function id. - * - * Attribute tree: - * - *
- * |- Function names -> begins at the start of the trace, each ns is a different function name.
- * 
- * - * @author Arnaud Fiorini - */ -public class RocmMetadataStateProvider extends AbstractTmfStateProvider { - - private static final String ID = "org.eclipse.tracecompass.incubator.rocm.core.stateprovider.functionname"; //$NON-NLS-1$ - - /** - * Attribute name for the function name map. - */ - public static final String FUNCTION_NAMES = "Function Names"; //$NON-NLS-1$ - - /** - * @param trace - * the trace to analyze - */ - public RocmMetadataStateProvider(@NonNull ITmfTrace trace) { - super(trace, ID); - } - - @Override - public int getVersion() { - return 1; - } - - @Override - public @NonNull ITmfStateProvider getNewInstance() { - return new RocmCallStackStateProvider(getTrace()); - } - - @Override - protected void eventHandle(@NonNull ITmfEvent event) { - if (event.getName().endsWith("function_name")) { //$NON-NLS-1$ - ITmfStateSystemBuilder ssb = getStateSystemBuilder(); - if (ssb == null) { - return; - } - int functionNameQuark = ssb.getQuarkAbsoluteAndAdd(FUNCTION_NAMES); - int apiQuark = ssb.getQuarkRelativeAndAdd(functionNameQuark, - ((Integer) ((RocmTrace) event.getTrace()).getApiId(event.getName().split("_")[0] + "_api")).toString()); //$NON-NLS-1$ //$NON-NLS-2$ - String functionName = event.getContent().getFieldValue(String.class, RocmStrings.NAME); - Integer cid = event.getContent().getFieldValue(Integer.class, RocmStrings.CORRELATION_ID); - if (functionName == null || cid == null) { - return; - } - ssb.modifyAttribute(ssb.getStartTime() + cid, functionName, apiQuark); - } - } - - /** - * Static function to get the function id from an api event cid. - * - * @param event - * An API event - * @return functionId - */ - public static int getFunctionId(@NonNull ITmfEvent event) { - int nApi = ((RocmTrace) event.getTrace()).getNApi(); - Integer cid = event.getContent().getFieldValue(Integer.class, RocmStrings.CID); - if (cid == null) { - cid = event.getContent().getFieldValue(Integer.class, RocmStrings.CORRELATION_ID); - } - if (cid == null) { - return -1; - } - int apiId; - if (event.getName().endsWith("function_name")) { //$NON-NLS-1$ - apiId = ((RocmTrace) event.getTrace()).getApiId(event.getName().split("_")[0] + "_api"); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - apiId = ((RocmTrace) event.getTrace()).getApiId(event.getName()); - } - return cid * nApi + apiId; - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmStrings.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmStrings.java deleted file mode 100644 index 16f540f1d..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/RocmStrings.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - *******************************************************************************/ -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old; - -/** - * Strings used in the ROCm module - * - * @author Arnaud Fiorini - * @noimplement This interface is not intended to be implemented by clients. - */ -@SuppressWarnings({ "javadoc", "nls" }) -public interface RocmStrings { - /* Event types */ - String GPU_KERNEL = "compute_kernels_hsa"; - String HSA_API = "hsa_api"; - String HIP_API = "hip_api"; - String HCC_OPS = "hcc_ops"; - String ROCTX = "roctx"; - String ASYNC_COPY = "async_copy"; - String HIP_ACTIVITY = "hip_activity"; - String HSA_ACTIVITY = "hsa_activity"; - String KERNEL_EVENT = "kernel_event"; - String HIP_FUNCTION_NAME = "hip_function_name"; - String HSA_FUNCTION_NAME = "hsa_function_name"; - String METRIC_DOUBLE = "metric_double"; - String METRIC_INTEGER = "metric_uint64"; - String METRIC_NAME = "metric_name"; - String METRIC_NAME_END = "metric_name_end"; - - /* Field names */ - String NAME = "name"; - String ARGS = "args"; - String KERNEL_NAME = "kernel_name"; - String KERNEL_DISPATCH_ID = "kernel_dispatch_id"; - String GPU_ID = "gpu_id"; - String CORRELATION_ID = "correlation_id"; - String DEVICE_ID = "device_id"; - String QUEUE_ID = "queue_id"; - String QUEUE_INDEX = "queue_index"; - String STREAM_ID = "stream_id"; - /** Function call id, is used to identify the function name */ - String CID = "cid"; - String TID = "tid"; - String PID = "pid"; - String ID = "id"; - String END = "end"; - String MESSAGE = "message"; - String VALUE = "value"; - - /* State categories */ - String EDGES = "Edges"; - String GPU_ACTIVITY = "GPU Activity"; - String GPU = "GPU "; - String GAP_ANALYSIS = "Gap Analysis"; - String THREAD = "Thread "; - String SYSTEM = "System"; - String MEMORY = "Memory"; - String MEMORY_TRANSFERS = "Memory Transfers"; - String STREAMS = "HIP Streams"; - String STREAM = "Stream "; - String QUEUES = "Queues"; - String QUEUE = "Queue "; - String GPU_KERNELS = "GPU Kernels"; - - /* Event Names */ - String KERNEL_EXECUTION = "KernelExecution"; - String KERNEL_LAUNCH = "hipLaunchKernel"; - String HIP_DEVICE_SYNCHRONIZE = "hipDeviceSynchronize"; - String COPY = "Copy"; - - /* State values */ - String IDLE = "Idle"; -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/package-info.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/package-info.java similarity index 82% rename from analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/package-info.java rename to analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/package-info.java index fa9d33bf6..c12d855e2 100644 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/old/package-info.java +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/package-info.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 École Polytechnique de Montréal + * Copyright (c) 2024 É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 2.0 which @@ -8,4 +8,5 @@ * * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old; \ No newline at end of file +@org.eclipse.jdt.annotation.NonNullByDefault +package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis; diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/analysis/dependency/IDependencyMaker.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/analysis/dependency/IDependencyMaker.java deleted file mode 100644 index 946ffe584..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/analysis/dependency/IDependencyMaker.java +++ /dev/null @@ -1,40 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.rocm.core.analysis.dependency; - -import java.util.Map; - -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; - -/** - * This interface is used to separate the event handlers which do not store - * states and dependency making which requires to store some information to - * make the dependencies. - * - * @author Arnaud Fiorini - */ -public interface IDependencyMaker { - - /** - * @param event - * The event to process - * @param ssb - * The state system builder to use to add the dependency - */ - void processEvent(ITmfEvent event, ITmfStateSystemBuilder ssb); - - /** - * @return A Map which stores the event correlations - */ - Map getApiEventCorrelationMap(); -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/RocmApiCtfPluginEventLayout.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/RocmApiCtfPluginEventLayout.java new file mode 100644 index 000000000..9ccbdfcec --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/RocmApiCtfPluginEventLayout.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.rocm.core.ctfplugin.trace; + +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout.IApiEventLayout; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; + +/** + * Event layout for API events in traces generated by the CTF plugin in ROCm + * + * @author Arnaud Fiorini + */ +public abstract class RocmApiCtfPluginEventLayout implements IApiEventLayout { + + @Override + public boolean isBeginEvent(ITmfEvent event) { + return event.getName().endsWith(RocmCtfPluginTraceEventLayout.HSA_BEGIN_SUFFIX) || + event.getName().endsWith(RocmCtfPluginTraceEventLayout.HIP_BEGIN_SUFFIX); + } + + @Override + public String getEventName(ITmfEvent event) { + if (isBeginEvent(event)) { + if (event.getName().startsWith(RocmCtfPluginTraceEventLayout.HIP)) { + return event.getName().substring(0, event.getName().length() - 5); + } + return event.getName().substring(0, event.getName().length() - 6); + } + if (event.getName().startsWith(RocmCtfPluginTraceEventLayout.HIP)) { + return event.getName().substring(0, event.getName().length() - 3); + } + return event.getName().substring(0, event.getName().length() - 4); + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/RocmCtfPluginTrace.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/RocmCtfPluginTrace.java new file mode 100644 index 000000000..9ef1e8d95 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/RocmCtfPluginTrace.java @@ -0,0 +1,181 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.rocm.core.ctfplugin.trace; + +import java.util.Map; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTrace; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout; +import org.eclipse.tracecompass.incubator.internal.rocm.core.Activator; +import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.RocmEventLayout; +import org.eclipse.tracecompass.incubator.rocm.core.trace.RocmTrace; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; +import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect; +import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException; +import org.eclipse.tracecompass.tmf.core.trace.ITmfContext; +import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus; +import org.eclipse.tracecompass.tmf.ctf.core.context.CtfLocation; +import org.eclipse.tracecompass.tmf.ctf.core.context.CtfLocationInfo; +import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTraceValidationStatus; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableList.Builder; + +/** + * Trace type for traces generated by the CTF plugin in ROCm + * + * @author Arnaud Fiorini + */ +public class RocmCtfPluginTrace extends RocmTrace implements IGpuTrace { + + private @Nullable Boolean fIsContainingKernelGpuActivity; + + private ImmutableList> fAspects = ImmutableList.of(TID_ASPECT, FUNCTION_NAME_ASPECT); + + private static final int MAX_OPERATIONS_UNTIL_OPERATION_END = 100; + private static final int CONFIDENCE = 101; + + @Override + public @NonNull IGpuTraceEventLayout getGpuTraceEventLayout() { + return RocmCtfPluginTraceEventLayout.getInstance(); + } + + @Override + public Iterable> getEventAspects() { + return fAspects; + } + + @Override + public void initTrace(final @Nullable IResource resource, final @Nullable String path, + final @Nullable Class eventType) throws TmfTraceException { + super.initTrace(resource, path, eventType); + + ImmutableList.Builder> builder = new Builder<>(); + builder.addAll(super.getEventAspects()); + fAspects = builder.build(); + lookForKernelGpuActivityMetadata(); + } + + @Override + public @Nullable IStatus validate(final @Nullable IProject project, final @Nullable String path) { + IStatus status = super.validate(project, path); + if (status instanceof CtfTraceValidationStatus) { + Map environment = ((CtfTraceValidationStatus) status).getEnvironment(); + /* Make sure the domain is "kernel" in the trace's env vars */ + String domain = environment.get("tracer_name"); //$NON-NLS-1$ + boolean isRocprofilerVersionPresent = environment.get("rocprofiler_version") != null; //$NON-NLS-1$ + if (domain == null || !domain.equals("\"barectf\"")) { //$NON-NLS-1$ + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, + "This trace was not recognized as a ROCm trace. You can update your rocprofiler version or you can change manually the tracer name to \"rocprof\" in the metadata file to force the validation."); //$NON-NLS-1$ + } + if (isRocprofilerVersionPresent) { + return new TraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID); + } + } + return status; + } + + /** + * Look for metadata indicating if the trace contains kernel gpu activity + * events. Otherwise if it is requested, let the method + * isContainingKernelGpuActivity to calculate this boolean if the metadata + * is not present. + */ + private void lookForKernelGpuActivityMetadata() { + @SuppressWarnings("null") + Map environment = this.getEnvironment(); + /* Make sure the domain is "kernel" in the trace's env vars */ + String rocprofilerArgs = environment.get("args"); //$NON-NLS-1$ + if (rocprofilerArgs == null) { + return; + } else if (rocprofilerArgs.contains("--sys-trace") || rocprofilerArgs.contains("--hsa-trace")) { //$NON-NLS-1$ //$NON-NLS-2$ + fIsContainingKernelGpuActivity = true; + } + fIsContainingKernelGpuActivity = false; + } + + /** + * Look for kernel GPU activity in the trace and tries to correlate it with + * API events. + * + * @return if the trace contains GPU kernel activity. + */ + public boolean isContainingKernelGpuActivity() { + if (fIsContainingKernelGpuActivity != null) { + return fIsContainingKernelGpuActivity; + } + ITmfContext context = seekEvent(new CtfLocation(new CtfLocationInfo(0L, 0L))); + ITmfEvent event = getNext(context); + Long hipLaunchKernelEventCorrelationId = -1L; + RocmEventLayout layout = new RocmEventLayout(); + Integer i = 0; + while (event != null && i < MAX_OPERATIONS_UNTIL_OPERATION_END) { + Long correlationId = event.getContent().getFieldValue(Long.class, layout.fieldCorrelationId()); + if (correlationId == null) { + event = getNext(context); + continue; + } + if (event.getName().equals(layout.hipLaunchKernelBegin())) { + if (hipLaunchKernelEventCorrelationId == -1) { + hipLaunchKernelEventCorrelationId = correlationId; + } + i += 1; + } + if (event.getName().equals(layout.getHipOperationBegin()) && correlationId.equals(hipLaunchKernelEventCorrelationId)) { + fIsContainingKernelGpuActivity = true; + return fIsContainingKernelGpuActivity; + } + event = getNext(context); + } + fIsContainingKernelGpuActivity = false; + return fIsContainingKernelGpuActivity; + } + + private static final ITmfEventAspect TID_ASPECT = new ITmfEventAspect<>() { + @Override + public String getName() { + return "Thread ID"; //$NON-NLS-1$ + } + + @Override + public String getHelpText() { + return ITmfEventAspect.EMPTY_STRING; + } + + @Override + public @Nullable Integer resolve(ITmfEvent event) { + return event.getContent().getFieldValue(Integer.class, RocmCtfPluginTraceEventLayout.getInstance().fieldThreadId()); + } + }; + + private static final ITmfEventAspect FUNCTION_NAME_ASPECT = new ITmfEventAspect<>() { + @Override + public String getName() { + return "Function name"; //$NON-NLS-1$ + } + + @Override + public String getHelpText() { + return ITmfEventAspect.EMPTY_STRING; + } + + @Override + public @Nullable String resolve(ITmfEvent event) { + return RocmCtfPluginTraceEventLayout.getInstance().getCorrespondingApiLayout(event).getEventName(event); + } + }; +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/RocmCtfPluginTraceEventLayout.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/RocmCtfPluginTraceEventLayout.java new file mode 100644 index 000000000..1618db011 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/RocmCtfPluginTraceEventLayout.java @@ -0,0 +1,121 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.rocm.core.ctfplugin.trace; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; + +import com.google.common.collect.ImmutableList; + +/** + * Event layout for GPU events in traces generated by the CTF plugin in ROCm + * + * @author Arnaud Fiorini + */ +public class RocmCtfPluginTraceEventLayout implements IGpuTraceEventLayout { + + /** Suffix for HSA events */ + public static final String HSA_BEGIN_SUFFIX = "_begin"; //$NON-NLS-1$ + /** Suffix for HIP events */ + public static final String HIP_BEGIN_SUFFIX = "Begin"; //$NON-NLS-1$ + /** HIP string */ + public static final String HIP = "hip"; //$NON-NLS-1$ + /** HSA string */ + public static final String HSA = "hsa"; //$NON-NLS-1$ + /** HIP operation */ + public static final String HIP_OP = "hip_op"; //$NON-NLS-1$ + /** HSA operation */ + public static final String HSA_OP = "hsa_op"; //$NON-NLS-1$ + + private static @Nullable RocmCtfPluginTraceEventLayout INSTANCE; + private static List fApiLayouts = ImmutableList.of(new HsaApiEventLayout(), new HipApiEventLayout()); + + /** + * The instance of this event layout + *

+ * This object is completely immutable, so no need to create additional + * instances via the constructor. + * + * @return the instance + */ + public static synchronized RocmCtfPluginTraceEventLayout getInstance() { + RocmCtfPluginTraceEventLayout instance = INSTANCE; + if (instance == null) { + instance = new RocmCtfPluginTraceEventLayout(); + INSTANCE = instance; + } + return instance; + } + + @Override + public @NonNull Collection getApiLayouts() { + return fApiLayouts; + } + + @Override + public @NonNull IApiEventLayout getCorrespondingApiLayout(ITmfEvent event) { + if (event.getName().startsWith(HSA)) { + return fApiLayouts.get(0); + } + return fApiLayouts.get(1); + } + + @Override + public boolean isMemcpyBegin(ITmfEvent event) { + return false; + } + + @Override + public boolean isLaunchBegin(ITmfEvent event) { + return false; + } + + @Override + public boolean isApiEvent(ITmfEvent event) { + String name = event.getName(); + return (name.startsWith(HSA) && !name.startsWith(HSA_OP)) || (name.startsWith(HIP) && !name.startsWith(HIP_OP)); + } + + @Override + public @NonNull String fieldThreadId() { + return "context._thread_id"; //$NON-NLS-1$ + } + + @Override + public @NonNull String fieldDuration() { + return ""; //$NON-NLS-1$ + } + + /** + * Event layout for HSA api events + */ + public static class HsaApiEventLayout extends RocmApiCtfPluginEventLayout { + @Override + public String getApiName() { + return "HSA"; //$NON-NLS-1$ + } + } + + /** + * Event layout for HIP api events + */ + public static class HipApiEventLayout extends RocmApiCtfPluginEventLayout { + @Override + public String getApiName() { + return "HIP"; //$NON-NLS-1$ + } + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/old/package-info.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/package-info.java similarity index 72% rename from analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/old/package-info.java rename to analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/package-info.java index 76107c260..68c0b0a2a 100644 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/old/package-info.java +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/ctfplugin/trace/package-info.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023 École Polytechnique de Montréal + * Copyright (c) 2024 É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 2.0 which @@ -9,4 +9,5 @@ * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ -package org.eclipse.tracecompass.incubator.rocm.core.trace.old; +@org.eclipse.jdt.annotation.NonNullByDefault +package org.eclipse.tracecompass.incubator.rocm.core.ctfplugin.trace; \ No newline at end of file diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/RocmApiEventLayout.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/RocmApiEventLayout.java new file mode 100644 index 000000000..43f33badb --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/RocmApiEventLayout.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.rocm.core.exatracer.trace; + +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout.IApiEventLayout; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; + +/** + * Event layout for API events in traces generated by exatracer + * + * @author Arnaud Fiorini + */ +public abstract class RocmApiEventLayout implements IApiEventLayout { + + @Override + public boolean isBeginEvent(ITmfEvent event) { + return event.getName().endsWith(RocmExatracerTraceEventLayout.BEGIN_SUFFIX); + } + + @Override + public String getEventName(ITmfEvent event) { + if (isBeginEvent(event)) { + return event.getName().substring(4, event.getName().length() - 6); + } + return event.getName().substring(4, event.getName().length() - 5); + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/RocmExatracerTrace.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/RocmExatracerTrace.java new file mode 100644 index 000000000..f392b6cd6 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/RocmExatracerTrace.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.rocm.core.exatracer.trace; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.tracecompass.analysis.os.linux.core.event.aspect.LinuxPidAspect; +import org.eclipse.tracecompass.analysis.os.linux.core.event.aspect.LinuxTidAspect; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTrace; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout; +import org.eclipse.tracecompass.incubator.internal.rocm.core.Activator; +import org.eclipse.tracecompass.incubator.rocm.core.trace.RocmTrace; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; +import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect; +import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus; +import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTraceValidationStatus; + +/** + * Traces generated by the exatracer and ROCm runtime + * + * @author Arnaud Fiorini + */ +public class RocmExatracerTrace extends RocmTrace implements IGpuTrace { + + private static final int CONFIDENCE = 101; + + /** + * Constructor + */ + public RocmExatracerTrace() { + super(); + } + + private static LinuxPidAspect fVpidAspect = new LinuxPidAspect() { + @Override + public @Nullable Integer resolve(ITmfEvent event) { + Long fieldValue = event.getContent().getFieldValue(Long.class, "context._vpid"); //$NON-NLS-1$ + if (fieldValue != null) { + return fieldValue.intValue(); + } + return null; + } + }; + private static LinuxTidAspect fVtidAspect = new LinuxTidAspect() { + @Override + public @Nullable Integer resolve(ITmfEvent event) { + Long fieldValue = event.getContent().getFieldValue(Long.class, "context._vtid"); //$NON-NLS-1$ + if (fieldValue != null) { + return fieldValue.intValue(); + } + fieldValue = event.getContent().getFieldValue(Long.class, RocmExatracerTraceEventLayout.getInstance().fieldThreadId()); + if (fieldValue != null) { + return fieldValue.intValue(); + } + return null; + } + }; + + @Override + public @Nullable IStatus validate(@Nullable IProject project, @Nullable String path) { + IStatus status = super.validate(project, path); + if (status instanceof CtfTraceValidationStatus) { + Map environment = ((CtfTraceValidationStatus) status).getEnvironment(); + /* Make sure the domain is "kernel" in the trace's env vars */ + String domain = environment.get("tracer_name"); //$NON-NLS-1$ + if (domain == null || !domain.equals("\"lttng-ust\"")) { //$NON-NLS-1$ + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, + "This trace was not recognized as a ROCm trace. You can update your rocprofiler version or you can change manually the tracer name to \"rocprof\" in the metadata file to force the validation."); //$NON-NLS-1$ + } + return new TraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID); + } + return status; + } + + @Override + public Iterable> getEventAspects() { + Iterable> oldAspects = super.getEventAspects(); + List> aspects = new ArrayList<>(); + for (ITmfEventAspect aspect : oldAspects) { + aspects.add(aspect); + } + aspects.add(fVpidAspect); + aspects.add(fVtidAspect); + return aspects; + } + + @Override + public @NonNull IGpuTraceEventLayout getGpuTraceEventLayout() { + return RocmExatracerTraceEventLayout.getInstance(); + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/RocmExatracerTraceEventLayout.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/RocmExatracerTraceEventLayout.java new file mode 100644 index 000000000..d6e9f49e8 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/RocmExatracerTraceEventLayout.java @@ -0,0 +1,114 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.rocm.core.exatracer.trace; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.tracecompass.incubator.gpu.core.trace.IGpuTraceEventLayout; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; + +import com.google.common.collect.ImmutableList; + +/** + * Event layout for events in traces generated by exatracer + * + * @author Arnaud Fiorini + */ +public class RocmExatracerTraceEventLayout implements IGpuTraceEventLayout { + + /** Suffix for API events */ + public static final String BEGIN_SUFFIX = "_entry"; //$NON-NLS-1$\ + /** HIP string */ + public static final String HIP = "hip"; //$NON-NLS-1$ + /** HSA string */ + public static final String HSA = "hsa"; //$NON-NLS-1$ + + private static @Nullable RocmExatracerTraceEventLayout INSTANCE; + private static List fApiLayouts = ImmutableList.of(new HsaApiEventLayout(), new HipApiEventLayout()); + + /** + * The instance of this event layout + *

+ * This object is completely immutable, so no need to create additional + * instances via the constructor. + * + * @return the instance + */ + public static synchronized RocmExatracerTraceEventLayout getInstance() { + RocmExatracerTraceEventLayout instance = INSTANCE; + if (instance == null) { + instance = new RocmExatracerTraceEventLayout(); + INSTANCE = instance; + } + return instance; + } + + @Override + public @NonNull Collection getApiLayouts() { + return fApiLayouts; + } + + @Override + public @NonNull IApiEventLayout getCorrespondingApiLayout(ITmfEvent event) { + if (event.getName().startsWith(HSA)) { + return fApiLayouts.get(0); + } + return fApiLayouts.get(1); + } + + @Override + public boolean isMemcpyBegin(ITmfEvent event) { + return false; + } + + @Override + public boolean isLaunchBegin(ITmfEvent event) { + return false; + } + + @Override + public boolean isApiEvent(ITmfEvent event) { + return event.getName().startsWith(HSA) || event.getName().startsWith(HIP); + } + + @Override + public @NonNull String fieldThreadId() { + return "lttng_thread_id"; //$NON-NLS-1$ + } + + @Override + public @NonNull String fieldDuration() { + return ""; //$NON-NLS-1$ + } + + /** + * Event layout for HSA api events + */ + public static class HsaApiEventLayout extends RocmApiEventLayout { + @Override + public String getApiName() { + return "HSA"; //$NON-NLS-1$ + } + } + + /** + * Event layout for HIP api events + */ + public static class HipApiEventLayout extends RocmApiEventLayout { + @Override + public String getApiName() { + return "HIP"; //$NON-NLS-1$ + } + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/dependency/package-info.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/package-info.java similarity index 66% rename from analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/dependency/package-info.java rename to analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/package-info.java index e792dc674..fd0f0dd78 100644 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/internal/rocm/core/analysis/dependency/package-info.java +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/exatracer/trace/package-info.java @@ -1,5 +1,5 @@ -/********************************************************************** - * Copyright (c) 2022 École Polytechnique de Montréal +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which @@ -7,6 +7,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ + *******************************************************************************/ -package org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.dependency; +@org.eclipse.jdt.annotation.NonNullByDefault +package org.eclipse.tracecompass.incubator.rocm.core.exatracer.trace; \ No newline at end of file diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/GpuAspect.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/GpuAspect.java deleted file mode 100644 index 3813c9a34..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/GpuAspect.java +++ /dev/null @@ -1,91 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.rocm.core.trace; - -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.event.ITmfEventField; -import org.eclipse.tracecompass.tmf.core.event.aspect.TmfDeviceAspect; -import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent; - -/** - * This aspect describes which GPU is related to each GPU activity or Kernel - * event - * - * @author Arnaud Fiorini - */ -public final class GpuAspect extends TmfDeviceAspect { - - /** The singleton instance */ - public static final GpuAspect INSTANCE = new GpuAspect(); - - private GpuAspect() { - } - - @Override - public String getName() { - return Messages.getMessage(Messages.AspectName_GPU); - } - - @Override - public String getHelpText() { - return Messages.getMessage(Messages.AspectHelpText_GPU); - } - - /** - * Gets the GPU number if available on an event - * - * @param event - * The event to get the GPU number from - * @return the GPU number of the GPU on which this event was executed or - * {@code null} - */ - @Override - public @Nullable Integer resolve(ITmfEvent event) { - if (!(event instanceof CtfTmfEvent)) { - return null; - } - ITmfEventField content = event.getContent(); - if (content != null) { - Integer fieldValue = content.getFieldValue(Integer.class, RocmStrings.DEVICE_ID); - if (fieldValue == null) { - fieldValue = content.getFieldValue(Integer.class, RocmStrings.GPU_ID); - } - return fieldValue == null ? null : fieldValue.intValue(); - } - return null; - } - - /** - * Consider all sub-instance of this type "equal", so that they get merged - * in a single CPU column/aspect. - * - * @param other - * The object to compare it with - * @return true if the object is of the same type - */ - @Override - public boolean equals(@Nullable Object other) { - return (other instanceof GpuAspect); - } - - @Override - public String getDeviceType() { - return "gpu"; //$NON-NLS-1$ - } - - @Override - public int hashCode() { - return getName().hashCode(); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/Messages.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/Messages.java deleted file mode 100644 index e5bbaae71..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/Messages.java +++ /dev/null @@ -1,85 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.rocm.core.trace; - -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.osgi.util.NLS; - -/** - * Aspect names for the ROCm GPU traces - * - * @author Arnaud Fiorini - */ -@org.eclipse.jdt.annotation.NonNullByDefault -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.tracecompass.incubator.rocm.core.trace.messages"; //$NON-NLS-1$ - - /** Name for the GPU aspect which displays the GPU id number */ - public static @Nullable String AspectName_GPU; - - /** Description of the GPU aspect */ - public static @Nullable String AspectHelpText_GPU; - - /** Name of the PID aspect which displays the PID (Process Id) */ - public static @Nullable String AspectName_PID; - - /** Name of the TID aspect which displays the TID (Thread Id) */ - public static @Nullable String AspectName_TID; - - /** Name of the Queue Id which displays the id of the GPU queue */ - public static @Nullable String AspectName_QueueID; - - /** Name of the Stream Id which displays the id of the HIP streams */ - public static @Nullable String AspectName_StreamID; - - /** - * Name of the aspect which displays the index of the operation in the GPU - * queue - */ - public static @Nullable String AspectName_QueueIndex; - - /** - * Function name which displays the function called for each event in the - * trace - */ - public static @Nullable String AspectName_FunctionName; - - /** - * Nanosecond normalized timestamp - * - * @since 6.2 - */ - public static @Nullable String AspectName_Timestamp_Nanoseconds; - /** - * Explanation of why use a nanosecond normalized timestamp - * - * @since 6.2 - */ - public static @Nullable String AspectName_Timestamp_Nanoseconds_Help; - - static { - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } - - /** - * Helper method to expose externalized strings as non-null objects. - */ - static String getMessage(@Nullable String msg) { - if (msg == null) { - return ""; //$NON-NLS-1$ - } - return msg; - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmAspects.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmAspects.java deleted file mode 100644 index 0107e246b..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmAspects.java +++ /dev/null @@ -1,213 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.rocm.core.trace; - -import java.util.List; - -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.handlers.old.ApiEventHandler; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect; - -import com.google.common.collect.ImmutableList; - -/** - * Some aspects to help the user navigate the ROCm events. - * - * @author Arnaud Fiorini - */ -@org.eclipse.jdt.annotation.NonNullByDefault -public class RocmAspects { - private static final ITmfEventAspect PID_ASPECT = new ITmfEventAspect() { - @Override - public String getName() { - return Messages.getMessage(Messages.AspectName_PID); - } - - @Override - public String getHelpText() { - return ITmfEventAspect.EMPTY_STRING; - } - - @Override - public @Nullable Integer resolve(ITmfEvent event) { - return event.getContent().getFieldValue(Integer.class, RocmStrings.PID); - } - }; - - private static final ITmfEventAspect TID_ASPECT = new ITmfEventAspect() { - @Override - public String getName() { - return Messages.getMessage(Messages.AspectName_TID); - } - - @Override - public String getHelpText() { - return ITmfEventAspect.EMPTY_STRING; - } - - @Override - public @Nullable Integer resolve(ITmfEvent event) { - return event.getContent().getFieldValue(Integer.class, RocmStrings.TID); - } - }; - - private static final ITmfEventAspect QUEUE_ID_ASPECT = new ITmfEventAspect() { - @Override - public String getName() { - return Messages.getMessage(Messages.AspectName_QueueID); - } - - @Override - public String getHelpText() { - return ITmfEventAspect.EMPTY_STRING; - } - - @Override - public @Nullable Integer resolve(ITmfEvent event) { - return event.getContent().getFieldValue(Integer.class, RocmStrings.QUEUE_ID); - } - }; - - private static final ITmfEventAspect STREAM_ID_ASPECT = new ITmfEventAspect() { - @Override - public String getName() { - return Messages.getMessage(Messages.AspectName_StreamID); - } - - @Override - public String getHelpText() { - return ITmfEventAspect.EMPTY_STRING; - } - - @Override - public @Nullable Integer resolve(ITmfEvent event) { - return event.getContent().getFieldValue(Integer.class, RocmStrings.STREAM_ID); - } - }; - - private static final ITmfEventAspect QUEUE_INDEX_ASPECT = new ITmfEventAspect() { - @Override - public String getName() { - return Messages.getMessage(Messages.AspectName_QueueIndex); - } - - @Override - public String getHelpText() { - return ITmfEventAspect.EMPTY_STRING; - } - - @Override - public @Nullable Integer resolve(ITmfEvent event) { - return event.getContent().getFieldValue(Integer.class, RocmStrings.QUEUE_INDEX); - } - }; - - private static final ITmfEventAspect FUNCTION_NAME_ASPECT = new ITmfEventAspect() { - @Override - public String getName() { - return Messages.getMessage(Messages.AspectName_FunctionName); - } - - @Override - public String getHelpText() { - return ITmfEventAspect.EMPTY_STRING; - } - - @Override - public @Nullable String resolve(ITmfEvent event) { - if (event.getName().endsWith("_api")) { //$NON-NLS-1$ - return ApiEventHandler.getFunctionApiName(event); - } - String name = event.getContent().getFieldValue(String.class, RocmStrings.NAME); - if (name == null) { - name = event.getContent().getFieldValue(String.class, RocmStrings.KERNEL_NAME); - } - return name; - } - }; - - private static final List> ASPECTS = ImmutableList.of( - getPIDAspect(), - getTIDAspect(), - getQueueIDAspect(), - getStreamIDAspect(), - getQueueIndexAspect(), - getFunctionNameAspect()); - - private RocmAspects() { - } - - /** - * Get the aspect for the event pid - * - * @return The process ID - */ - public static ITmfEventAspect getPIDAspect() { - return PID_ASPECT; - } - - /** - * Get the aspect for the event tid - * - * @return The thread ID - */ - public static ITmfEventAspect getTIDAspect() { - return TID_ASPECT; - } - - /** - * Get the aspect for the event HSA queue ID - * - * @return The queue ID - */ - public static ITmfEventAspect getQueueIDAspect() { - return QUEUE_ID_ASPECT; - } - - /** - * Get the aspect for the event HIP stream ID - * - * @return The stream ID - */ - public static ITmfEventAspect getStreamIDAspect() { - return STREAM_ID_ASPECT; - } - - /** - * Get the aspect for the event queue index - * - * @return The event index in its HSA queue - */ - public static ITmfEventAspect getQueueIndexAspect() { - return QUEUE_INDEX_ASPECT; - } - - /** - * Get the name of the function executed represented by the event - * - * @return The function name - */ - public static ITmfEventAspect getFunctionNameAspect() { - return FUNCTION_NAME_ASPECT; - } - - /** - * Get the list of all Rocm aspects - * - * @return the list of aspects - */ - public static List> getAllAspects() { - return ASPECTS; - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmCounterAspect.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmCounterAspect.java deleted file mode 100644 index 3fa730f5a..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmCounterAspect.java +++ /dev/null @@ -1,114 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.rocm.core.trace; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.tracecompass.analysis.counters.core.CounterAnalysis; -import org.eclipse.tracecompass.analysis.counters.core.aspects.CounterAspect; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem; -import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils; -import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace; - -/** - * Counter aspects to make use of the Counter analysis - * - * @author Arnaud Fiorini - */ -public class RocmCounterAspect extends CounterAspect { - - private Integer fCounterId; - - /** - * Rocm Counter Aspect constructor - * - * @param fieldName - * The field of the performance counter - * @param label - * Label describing the performance counter - * @param class1 - * The Gpu group to which the counter is associated - * @param counterId - * the counter id which allows to retrieve the label after - * initialization - */ - public RocmCounterAspect(@NonNull String fieldName, @NonNull String label, Class<@NonNull GpuAspect> class1, Integer counterId) { - super(fieldName, label, class1); - fCounterId = counterId; - } - - /** - * Rocm Counter Aspect constructor - * - * @param fieldName - * The field of the performance counter - * @param label - * Label describing the performance counter - * @param counterId - * the counter id which allows to retrieve the label after - * initialization - */ - public RocmCounterAspect(@NonNull String fieldName, @NonNull String label, Integer counterId) { - super(fieldName, label); - fCounterId = counterId; - } - - @Override - public boolean isCumulative() { - return false; - } - - @Override - public @Nullable Number resolve(@NonNull ITmfEvent event) { - Integer counterId = event.getContent().getFieldValue(Integer.class, RocmStrings.ID); - if (fCounterId.equals(counterId)) { - if (event.getName().equals(RocmStrings.METRIC_DOUBLE)) { - return event.getContent().getFieldValue(Double.class, RocmStrings.VALUE); - } else if (event.getName().equals(RocmStrings.METRIC_INTEGER)) { - return event.getContent().getFieldValue(Long.class, RocmStrings.VALUE); - } - } - if (event.getName().equals(RocmStrings.HIP_ACTIVITY)) { - CounterAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(event.getTrace(), - CounterAnalysis.class, CounterAnalysis.ID); - if (module == null) { - return null; - } - ITmfStateSystem ss = module.getStateSystem(); - if (ss == null) { - return null; - } - try { - String gpuId = event.getContent().getFieldValue(String.class, RocmStrings.DEVICE_ID); - int groupQuark = ss.getQuarkAbsolute(CounterAnalysis.GROUPED_COUNTER_ASPECTS_ATTRIB); - int gpuGroupQuark = ss.getQuarkRelative(groupQuark, GpuAspect.INSTANCE.getName()); - int gpuQuark = ss.getQuarkRelative(gpuGroupQuark, gpuId); - int counterQuark = ss.getQuarkRelative(gpuQuark, this.getName()); - Long timestampEnd = event.getContent().getFieldValue(Long.class, RocmStrings.END); - if (timestampEnd != null) { - long valueBefore = ss.querySingleState(event.getTimestamp().getValue(), counterQuark).getValueLong(); - long valueAfter = ss.querySingleState(((CtfTmfTrace) event.getTrace()).timestampCyclesToNanos(timestampEnd), counterQuark).getValueLong(); - return valueAfter - valueBefore; - } - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - // Either the analysis is not available or the state system has - // not been written yet. - return null; - } - } - return null; - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmTrace.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmTrace.java new file mode 100644 index 000000000..031364fa4 --- /dev/null +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmTrace.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2024 É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 2.0 which + * accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tracecompass.incubator.rocm.core.trace; + +import java.util.Collection; + +import org.eclipse.core.resources.IResource; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; +import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect; +import org.eclipse.tracecompass.tmf.core.event.aspect.TmfBaseAspects; +import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException; +import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableList.Builder; +import com.google.common.collect.ImmutableSet; + +/** + * Traces generated by the ROCm environment (ROC-tracer and/or ROC-profiler) + * that use the CTF format. These traces are identified using the tracer_name + * environment variable. + * + * @author Arnaud Fiorini + */ +public class RocmTrace extends CtfTmfTrace { + + private static final Collection> ROCM_CTF_ASPECTS = ImmutableList.of( + TmfBaseAspects.getTimestampAspect(), + TmfBaseAspects.getEventTypeAspect(), + TmfBaseAspects.getContentsAspect(), + TmfBaseAspects.getTraceNameAspect()); + + /** Collection of aspects, default values */ + private Collection> fAspects = ImmutableSet.copyOf(ROCM_CTF_ASPECTS); + + @Override + public Iterable> getEventAspects() { + return fAspects; + } + + @Override + public void initTrace(final @Nullable IResource resource, final @Nullable String path, + final @Nullable Class eventType) throws TmfTraceException { + super.initTrace(resource, path, eventType); + + ImmutableList.Builder> builder = new Builder<>(); + builder.addAll(ROCM_CTF_ASPECTS); + fAspects = builder.build(); + } +} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmTraceSymbolProvider.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmTraceSymbolProvider.java deleted file mode 100644 index ffee18c84..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmTraceSymbolProvider.java +++ /dev/null @@ -1,99 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.rocm.core.trace; - -import org.apache.commons.lang3.StringUtils; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.tracecompass.incubator.internal.rocm.core.Activator; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmMetadataAnalysis; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmMetadataStateProvider; -import org.eclipse.tracecompass.incubator.rocm.core.trace.old.RocmTrace; -import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem; -import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException; -import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException; -import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider; -import org.eclipse.tracecompass.tmf.core.symbols.TmfResolvedSymbol; -import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; -import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils; - -/** - * Symbol provider to resolve api function ids to their names - * - * @author Arnaud Fiorini - */ -public class RocmTraceSymbolProvider implements ISymbolProvider { - - private @NonNull ITmfTrace fTrace; - - /** - * Constructor - * - * @param trace - * The trace this provider is for - */ - public RocmTraceSymbolProvider(@NonNull ITmfTrace trace) { - fTrace = trace; - } - - @Override - public @NonNull ITmfTrace getTrace() { - return fTrace; - } - - @Override - public void loadConfiguration(@Nullable IProgressMonitor monitor) { - // No configuration - } - - @Override - public @Nullable TmfResolvedSymbol getSymbol(long address) { - RocmMetadataAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(getTrace(), - RocmMetadataAnalysis.class, RocmMetadataAnalysis.ID); - if (module == null) { - /* - * The analysis is not available for this trace, we won't be able to - * find the information. - */ - return null; - } - ITmfStateSystem ss = module.getStateSystem(); - if (ss == null || address == -1) { - return new TmfResolvedSymbol(address, StringUtils.EMPTY); - } - String functionName; - try { - RocmTrace trace = (RocmTrace) getTrace(); - int nApi = trace.getNApi(); - Integer apiId = (int) (address % nApi); - int cid = (int) ((address - apiId) / nApi); - int functionNameQuark = ss.getQuarkAbsolute(RocmMetadataStateProvider.FUNCTION_NAMES); - int apiQuark = ss.getQuarkRelative(functionNameQuark, apiId.toString()); - functionName = ss.querySingleState(ss.getStartTime() + cid, apiQuark).getValueString(); - if (functionName == null) { - functionName = StringUtils.EMPTY; - Activator.getInstance().logWarning("The function name with cid " + cid + //$NON-NLS-1$ - " and the apiId " + apiId + " was not found in the state system"); //$NON-NLS-1$ //$NON-NLS-2$ - } - } catch (AttributeNotFoundException | StateSystemDisposedException e) { - Activator.getInstance().logError(e.getMessage()); - return new TmfResolvedSymbol(address, StringUtils.EMPTY); - } - return new TmfResolvedSymbol(address, functionName); - } - - @Override - public @Nullable TmfResolvedSymbol getSymbol(int pid, long timestamp, long address) { - return getSymbol(address); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmTraceSymbolProviderFactory.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmTraceSymbolProviderFactory.java deleted file mode 100644 index bc51e798a..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/RocmTraceSymbolProviderFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.rocm.core.trace; - -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmMetadataAnalysis; -import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider; -import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProviderFactory; -import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; -import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils; - -/** - * Factory for the ROCm Symbol provider - * - * @author Arnaud Fiorini - */ -public class RocmTraceSymbolProviderFactory implements ISymbolProviderFactory { - - @Override - public @Nullable ISymbolProvider createProvider(@NonNull ITmfTrace trace) { - RocmMetadataAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace, - RocmMetadataAnalysis.class, RocmMetadataAnalysis.ID); - if (module == null) { - return null; - } - return new RocmTraceSymbolProvider(trace); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/messages.properties b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/messages.properties deleted file mode 100644 index 8afaa273a..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/messages.properties +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################### -# Copyright (c) 2022 É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 2.0 which -# accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -############################################################################### - -AspectName_Timestamp_Nanoseconds=Timestamp ns -AspectName_Timestamp_Nanoseconds_Help=Timestamp in nanoseconds, normalized and useful for calculations -AspectName_GPU=GPU -AspectHelpText_GPU=The GPU on which this event happened -AspectName_PID=PID -AspectName_TID=TID -AspectName_QueueID=Queue ID -AspectName_StreamID=Stream ID -AspectName_QueueIndex=Queue Index -AspectName_FunctionName=Function Name diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/old/RocmTrace.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/old/RocmTrace.java deleted file mode 100644 index 5dcb425cc..000000000 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/old/RocmTrace.java +++ /dev/null @@ -1,232 +0,0 @@ -/********************************************************************** - * Copyright (c) 2022 É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 2.0 which - * accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - **********************************************************************/ - -package org.eclipse.tracecompass.incubator.rocm.core.trace.old; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jdt.annotation.NonNull; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.tracecompass.incubator.internal.rocm.core.Activator; -import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmStrings; -import org.eclipse.tracecompass.incubator.rocm.core.trace.GpuAspect; -import org.eclipse.tracecompass.incubator.rocm.core.trace.RocmAspects; -import org.eclipse.tracecompass.incubator.rocm.core.trace.RocmCounterAspect; -import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; -import org.eclipse.tracecompass.tmf.core.event.ITmfEventType; -import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect; -import org.eclipse.tracecompass.tmf.core.event.aspect.TmfBaseAspects; -import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException; -import org.eclipse.tracecompass.tmf.core.filter.ITmfFilter; -import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange; -import org.eclipse.tracecompass.tmf.core.trace.ITmfContext; -import org.eclipse.tracecompass.tmf.core.trace.ITmfTraceWithPreDefinedEvents; -import org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext; -import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus; -import org.eclipse.tracecompass.tmf.ctf.core.context.CtfLocation; -import org.eclipse.tracecompass.tmf.ctf.core.context.CtfLocationInfo; -import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace; -import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTraceValidationStatus; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableList.Builder; -import com.google.common.collect.ImmutableSet; - -/** - * Traces generated by the ROCm environment (ROC-tracer and/or ROC-profiler) - * that use the CTF format. These traces are identified using the tracer_name - * environment variable. - * - * @author Arnaud Fiorini - */ -public class RocmTrace extends CtfTmfTrace { - - private static final @NonNull Collection<@NonNull ITmfEventAspect> ROCM_CTF_ASPECTS = ImmutableList.of( - TmfBaseAspects.getTimestampAspect(), - TmfBaseAspects.getEventTypeAspect(), - TmfBaseAspects.getContentsAspect(), - TmfBaseAspects.getTraceNameAspect()); - - /** Collection of aspects, default values */ - private @NonNull Collection> fAspects = ImmutableSet.copyOf(ROCM_CTF_ASPECTS); - - private static final int CONFIDENCE = 100; - /** - * This is a reduction factor to avoid overflows. - */ - private static final int REDUCTION_FACTOR = 4096; - - private static final int VERSION = 1; - - /** Api type mapped to integer ids */ - private Map fApiMap; - - /** - * Constructor - */ - public RocmTrace() { - super(); - } - - @Override - public Iterable> getEventAspects() { - return fAspects; - } - - @Override - public void initTrace(final IResource resource, final String path, - final Class eventType) throws TmfTraceException { - super.initTrace(resource, path, eventType); - - initializeApiMap(); - - ImmutableList.Builder> builder = new Builder<>(); - builder.add(GpuAspect.INSTANCE); - builder.addAll(createRocmAspects(this)); - builder.addAll(ROCM_CTF_ASPECTS); - builder.addAll(createCounterAspects(this)); - fAspects = builder.build(); - } - - /** - * @param apiName - * the name of API (HIP, HSA) - * @return the api ID - */ - public int getApiId(String apiName) { - return fApiMap.getOrDefault(apiName, -1); - } - - /** - * @return the number of API defined in the trace - */ - public int getNApi() { - return fApiMap.size(); - } - - private void initializeApiMap() { - fApiMap = new HashMap<>(); - for (ITmfEventType eventType : getContainedEventTypes()) { - if (eventType.getName().endsWith("_api")) { //$NON-NLS-1$ - fApiMap.put(eventType.getName(), fApiMap.size()); - } - } - } - - private static Collection> createRocmAspects(ITmfTraceWithPreDefinedEvents trace) { - ImmutableList.Builder> builder = new Builder<>(); - - for (ITmfEventType eventType : trace.getContainedEventTypes()) { - if (eventType.getName().equals(RocmStrings.HSA_API)) { - builder.add(RocmAspects.getQueueIDAspect()); - builder.add(RocmAspects.getQueueIndexAspect()); - } - if (eventType.getName().equals(RocmStrings.HIP_API)) { - builder.add(RocmAspects.getStreamIDAspect()); - } - } - builder.add(RocmAspects.getPIDAspect()); - builder.add(RocmAspects.getTIDAspect()); - builder.add(RocmAspects.getFunctionNameAspect()); - return builder.build(); - } - - private Collection> createCounterAspects(ITmfTraceWithPreDefinedEvents trace) { - ImmutableSet.Builder> perfBuilder = new ImmutableSet.Builder<>(); - ITmfContext context = seekEvent(new CtfLocation(new CtfLocationInfo(0L, 0L))); - - // Get the number of events or an arbitrary number to check if there is - // any metric definition in the trace - Map environment = getEnvironment(); - int traceSize = 0; - if (environment != null) { - traceSize = Integer.parseInt(environment.get("nb_events")); //$NON-NLS-1$ - } - int nEventsToRead = Integer.min(traceSize, 10000); - - for (ITmfEventType eventType : trace.getContainedEventTypes()) { - if (eventType.getName().equals(RocmStrings.METRIC_NAME)) { - for (int i = 0; i < nEventsToRead; i++) { - ITmfEvent event = getNext(context); - if (event.getName().equals(RocmStrings.METRIC_NAME_END)) { - break; - } - if (event.getName().equals(RocmStrings.METRIC_NAME)) { - buildCounterAspectsFromEvent(perfBuilder, event); - } - } - break; - } - } - - return perfBuilder.build(); - } - - private static void buildCounterAspectsFromEvent(ImmutableSet.Builder> builder, ITmfEvent event) { - String fieldName = event.getContent().getFieldValue(String.class, RocmStrings.NAME); - if (fieldName != null) { - Integer id = event.getContent().getFieldValue(Integer.class, RocmStrings.ID); - builder.add(new RocmCounterAspect(fieldName, fieldName, GpuAspect.class, id)); - } - } - - @Override - public int size() { - Map environment = getEnvironment(); - if (environment != null) { - String size = environment.get("nb_events"); //$NON-NLS-1$ - if (size != null) { - return (int) (Long.parseLong(size) / REDUCTION_FACTOR); - } - } - return super.size(); - } - - @Override - public @Nullable IStatus validate(final @Nullable IProject project, final @Nullable String path) { - IStatus status = super.validate(project, path); - if (status instanceof CtfTraceValidationStatus) { - Map environment = ((CtfTraceValidationStatus) status).getEnvironment(); - /* Make sure the domain is "kernel" in the trace's env vars */ - String domain = environment.get("tracer_name"); //$NON-NLS-1$ - if (domain == null || !domain.equals("\"rocprof\"")) { //$NON-NLS-1$ - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, - "This trace was not recognized as a ROCm trace. You can update your rocprofiler version or you can change manually the tracer name to \"rocprof\" in the metadata file to force the validation."); //$NON-NLS-1$ - } - - int tracerMajor = Integer.parseInt(environment.get("plugin_major")); //$NON-NLS-1$ - int tracerMinor = Integer.parseInt(environment.get("plugin_minor")); //$NON-NLS-1$ - return checkVersion(tracerMajor, tracerMinor); - } - return status; - } - - private static IStatus checkVersion(int tracerMajor, int tracerMinor) { - if (tracerMajor < VERSION) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The tracer version is " + tracerMajor + "." + tracerMinor + " and this version of the ROCm plugin supports only tracer with versions > 3.0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } else if (tracerMajor > VERSION) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The ROCm plugin version needs to be updated to support this new version of rocprofiler."); //$NON-NLS-1$ - } - return new TraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID); - } - - @Override - public TmfTraceContext createTraceContext(TmfTimeRange selection, TmfTimeRange windowRange, @Nullable IFile editorFile, @Nullable ITmfFilter filter) { - return new TmfTraceContext(selection, windowRange, editorFile, filter); - } -} diff --git a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/package-info.java b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/package-info.java index 5be44a940..875db8732 100644 --- a/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/package-info.java +++ b/analyses/org.eclipse.tracecompass.incubator.rocm.core/src/org/eclipse/tracecompass/incubator/rocm/core/trace/package-info.java @@ -9,4 +9,5 @@ * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ +@org.eclipse.jdt.annotation.NonNullByDefault package org.eclipse.tracecompass.incubator.rocm.core.trace; diff --git a/analyses/pom.xml b/analyses/pom.xml index 88f8e2e33..4022d07b5 100644 --- a/analyses/pom.xml +++ b/analyses/pom.xml @@ -56,6 +56,9 @@ org.eclipse.tracecompass.incubator.inandout.core org.eclipse.tracecompass.incubator.inandout.core.tests org.eclipse.tracecompass.incubator.inandout.ui + org.eclipse.tracecompass.incubator.gpu + org.eclipse.tracecompass.incubator.gpu.core + org.eclipse.tracecompass.incubator.gpu.core.tests diff --git a/common/org.eclipse.tracecompass.incubator.releng-site/category.xml b/common/org.eclipse.tracecompass.incubator.releng-site/category.xml index adc4542d0..a4703b51d 100644 --- a/common/org.eclipse.tracecompass.incubator.releng-site/category.xml +++ b/common/org.eclipse.tracecompass.incubator.releng-site/category.xml @@ -72,6 +72,9 @@ + + + diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.gitignore b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.gitignore new file mode 100644 index 000000000..f1ac03781 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.gitignore @@ -0,0 +1 @@ +index/ diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.project b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.project new file mode 100644 index 000000000..7bc847eb4 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.project @@ -0,0 +1,22 @@ + + + org.eclipse.tracecompass.incubator.gpu.doc.user + + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + + diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.settings/org.eclipse.core.resources.prefs b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.settings/org.eclipse.core.runtime.prefs b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 000000000..5a0ad22d2 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 000000000..b196c64a3 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/META-INF/MANIFEST.MF b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/META-INF/MANIFEST.MF new file mode 100644 index 000000000..9942c134f --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 0.10.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.tracecompass.incubator.gpu.doc.user;singleton:=true +Require-Bundle: org.eclipse.help +Automatic-Module-Name: org.eclipse.tracecompass.incubator.gpu.doc.user diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/about.html b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/about.html new file mode 100644 index 000000000..164f781a8 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/about.html @@ -0,0 +1,36 @@ + + + + +About + + +

About This Content

+ +

November 30, 2017

+

License

+ +

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

+ +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/book.css b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/book.css new file mode 100644 index 000000000..797473964 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/book.css @@ -0,0 +1,59 @@ +/* following font face declarations need to be removed for DBCS */ + + +body, h1, h2, h3, h4, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-family: Arial, sans-serif; color: #000000} +pre { font-family: Courier, monospace} + +/* end font face declarations */ + +/* following font size declarations should be OK for DBCS */ +body, h1, h2, h3, h4, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-size: 12pt; } +pre { font-size: 12pt} + +/* end font size declarations */ + +body { background: #FFFFFF} +h1 { font-size: 18pt; margin-top: 5; margin-bottom: 1 } +h2 { font-size: 14pt; margin-top: 25; margin-bottom: 3 } +h3 { font-size: 11pt; margin-top: 20; margin-bottom: 3 } +h4 { font-size: 10pt; margin-top: 20; margin-bottom: 3; font-style: italic } +h5 { font size: 13.5pt; } +p { font-size: 12pt; } +pre { margin-left: 6; font-size: 9pt } + +a:link { color: #006699 } +a:visited { color: #996699 } +a:hover { color: #006699 } + +ul { margin-top: 0; margin-bottom: 10 } +li { margin-top: 0; margin-bottom: 0 } +li p { margin-top: 0; margin-bottom: 0 } +ol { margin-top: 0; margin-bottom: 10 } +dl { margin-top: 0; margin-bottom: 10 } +dt { margin-top: 0; margin-bottom: 0; font-weight: bold } +dd { margin-top: 0; margin-bottom: 0 } +strong { font-weight: bold} +em { font-style: italic} +var { font-style: italic} +div.revision { border-left-style: solid; border-left-width: thin; + border-left-color: #7B68EE; padding-left:5 } +th { font-weight: bold } +.hidden { + display: none; +} + +/* Mike Behm's addition to the style sheet */ +.userinput { font-family: monospace; } +.guitab, .important, .guibutton, .selectblue, .guimenu, .guilabel, +.notetitle { + color: #000000; + font-family: helvetica, arial, sans-serif; + font-weight: bold; + } +div.linux {display:none;} +.firsterm {font-style:italic;} + +.typewriter {font-family:monospace;} +.bold {font-weight:600;} +.linethrough {text-decoration: line-through;} +.underline {text-decoration: underline;} diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/build.properties b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/build.properties new file mode 100644 index 000000000..ed4ef52b4 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/build.properties @@ -0,0 +1,18 @@ +############################################################################### +# Copyright (c) 2024 É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 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### + +bin.includes = plugin.xml,\ + META-INF/,\ + about.html,\ + plugin.properties,\ + book.css,\ + doc/ +src.includes = about.html diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/build.xml b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/build.xml new file mode 100644 index 000000000..6e0dbc625 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/build.xml @@ -0,0 +1,51 @@ + + + + Generate Eclipse help content for the gpu User Guide + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/.gitignore b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/.gitignore new file mode 100644 index 000000000..28d48547c --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/.gitignore @@ -0,0 +1,2 @@ +*.html +*.xml diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/User-Guide.mediawiki b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/User-Guide.mediawiki new file mode 100644 index 000000000..482f5f612 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/User-Guide.mediawiki @@ -0,0 +1,4 @@ + += gpu = + + diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/images/home.gif b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/images/home.gif new file mode 100644 index 000000000..4472e8ce5 Binary files /dev/null and b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/images/home.gif differ diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/images/next.gif b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/images/next.gif new file mode 100644 index 000000000..e2f8c3e1f Binary files /dev/null and b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/images/next.gif differ diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/images/prev.gif b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/images/prev.gif new file mode 100644 index 000000000..4fb415010 Binary files /dev/null and b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/doc/images/prev.gif differ diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/plugin.properties b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/plugin.properties new file mode 100644 index 000000000..8a7f1b849 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/plugin.properties @@ -0,0 +1,13 @@ +############################################################################### +# Copyright (c) 2024 É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 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### + +Bundle-Vendor = Eclipse Trace Compass Incubator +Bundle-Name = Trace Compass GPU User Guide (Incubation) diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/plugin.xml b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/plugin.xml new file mode 100644 index 000000000..43800d9f4 --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/plugin.xml @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/pom.xml b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/pom.xml new file mode 100644 index 000000000..b6172acab --- /dev/null +++ b/doc/org.eclipse.tracecompass.incubator.gpu.doc.user/pom.xml @@ -0,0 +1,125 @@ + + + + 4.0.0 + + + org.eclipse.tracecompass.incubator.doc + org.eclipse.tracecompass.incubator + 0.10.0-SNAPSHOT + + + org.eclipse.tracecompass.incubator.gpu.doc.user + eclipse-plugin + + Trace Compass Incubator gpu User Guide + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + generate-documentation + generate-sources + + + + + + + + run + + + + clean-documentation + clean + + + + + + + run + + + + + + + org.eclipse.tycho.extras + tycho-eclipserun-plugin + + -application org.eclipse.ant.core.antRunner -buildfile build.xml build.index + + + + + maven-clean-plugin + + + clean-index + clean + + + index/ + + + + clean + + + + + + + + + + deploy-doc + + + + maven-antrun-plugin + + + deploy + install + + run + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/pom.xml b/doc/pom.xml index 946b4cfce..1a800c8b9 100644 --- a/doc/pom.xml +++ b/doc/pom.xml @@ -53,6 +53,7 @@ org.eclipse.tracecompass.incubator.gerrit.doc.user org.eclipse.tracecompass.incubator.system.doc.user org.eclipse.tracecompass.incubator.inandout.doc.user + org.eclipse.tracecompass.incubator.gpu.doc.user diff --git a/rcp/org.eclipse.tracecompass.incubator.rcp.product/tracing.incubator.product b/rcp/org.eclipse.tracecompass.incubator.rcp.product/tracing.incubator.product index 973ba431a..5817a7bca 100644 --- a/rcp/org.eclipse.tracecompass.incubator.rcp.product/tracing.incubator.product +++ b/rcp/org.eclipse.tracecompass.incubator.rcp.product/tracing.incubator.product @@ -159,6 +159,7 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U + diff --git a/trace-server/org.eclipse.tracecompass.incubator.trace.server.product/traceserver.product b/trace-server/org.eclipse.tracecompass.incubator.trace.server.product/traceserver.product index c434c8619..15549280a 100644 --- a/trace-server/org.eclipse.tracecompass.incubator.trace.server.product/traceserver.product +++ b/trace-server/org.eclipse.tracecompass.incubator.trace.server.product/traceserver.product @@ -188,6 +188,8 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U + +