Skip to content

C++ entry points not captured during profiling #29804

Description

@DullReferenceException
  • Version: v12.11.1
  • Platform: Darwin 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

When capturing profiling information via node --prof then processing via node --prof-process, the C++ entry points section is blank, and just the node binary is shown in the bottom-up profile. Even in the summary, it shows 0 ticks for C++:

 [C++]:
   ticks  total  nonlib   name

 [Summary]:
   ticks  total  nonlib   name
    937    6.0%   88.1%  JavaScript
      0    0.0%    0.0%  C++
    403    2.6%   37.9%  GC
  14654   93.2%          Shared libraries
    126    0.8%          Unaccounted

I have seen more details before when using the profiling available in the CLI. While processing the profiling data, I see a lot of Code move event for unknown code messages output, so maybe this relates? node --cpu-prof also seems to omit these details.

Activity

  1. DullReferenceException commented on Oct 1, 2019

    @DullReferenceException
    Author

    One possible clue: I do see C++ function names in the raw profiling logs; they're just not making their way to the --prof-process output.

  2. addaleax commented on Oct 1, 2019

    @addaleax
    Member

    I can’t reproduce this on x64 Linux. Can you figure out which Node.js versions this affects (in particular, whether v12.10.0 has the same issue), and whether this depends on the script you’re profiling?

  3. DullReferenceException commented on Oct 1, 2019

    @DullReferenceException
    Author

    It's happening for both node 10 and 12 for me. The versions I've tried are:

    v10.15.3 - This used to work but stopped capturing C++ data for some reason
    v10.16.3 - Tried to upgrade to latest LTS; same issue
    v12.11.1 - Tried latest version, same issue

    I suspect that there might be some environmental factor causing this issue, but I can't determine what that would be. I'm saying this because v10.15.3's profiling used to work fine.

    One environmental change that occurred before this started happening is that I tried to enable dtrace inside of SIP using csrutil, and that's when this started happening. But after resetting SIP (csrutil reset) and even turning off SIP (csrutil disable), the problem persists, so I'm not 100% sure it relates to that. Maybe is a good hint for macOS experts?

  4. added
    macosIssues and PRs related to the macOS platform.
    on Oct 1, 2019
  5. addaleax commented on Oct 1, 2019

    @addaleax
    Member

    @nodejs/platform-macos

  6. devnexen commented on Oct 1, 2019

    @devnexen
    Contributor

    tried with both 12.11.1 and current master branch and can't reproduce.
    image

  7. Fishrock123 commented on Oct 1, 2019

    @Fishrock123
    Contributor

    @devnexen Whats' your platform? i.e. what macos/darwin version?

  8. devnexen commented on Oct 1, 2019

    @devnexen
    Contributor

    18.7.0, last one

  9. DullReferenceException commented on Oct 1, 2019

    @DullReferenceException
    Author

    Would my --prof log file be helpful? It's 10MB or so.

  10. bnoordhuis commented on Oct 2, 2019

    @bnoordhuis
    Member

    What do c++filt --version, nm --version and which c++filt nm print on your system? The log file processor calls out to them to look up and demangle C++ symbols.

  11. DullReferenceException commented on Oct 2, 2019

    @DullReferenceException
    Author
    » c++filt --version                                                                                                                                      
    GNU c++filt 070207 20070207
    Copyright 2005 Free Software Foundation, Inc.
    This program is free software; you may redistribute it under the terms of
    the GNU General Public License.  This program has absolutely no warranty.
    
    » nm --version                                                                                                                                           
    Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.
    
    » which c++filt nm                                                                                                                                       
    /usr/bin/c++filt
    /usr/bin/nm
    

    Maybe that second message is what's mucking things up. Trying again after accepting the license...

  12. DullReferenceException commented on Oct 2, 2019

    @DullReferenceException
    Author

    Amazing, that was it! So perhaps an upgrade occurred and a new agreement requirement was injected without my knowledge.

    Would there be a way for the profiler to notify users like me when this sort of thing occurs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    macosIssues and PRs related to the macOS platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions