[Development] QtCS 2017 logging/tracing session notes

Thiago Macieira thiago.macieira at intel.com
Tue Oct 10 16:28:13 CEST 2017

On Tuesday, 10 October 2017 15:12:52 CEST Christian Gagneraud wrote:
> On 10 October 2017 at 22:48, Thiago Macieira <thiago.macieira at intel.com> 
> > do not change qdebug but provide structured tracing as a new facility
> Any chance this can be made lock-free from a caller point of view?

No, we cannot provide a lock-free solution. There's a lot of global state that 
needs to be queried so I don't think there's a solution that won't involve a 

I'm talking about the implementation. User code should never need to use 

> (PS: I don't even know if qDebug streaming is lock-free and i'm
> interested to know the answer:))

It's not. There are mutexes inside.

> A lock-free callee site has the advantage of not influencing (much)
> multi-threading issues. Observing is disturbing as they say.

Which is why it's not going to be lock-free. Even printf has a lock.

> Could this "Structured logging" be it?
> I have as well investigated LTTng, but didn't like their userspace
> boiler plate. In the past, I used LTT in kernel mode and it was very
> simple (LTT was originally made for the Linux Kernel).  My (personal)
> conclusion is: if in userspace, better implement your own solution.

Not sure. I looked at the proposed LTTng support for Qt and though it looks 
interesting but didn't like the boilerplate either.

> Looking quickly at the code review, I can see that a very few qtbase
> source files have been patched, and a new tool has been added.

That's just proof of concept. The idea was to work on more tracepoints and 
more types after the base functionality got merged.

> Could this "Structured logging" provide something along the lines of
> event handler and event dispatcher profiling/tracing?

Possibly, I'm not sure. We concluded during the session we needed more 

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Development mailing list