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

lttng: updated flags for gc tracing #3388

Closed
wants to merge 2 commits into from
Closed

Conversation

GlenTiki
Copy link
Contributor

This fixes some build errors I was getting while trying to build --with-lttng. :)

@mscdex mscdex added the post-mortem Issues and PRs related to the post-mortem diagnostics of Node.js. label Oct 15, 2015
@Fishrock123
Copy link
Contributor

cc @nodejs/lts

@rvagg
Copy link
Member

rvagg commented Oct 16, 2015

@thekemkid do you know how long this has been broken? it'd be nice if we could get some lttng folks using releases more often so this stuff was kept in shape.

@GlenTiki
Copy link
Contributor Author

@rvagg it looks like it was working in the v4.1.2 proposal branch. I'm planning on doing some more work on lttng/adding more lttng tracepoints so I'll keep maintaining it. :)

flagsStr = "kGCCallbackFlagConstructRetainedObjectInfos";
} else if (flags == v8::GCCallbackFlags::kGCCallbackFlagForced) {
flagsStr = "kGCCallbackFlagForced";
} else if (flags == v8::GCCallbackFlags::kGCCallbackFlagSynchronousPhantomCallbackProcessing) {
Copy link
Member

Choose a reason for hiding this comment

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

Long lines, please keep them <= 80 columns.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would it be okay if I used a switch here instead?
Heres what I'm thinking:

switch (flags) {
    case 
      v8::GCCallbackFlags::kNoGCCallbackFlags:
        flagsStr = "kNoGCCallbackFlags";
    break;
    case 
      v8::GCCallbackFlags::kGCCallbackFlagConstructRetainedObjectInfos;
        flagsStr = "kGCCallbackFlagConstructRetainedObjectInfos";
    break;
    case 
      v8::GCCallbackFlags::kGCCallbackFlagForced:
        flagsStr = "kGCCallbackFlagForced";
    break;
    case 
      v8::GCCallbackFlags::kGCCallbackFlagSynchronousPhantomCallbackProcessing:
        flagsStr = "kGCCallbackFlagSynchronousPhantomCallbackProcessing";
    break;
    default:
        flagsStr = "Unrecognised GCCallbackFlag";
    break;
  }

Copy link
Member

Choose a reason for hiding this comment

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

That looks a little awkward. You could add a using F = v8::GCCallbackFlags a few lines up so you can shorten the names but I'd probably use an x-macro to generate the clauses. That lets you drop the duplication of the enum and the string as well. You can find an example of an x-macro in src/node_v8.cc, grep for HEAP_STATISTICS_PROPERTIES.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! I also shortened the GCType if statement with an x-macro too.

@bnoordhuis
Copy link
Member

The breakage is because of the recent upgrade to V8 4.6 in master.

@GlenTiki
Copy link
Contributor Author

Okay, I think this is ready to be reviewed again :) Let me know if I need to squash the commits.

@GlenTiki
Copy link
Contributor Author

could I get another review? @nodejs/lts

bnoordhuis pushed a commit that referenced this pull request Oct 20, 2015
PR-URL: #3388
Reviewed-By: Ben Noordhuis <[email protected]>
@bnoordhuis
Copy link
Member

Landed in 9adc6a6, thanks. Can you make sure next time that make cpplint is happy?

@bnoordhuis bnoordhuis closed this Oct 20, 2015
@MylesBorins
Copy link
Contributor

Should we add an LTS tag here?

@Fishrock123
Copy link
Contributor

The breakage is because of the recent upgrade to V8 4.6 in master.

Should we add an LTS tag here?

No need. :)

@GlenTiki
Copy link
Contributor Author

@bnoordhuis will do, thanks :)

rvagg pushed a commit that referenced this pull request Oct 21, 2015
PR-URL: #3388
Reviewed-By: Ben Noordhuis <[email protected]>
@rvagg rvagg mentioned this pull request Oct 21, 2015
@rvagg rvagg mentioned this pull request Dec 17, 2015
@MylesBorins
Copy link
Contributor

@jasnell it doesn't look like 2930867 has been backported to LTS. I don't think we should be backporting this commit unless we upgrade v8 to 4.6 on LTS

thoughts?

@MylesBorins
Copy link
Contributor

Removing LTS tag. @jasnell @rvagg feel free to re apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
post-mortem Issues and PRs related to the post-mortem diagnostics of Node.js.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants