コード例 #1
0
    def actions_for_project(
            self, project: Project) -> tp.MutableSequence[actions.Step]:
        """Returns the specified steps to run the project(s) specified in the
        call in a fixed order."""

        # Add the required runtime extensions to the project(s).
        project.runtime_extension = run.RuntimeExtension(project, self) \
            << time.RunWithTime()

        # Add the required compiler extensions to the project(s).
        project.compiler_extension = compiler.RunCompiler(project, self) \
            << RunWLLVM() \
            << run.WithTimeout()

        # Add own error handler to compile step.
        project.compile = get_default_compile_error_wrapped(
            self.get_handle(), project, CR)

        # This c-flag is provided by VaRA and it suggests to use the git-blame
        # annotation.
        project.cflags = ["-fvara-GB"]

        analysis_actions = []

        analysis_actions += get_bc_cache_actions(
            project,
            extraction_error_handler=create_default_compiler_error_handler(
                self.get_handle(), project, self.REPORT_SPEC.main_report))

        analysis_actions.append(CRAnalysis(project, self.get_handle()))
        analysis_actions.append(actions.Clean(project))

        return analysis_actions
コード例 #2
0
 def ijpp_config(_project, name):
     return actions.RequireAll(actions=[
         actions.Echo("Stage: JIT Configurations"),
         actions.MakeBuildDir(_project),
         actions.Compile(_project),
         actions.Run(_project),
         actions.Clean(_project),
         actions.Echo(name),
     ])
コード例 #3
0
    def actions_for_project(self, project: Project) -> tp.List[actions.Step]:
        """Returns the specified steps to run the project(s) specified in the
        call in a fixed order."""

        analysis_actions = [
            CreatePyDrillerSZZReport(project),
            actions.Clean(project)
        ]

        return analysis_actions
コード例 #4
0
    def actions_for_project(
        self, project: Project
    ) -> tp.MutableSequence[actions.Step]:
        """
        Returns the specified steps to run the project(s) specified in the call
        in a fixed order.

        Args:
            project: to analyze
        """
        # Try, to build the project without optimizations to get more precise
        # blame annotations. Note: this does not guarantee that a project is
        # build without optimizations because the used build tool/script can
        # still add optimizations flags after the experiment specified cflags.
        project.cflags += ["-O1", "-Xclang", "-disable-llvm-optzns", "-g0"]
        bc_file_extensions = [
            BCFileExtensions.NO_OPT,
            BCFileExtensions.TBAA,
        ]

        # Add the required runtime extensions to the project(s).
        project.runtime_extension = run.RuntimeExtension(project, self) \
            << time.RunWithTime()

        # Add the required compiler extensions to the project(s).
        project.compiler_extension = compiler.RunCompiler(project, self) \
            << RunWLLVM() \
            << run.WithTimeout()

        # Add own error handler to compile step.
        project.compile = get_default_compile_error_wrapped(
            self.get_handle(), project, self.REPORT_SPEC.main_report
        )

        analysis_actions = get_bc_cache_actions(
            project, bc_file_extensions,
            create_default_compiler_error_handler(
                self.get_handle(), project, self.REPORT_SPEC.main_report
            )
        )

        for _ in range(0, 10):
            analysis_actions.append(
                RunGlobalsTestAnalysis(project, self.get_handle(), True)
            )
            analysis_actions.append(
                RunGlobalsTestAnalysis(project, self.get_handle(), False)
            )

        # Clean up the generated files afterwards
        analysis_actions.append(actions.Clean(project))

        return analysis_actions
コード例 #5
0
    def actions_for_project(self, project: Project) -> tp.List[actions.Step]:
        """Returns the specified steps to run the project(s) specified in the
        call in a fixed order."""

        analysis_actions = [
            PrepareSZZUnleashedData(project),
            RunSZZUnleashed(project, self.get_handle()),
            CreateSZZUnleashedReport(project),
            actions.Clean(project)
        ]

        return analysis_actions
コード例 #6
0
    def actions_for_project(
        self, project: Project
    ) -> tp.MutableSequence[actions.Step]:
        """
        Returns the specified steps to run the project(s) specified in the call
        in a fixed order.

        Args:
            project: to analyze
        """

        # Add tracing markers.
        fm_provider = FeatureModelProvider.create_provider_for_project(project)
        if fm_provider is None:
            raise Exception("Could not get FeatureModelProvider!")

        fm_path = fm_provider.get_feature_model_path(project.version_of_primary)

        if fm_path is None or not fm_path.exists():
            raise FeatureModelNotFound(project, fm_path)

        # Sets vara tracing flags
        project.cflags += [
            "-fvara-feature", f"-fvara-fm-path={fm_path.absolute()}",
            "-fsanitize=vara", "-fvara-instr=usdt", "-flto", "-fuse-ld=lld"
        ]

        project.ldflags += ["-flto"]

        # Add the required runtime extensions to the project(s).
        project.runtime_extension = run.RuntimeExtension(project, self) \
            << bbtime.RunWithTime()

        # Add the required compiler extensions to the project(s).
        project.compiler_extension = compiler.RunCompiler(project, self) \
            << run.WithTimeout()

        # Add own error handler to compile step.
        project.compile = get_default_compile_error_wrapped(
            self.get_handle(), project, VaraInstrumentationStatsReport
        )

        analysis_actions = []
        analysis_actions.append(actions.Compile(project))

        analysis_actions.append(
            CaptureInstrumentationStats(project, self.get_handle())
        )

        analysis_actions.append(actions.Clean(project))

        return analysis_actions
コード例 #7
0
ファイル: phasar_fta.py プロジェクト: se-sic/VaRA-Tool-Suite
    def actions_for_project(self, project: Project) -> tp.List[actions.Step]:
        """
        Returns the specified steps to run the project(s) specified in the call
        in a fixed order.

        Args:
            project: to analyze
        """

        # Add the required runtime extensions to the project(s).
        project.runtime_extension = run.RuntimeExtension(project, self) \
            << time.RunWithTime()

        # Add the required compiler extensions to the project(s).
        project.compiler_extension = compiler.RunCompiler(project, self) \
            << RunWLLVM() \
            << run.WithTimeout()

        # Add own error handler to compile step.
        project.compile = get_default_compile_error_wrapped(
            self.get_handle(), project, self.REPORT_SPEC.main_report)

        fm_provider = FeatureModelProvider.get_provider_for_project(project)

        fm_path = fm_provider.get_feature_model_path(
            project.version_of_primary)

        project.cflags += [
            "-O1", "-Xclang", "-disable-llvm-optzns", "-fvara-feature",
            "-fvara-fm-path=" + str(fm_path), "-g"
        ]

        bc_file_extensions = [
            BCFileExtensions.NO_OPT, BCFileExtensions.TBAA,
            BCFileExtensions.FEATURE, BCFileExtensions.DEBUG
        ]

        analysis_actions = []

        analysis_actions += get_bc_cache_actions(
            project,
            bc_file_extensions,
            extraction_error_handler=create_default_compiler_error_handler(
                self.get_handle(), project, self.REPORT_SPEC.main_report))

        analysis_actions.append(
            PhASARFTACheck(project, self.get_handle(), bc_file_extensions))
        analysis_actions.append(actions.Clean(project))

        return analysis_actions
コード例 #8
0
    def actions_for_project(
            self, project: Project) -> tp.MutableSequence[actions.Step]:
        """Returns the specified steps to run the project(s) specified in the
        call in a fixed order."""

        fm_provider = FeatureModelProvider.create_provider_for_project(project)
        if fm_provider is None:
            raise Exception("Could not get FeatureModelProvider!")

        fm_path = fm_provider.get_feature_model_path(
            project.version_of_primary)
        if fm_path is None or not fm_path.exists():
            raise FeatureModelNotFound(project, fm_path)

        # We need debug info to later determine source code locations in a
        # utility pass. Also, include feature information.
        project.cflags += [
            "-g", "-fvara-feature", f"-fvara-fm-path={fm_path.absolute()}"
        ]

        # Add the required runtime extensions to the project(s).
        project.runtime_extension = run.RuntimeExtension(project, self) \
            << time.RunWithTime()

        # Add the required compiler extensions to the project(s). We want to
        # transfer the whole project into LLVM-IR.
        project.compiler_extension = compiler.RunCompiler(project, self) \
            << RunWLLVM() \
            << run.WithTimeout()

        project.compile = get_default_compile_error_wrapped(
            self.get_handle(), project, self.REPORT_SPEC.main_report)

        bc_file_extensions = [BCFileExtensions.DEBUG, BCFileExtensions.FEATURE]

        analysis_actions = []
        analysis_actions.append(actions.Compile(project))
        analysis_actions.append(Extract(project, bc_file_extensions))
        analysis_actions.append(
            CollectInstrumentationPoints(project, self.get_handle()))
        analysis_actions.append(actions.Clean(project))

        return analysis_actions
コード例 #9
0
    def actions_for_project(
            self, project: Project) -> tp.MutableSequence[actions.Step]:
        """Returns the specified steps to run the project(s) specified in the
        call in a fixed order."""

        BE.setup_basic_blame_experiment(
            self, project,
            self.get_handle().report_spec().main_report)

        project.cflags.append('-g')
        project.cflags.append(self.__opt_flag)

        analysis_actions = BE.generate_basic_blame_experiment_actions(
            project, self.__bc_file_extensions)

        analysis_actions.append(
            BlameVerifierReportGeneration(project, self.__bc_file_extensions,
                                          self.get_handle()))
        analysis_actions.append(actions.Clean(project))

        return analysis_actions
コード例 #10
0
    def actions_for_project(
        self, project: Project
    ) -> tp.MutableSequence[actions.Step]:
        """
        Returns the specified steps to run the project(s) specified in the call
        in a fixed order.

        Args:
            project: to analyze
        """

        # Add the required runtime extensions to the project(s).
        project.runtime_extension = run.RuntimeExtension(project, self) \
            << time.RunWithTime()

        # Add the required compiler extensions to the project(s).
        project.compiler_extension = compiler.RunCompiler(project, self) \
            << RunWLLVM() \
            << run.WithTimeout()

        # Add own error handler to compile step.
        project.compile = get_default_compile_error_wrapped(
            self.get_handle(), project, EmptyReport
        )

        analysis_actions = []

        analysis_actions += get_bc_cache_actions(
            project,
            extraction_error_handler=create_default_compiler_error_handler(
                self.get_handle(), project, self.REPORT_SPEC.main_report
            )
        )

        analysis_actions.append(
            IDELinearConstantAnalysis(project, self.get_handle())
        )
        analysis_actions.append(actions.Clean(project))

        return analysis_actions
コード例 #11
0
    def actions_for_project(
        self, project: Project
    ) -> tp.MutableSequence[actions.Step]:
        """
        Returns the specified steps to run the project(s) specified in the call
        in a fixed order.

        Args:
            project: to analyze
        """
        # Try, to build the project without optimizations to get more precise
        # blame annotations. Note: this does not guarantee that a project is
        # build without optimizations because the used build tool/script can
        # still add optimizations flags after the experiment specified cflags.
        project.cflags += ["-O1", "-Xclang", "-disable-llvm-optzns", "-g0"]
        bc_file_extensions = [
            BCFileExtensions.NO_OPT,
            BCFileExtensions.TBAA,
            BCFileExtensions.BLAME,
        ]

        BE.setup_basic_blame_experiment(self, project, BR)

        analysis_actions = BE.generate_basic_blame_experiment_actions(
            project,
            bc_file_extensions,
            extraction_error_handler=create_default_compiler_error_handler(
                self.get_handle(), project, self.REPORT_SPEC.main_report
            )
        )

        analysis_actions.append(
            BlameReportGeneration(
                project, self.get_handle(), self.BLAME_TAINT_SCOPE
            )
        )
        analysis_actions.append(actions.Clean(project))

        return analysis_actions
コード例 #12
0
    def actions_for_project(
            self, project: Project) -> tp.MutableSequence[actions.Step]:
        """Returns the specified steps to run the project(s) specified in the
        call in a fixed order."""

        # Add the required runtime extensions to the project(s).
        project.runtime_extension = run.RuntimeExtension(project, self) \
            << time.RunWithTime()

        # Add the required compiler extensions to the project(s).
        project.compiler_extension = compiler.RunCompiler(project, self) \
            << RunWLLVM() \
            << run.WithTimeout()

        project.compile = get_default_compile_error_wrapped(
            self.get_handle(), project, self.REPORT_SPEC.main_report)

        analysis_actions = []
        analysis_actions.append(actions.Compile(project))
        analysis_actions.append(EmptyAnalysis(project, self.get_handle()))
        analysis_actions.append(actions.Clean(project))

        return analysis_actions
コード例 #13
0
ファイル: pgo.py プロジェクト: PolyJIT/polyjit.experiments
    def actions_for_project(self, project):
        import copy
        import uuid

        no_pgo_project = copy.deepcopy(project)
        no_pgo_project.run_uuid = uuid.uuid4()
        pgo_project = copy.deepcopy(project)
        pgo_project.run_uuid = uuid.uuid4()

        project.cflags += ["-O3", "-fprofile-generate=./raw-profiles"]
        cfg_inst = {"cflags": project.cflags, "name": "inst"}
        project.compiler_extension = \
            extensions.compiler.RunCompiler(project, self, config=cfg_inst) \
            << extensions.run.WithTimeout()
        project.runtime_extension = \
            extensions.run.RuntimeExtension(project, self, config=cfg_inst)

        # Still activating pgo for clang pgo optimisation
        no_pgo_project.cflags += [
            "-O3", "-fprofile-use=./raw-profiles", "-mllvm", "-polly",
            "-mllvm", "-stats"
        ]
        cfg_no_pgo = {"cflags": no_pgo_project.cflags, "name": "no-pgo"}
        no_pgo_project.compiler_extension = \
            compilestats.ExtractCompileStats(project, self, config=cfg_no_pgo) \
            << extensions.run.WithTimeout()

        pgo_project.cflags += [
            "-O3", "-fprofile-use=./raw-profiles", "-mllvm", "-polly",
            "-mllvm", "-polly-pgo-enable"
            "-mllvm", "-stats"
        ]
        cfg_pgo = {"cflags": pgo_project.cflags, "name": "pgo"}
        pgo_project.compiler_extension = \
            extensions.run.RuntimeExtension(project, self) \
            << extensions.time.RunWithTime(config=cfg_pgo)

        actns = [
            actions.RequireAll(actions=[
                actions.MakeBuildDir(project),
                actions.Compile(project),
                actions.Run(project),
                SaveProfile(project, filename='prog.profdata'),
                actions.Clean(project),
            ]),
            actions.RequireAll(actions=[
                actions.MakeBuildDir(no_pgo_project),
                actions.Compile(no_pgo_project),
                actions.Run(no_pgo_project),
                actions.Clean(no_pgo_project)
            ]),
            actions.RequireAll(actions=[
                actions.MakeBuildDir(pgo_project),
                RetrieveFile(pgo_project,
                             filename="prog.profdata",
                             run_group=project.run_uuid),
                actions.Compile(pgo_project),
                actions.Run(pgo_project),
                actions.Clean(pgo_project)
            ])
        ]
        return actns