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

systrace doesn't include JS or native modules thread info #26032

Closed
evelant opened this issue Aug 12, 2019 · 22 comments
Closed

systrace doesn't include JS or native modules thread info #26032

evelant opened this issue Aug 12, 2019 · 22 comments
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@evelant
Copy link

evelant commented Aug 12, 2019

I'm using systrace via the process detailed in the documentation. In my trace results there is no useful JS thread or native modules thread info. This makes it more or less useless for profiling my app.

React native version:

System:
    OS: macOS 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 791.28 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
    Yarn: 1.17.3 - ~/.yarn/bin/yarn
    npm: 6.10.1 - ~/.nvm/versions/node/v8.11.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
  IDEs:
    Android Studio: 3.4 AI-183.5429.30.34.5452501
    Xcode: 10.3/10G8 - /usr/bin/xcodebuild
  npmPackages:
    @react-native-community/cli: ^2.9.0 => 2.9.0 
    react: 16.9.0 => 16.9.0 
    react-native: ^0.60.5 => 0.60.5 
  npmGlobalPackages:
    create-react-native-app: 2.0.2
    react-native-macos-cli: 2.0.1

Steps To Reproduce

  1. Take a systrace profile per the documentation
  2. Open profile and note that the JS and native modules threads don't contain useful information like they do in the documentation example

Describe what you expected to happen:
JS and native modules threads appear in the systrace as per the documentation. See the following screenshots of my trace -- the JS and native modules information is missing. There is mqt_js and mqt_native_mod in the trace but they don't contain any meaningful data like the documentation example. This trace definitely contains some heavy JS work but it appears like it isn't recorded.

image

image

image

Snack, code example, screenshot, or link to a repository:
Example trace: https://www.dropbox.com/s/n0ig26bctwq359k/trace.html?dl=0

@evelant evelant added the Bug label Aug 12, 2019
@evelant evelant changed the title systrace doesn't include JS or native modules threads systrace doesn't include JS or native modules thread info Aug 12, 2019
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.60 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@evelant
Copy link
Author

evelant commented Aug 19, 2019

I updated to latest react native. Problem still persists, there is no useful information about the js or native modules threads like is shown in the documentation. A trace file can be found here: https://www.dropbox.com/s/n0ig26bctwq359k/trace.html?dl=0

@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Aug 19, 2019
@evelant
Copy link
Author

evelant commented Aug 19, 2019

The issue does conform to the template...?

@evelant
Copy link
Author

evelant commented Sep 7, 2019

Anything I can do here? The bot seems to have erroneously confined my issue to the dustbin.

@stale
Copy link

stale bot commented Dec 6, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 6, 2019
@evelant
Copy link
Author

evelant commented Dec 7, 2019

This issue never got examined. I think it got ignored because the bot flagged it as needs more information even though I provided the info. Needs discussion.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 7, 2019
@bartzy
Copy link

bartzy commented Dec 13, 2019

I'm experiencing the same problem. I think this is related to the fact that FB has its own closed-source implementation of systrace that doesn't have these issues so it's not a priority (see react-native-community/discussions-and-proposals#69 (comment)).

@vineyardbovines
Copy link

Any updates here? This is a big issue on our end.

@evelant
Copy link
Author

evelant commented Feb 20, 2020

This is still an issue on latest RN 0.61.5. Symptoms are exactly the same.

System:
    OS: macOS 10.15.3
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 133.43 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.10.0 - ~/.nvm/versions/node/v12.10.0/bin/node
    Yarn: 1.19.2 - ~/.yarn/bin/yarn
    npm: 6.13.7 - ~/dev/TaskHero/node_modules/.bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      Android NDK: 21.0.6113669
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    @react-native-community/cli: ^4.1.0 => 4.1.0
    react: 16.9.0 => 16.9.0
    react-native: github:AndrewMorsillo/react-native#0.61-stable-th-custom => 0.61.5

@axe-fb
Copy link
Contributor

axe-fb commented Feb 25, 2020

For the JS information, are you using JSC or Hermes ? JSC profiling had broken a while ago, and now that we are supporting Hermes, we have that information in the Hermes sampling profiler, which is not yet integrated into Systrace.
The native modules have as much information as you have added trace markers in your code.

To solve this issue, i would recommend adding trace markers to JS and native modules to see how long the communication takes.

@evelant
Copy link
Author

evelant commented Feb 25, 2020

I am using JSC. Hermes is unfortunately not an option (at least for now) due to lack of Proxy support. My app relies heavily on mobx-state-tree which requires Proxy.

I don't quite understand what you mean by the native modules having as much information as I have added trace markers. None of the native code in my app was written by me, it's all react-native internal or npm modules. If you compare the screenshot in the issue above to the screenshot of the expected output from the docs you can see that the expected tracing information is missing from mqt_native_modules.

Can you provide a bit more detail about how I would go about adding the trace markers you're referring to? I apologize if that may seem like an obvious thing but I have little to no experience with native android code. My app has no custom native code, all native code is internal to react-native or from npm modules.

@safaiyeh safaiyeh removed the Ran Commands One of our bots successfully processed a command. label Mar 20, 2020
@stale
Copy link

stale bot commented Jun 20, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 20, 2020
@loopiezlol
Copy link

can confirm this still happens with Hermes on react 0.62

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 23, 2020
@evelant
Copy link
Author

evelant commented Aug 29, 2020

This is still an issue 1 year later. As far as I can see there are no working profiling tools for react-native Android at the moment and haven't been for a couple years. This is really painful for my team, we have customers reporting performance issues on Android but have no way to diagnose and solve them other than trial and error. Only chrome profiler appears to work but as we all know that doesn't offer a picture of what's really happening, only a somewhat relative measurement of perf against itself using v8 with debug mode caveats. @axe-fb can you offer any guidance about the state of performance profiling for RN Android?

@netlemur
Copy link

netlemur commented Nov 4, 2020

can confirm this still happens on 0.63.3 – with or without Hermes.

@DrRefactor
Copy link

Issue also happens on V8.

@zbycz
Copy link

zbycz commented Mar 24, 2021

JS thread still not recorded:

image

Would it be possible to realase the facebook's internal systrace tool, which is capable of showing the data?

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 14, 2023
@DrRefactor
Copy link

unstale

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 14, 2023
@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 11, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests