mbox series

[v2,0/2] kernel-shark:add new plugin for xenomai cobalt_switch_context events

Message ID 20211222064014.4471-1-hongzhan.chen@intel.com (mailing list archive)
Headers show
Series kernel-shark:add new plugin for xenomai cobalt_switch_context events | expand

Message

Hongzhan Chen Dec. 22, 2021, 6:40 a.m. UTC
1. To avoid code duplication, move some common APIs and definitions
   out to create new files and share with other plugins.
2. add new plugin for handling xenomai cobalt_switch_context events
   to visualize OOB state of RT tasks.

I tried to move common APIs and definitions to KsPlugins.cpp/hpp but
found these definitions finally depend on KsMainWindow object used
by _doubleClick of LatencyBox assigned by plugin_set_gui_ptr via
KSHARK_MENU_PLUGIN_INITIALIZER. 
I do not know how to remove this dependency so I create new files to
avoid code duplication. Please suggest if there is better way. 

Hongzhan Chen (2):
  kernel-shark: Move common APIs and definitions out to avoid
    duplication
  kernel-shark: Add plugin for handling Xenomai cobalt_context_switch

 src/libkshark-tepdata.c                    |   1 +
 src/plugins/CMakeLists.txt                 |   6 +-
 src/plugins/CobaltSwitchEvents.cpp         | 125 +++++++++++++++
 src/plugins/CommonSched.hpp                |  99 ++++++++++++
 src/plugins/SchedEvents.cpp                |  87 +----------
 src/plugins/common_sched.c                 |  37 +++++
 src/plugins/common_sched.h                 |  50 ++++++
 src/plugins/sched_events.c                 |  37 +----
 src/plugins/sched_events.h                 |  12 +-
 src/plugins/xenomai_cobalt_switch_events.c | 169 +++++++++++++++++++++
 src/plugins/xenomai_cobalt_switch_events.h |  54 +++++++
 11 files changed, 545 insertions(+), 132 deletions(-)
 create mode 100644 src/plugins/CobaltSwitchEvents.cpp
 create mode 100644 src/plugins/CommonSched.hpp
 create mode 100644 src/plugins/common_sched.c
 create mode 100644 src/plugins/common_sched.h
 create mode 100644 src/plugins/xenomai_cobalt_switch_events.c
 create mode 100644 src/plugins/xenomai_cobalt_switch_events.h

Comments

Yordan Karadzhov Jan. 5, 2022, 11:32 a.m. UTC | #1
On 22.12.21 г. 8:40 ч., Hongzhan Chen wrote:
> 1. To avoid code duplication, move some common APIs and definitions
>     out to create new files and share with other plugins.
> 2. add new plugin for handling xenomai cobalt_switch_context events
>     to visualize OOB state of RT tasks.
> 
> I tried to move common APIs and definitions to KsPlugins.cpp/hpp but
> found these definitions finally depend on KsMainWindow object used
> by _doubleClick of LatencyBox assigned by plugin_set_gui_ptr via
> KSHARK_MENU_PLUGIN_INITIALIZER.
> I do not know how to remove this dependency so I create new files to
> avoid code duplication. Please suggest if there is better way.

Hi Hongzhan,

Indeed, this turns to be a bit trickier than I expected, but it is possible.
I will comment in the patch.

thanks,
Yordan

> 
> Hongzhan Chen (2):
>    kernel-shark: Move common APIs and definitions out to avoid
>      duplication
>    kernel-shark: Add plugin for handling Xenomai cobalt_context_switch
> 
>   src/libkshark-tepdata.c                    |   1 +
>   src/plugins/CMakeLists.txt                 |   6 +-
>   src/plugins/CobaltSwitchEvents.cpp         | 125 +++++++++++++++
>   src/plugins/CommonSched.hpp                |  99 ++++++++++++
>   src/plugins/SchedEvents.cpp                |  87 +----------
>   src/plugins/common_sched.c                 |  37 +++++
>   src/plugins/common_sched.h                 |  50 ++++++
>   src/plugins/sched_events.c                 |  37 +----
>   src/plugins/sched_events.h                 |  12 +-
>   src/plugins/xenomai_cobalt_switch_events.c | 169 +++++++++++++++++++++
>   src/plugins/xenomai_cobalt_switch_events.h |  54 +++++++
>   11 files changed, 545 insertions(+), 132 deletions(-)
>   create mode 100644 src/plugins/CobaltSwitchEvents.cpp
>   create mode 100644 src/plugins/CommonSched.hpp
>   create mode 100644 src/plugins/common_sched.c
>   create mode 100644 src/plugins/common_sched.h
>   create mode 100644 src/plugins/xenomai_cobalt_switch_events.c
>   create mode 100644 src/plugins/xenomai_cobalt_switch_events.h
>
Steven Rostedt Jan. 6, 2022, 5:18 p.m. UTC | #2
This was sent during the Christmas vacation. I don't want it to be
forgotten about.

Yordan, what's your thoughts on this?

-- Steve


On Wed, 22 Dec 2021 01:40:12 -0500
Hongzhan Chen <hongzhan.chen@intel.com> wrote:

> 1. To avoid code duplication, move some common APIs and definitions
>    out to create new files and share with other plugins.
> 2. add new plugin for handling xenomai cobalt_switch_context events
>    to visualize OOB state of RT tasks.
> 
> I tried to move common APIs and definitions to KsPlugins.cpp/hpp but
> found these definitions finally depend on KsMainWindow object used
> by _doubleClick of LatencyBox assigned by plugin_set_gui_ptr via
> KSHARK_MENU_PLUGIN_INITIALIZER. 
> I do not know how to remove this dependency so I create new files to
> avoid code duplication. Please suggest if there is better way. 
> 
> Hongzhan Chen (2):
>   kernel-shark: Move common APIs and definitions out to avoid
>     duplication
>   kernel-shark: Add plugin for handling Xenomai cobalt_context_switch
> 
>  src/libkshark-tepdata.c                    |   1 +
>  src/plugins/CMakeLists.txt                 |   6 +-
>  src/plugins/CobaltSwitchEvents.cpp         | 125 +++++++++++++++
>  src/plugins/CommonSched.hpp                |  99 ++++++++++++
>  src/plugins/SchedEvents.cpp                |  87 +----------
>  src/plugins/common_sched.c                 |  37 +++++
>  src/plugins/common_sched.h                 |  50 ++++++
>  src/plugins/sched_events.c                 |  37 +----
>  src/plugins/sched_events.h                 |  12 +-
>  src/plugins/xenomai_cobalt_switch_events.c | 169 +++++++++++++++++++++
>  src/plugins/xenomai_cobalt_switch_events.h |  54 +++++++
>  11 files changed, 545 insertions(+), 132 deletions(-)
>  create mode 100644 src/plugins/CobaltSwitchEvents.cpp
>  create mode 100644 src/plugins/CommonSched.hpp
>  create mode 100644 src/plugins/common_sched.c
>  create mode 100644 src/plugins/common_sched.h
>  create mode 100644 src/plugins/xenomai_cobalt_switch_events.c
>  create mode 100644 src/plugins/xenomai_cobalt_switch_events.h
>
Yordan Karadzhov Jan. 6, 2022, 5:32 p.m. UTC | #3
Hi Steven,
Happy New Year!

I already replayed, asking for some minor corrections.
https://lore.kernel.org/all/bb1741d5-600a-82a9-d8bc-91222400e129@gmail.com/
I think the plugin is almost ready.

BTW have you finished the renovation of your office? If yes, I will send you a review for your trace-cruncher patch.

cheers,
Yordan


On 6.01.22 г. 19:18 ч., Steven Rostedt wrote:
> 
> This was sent during the Christmas vacation. I don't want it to be
> forgotten about.
> 
> Yordan, what's your thoughts on this?
> 
> -- Steve
> 
> 
> On Wed, 22 Dec 2021 01:40:12 -0500
> Hongzhan Chen <hongzhan.chen@intel.com> wrote:
> 
>> 1. To avoid code duplication, move some common APIs and definitions
>>     out to create new files and share with other plugins.
>> 2. add new plugin for handling xenomai cobalt_switch_context events
>>     to visualize OOB state of RT tasks.
>>
>> I tried to move common APIs and definitions to KsPlugins.cpp/hpp but
>> found these definitions finally depend on KsMainWindow object used
>> by _doubleClick of LatencyBox assigned by plugin_set_gui_ptr via
>> KSHARK_MENU_PLUGIN_INITIALIZER.
>> I do not know how to remove this dependency so I create new files to
>> avoid code duplication. Please suggest if there is better way.
>>
>> Hongzhan Chen (2):
>>    kernel-shark: Move common APIs and definitions out to avoid
>>      duplication
>>    kernel-shark: Add plugin for handling Xenomai cobalt_context_switch
>>
>>   src/libkshark-tepdata.c                    |   1 +
>>   src/plugins/CMakeLists.txt                 |   6 +-
>>   src/plugins/CobaltSwitchEvents.cpp         | 125 +++++++++++++++
>>   src/plugins/CommonSched.hpp                |  99 ++++++++++++
>>   src/plugins/SchedEvents.cpp                |  87 +----------
>>   src/plugins/common_sched.c                 |  37 +++++
>>   src/plugins/common_sched.h                 |  50 ++++++
>>   src/plugins/sched_events.c                 |  37 +----
>>   src/plugins/sched_events.h                 |  12 +-
>>   src/plugins/xenomai_cobalt_switch_events.c | 169 +++++++++++++++++++++
>>   src/plugins/xenomai_cobalt_switch_events.h |  54 +++++++
>>   11 files changed, 545 insertions(+), 132 deletions(-)
>>   create mode 100644 src/plugins/CobaltSwitchEvents.cpp
>>   create mode 100644 src/plugins/CommonSched.hpp
>>   create mode 100644 src/plugins/common_sched.c
>>   create mode 100644 src/plugins/common_sched.h
>>   create mode 100644 src/plugins/xenomai_cobalt_switch_events.c
>>   create mode 100644 src/plugins/xenomai_cobalt_switch_events.h
>>
>
Steven Rostedt Jan. 6, 2022, 6:32 p.m. UTC | #4
On Thu, 6 Jan 2022 19:32:56 +0200
Yordan Karadzhov <y.karadz@gmail.com> wrote:

> Hi Steven,
> Happy New Year!

Happy New Year to you too Yordan!

> 
> I already replayed, asking for some minor corrections.
> https://lore.kernel.org/all/bb1741d5-600a-82a9-d8bc-91222400e129@gmail.com/
> I think the plugin is almost ready.

Strange, I didn't receive it. I wonder if I got booted from the email lists
because I had my mail server offline for too long (/me goes check).

> 
> BTW have you finished the renovation of your office? If yes, I will send you a review for your trace-cruncher patch.
>

Yes, I just finished. Now I'm trying to catch up on everything and also
work on some things that I may not be able to work on when I start working
again.

Cheers,

-- Steve