Skip to content

[Config] Integrate Tracy profiler - #4182

Merged
bakpaul merged 5 commits into
sofa-framework:masterfrom
alxbilger:tracy
Sep 27, 2023
Merged

[Config] Integrate Tracy profiler#4182
bakpaul merged 5 commits into
sofa-framework:masterfrom
alxbilger:tracy

Conversation

@alxbilger

@alxbilger alxbilger commented Sep 19, 2023

Copy link
Copy Markdown
Contributor

I integrated the Tracy profiler (https://github.com/wolfpld/tracy). It adds a ton of new feature to our internal profiler. In particular, I like:

  • Multithreaded timeline
  • Statistics
  • Messages
  • Memory management (need more work, I could not test it)
  • See context switching
  • Mutex profiling (not tested yet)

I tried not to be invasive, but it will require a change on the way we define timers such as in master...alxbilger:sofa:scoped_timer (the demo runs with this branch).

TODO: a dedicated MessageHandler

peek (1)


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@alxbilger alxbilger added pr: status to review To notify reviewers to review this pull-request pr: new feature Implement a new feature labels Sep 19, 2023
@epernod

epernod commented Sep 19, 2023

Copy link
Copy Markdown
Contributor

Very cool and useful indeed! It really look like the one in unity!
I see the Tracy lib is under BSD license, is it a problem to add it in the core of SOFA ? @hugtalbot
otherwise we should move the profiler into another repo?

@fredroy

fredroy commented Sep 20, 2023

Copy link
Copy Markdown
Contributor

Very cool and useful indeed! It really look like the one in unity! I see the Tracy lib is under BSD license, is it a problem to add it in the core of SOFA ? @hugtalbot otherwise we should move the profiler into another repo?

@alxbilger did it in a way we dont even ship it with SOFA as it will downloaded from their repo at the cmake step.
Moreover, this is for developers so the binary distribution would not contain the compiled lib anyway.

In any case, BSD licence is very lax anyway so it should be OK.

@fredroy

fredroy commented Sep 20, 2023

Copy link
Copy Markdown
Contributor

The screenshots on the repo look mad 🤩 (even asm views of statement 😶‍🌫️)
I am especially interested of the multi-threading part, as the profiler of MSVC (and the valgrind/callgrind on linux) does not really handle it well.

  • Do you need to compile with debug info?
  • It is tracing so obviously there will be overhead, but can you say how much is the performance hit (if any) ? (msvc's is almost as fast but requires RelWithDebugInfo and callgrind is slow like hell)

EDIT: tried myself, works in Release mode as well 😎👍

@fredroy fredroy added the topic for next dev-meeting PR to be discussed in sofa-dev meeting label Sep 20, 2023
@hugtalbot hugtalbot removed the topic for next dev-meeting PR to be discussed in sofa-dev meeting label Sep 20, 2023
@alxbilger
alxbilger marked this pull request as ready for review September 27, 2023 08:43
@bakpaul bakpaul added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Sep 27, 2023
@bakpaul
bakpaul merged commit 25261d3 into sofa-framework:master Sep 27, 2023
@hugtalbot hugtalbot added this to the v23.12 milestone Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: new feature Implement a new feature pr: status ready Approved a pull-request, ready to be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants