From: Tim Beaulen <tbscope@gmail.com>
To: systemtap@sources.redhat.com
Subject: Line numbers reported by pp() do not respond to the reality
Date: Sun, 05 Sep 2010 10:09:00 -0000 [thread overview]
Message-ID: <AANLkTikQ-_YW2huZQJiHPmU8nmqUoSMcOQJLKNW5EuWD@mail.gmail.com> (raw)
When using the following script:
# --- testpp.stp ---
global calls
probe process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@*:*")
{
if (execname() == "src") {
calls[pp()] <<< 1;
}
}
probe end
{
printf("\n");
foreach (call in calls) {
printf("%s\n calls: %10d\n", call, @count(calls[call]));
}
}
# --------------------
And running it like this:
sudo stap ./testpp.stp
I get these results:
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:5024")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:5018")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:5011")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:5009")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:5004")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:5003")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:5002")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:5001")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:4998")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:4999")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:4996")
calls: 2000
process("/home/kdesystemtap/kdeinstall/lib/kde4/plugins/styles/oxygen.so").statement("drawScrollBarSliderControl@/home/kdesystemtap/kde/src/trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygenstyle.cpp:4995")
calls: 2000
As you can see, the line numbers start at 4995 and end at 5024.
The actual part of the .cpp file including the line numbers:
4947 bool Style::drawScrollBarSliderControl( const QStyleOption*
option, QPainter* painter, const QWidget* widget ) const
4948 {
4949
4950 // cast option and check
4951 const QStyleOptionSlider *slider = qstyleoption_cast<const
QStyleOptionSlider *>( option );
4952 if( !slider ) return true;
4953
4954 const QRect& r( option->rect );
4955 const QPalette& palette( option->palette );
4956
4957 const State& flags( option->state );
4958 const bool horizontal( flags & State_Horizontal );
4959 const bool enabled( flags&State_Enabled );
4960 const bool mouseOver( enabled && (flags&State_MouseOver) );
4961
4962 // enable animation state
4963 animations().scrollBarEngine().updateState( widget,
enabled && slider && (slider->activeSubControls & SC_ScrollBarSlider)
);
4964
4965 const bool animated( enabled &&
animations().scrollBarEngine().isAnimated( widget, SC_ScrollBarSlider
) );
4966
4967 if( horizontal )
4968 {
4969 if( animated ) renderScrollBarHandle( painter, r,
palette, Qt::Horizontal, mouseOver,
animations().scrollBarEngine().opacity( widget, SC_ScrollBarSlider )
);
4970 else renderScrollBarHandle( painter, r, palette,
Qt::Horizontal, mouseOver );
4971
4972 } else {
4973
4974 if( animated ) renderScrollBarHandle( painter, r,
palette, Qt::Vertical, mouseOver,
animations().scrollBarEngine().opacity( widget, SC_ScrollBarSlider )
);
4975 else renderScrollBarHandle( painter, r, palette,
Qt::Vertical, mouseOver );
4976
4977 }
4978
4979 return true;
4980 }
As you can see, the line numbers differ. Why is that? Maybe I don not
understand the line numbers reported by pp().
I was hoping to make some sort of automatic report generator that
would be able to parse the correct line from the source file, but this
difference makes this impossible.
I am using Systemtap 1.2.
next reply other threads:[~2010-09-05 10:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-05 10:09 Tim Beaulen [this message]
2010-09-05 13:08 ` Frank Ch. Eigler
2010-09-05 18:11 ` Tim Beaulen
[not found] ` <AANLkTi=PcchooJZCTkurLpYsWEhGwc=kdsdXmJ=F3bkq@mail.gmail.com>
2010-09-05 18:39 ` Tim Beaulen
2010-09-06 7:59 ` Tim Beaulen
2010-09-06 12:18 ` Frank Ch. Eigler
2010-09-12 8:26 ` Tim Beaulen
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=AANLkTikQ-_YW2huZQJiHPmU8nmqUoSMcOQJLKNW5EuWD@mail.gmail.com \
--to=tbscope@gmail.com \
--cc=systemtap@sources.redhat.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).