Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure we reset OutputtedFilenameList in profiling when a workspace is restored #1164

Merged
merged 1 commit into from
Feb 23, 2017

Conversation

ChrisJefferson
Copy link
Contributor

This patch ensures that if we load a saved workspace, we correctly output filenames. This is only required when restoring a workspace where coverage/profile was active, with --prof or --cover.

The workspace restores the variable OutputtedFilenameList, which represents files we have already outputted. We want to clear that file, so our new profile includes the filenames.

This is a pain to add a test for, but easy to eyeball -- looking at profiles generated they were previously missing filenames, now they aren't.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change makes absolute sense, and I don't think there is need to add a test for it. I'd perhaps tweak the comment a bit, but that's minor.

src/profile.c Outdated
{
/* When we restore a workspace, we start a new profile. This is the
* only part of the profile which is stored in the GAP memory space,
* so we want to clear it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We "want" to clear it? Not "need" to clear it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to change to 'need'

src/profile.c Outdated
@@ -1005,6 +1005,15 @@ static Int InitKernel (
return 0;
}

static Int PostRestore ( StructInitInfo * module )
{
/* When we restore a workspace, we start a new profile. This is the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was mildly confused when reading "This" here, until I realized that it referred to the text after the comment. Perhaps rephrase this as "The OutputtedFilenameList is ..." or "The list of outputted filenames is" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tweaked

@codecov
Copy link

codecov bot commented Feb 22, 2017

Codecov Report

Merging #1164 into master will increase coverage by 1.55%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1164      +/-   ##
==========================================
+ Coverage    66.8%   68.35%   +1.55%     
==========================================
  Files         433      435       +2     
  Lines      228624   230662    +2038     
==========================================
+ Hits       152725   157680    +4955     
+ Misses      75899    72982    -2917
Impacted Files Coverage Δ
src/profile.c 38.39% <100%> (+0.97%)
src/iostream.c 57.62% <ø> (-3.19%)
src/vecgf2.c 61.9% <ø> (-2.13%)
src/saveload.c 62.97% <ø> (-1.94%)
src/system.c 62.84% <ø> (-1.43%)
src/lists.c 60.07% <ø> (-1.41%)
src/gasman.c 83.85% <ø> (-1.34%)
src/scanner.c 73.78% <ø> (-1.05%)
src/objscoll.c 68.28% <ø> (-1.03%)
src/bool.c 92.45% <ø> (-0.89%)
... and 148 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f02a3c...0c9d1ff. Read the comment docs.

@ChrisJefferson
Copy link
Contributor Author

ChrisJefferson commented Feb 22, 2017

I have no idea why it looks like this is trashing coverage so badly.
EDIT: And now I've rebased it's fine.

@fingolfin fingolfin merged commit 448d67f into gap-system:master Feb 23, 2017
@ChrisJefferson ChrisJefferson deleted the profile-restore branch May 12, 2017 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants