Giter VIP home page Giter VIP logo

Comments (3)

ddiproietto avatar ddiproietto commented on May 30, 2024

Hi!

By linking statically the perfetto library to two separate DLLs, you're effectively creating two separate instances of the library, so the behavior you're observing is expected.

The most straightforward solution would be to avoid dynamic linking at all, that's what perfetto was originally designed for. I'm not sure it's an option in your case, though.

You can try linking dynamically, but the C++ annotations for dynamic linking (PERFETTO_EXPORT_COMPONENT) are supported on a best effort basis, mostly for tests.

Lastly, you can use the more restricted C API in include/perfetto/public (examples in examples/shared_lib/). Dynamic linking is officially supported there. The only blocker there is that there's no easy way to build the C shared library with CMake. I've opened #713 to keep track of this.

Those are the options at the moment, I believe. Let me know if you have any questions.

from perfetto.

worawatt avatar worawatt commented on May 30, 2024

Thank you for this information!

I'll try dynamic linking (although it's not fully supported).

Does trace_categories.cc also have to be built as a dynamic library?

from perfetto.

ddiproietto avatar ddiproietto commented on May 30, 2024

Does trace_categories.cc also have to be built as a dynamic library?

Not really, you can have separate trace_categories.cc that are statically linked into each .DLL

from perfetto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.