GithubHelp home page GithubHelp logo

ETW Tracing using rusttrace crate about xi-win HOT 2 OPEN

xi-editor avatar xi-editor commented on September 25, 2024
ETW Tracing using rusttrace crate

from xi-win.

Comments (2)

LiHRaM avatar LiHRaM commented on September 25, 2024

Hey Codri - were you able to receive logging information from the core as well? I'm mostly interested in the errors, as currently they are ignored, but this might be a useful solution. (See #60)
Also, the CLA is no longer necessary. :)

from xi-win.

codri avatar codri commented on September 25, 2024

Hey @LiHRaM ,

No, I didn't wire it up for core. Only for requests/responses going from/into xi-win.
I was thinking about the whole state of xi logging, and tracing, as well as how to integrate with etw.
Here are a few notes/toughts:

  1. There already seems to be an effort to add logging to xi-editor. see xi-editor/xi-editor#408 but, this is not quite what etw can provide, since etw can be used for performance tracing and can be enabled/disabled on runtime, with it being zero cost when not enabled.
  2. The library mentioned above(rusttrace) does only string tracing for etw, which is not ideal, etw has the concept of structured logging, which is more flexible and performant. For example, for the xi-rpc method one can define an enum, and not collect redundant strings, which will impact perf test more than collecting an integer would.
  3. I've investigated using win32 rust bindings to do structured logging into etw. I guess it would end up looking a lot like lttng tracing client for rust https://docs.rs/lttng-ust-generate/0.1.1/lttng_ust_generate/
  4. LTTng and ETW are very similar conceptually, maybe it's worth making a structured logging/tracing library that uses ETW on Windows and LTTng on Linux. Not sure it makes sense respecting the log interface, as that is mainly for string logging.
  5. ETW has a series of modes to do logging, in one you specify a XML template(if I remember correctly) defining the schema of your logger, which is messy. There is another mode where you use system calls to register event schema on startup, and the client can ask the OS to get it for a certain process. The latter I think is the way to go.

So, long story short, ETW and LTTng are interesting pieces of technology, can be a great fit for high performance crossplatform tracing. But, I'm yet to make the thin wrapper library that can log into both.

from xi-win.

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.