Skip to content

Commit

Permalink
Remove additional report file prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonievonMann committed Feb 22, 2024
1 parent 6a7efb1 commit f5a69bb
Showing 1 changed file with 9 additions and 36 deletions.
45 changes: 9 additions & 36 deletions varats/varats/experiments/vara/blame_ast_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@
)
from varats.project.project_util import get_local_project_git_paths
from varats.project.varats_project import VProject
from varats.report.report import (
FileStatusExtension,
ReportFilename,
ReportFilepath,
ReportSpecification,
)
from varats.utils.git_util import ShortCommitHash
from varats.report.report import ReportSpecification


class BlameAnnotationGeneration(actions.ProjectStep): #type: ignore
Expand All @@ -52,13 +46,9 @@ class BlameAnnotationGeneration(actions.ProjectStep): #type: ignore

project: VProject

def __init__(
self, project: Project, experiment_handle: ExperimentHandle,
file_prefix: str
):
def __init__(self, project: Project, experiment_handle: ExperimentHandle):
super().__init__(project=project)
self.__experiment_handle = experiment_handle
self.__file_prefix = file_prefix

def __call__(self) -> actions.StepResult:
return self.analyze()
Expand All @@ -77,22 +67,8 @@ def analyze(self) -> actions.StepResult:
# Add to the user-defined path for saving the results of the
# analysis also the name and the unique id of the project of every
# run.
varats_result_folder = get_varats_result_folder(self.project)
result_filepath = ReportFilepath(
varats_result_folder,
ReportFilename(
self.__file_prefix + self.__experiment_handle.get_file_name(
BA.shorthand(),
project_name=str(self.project.name),
binary_name=binary.name,
project_revision=ShortCommitHash(
self.project.version_of_primary
),
project_uuid=str(self.project.run_uuid),
extension_type=FileStatusExtension.SUCCESS,
config_id=None
).filename
)
result_file = create_new_success_result_filepath(
self.__experiment_handle, BA, self.project, binary
)

opt_params = [
Expand All @@ -101,8 +77,7 @@ def analyze(self) -> actions.StepResult:
"-vara-git-mappings=" + ",".join([
f'{repo}:{path}' for repo, path in
get_local_project_git_paths(self.project.name).items()
]), "-vara-use-phasar",
f"-vara-report-outfile={result_filepath}",
]), "-vara-use-phasar", f"-vara-report-outfile={result_file}",
get_cached_bc_file_path(
self.project, binary, [
BCFileExtensions.NO_OPT, BCFileExtensions.TBAA,
Expand Down Expand Up @@ -153,9 +128,9 @@ def analyze(self) -> actions.StepResult:
varats_result_folder = get_varats_result_folder(self.project)

for file in os.listdir(varats_result_folder):
if fnmatch.fnmatch(file, "linereport" + '*'):
if fnmatch.fnmatch(file, "LBA" + '*'):
line_filepath = Path(varats_result_folder / file)
if fnmatch.fnmatch(file, "astreport" + '*'):
if fnmatch.fnmatch(file, "ASTBA" + '*'):
ast_filepath = Path(varats_result_folder / file)

line_annotations = BA(line_filepath)
Expand Down Expand Up @@ -213,9 +188,7 @@ def actions_for_project(
)
# Generate blame annotation report
analysis_actions.append(
BlameAnnotationGeneration(
project, self.get_handle(), "linereport-"
)
BlameAnnotationGeneration(project, self.get_handle())
)

return analysis_actions
Expand Down Expand Up @@ -261,7 +234,7 @@ def actions_for_project(
)
# Generate blame annotation report
analysis_actions.append(
BlameAnnotationGeneration(project, self.get_handle(), "astreport-")
BlameAnnotationGeneration(project, self.get_handle())
)

return analysis_actions
Expand Down

0 comments on commit f5a69bb

Please sign in to comment.