mbox series

[RFC,0/2] Allow GUI plugins to build standalone

Message ID 20220119120229.68627-1-y.karadz@gmail.com (mailing list archive)
Headers show
Series Allow GUI plugins to build standalone | expand

Message

Yordan Karadzhov Jan. 19, 2022, 12:02 p.m. UTC
Hi Hongzhan and Jan,

I tried to build your plugin standalone and I realized that this is
in fact not possible due to some missing header files. This gets fixed
in the following patch-set. I also made some minor modifications in
the code of your plugin and will send you this modified version of
the plugin in a separate email. 

Please let me know if you find this modifications useful or not?

Cheers,
Yordan

Yordan Karadzhov (VMware) (2):
  kernel-shark: Add KsPluginsGUI.hpp/.cpp
  kernel-shark: Install missing headers

 src/CMakeLists.txt         | 12 ++++++++++++
 src/KsPluginsGUI.cpp       | 27 +++++++++++++++++++++++++++
 src/KsPluginsGUI.hpp       | 22 ++++++++++++++++++++++
 src/plugins/CMakeLists.txt |  4 ++++
 4 files changed, 65 insertions(+)
 create mode 100644 src/KsPluginsGUI.cpp
 create mode 100644 src/KsPluginsGUI.hpp

Comments

Yordan Karadzhov Jan. 19, 2022, 12:10 p.m. UTC | #1
And here is the version of the plugin that can build standalone. In order to load it just do:

kernelshark -p path/to/xenomai_cobalt_plugin/plugin-xenomai_cobalt_switch_events.so

You can also load it from the menus.
Note that I only tested that it builds and loads successfully but I have no data file that contains 'cobalt' events.

Cheers,
Yordan


On 19.01.22 г. 14:02 ч., Yordan Karadzhov (VMware) wrote:
> Hi Hongzhan and Jan,
> 
> I tried to build your plugin standalone and I realized that this is
> in fact not possible due to some missing header files. This gets fixed
> in the following patch-set. I also made some minor modifications in
> the code of your plugin and will send you this modified version of
> the plugin in a separate email.
> 
> Please let me know if you find this modifications useful or not?
> 
> Cheers,
> Yordan
> 
> Yordan Karadzhov (VMware) (2):
>    kernel-shark: Add KsPluginsGUI.hpp/.cpp
>    kernel-shark: Install missing headers
> 
>   src/CMakeLists.txt         | 12 ++++++++++++
>   src/KsPluginsGUI.cpp       | 27 +++++++++++++++++++++++++++
>   src/KsPluginsGUI.hpp       | 22 ++++++++++++++++++++++
>   src/plugins/CMakeLists.txt |  4 ++++
>   4 files changed, 65 insertions(+)
>   create mode 100644 src/KsPluginsGUI.cpp
>   create mode 100644 src/KsPluginsGUI.hpp
>
Hongzhan Chen Feb. 11, 2022, 5:03 a.m. UTC | #2
>-----Original Message-----
>From: Yordan Karadzhov <y.karadz@gmail.com> 
>Sent: Wednesday, January 19, 2022 8:10 PM
>To: linux-trace-devel@vger.kernel.org; Chen, Hongzhan <hongzhan.chen@intel.com>; Kiszka, Jan <jan.kiszka@siemens.com>
>Subject: Re: [RFC PATCH 0/2] Allow GUI plugins to build standalone
>
>And here is the version of the plugin that can build standalone. In order to load it just do:
>
>kernelshark -p path/to/xenomai_cobalt_plugin/plugin-xenomai_cobalt_switch_events.so
>
>You can also load it from the menus.
>Note that I only tested that it builds and loads successfully but I have no data file that contains 'cobalt' events.

Sorry for late response. It builds and loads successfully based on your patchset according to my test. It is really great
that we can build it standalone. It also visualize cobalt blue hollow box for xenomai OOB state correctly after run.
It is very useful.

But when I double click the box , kernel-shark quit abnormally with segmentation fault.

Following is backtrace info:

[Thread 0x7fffc084d700 (LWP 2064) exited]

Thread 1 "kernelshark" received signal SIGSEGV, Segmentation fault.
KsMainWindow::markEntry (this=0x0, e=0x7fffadf90f60, st=DualMarkerState::B) at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/KsUtils.hpp:229
229             ssize_t size() const {return _dataSize;}
(gdb) backtrace
#0  0x00007ffff7b91442 in KsMainWindow::markEntry(kshark_entry const*, DualMarkerState) (this=0x0, e=0x7fffadf90f60, st=DualMarkerState::B)
    at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/KsUtils.hpp:229
#1  0x00007fffc0876329 in XenomaiSwitchBox::_doubleClick() const (this=0x1c7ebc0) at CobaltSwitchEvents.cpp:43
#2  0x00007ffff5a2594f in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#3  0x00007ffff59e683c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#4  0x00007ffff59ee65f in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#5  0x00007ffff48dc8a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff59ed632 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
    at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7  0x00007ffff5a4015b in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8  0x00007ffff5a427ca in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007ffff59e683c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007ffff59ee104 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ffff48dc8a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007ffff522a780 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#13 0x00007ffff522c0b5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#14 0x00007ffff520333b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#15 0x00007fffed8ae260 in  () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#16 0x00007ffff13b7537 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff13b7770 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff13b77fc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007ffff493585f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ffff48da8da in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007ffff48e3984 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x0000000000402af5 in main (argc=<optimized out>, argv=<optimized out>) at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/kernelshark.cpp:154
#23 0x00007ffff369abf7 in __libc_start_main (main=
    0x402480 <main>, argc=1, argv=0x7fffffffdd18, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd08) at ../csu/libc-start.c:310
#24 0x0000000000402cfa in _start () at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/kernelshark.cpp:129
(gdb)

Regards

Hongzhan Chen
>
>Cheers,
>Yordan
>
>
>On 19.01.22 ?. 14:02 ?., Yordan Karadzhov (VMware) wrote:
>> Hi Hongzhan and Jan,
>> 
>> I tried to build your plugin standalone and I realized that this is
>> in fact not possible due to some missing header files. This gets fixed
>> in the following patch-set. I also made some minor modifications in
>> the code of your plugin and will send you this modified version of
>> the plugin in a separate email.
>> 
>> Please let me know if you find this modifications useful or not?
>> 
>> Cheers,
>> Yordan
>> 
>> Yordan Karadzhov (VMware) (2):
>>    kernel-shark: Add KsPluginsGUI.hpp/.cpp
>>    kernel-shark: Install missing headers
>> 
>>   src/CMakeLists.txt         | 12 ++++++++++++
>>   src/KsPluginsGUI.cpp       | 27 +++++++++++++++++++++++++++
>>   src/KsPluginsGUI.hpp       | 22 ++++++++++++++++++++++
>>   src/plugins/CMakeLists.txt |  4 ++++
>>   4 files changed, 65 insertions(+)
>>   create mode 100644 src/KsPluginsGUI.cpp
>>   create mode 100644 src/KsPluginsGUI.hpp
>>
Yordan Karadzhov Feb. 11, 2022, 12:30 p.m. UTC | #3
On 11.02.22 г. 7:03 ч., Chen, Hongzhan wrote:
> But when I double click the box , kernel-shark quit abnormally with segmentation fault.
> 
> Following is backtrace info:
> 
> [Thread 0x7fffc084d700 (LWP 2064) exited]
> 
> Thread 1 "kernelshark" received signal SIGSEGV, Segmentation fault.
> KsMainWindow::markEntry (this=0x0, e=0x7fffadf90f60, st=DualMarkerState::B) at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/KsUtils.hpp:229
> 229             ssize_t size() const {return _dataSize;}
> (gdb) backtrace
> #0  0x00007ffff7b91442 in KsMainWindow::markEntry(kshark_entry const*, DualMarkerState) (this=0x0, e=0x7fffadf90f60, st=DualMarkerState::B)
>      at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/KsUtils.hpp:229
> #1  0x00007fffc0876329 in XenomaiSwitchBox::_doubleClick() const (this=0x1c7ebc0) at CobaltSwitchEvents.cpp:43
> #2  0x00007ffff5a2594f in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #3  0x00007ffff59e683c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #4  0x00007ffff59ee65f in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #5  0x00007ffff48dc8a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
> #6  0x00007ffff59ed632 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
>      at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #7  0x00007ffff5a4015b in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #8  0x00007ffff5a427ca in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #9  0x00007ffff59e683c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #10 0x00007ffff59ee104 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #11 0x00007ffff48dc8a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
> #12 0x00007ffff522a780 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
> #13 0x00007ffff522c0b5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
> #14 0x00007ffff520333b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
> #15 0x00007fffed8ae260 in  () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
> #16 0x00007ffff13b7537 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
> #17 0x00007ffff13b7770 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
> #18 0x00007ffff13b77fc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
> #19 0x00007ffff493585f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
> #20 0x00007ffff48da8da in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
> #21 0x00007ffff48e3984 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
> #22 0x0000000000402af5 in main (argc=<optimized out>, argv=<optimized out>) at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/kernelshark.cpp:154
> #23 0x00007ffff369abf7 in __libc_start_main (main=
>      0x402480 <main>, argc=1, argv=0x7fffffffdd18, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd08) at ../csu/libc-start.c:310
> #24 0x0000000000402cfa in _start () at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/kernelshark.cpp:129
> (gdb)
> 

Hi Hongzhan,

I have an idea what can be the problem here.
Please try applying the attached patch and let me know if the double click works.

Thanks!
Yordan


> Regards
> 
> Hongzhan Chen
Hongzhan Chen Feb. 14, 2022, 1:19 a.m. UTC | #4
>
>
>-----Original Message-----
>From: Yordan Karadzhov <y.karadz@gmail.com> 
>Sent: Friday, February 11, 2022 8:30 PM
>To: Chen, Hongzhan <hongzhan.chen@intel.com>; linux-trace-devel@vger.kernel.org; Kiszka, Jan <jan.kiszka@siemens.com>
>Subject: Re: [RFC PATCH 0/2] Allow GUI plugins to build standalone
>
>
>
>On 11.02.22 ?. 7:03 ?., Chen, Hongzhan wrote:
>> But when I double click the box , kernel-shark quit abnormally with segmentation fault.
>> 
>> Following is backtrace info:
>> 
>> [Thread 0x7fffc084d700 (LWP 2064) exited]
>> 
>> Thread 1 "kernelshark" received signal SIGSEGV, Segmentation fault.
>> KsMainWindow::markEntry (this=0x0, e=0x7fffadf90f60, st=DualMarkerState::B) at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/KsUtils.hpp:229
>> 229             ssize_t size() const {return _dataSize;}
>> (gdb) backtrace
>> #0  0x00007ffff7b91442 in KsMainWindow::markEntry(kshark_entry const*, DualMarkerState) (this=0x0, e=0x7fffadf90f60, st=DualMarkerState::B)
>>      at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/KsUtils.hpp:229
>> #1  0x00007fffc0876329 in XenomaiSwitchBox::_doubleClick() const (this=0x1c7ebc0) at CobaltSwitchEvents.cpp:43
>> #2  0x00007ffff5a2594f in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
>> #3  0x00007ffff59e683c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
>> #4  0x00007ffff59ee65f in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
>> #5  0x00007ffff48dc8a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
>> #6  0x00007ffff59ed632 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
>>      at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
>> #7  0x00007ffff5a4015b in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
>> #8  0x00007ffff5a427ca in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
>> #9  0x00007ffff59e683c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
>> #10 0x00007ffff59ee104 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
>> #11 0x00007ffff48dc8a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
>> #12 0x00007ffff522a780 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
>> #13 0x00007ffff522c0b5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
>> #14 0x00007ffff520333b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
>> #15 0x00007fffed8ae260 in  () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
>> #16 0x00007ffff13b7537 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
>> #17 0x00007ffff13b7770 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
>> #18 0x00007ffff13b77fc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
>> #19 0x00007ffff493585f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
>> #20 0x00007ffff48da8da in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
>> #21 0x00007ffff48e3984 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
>> #22 0x0000000000402af5 in main (argc=<optimized out>, argv=<optimized out>) at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/kernelshark.cpp:154
>> #23 0x00007ffff369abf7 in __libc_start_main (main=
>>      0x402480 <main>, argc=1, argv=0x7fffffffdd18, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd08) at ../csu/libc-start.c:310
>> #24 0x0000000000402cfa in _start () at /home/intel/iotg/dovetail/kernelshark/kernel-shark/src/kernelshark.cpp:129
>> (gdb)
>> 
>
>Hi Hongzhan,
>
>I have an idea what can be the problem here.
>Please try applying the attached patch and let me know if the double click works.

The double click works after patching.  Appreciate your help.  Would you merge all the patches including the last patchset 
"Allow GUI plugins to build standalone" that you already merged it partially?

Regards

Hongzhan Chen

>
>Thanks!
>Yordan
>
>
>> Regards
>> 
>> Hongzhan Chen