[Development] FW: Tracing for applications

Lukast dev lukast.dev at gmail.com
Mon Dec 9 22:05:28 CET 2019


> Now, since the minitrace example seems to target MSVC, may I ask if
> you tried Visual Studio performance analysis?

Yes, I also have experience with Intel VTune that works quite nicely.
There I enjoy flame graphs being done with this script from Intel VTune
output file:
https://github.com/brendangregg/FlameGraph/blob/master/stackcollapse-vtune.pl

But stack sampling sometimes sucks because you don't see if the function
was called million times and thus it shows up in the profile
or it is called once and is expensive and thus it shows up as hot spot.
That's the benefit of tracing where you see number of calls and also
can observe some meta data about the traced event like current memory
consumption or any other counter you are interested in.

Cheers









pi 6. 12. 2019 o 19:14 Arnaud Clère <arnaud.clere at moulinarso.fr> napísal(a):

> > -----Original Message-----
> > From: Milian Wolff <mail at milianw.de>
> >
> > On Mittwoch, 4. Dezember 2019 12:23:00 CET Lukast dev wrote:
> > > is there some Qt solution for producing traces used for performance
> > > analysis?
> > >
> > > There is on-going work for LTTNG and ETW in Qt I noticed, e.g. here
> > > https://codereview.qt-project.org/c/qt/qtbase/+/185287. Can that
> > > solution be re-used in Qt applications?
> > > If so, is there some documentation for this?
> >
> > We at KDAB are currently experimenting with this inside Qt itself.
> > As such, we aren't confident enough to publish what we have as public
> API yet.
> > That said, I would more than welcome more eyes on this.
> > There is no documentation other than the sources.
> > If you have any concrete questions, don't hesitate to ask.
>
> It looks to me like tracegen can indeed be used from inside users
> applications using the commit as an example.
> With tracegen, you define tracepoints in an external file that is
> translated to very efficient code that will output events with a few
> basic data and you insert these tracepoints at specific places in your
> code.
> It is designed for maximal throughput and minimal impact on
> performance, not really to instrument a lot of functions though.
>
> Minitrace seems rather different and more akin to QDebug traces, just,
> in a specific JSON format that can be consumed by chrome://tracing.
> You may be able to write a QMessageHandler achieving the same purpose.
> You will not be able to put integer event arguments as JSON number but
> only string.
> But at least you may be able to use QMessageLogContext file and line,
> or maybe function, to get a unique id that chrome://tracing can use to
> collate begin/end events.
> See the example below:
> https://doc.qt.io/qt-5/qtglobal.html#qInstallMessageHandler
> And minitrace event formatting here:
> https://github.com/hrydgard/minitrace/blob/master/minitrace.c#L302
>
> Now, since the minitrace example seems to target MSVC, may I ask if
> you tried Visual Studio performance analysis?
> It samples stack traces to provide a rough estimate of performance
> bottlenecks without having to modify the source code at all.
>
> Hope it helps,
> Arnaud
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20191209/92dfaa3b/attachment.html>


More information about the Development mailing list