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

trace_events: fix dynamic enabling of trace events #22114

Closed
wants to merge 2 commits into from

Conversation

ofrobots
Copy link
Contributor

@ofrobots ofrobots commented Aug 3, 2018

V8 was assuming that trace-events can only be enabled at startup and, once disabled, will never be enabled again. In Node.js we have a lot more dynamic control over tracing. Fix bug upstream.

This PR back ports the fix and adds a test. This can be floated until (if) this is merged upstream.

/cc @nodejs/trace-events @nodejs/v8-update

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

V8-CI: https://ci.nodejs.org/view/All/job/node-test-commit-v8-linux/1570/
CI: https://ci.nodejs.org/job/node-test-pull-request/16180/

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. v8 engine Issues and PRs related to the V8 dependency. labels Aug 3, 2018
@targos
Copy link
Member

targos commented Aug 4, 2018

Embedder string was bumped twice :)

Original commit message:

    [tracing] allow dynamic control of tracing

    If the trace_buffer_ was null, we were returning a pointer to a static
    flag back that permanently disabled that particular trace point.

    This implied an assumption that tracing will be statically enabled at
    process startup, and once it is disabled, it will never be enabled
    again. On Node.js side we want to dynamically enable/disable tracing as per
    programmer intent.

    Change-Id: Ic7a7839b8450ab5c356d85e8e0826f42824907f4
    Reviewed-on: https://chromium-review.googlesource.com/1161518
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
    Cr-Commit-Position: refs/heads/master@{nodejs#54903}

Refs: v8/v8@bf5ea81
@targos
Copy link
Member

targos commented Sep 3, 2018

@targos
Copy link
Member

targos commented Sep 4, 2018

@targos
Copy link
Member

targos commented Sep 4, 2018

Landed in ec285c8 and 8e91215

@targos targos closed this Sep 4, 2018
targos pushed a commit that referenced this pull request Sep 4, 2018
Original commit message:

    [tracing] allow dynamic control of tracing

    If the trace_buffer_ was null, we were returning a pointer to a static
    flag back that permanently disabled that particular trace point.

    This implied an assumption that tracing will be statically enabled at
    process startup, and once it is disabled, it will never be enabled
    again. On Node.js side we want to dynamically enable/disable tracing as per
    programmer intent.

    Change-Id: Ic7a7839b8450ab5c356d85e8e0826f42824907f4
    Reviewed-on: https://chromium-review.googlesource.com/1161518
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
    Cr-Commit-Position: refs/heads/master@{#54903}

Refs: v8/v8@bf5ea81

PR-URL: #22114
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Sep 4, 2018
PR-URL: #22114
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Sep 5, 2018
Original commit message:

    [tracing] allow dynamic control of tracing

    If the trace_buffer_ was null, we were returning a pointer to a static
    flag back that permanently disabled that particular trace point.

    This implied an assumption that tracing will be statically enabled at
    process startup, and once it is disabled, it will never be enabled
    again. On Node.js side we want to dynamically enable/disable tracing as per
    programmer intent.

    Change-Id: Ic7a7839b8450ab5c356d85e8e0826f42824907f4
    Reviewed-on: https://chromium-review.googlesource.com/1161518
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
    Cr-Commit-Position: refs/heads/master@{#54903}

Refs: v8/v8@bf5ea81

PR-URL: #22114
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Sep 5, 2018
PR-URL: #22114
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Sep 6, 2018
Original commit message:

    [tracing] allow dynamic control of tracing

    If the trace_buffer_ was null, we were returning a pointer to a static
    flag back that permanently disabled that particular trace point.

    This implied an assumption that tracing will be statically enabled at
    process startup, and once it is disabled, it will never be enabled
    again. On Node.js side we want to dynamically enable/disable tracing as per
    programmer intent.

    Change-Id: Ic7a7839b8450ab5c356d85e8e0826f42824907f4
    Reviewed-on: https://chromium-review.googlesource.com/1161518
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
    Cr-Commit-Position: refs/heads/master@{#54903}

Refs: v8/v8@bf5ea81

PR-URL: #22114
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Sep 6, 2018
PR-URL: #22114
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants