This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Line numbers reported by pp() do not respond to the reality
- From: Tim Beaulen <tbscope at gmail dot com>
- To: systemtap at sources dot redhat dot com
- Date: Sun, 5 Sep 2010 12:08:53 +0200
- Subject: Line numbers reported by pp() do not respond to the reality
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.