On Tuesday 04 August 2015 21:41:47 Liang, Kan wrote:
> Hi Milian,
> 
> Is it possible to share your test case/steps with me?

Sure, I hope Qt is fine with you.

main.cpp:
~~~~~~~~~~~~~~~~~~~~~~
#include <QString>
#include <QTextStream>

int main()
{
    QStringList haystack;
    for (int i = 0; i < 1000; ++i) {
        haystack << QString::number(i);
    }

    uint matches = 0;
    for (int i = 0; i < 1000; ++i) {
        foreach (const QString &str, haystack) {
            if (str == "needle") {
                ++matches;
            }
        }
    }

    QTextStream out(stdout);
    out << "Matches: " << matches << endl;

    return 0;
}

~~~~~~~~~~~~~~~~~~~~~~

lbr.pro:
~~~~~~~~~~~~~~~~~~~~~~
TEMPLATE = app

SOURCES = main.cpp

CONFIG += release
QMAKE_CXXFLAGS += -g
~~~~~~~~~~~~~~~~~~~~~~

To build, put both into a folder and then do:

~~~~~~~~~~~~~~~~~~~~~~
mkdir build
cd build
qmake-qt5 ..
make
perf record --call-graph lbr ./lbr
perf report --stdio
~~~~~~~~~~~~~~~~~~~~~~

> Does --call-graph fp work?

No, I'm on a 64bit architecture, and most libs (esp. Qt) is built without 
framepointers. --call-graph dwarf does work though.

Bye
-- 
Milian Wolff
[email protected]
http://milianw.de
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to