linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Milian Wolff <mail@milianw.de>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	"linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>
Subject: Re: Haswell LBR call stacks - broken
Date: Wed, 05 Aug 2015 11:02:55 +0200	[thread overview]
Message-ID: <1789536.mnTOPtGhsS@milian-kdab2> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F077018D21C6@SHSMSX103.ccr.corp.intel.com>

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
mail@milianw.de
http://milianw.de

      reply	other threads:[~2015-08-05  9:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 11:02 Haswell LBR call stacks Milian Wolff
2015-08-04 17:24 ` Haswell LBR call stacks - broken Milian Wolff
2015-08-04 18:10   ` Andi Kleen
2015-08-04 21:41     ` Liang, Kan
2015-08-05  9:02       ` Milian Wolff [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1789536.mnTOPtGhsS@milian-kdab2 \
    --to=mail@milianw.de \
    --cc=andi@firstfloor.org \
    --cc=kan.liang@intel.com \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).